列表优化

hwork-master
齐慧慧 2025-11-10 09:25:47 +08:00
parent 161a2a3e9a
commit 1f43402454
8 changed files with 195 additions and 194 deletions

View File

@ -64,7 +64,7 @@
:row-height="100" :customRow="rowClick" :sortDirections="['descend', 'ascend', '']" :row-height="100" :customRow="rowClick" :sortDirections="['descend', 'ascend', '']"
:rowClassName="setRowClassName" @resizeColumn="handleResizeColumn"> :rowClassName="setRowClassName" @resizeColumn="handleResizeColumn">
<!--列搜索组件封装--> <!--列搜索组件封装-->
<template #filterDropdown="{ setSelectedKeys, selectedKeys, confirm, clearFilters, column }"> <template #customFilterDropdown="{ setSelectedKeys, selectedKeys, confirm, clearFilters, column }">
<div style="padding: 8px"> <div style="padding: 8px">
<a-input ref="searchInput" :placeholder="'请输入'" :value="selectedKeys[0]" <a-input ref="searchInput" :placeholder="'请输入'" :value="selectedKeys[0]"
style="width: 188px; margin-bottom: 8px; display: block" style="width: 188px; margin-bottom: 8px; display: block"
@ -117,7 +117,7 @@
</div> </div>
</template> </template>
<!--列排序组件封装--> <!--列排序组件封装-->
<template #filterIcon="filtered"> <template #customFilterIcon="filtered">
<search-outlined :style="{ color: filtered ? '#108ee9' : undefined }" /> <search-outlined :style="{ color: filtered ? '#108ee9' : undefined }" />
</template> </template>
@ -154,7 +154,8 @@
<!-- 单个操作 --> <!-- 单个操作 -->
<pro-authority :value="item.code ? item.code : false" v-else> <pro-authority :value="item.code ? item.code : false" v-else>
<a-popconfirm v-if="item.isDel" title="确认删除?" ok-text="" cancel-text="" <a-popconfirm v-if="item.isDel" title="确认删除?" ok-text="" cancel-text=""
@confirm="item.delEvent(record)" @cancel="item.cancelEvent(record)"> @confirm="item.delEvent && item.delEvent(record)"
@cancel="item.cancelEvent ? item.cancelEvent(record) : null">
<a-button type="text" danger >{{ item.label || '删除' }}</a-button> <a-button type="text" danger >{{ item.label || '删除' }}</a-button>
</a-popconfirm> </a-popconfirm>
<div style="display: inline-block" v-else> <div style="display: inline-block" v-else>
@ -568,7 +569,7 @@
} }
}; };
/// column customRender /// / antdv4 APIcustomFilterDropdown/customFilterIcon column.slots
state.columns.forEach(async (column) => { state.columns.forEach(async (column) => {
//dictionarytable //dictionarytable
let dict = []; let dict = [];
@ -583,11 +584,8 @@
column.filters = dict; column.filters = dict;
column.filterSearch = true; column.filterSearch = true;
} }
// + // API使 customFilterDropdown 使
column.slots = Object.assign({}, column.slots || {}, { column.customFilterDropdown = true;
filterDropdown: 'filterDropdown',
filterIcon: 'filterIcon'
})
} }
// showSearch / column.slots // showSearch / column.slots
}); });

View File

@ -8,7 +8,7 @@
checkStrictly checkStrictly
show-line="true" show-line="true"
:tree-data="state.powers" :tree-data="state.powers"
:replace-fields="state.powerReplaceFields" :fieldNames="state.powerReplaceFields"
v-model:checkedKeys="state.checkedPowerIds" v-model:checkedKeys="state.checkedPowerIds"
/> />
</a-tab-pane> </a-tab-pane>
@ -29,7 +29,7 @@
show-line="true" show-line="true"
v-if="state.showDept" v-if="state.showDept"
:tree-data="state.depts" :tree-data="state.depts"
:replace-fields="state.deptReplaceFields" :fieldNames="state.deptReplaceFields"
v-model:checkedKeys="state.checkedDeptIds" v-model:checkedKeys="state.checkedDeptIds"
/> />
</a-tab-pane> </a-tab-pane>

View File

