列表优化
parent
161a2a3e9a
commit
1f43402454
|
|
@ -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 新 API(customFilterDropdown/customFilterIcon),避免 column.slots 警告
|
||||||
state.columns.forEach(async (column) => {
|
state.columns.forEach(async (column) => {
|
||||||
//因为列过滤的渲染优先于dictionary组件的渲染,所以字典的初始化放在table列初始化中
|
//因为列过滤的渲染优先于dictionary组件的渲染,所以字典的初始化放在table列初始化中
|
||||||
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 自定义
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
|
||||||
|
|
@ -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: "方向标志",
|
||||||
|
|
|
||||||
|
|
@ -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: "业务类型",
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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",
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
/// 分页参数
|
/// 分页参数
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue