diff --git a/.gitignore b/.gitignore index 004766c9..a2ab4206 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ selenium-debug.log *.local package-lock.json +echarts.js \ No newline at end of file diff --git a/package.json b/package.json index 0bbe53e6..8715ba64 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,7 @@ "code-brick-zj": "^1.0.2", "core-js": "^3.26.0", "crypto-js": "^4.0.0", + "diagram-js": "^12.3.0", "echarts": "5.4.0", "element-ui": "2.15.12", "file-saver": "^2.0.5", @@ -64,21 +65,25 @@ "moment": "^2.29.4", "nprogress": "0.2.0", "qrcode.vue": "^1.7.0", + "qs": "^6.11.2", "quill": "1.3.7", "screenfull": "5.0.2", "sortablejs": "1.10.2", "throttle-debounce": "2.1.0", + "video.js": "^8.5.2", "vue": "2.7.14", "vue-count-to": "1.0.13", "vue-cropper": "0.5.8", "vue-meta": "^2.4.0", + "vue-plugin-hiprint": "^0.0.54-fix", "vue-quill-editor": "^3.0.6", "vue-router": "3.4.9", "vue-video-player": "^5.0.2", "vuedraggable": "2.24.3", "vuex": "3.6.2", "xlsx": "^0.18.5", - "xml-js": "1.6.11" + "xml-js": "1.6.11", + "yorkie": "^2.0.0" }, "devDependencies": { "@vue/cli-plugin-babel": "4.5.18", @@ -92,7 +97,7 @@ "chalk": "4.1.0", "compression-webpack-plugin": "5.0.2", "connect": "3.6.6", - "eslint": "7.15.0", + "eslint": "6.8.0", "eslint-config-airbnb-base": "^14.0.0", "eslint-plugin-import": "^2.26.0", "eslint-plugin-prettier": "^3.1.0", diff --git a/public/index.html b/public/index.html index 589910ee..860ebd9d 100644 --- a/public/index.html +++ b/public/index.html @@ -1,215 +1,218 @@ - - - - - - - <%= webpackConfig.name %> - - + - .loaded #loader-wrapper .loader-section.section-right { - -webkit-transform: translateX(100%); - -ms-transform: translateX(100%); - transform: translateX(100%); - -webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1); - transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1); - } - - .loaded #loader { - opacity: 0; - -webkit-transition: all 0.3s ease-out; - transition: all 0.3s ease-out; - } - - .loaded #loader-wrapper { - visibility: hidden; - -webkit-transform: translateY(-100%); - -ms-transform: translateY(-100%); - transform: translateY(-100%); - -webkit-transition: all 0.3s 1s ease-out; - transition: all 0.3s 1s ease-out; - } - - .no-js #loader-wrapper { - display: none; - } - - .no-js h1 { - color: #222222; - } - - #loader-wrapper .load_title { - font-family: 'Open Sans'; - color: #fff; - font-size: 19px; - width: 100%; - text-align: center; - z-index: 9999999999999; - position: absolute; - top: 60%; - opacity: 1; - line-height: 30px; - } - - #loader-wrapper .load_title span { - font-weight: normal; - font-style: italic; - font-size: 13px; - color: #fff; - opacity: 0.5; - } - - - - -
-
-
-
-
-
正在加载系统资源,请耐心等待
-
+ +
+
+
+
+
+
正在加载系统资源,请耐心等待
- - +
+ + + \ No newline at end of file diff --git a/public/print-lock.css b/public/print-lock.css new file mode 100644 index 00000000..93e654a0 --- /dev/null +++ b/public/print-lock.css @@ -0,0 +1,339 @@ +@media print { + body { + margin: 0px; + padding: 0px; + } +} + +@page { + margin: 0; +} + +.hiprint-printPaper * { + box-sizing: border-box; + -moz-box-sizing: border-box; /* Firefox */ + -webkit-box-sizing: border-box; /* Safari */ +} + +.hiprint-printPaper *:focus { + outline: -webkit-focus-ring-color auto 0px; +} + +.hiprint-printPaper { + position: relative; + padding: 0 0 0 0; + page-break-after: always; + -webkit-user-select: none; /* Chrome/Safari/Opera */ + -moz-user-select: none; /* Firefox */ + user-select: none; + overflow-x: hidden; + overflow: hidden; +} + +.hiprint-printPaper .hiprint-printPaper-content { + position: relative; +} + +/* 火狐浏览器打印 第一页过后 重叠问题 */ +@-moz-document url-prefix() { + .hiprint-printPaper .hiprint-printPaper-content { + position: relative; + margin-top: 20px; + top: -20px + } +} + +.hiprint-printPaper.design { + overflow: visible; +} + + +.hiprint-printTemplate .hiprint-printPanel { + page-break-after: always; +} + +.hiprint-printPaper, hiprint-printPanel { + box-sizing: border-box; + border: 0px; +} + +.hiprint-printPanel .hiprint-printPaper:last-child { + page-break-after: avoid; +} + +.hiprint-printTemplate .hiprint-printPanel:last-child { + page-break-after: avoid; +} + +.hiprint-printPaper .hideheaderLinetarget { + border-top: 0px dashed rgb(201, 190, 190) !important; +} + +.hiprint-printPaper .hidefooterLinetarget { + border-top: 0px dashed rgb(201, 190, 190) !important; +} + +.hiprint-printPaper.design { + border: 1px dashed rgba(170, 170, 170, 0.7); +} + +.design .hiprint-printElement-table-content, .design .hiprint-printElement-longText-content { + overflow: hidden; + box-sizing: border-box; +} + +.design .resize-panel { + box-sizing: border-box; + border: 1px dotted; +} + +.hiprint-printElement-text { + background-color: transparent; + background-repeat: repeat; + padding: 0 0 0 0; + border: 0.75pt none rgb(0, 0, 0); + direction: ltr; + font-family: 'SimSun'; + font-size: 9pt; + font-style: normal; + font-weight: normal; + padding-bottom: 0pt; + padding-left: 0pt; + padding-right: 0pt; + padding-top: 0pt; + text-align: left; + text-decoration: none; + line-height: 9.75pt; + box-sizing: border-box; + word-wrap: break-word; + word-break: break-all; +} + +.design .hiprint-printElement-text-content { + border: 1px dashed rgb(206, 188, 188); + box-sizing: border-box; +} + +.hiprint-printElement-longText { + background-color: transparent; + background-repeat: repeat; + border: 0.75pt none rgb(0, 0, 0); + direction: ltr; + font-family: 'SimSun'; + font-size: 9pt; + font-style: normal; + font-weight: normal; + padding-bottom: 0pt; + padding-left: 0pt; + padding-right: 0pt; + padding-top: 0pt; + text-align: left; + text-decoration: none; + line-height: 9.75pt; + box-sizing: border-box; + word-wrap: break-word; + word-break: break-all; + /*white-space: pre-wrap*/ +} + + +.hiprint-printElement-table { + background-color: transparent; + background-repeat: repeat; + color: rgb(0, 0, 0); + border-color: rgb(0, 0, 0); + border-style: none; + direction: ltr; + font-family: 'SimSun'; + font-size: 9pt; + font-style: normal; + font-weight: normal; + padding-bottom: 0pt; + padding-left: 0pt; + padding-right: 0pt; + padding-top: 0pt; + text-align: left; + text-decoration: none; + padding: 0 0 0 0; + box-sizing: border-box; + line-height: 9.75pt; +} + +.hiprint-printElement-table thead { + background: #e8e8e8; + font-weight: 700; +} + +.hiprint-printElement-tableTarget, .hiprint-printElement-tableTarget tr, .hiprint-printElement-tableTarget td { + border-color: rgb(0, 0, 0); + /*border-style: none;*/ + /*border: 1px solid rgb(0, 0, 0);*/ + font-weight: normal; + direction: ltr; + padding-bottom: 0pt; + padding-left: 4pt; + padding-right: 4pt; + padding-top: 0pt; + text-decoration: none; + vertical-align: middle; + box-sizing: border-box; + word-wrap: break-word; + word-break: break-all; + /*line-height: 9.75pt; + font-size: 9pt;*/ +} + +.hiprint-printElement-tableTarget-border-all { + border: 1px solid; +} +.hiprint-printElement-tableTarget-border-none { + border: 0px solid; +} +.hiprint-printElement-tableTarget-border-lr { + border-left: 1px solid; + border-right: 1px solid; +} +.hiprint-printElement-tableTarget-border-left { + border-left: 1px solid; +} +.hiprint-printElement-tableTarget-border-right { + border-right: 1px solid; +} +.hiprint-printElement-tableTarget-border-tb { + border-top: 1px solid; + border-bottom: 1px solid; +} +.hiprint-printElement-tableTarget-border-top { + border-top: 1px solid; +} +.hiprint-printElement-tableTarget-border-bottom { + border-bottom: 1px solid; +} + +.hiprint-printElement-tableTarget-border-td-none td { + border: 0px solid; +} +.hiprint-printElement-tableTarget-border-td-all td:not(:last-child) { + border-right: 1px solid; +} + +/*.hiprint-printElement-tableTarget tr,*/ +.hiprint-printElement-tableTarget td { + height: 18pt; +} + +.hiprint-printPaper .hiprint-paperNumber { + font-size: 9pt; +} + +.design .hiprint-printElement-table-handle { + position: absolute; + height: 21pt; + width: 21pt; + background: red; + z-index: 1; +} + +.hiprint-printPaper .hiprint-paperNumber-disabled { + float: right !important; + right: 0 !important; + color: gainsboro !important; +} + +.hiprint-printElement-vline, .hiprint-printElement-hline { + border: 0px none rgb(0, 0, 0); + +} + +.hiprint-printElement-vline { + border-left: 0.75pt solid #000; + border-right: 0px none rgb(0, 0, 0) !important; + border-bottom: 0px none rgb(0, 0, 0) !important; + border-top: 0px none rgb(0, 0, 0) !important; +} + +.hiprint-printElement-hline { + border-top: 0.75pt solid #000; + border-right: 0px none rgb(0, 0, 0) !important; + border-bottom: 0px none rgb(0, 0, 0) !important; + border-left: 0px none rgb(0, 0, 0) !important; +} + +.hiprint-printElement-oval, .hiprint-printElement-rect { + border: 0.75pt solid #000; +} + +.hiprint-text-content-middle { +} + +.hiprint-text-content-middle > div { + display: grid; + align-items: center; +} + +.hiprint-text-content-bottom { +} + +.hiprint-text-content-bottom > div { + display: grid; + align-items: flex-end; +} + +.hiprint-text-content-wrap { +} + +.hiprint-text-content-wrap .hiprint-text-content-wrap-nowrap { + white-space: nowrap; +} + +.hiprint-text-content-wrap .hiprint-text-content-wrap-clip { + white-space: nowrap; + overflow: hidden; + text-overflow: clip; +} + +.hiprint-text-content-wrap .hiprint-text-content-wrap-ellipsis { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +/*hi-grid-row */ +.hi-grid-row { + position: relative; + height: auto; + margin-right: 0; + margin-left: 0; + zoom: 1; + display: block; + box-sizing: border-box; +} + +.hi-grid-row::after, .hi-grid-row::before { + display: table; + content: ''; + box-sizing: border-box; +} + +.hi-grid-col { + display: block; + box-sizing: border-box; + position: relative; + float: left; + flex: 0 0 auto; +} + +.table-grid-row { + margin-left: -0pt; + margin-right: -0pt; +} + +.tableGridColumnsGutterRow { + padding-left: 0pt; + padding-right: 0pt; +} + +.hiprint-gridColumnsFooter { + text-align: left; + clear: both; +} diff --git a/src/assets/icons/svg/Confirm.svg b/src/assets/icons/svg/Confirm.svg new file mode 100644 index 00000000..6b284c96 --- /dev/null +++ b/src/assets/icons/svg/Confirm.svg @@ -0,0 +1,12 @@ + + + 选择 + + + + + + + + + \ No newline at end of file diff --git a/src/assets/icons/svg/Qian.svg b/src/assets/icons/svg/Qian.svg new file mode 100644 index 00000000..997993cb --- /dev/null +++ b/src/assets/icons/svg/Qian.svg @@ -0,0 +1,14 @@ + + + 菜单 + + + + + + + + + + + \ No newline at end of file diff --git a/src/assets/images/DataBoard.png b/src/assets/images/DataBoard.png new file mode 100644 index 00000000..7e1fb610 Binary files /dev/null and b/src/assets/images/DataBoard.png differ diff --git a/src/assets/images/Qian.png b/src/assets/images/Qian.png new file mode 100644 index 00000000..07e4170e Binary files /dev/null and b/src/assets/images/Qian.png differ diff --git a/src/components/DialogForm/index.vue b/src/components/DialogForm/index.vue index 03c05be4..a290ce95 100644 --- a/src/components/DialogForm/index.vue +++ b/src/components/DialogForm/index.vue @@ -89,6 +89,8 @@ function findMaxLabelWidth(rows) { let max = 0; rows.forEach((row) => { row.forEach((opt) => { + // debugger; + if (!opt.label) return 0; if (opt.label.length > max) { max = opt.label.length; } @@ -114,6 +116,10 @@ export default { type: Object, default: () => ({}), }, + disabled: { + type: Boolean, + default: false, + } }, data() { return { diff --git a/src/layout/components/AppMain.vue b/src/layout/components/AppMain.vue index a14aba84..15c86487 100644 --- a/src/layout/components/AppMain.vue +++ b/src/layout/components/AppMain.vue @@ -32,7 +32,7 @@ export default { min-height: calc(100vh - 56px); min-width: calc(100vh - 280px); position: relative; - overflow: hidden; + overflow: visible; margin: 8px 14px 0px 16px; border-radius: 8px; background-color: #fff; diff --git a/src/mixins/lb/basicPageMixin.js b/src/mixins/lb/basicPageMixin.js index 8eab17ff..36c61708 100644 --- a/src/mixins/lb/basicPageMixin.js +++ b/src/mixins/lb/basicPageMixin.js @@ -53,6 +53,9 @@ export default { case 'delete': this.handleDelete(data); break; + case 'detail': + this.handleDetail(data); + break; } }, // 处理搜索栏按钮 diff --git a/src/router/index.js b/src/router/index.js index f8430b94..fc08e221 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -64,6 +64,11 @@ export const constantRoutes = [ component: (resolve) => require(['@/views/error/401'], resolve), hidden: true }, + { + path: '/print-design', + component: (resolve) => require(['@/views/print/design'], resolve), + hidden: true + }, { path: '/', component: Layout, diff --git a/src/views/base/dataBoard/index.vue b/src/views/base/dataBoard/index.vue new file mode 100644 index 00000000..9c242a15 --- /dev/null +++ b/src/views/base/dataBoard/index.vue @@ -0,0 +1,74 @@ + + + + + + + diff --git a/src/views/base/equipmentBindGroup/components/BasicDrawer.vue b/src/views/base/equipmentBindGroup/components/BasicDrawer.vue new file mode 100644 index 00000000..3bfb196c --- /dev/null +++ b/src/views/base/equipmentBindGroup/components/BasicDrawer.vue @@ -0,0 +1,482 @@ + + + + + + + diff --git a/src/views/base/equipmentBindGroup/components/dialogForm.vue b/src/views/base/equipmentBindGroup/components/dialogForm.vue new file mode 100644 index 00000000..fe7b848b --- /dev/null +++ b/src/views/base/equipmentBindGroup/components/dialogForm.vue @@ -0,0 +1,186 @@ + + + + + + + diff --git a/src/views/base/equipmentBindGroup/index.vue b/src/views/base/equipmentBindGroup/index.vue index bab7525f..e504c804 100644 --- a/src/views/base/equipmentBindGroup/index.vue +++ b/src/views/base/equipmentBindGroup/index.vue @@ -40,6 +40,57 @@ @confirm="submitForm"> + + +
@@ -55,16 +106,24 @@ import { import { getEquipmentGroupPage } from '@/api/base/equipmentGroup'; import moment from 'moment'; +import { publicFormatter } from '@/utils/dict'; import basicPageMixin from '@/mixins/lb/basicPageMixin'; +import BasicDrawer from './components/BasicDrawer.vue'; export default { name: 'EquipmentBindGroup', - components: {}, + components: { BasicDrawer }, mixins: [basicPageMixin], data() { return { searchBarKeys: ['groupId', 'equipmentName'], tableBtn: [ + this.$auth.hasPermi('base:equipment-bind-group:update') + ? { + type: 'detail', + btnName: '查看报警', + } + : undefined, this.$auth.hasPermi('base:equipment-bind-group:update') ? { type: 'edit', @@ -88,32 +147,32 @@ export default { }, { prop: 'equipmentName', label: '设备' }, { prop: 'groupName', label: '分组' }, - { - _action: 'equipment-bind-group-show-alert', - label: '分组报警', - subcomponent: { - props: ['injectData'], - render: function (h) { - const _this = this; - return h( - 'el-button', - { - props: { type: 'text' }, - on: { - click: function () { - console.log('inejctdata', _this.injectData); - _this.$emit('emitData', { - action: _this.injectData._action, - value: _this.injectData, - }); - }, - }, - }, - '查看报警' - ); - }, - }, - }, + // { + // _action: 'equipment-bind-group-show-alert', + // label: '分组报警', + // subcomponent: { + // props: ['injectData'], + // render: function (h) { + // const _this = this; + // return h( + // 'el-button', + // { + // props: { type: 'text' }, + // on: { + // click: function () { + // console.log('inejctdata', _this.injectData); + // _this.$emit('emitData', { + // action: _this.injectData._action, + // value: _this.injectData, + // }); + // }, + // }, + // }, + // '查看报警' + // ); + // }, + // }, + // }, ], searchBarFormConfig: [ { @@ -196,6 +255,59 @@ export default { form: {}, // 表单校验 rules: {}, + // + alarmForm: { + id: undefined, + equipmentGroupCode: undefined, + equipmentGroupName: undefined, + }, + editVisible: false, + editMode: '', + drawerBaseInfoRows: [ + [ + { + input: true, + label: '设备分组名称', + prop: 'name', + rules: [{ required: true, message: '不能为空', trigger: 'blur' }], + // bind: { + // disabled: this.editMode == 'detail', // some condition, like detail mode... + // } + }, + { + input: true, + label: '设备分组编码', + prop: 'code', + // url: '/base/equipment/getCode', + }, + ], + ], + drawerListProps: [ + { + prop: 'createTime', + label: '添加时间', + fixed: true, + width: 180, + filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), + }, + { width: 240, prop: 'code', label: '报警编码' }, + { + width: 100, + prop: 'type', + label: '报警类型', + filter: (val) => + val != null ? ['-', '字符型', '布尔型', '-'][val] : '-', + }, + { + width: 90, + prop: 'grade', + label: '报警级别', + filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL), + }, + { width: 180, prop: 'alarmCode', label: '设备报警编码' }, + { width: 128, prop: 'plcParamName', label: '参数列名' }, + { width: 128, prop: 'alarmContent', label: '报警内容' }, + ], }; }, created() { @@ -229,7 +341,6 @@ export default { /** 查询列表 */ getList() { this.loading = true; - _; // 执行查询 getEquipmentBindGroupPage(this.queryParams).then((response) => { this.list = response.data.list; this.total = response.data.total; @@ -299,6 +410,20 @@ export default { }); }); }, + // 查看报警 + handleDetail(row) { + const { equipmentId, equipmentName, groupCode, groupId, groupName, id } = + row; + // 打开抽屉 + this.editMode = 'detail'; + this.alarmForm.id = groupId; + this.alarmForm.equipmentGroupCode = groupCode; + this.alarmForm.equipmentGroupName = groupName; + this.editVisible = true; + this.$nextTick(() => { + this.$refs['drawer'].init(); + }); + }, /** 删除按钮操作 */ handleDelete(row) { const id = row.id; diff --git a/src/views/base/equipmentGroup/components/BasicDrawer.vue b/src/views/base/equipmentGroup/components/BasicDrawer.vue new file mode 100644 index 00000000..7a6f7a67 --- /dev/null +++ b/src/views/base/equipmentGroup/components/BasicDrawer.vue @@ -0,0 +1,481 @@ + + + + + + + diff --git a/src/views/base/equipmentGroup/components/dialogForm.vue b/src/views/base/equipmentGroup/components/dialogForm.vue new file mode 100644 index 00000000..519b435e --- /dev/null +++ b/src/views/base/equipmentGroup/components/dialogForm.vue @@ -0,0 +1,187 @@ + + + + + + + diff --git a/src/views/base/equipmentGroup/index.vue b/src/views/base/equipmentGroup/index.vue index 24d248fe..f3509adc 100644 --- a/src/views/base/equipmentGroup/index.vue +++ b/src/views/base/equipmentGroup/index.vue @@ -40,6 +40,57 @@ @confirm="submitForm"> + + + @@ -53,17 +104,27 @@ import { exportEquipmentGroupExcel, } from '@/api/base/equipmentGroup'; import moment from 'moment'; +import { publicFormatter } from '@/utils/dict'; import basicPageMixin from '@/mixins/lb/basicPageMixin'; -import { getAccessToken } from '@/utils/auth'; +// import { getAccessToken } from '@/utils/auth'; +import BasicDrawer from './components/BasicDrawer.vue'; export default { name: 'EquipmentGroup', mixins: [basicPageMixin], - components: {}, + components: { BasicDrawer }, data() { return { + editVisible: false, + editMode: '', searchBarKeys: ['name', 'code'], tableBtn: [ + this.$auth.hasPermi('base:equipment-group:update') + ? { + type: 'detail', + btnName: '查看报警', + } + : undefined, this.$auth.hasPermi('base:equipment-group:update') ? { type: 'edit', @@ -88,34 +149,84 @@ export default { { prop: 'name', label: '设备分组名称' }, { prop: 'code', label: '设备分组编码' }, { prop: 'remark', label: '备注' }, - { - _action: 'equipment-group-show-alert', - label: '报警', - subcomponent: { - props: ['injectData'], - render: function (h) { - const _this = this; - return h( - 'el-button', - { - props: { type: 'text' }, - on: { - click: function () { - console.log('inejctdata', _this.injectData); - _this.$emit('emitData', { - action: _this.injectData._action, - // value: _this.injectData.id, - value: _this.injectData, - }); - }, - }, - }, - '查看报警' - ); - }, - }, - }, + // { + // _action: 'equipment-group-show-alert', + // label: '报警', + // subcomponent: { + // props: ['injectData'], + // render: function (h) { + // const _this = this; + // return h( + // 'el-button', + // { + // props: { type: 'text' }, + // on: { + // click: function () { + // console.log('inejctdata', _this.injectData); + // _this.$emit('emitData', { + // action: _this.injectData._action, + // // value: _this.injectData.id, + // value: _this.injectData, + // }); + // }, + // }, + // }, + // '查看报警' + // ); + // }, + // }, + // }, ], + drawerBaseInfoRows: [ + [ + { + input: true, + label: '设备分组名称', + prop: 'name', + rules: [{ required: true, message: '不能为空', trigger: 'blur' }], + // bind: { + // disabled: this.editMode == 'detail', // some condition, like detail mode... + // } + }, + { + input: true, + label: '设备分组编码', + prop: 'code', + // url: '/base/equipment/getCode', + } + ] + ], + drawerListProps: [ + { + prop: 'createTime', + label: '添加时间', + fixed: true, + width: 180, + filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), + }, + { width: 240, prop: 'code', label: '报警编码' }, + { + width: 100, + prop: 'type', + label: '报警类型', + filter: (val) => + val != null ? ['-', '字符型', '布尔型', '-'][val] : '-', + }, + { + width: 90, + prop: 'grade', + label: '报警级别', + filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL), + }, + { width: 180, prop: 'alarmCode', label: '设备报警编码' }, + { width: 128, prop: 'plcParamName', label: '参数列名' }, + { width: 128, prop: 'alarmContent', label: '报警内容' }, + ], + alarmForm: { + id: undefined, + equipmentGroupCode: undefined, + equipmentGroupName: undefined, + }, searchBarFormConfig: [ { type: 'input', @@ -299,6 +410,20 @@ export default { }); }); }, + // 查看报警 + handleDetail(row) { + // debugger; + const { id, code, name, createTime } = row; + // 打开抽屉 + this.editMode = 'detail'; + this.alarmForm.id = id; + this.alarmForm.equipmentGroupCode = code; + this.alarmForm.equipmentGroupName = name; + this.editVisible = true; + this.$nextTick(() => { + this.$refs['drawer'].init(); + }); + }, /** 删除按钮操作 */ handleDelete(row) { const id = row.id; diff --git a/src/views/base/equipmentGroupAlarm/dialogForm.vue b/src/views/base/equipmentGroupAlarm/dialogForm.vue index a0b9f55e..329186da 100644 --- a/src/views/base/equipmentGroupAlarm/dialogForm.vue +++ b/src/views/base/equipmentGroupAlarm/dialogForm.vue @@ -18,24 +18,25 @@ prop="code" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]"> @@ -47,6 +48,7 @@ :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]"> @@ -86,6 +89,7 @@ label="设备报警编码" prop="alarmCode"> @@ -99,6 +103,7 @@ prop="plcParamName" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]"> @@ -110,6 +115,7 @@ prop="alarmContent" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]"> @@ -133,6 +139,10 @@ export default { type: Object, default: () => ({}), }, + disabled: { + type: Boolean, + default: false, + }, }, data() { return { diff --git a/src/views/base/equipmentPlcConnect/components/BasicDrawer.vue b/src/views/base/equipmentPlcConnect/components/BasicDrawer.vue new file mode 100644 index 00000000..740f6b71 --- /dev/null +++ b/src/views/base/equipmentPlcConnect/components/BasicDrawer.vue @@ -0,0 +1,531 @@ + + + + + + + diff --git a/src/views/base/equipmentPlcConnect/index.vue b/src/views/base/equipmentPlcConnect/index.vue index 5d7e72d9..f64f05cc 100644 --- a/src/views/base/equipmentPlcConnect/index.vue +++ b/src/views/base/equipmentPlcConnect/index.vue @@ -40,6 +40,53 @@ @confirm="submitForm"> + + + @@ -55,11 +102,13 @@ import { import moment from 'moment'; import basicPageMixin from '@/mixins/lb/basicPageMixin'; // import './http'; +import BasicDrawer from './components/BasicDrawer.vue'; +import { publicFormatter } from '@/utils/dict'; export default { name: 'EquipmentPlcConnect', mixins: [basicPageMixin], - components: {}, + components: { BasicDrawer }, data() { return { searchBarKeys: ['equipmentId', 'plcId'], @@ -78,6 +127,10 @@ export default { // : undefined, // ].filter((v) => v), tableBtn: [ + { + type: 'detail', + btnName: '参数绑定', + }, { type: 'edit', btnName: '修改', @@ -107,32 +160,32 @@ export default { { prop: 'plcTableName', label: '关联表名' }, { prop: 'plcName', label: '标识名称' }, { prop: 'bindingParameters', label: '绑定参数数量' }, - { - _action: 'params-bind', - label: '查看绑定', - subcomponent: { - props: ['injectData'], - render: function (h) { - const _this = this; - return h( - 'el-button', - { - props: { type: 'text' }, - on: { - click: function () { - console.log('inejctdata', _this.injectData); - _this.$emit('emitData', { - action: _this.injectData._action, - payload: _this.injectData, - }); - }, - }, - }, - '查看绑定' - ); - }, - }, - }, + // { + // _action: 'params-bind', + // label: '查看绑定', + // subcomponent: { + // props: ['injectData'], + // render: function (h) { + // const _this = this; + // return h( + // 'el-button', + // { + // props: { type: 'text' }, + // on: { + // click: function () { + // console.log('inejctdata', _this.injectData); + // _this.$emit('emitData', { + // action: _this.injectData._action, + // payload: _this.injectData, + // }); + // }, + // }, + // }, + // '查看绑定' + // ); + // }, + // }, + // }, ], searchBarFormConfig: [ { @@ -185,8 +238,8 @@ export default { url: '/base/equipment-plc/listAll', rules: [{ required: true, message: '不能为空', trigger: 'blur' }], bind: { - filterable: true - } + filterable: true, + }, }, ], [ @@ -197,8 +250,8 @@ export default { url: '/base/equipment/page?pageNo=1&pageSize=99', rules: [{ required: true, message: '不能为空', trigger: 'blur' }], bind: { - filterable: true - } + filterable: true, + }, }, ], ], @@ -212,6 +265,52 @@ export default { }, // 表单参数 form: {}, + // 查看绑定配置 + editVisible: false, + editMode: '', + drawerBaseInfoRows: [ + [ + { + input: true, + label: '设备名', + prop: 'equipmentName', + rules: [{ required: true, message: '不能为空', trigger: 'blur' }], + // bind: { + // disabled: this.editMode == 'detail', // some condition, like detail mode... + // } + }, + { + input: true, + label: '关联表名', + prop: 'plcTableName', + // url: '/base/equipment/getCode', + }, + ], + ], + drawerListProps: [ + { prop: 'plcParamName', label: '参数列名' }, + { prop: 'name', label: '参数名称' }, + { + prop: 'unit', + label: '单位', + filter: publicFormatter('unit_dict'), + }, + { + prop: 'collection', + label: '是否采集', + filter: (val) => (val != null ? ['否', '是'][val] : '-'), + }, + { prop: 'minValue', label: '最小值' }, + { prop: 'maxValue', label: '最大值' }, + { prop: 'defaultValue', label: '标准值' }, + { prop: 'description', label: '描述' }, + { prop: 'remark', label: '备注' }, + ], + alarmForm: { + id: undefined, + equipmentName: undefined, + plcTableName: undefined, + }, }; }, created() { @@ -353,6 +452,34 @@ export default { }); }); }, + + // 查看报警 + handleDetail(row) { + // debugger; + const { + id, + bindingParameters, + equipmentCode, + equipmentId, + equipmentName, + plcCode, + plcId, + plcName, + plcTableName, + productionLine, + workshopSection, + } = row; + // 打开抽屉 + this.editMode = 'detail'; + this.alarmForm.id = id; + this.alarmForm.plcTableName = plcTableName; // 关联表名 + this.alarmForm.equipmentName = equipmentName; + this.editVisible = true; + this.$nextTick(() => { + this.$refs['drawer'].init(); + }); + }, + /** 删除按钮操作 */ handleDelete(row) { const id = row.id; @@ -367,6 +494,7 @@ export default { }) .catch(() => {}); }, + /** 导出按钮操作 */ handleExport() { // 处理查询参数 diff --git a/src/views/core/base/equipment/index.vue b/src/views/core/base/equipment/index.vue index 5b70519e..37aaaac1 100644 --- a/src/views/core/base/equipment/index.vue +++ b/src/views/core/base/equipment/index.vue @@ -139,6 +139,12 @@ export default { btnName: '删除', } : undefined, + this.$auth.hasPermi(`base:equipment:update`) + ? { + type: 'detail', + btnName: '详情', + } + : undefined, ].filter((v) => v), tableProps: [ { @@ -153,32 +159,32 @@ export default { { prop: 'equipmentType', label: '设备类型' }, { prop: 'enName', label: '英文名称' }, { prop: 'abbr', label: '缩写' }, - { - action: 'show-detail', - label: '详情', - subcomponent: { - props: ['injectData'], - render: function (h) { - const _this = this; - return h( - 'el-button', - { - props: { type: 'text', size: 'mini' }, - on: { - click: function () { - console.log('inejctdata', _this.injectData); - _this.$emit('emitData', { - action: _this.injectData.action, - value: _this.injectData.id, - }); - }, - }, - }, - '查看详情' - ); - }, - }, - }, + // { + // action: 'show-detail', + // label: '详情', + // subcomponent: { + // props: ['injectData'], + // render: function (h) { + // const _this = this; + // return h( + // 'el-button', + // { + // props: { type: 'text', size: 'mini' }, + // on: { + // click: function () { + // console.log('inejctdata', _this.injectData); + // _this.$emit('emitData', { + // action: _this.injectData.action, + // value: _this.injectData.id, + // }); + // }, + // }, + // }, + // '查看详情' + // ); + // }, + // }, + // }, ], searchBarFormConfig: [ { @@ -532,6 +538,10 @@ export default { case 'delete': this.handleDelete(data); break; + case 'detail': + const { id } = data; + this.viewDetail(id); + break; } }, }, diff --git a/src/views/equipment/analysis/efficiency/components/pieChart.vue b/src/views/equipment/analysis/efficiency/components/pieChart.vue index e051f341..249e5b3b 100644 --- a/src/views/equipment/analysis/efficiency/components/pieChart.vue +++ b/src/views/equipment/analysis/efficiency/components/pieChart.vue @@ -6,10 +6,11 @@ -->