Commit 9dacf737 by Tianqing Liu

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

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