bufix 0705 zentao

This commit is contained in:
lb
2023-07-05 14:52:04 +08:00
parent f076e23a67
commit b8765af77f
23 changed files with 287 additions and 236 deletions

View File

@@ -12,8 +12,7 @@
row-key="id"
:lazy="true"
:load="loadSubClassFn"
border
>
border>
<!-- @cell-mouse-enter="(row, col, cell, event) => $emit('cell-mouse-enter', row, col, cell, event)"> -->
<!-- @cell-mouse-leave="(row, col, cell, event) => $emit('cell-mouse-leave', row, col, cell, event)"> -->
<!-- 表格头定义 -->
@@ -34,8 +33,7 @@
}
: null
"
v-bind="head.more"
></el-table-column>
v-bind="head.more"></el-table-column>
<!-- 普通的表头 -->
<el-table-column
v-else
@@ -49,8 +47,7 @@
filter-placement="top"
:align="head.align || null"
v-bind="head.more"
:show-overflow-tooltip="head.showOverflowTooltip || !(head.prop === 'operations')"
>
:show-overflow-tooltip="head.showOverflowTooltip || !(head.prop === 'operations')">
<!-- :show-overflow-tooltip="head.showOverflowTooltip || true" -->
<!-- 子组件 -->
<template v-if="head.prop" slot-scope="scope">
@@ -59,15 +56,17 @@
:is="head.subcomponent"
:key="idx + 'sub'"
:inject-data="{ ...scope.row, head }"
@emit-data="handleSubEmitData"
/>
@emit-data="handleSubEmitData" />
<!-- 直接展示数据或应用过滤器 -->
<span v-else>{{ scope.row[head.prop] | commonFilter(head.filter) }}</span>
</template>
<!-- 多级表头 -->
<template v-if="!head.prop && head.children">
<TableHead v-for="(subhead, subindex) in head.children" :key="'subhead-' + idx + '-subindex-' + subindex" :opt="subhead" />
<TableHead
v-for="(subhead, subindex) in head.children"
:key="'subhead-' + idx + '-subindex-' + subindex"
:opt="subhead" />
</template>
</el-table-column>
</template>
@@ -106,12 +105,18 @@ export default {
type: Number,
default: 0,
},
page: {
type: Number,
default: 1,
},
size: {
type: Number,
default: 20,
},
},
inject: ["urls"],
data() {
return {
page: 1,
size: 20, // 默认20
dataList: [],
};
},

View File

@@ -16,6 +16,8 @@
:table-data="dataList"
@operate-event="handleOperate"
@load-sub="handleLoadSub"
:page="page"
:size="size"
:refresh-layout-key="refreshLayoutKey" />
<el-pagination
@@ -270,6 +272,7 @@ export default {
// payload: { type: string, data: string | number | object }
switch (type) {
case "delete": {
let currenPageListLength = this.dataList.length;
// 确认是否删除
return this.$confirm(`确定要删除 "${data.name}" 吗?`, "提示", {
confirmButtonText: "确认",
@@ -285,7 +288,7 @@ export default {
}).then(({ data: res }) => {
if (res.code === 0) {
this.$message.success("删除成功!");
if (currenPageListLength == 1) this.page = this.page > 1 ? this.page - 1 : 1;
this.getList(this.cachedSearchCondition);
}
});