{"remainingRequest":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\src\\views\\acs\\config\\assigned\\index.vue?vue&type=script&lang=js","dependencies":[{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\src\\views\\acs\\config\\assigned\\index.vue","mtime":1732871026556},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1732872824662},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\babel-loader\\lib\\index.js","mtime":1732872825017},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1732872824662},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\vue-loader\\lib\\index.js","mtime":1732872825835}],"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\r\nimport crudAcsDeviceAssigned from '@/api/acs/config/deviceAssigned'\r\nimport CRUD, { crud, form, header, presenter } from '@crud/crud'\r\nimport crudOperation from '@crud/CRUD.operation'\r\nimport udOperation from '@crud/UD.operation'\r\nimport pagination from '@crud/Pagination'\r\nimport deviceCrud from '@/api/acs/device/device'\r\nimport i18n from '@/i18n'\r\n\r\nconst defaultForm = {\r\n assigned_id: null,\r\n device_code: null,\r\n task_nextDevice_code: null,\r\n inst_nextDevice_code: null,\r\n param: null,\r\n tableData: []\r\n}\r\nexport default {\r\n name: 'AcsDeviceAssigned',\r\n components: { pagination, crudOperation, udOperation },\r\n mixins: [presenter(), header(), form(defaultForm), crud()],\r\n cruds() {\r\n return CRUD({\r\n title: i18n.t('config.table.mapping_relationship'),\r\n url: 'api/deviceAssigned',\r\n idField: 'assigned_id',\r\n sort: 'assigned_id',\r\n optShow: {\r\n add: true,\r\n edit: true,\r\n del: true\r\n },\r\n crudMethod: { ...crudAcsDeviceAssigned }\r\n })\r\n },\r\n data() {\r\n return {\r\n showList: true,\r\n permission: {\r\n add: ['admin', 'AcsDeviceAssigned:add'],\r\n edit: ['admin', 'AcsDeviceAssigned:edit'],\r\n del: ['admin', 'AcsDeviceAssigned:del']\r\n },\r\n tableData: [{\r\n name: ''\r\n }],\r\n deviceList: [],\r\n rules: {\r\n device_code: [\r\n { required: true, message: this.$t('config.table.device_is_not_null'), trigger: 'blur' }\r\n ]\r\n }\r\n }\r\n },\r\n created() {\r\n this.$nextTick(() => {\r\n deviceCrud.selectDeviceList().then(data => {\r\n this.deviceList = data\r\n })\r\n })\r\n },\r\n methods: {\r\n // 钩子:在获取表格数据之前执行,false 则代表不获取数据\r\n [CRUD.HOOK.beforeRefresh]() {\r\n return true\r\n },\r\n [CRUD.HOOK.beforeToEdit](data) {\r\n const form = JSON.stringify(data.form)\r\n const formObj = JSON.parse(form)\r\n this.form.assigned_id = formObj.assigned_id\r\n this.form.device_code = formObj.device_code\r\n this.form.task_nextDevice_code = formObj.task_nextDevice_code.split(',')\r\n this.form.inst_nextDevice_code = formObj.inst_nextDevice_code.split(',')\r\n const param = JSON.parse(formObj.param)\r\n const tableData = []\r\n Object.keys(param).forEach(key => {\r\n tableData.push({\r\n device: key,\r\n inOut: param[key].inOut,\r\n limit: param[key].limit,\r\n scale: param[key].scale\r\n })\r\n })\r\n this.form.tableData = tableData\r\n return true\r\n },\r\n paramFormate(row, index) {\r\n return JSON.parse(JSON.stringify(row.param))\r\n },\r\n getStatus() {\r\n if (this.crud.status.edit === 0) {\r\n this.showList = false\r\n } else {\r\n this.showList = true\r\n }\r\n },\r\n getValue: function(value) {\r\n const tableData = []\r\n if (!(value && typeof value === 'object' && Object.keys(value).length === 0)) {\r\n // const oldTableData = JSON.parse(JSON.stringify(this.form.tableData))\r\n // if (oldTableData && oldTableData.length > 0) {\r\n // oldTableData.forEach(row => {\r\n // console.log(row)\r\n // })\r\n // }\r\n value.forEach(item => {\r\n tableData.push({\r\n device: item,\r\n limit: 50,\r\n scale: 50,\r\n inOut: false\r\n })\r\n })\r\n }\r\n this.form.tableData = tableData\r\n },\r\n changeNextDevice(value) {\r\n debugger\r\n }\r\n }\r\n}\r\n",null]}