fix: bug#17573【设备】插件设备进行映射时,传参ID错误,传入了设备接入网关ID,应该为插件ID

This commit is contained in:
leiqiaochu 2024-10-31 11:52:22 +08:00
parent 0ced59c084
commit 2e2ec80979
2 changed files with 18 additions and 15 deletions

View File

@ -53,7 +53,7 @@ const handleOk = async () => {
loading.value = true loading.value = true
const res = await savePluginData( const res = await savePluginData(
'device', 'device',
props.pluginId!, props.accessId!,
route.params.id as string, route.params.id as string,
checkKey.value checkKey.value
).catch(() => ({ success: false })) ).catch(() => ({ success: false }))
@ -71,7 +71,7 @@ const handleCancel = () => {
} }
const getCheckedKeys = () => { const getCheckedKeys = () => {
getPluginData( 'device', props.pluginId!, route.params.id as string,).then(res => { getPluginData( 'device', props.accessId!, route.params.id as string,).then(res => {
if (res.success) { if (res.success) {
checkKey.value = res.result?.externalId || '' checkKey.value = res.result?.externalId || ''
} }

View File

@ -145,12 +145,12 @@ const props = defineProps({
default: undefined, default: undefined,
}, },
type: { type: {
type: String, type: String,
default: 'device', default: 'device',
}, },
internalId: { internalId: {
type: String, type: String,
default: undefined, default: undefined,
}, },
}); });
@ -181,9 +181,10 @@ const queryInkingDevices = (data: string[]) => {
return; return;
} }
const res = await getInkingDevices(data,props.accessId); const res = await getInkingDevices(data, props.accessId);
if (res) { if (res) {
disabledKeys.value = res.result?.map((item) => item.externalId) || []; disabledKeys.value =
res.result?.map((item) => item.externalId) || [];
} }
resolve(true); resolve(true);
@ -250,15 +251,17 @@ const init = async () => {
const resp = await getCommandsByAccess(props.accessId); const resp = await getCommandsByAccess(props.accessId);
if (resp.success && resp.result?.length) { if (resp.success && resp.result?.length) {
// //
const item = resp.result.find(item => item.id === 'QueryDevicePage'); const item = resp.result.find(
(item) => item.id === 'QueryDevicePage',
);
if (item) { if (item) {
showPage.value = true showPage.value = true;
columns.value = item.expands?.terms?.map((t) => ({ columns.value = item.expands?.terms?.map((t) => ({
title: t.name, title: t.name,
dataIndex: t.id, dataIndex: t.id,
search: { search: {
type: t.valueType.type, type: t.valueType.type,
}, },
})); }));
} }
} }