列表优化

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', '']"
:rowClassName="setRowClassName" @resizeColumn="handleResizeColumn">
<!--列搜索组件封装-->
<template #filterDropdown="{ setSelectedKeys, selectedKeys, confirm, clearFilters, column }">
<template #customFilterDropdown="{ setSelectedKeys, selectedKeys, confirm, clearFilters, column }">
<div style="padding: 8px">
<a-input ref="searchInput" :placeholder="'请输入'" :value="selectedKeys[0]"
style="width: 188px; margin-bottom: 8px; display: block"
@ -117,7 +117,7 @@
</div>
</template>
<!--列排序组件封装-->
<template #filterIcon="filtered">
<template #customFilterIcon="filtered">
<search-outlined :style="{ color: filtered ? '#108ee9' : undefined }" />
</template>
@ -154,7 +154,8 @@
<!-- 单个操作 -->
<pro-authority :value="item.code ? item.code : false" v-else>
<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-popconfirm>
<div style="display: inline-block" v-else>
@ -568,7 +569,7 @@
}
};
/// column customRender
/// / antdv4 APIcustomFilterDropdown/customFilterIcon column.slots
state.columns.forEach(async (column) => {
//dictionarytable
let dict = [];
@ -583,11 +584,8 @@
column.filters = dict;
column.filterSearch = true;
}
// +
column.slots = Object.assign({}, column.slots || {}, {
filterDropdown: 'filterDropdown',
filterIcon: 'filterIcon'
})
// API使 customFilterDropdown 使
column.customFilterDropdown = true;
}
// showSearch / column.slots
});

View File

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

View File

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

View File

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

View File

