| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div class="construction-view"> |
| | | <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="NVR" prop="nvrId"> |
| | | <nvr v-model="queryParams.nvrId" :schoolId="schoolId"></nvr> |
| | |
| | | </el-form-item> |
| | | <el-form-item label="型号" prop="model"> |
| | | <el-input |
| | | v-model="queryParams.model" |
| | | placeholder="请输入型号" |
| | | @keyup.enter.native="handleQuery" |
| | | v-model="queryParams.model" |
| | | placeholder="请输入型号" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['oa:ipc:add']" |
| | | >新增</el-button> |
| | | type="primary" |
| | | plain |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['oa:ipc:add']" |
| | | >新增 |
| | | </el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="el-icon-edit" |
| | | size="mini" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['oa:ipc:edit']" |
| | | >修改</el-button> |
| | | type="success" |
| | | plain |
| | | icon="el-icon-edit" |
| | | size="mini" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['oa:ipc:edit']" |
| | | >修改 |
| | | </el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="el-icon-delete" |
| | | size="mini" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['oa:ipc:remove']" |
| | | >删除</el-button> |
| | | type="danger" |
| | | plain |
| | | icon="el-icon-delete" |
| | | size="mini" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['oa:ipc:remove']" |
| | | >删除 |
| | | </el-button> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" :data="ipcList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column type="selection" width="55" align="center"/> |
| | | <el-table-column label="序号" align="center" width="50"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.$index + (queryParams.pageNum - 1) * queryParams.pageSize + 1 }} </span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="MAC" align="center" prop="mac" /> |
| | | <el-table-column label="IP" align="center" prop="ip" /> |
| | | <el-table-column label="端口" align="center" prop="port" /> |
| | | <el-table-column label="登录账户" align="center" prop="loginAccount" /> |
| | | <el-table-column label="NVR" align="center" prop="nvrId_dictText" /> |
| | | <el-table-column label="通道" align="center" prop="passageway_dictText" /> |
| | | <el-table-column label="安装位置" align="center" prop="buildingId_dictText" /> |
| | | <el-table-column label="所属单位" align="center" prop="organizationId_dictText" /> |
| | | <el-table-column label="施工批次" align="center" prop="constructionBatchId_dictText" /> |
| | | <!-- <el-table-column label="序列号" align="center" prop="serialNumber" />--> |
| | | <!-- <el-table-column label="型号" align="center" prop="model" />--> |
| | | <!-- <el-table-column label="生产厂商" align="center" prop="manufacturerId_dictText" />--> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <el-table-column label="MAC" min-width="150" align="center" prop="mac"/> |
| | | <el-table-column label="IP" width="130" align="center" prop="ip"/> |
| | | <el-table-column label="端口" width="80" align="center" prop="port"/> |
| | | <el-table-column label="登录账户" min-width="120" align="center" prop="loginAccount"/> |
| | | <el-table-column label="NVR" align="center" prop="nvrId_dictText"> |
| | | <template slot-scope="scope"> |
| | | <el-link type="primary" @click="nvrClick(scope.row)">{{ scope.row.nvrId_dictText }}</el-link> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="通道" align="center" prop="passageway_dictText"/> |
| | | <el-table-column label="安装位置" min-width="240" align="center" prop="buildingId_dictText"/> |
| | | <el-table-column label="所属单位" min-width="200" align="center" prop="organizationId_dictText"/> |
| | | <el-table-column label="施工批次" min-width="120" align="center" prop="constructionBatchId_dictText"/> |
| | | <el-table-column label="序列号" align="center" prop="serialNumber"/> |
| | | <el-table-column label="型号" align="center" prop="model"/> |
| | | <el-table-column label="生产厂商" align="center" prop="manufacturerId_dictText"/> |
| | | <el-table-column label="操作" align="center" fixed="right" width="180" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['oa:ipc:edit']" |
| | | >修改</el-button> |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-view" |
| | | @click="handleInfo(scope.row)" |
| | | >查看 |
| | | </el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | class="del-btn" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['oa:ipc:remove']" |
| | | >删除</el-button> |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['oa:ipc:edit']" |
| | | >修改 |
| | | </el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | class="del-btn" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['oa:ipc:remove']" |
| | | >删除 |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total>0" |
| | | :total="total" |
| | | :page.sync="queryParams.pageNum" |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getList" |
| | | v-show="total>0" |
| | | :total="total" |
| | | :page.sync="queryParams.pageNum" |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | |
| | | <!-- 添加或修改ipc设备对话框 --> |
| | | <el-dialog :title="title" :visible.sync="open" width="700px" :append-to-body="true" :close-on-click-modal="false" :destroy-on-close="true"> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
| | | <el-dialog :title="title" :visible.sync="open" width="900px" :append-to-body="true" :close-on-click-modal="false" |
| | | :destroy-on-close="true"> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px" :disabled="disabled"> |
| | | <el-row> |
| | | <el-col :span="9"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="MAC" prop="mac"> |
| | | <el-input v-model="form.mac" placeholder="请输入MAC" /> |
| | | <el-input v-model="form.mac" placeholder="请输入MAC"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="9"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="IP" prop="ip"> |
| | | <el-input v-model="form.ip" placeholder="请输入IP" /> |
| | | <el-input v-model="form.ip" placeholder="请输入IP"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="端口" prop="port"> |
| | | <el-input-number v-model="form.port" controls-position="right" :min="0" :max="65535"/> |
| | | </el-form-item> |
| | |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="nvr" prop="nvrId"> |
| | | <nvr v-if="open" v-model="form.nvrId" :schoolId="schoolId"></nvr> |
| | | <nvr v-if="open" v-model="form.nvrId" :schoolId="schoolId"></nvr> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | </el-row> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button> |
| | | <el-button :loading="buttonLoading" :disabled="disabled" type="primary" @click="copy">复制上一条信息</el-button> |
| | | <el-button :loading="buttonLoading" :disabled="disabled" type="primary" @click="submitForm">确 定</el-button> |
| | | <el-button @click="cancel">取 消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | | <!-- 服务器 --> |
| | | <Dialog title="服务器" :visible.sync="nvrOpen" width="700px" :append-to-body="true" :destroy-on-close="true"> |
| | | <nvr-form v-if="nvrOpen" :nvrId="nvrId"></nvr-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="nvrOpen = false">关 闭</el-button> |
| | | </div> |
| | | </Dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { listIpc, getIpc, delIpc, addIpc, updateIpc } from "@/api/oa/ipc"; |
| | | import {listIpc, getIpc, delIpc, addIpc, updateIpc, getCopyIpc} from "@/api/oa/ipc"; |
| | | import building from "../../components/building"; |
| | | import organization from "../../components/organization"; |
| | | import constructionBatch from "../../components/constructionBatch"; |
| | | import manufacturer from "../../components/manufacturer"; |
| | | import nvr from '../../components/nvr' |
| | | import nvrForm from '../../components/nvr/form' |
| | | |
| | | export default { |
| | | name: "Ipc", |
| | |
| | | organization, |
| | | constructionBatch, |
| | | manufacturer, |
| | | nvr |
| | | nvr, |
| | | nvrForm |
| | | }, |
| | | props: { |
| | | schoolId: { |
| | |
| | | // 表单校验 |
| | | rules: { |
| | | id: [ |
| | | { required: true, message: "不能为空", trigger: "blur" } |
| | | {required: true, message: "不能为空", trigger: "blur"} |
| | | ], |
| | | mac: [ |
| | | { required: true, message: "mac不能为空", trigger: "blur" }, |
| | | {required: true, message: "mac不能为空", trigger: "blur"}, |
| | | { |
| | | pattern: /^[A-F0-9]{2}(-[A-F0-9]{2}){5}$|^[A-F0-9]{2}(:[A-F0-9]{2}){5}$|^[A-F0-9]{12}$|^[A-F0-9]{4}(\.[A-F0-9]{4}){2}$/, |
| | | message: "请输入正确的MAC", |
| | | message: "请输入正确的MAC,文本范围 0~9、a~f、A~F、:", |
| | | trigger: "blur" |
| | | } |
| | | ], |
| | | ip: [ |
| | | { required: true, message: "IP不能为空", trigger: "blur" }, |
| | | {required: true, message: "IP不能为空", trigger: "blur"}, |
| | | { |
| | | pattern: /^(\d|[1-9]\d|1\d{2}|2[0-5][0-5])\.(\d|[1-9]\d|1\d{2}|2[0-5][0-5])\.(\d|[1-9]\d|1\d{2}|2[0-5][0-5])\.(\d|[1-9]\d|1\d{2}|2[0-5][0-5])$/, |
| | | message: "请输入正确的ip地址", |
| | | message: "请输入正确的ip地址,文本范围 0~9、.", |
| | | trigger: "blur" |
| | | } |
| | | ], |
| | | port: [ |
| | | { required: true, message: "端口不能为空", trigger: "blur" } |
| | | {required: true, message: "端口不能为空", trigger: "blur"} |
| | | ], |
| | | loginAccount: [ |
| | | { required: true, message: "登录账户不能为空", trigger: "blur" } |
| | | {required: true, message: "登录账户不能为空", trigger: "blur"} |
| | | ], |
| | | buildingId: [ |
| | | { required: true, message: "安装位置不能为空", trigger: "blur" } |
| | | {required: true, message: "安装位置不能为空", trigger: "blur"} |
| | | ], |
| | | organizationId: [ |
| | | { required: true, message: "所属单位不能为空", trigger: "blur" } |
| | | {required: true, message: "所属单位不能为空", trigger: "blur"} |
| | | ], |
| | | constructionBatchId: [ |
| | | { required: true, message: "施工批次不能为空", trigger: "blur" } |
| | | {required: true, message: "施工批次不能为空", trigger: "blur"} |
| | | ], |
| | | } |
| | | passageway: [] |
| | | }, |
| | | disabled: false, |
| | | nvrOpen: false, |
| | | nvrId: undefined |
| | | }; |
| | | }, |
| | | computed: { |
| | | getNvrId() { |
| | | return this.form.nvrId |
| | | } |
| | | }, |
| | | watch: { |
| | | 'schoolId': function () { |
| | | this.getList() |
| | | }, |
| | | getNvrId: function (v) { |
| | | if (v) { |
| | | this.rules.passageway = [{required: true, message: "通道不能为空", trigger: "blur"}] |
| | | } else { |
| | | this.rules.passageway = [] |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | // 多选框选中数据 |
| | | handleSelectionChange(selection) { |
| | | this.ids = selection.map(item => item.id) |
| | | this.single = selection.length!==1 |
| | | this.single = selection.length !== 1 |
| | | this.multiple = !selection.length |
| | | }, |
| | | /** 新增按钮操作 */ |
| | | handleAdd() { |
| | | this.reset(); |
| | | this.disabled = false; |
| | | this.open = true; |
| | | this.title = "添加ipc设备"; |
| | | this.title = "添加IPC设备"; |
| | | }, |
| | | /** 修改按钮操作 */ |
| | | handleUpdate(row) { |
| | | handleInfo(row) { |
| | | this.loading = true; |
| | | this.disabled = true; |
| | | this.reset(); |
| | | const id = row.id || this.ids |
| | | getIpc(id).then(response => { |
| | | this.loading = false; |
| | | this.form = response.data; |
| | | this.open = true; |
| | | this.title = "修改ipc设备"; |
| | | this.title = "IPC设备详情"; |
| | | }); |
| | | }, |
| | | /** 修改按钮操作 */ |
| | | handleUpdate(row) { |
| | | this.loading = true; |
| | | this.disabled = false; |
| | | this.reset(); |
| | | const id = row.id || this.ids |
| | | getIpc(id).then(response => { |
| | | this.loading = false; |
| | | this.form = response.data; |
| | | this.open = true; |
| | | this.title = "修改IPC设备"; |
| | | }); |
| | | }, |
| | | /** 提交按钮 */ |
| | |
| | | } |
| | | }); |
| | | }, |
| | | copy() { |
| | | this.buttonLoading = true; |
| | | getCopyIpc().then(res => { |
| | | const obj = res.data; |
| | | // 编辑 |
| | | if (this.form.id) { |
| | | obj.id = this.form.id; |
| | | } |
| | | // 新增 |
| | | else { |
| | | obj.id = undefined; |
| | | } |
| | | this.form = this.shallowCopy(obj); |
| | | this.$modal.msgSuccess("修改成功"); |
| | | }).finally(() => { |
| | | this.buttonLoading = false; |
| | | }); |
| | | }, |
| | | shallowCopy(src) { |
| | | var dst = {}; |
| | | for (var prop in src) { |
| | | if (src.hasOwnProperty(prop)) { |
| | | dst[prop] = src[prop]; |
| | | } |
| | | } |
| | | return dst; |
| | | }, |
| | | /** 删除按钮操作 */ |
| | | handleDelete(row) { |
| | | const ids = row.id || this.ids; |
| | | this.$modal.confirm('是否确认删除ipc设备编号为"' + ids + '"的数据项?').then(() => { |
| | | this.$modal.confirm('是否确认删除?').then(() => { |
| | | this.loading = true; |
| | | return delIpc(ids); |
| | | }).then(() => { |
| | |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | /** 导出按钮操作 */ |
| | | handleExport() { |
| | | this.download('oa/ipc/export', { |
| | | ...this.queryParams |
| | | }, `ipc_${new Date().getTime()}.xlsx`) |
| | | nvrClick(row) { |
| | | this.nvrId = row.nvrId; |
| | | this.nvrOpen = true; |
| | | } |
| | | } |
| | | }; |