@ -79,19 +79,12 @@
console.log("1 TaskStatistics") console.log("1 TaskStatistics")
// //
const columns = [{ const columns = [
dataIndex: "index",
key: "index",
title: "序号",
width: 60,
fixed: 'left',
align: 'center'
},
{ {
title: "日期", title: "日期",
dataIndex: "dayTime", dataIndex: "dayTime",
key: "dayTime", key: "dayTime",
width:100 width:120
}, },
{ {
title: "方向标志", title: "方向标志",

View File

@ -79,19 +79,12 @@
console.log("1 TaskStatistics") console.log("1 TaskStatistics")
// //
const columns = [{ const columns = [
dataIndex: "index",
key: "index",
title: "序号",
width: 60,
fixed: 'left',
align: 'center'
},
{ {
title: "日期", title: "日期",
dataIndex: "dayTime", dataIndex: "dayTime",
key: "dayTime", key: "dayTime",
width: 100 width: 120
}, },
{ {
title: "业务类型", title: "业务类型",

View File

@ -3,9 +3,20 @@
<template #search> <template #search>
<pro-query :searchParam="searchParam" @on-search="search"></pro-query> <pro-query :searchParam="searchParam" @on-search="search"></pro-query>
</template> </template>
<pro-table rowKey="id" ref="tableRef" :fetch="fetch" :columns="columns" :toolbar="toolbar" <pro-table
:operate="operate" :param="state.param" :pagination="pagination" rowKey="id"
:row-selection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }"> ref="tableRef"
:fetch="fetch"
:columns="columns"
:toolbar="toolbar"
:operate="operate"
:param="state.param"
:pagination="pagination"
:row-selection="{
selectedRowKeys: state.selectedRowKeys,
onChange: onSelectChange,
}"
>
</pro-table> </pro-table>
</a-list-layout> </a-list-layout>
<a-modal v-model:open="visible" :footer="null" title="查看详情">{{text}}</a-modal> <a-modal v-model:open="visible" :footer="null" title="查看详情">{{text}}</a-modal>
@ -31,10 +42,11 @@ export default {
components: {}, components: {},
setup() { setup() {
const tableRef = ref();
const tableRef = ref() const text = ref('')
const visible = ref(false)
const columns = [{ const columns = [
{
dataIndex: "index", dataIndex: "index",
key: "index", key: "index",
title: "序号", title: "序号",
@ -46,7 +58,7 @@ export default {
dataIndex: "requestCode", dataIndex: "requestCode",
key: "requestCode", key: "requestCode",
title: "请求编号", title: "请求编号",
width: 200, width: 150,
showSearch: true, showSearch: true,
}, },
{ {
@ -55,10 +67,10 @@ export default {
title: "状态", title: "状态",
width: 100, width: 100,
dictionary: { dictionary: {
type: 'tag', type: "tag",
code: 'TaskStatus' code: "TaskStatus",
}, },
showSearch: true showSearch: true,
}, },
{ {
dataIndex: "paramType", dataIndex: "paramType",
@ -136,9 +148,9 @@ export default {
title: "优先级", title: "优先级",
width: 120, width: 120,
dictionary: { dictionary: {
type: 'tag', type: "tag",
code: 'priority' code: "priority",
} },
}, },
{ {
dataIndex: "remark", dataIndex: "remark",
@ -305,45 +317,50 @@ export default {
}; };
/// ///
const toolbar = [{ const toolbar = [
{
label: "删除", label: "删除",
code: 'wms:request:delete', code: "wms:request:delete",
icon: 'DeleteOutlined',
event: function () { event: function () {
removeBatchMethod(state.selectedRowKeys) removeBatchMethod(state.selectedRowKeys);
},
icon: 'DeleteOutlined',
danger: true,
}, },
]; ];
/// ///
const operate = [{ const operate = [
{
label: "删除", label: "删除",
code: 'wms:request:delete', code: "wms:request:delete",
isDel: true,
event: function (record) { event: function (record) {
removeMethod(record) removeMethod(record);
} },
}, },
{ {
label: "重置", label: "重置",
code: 'wms:request:reactivate', code: "wms:request:reactivate",
isRes: true, isRes: true,
event: function (record) { event: function (record) {
reActivateMethod(record) reActivateMethod(record);
} },
}, },
{ {
label: "取消", label: "取消",
code: 'wms:request:cancel', code: "wms:request:cancel",
isRes: true, isRes: true,
event: function (record) { event: function (record) {
cancelMethod(record) cancelMethod(record);
} },
}, },
{ {
label: "查看", label: "查看",
event: function (record) { event: function (record) {
alert("查看详情:" + JSON.stringify(record)) // alert(":" + JSON.stringify(record));
} text.value = JSON.stringify(record)
visible.value = true
},
}, },
]; ];

View File

@ -136,7 +136,7 @@ export default {
dataIndex: "createBy", dataIndex: "createBy",
key: "createBy", key: "createBy",
title: "录入人", title: "录入人",
width: 100, width: 150,
}, },
{ {
dataIndex: "createTime", dataIndex: "createTime",
@ -148,7 +148,7 @@ export default {
dataIndex: "updateBy", dataIndex: "updateBy",
key: "updateBy", key: "updateBy",
title: "修改人", title: "修改人",
width: 100, width: 150,
}, },
{ {
dataIndex: "updateTime", dataIndex: "updateTime",

View File

@ -217,14 +217,14 @@ export default {
dataIndex: "sourceLoc", dataIndex: "sourceLoc",
key: "sourceLoc", key: "sourceLoc",
title: "源位置", title: "源位置",
width: 150, width: 170,
showSearch: true, showSearch: true,
}, },
{ {
dataIndex: "targetLoc", dataIndex: "targetLoc",
key: "targetLoc", key: "targetLoc",
title: "目标位置", title: "目标位置",
width: 120, width: 170,
showSearch: true, showSearch: true,
}, },
// { // {

View File

@ -381,20 +381,20 @@ export default {
/// ///
const operate = [ { const operate = [ {
label: "修改",
code: 'wms:loc:edit',
event: function (record) {
state.visibleEdit = true, state.recordEdit = record
}
},
{
label: "删除", label: "删除",
code: 'wms:loc:delete', code: 'wms:loc:delete',
isDel: true, isDel: true,
delEvent: function (record) { delEvent: function (record) {
removeMethod(record) removeMethod(record)
} }
},{
label: "修改",
code: 'wms:loc:edit',
event: function (record) {
state.visibleEdit = true, state.recordEdit = record
}
}, },
]; ];
/// ///