|
@@ -19,7 +19,7 @@
|
|
|
row-id="id"
|
|
row-id="id"
|
|
|
:ref="name"
|
|
:ref="name"
|
|
|
:tableWidth="width + 'px'"
|
|
:tableWidth="width + 'px'"
|
|
|
- :height="height +'px'"
|
|
|
|
|
|
|
+ :height="autoHeight?'auto':(height +'px')"
|
|
|
:stripe="true"
|
|
:stripe="true"
|
|
|
:show-header="showHeader"
|
|
:show-header="showHeader"
|
|
|
auto-resize
|
|
auto-resize
|
|
@@ -30,7 +30,7 @@
|
|
|
:checkbox-config="{range:checkRange,showHeader:showCheckboxHeader,visibleMethod: checkboxMethod}"
|
|
:checkbox-config="{range:checkRange,showHeader:showCheckboxHeader,visibleMethod: checkboxMethod}"
|
|
|
:footer-method="footerMethod"
|
|
:footer-method="footerMethod"
|
|
|
:data="dataFinal"
|
|
:data="dataFinal"
|
|
|
- :menu-config="{visibleMethod:visibleMethod,body:header,header:header}"
|
|
|
|
|
|
|
+ :menu-config="{ visibleMethod:visibleMethod,header:header,body:header}"
|
|
|
@contextmenu.native.prevent
|
|
@contextmenu.native.prevent
|
|
|
@scroll="handleScroll"
|
|
@scroll="handleScroll"
|
|
|
@cell-menu="cellMenu"
|
|
@cell-menu="cellMenu"
|
|
@@ -60,6 +60,36 @@
|
|
|
<p>{{ vm.$t('appNoData') }}</p>
|
|
<p>{{ vm.$t('appNoData') }}</p>
|
|
|
</template>
|
|
</template>
|
|
|
</vxe-table>
|
|
</vxe-table>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- <DkModal-->
|
|
|
|
|
+ <!-- v-model="menuFlag"-->
|
|
|
|
|
+ <!-- :closable="false"-->
|
|
|
|
|
+ <!-- :saveFlag="true"-->
|
|
|
|
|
+ <!-- :footer-flag="false"-->
|
|
|
|
|
+ <!-- :width="200"-->
|
|
|
|
|
+ <!-- >-->
|
|
|
|
|
+ <!-- <DropdownMenu style="line-height: 0;">-->
|
|
|
|
|
+ <!-- <Dropdown placement="right-start"-->
|
|
|
|
|
+ <!-- v-for="(item, index) of header.options[0].filter(it=>it.children && it.children.length > 0)"-->
|
|
|
|
|
+ <!-- :key="index">-->
|
|
|
|
|
+ <!-- <DropdownItem >-->
|
|
|
|
|
+ <!-- {{ $t(item.name) }}-->
|
|
|
|
|
+ <!-- <Icon v-if="item.children && item.children.length > 0" type="ios-arrow-forward"></Icon>-->
|
|
|
|
|
+ <!-- </DropdownItem>-->
|
|
|
|
|
+ <!-- <DropdownMenu slot="list" placement="right" v-if="item.children && item.children.length > 0">-->
|
|
|
|
|
+ <!-- <DropdownItem v-for="(t,index) in item?.children" :key="index+'l'" :name="t.key" @click.native="menuClick(t)"-->
|
|
|
|
|
+ <!-- >-->
|
|
|
|
|
+ <!-- {{ t.name }}-->
|
|
|
|
|
+ <!-- </DropdownItem>-->
|
|
|
|
|
+ <!-- </DropdownMenu>-->
|
|
|
|
|
+ <!-- </Dropdown>-->
|
|
|
|
|
+ <!-- <DropdownItem v-for="(item, index) of header.options[0].filter(it=>!it.children)" :key="'c'+ index"-->
|
|
|
|
|
+ <!-- @click.native="menuClick(item)">-->
|
|
|
|
|
+ <!-- {{ $t(item.name) }}-->
|
|
|
|
|
+ <!-- </DropdownItem>-->
|
|
|
|
|
+ <!-- </DropdownMenu>-->
|
|
|
|
|
+ <!-- </DkModal>-->
|
|
|
|
|
+
|
|
|
<!--设置-->
|
|
<!--设置-->
|
|
|
<div class="setting-class" v-if="showSettingFlag && settingLeft"
|
|
<div class="setting-class" v-if="showSettingFlag && settingLeft"
|
|
|
:style="'top:' + settingTop + ';left:' + settingLeft"
|
|
:style="'top:' + settingTop + ';left:' + settingLeft"
|
|
@@ -69,7 +99,7 @@
|
|
|
<!-- 全屏 -->
|
|
<!-- 全屏 -->
|
|
|
<div class="setting-class" v-if="showSettingFlag && settingLeft "
|
|
<div class="setting-class" v-if="showSettingFlag && settingLeft "
|
|
|
:style="'top:' + settingTop + ';left:' + (parseInt(settingLeft.replace('px', '')) - 20) + 'px'"
|
|
:style="'top:' + settingTop + ';left:' + (parseInt(settingLeft.replace('px', '')) - 20) + 'px'"
|
|
|
- @click="fullModal = true">
|
|
|
|
|
|
|
+ @click="handleMax">
|
|
|
<icon type="iconfont iconfont icon-max1"></icon>
|
|
<icon type="iconfont iconfont icon-max1"></icon>
|
|
|
</div>
|
|
</div>
|
|
|
<!--不能用上面的,因为会根据settingLeft来设置,这个有滞后性-->
|
|
<!--不能用上面的,因为会根据settingLeft来设置,这个有滞后性-->
|
|
@@ -78,19 +108,28 @@
|
|
|
<div id="pageInfo" v-if="pageTotalFlag || pageFlag || treeFlag"
|
|
<div id="pageInfo" v-if="pageTotalFlag || pageFlag || treeFlag"
|
|
|
class="table-foot-class">
|
|
class="table-foot-class">
|
|
|
<div style="display: flex;align-items: center">
|
|
<div style="display: flex;align-items: center">
|
|
|
- <span v-if="pageTotalFlag"
|
|
|
|
|
- class="table-choose-foot">{{
|
|
|
|
|
- selectFlag && batchKeys.length > 0 ? vm.$t('chosedText') + batchKeys.length + vm.$t('items') + ',' : ''
|
|
|
|
|
- }}{{ vm.$t('total') + getTotalCount() + vm.$t('items') }}
|
|
|
|
|
- <Tag style="background: #2E406B" color="#fff" v-if="clearBtnText && dataFinal.length > 0">{{
|
|
|
|
|
- clearBtnText
|
|
|
|
|
- }}</Tag>
|
|
|
|
|
- <span v-if="filterContent.length>0 "> {{
|
|
|
|
|
- '【' + vm.$t('filtered') + ' ' + dataFinal.length + vm.$t('items') + '】'
|
|
|
|
|
- }} </span>
|
|
|
|
|
- <Tag class="filter-button" v-for="(it,index) in filterContent" @click.native="handleClick(it)"
|
|
|
|
|
- :key="index" :name="it" closable @on-close="closeTagFilterContent">{{ it }}</Tag>
|
|
|
|
|
- </span>
|
|
|
|
|
|
|
+ <div v-if="pageTotalFlag"
|
|
|
|
|
+ class="table-choose-foot" style="display: flex">
|
|
|
|
|
+ <!--多选才会体现已选数据-->
|
|
|
|
|
+ <div v-if="chooseFlag && multiple">
|
|
|
|
|
+ {{
|
|
|
|
|
+ selectFlag && batchKeys.length > 0 ? vm.$t('chosedText') + batchKeys.length + vm.$t('items') + ',' : ''
|
|
|
|
|
+ }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ {{ vm.$t('total') + getTotalCount() + vm.$t('items') }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <Tag style="background: #2E406B" color="#fff" v-if="clearBtnText && dataFinal.length > 0">{{
|
|
|
|
|
+ clearBtnText
|
|
|
|
|
+ }}
|
|
|
|
|
+ </Tag>
|
|
|
|
|
+ <span v-if="filterContent.length>0 "> {{
|
|
|
|
|
+ '【' + vm.$t('filtered') + ' ' + dataFinal.length + vm.$t('items') + '】'
|
|
|
|
|
+ }} </span>
|
|
|
|
|
+ <Tag class="filter-button" v-for="(it,index) in filterContent" @click.native="handleClick(it)"
|
|
|
|
|
+ :key="index" :name="it" closable @on-close="closeTagFilterContent">{{ it }}
|
|
|
|
|
+ </Tag>
|
|
|
|
|
+ </div>
|
|
|
<!--展开收缩按钮-->
|
|
<!--展开收缩按钮-->
|
|
|
<div style="display: flex;padding-left: 5px" v-if="treeFlag">
|
|
<div style="display: flex;padding-left: 5px" v-if="treeFlag">
|
|
|
<Button type="default" size="small" @click="expandAll" style="margin-left: 2px">
|
|
<Button type="default" size="small" @click="expandAll" style="margin-left: 2px">
|
|
@@ -107,7 +146,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <Page v-if="pageFlag" :page-size="pageInfo.pageSize" :current="pageInfo.currentPage"
|
|
|
|
|
|
|
+ <Page v-if="pageFlag" :page-size="pageSize?pageSize: pageInfo.pageSize" :current="pageInfo.currentPage"
|
|
|
:page-size-opts="pageSizeOpts" :total="pageInfo.total" size="small"
|
|
:page-size-opts="pageSizeOpts" :total="pageInfo.total" size="small"
|
|
|
show-elevator show-sizer
|
|
show-elevator show-sizer
|
|
|
@on-change="currentPageChange" @on-page-size-change="pageSizeChange"
|
|
@on-change="currentPageChange" @on-page-size-change="pageSizeChange"
|
|
@@ -115,49 +154,54 @@
|
|
|
<div v-else></div>
|
|
<div v-else></div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <!--全屏-->
|
|
|
|
|
- <DkModal
|
|
|
|
|
- v-model="fullModal"
|
|
|
|
|
- :saveFlag="true"
|
|
|
|
|
- fullscreen
|
|
|
|
|
- :title="vm.$t('tableFullScreen')"
|
|
|
|
|
- :footer-flag="false"
|
|
|
|
|
- >
|
|
|
|
|
- <vxe-table
|
|
|
|
|
- :cell-style="cellStyle"
|
|
|
|
|
- :footer-cell-style="footCellStyle"
|
|
|
|
|
- align="center"
|
|
|
|
|
- size="mini"
|
|
|
|
|
- :border="border"
|
|
|
|
|
- row-id="id"
|
|
|
|
|
- :tableWidth="width + 'px'"
|
|
|
|
|
- height="auto"
|
|
|
|
|
- :stripe="true"
|
|
|
|
|
- :show-header="showHeader"
|
|
|
|
|
- auto-resize
|
|
|
|
|
- :scroll-y="{gt:20}"
|
|
|
|
|
- :sort-config="{showIcon:sortable}"
|
|
|
|
|
- :column-config="{isCurrent: true, isHover: true, resizable: true}"
|
|
|
|
|
- :show-footer="showFooter"
|
|
|
|
|
- :checkbox-config="{range:checkRange,showHeader:showCheckboxHeader,visibleMethod: checkboxMethod}"
|
|
|
|
|
- :footer-method="footerMethod"
|
|
|
|
|
- :data="dataFinal"
|
|
|
|
|
- :tooltip-config="{contentMethod:loadTipContentMethod,enterable: true}"
|
|
|
|
|
- :tree-config="treeFlag?{transform: treeFlag, rowField: treeRowField, parentField: parentField,lazy: lazy, hasChild: 'hasChild', loadMethod: loadChildrenMethod, children: treeChildren}:undefined"
|
|
|
|
|
- :radio-config="{highlight: true,strict: true,checkField: 'checked',
|
|
|
|
|
- trigger: triggerFlag ? 'row' :null ,checkMethod:checkMethodFlag ? checkRadioMethod : null }"
|
|
|
|
|
- :row-config="{isCurrent: true, isHover: true}"
|
|
|
|
|
- >
|
|
|
|
|
- <DkTableColumn type="seq" width="45" fixed="left" :show-tip="showTip" :seq-tip-content="seqTipContent"
|
|
|
|
|
- :chooseDataFlag="chooseDataFlag"
|
|
|
|
|
- :add-flag="addFlag"></DkTableColumn>
|
|
|
|
|
- <slot></slot>
|
|
|
|
|
- <template #empty>
|
|
|
|
|
- <img src="@/assets/images/empty.png" style="width: 90px;height: 85px;"/>
|
|
|
|
|
- <p>{{ vm.$t('appNoData') }}</p>
|
|
|
|
|
- </template>
|
|
|
|
|
- </vxe-table>
|
|
|
|
|
- </DkModal>
|
|
|
|
|
|
|
+ <!-- <DkModal-->
|
|
|
|
|
+ <!-- v-model="fullModal"-->
|
|
|
|
|
+ <!-- :saveFlag="true"-->
|
|
|
|
|
+ <!-- fullscreen-->
|
|
|
|
|
+ <!-- :title="vm.$t('tableFullScreen')"-->
|
|
|
|
|
+ <!-- :footer-flag="false"-->
|
|
|
|
|
+ <!-- >-->
|
|
|
|
|
+ <!-- <vxe-table-->
|
|
|
|
|
+ <!-- :cell-style="cellStyle"-->
|
|
|
|
|
+ <!-- :footer-cell-style="footCellStyle"-->
|
|
|
|
|
+ <!-- align="center"-->
|
|
|
|
|
+ <!-- size="mini"-->
|
|
|
|
|
+ <!-- :border="border"-->
|
|
|
|
|
+ <!-- row-id="id"-->
|
|
|
|
|
+ <!-- :tableWidth="width + 'px'"-->
|
|
|
|
|
+ <!-- height="auto"-->
|
|
|
|
|
+ <!-- :stripe="true"-->
|
|
|
|
|
+ <!-- :show-header="showHeader"-->
|
|
|
|
|
+ <!-- auto-resize-->
|
|
|
|
|
+ <!-- :scroll-y="{gt:20}"-->
|
|
|
|
|
+ <!-- :sort-config="{showIcon:sortable}"-->
|
|
|
|
|
+ <!-- :column-config="{isCurrent: true, isHover: true, resizable: true}"-->
|
|
|
|
|
+ <!-- :show-footer="showFooter"-->
|
|
|
|
|
+ <!-- :checkbox-config="{range:checkRange,showHeader:showCheckboxHeader,visibleMethod: checkboxMethod}"-->
|
|
|
|
|
+ <!-- :footer-method="footerMethod"-->
|
|
|
|
|
+ <!-- :menu-config="{ visibleMethod:visibleMethod,header:header,body:header}"-->
|
|
|
|
|
+ <!-- @contextmenu.native.prevent-->
|
|
|
|
|
+ <!-- @scroll="handleScroll"-->
|
|
|
|
|
+ <!-- @cell-menu="cellMenu"-->
|
|
|
|
|
+ <!-- @menu-click="menuClick"-->
|
|
|
|
|
+ <!-- @cell-click="cellClick"-->
|
|
|
|
|
+ <!-- :data="dataFinal"-->
|
|
|
|
|
+ <!-- :tooltip-config="{contentMethod:loadTipContentMethod,enterable: true}"-->
|
|
|
|
|
+ <!-- :tree-config="treeFlag?{transform: treeFlag, rowField: treeRowField, parentField: parentField,lazy: lazy, hasChild: 'hasChild', loadMethod: loadChildrenMethod, children: treeChildren}:undefined"-->
|
|
|
|
|
+ <!-- :radio-config="{highlight: true,strict: true,checkField: 'checked',-->
|
|
|
|
|
+ <!-- trigger: triggerFlag ? 'row' :null ,checkMethod:checkMethodFlag ? checkRadioMethod : null }"-->
|
|
|
|
|
+ <!-- :row-config="{isCurrent: true, isHover: true}"-->
|
|
|
|
|
+ <!-- >-->
|
|
|
|
|
+ <!-- <DkTableColumn type="seq" width="45" fixed="left" :show-tip="showTip" :seq-tip-content="seqTipContent"-->
|
|
|
|
|
+ <!-- :chooseDataFlag="chooseDataFlag"-->
|
|
|
|
|
+ <!-- :add-flag="addFlag"></DkTableColumn>-->
|
|
|
|
|
+ <!-- <slot></slot>-->
|
|
|
|
|
+ <!-- <template #empty>-->
|
|
|
|
|
+ <!-- <img src="@/assets/images/empty.png" style="width: 90px;height: 85px;"/>-->
|
|
|
|
|
+ <!-- <p>{{ vm.$t('appNoData') }}</p>-->
|
|
|
|
|
+ <!-- </template>-->
|
|
|
|
|
+ <!-- </vxe-table>-->
|
|
|
|
|
+ <!-- </DkModal>-->
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -243,6 +287,11 @@ export default {
|
|
|
return [100, 200, 500, 1000]
|
|
return [100, 200, 500, 1000]
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ //每页行数
|
|
|
|
|
+ pageSize: {
|
|
|
|
|
+ type: Number,
|
|
|
|
|
+ default: null
|
|
|
|
|
+ },
|
|
|
// 是否显示已选条数
|
|
// 是否显示已选条数
|
|
|
selectFlag: {
|
|
selectFlag: {
|
|
|
type: Boolean,
|
|
type: Boolean,
|
|
@@ -460,8 +509,13 @@ export default {
|
|
|
},
|
|
},
|
|
|
// 是否显示右键菜单
|
|
// 是否显示右键菜单
|
|
|
cellMenuFlag: {
|
|
cellMenuFlag: {
|
|
|
- Type: Boolean,
|
|
|
|
|
|
|
+ type: Boolean,
|
|
|
default: true
|
|
default: true
|
|
|
|
|
+ },
|
|
|
|
|
+ // 是否自动高度
|
|
|
|
|
+ autoHeight: {
|
|
|
|
|
+ type: Boolean,
|
|
|
|
|
+ default: false
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
provide() {
|
|
provide() {
|
|
@@ -532,10 +586,9 @@ export default {
|
|
|
]
|
|
]
|
|
|
]
|
|
]
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
pageInfo: {
|
|
pageInfo: {
|
|
|
total: 0,
|
|
total: 0,
|
|
|
- pageSize: this.$config.pageSize,
|
|
|
|
|
|
|
+ pageSize: self.pageSize ? self.pageSize : this.$config.pageSize,
|
|
|
currentPage: 1
|
|
currentPage: 1
|
|
|
},
|
|
},
|
|
|
batchKeys: [],
|
|
batchKeys: [],
|
|
@@ -558,7 +611,8 @@ export default {
|
|
|
settingTop: null, // 设置图标居上的位置
|
|
settingTop: null, // 设置图标居上的位置
|
|
|
chooseTop: null, // 全选图标居上的位置
|
|
chooseTop: null, // 全选图标居上的位置
|
|
|
chooseLeft: null, // 全选图标居左的位置
|
|
chooseLeft: null, // 全选图标居左的位置
|
|
|
- fullModal: false, // 全屏显示
|
|
|
|
|
|
|
+ menuFlag: false,// 右键菜单状态
|
|
|
|
|
+ cellMenuObj: null,// 右键点击的实体
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
@@ -691,21 +745,43 @@ export default {
|
|
|
})
|
|
})
|
|
|
let columnIndex = 0;
|
|
let columnIndex = 0;
|
|
|
let hideNum = 0;
|
|
let hideNum = 0;
|
|
|
|
|
+ // this.$slots.default.forEach((it, index) => {
|
|
|
|
|
+ // if (it && it.componentInstance) {
|
|
|
|
|
+ // if (it.componentInstance.field != column.field) {
|
|
|
|
|
+ // it.componentInstance.freezeFlag = false;
|
|
|
|
|
+ // if (!it.componentInstance.visible) {
|
|
|
|
|
+ // hideNum++;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // columnIndex = this.chooseFlag ? (index + 2) : (index + 1);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // console.log('t3',it.componentInstance.field,column.field,it.componentInstance.freezeFlag)
|
|
|
|
|
+ // }
|
|
|
|
|
+ // })
|
|
|
|
|
+ tableColumns.visibleColumn.forEach((it, index) => {
|
|
|
|
|
+ if (it.field != column.field) {
|
|
|
|
|
+ // it.componentInstance.freezeFlag = false;
|
|
|
|
|
+ // if (!it.componentInstance.visible) {
|
|
|
|
|
+ // hideNum++;
|
|
|
|
|
+ // }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ columnIndex = this.chooseFlag ? index + 1 : index;
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ // 先把所有的图标去掉
|
|
|
this.$slots.default.forEach((it, index) => {
|
|
this.$slots.default.forEach((it, index) => {
|
|
|
if (it && it.componentInstance) {
|
|
if (it && it.componentInstance) {
|
|
|
- if (it.componentInstance.field != column.field) {
|
|
|
|
|
- it.componentInstance.freezeFlag = false;
|
|
|
|
|
- if (!it.componentInstance.visible) {
|
|
|
|
|
- hideNum++;
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- columnIndex = this.chooseFlag ? (index + 2) : (index + 1);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ it.componentInstance.freezeFlag = false;
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
- if (hideNum) {
|
|
|
|
|
- columnIndex = columnIndex - hideNum;
|
|
|
|
|
|
|
+ let filters = this.$slots.default.filter(it => it.componentInstance.field == column.field)
|
|
|
|
|
+ if (filters && filters.length > 0) {
|
|
|
|
|
+ filters[0].componentInstance.freezeFlag = true;
|
|
|
}
|
|
}
|
|
|
|
|
+ // if (hideNum) {
|
|
|
|
|
+ // columnIndex = columnIndex - hideNum;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // console.log('t3', hideNum,columnIndex,this.chooseFlag)
|
|
|
// 冻结该列之前的列,包括这列
|
|
// 冻结该列之前的列,包括这列
|
|
|
for (let i = 0; i <= columnIndex; i++) {
|
|
for (let i = 0; i <= columnIndex; i++) {
|
|
|
tableColumns.visibleColumn[i].fixed = 'left'
|
|
tableColumns.visibleColumn[i].fixed = 'left'
|
|
@@ -722,7 +798,9 @@ export default {
|
|
|
handleFreeze(e) {
|
|
handleFreeze(e) {
|
|
|
if (this.$slots.default && this.$slots.default.length > 0) {
|
|
if (this.$slots.default && this.$slots.default.length > 0) {
|
|
|
let columnIndex = e.columnIndex - (this.chooseFlag ? 2 : 1);
|
|
let columnIndex = e.columnIndex - (this.chooseFlag ? 2 : 1);
|
|
|
|
|
+ console.log('rrrr', columnIndex, this.$slots.default[columnIndex].componentInstance.handleFreeze)
|
|
|
if (this.$slots.default[columnIndex] && this.$slots.default[columnIndex].componentInstance.handleFreeze) {
|
|
if (this.$slots.default[columnIndex] && this.$slots.default[columnIndex].componentInstance.handleFreeze) {
|
|
|
|
|
+ console.log('t1')
|
|
|
this.$slots.default[columnIndex].componentInstance.handleFreeze(e);
|
|
this.$slots.default[columnIndex].componentInstance.handleFreeze(e);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -861,6 +939,7 @@ export default {
|
|
|
return it[e.column.field]
|
|
return it[e.column.field]
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
+ let col = e.column.params
|
|
|
if (col.type !== 'seq' && col.type !== 'radio' && col.type !== 'checkbox'
|
|
if (col.type !== 'seq' && col.type !== 'radio' && col.type !== 'checkbox'
|
|
|
&& col.type !== 'operate' && col.type !== 'image' && col.type !== 'button') {
|
|
&& col.type !== 'operate' && col.type !== 'image' && col.type !== 'button') {
|
|
|
columnValues.push(e.column.title + '占') // 把每列的表头也加进去算
|
|
columnValues.push(e.column.title + '占') // 把每列的表头也加进去算
|
|
@@ -1063,6 +1142,7 @@ export default {
|
|
|
return {textAlign: column.params.align}
|
|
return {textAlign: column.params.align}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
// column.property===?也可根据列名判断,也可根据column对象的属性灵活配置
|
|
// column.property===?也可根据列名判断,也可根据column对象的属性灵活配置
|
|
|
for (let it of this.$slots.default) {
|
|
for (let it of this.$slots.default) {
|
|
|
if (it && it.componentInstance) {
|
|
if (it && it.componentInstance) {
|
|
@@ -1072,6 +1152,7 @@ export default {
|
|
|
return {textAlign: "center"}
|
|
return {textAlign: "center"}
|
|
|
}
|
|
}
|
|
|
if (it.componentInstance.columnType === 'number') {
|
|
if (it.componentInstance.columnType === 'number') {
|
|
|
|
|
+ // console.log('rrr',column.field,it.componentInstance.columnType)
|
|
|
return {textAlign: 'right'}
|
|
return {textAlign: 'right'}
|
|
|
} else if (it.componentInstance.columnType === 'checkbox' || it.componentInstance.columnType === 'date') {
|
|
} else if (it.componentInstance.columnType === 'checkbox' || it.componentInstance.columnType === 'date') {
|
|
|
return {textAlign: 'center'}
|
|
return {textAlign: 'center'}
|
|
@@ -1093,7 +1174,7 @@ export default {
|
|
|
if (it && it.componentInstance) {
|
|
if (it && it.componentInstance) {
|
|
|
if (it.componentInstance.field === column.property) {
|
|
if (it.componentInstance.field === column.property) {
|
|
|
if (it.componentInstance.columnType === 'number') {
|
|
if (it.componentInstance.columnType === 'number') {
|
|
|
- return {textAlign: 'right', background: '#FFF8E1',cursor:'pointer'}
|
|
|
|
|
|
|
+ return {textAlign: 'right', background: '#FFF8E1', cursor: 'pointer'}
|
|
|
} else {
|
|
} else {
|
|
|
return {textAlign: 'left', background: '#FFF8E1'}
|
|
return {textAlign: 'left', background: '#FFF8E1'}
|
|
|
}
|
|
}
|
|
@@ -1337,15 +1418,29 @@ export default {
|
|
|
* @date : 2023/2/23 13:39
|
|
* @date : 2023/2/23 13:39
|
|
|
*/
|
|
*/
|
|
|
cellMenu(e) {
|
|
cellMenu(e) {
|
|
|
-
|
|
|
|
|
|
|
+ // this.menuFlag = true;
|
|
|
|
|
+ // console.log('menuFlag', this.menuFlag,e)
|
|
|
|
|
+ // this.cellMenuObj = {...e};
|
|
|
this.$emit('cellMenu', e)
|
|
this.$emit('cellMenu', e)
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
|
|
+ contextMenuClick(e) {
|
|
|
|
|
+ // if (e.menu.children && e.menu.children.length > 0) {
|
|
|
|
|
+ // // this.$refs[this.name].closeMenu()
|
|
|
|
|
+ //
|
|
|
|
|
+ // console.log('ttt', e)
|
|
|
|
|
+ // return false;
|
|
|
|
|
+ // }
|
|
|
|
|
+ return true;
|
|
|
|
|
+ },
|
|
|
/**
|
|
/**
|
|
|
* @desc : 右键
|
|
* @desc : 右键
|
|
|
* @author : 周兴
|
|
* @author : 周兴
|
|
|
* @date : 2022/3/30 17:24
|
|
* @date : 2022/3/30 17:24
|
|
|
*/
|
|
*/
|
|
|
menuClick(e) {
|
|
menuClick(e) {
|
|
|
|
|
+ // e.menu = {...this.cellMenuObj}
|
|
|
|
|
+ // e.menu.code = e.code
|
|
|
if (e.menu.code == 'selfAdaption') {
|
|
if (e.menu.code == 'selfAdaption') {
|
|
|
this.autoWidthHandle()
|
|
this.autoWidthHandle()
|
|
|
} else if (e.menu.code == 'selfAdaptionOne') {
|
|
} else if (e.menu.code == 'selfAdaptionOne') {
|
|
@@ -1377,6 +1472,14 @@ export default {
|
|
|
}, 400)
|
|
}, 400)
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
|
|
|
+ * @desc : 点击菜单
|
|
|
|
|
+ * @author : 周兴
|
|
|
|
|
+ * @date : 2023/12/20 15:47
|
|
|
|
|
+ */
|
|
|
|
|
+ clickMenu(e) {
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+ /**
|
|
|
* @desc : 透视
|
|
* @desc : 透视
|
|
|
* @author : 周兴
|
|
* @author : 周兴
|
|
|
* @date : 2023/3/18 17:44
|
|
* @date : 2023/3/18 17:44
|
|
@@ -2047,6 +2150,50 @@ export default {
|
|
|
this.$emit('chooseData', row, rowIndex);
|
|
this.$emit('chooseData', row, rowIndex);
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
|
|
|
+ * @desc : 全屏
|
|
|
|
|
+ * @author : 周兴
|
|
|
|
|
+ * @date : 2023/12/21 16:37
|
|
|
|
|
+ */
|
|
|
|
|
+ handleMax() {
|
|
|
|
|
+ const tableColumns = this.$refs[this.name].getTableColumn()
|
|
|
|
|
+ if (tableColumns && tableColumns.visibleColumn) {
|
|
|
|
|
+ let columnsFull = tableColumns.visibleColumn.filter(it => it.type != 'seq'
|
|
|
|
|
+ && it.type != 'checkbox' && it.type != 'radio')
|
|
|
|
|
+ .map(it => {
|
|
|
|
|
+ let align = 'left';
|
|
|
|
|
+ if (it.params && it.params.align) {
|
|
|
|
|
+ align = it.params.align;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ let type = it.params?.type;
|
|
|
|
|
+ if (type === 'date' || type === 'switch' || type === 'checkbox' || it.params?.centerFlag) {
|
|
|
|
|
+ align = 'center';
|
|
|
|
|
+ } else if (type === 'number' || it.params?.dataType === 'number') {
|
|
|
|
|
+ align = 'right';
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ // console.log('444', this.$slots.default, this.$parent)
|
|
|
|
|
+ // this.$parent?.handleLink();
|
|
|
|
|
+ let obj = {
|
|
|
|
|
+ field: it.field,
|
|
|
|
|
+ title: it.title,
|
|
|
|
|
+ type: it.params?.type,
|
|
|
|
|
+ dataType: it.params?.dataType,
|
|
|
|
|
+ digits: it.params?.digits,
|
|
|
|
|
+ align: align,
|
|
|
|
|
+ instance: this.$parent,
|
|
|
|
|
+ col: this.$slots.default.filter(item => item.componentInstance.field === it.field)
|
|
|
|
|
+ }
|
|
|
|
|
+ return obj;
|
|
|
|
|
+ });
|
|
|
|
|
+ this.$TableMax({columns: columnsFull, tableData: this.dataFinal},
|
|
|
|
|
+ {
|
|
|
|
|
+ // ok: (searchText) => {
|
|
|
|
|
+ // this.handleColPosition(searchText); // 执行列定位方法
|
|
|
|
|
+ // },
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ /**
|
|
|
* @desc : 改变设置的位置
|
|
* @desc : 改变设置的位置
|
|
|
* @author : 周兴
|
|
* @author : 周兴
|
|
|
* @date : 2023/1/29 16:55
|
|
* @date : 2023/1/29 16:55
|
|
@@ -2163,5 +2310,26 @@ export default {
|
|
|
padding: 0 !important;
|
|
padding: 0 !important;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+.menu-class {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ top: 50%;
|
|
|
|
|
+ left: 50%;
|
|
|
|
|
+ border: 1px solid #aaa;
|
|
|
|
|
+ box-shadow: 2px 2px 2px #888888;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/deep/ .ivu-dropdown-menu {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/deep/ .ivu-dropdown {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/deep/ .ivu-select-selection {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
|
|
|
</style>
|
|
</style>
|