diff --git a/src/directive/index.js b/src/directive/index.js index 5ddedd46..792f4350 100644 --- a/src/directive/index.js +++ b/src/directive/index.js @@ -16,8 +16,8 @@ const install = function(Vue) { Vue.directive('dialogDragWidth', dialogDragWidth) Vue.directive('dialogDragHeight', dialogDragHeight) Vue.directive('dialogFullScreen', dialogFullScreen) - Vue.directive('elTableResizeHeight', elTableResizeHeight) - // v-elTableResizeHeight="{bottomOffset: 85}" + Vue.directive('doTableResizeHeight', elTableResizeHeight) + // v-doTableResizeHeight="{topSearchFormRef: 'queryForm'}" Vue.directive('el-select-loadmore', elSelectLoadmore); } diff --git a/src/directive/table/resizeHeight.js b/src/directive/table/resizeHeight.js index 11ebaa19..120a4dd7 100644 --- a/src/directive/table/resizeHeight.js +++ b/src/directive/table/resizeHeight.js @@ -1,3 +1,5 @@ + // v-doTableResizeHeight="{topSearchFormRef: 'queryForm'}" + // 设置表格高度 const doResize = async (el, binding, vnode) => { // 获取表格Dom对象 @@ -9,17 +11,32 @@ const doResize = async (el, binding, vnode) => { value } = binding - if (!$table.height) { - throw new Error(`el-$table must set the height. Such as height='100px'`) - } - // 获取距底部距离(用于展示页码等信息) - const bottomOffset = (value && value.bottomOffset) || 30 + console.log("=====>1111==>"); + console.log($table); + console.log($table.searchFormRef); + + + this.$nextTick(function() { + let queryFormEl = this.$refs[$table.searchFormRef].$el; + console.log( queryFormEl ); + let tableH = queryFormEl.offsetHeight+190; + tableHeight = window.innerHeight - tableH; + $table.layout.setHeight(tableHeight) + }); + + // if (!$table.height) { + // throw new Error(`el-$table must set the height. Such as height='100px'`) + // } + // 获取距底部距离(用于展示页码等信息) + // const bottomOffset = (value && value.bottomOffset) || 30 + + // if (!$table) return + - if (!$table) return // 计算列表高度并设置 - const height = window.innerHeight - el.getBoundingClientRect().top - bottomOffset - $table.layout.setHeight(height) + // const height = window.innerHeight - el.getBoundingClientRect().top - bottomOffset + // $table.layout.setHeight(height) $table.doLayout() } diff --git a/src/main.js b/src/main.js index 17c219ab..4c18c159 100644 --- a/src/main.js +++ b/src/main.js @@ -54,6 +54,8 @@ import DictData from '@/components/DictData' // XdTable import XdTable from "@/components/XdTable" +import XdPageContainer from "@/components/XdPageContainer" + import XdTextareaInput from "@/components/XdTextareaInput" // XdDialog @@ -118,6 +120,7 @@ Vue.component('ImageOneUpload', ImageOneUpload) Vue.component('ImagePreview', ImagePreview) Vue.component('CustomDatePicker', CustomDatePicker) Vue.component('XdTable', XdTable) +Vue.component('XdPageContainer', XdPageContainer) Vue.component('XdDialog', XdDialog) Vue.component('SearchForm', SearchForm) Vue.component('XdTextareaInput', XdTextareaInput) diff --git a/src/views/emis/emisCustomerAddress/recipientAddress.vue b/src/views/emis/emisCustomerAddress/recipientAddress.vue index fba5da95..3cc3f49a 100644 --- a/src/views/emis/emisCustomerAddress/recipientAddress.vue +++ b/src/views/emis/emisCustomerAddress/recipientAddress.vue @@ -1,6 +1,6 @@