{"remainingRequest":"D:\\jenkins\\workspace\\sfz-lh-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\sfz-lh-fvue\\src\\views\\Normal\\DeviceManagement\\controDevice.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\sfz-lh-fvue\\src\\views\\Normal\\DeviceManagement\\controDevice.vue","mtime":1704418079228},{"path":"D:\\jenkins\\workspace\\sfz-lh-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\sfz-lh-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\sfz-lh-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\r\nimport pagination from '@/components/pagination'\r\nimport {TableMixin} from '@/mixins/tableMixin'\r\nimport tollStationManagement from '@/api/BasicDataManagement/tollStationManagement.js'\r\nimport device from '@/api/DeviceManagement/device.js'\r\nexport default {\r\n name: 'controDevice',\r\n mixins: [TableMixin, pagination],\r\n data() {\r\n return {\r\n disabledDetils: false,\r\n currentPage: 1,\r\n tableMaxHeight: 400,\r\n loading: false,\r\n tableLoading: false,\r\n tableData: [],\r\n multipleSelection: [],\r\n params: {\r\n pageBean: {\r\n page: 1,\r\n pageSize: 20,\r\n total: 0,\r\n },\r\n },\r\n searchForm: {}, // 顶部搜索对象\r\n tollStationData: [],\r\n tollStationId: '',\r\n value: '',\r\n allData: {\r\n pageBean: {\r\n page: 1,\r\n pageSize: -1,\r\n total: 0,\r\n },\r\n },\r\n deviceData: [],\r\n dialog: {\r\n title: '添加',\r\n visible: false,\r\n },\r\n deleteIds: '', // 是否选中列表解锁删除按钮\r\n dialog: {\r\n title: '添加',\r\n visible: false,\r\n },\r\n dialogForm: {},\r\n disabled: false, // 是否禁止输入输入\r\n edit: false, // 是否是修改功能\r\n rules: {\r\n deviceName: {\r\n required: true,\r\n message: '请输入路线编号',\r\n trigger: 'blur',\r\n },\r\n showContext: {\r\n required: true,\r\n message: '请选择路线名称',\r\n trigger: 'blur',\r\n },\r\n },\r\n }\r\n },\r\n created() {\r\n this.tollStationId = sessionStorage.getItem('tollStationId')\r\n this.searchForm.tollStationId = this.tollStationId\r\n this.loadTollStation()\r\n this.getDeviceControl(1)\r\n this.loadDeviceData()\r\n },\r\n methods: {\r\n // 获取设备控制数据\r\n getDeviceControl(page) {\r\n if (page) this.params.pageBean.page = page\r\n this.tableLoading = true\r\n device.queryDeviceControl(this.params).then((res) => {\r\n this.tableLoading = false\r\n let data = res.data.value\r\n this.tableData = data.rows || []\r\n if (data.page) {\r\n this.params.pageBean = {\r\n page: data.page,\r\n pageSize: data.pageSize,\r\n total: data.total,\r\n }\r\n }\r\n this.params.querys = []\r\n })\r\n },\r\n //获取设备数据\r\n loadDeviceData() {\r\n this.deviceData = []\r\n device.queryDeviceList(this.allData).then((res) => {\r\n for (let i = 0; i < res.value.rows.length; i++) {\r\n let obj = []\r\n if (res.value.rows[i].isController == 1) {\r\n obj = {\r\n code: res.value.rows[i].code,\r\n name: res.value.rows[i].name,\r\n tollStationName: res.value.rows[i].tollStationName,\r\n tollStationId: res.value.rows[i].tollStationId,\r\n isController: res.value.rows[i].isController,\r\n positionPathName: res.value.rows[i].positionPathName,\r\n }\r\n this.deviceData.push(obj)\r\n }\r\n }\r\n })\r\n },\r\n // 获取收费站数据\r\n loadTollStation() {\r\n tollStationManagement.queryTollStation(this.allData).then((res) => {\r\n let obj = []\r\n for (let i = 0; i < res.data.rows.length; i++) {\r\n obj = {\r\n id: res.data.rows[i].id,\r\n name: res.data.rows[i].name,\r\n roadName: res.data.rows[i].roadSegmentName,\r\n roadId: res.data.rows[i].roadSegmentId,\r\n }\r\n this.tollStationData.push(obj)\r\n }\r\n })\r\n },\r\n // 弹层关闭\r\n handleDialogClose() {\r\n this.dialog.visible = false\r\n },\r\n //添加\r\n handleAdd() {\r\n this.edit = false\r\n this.disabledDetils = false\r\n this.dialogForm = {}\r\n this.dialog.title = '添加'\r\n this.dialog.visible = true\r\n },\r\n // 编辑\r\n handleEdit(rows) {\r\n this.$refs.form.clearValidate()\r\n this.edit = true\r\n this.disabledDetils = false\r\n this.dialogForm = rows || {}\r\n this.dialogForm = {\r\n ...rows,\r\n }\r\n this.dialog.title = '编辑'\r\n this.dialog.visible = true\r\n },\r\n // 顶部搜索\r\n handleSearch() {\r\n let obj = this.searchForm\r\n let querys = []\r\n for (let i in obj) {\r\n if (obj[i]) {\r\n querys.push({\r\n group: 'main',\r\n operation:\r\n i == 'tollStationId' || i == 'deviceName' ? 'LIKE' : 'EQUAL',\r\n parentGroup: '',\r\n property: i,\r\n relation: 'AND',\r\n value: obj[i],\r\n })\r\n }\r\n }\r\n this.params.querys = querys\r\n this.getDeviceControl(1)\r\n },\r\n // 表单提交保存\r\n submit() {\r\n for (let i = 0; i < this.deviceData.length; i++) {\r\n if (this.dialogForm.deviceName == this.deviceData[i].name) {\r\n this.dialogForm.deviceCode = this.deviceData[i].code\r\n this.dialogForm.tollStationName = this.deviceData[i].tollStationName\r\n this.dialogForm.isController = this.deviceData[i].isController\r\n this.dialogForm.positionPathName = this.deviceData[i].positionPathName\r\n this.dialogForm.tollStationId = this.deviceData[i].tollStationId\r\n }\r\n }\r\n this.$refs.form.validate((valid) => {\r\n if (valid) {\r\n this.loading = true\r\n device\r\n .addDeviceControl(this.dialogForm)\r\n .then((res) => {\r\n if (res.data.state) {\r\n this.dialog.visible = false\r\n this.getDeviceControl(1)\r\n }\r\n if (!res.errorMsg) {\r\n this.$message({\r\n message: !this.edit ? '添加成功' : '修改成功',\r\n type: 'success',\r\n })\r\n this.editVisible = false\r\n }\r\n this.loading = false\r\n })\r\n .catch(() => {\r\n this.loading = false\r\n })\r\n } else {\r\n return false\r\n }\r\n })\r\n },\r\n // 删除\r\n handleDelete() {\r\n this.$confirm(this.$t('common.sureDelete'), this.$t('common.tips'), {\r\n confirmButtonText: this.$t('common.confirm'),\r\n cancelButtonText: this.$t('common.cancel'),\r\n type: 'warning',\r\n }).then(() => {\r\n device.batchControlDelete(this.deleteIds).then((res) => {\r\n this.getDeviceControl(1)\r\n if (!res.errorMsg) {\r\n this.$message({\r\n message: '删除成功',\r\n type: 'success',\r\n })\r\n }\r\n })\r\n })\r\n },\r\n },\r\n\r\n mounted() {\r\n this.calcTableHeight()\r\n this.$root.$on('resize', () => {\r\n this.calcTableHeight(500)\r\n })\r\n },\r\n computed: {\r\n SearchPanel() {\r\n return {\r\n '--searchPanel': this.searchPanel + 'px',\r\n }\r\n },\r\n },\r\n}\r\n",null]}