fix: bug#12637、12632

This commit is contained in:
xieyonghong 2023-04-26 14:30:09 +08:00
parent 5f8bc64b1e
commit 122c7ae928
9 changed files with 25 additions and 18 deletions

View File

@ -376,7 +376,8 @@ const defaultParams = ref({
terms: [
{
column: 'collectorId',
value: props.data.id,
termType: 'eq',
value: !props.data?.id ? 'undefined' : (props.data.id === '*' ? undefined : props.data.id),
},
],
},
@ -628,10 +629,10 @@ const handleSubscribeValue = throttle((payload: any) => {
const subscribeProperty = (value: any) => {
const list = value.map((item: any) => item.id);
const id = `collector-${props.data?.channelId || 'channel'}-${
props.data?.id || 'point'
(props.data?.id || (props.data && props.data.id === '*')) ? 'point' : props.data?.id
}-data-${list.join('-')}`;
const topic = `/collector/${props.data?.channelId || '*'}/${
props.data?.id || '*'
(props.data?.id || (props.data && props.data.id === '*')) ? '*' : props.data?.id
}/data`;
subRef.value = getWebSocket(id, topic, {
pointId: list.join(','),
@ -694,7 +695,7 @@ watch(
label: '订阅',
value: 'subscribe',
});
defaultParams.value.terms[0].terms[0].value = value.id;
defaultParams.value.terms[0].terms[0].value = !value.id ? 'undefined' : (value.id === '*' ? undefined : value.id);
tableRef?.value?.reload && tableRef?.value?.reload();
cancelSelect();
checkAll.value = false;

View File

@ -224,12 +224,12 @@ const handleOk = async () => {
loading.value = true;
const response = !id
? await save(params)
: await update(id, { ...props.data, ...params });
if (response.status === 200) {
? await save(params).catch(() => { success: false })
: await update(id, { ...props.data, ...params }).catch(() => { success: false });
loading.value = false;
if (response.success) {
emit('change', true);
}
loading.value = false;
};
const getTypeTooltip = (value: string) =>

View File

@ -25,8 +25,8 @@
v-model:selected-keys="selectedKeys"
:fieldNames="{ key: 'id' }"
v-if="
defualtDataSource.length !== 0 ||
defualtDataSource?.[0]?.children?.length !== 0
!(defualtDataSource.length === 0 ||
defualtDataSource?.[0]?.children?.length === 0)
"
:height="660"
defaultExpandAll
@ -247,7 +247,7 @@ const handleSearch = async (value: any) => {
collectorAll.value = res.result;
if (selectedKeys.value.length === 0) {
selectedKeys.value = ['*'];
selectedKeys.value = res.result.length ? ['*'] : [];
}
//change
@ -259,8 +259,8 @@ const handleSearch = async (value: any) => {
}
spinning.value = false;
};
const getChannelNoPaging = async () => {
const res = await queryChannelNoPaging();
Store.set('channelListAll', res.result);
};
@ -275,8 +275,14 @@ watch(
(n, p) => {
const key = _.isArray(n) ? n[0] : n;
if (key) {
if (key !== "*") {
const row = collectorAll.value.find((i: any) => i.id === key);
emits('change', row);
} else {
emits('change', {
id: '*'
});
}
} else {
selectedKeys.value = p; //
}

View File

@ -19,7 +19,7 @@ import Tree from './Tree/index.vue';
import Point from './Point/index.vue';
const data = ref();
const spinning = ref(true);
const spinning = ref(false);
const changeTree = (row: any) => {
spinning.value = true;

View File

@ -655,7 +655,7 @@ const saveData = () => {
if (route.query.save) {
// @ts-ignore
window?.onTabSaveSuccess(resp);
window.close();
setTimeout(() => window.close(), 300);
} else {
history.back();
}

View File

@ -125,7 +125,7 @@ const onFinish = async (values: any) => {
if (route.query.save) {
// @ts-ignore
window?.onTabSaveSuccess(resp.result);
window.close();
setTimeout(() => window.close(), 300);
} else {
history.back();
}

View File

@ -188,7 +188,7 @@ function delDepartment(id: string) {
function refresh(id: string) {
// @ts-ignore
window?.onTabSaveSuccess && window.onTabSaveSuccess(id);
window.close();
setTimeout(() => window.close(), 300);
getTree();
}

View File

@ -65,7 +65,7 @@ const confirm = () => {
if (route.query.save) {
// @ts-ignore
window?.onTabSaveSuccess(resp.result.id);
window.close();
setTimeout(() => window.close(), 300);
} else jumpPage(`system/Role/Detail`, { id: resp.result.id });
}
})

View File

@ -96,7 +96,7 @@ export default defineConfig(({ mode}) => {
// target: 'http://192.168.32.244:8881',
target: 'http://120.77.179.54:8844', // 120测试
// target: 'http://192.168.33.46:8844', // 本地开发环境
ws: 'ws://192.168.33.46:8844',
ws: 'ws://120.77.179.54:8844',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
}