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

View File

@ -13,7 +13,7 @@
</div> </div>
<div v-else> <div v-else>
<p>{{ type === 'active' ? '启用' : '同步' }}成功{{ count }}</p> <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>
</div> </div>
<template #footer> <template #footer>
@ -56,13 +56,13 @@ const getData = (api: string) => {
source.value = _source; source.value = _source;
_source.onmessage = (e: any) => { _source.onmessage = (e: any) => {
const res = JSON.parse(e.data); const res = JSON.parse(e.data);
// console.log(res)
switch (props.type) { switch (props.type) {
case 'active': case 'active':
if (res.success) { if (res.success) {
_source.close(); _source.close();
dt += res.total; dt += res.total;
count.value = dt; count.value = dt;
flag.value = false;
} else { } else {
if (res.source) { if (res.source) {
errCount.value = 1 errCount.value = 1
@ -76,6 +76,7 @@ const getData = (api: string) => {
case 'sync': case 'sync':
dt += res; dt += res;
count.value = dt; count.value = dt;
flag.value = false;
break; break;
default: default:
break; break;