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 @@ - - - - - - - - - - - - - - - - - - - - - - - +
+ + + + + + + + + + + + + + + + + + + + + + + +
- - - - - - - - - - - - - - - - - - - - - - - - +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
- - -