From e0fac4556dd63e8b49c67a05c731f6835f2b8c52 Mon Sep 17 00:00:00 2001 From: lb Date: Wed, 27 Mar 2024 16:28:09 +0800 Subject: [PATCH] update tableheight --- src/components/RuoYi/Doc/index.vue | 21 --- src/components/RuoYi/Git/index.vue | 21 --- src/components/tableInnerComponents.js | 60 ++++++++ src/mixins/lb/tableHeightMixin.js | 18 +++ .../specialEquipment/basic/FireFighthing.vue | 27 +++- src/views/specialEquipment/basic/Manage.vue | 33 +++-- src/views/specialEquipment/basic/Safety.vue | 25 +++- .../check/CheckOrderListTable.vue | 60 ++++++-- src/views/specialEquipment/check/Config.vue | 13 +- src/views/specialEquipment/check/Content.vue | 3 +- src/views/specialEquipment/check/Record.vue | 20 ++- .../specialEquipment/maintain/Monitor.vue | 79 +--------- .../specialEquipment/maintain/PlanConfig.vue | 110 +++++--------- .../specialEquipment/maintain/Record.vue | 139 ++++-------------- .../specialEquipment/maintain/Repair.vue | 9 +- .../specialEquipment/maintain/WaitingList.vue | 2 +- .../maintain/WaitingListTable.vue | 29 +++- src/views/specialEquipment/maintain/htmls.vue | 42 +++--- 18 files changed, 327 insertions(+), 384 deletions(-) delete mode 100644 src/components/RuoYi/Doc/index.vue delete mode 100644 src/components/RuoYi/Git/index.vue create mode 100644 src/components/tableInnerComponents.js create mode 100644 src/mixins/lb/tableHeightMixin.js diff --git a/src/components/RuoYi/Doc/index.vue b/src/components/RuoYi/Doc/index.vue deleted file mode 100644 index af9155b7..00000000 --- a/src/components/RuoYi/Doc/index.vue +++ /dev/null @@ -1,21 +0,0 @@ - - - diff --git a/src/components/RuoYi/Git/index.vue b/src/components/RuoYi/Git/index.vue deleted file mode 100644 index b0d15f01..00000000 --- a/src/components/RuoYi/Git/index.vue +++ /dev/null @@ -1,21 +0,0 @@ - - - diff --git a/src/components/tableInnerComponents.js b/src/components/tableInnerComponents.js new file mode 100644 index 00000000..53fcff1d --- /dev/null +++ b/src/components/tableInnerComponents.js @@ -0,0 +1,60 @@ +/** + * 本文件保存一些 BaseTable 会用到的组件 + */ + +// 操作按钮 +export const TableBtn = { + name: 'TableBtn', + props: ['injectData'], + data() { + return {}; + }, + methods: { + handleClick() { + this.$emit('emitData', { + action: this.injectData.label, + value: this.injectData, + }); + }, + }, + render: function (h) { + return ( + + {this.injectData.entryText} + + ); + }, +}; + +// 余量 +export const RemainBox = { + name: 'RemainBox', + props: ['injectData'], + data() { + return {}; + }, + computed: { + value() { + return this.injectData[this.injectData.prop] || null; + }, + color() { + if (this.value) { + const v = +this.value; + return v < 0 ? '#FF5454' : v >= 0 && v < 2 ? '#FFD767' : '#37D97F'; + } + return 'unset'; + }, + }, + render: function (h) { + return ( +
+ {this.injectData[this.injectData.prop]?.toFixed(0) || ''} +
+ ); + }, +}; diff --git a/src/mixins/lb/tableHeightMixin.js b/src/mixins/lb/tableHeightMixin.js new file mode 100644 index 00000000..f8495e1b --- /dev/null +++ b/src/mixins/lb/tableHeightMixin.js @@ -0,0 +1,18 @@ +export default { + data() { + return { + tableH: this.tableHeight(260), + }; + }, + created() { + window.addEventListener('resize', this._setTableHeight); + }, + destroyed() { + window.removeEventListener('resize', this._setTableHeight); + }, + methods: { + _setTableHeight() { + this.tableH = this.tableHeight(260); + }, + }, +}; diff --git a/src/views/specialEquipment/basic/FireFighthing.vue b/src/views/specialEquipment/basic/FireFighthing.vue index d8494b01..f9128ae5 100644 --- a/src/views/specialEquipment/basic/FireFighthing.vue +++ b/src/views/specialEquipment/basic/FireFighthing.vue @@ -19,6 +19,7 @@ :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-data="list" + :max-height="tableH" @emitFun="handleEmitFun"> import moment from 'moment'; import basicPageMixin from '@/mixins/lb/basicPageMixin'; +import tableHeightMixin from '@/mixins/lb/tableHeightMixin'; import EquipmentDrawer from '../components/firefightingDrawer'; import BaseDialogWrapper from '../components/BaseDialogWrapper.vue'; @@ -135,7 +137,7 @@ export default { EquipmentDrawer, BaseDialog: BaseDialogWrapper, }, - mixins: [basicPageMixin], + mixins: [basicPageMixin, tableHeightMixin], data() { return { searchBarKeys: ['name', 'code'], @@ -160,17 +162,28 @@ export default { : undefined, ].filter((v) => v), tableProps: [ - { prop: 'name', label: '设备名称' }, - { width: 256, prop: 'code', label: '设备编码' }, - { prop: 'location', label: '位置' }, - { prop: 'responsiblePeopleName', label: '负责人' }, + { prop: 'name', label: '设备名称', showOverflowtooltip: true }, + { + width: 200, + prop: 'code', + label: '设备编码', + showOverflowtooltip: true, + }, + { prop: 'location', label: '位置', showOverflowtooltip: true }, + { + prop: 'responsiblePeopleName', + label: '负责人', + showOverflowtooltip: true, + }, { prop: 'dueDate', + width: 200, label: '有效期至', + howOverflowTooltip: true, filter: (val) => val != null ? moment(val).format('yyyy-MM-DD HH:mm:ss') : '--', }, - { prop: 'remark', label: '备注' }, + { prop: 'remark', label: '备注', showOverflowtooltip: true }, ], searchBarFormConfig: [ { @@ -285,7 +298,7 @@ export default { // 查询参数 queryParams: { pageNo: 1, - pageSize: 10, + pageSize: 20, code: '', name: '', }, diff --git a/src/views/specialEquipment/basic/Manage.vue b/src/views/specialEquipment/basic/Manage.vue index e9b34803..2fe9c9fc 100644 --- a/src/views/specialEquipment/basic/Manage.vue +++ b/src/views/specialEquipment/basic/Manage.vue @@ -19,6 +19,7 @@ :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-data="list" + :max-height="tableH" @emitFun="handleEmitFun"> import moment from 'moment'; import basicPageMixin from '@/mixins/lb/basicPageMixin'; +import tableHeightMixin from '@/mixins/lb/tableHeightMixin'; import EquipmentDrawer from '../components/manageDrawer'; import BaseDialogWrapper from '../components/BaseDialogWrapper.vue'; @@ -133,9 +135,9 @@ export default { components: { Editor, EquipmentDrawer, - BaseDialog: BaseDialogWrapper + BaseDialog: BaseDialogWrapper, }, - mixins: [basicPageMixin], + mixins: [basicPageMixin, tableHeightMixin], data() { return { searchBarKeys: ['name', 'code'], @@ -167,11 +169,20 @@ export default { // width: 180, // filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), // }, - { prop: 'name', label: '设备名称' }, - { width: 256, prop: 'code', label: '设备编码' }, - { prop: 'location', label: '位置' }, - { prop: 'responsiblePeopleName', label: '负责人' }, - { prop: 'remark', label: '备注' }, + { prop: 'name', label: '设备名称', showOverflowtooltip: true }, + { + width: 256, + prop: 'code', + label: '设备编码', + showOverflowtooltip: true, + }, + { prop: 'location', label: '位置', showOverflowtooltip: true }, + { + prop: 'responsiblePeopleName', + label: '负责人', + showOverflowtooltip: true, + }, + { prop: 'remark', label: '备注', showOverflowtooltip: true }, ], searchBarFormConfig: [ { @@ -277,7 +288,7 @@ export default { // 查询参数 queryParams: { pageNo: 1, - pageSize: 10, + pageSize: 20, code: '', name: '', }, @@ -407,15 +418,15 @@ export default { // this.title = '修改设备'; // }); }, - handleDetail(row, mode='detail') { - const {id} = row; + handleDetail(row, mode = 'detail') { + const { id } = row; this.form.id = id; // 打开抽屉 this.editMode = mode; this.editVisible = true; this.$nextTick(() => { this.$refs['drawer'].init(); - }) + }); // this.reset(); // this.showUploadComponents = false; // const id = row.id; diff --git a/src/views/specialEquipment/basic/Safety.vue b/src/views/specialEquipment/basic/Safety.vue index 63c5abf8..5d8c3a9b 100644 --- a/src/views/specialEquipment/basic/Safety.vue +++ b/src/views/specialEquipment/basic/Safety.vue @@ -19,6 +19,7 @@ :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-data="list" + :max-height="tableH" @emitFun="handleEmitFun"> import moment from 'moment'; import basicPageMixin from '@/mixins/lb/basicPageMixin'; +import tableHeightMixin from '@/mixins/lb/tableHeightMixin'; import EquipmentDrawer from '../components/safetyDrawer'; import { createEquipment, @@ -134,7 +136,7 @@ export default { EquipmentDrawer, BaseDialog: BaseDialogWrapper, }, - mixins: [basicPageMixin], + mixins: [basicPageMixin, tableHeightMixin], data() { return { searchBarKeys: ['name', 'code'], @@ -166,11 +168,20 @@ export default { // width: 180, // filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), // }, - { prop: 'name', label: '设备名称' }, - { width: 256, prop: 'code', label: '设备编码' }, - { prop: 'location', label: '位置' }, - { prop: 'responsiblePeopleName', label: '负责人' }, - { prop: 'remark', label: '备注' }, + { prop: 'name', label: '设备名称', showOverflowtooltip: true }, + { + width: 200, + prop: 'code', + label: '设备编码', + showOverflowtooltip: true, + }, + { prop: 'location', label: '位置', showOverflowtooltip: true }, + { + prop: 'responsiblePeopleName', + label: '负责人', + showOverflowtooltip: true, + }, + { prop: 'remark', label: '备注', showOverflowtooltip: true }, ], searchBarFormConfig: [ { @@ -275,7 +286,7 @@ export default { // 查询参数 queryParams: { pageNo: 1, - pageSize: 10, + pageSize: 20, code: '', name: '', }, diff --git a/src/views/specialEquipment/check/CheckOrderListTable.vue b/src/views/specialEquipment/check/CheckOrderListTable.vue index 066b67fe..c231f6d8 100644 --- a/src/views/specialEquipment/check/CheckOrderListTable.vue +++ b/src/views/specialEquipment/check/CheckOrderListTable.vue @@ -9,6 +9,7 @@ - + - + @@ -46,12 +62,18 @@ - + @@ -59,6 +81,8 @@