fix: bug#12637、12632
This commit is contained in:
parent
5f8bc64b1e
commit
122c7ae928
|
@ -376,7 +376,8 @@ const defaultParams = ref({
|
||||||
terms: [
|
terms: [
|
||||||
{
|
{
|
||||||
column: 'collectorId',
|
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 subscribeProperty = (value: any) => {
|
||||||
const list = value.map((item: any) => item.id);
|
const list = value.map((item: any) => item.id);
|
||||||
const id = `collector-${props.data?.channelId || 'channel'}-${
|
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('-')}`;
|
}-data-${list.join('-')}`;
|
||||||
const topic = `/collector/${props.data?.channelId || '*'}/${
|
const topic = `/collector/${props.data?.channelId || '*'}/${
|
||||||
props.data?.id || '*'
|
(props.data?.id || (props.data && props.data.id === '*')) ? '*' : props.data?.id
|
||||||
}/data`;
|
}/data`;
|
||||||
subRef.value = getWebSocket(id, topic, {
|
subRef.value = getWebSocket(id, topic, {
|
||||||
pointId: list.join(','),
|
pointId: list.join(','),
|
||||||
|
@ -694,7 +695,7 @@ watch(
|
||||||
label: '订阅',
|
label: '订阅',
|
||||||
value: 'subscribe',
|
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();
|
tableRef?.value?.reload && tableRef?.value?.reload();
|
||||||
cancelSelect();
|
cancelSelect();
|
||||||
checkAll.value = false;
|
checkAll.value = false;
|
||||||
|
|
|
@ -224,12 +224,12 @@ const handleOk = async () => {
|
||||||
|
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const response = !id
|
const response = !id
|
||||||
? await save(params)
|
? await save(params).catch(() => { success: false })
|
||||||
: await update(id, { ...props.data, ...params });
|
: await update(id, { ...props.data, ...params }).catch(() => { success: false });
|
||||||
if (response.status === 200) {
|
loading.value = false;
|
||||||
|
if (response.success) {
|
||||||
emit('change', true);
|
emit('change', true);
|
||||||
}
|
}
|
||||||
loading.value = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const getTypeTooltip = (value: string) =>
|
const getTypeTooltip = (value: string) =>
|
||||||
|
|
|
@ -25,8 +25,8 @@
|
||||||
v-model:selected-keys="selectedKeys"
|
v-model:selected-keys="selectedKeys"
|
||||||
:fieldNames="{ key: 'id' }"
|
:fieldNames="{ key: 'id' }"
|
||||||
v-if="
|
v-if="
|
||||||
defualtDataSource.length !== 0 ||
|
!(defualtDataSource.length === 0 ||
|
||||||
defualtDataSource?.[0]?.children?.length !== 0
|
defualtDataSource?.[0]?.children?.length === 0)
|
||||||
"
|
"
|
||||||
:height="660"
|
:height="660"
|
||||||
defaultExpandAll
|
defaultExpandAll
|
||||||
|
@ -247,7 +247,7 @@ const handleSearch = async (value: any) => {
|
||||||
collectorAll.value = res.result;
|
collectorAll.value = res.result;
|
||||||
|
|
||||||
if (selectedKeys.value.length === 0) {
|
if (selectedKeys.value.length === 0) {
|
||||||
selectedKeys.value = ['*'];
|
selectedKeys.value = res.result.length ? ['*'] : [];
|
||||||
}
|
}
|
||||||
|
|
||||||
//激活change事件
|
//激活change事件
|
||||||
|
@ -259,8 +259,8 @@ const handleSearch = async (value: any) => {
|
||||||
}
|
}
|
||||||
spinning.value = false;
|
spinning.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
const getChannelNoPaging = async () => {
|
const getChannelNoPaging = async () => {
|
||||||
|
|
||||||
const res = await queryChannelNoPaging();
|
const res = await queryChannelNoPaging();
|
||||||
Store.set('channelListAll', res.result);
|
Store.set('channelListAll', res.result);
|
||||||
};
|
};
|
||||||
|
@ -275,8 +275,14 @@ watch(
|
||||||
(n, p) => {
|
(n, p) => {
|
||||||
const key = _.isArray(n) ? n[0] : n;
|
const key = _.isArray(n) ? n[0] : n;
|
||||||
if (key) {
|
if (key) {
|
||||||
|
if (key !== "*") {
|
||||||
const row = collectorAll.value.find((i: any) => i.id === key);
|
const row = collectorAll.value.find((i: any) => i.id === key);
|
||||||
emits('change', row);
|
emits('change', row);
|
||||||
|
} else {
|
||||||
|
emits('change', {
|
||||||
|
id: '*'
|
||||||
|
});
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
selectedKeys.value = p; // 防止取消
|
selectedKeys.value = p; // 防止取消
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ import Tree from './Tree/index.vue';
|
||||||
import Point from './Point/index.vue';
|
import Point from './Point/index.vue';
|
||||||
|
|
||||||
const data = ref();
|
const data = ref();
|
||||||
const spinning = ref(true);
|
const spinning = ref(false);
|
||||||
|
|
||||||
const changeTree = (row: any) => {
|
const changeTree = (row: any) => {
|
||||||
spinning.value = true;
|
spinning.value = true;
|
||||||
|
|
|
@ -655,7 +655,7 @@ const saveData = () => {
|
||||||
if (route.query.save) {
|
if (route.query.save) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
window?.onTabSaveSuccess(resp);
|
window?.onTabSaveSuccess(resp);
|
||||||
window.close();
|
setTimeout(() => window.close(), 300);
|
||||||
} else {
|
} else {
|
||||||
history.back();
|
history.back();
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,7 +125,7 @@ const onFinish = async (values: any) => {
|
||||||
if (route.query.save) {
|
if (route.query.save) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
window?.onTabSaveSuccess(resp.result);
|
window?.onTabSaveSuccess(resp.result);
|
||||||
window.close();
|
setTimeout(() => window.close(), 300);
|
||||||
} else {
|
} else {
|
||||||
history.back();
|
history.back();
|
||||||
}
|
}
|
||||||
|
|
|
@ -188,7 +188,7 @@ function delDepartment(id: string) {
|
||||||
function refresh(id: string) {
|
function refresh(id: string) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
window?.onTabSaveSuccess && window.onTabSaveSuccess(id);
|
window?.onTabSaveSuccess && window.onTabSaveSuccess(id);
|
||||||
window.close();
|
setTimeout(() => window.close(), 300);
|
||||||
getTree();
|
getTree();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ const confirm = () => {
|
||||||
if (route.query.save) {
|
if (route.query.save) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
window?.onTabSaveSuccess(resp.result.id);
|
window?.onTabSaveSuccess(resp.result.id);
|
||||||
window.close();
|
setTimeout(() => window.close(), 300);
|
||||||
} else jumpPage(`system/Role/Detail`, { id: resp.result.id });
|
} else jumpPage(`system/Role/Detail`, { id: resp.result.id });
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -96,7 +96,7 @@ export default defineConfig(({ mode}) => {
|
||||||
// target: 'http://192.168.32.244:8881',
|
// target: 'http://192.168.32.244:8881',
|
||||||
target: 'http://120.77.179.54:8844', // 120测试
|
target: 'http://120.77.179.54:8844', // 120测试
|
||||||
// target: 'http://192.168.33.46:8844', // 本地开发环境
|
// target: 'http://192.168.33.46:8844', // 本地开发环境
|
||||||
ws: 'ws://192.168.33.46:8844',
|
ws: 'ws://120.77.179.54:8844',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: (path) => path.replace(/^\/api/, '')
|
rewrite: (path) => path.replace(/^\/api/, '')
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue