Files
tekelanew_acs/acs/nladmin-ui/node_modules/.cache/vue-loader/ef24cffda81ed1bf1a16b7cdadbab79c.json
2024-12-05 09:33:18 +08:00

1 line
7.0 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"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\\device\\opc\\index.vue?vue&type=script&lang=js","dependencies":[{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\src\\views\\acs\\device\\opc\\index.vue","mtime":1732871026604},{"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//\n//\n\r\nimport crudOpc from '@/api/acs/device/opc'\r\nimport CRUD, { crud, form, header, presenter } from '@crud/crud'\r\nimport crudOperation from '@crud/CRUD.operation'\r\nimport pagination from '@crud/Pagination'\r\nimport rrOperation from '@crud/RR.operation'\r\nimport i18n from '@/i18n'\r\n\r\nconst defaultForm = {\r\n type: null,\r\n opc_id: null,\r\n opc_code: null,\r\n opc_name: null,\r\n opc_host: null,\r\n user: null,\r\n password: null,\r\n prog_id: null,\r\n cls_id: null,\r\n domain: null,\r\n remark: null,\r\n is_active: null,\r\n is_delete: null,\r\n create_by: null,\r\n create_time: null,\r\n update_by: null,\r\n update_time: null,\r\n plc_code: null,\r\n plc_name: null,\r\n plc_host: null,\r\n opc_server_id: null,\r\n plc_opc_name: null\r\n}\r\nexport default {\r\n name: 'Opc',\r\n components: { pagination, crudOperation, rrOperation },\r\n mixins: [presenter(), header(), form(defaultForm), crud()],\r\n cruds() {\r\n return CRUD({\r\n title: i18n.t('opc.title'), url: 'api/opc', idField: 'opc_id', sort: 'opc_id,desc', crudMethod: { ...crudOpc },\r\n optShow: {\r\n add: true,\r\n edit: false,\r\n del: false,\r\n download: false\r\n }\r\n })\r\n },\r\n data() {\r\n return {\r\n dialogPlcFormVisible: false,\r\n operateFlag: null,\r\n permission: {\r\n add: ['admin', 'opc:add'],\r\n edit: ['admin', 'opc:edit'],\r\n del: ['admin', 'opc:del']\r\n },\r\n rules: {\r\n opc_id: [\r\n { required: true, message: 'OPC标识不能为空', trigger: 'blur' }\r\n ],\r\n opc_code: [\r\n { required: true, message: 'OPC编码不能为空', trigger: 'blur' }\r\n ],\r\n opc_name: [\r\n { required: true, message: 'OPC名称不能为空', trigger: 'blur' }\r\n ],\r\n password: [\r\n { required: true, message: '密码不能为空', trigger: 'blur' }\r\n ],\r\n is_active: [\r\n { required: true, message: '是否启用不能为空', trigger: 'blur' }\r\n ],\r\n is_delete: [\r\n { required: true, message: '是否删除不能为空', trigger: 'blur' }\r\n ],\r\n create_by: [\r\n { required: true, message: '创建者不能为空', trigger: 'blur' }\r\n ],\r\n create_time: [\r\n { required: true, message: '创建时间不能为空', trigger: 'blur' }\r\n ]\r\n }\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 handleClick(row, flag) {\r\n // flag为0是新增flag为1是编辑flag为2是删除\r\n // 如果是父类操作\r\n if (row.opc_flag === '1') {\r\n if (flag === '1') {\r\n this.crud.toEdit(row)\r\n }\r\n if (flag === '2') {\r\n this.crud.doDelete(row)\r\n }\r\n if (flag === '0') {\r\n this.dialogPlcFormVisible = true\r\n this.form.opc_server_id = row.opc_id\r\n this.form.plc_opc_name = row.opc_name\r\n this.operateFlag = '0'\r\n }\r\n } else {\r\n if (flag === '1') {\r\n const jo = JSON.parse(JSON.stringify(row))\r\n const new_jo = {\r\n plc_id: jo.opc_id,\r\n plc_code: jo.opc_code,\r\n plc_name: jo.opc_name,\r\n plc_host: jo.opc_host,\r\n opc_server_id: jo.opc_server_id,\r\n is_active: jo.is_active,\r\n is_delete: jo.is_delete,\r\n create_by: jo.create_by,\r\n create_time: jo.create_time,\r\n update_by: jo.update_time,\r\n update_time: jo.update_time,\r\n plc_opc_name: jo.plc_opc_name\r\n }\r\n this.crud.resetForm(JSON.parse(JSON.stringify(new_jo)))\r\n this.dialogPlcFormVisible = true\r\n this.operateFlag = '1'\r\n }\r\n if (flag === '2') {\r\n crudOpc.delPLC(row).then(res => {\r\n this.crud.resetForm()\r\n this.crud.toQuery()\r\n this.crud.notify(status + '成功', CRUD.NOTIFICATION_TYPE.SUCCESS)\r\n }).catch(err => {\r\n console.log(err.response.data.message)\r\n })\r\n }\r\n }\r\n },\r\n getDetail() {\r\n const _this = this\r\n this.crud.crudMethod.getmeteal(this.form).then(function(response) {\r\n _this.form.cls_id = response.classId\r\n _this.form.prog_id = response.progId\r\n _this.form.remark = response.description\r\n _this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)\r\n }).catch(err => {\r\n console.log(err.response.data.message)\r\n })\r\n },\r\n // 改变状态\r\n addPlc() {\r\n if (this.operateFlag === '0') {\r\n crudOpc.addPLC(this.form).then(res => {\r\n this.crud.resetForm()\r\n this.dialogPlcFormVisible = false\r\n this.crud.toQuery()\r\n this.crud.notify(status + '成功', CRUD.NOTIFICATION_TYPE.SUCCESS)\r\n }).catch(err => {\r\n console.log(err.response.data.message)\r\n })\r\n }\r\n if (this.operateFlag === '1') {\r\n crudOpc.editPLC(this.form).then(res => {\r\n this.crud.resetForm()\r\n this.dialogPlcFormVisible = false\r\n this.crud.toQuery()\r\n this.crud.notify(status + '成功', CRUD.NOTIFICATION_TYPE.SUCCESS)\r\n }).catch(err => {\r\n console.log(err.response.data.message)\r\n })\r\n }\r\n }\r\n }\r\n}\r\n",null]}