2025-08-07 15:16:23 +08:00
|
|
|
<template>
|
2025-11-06 14:25:31 +08:00
|
|
|
<a-list-layout
|
|
|
|
|
ref="pageRef"
|
|
|
|
|
>
|
|
|
|
|
<template #search>
|
|
|
|
|
<pro-query :searchParam="searchParam" @on-search="search"></pro-query>
|
|
|
|
|
</template>
|
2025-08-07 15:16:23 +08:00
|
|
|
<!-- 自增值定义列表 -->
|
2025-11-06 14:25:31 +08:00
|
|
|
<pro-table ref="tableRef" :fetch="fetch" :columns="columns" :toolbar="toolbar" :operate="operate"
|
|
|
|
|
:param="state.param" :pagination="pagination"
|
|
|
|
|
:row-selection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }">
|
|
|
|
|
</pro-table>
|
2025-08-07 15:16:23 +08:00
|
|
|
<save :visible="state.visibleSave" @close="closeSave"></save>
|
|
|
|
|
<edit :visible="state.visibleEdit" @close="closeEdit" :record="state.recordEdit"></edit>
|
2025-11-06 14:25:31 +08:00
|
|
|
</a-list-layout>
|
2025-08-07 15:16:23 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2025-11-04 14:04:50 +08:00
|
|
|
import save from './modal/save.vue';
|
|
|
|
|
import edit from './modal/edit.vue';
|
2025-08-07 15:16:23 +08:00
|
|
|
import {
|
|
|
|
|
message,
|
2025-11-04 14:04:50 +08:00
|
|
|
Modal as modal
|
2025-11-03 16:40:10 +08:00
|
|
|
} from '@hwork/ant-design-vue';
|
2025-08-07 15:16:23 +08:00
|
|
|
import {
|
|
|
|
|
ExclamationCircleOutlined
|
|
|
|
|
} from '@ant-design/icons-vue';
|
|
|
|
|
import {
|
|
|
|
|
page,
|
|
|
|
|
remove,
|
|
|
|
|
removeBatch
|
|
|
|
|
} from "@/api/wms/seqNum";
|
|
|
|
|
import {
|
|
|
|
|
reactive,
|
|
|
|
|
createVNode,
|
|
|
|
|
ref
|
|
|
|
|
} from 'vue';
|
|
|
|
|
|
|
|
|
|
const removeKey = "remove";
|
|
|
|
|
const removeBatchKey = "removeBatch";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
save,
|
|
|
|
|
edit,
|
|
|
|
|
},
|
|
|
|
|
setup() {
|
|
|
|
|
|
|
|
|
|
const tableRef = ref();
|
|
|
|
|
|
|
|
|
|
/// 列配置
|
|
|
|
|
const columns = [{
|
2025-11-07 16:34:20 +08:00
|
|
|
dataIndex: "index",
|
|
|
|
|
key: "index",
|
|
|
|
|
title: "序号",
|
|
|
|
|
width: 60,
|
|
|
|
|
fixed: 'left',
|
|
|
|
|
align: 'center'
|
|
|
|
|
},
|
|
|
|
|
{
|
2025-08-07 15:16:23 +08:00
|
|
|
dataIndex: "seqCode",
|
|
|
|
|
key: "seqCode",
|
|
|
|
|
title: "值编号",
|
|
|
|
|
width: 150,
|
|
|
|
|
showSearch:true//显示列搜索
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
dataIndex: "seqName",
|
|
|
|
|
key: "seqName",
|
|
|
|
|
title: "名称",
|
|
|
|
|
width: 150,
|
|
|
|
|
showSearch:true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
dataIndex: "minValue",
|
|
|
|
|
key: "minValue",
|
|
|
|
|
title: "起始值",
|
2025-11-07 16:34:20 +08:00
|
|
|
align: 'right',
|
2025-08-07 15:16:23 +08:00
|
|
|
width: 150,
|
|
|
|
|
showSearch:true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
dataIndex: "incValue",
|
|
|
|
|
key: "incValue",
|
|
|
|
|
title: "自增值",
|
2025-11-07 16:34:20 +08:00
|
|
|
align: 'right',
|
2025-08-07 15:16:23 +08:00
|
|
|
width: 150,
|
|
|
|
|
showSearch:true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
dataIndex: "maxValue",
|
|
|
|
|
key: "maxValue",
|
|
|
|
|
title: "最大值",
|
2025-11-07 16:34:20 +08:00
|
|
|
align: 'right',
|
2025-08-07 15:16:23 +08:00
|
|
|
width: 150,
|
|
|
|
|
showSearch:true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
dataIndex: "currValue",
|
|
|
|
|
key: "currValue",
|
2025-11-07 16:34:20 +08:00
|
|
|
align: 'right',
|
2025-08-07 15:16:23 +08:00
|
|
|
title: "当前值",
|
|
|
|
|
width: 150,
|
|
|
|
|
showSearch:true
|
|
|
|
|
},
|
|
|
|
|
// {
|
|
|
|
|
// dataIndex: "ext1",
|
|
|
|
|
// key: "ext1",
|
|
|
|
|
// title: "扩展1"
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// dataIndex: "ext2",
|
|
|
|
|
// key: "ext2",
|
|
|
|
|
// title: "扩展2"
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// dataIndex: "ext3",
|
|
|
|
|
// key: "ext3",
|
|
|
|
|
// title: "扩展3"
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// dataIndex: "ext4",
|
|
|
|
|
// key: "ext4",
|
|
|
|
|
// title: "扩展4"
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// dataIndex: "ext5",
|
|
|
|
|
// key: "ext5",
|
|
|
|
|
// title: "扩展5"
|
|
|
|
|
// },
|
|
|
|
|
/* {
|
|
|
|
|
dataIndex: "deleted",
|
|
|
|
|
key: "deleted",
|
|
|
|
|
title: "是否允许删除",
|
|
|
|
|
dictionary: {
|
|
|
|
|
type: 'tag',
|
|
|
|
|
code: 'deleted'
|
|
|
|
|
}
|
|
|
|
|
}, */
|
|
|
|
|
{
|
|
|
|
|
dataIndex: "createBy",
|
|
|
|
|
key: "createBy",
|
|
|
|
|
title: "录入人",
|
|
|
|
|
width: 150,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
dataIndex: "createTime",
|
|
|
|
|
key: "createTime",
|
|
|
|
|
title: "录入时间",
|
|
|
|
|
width: 200,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
dataIndex: "updateBy",
|
|
|
|
|
key: "updateBy",
|
|
|
|
|
title: "修改人",
|
|
|
|
|
width: 150,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
dataIndex: "updateTime",
|
|
|
|
|
key: "updateTime",
|
|
|
|
|
title: "修改时间",
|
|
|
|
|
width: 200,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
dataIndex: "remark",
|
|
|
|
|
key: "remark",
|
|
|
|
|
title: "备注",
|
|
|
|
|
width: 150,
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
/// 数据来源 [模拟]
|
|
|
|
|
const fetch = async (param) => {
|
|
|
|
|
var response = await page(param);
|
|
|
|
|
return {
|
|
|
|
|
total: response.data.total,
|
|
|
|
|
data: response.data.record,
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/// 删除配置
|
|
|
|
|
const removeMethod = (record) => {
|
|
|
|
|
message.loading({
|
|
|
|
|
content: "提交中...",
|
|
|
|
|
key: removeKey
|
|
|
|
|
});
|
|
|
|
|
remove({
|
|
|
|
|
"id": record.id
|
|
|
|
|
}).then((response) => {
|
|
|
|
|
if (response.success) {
|
|
|
|
|
message.success({
|
|
|
|
|
content: "删除成功",
|
|
|
|
|
key: removeKey,
|
|
|
|
|
duration: 1
|
|
|
|
|
})
|
|
|
|
|
tableRef.value.reload()
|
|
|
|
|
} else {
|
|
|
|
|
message.error({
|
|
|
|
|
content: "删除失败",
|
|
|
|
|
key: removeKey,
|
|
|
|
|
duration: 1
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const removeBatchMethod = (ids) => {
|
2025-11-06 14:25:31 +08:00
|
|
|
modal.confirm({
|
2025-08-07 15:16:23 +08:00
|
|
|
title: '您是否确定删除该数据?',
|
|
|
|
|
icon: createVNode(ExclamationCircleOutlined),
|
|
|
|
|
okText: '确定',
|
|
|
|
|
cancelText: '取消',
|
|
|
|
|
onOk() {
|
|
|
|
|
message.loading({
|
|
|
|
|
content: "提交中...",
|
|
|
|
|
key: removeBatchKey
|
|
|
|
|
});
|
|
|
|
|
removeBatch({
|
|
|
|
|
"ids": ids
|
|
|
|
|
}).then((response) => {
|
|
|
|
|
if (response.success) {
|
|
|
|
|
message.success({
|
|
|
|
|
content: "删除成功",
|
|
|
|
|
key: removeBatchKey,
|
|
|
|
|
duration: 1
|
|
|
|
|
})
|
|
|
|
|
tableRef.value.reload()
|
|
|
|
|
} else {
|
|
|
|
|
message.error({
|
|
|
|
|
content: "删除失败",
|
|
|
|
|
key: removeBatchKey,
|
|
|
|
|
duration: 1
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// 工具栏
|
|
|
|
|
const toolbar = [{
|
|
|
|
|
label: "新增",
|
|
|
|
|
code: 'wms:seqNum:add',
|
2025-11-07 16:34:20 +08:00
|
|
|
icon: 'PlusOutlined',
|
2025-08-07 15:16:23 +08:00
|
|
|
event: function() {
|
|
|
|
|
state.visibleSave = true
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "删除",
|
|
|
|
|
code: 'wms:seqNum:remove',
|
|
|
|
|
event: function() {
|
|
|
|
|
removeBatchMethod(state.selectedRowKeys)
|
|
|
|
|
},
|
2025-11-07 16:34:20 +08:00
|
|
|
icon: 'DeleteOutlined',
|
|
|
|
|
danger: true,
|
2025-08-07 15:16:23 +08:00
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
/// 行操作
|
|
|
|
|
const operate = [{
|
|
|
|
|
label: "修改",
|
|
|
|
|
code: 'wms:seqNum:edit',
|
|
|
|
|
event: function(record) {
|
|
|
|
|
state.visibleEdit = true, state.recordEdit = record
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "删除",
|
|
|
|
|
code: 'wms:seqNum:delete',
|
|
|
|
|
isDel: true,
|
|
|
|
|
delEvent: function(record) {
|
|
|
|
|
removeMethod(record)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
/// 分页参数
|
|
|
|
|
const pagination = {
|
|
|
|
|
pageNum: 1,
|
2025-11-04 15:15:46 +08:00
|
|
|
pageSize: 20,
|
2025-08-07 15:16:23 +08:00
|
|
|
showSizeChanger: true, // 显示可改变每页条数
|
2025-11-04 15:15:46 +08:00
|
|
|
pageSizeOptions: ["10", "20", "50", "100"], // 每页条数选项设置
|
2025-08-07 15:16:23 +08:00
|
|
|
showTotal: total => `共 ${total} 条记录`, // 显示总条数
|
|
|
|
|
showSizeChange: (current, pageSize) => (this.pageSize = pageSize) // 改变每页条数时更新显示
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// 外置参数 - 当参数改变时, 重新触发 fetch 函数
|
|
|
|
|
const state = reactive({
|
|
|
|
|
selectedRowKeys: [],
|
|
|
|
|
param: {},
|
|
|
|
|
visibleSave: false,
|
|
|
|
|
visibleEdit: false,
|
|
|
|
|
recordEdit: {},
|
|
|
|
|
recordInfo: {},
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
//界面头部-查询框
|
|
|
|
|
const searchParam = [{
|
|
|
|
|
key: "seqCode",
|
|
|
|
|
type: "input",
|
|
|
|
|
label: "值编号"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: "seqName",
|
|
|
|
|
type: "input",
|
|
|
|
|
label: "名称"
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
const search = function(value) {
|
|
|
|
|
state.param = value
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const closeSave = function() {
|
|
|
|
|
tableRef.value.reload();
|
|
|
|
|
state.visibleSave = false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const closeEdit = function() {
|
|
|
|
|
tableRef.value.reload();
|
|
|
|
|
state.visibleEdit = false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const onSelectChange = selectedRowKeys => {
|
|
|
|
|
state.selectedRowKeys = selectedRowKeys;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
state, // 状态共享
|
|
|
|
|
fetch, // 数据回调
|
|
|
|
|
toolbar, // 工具栏
|
|
|
|
|
columns, // 列配置
|
|
|
|
|
operate, // 行操作
|
|
|
|
|
pagination, // 分页配置
|
|
|
|
|
|
|
|
|
|
search,
|
|
|
|
|
searchParam, // 查询参数
|
|
|
|
|
|
|
|
|
|
closeSave,
|
|
|
|
|
closeEdit,
|
|
|
|
|
|
|
|
|
|
onSelectChange,
|
|
|
|
|
tableRef
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|