fix: 修改同步设备状态

This commit is contained in:
100011797 2023-03-23 15:35:57 +08:00
parent dead9c5b46
commit 0e56cadb12
2 changed files with 7 additions and 6 deletions

View File

@ -162,7 +162,7 @@ import {
} from '@/api/device/instance';
import MSelect from './MSelect.vue';
import PatchMapping from './PatchMapping.vue';
import { message } from 'ant-design-vue/es';
import { onlyMessage } from '@/utils/comm';
const columns = [
{
@ -280,7 +280,7 @@ const unbind = async (id: string) => {
},
);
if (resp.status === 200) {
message.success('操作成功!');
onlyMessage('操作成功!', 'success');
handleSearch();
}
}
@ -313,7 +313,7 @@ const onSave = () => {
submitData,
);
if (resp.status === 200) {
message.success('操作成功!');
onlyMessage('操作成功!', 'success');
handleSearch();
}
}
@ -342,7 +342,7 @@ const onAction = async (record: any) => {
submitData,
);
if (resp.status === 200) {
message.success('操作成功!');
onlyMessage('操作成功!', 'success');
handleSearch();
}
};

View File

@ -13,7 +13,7 @@
</div>
<div v-else>
<p>{{ type === 'active' ? '启用' : '同步' }}成功{{ count }}</p>
<p v-if="type === 'active'">启用失败:{{ errCount }}条<j-tooltip title="实例信息页面中的配置项未完善"><AIcon type="QuestionCircleOutlined" /></j-tooltip></p>
<p v-if="type === 'active'">启用失败:{{ errCount }}条<j-tooltip title="实例信息页面中的配置项未完善"><AIcon style="margin-left: 5px" type="QuestionCircleOutlined" /></j-tooltip></p>
</div>
</div>
<template #footer>
@ -56,13 +56,13 @@ const getData = (api: string) => {
source.value = _source;
_source.onmessage = (e: any) => {
const res = JSON.parse(e.data);
// console.log(res)
switch (props.type) {
case 'active':
if (res.success) {
_source.close();
dt += res.total;
count.value = dt;
flag.value = false;
} else {
if (res.source) {
errCount.value = 1
@ -76,6 +76,7 @@ const getData = (api: string) => {
case 'sync':
dt += res;
count.value = dt;
flag.value = false;
break;
default:
break;