Commit 3b05a470 by Tianqing Liu

feat: 优化数据重跑功能UI

1 parent 0b60252a
<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-select v-model:value="queryForm.account_id"
style="width: 280px"
......@@ -28,6 +34,7 @@
style="width: 200px"
mode="multiple"
:maxTagCount="1"
:disabled="queryForm.dataType === 2"
:options="showedProgressList"
>
<template #dropdownRender="{ menuNode: menu }">
......@@ -50,6 +57,7 @@
</a-form-item>
<a-form-item>
<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>
......@@ -130,6 +138,8 @@ export default {
const queryForm = reactive(
{
dataType: 1,
account_id: [],
plaza_id: [],
scheduleTypeList: [],
......@@ -285,12 +295,52 @@ export default {
}
const confirmSearch = function() {
resultList.value = []
informationList.value = []
for (const scheduleType of queryForm.scheduleTypeList)
if (queryForm.dataType === 1) {
resultList.value = []
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() {
......@@ -329,6 +379,8 @@ export default {
confirmSearch,
selectAll,
clearAll,
confirmSearch2,
}
}
}
......@@ -336,4 +388,9 @@ export default {
<style lang="less" scoped>
@import "./DataRerun.less";
.data-return-form {
/deep/.ant-form-item {
margin-bottom: 10px;
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!