Commit 3b05a470 by Tianqing Liu

feat: 优化数据重跑功能UI

1 parent 0b60252a
<template> <template>
<a-form :model="queryForm" layout="inline" :label-col="{ style: { width: '70px' } }"> <a-form class="data-return-form" :model="queryForm" layout="inline" :label-col="{ style: { width: '70px' } }">
<a-form-item label="类型:">
<a-select style="width: 176px" v-model:value="queryForm.dataType">
<a-select-option :value="1">全店重跑</a-select-option>
<a-select-option :value="2">分类重跑</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="集团:"> <a-form-item label="集团:">
<a-select v-model:value="queryForm.account_id" <a-select v-model:value="queryForm.account_id"
style="width: 280px" style="width: 280px"
...@@ -28,6 +34,7 @@ ...@@ -28,6 +34,7 @@
style="width: 200px" style="width: 200px"
mode="multiple" mode="multiple"
:maxTagCount="1" :maxTagCount="1"
:disabled="queryForm.dataType === 2"
:options="showedProgressList" :options="showedProgressList"
> >
<template #dropdownRender="{ menuNode: menu }"> <template #dropdownRender="{ menuNode: menu }">
...@@ -50,6 +57,7 @@ ...@@ -50,6 +57,7 @@
</a-form-item> </a-form-item>
<a-form-item> <a-form-item>
<a-button type="primary" @click="confirmSearch">开始</a-button> <a-button type="primary" @click="confirmSearch">开始</a-button>
<!--<a-button type="primary" style="margin-left: 10px" @click="confirmSearch2">数据重跑</a-button>-->
</a-form-item> </a-form-item>
</a-form> </a-form>
...@@ -130,6 +138,8 @@ export default { ...@@ -130,6 +138,8 @@ export default {
const queryForm = reactive( const queryForm = reactive(
{ {
dataType: 1,
account_id: [], account_id: [],
plaza_id: [], plaza_id: [],
scheduleTypeList: [], scheduleTypeList: [],
...@@ -285,12 +295,52 @@ export default { ...@@ -285,12 +295,52 @@ export default {
} }
const confirmSearch = function() { const confirmSearch = function() {
resultList.value = [] if (queryForm.dataType === 1) {
informationList.value = [] resultList.value = []
for (const scheduleType of queryForm.scheduleTypeList) informationList.value = []
for (const scheduleType of queryForm.scheduleTypeList)
{
initializeWebSocket(scheduleType)
}
} else {
// 分类重跑
confirmSearch2()
}
}
// 新需求:数据重跑
const initializeWebSocket2 = function(scheduleType) {
if (webSocketMap[scheduleType] !== undefined)
{
webSocketMap[scheduleType].close()
}
// const targetUrl = `${window._socketUrl}/recal/schedule/${scheduleType}`
const targetUrl = ''
webSocketMap[scheduleType] = new WebSocket(targetUrl)
webSocketMap[scheduleType].onopen = () => {
// 查询条件
queryData(scheduleType)
}
webSocketMap[scheduleType].onmessage = function(event) {
let message = JSON.parse(event.data)
dealMessage(message)
if (message.stepCount === 1)
{ {
initializeWebSocket(scheduleType) webSocketMap[scheduleType].close()
} }
}
}
const confirmSearch2 = function() {
resultList.value = []
informationList.value = []
for (const scheduleType of queryForm.scheduleTypeList)
{
initializeWebSocket2(scheduleType)
}
} }
const selectAll = function() { const selectAll = function() {
...@@ -329,6 +379,8 @@ export default { ...@@ -329,6 +379,8 @@ export default {
confirmSearch, confirmSearch,
selectAll, selectAll,
clearAll, clearAll,
confirmSearch2,
} }
} }
} }
...@@ -336,4 +388,9 @@ export default { ...@@ -336,4 +388,9 @@ export default {
<style lang="less" scoped> <style lang="less" scoped>
@import "./DataRerun.less"; @import "./DataRerun.less";
.data-return-form {
/deep/.ant-form-item {
margin-bottom: 10px;
}
}
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!