From eb594c0c21d5557ab4a2c8d13bded421a38bb67b Mon Sep 17 00:00:00 2001 From: xd <844539747@qq.com> Date: Wed, 10 Jul 2024 16:36:34 +0800 Subject: [PATCH] ' --- ruoyi-ui/src/directive/index.js | 2 + ruoyi-ui/src/directive/table/tableHeight.js | 35 +++ .../src/views/clMaterial/clMaterial/index.vue | 64 ++--- .../src/views/customer/customer/index.vue | 96 ++++---- ruoyi-ui/src/views/factory/factory/index.vue | 68 +++--- .../src/views/material/material/index.vue | 68 +++--- .../views/materialType/materialType/index.vue | 62 ++--- ruoyi-ui/src/views/monitor/job/index.vue | 104 ++++---- .../src/views/monitor/logininfor/index.vue | 42 ++-- ruoyi-ui/src/views/monitor/online/index.vue | 72 +++--- ruoyi-ui/src/views/monitor/operlog/index.vue | 80 ++++--- .../priceVerification/index.vue | 75 +++--- ruoyi-ui/src/views/quot/quot/index.vue | 223 +++++++++--------- ruoyi-ui/src/views/redBook/quots.vue | 48 ++-- .../src/views/sysSapUser/sysSapUser/index.vue | 56 ++--- ruoyi-ui/src/views/system/config/index.vue | 75 +++--- ruoyi-ui/src/views/system/dept/index.vue | 97 ++++---- ruoyi-ui/src/views/system/dict/index.vue | 84 +++---- ruoyi-ui/src/views/system/menu/index.vue | 109 ++++----- ruoyi-ui/src/views/system/notice/index.vue | 90 +++---- ruoyi-ui/src/views/system/post/index.vue | 72 +++--- ruoyi-ui/src/views/system/role/index.vue | 100 ++++---- .../technicalConfirm/index.vue | 105 +++++---- ruoyi-ui/src/views/tool/gen/index.vue | 141 +++++------ 24 files changed, 1028 insertions(+), 940 deletions(-) create mode 100644 ruoyi-ui/src/directive/table/tableHeight.js diff --git a/ruoyi-ui/src/directive/index.js b/ruoyi-ui/src/directive/index.js index b9b07da..459a0d6 100644 --- a/ruoyi-ui/src/directive/index.js +++ b/ruoyi-ui/src/directive/index.js @@ -4,6 +4,7 @@ import dialogDrag from './dialog/drag' import dialogDragWidth from './dialog/dragWidth' import dialogDragHeight from './dialog/dragHeight' import clipboard from './module/clipboard' +import tableHeight from './table/tableHeight' const install = function(Vue) { Vue.directive('hasRole', hasRole) @@ -12,6 +13,7 @@ const install = function(Vue) { Vue.directive('dialogDrag', dialogDrag) Vue.directive('dialogDragWidth', dialogDragWidth) Vue.directive('dialogDragHeight', dialogDragHeight) + Vue.directive('tableHeight', tableHeight) } if (window.Vue) { diff --git a/ruoyi-ui/src/directive/table/tableHeight.js b/ruoyi-ui/src/directive/table/tableHeight.js new file mode 100644 index 0000000..57bb62e --- /dev/null +++ b/ruoyi-ui/src/directive/table/tableHeight.js @@ -0,0 +1,35 @@ +import { addResizeListener, removeResizeListener } from 'element-ui/src/utils/resize-event' + +// 设置表格高度 +const doResize = (el, binding) => { + // 获取调用传递过来的数据 + const { value } = binding + // 获取距底部距离(用于展示页码等信息) + const customHeight = (value && value.customHeight) || 76 + // 计算列表高度 + const height = window.innerHeight - el.getBoundingClientRect().top - customHeight + // 设置高度 + el.style.height = height + "px" +} + +export default { + // 初始化设置 + bind(el, binding) { + // 设置resize监听方法 + el.resizeListener = () => { + doResize(el, binding) + } + // 绑定监听方法到addResizeListener + addResizeListener(window.document.body, el.resizeListener) + }, + // 所在组件的 VNode 更新时设置 + // 页面上搜索表单是可以展开收起的,当展开更多表单搜索时,表格高度没变 + update(el, binding) { + doResize(el, binding) + }, + // 销毁时设置 + unbind(el) { + // 移除resize监听 + removeResizeListener(window.document.body, el.resizeListener) + } +} diff --git a/ruoyi-ui/src/views/clMaterial/clMaterial/index.vue b/ruoyi-ui/src/views/clMaterial/clMaterial/index.vue index e53fabd..f452c84 100644 --- a/ruoyi-ui/src/views/clMaterial/clMaterial/index.vue +++ b/ruoyi-ui/src/views/clMaterial/clMaterial/index.vue @@ -89,37 +89,39 @@ - - - - - - - - - - - - - - +
+ + + + + + + + + + + + + + +
- - - - - - - - - - - - - - - - - - - - - - - - +
+ + + + + + + + + + + + + + + + + + + + + + + + +
- - - - - - - - - - - - - - - - - - +
+ + + + + + + + + + + + + + + + + + +
- - - - - - - - - - - - - - - - +
+ + + + + + + + + + + + + + + + +
- - - - - - - - - - - - - +
+ + + + + + + + + + + + + +
- - - - - - - - - - - - - - - - +
+ + + + + + + + + + + + + + + + +
- - - - - - - - - - - - - - - - +
+ + + + + + + + + + + + + + + + +
- - - - - - - - - - - - - - - - - - + +
+ + + + + + + + + + + + + + + + + + +
diff --git a/ruoyi-ui/src/views/monitor/operlog/index.vue b/ruoyi-ui/src/views/monitor/operlog/index.vue index 4a1828f..156a3d9 100644 --- a/ruoyi-ui/src/views/monitor/operlog/index.vue +++ b/ruoyi-ui/src/views/monitor/operlog/index.vue @@ -111,45 +111,47 @@ - - - - - - - - - - - - - - - - - - - - - - - +
+ + + + + + + + + + + + + + + + + + + + + + + +
- - - - - - - - - - - - - - - - - - - - - - - - +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
- - -