Commit 17b0b4ce3fc333e2830965ae7925f461dd25c1a5

Authored by ww
1 parent 4b636fee

fix: call save layout info api happend error after data board component

1 1 <script lang="ts" setup>
2 2 import { Button, PageHeader, Empty, Spin, Tooltip } from 'ant-design-vue';
3   - import { LineChartOutlined, RollbackOutlined } from '@ant-design/icons-vue';
4 3 import { GridItem, GridLayout } from 'vue3-grid-layout';
5 4 import { nextTick, onMounted, ref } from 'vue';
6 5 import WidgetWrapper from '../components/WidgetWrapper/WidgetWrapper.vue';
... ... @@ -40,6 +39,7 @@
40 39 import { buildUUID } from '/@/utils/uuid';
41 40 import HistoryTrendModal from './components/HistoryTrendModal.vue';
42 41 import trendIcon from '/@/assets/svg/trend.svg';
  42 + import backIcon from '/@/assets/images/back.png';
43 43
44 44 const ROUTE = useRoute();
45 45
... ... @@ -348,7 +348,6 @@
348 348 if (!dataBoardId) return;
349 349 await deleteDataComponent({ dataBoardId, ids: [id] });
350 350 createMessage.success('删除成功');
351   - await handleSaveLayoutInfo();
352 351 await getDataBoardComponent();
353 352 } catch (error) {
354 353 // createMessage.error('删除失败');
... ... @@ -371,7 +370,12 @@
371 370 <PageHeader>
372 371 <template #title>
373 372 <div class="flex items-center">
374   - <RollbackOutlined v-if="!getIsSharePage" class="mr-3" @click="handleBack" />
  373 + <img
  374 + :src="backIcon"
  375 + v-if="!getIsSharePage"
  376 + class="mr-3 cursor-pointer"
  377 + @click="handleBack"
  378 + />
375 379 <span class="text-lg" color="#333">{{ getDataBoardName }}</span>
376 380 </div>
377 381 </template>
... ...
... ... @@ -132,17 +132,20 @@ export function useSocketConnect(dataSourceRef: Ref<DataBoardLayoutInfo[]>) {
132 132 };
133 133
134 134 const beginSendMessage = () => {
135   - // close();
  135 + close();
136 136 cmdIdMapping.clear();
137 137
138   - // open();
139   - const messageList = transformSocketMessageItem();
  138 + // TODO current need use setTimeout delay 1 second to reconnect
  139 + setTimeout(() => {
  140 + open();
  141 + const messageList = transformSocketMessageItem();
140 142
141   - if (unref(status) !== 'OPEN') {
142   - waitSendQueue.push(JSON.stringify(messageList));
143   - return;
144   - }
145   - send(JSON.stringify(messageList));
  143 + if (unref(status) !== 'OPEN') {
  144 + waitSendQueue.push(JSON.stringify(messageList));
  145 + return;
  146 + }
  147 + send(JSON.stringify(messageList));
  148 + }, 1000);
146 149 };
147 150
148 151 return {
... ...