@ -3,9 +3,20 @@
<template #search>
<pro-query :searchParam="searchParam" @on-search="search"></pro-query>
</template>
<pro-table rowKey="id" ref="tableRef" :fetch="fetch" :columns="columns" :toolbar="toolbar"
:operate="operate" :param="state.param" :pagination="pagination"
:row-selection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }">
<pro-table
rowKey="id"
ref="tableRef"
:fetch="fetch"
:columns="columns"
:toolbar="toolbar"
:operate="operate"
:param="state.param"
:pagination="pagination"
:row-selection="{
selectedRowKeys: state.selectedRowKeys,
onChange: onSelectChange,
}"
>
</pro-table>
</a-list-layout>
<a-modal v-model:open="visible" :footer="null" title="查看详情">{{text}}</a-modal>
@ -31,121 +42,122 @@ export default {
components: {},
setup() {
const tableRef = ref()
const columns = [{
dataIndex: "index",
key: "index",
title: "序号",
width: 60,
fixed: 'left',
align: 'center'
},
{
dataIndex: "requestCode",
key: "requestCode",
title: "请求编号",
width: 200,
showSearch: true,
},
{
dataIndex: "status",
key: "status",
title: "状态",
width: 100,
dictionary: {
type: 'tag',
code: 'TaskStatus'
const tableRef = ref();
const text = ref('')
const visible = ref(false)
const columns = [
{
dataIndex: "index",
key: "index",
title: "序号",
width: 60,
fixed: 'left',
align: 'center'
},
{
dataIndex: "requestCode",
key: "requestCode",
title: "请求编号",
width: 150,
showSearch: true,
},
{
dataIndex: "status",
key: "status",
title: "状态",
width: 100,
dictionary: {
type: "tag",
code: "TaskStatus",
},
showSearch: true,
},
{
dataIndex: "paramType",
key: "paramType",
title: "请求类型",
width: 150,
showSearch: true,
},
{
dataIndex: "processClass",
key: "processClass",
title: "处理类",
width: 160,
showSearch: true,
},
{
dataIndex: "requestDate",
key: "requestDate",
title: "请求时间",
width: 180,
},
{
dataIndex: "respondDate",
key: "respondDate",
title: "响应时间",
width: 180,
},
{
dataIndex: "request",
key: "request",
title: "请求数据",
width: 900,
showSearch: true,
},
{
dataIndex: "response",
key: "response",
title: "响应信息",
width: 900,
showSearch: true,
},
{
dataIndex: "createBy",
key: "createBy",
title: "录入人",
width: 120,
},
{
dataIndex: "createTime",
key: "createTime",
title: "录入时间",
width: 200,
},
{
dataIndex: "updateBy",
key: "updateBy",
title: "修改人",
width: 120,
},
{
dataIndex: "updateTime",
key: "updateTime",
title: "修改时间",
width: 200,
},
{
dataIndex: "preRequestCode",
key: "preRequestCode",
title: "前置请求编号",
width: 120,
},
{
dataIndex: "priority",
key: "priority",
title: "优先级",
width: 120,
dictionary: {
type: "tag",
code: "priority",
},
},
{
dataIndex: "remark",
key: "remark",
title: "备注",
width: 300,
},
showSearch: true
},
{
dataIndex: "paramType",
key: "paramType",
title: "请求类型",
width: 150,
showSearch: true,
},
{
dataIndex: "processClass",
key: "processClass",
title: "处理类",
width: 160,
showSearch: true,
},
{
dataIndex: "requestDate",
key: "requestDate",
title: "请求时间",
width: 180,
},
{
dataIndex: "respondDate",
key: "respondDate",
title: "响应时间",
width: 180,
},
{
dataIndex: "request",
key: "request",
title: "请求数据",
width: 900,
showSearch: true,
},
{
dataIndex: "response",
key: "response",
title: "响应信息",
width: 900,
showSearch: true,
},
{
dataIndex: "createBy",
key: "createBy",
title: "录入人",
width: 120,
},
{
dataIndex: "createTime",
key: "createTime",
title: "录入时间",
width: 200,
},
{
dataIndex: "updateBy",
key: "updateBy",
title: "修改人",
width: 120,
},
{
dataIndex: "updateTime",
key: "updateTime",
title: "修改时间",
width: 200,
},
{
dataIndex: "preRequestCode",
key: "preRequestCode",
title: "前置请求编号",
width: 120,
},
{
dataIndex: "priority",
key: "priority",
title: "优先级",
width: 120,
dictionary: {
type: 'tag',
code: 'priority'
}
},
{
dataIndex: "remark",
key: "remark",
title: "备注",
width: 300,
},
];
/// []
@ -305,46 +317,51 @@ export default {
};
///
const toolbar = [{
label: "删除",
code: 'wms:request:delete',
icon: 'DeleteOutlined',
event: function () {
removeBatchMethod(state.selectedRowKeys)
const toolbar = [
{
label: "删除",
code: "wms:request:delete",
event: function () {
removeBatchMethod(state.selectedRowKeys);
},
icon: 'DeleteOutlined',
danger: true,
},
];
///
const operate = [{
label: "删除",
code: 'wms:request:delete',
isDel: true,
event: function (record) {
removeMethod(record)
}
},
{
label: "重置",
code: 'wms:request:reactivate',
isRes: true,
event: function (record) {
reActivateMethod(record)
}
},
{
label: "取消",
code: 'wms:request:cancel',
isRes: true,
event: function (record) {
cancelMethod(record)
}
},
{
label: "查看",
event: function (record) {
alert("查看详情:" + JSON.stringify(record))
}
},
const operate = [
{
label: "删除",
code: "wms:request:delete",
event: function (record) {
removeMethod(record);
},
},
{
label: "重置",
code: "wms:request:reactivate",
isRes: true,
event: function (record) {
reActivateMethod(record);
},
},
{
label: "取消",
code: "wms:request:cancel",
isRes: true,
event: function (record) {
cancelMethod(record);
},
},
{
label: "查看",
event: function (record) {
// alert(":" + JSON.stringify(record));
text.value = JSON.stringify(record)
visible.value = true
},
},
];
const pagination = {

View File

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

View File

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

View File

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