Commit 9dacf737 by Tianqing Liu

feat: 增加批次功能,回显优化

1 parent 28b0a08b
......@@ -36,7 +36,7 @@
<a-input-number v-model:value="queryForm.maxNum" :min="queryForm.maxNum||0" :max="100000000" style="width: 140px"/>
</a-form-item>
<a-form-item label="批次ID:" style="padding: 5px 0">
<a-input v-model:value="queryForm.batchId" style="width: 240px"/>
<a-input v-model:value="queryForm.batchId" style="width: 240px" :allowClear="true"/>
</a-form-item>
<a-form-item style="padding: 5px 0">
<a-button type="primary" @click="clickSearch" :loading="isLoading">查询</a-button>
......@@ -134,6 +134,7 @@
batchId: '',
})
const searchCondition = ref({})
// 回显数据
if (window.localStorage.getItem('searchCondition')) {
searchCondition.value = JSON.parse(window.localStorage.getItem('searchCondition'));
queryForm.startTime = searchCondition.value.startTime;
......@@ -141,7 +142,7 @@
queryForm.minNum = searchCondition.value.minNum || 0;
queryForm.maxNum = searchCondition.value.maxNum || 100000;
queryForm.date = searchCondition.value.date;
queryForm.batchId = searchCondition.value.batchId || ''
queryForm.batchId = searchCondition.value.batch_id || ''
}
const onPageNumChange = function(num) {
pageNum.value = num
......@@ -271,7 +272,7 @@
maxNum: rawData.maxNum,
pageNum: pageNum.value,
pageSize: pageSize.value,
batchId: rawData.batchId,
batchId: rawData.batchId || '',
})
// 用于localStorage存储
const storageData = filterEmptyValueInObject({
......@@ -283,12 +284,13 @@
maxNum: rawData.maxNum,
startTime: rawData.startTime,
endTime: rawData.endTime,
batchId: rawData.batchId,
})
let searchCondition = JSON.parse(window.localStorage.getItem('searchCondition'));
let newSearchCondition = {
...searchCondition,
...storageData,
// 写在上面,会被filterEmptyValueInObject方法过滤
batch_id: rawData.batchId || '',
}
window.localStorage.setItem('searchCondition', JSON.stringify(newSearchCondition))
batchesResultApi.getBatchesResultList(data).then(
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!