| | |
| | | |
| | | <el-table v-loading="loading" :data="pointList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="点位类型" align="center" prop="pointType" /> |
| | | <el-table-column label="标签" align="center" prop="tag" > |
| | | <span>{{important}}</span> |
| | | <el-table-column label="点位名称" prop="pointName" width="200"/> |
| | | <el-table-column label="标签" align="center" width="90"> |
| | | <template slot-scope="scope"> |
| | | <dict-tag :options="dict.type.point_tag" :value="scope.row.pointTags"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="点位开始时间" align="center" prop="startTime" width="180"> |
| | | <template slot-scope="scope"> |
| | |
| | | </el-table-column> |
| | | <el-table-column label="运维状态" align="center" prop="status" /> |
| | | <el-table-column label="备注" align="center" prop="remark" /> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | |
| | | <el-form-item label="点位名称" prop="pointName"> |
| | | <el-input v-model="form.pointName" placeholder="请输入点位名称" /> |
| | | </el-form-item> |
| | | <el-form-item label="点位标签" prop="tag"> |
| | | <el-select v-model="form.tag" placeholder="点位标签"> |
| | | <el-option label="普通点位" value="普通点位"/> |
| | | <el-option label="重点点位" value="重点点位"/> |
| | | <el-form-item label="点位标签" prop="pointTag"> |
| | | <el-select v-model="form.pointTag" placeholder="点位标签" multiple clearable> |
| | | <el-option |
| | | v-for="dict in dict.type.point_tag" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="点位所在地" prop="region"> |
| | | <el-cascader v-model="form.region" :options="regionList" placeholder="点位所在地" :props="props" collapse-tags></el-cascader> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="点位所在地" prop="region">--> |
| | | <!-- <el-cascader v-model="form.region" :options="regionList" placeholder="点位所在地" :props="props" collapse-tags></el-cascader>--> |
| | | <!-- </el-form-item>--> |
| | | <el-form-item label="设备类型" prop="category"> |
| | | <el-select v-model="form.category" placeholder="设备类型"> |
| | | <el-option label="人脸识别" value="2"/> |
| | |
| | | <el-option label="车辆监控" value="3"/> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="监管部门" prop="category"> |
| | | <el-select v-model="form.deptName" placeholder="监管部门"> |
| | | <el-option label="省厅" value="省厅"/> |
| | | <el-option label="自贡荣县公安局" value="自贡荣县公安局"/> |
| | | <el-option label="自贡富顺公安局" value="自贡富顺公安局"/> |
| | | </el-select> |
| | | <el-form-item label="监管部门" prop="deptId"> |
| | | <el-cascader |
| | | v-model="form.deptId" |
| | | :options="deptOptions" |
| | | :show-all-levels="false" |
| | | clearable :props="{ checkStrictly: true }" |
| | | > |
| | | </el-cascader> |
| | | </el-form-item> |
| | | <el-form-item label="运维单位" prop="unitId"> |
| | | <el-select v-model="form.unitId" placeholder="运维单位"> |
| | |
| | | <script> |
| | | import { listPoint, getPoint, delPoint, addPoint, batchEdit, updatePoint } from "@/api/platform/point"; |
| | | import { unitSelect } from "@/api/platform/unit"; |
| | | import { getCascader } from '../../../api/platform/region' |
| | | import { getCascader } from '@/api/platform/region' |
| | | import { cascader } from '@/api/system/dept' |
| | | |
| | | export default { |
| | | name: "Point", |
| | | dicts: ['point_tag'], |
| | | data() { |
| | | return { |
| | | deptOptions: [], |
| | | // 批量修改表单 |
| | | batchEditForm: { |
| | | ids: [], |
| | |
| | | editingIndex: null, |
| | | // 遮罩层 |
| | | loading: true, |
| | | important: '重点点位', |
| | | // 选中数组 |
| | | ids: [], |
| | | // 非单个禁用 |
| | |
| | | pointName: [ |
| | | { required: true, message: "点位名称不能为空", trigger: "blur" } |
| | | ], |
| | | region: [ |
| | | { required: true, message: "点位所在地不能为空", trigger: "change" } |
| | | pointTag: [ |
| | | { required: true, message: "点位标签不能为空", trigger: "change" } |
| | | ], |
| | | deptName: [ |
| | | deptId: [ |
| | | { required: true, message: "监管部门不能为空", trigger: "change" } |
| | | ], |
| | | category: [ |
| | |
| | | created() { |
| | | this.getList(); |
| | | this.getUnitSelect(); |
| | | this.getCascader(); |
| | | // this.getCascader(); |
| | | this.getDeptCascader(); |
| | | }, |
| | | methods: { |
| | | // 点位导入 |
| | |
| | | getCascader() { |
| | | getCascader().then(res => { |
| | | this.regionList = res.data; |
| | | }) |
| | | }, |
| | | // 获取部门级联 |
| | | getDeptCascader() { |
| | | cascader().then(res => { |
| | | this.deptOptions = res.data; |
| | | }) |
| | | }, |
| | | // 点位项修改完成 |
| | |
| | | startTime: null, |
| | | endTime: null, |
| | | unitId: null, |
| | | deptId: [], |
| | | status: null, |
| | | remark: null, |
| | | createTime: null, |
| | | updateTime: null, |
| | | deleted: null, |
| | | pointDetail: "" |
| | | pointTag: [] |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | |
| | | const id = row.id || this.ids |
| | | getPoint(id).then(response => { |
| | | this.form = response.data; |
| | | this.form.pointTag = response.data.pointTags; |
| | | this.form.deptId = response.data.deptIds |
| | | this.form.timezone = [this.form.startTime, this.form.endTime] |
| | | if (this.form.pointDetail) { |
| | | this.tempFormList = JSON.parse(this.form.pointDetail) |
| | | } |
| | | this.form.category = this.form.category + '' |
| | | this.open = true; |
| | | this.title = "修改运维点位"; |
| | | }); |
| | | }, |
| | | /** 提交按钮 */ |
| | | submitForm() { |
| | | if (this.tempFormList) { |
| | | this.form.pointDetail = JSON.stringify(this.tempFormList) |
| | | } |
| | | if (this.form.id != null) { |
| | | updatePoint(this.form).then(response => { |
| | | this.$modal.msgSuccess("修改成功"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } else { |
| | | addPoint(this.form).then(response => { |
| | | this.$modal.msgSuccess("新增成功"); |
| | | this.open = false; |
| | | this.reset() |
| | | this.getList(); |
| | | }); |
| | | } |
| | | this.$refs['form'].validate(valid => { |
| | | if(valid) { |
| | | if (this.form.deptId && this.form.deptId.length > 0) { |
| | | this.form.deptId = this.form.deptId[this.form.deptId.length - 1] |
| | | } |
| | | let category = JSON.parse(JSON.stringify(this.form.category)); |
| | | this.form.category = parseInt(category) |
| | | if (this.form.id != null) { |
| | | updatePoint(this.form).then(response => { |
| | | this.$modal.msgSuccess("修改成功"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } else { |
| | | addPoint(this.form).then(response => { |
| | | this.$modal.msgSuccess("新增成功"); |
| | | this.open = false; |
| | | this.reset() |
| | | this.getList(); |
| | | }); |
| | | } |
| | | } else { |
| | | console.log("error") |
| | | } |
| | | }) |
| | | }, |
| | | /** 删除按钮操作 */ |
| | | handleDelete(row) { |