|
|
|
@ -51,7 +51,7 @@ const formData = reactive({ |
|
|
|
|
const tableData = reactive({ |
|
|
|
|
dataSource: [], |
|
|
|
|
methods: { |
|
|
|
|
handleTableChange: () => {}, |
|
|
|
|
handleTableChange, |
|
|
|
|
handleRemoveAck, |
|
|
|
|
handleUpdate, |
|
|
|
|
}, |
|
|
|
@ -89,6 +89,7 @@ async function handleCreateAck(data) { |
|
|
|
|
clearSearchData(); |
|
|
|
|
clearFormData(); |
|
|
|
|
getPage(); |
|
|
|
|
baseDataStore.getDictList(); |
|
|
|
|
} |
|
|
|
|
// ! 确认删除 |
|
|
|
|
async function handleRemoveAck(data) { |
|
|
|
@ -98,6 +99,7 @@ async function handleRemoveAck(data) { |
|
|
|
|
tableData.pageInfo.pageNumber--; |
|
|
|
|
} |
|
|
|
|
getPage(); |
|
|
|
|
baseDataStore.getDictList(); |
|
|
|
|
} |
|
|
|
|
// ! 更新数据 |
|
|
|
|
async function handleUpdate(data) { |
|
|
|
@ -122,6 +124,7 @@ async function handleUpdateAck(data) { |
|
|
|
|
Message.success('更新字典成功!'); |
|
|
|
|
clearFormData(); |
|
|
|
|
getPage(); |
|
|
|
|
baseDataStore.getDictList(); |
|
|
|
|
} |
|
|
|
|
// ! 监听筛选 |
|
|
|
|
watch(tableData.pageInfo, () => { |
|
|
|
@ -137,11 +140,20 @@ watch(tableData.pageInfo, () => { |
|
|
|
|
}); |
|
|
|
|
// ! 获取表格数据 |
|
|
|
|
async function getPage() { |
|
|
|
|
baseDataStore.getDictList(); |
|
|
|
|
const resd = await CoreDict.getDict(tableData.pageInfo); |
|
|
|
|
tableData.dataSource = resd.rowData; |
|
|
|
|
tableData.total = Number(resd.total); |
|
|
|
|
} |
|
|
|
|
// ! 表格筛选变动 |
|
|
|
|
function handleTableChange(page, filter, sorter){ |
|
|
|
|
if (sorter.order == 'ascend') { |
|
|
|
|
tableData.pageInfo.isAsc = true; |
|
|
|
|
} else if (sorter.order == 'descend') { |
|
|
|
|
tableData.pageInfo.isAsc = false; |
|
|
|
|
} else { |
|
|
|
|
tableData.pageInfo.isAsc = undefined; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// ! 页码变动 |
|
|
|
|
const handlePageChange = (page, pageSize) => { |
|
|
|
|
tableData.pageInfo.pageSize = pageSize; |
|
|
|
@ -150,17 +162,15 @@ const handlePageChange = (page, pageSize) => { |
|
|
|
|
}; |
|
|
|
|
// ! 清除筛选条件 |
|
|
|
|
function clearSearchData() { |
|
|
|
|
tableData.pageInfo = { |
|
|
|
|
pageSize: 10, |
|
|
|
|
pageNumber: 1, |
|
|
|
|
isList: false, |
|
|
|
|
isAsc: false, |
|
|
|
|
dictInfo: undefined, |
|
|
|
|
dictType: undefined, |
|
|
|
|
root: undefined, |
|
|
|
|
serviceKey: undefined, |
|
|
|
|
status: undefined, |
|
|
|
|
}; |
|
|
|
|
tableData.pageInfo.pageSize=10; |
|
|
|
|
tableData.pageInfo.pageNumber= 1; |
|
|
|
|
tableData.pageInfo.isList= false; |
|
|
|
|
tableData.pageInfo.isAsc= false; |
|
|
|
|
tableData.pageInfo.dictInfo= undefined; |
|
|
|
|
tableData.pageInfo.dictType=undefined; |
|
|
|
|
tableData.pageInfo.root=undefined; |
|
|
|
|
tableData.pageInfo.serviceKey=undefined; |
|
|
|
|
tableData.pageInfo.status=undefined; |
|
|
|
|
} |
|
|
|
|
// ! 清除编辑数据 |
|
|
|
|
function clearFormData() { |
|
|
|
@ -180,6 +190,7 @@ function clearFormData() { |
|
|
|
|
formData.formData.orderNum = 0; |
|
|
|
|
} |
|
|
|
|
onMounted(() => { |
|
|
|
|
baseDataStore.getDictList(); |
|
|
|
|
getPage(); |
|
|
|
|
if (baseDataStore.state.serviceList.length == 0) { |
|
|
|
|
baseDataStore.getServiceList(); |
|
|
|
|