fix: 边缘网关和设备诊断
This commit is contained in:
parent
f6947dd3e5
commit
7b83732170
|
@ -218,7 +218,7 @@ const ManualInspection = defineComponent({
|
||||||
if (data.type === 'device') {
|
if (data.type === 'device') {
|
||||||
instanceStore.tabActiveKey = 'Info'
|
instanceStore.tabActiveKey = 'Info'
|
||||||
} else if (data.type === 'product') {
|
} else if (data.type === 'product') {
|
||||||
menuStory.jumpPage('device/Product/Detail', { id: data.productId, tab: 'access' });
|
menuStory.jumpPage('device/Product/Detail', { id: data.productId, tab: 'Device' });
|
||||||
} else {
|
} else {
|
||||||
menuStory.jumpPage('link/AccessConfig/Detail', { id: data.configuration?.id });
|
menuStory.jumpPage('link/AccessConfig/Detail', { id: data.configuration?.id });
|
||||||
}
|
}
|
||||||
|
|
|
@ -891,7 +891,7 @@ const Status = defineComponent({
|
||||||
name: `产品-${item?.name}`,
|
name: `产品-${item?.name}`,
|
||||||
desc: '诊断产品MQTT认证配置是否正确,错误的配置将导致连接失败',
|
desc: '诊断产品MQTT认证配置是否正确,错误的配置将导致连接失败',
|
||||||
data: { ...item },
|
data: { ...item },
|
||||||
configuration,
|
configuration: _configuration,
|
||||||
productId: unref(device).productId,
|
productId: unref(device).productId,
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
|
@ -1052,7 +1052,7 @@ const Status = defineComponent({
|
||||||
name: `设备-${item?.name}`,
|
name: `设备-${item?.name}`,
|
||||||
desc: '诊断设备MQTT认证配置是否正确,错误的配置将导致连接失败',
|
desc: '诊断设备MQTT认证配置是否正确,错误的配置将导致连接失败',
|
||||||
data: { ...item },
|
data: { ...item },
|
||||||
configuration,
|
configuration: _configuration,
|
||||||
productId: unref(device).productId,
|
productId: unref(device).productId,
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -270,13 +270,12 @@ const getDetailFn = async () => {
|
||||||
getStatus(String(_id));
|
getStatus(String(_id));
|
||||||
list.value = [...initList];
|
list.value = [...initList];
|
||||||
getDetail();
|
getDetail();
|
||||||
instanceStore.tabActiveKey = routerParams.params.value.tab || 'Info';
|
|
||||||
}
|
}
|
||||||
|
instanceStore.tabActiveKey = routerParams.params.value.tab || 'Info';
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getDetailFn()
|
getDetailFn()
|
||||||
instanceStore.tabActiveKey = routerParams.params.value.tab || 'Info';
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const onBack = () => {
|
const onBack = () => {
|
||||||
|
|
|
@ -325,6 +325,20 @@ const isCheck = ref<boolean>(false);
|
||||||
const routerParams = useRouterParams()
|
const routerParams = useRouterParams()
|
||||||
const menuStory = useMenuStore();
|
const menuStory = useMenuStore();
|
||||||
|
|
||||||
|
const transformData = (arr: any[]): any[] => {
|
||||||
|
if(Array.isArray(arr) && arr.length){
|
||||||
|
return (arr || []).map((item: any) => {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
id: `classifiedId is ${item.id}`,
|
||||||
|
children: transformData(item.children)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
title: 'ID',
|
title: 'ID',
|
||||||
|
@ -398,10 +412,11 @@ const columns = [
|
||||||
hideInTable: true,
|
hideInTable: true,
|
||||||
search: {
|
search: {
|
||||||
type: 'treeSelect',
|
type: 'treeSelect',
|
||||||
|
rename: 'productId$product-info',
|
||||||
options: () =>
|
options: () =>
|
||||||
new Promise((resolve) => {
|
new Promise((resolve) => {
|
||||||
queryTree({ paging: false }).then((resp: any) => {
|
queryTree({ paging: false }).then((resp: any) => {
|
||||||
resolve(resp.result);
|
resolve(transformData(resp.result));
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
@ -423,12 +438,6 @@ const columns = [
|
||||||
...item,
|
...item,
|
||||||
value: `accessProvider is ${item.id}`
|
value: `accessProvider is ${item.id}`
|
||||||
})))
|
})))
|
||||||
// resolve(
|
|
||||||
// resp.result.map((item: any) => ({
|
|
||||||
// label: item.name,
|
|
||||||
// value: `accessProvider is ${item.id}`,
|
|
||||||
// })),
|
|
||||||
// );
|
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
|
|
@ -191,6 +191,20 @@ const importVisible = ref<boolean>(false);
|
||||||
const visible = ref<boolean>(false);
|
const visible = ref<boolean>(false);
|
||||||
const current = ref<Record<string, any>>({});
|
const current = ref<Record<string, any>>({});
|
||||||
|
|
||||||
|
const transformData = (arr: any[]): any[] => {
|
||||||
|
if(Array.isArray(arr) && arr.length){
|
||||||
|
return (arr || []).map((item: any) => {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
id: `classifiedId is ${item.id}`,
|
||||||
|
children: transformData(item.children)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
title: 'ID',
|
title: 'ID',
|
||||||
|
@ -216,6 +230,7 @@ const columns = [
|
||||||
key: 'productName',
|
key: 'productName',
|
||||||
search: {
|
search: {
|
||||||
type: 'select',
|
type: 'select',
|
||||||
|
rename: 'productId',
|
||||||
options: () =>
|
options: () =>
|
||||||
new Promise((resolve) => {
|
new Promise((resolve) => {
|
||||||
queryNoPagingPost({ paging: false }).then((resp: any) => {
|
queryNoPagingPost({ paging: false }).then((resp: any) => {
|
||||||
|
@ -253,8 +268,8 @@ const columns = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'classifiedId',
|
key: 'productId$product-info',
|
||||||
dataIndex: 'classifiedId',
|
dataIndex: 'productId$product-info',
|
||||||
title: '产品分类',
|
title: '产品分类',
|
||||||
hideInTable: true,
|
hideInTable: true,
|
||||||
search: {
|
search: {
|
||||||
|
@ -262,7 +277,7 @@ const columns = [
|
||||||
options: () =>
|
options: () =>
|
||||||
new Promise((resolve) => {
|
new Promise((resolve) => {
|
||||||
queryTree({ paging: false }).then((resp: any) => {
|
queryTree({ paging: false }).then((resp: any) => {
|
||||||
resolve(resp.result);
|
resolve(transformData(resp.result));
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
|
|
@ -171,11 +171,12 @@ const handleClick = (_detail: any) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
watch(() => props.value, async (newVal) => {
|
watch(() => props.value?.[0]?.value, (newVal) => {
|
||||||
if(newVal[0]?.value){
|
console.log(newVal, '123')
|
||||||
const { result } = await detail(newVal[0]?.value)
|
if(newVal){
|
||||||
emit('update:value', [{ value: result?.id, name: result?.name }]);
|
detail(newVal[0]?.value).then(resp => {
|
||||||
emit('change', result);
|
emit('change', resp.result);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
deep: true,
|
deep: true,
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
type="simple"
|
type="simple"
|
||||||
target="action-notice-config"
|
target="action-notice-config"
|
||||||
@search="handleSearch"
|
@search="handleSearch"
|
||||||
class="search"
|
class="action-search"
|
||||||
/>
|
/>
|
||||||
<div style="height: 400px; overflow-y: auto">
|
<div style="height: 400px; overflow-y: auto">
|
||||||
<JProTable
|
<JProTable
|
||||||
|
@ -12,8 +12,7 @@
|
||||||
:request="query"
|
:request="query"
|
||||||
model="CARD"
|
model="CARD"
|
||||||
:bodyStyle="{
|
:bodyStyle="{
|
||||||
paddingRight: 0,
|
padding: 0,
|
||||||
paddingLeft: 0,
|
|
||||||
}"
|
}"
|
||||||
:params="params"
|
:params="params"
|
||||||
:gridColumn="2"
|
:gridColumn="2"
|
||||||
|
@ -155,9 +154,15 @@ const onSelectChange = (keys: string[]) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleClick = (dt: any) => {
|
const handleClick = (dt: any) => {
|
||||||
_selectedRowKeys.value = [dt.id];
|
if (_selectedRowKeys.value.includes(dt.id)) {
|
||||||
emit('update:value', dt.id);
|
_selectedRowKeys.value = [];
|
||||||
emit('change', { provider: dt?.provider });
|
emit('update:value', undefined);
|
||||||
|
emit('change', { provider: undefined });
|
||||||
|
} else {
|
||||||
|
_selectedRowKeys.value = [dt.id];
|
||||||
|
emit('update:value', dt.id);
|
||||||
|
emit('change', { provider: dt?.provider });
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
|
@ -176,11 +181,9 @@ watch(
|
||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less">
|
||||||
.search {
|
.action-search {
|
||||||
margin-bottom: 0;
|
padding: 0 0 24px 0;
|
||||||
padding-right: 0px;
|
|
||||||
padding-left: 0px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
type="simple"
|
type="simple"
|
||||||
target="action-notice-template"
|
target="action-notice-template"
|
||||||
@search="handleSearch"
|
@search="handleSearch"
|
||||||
class="search"
|
class="action-search"
|
||||||
/>
|
/>
|
||||||
<div style="height: 400px; overflow-y: auto">
|
<div style="height: 400px; overflow-y: auto">
|
||||||
<JProTable
|
<JProTable
|
||||||
|
@ -12,8 +12,7 @@
|
||||||
:request="(e) => handleData(e)"
|
:request="(e) => handleData(e)"
|
||||||
model="CARD"
|
model="CARD"
|
||||||
:bodyStyle="{
|
:bodyStyle="{
|
||||||
paddingRight: 0,
|
padding: 0
|
||||||
paddingLeft: 0,
|
|
||||||
}"
|
}"
|
||||||
:params="params"
|
:params="params"
|
||||||
:gridColumn="2"
|
:gridColumn="2"
|
||||||
|
@ -130,9 +129,15 @@ const handleSearch = (_params: any) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleClick = (dt: any) => {
|
const handleClick = (dt: any) => {
|
||||||
_selectedRowKeys.value = [dt.id];
|
if (_selectedRowKeys.value.includes(dt.id)) {
|
||||||
emit('update:value', dt.id);
|
_selectedRowKeys.value = [];
|
||||||
emit('change', { templateName: dt?.name });
|
emit('update:value', undefined);
|
||||||
|
emit('change', { templateName: undefined });
|
||||||
|
} else {
|
||||||
|
_selectedRowKeys.value = [dt.id];
|
||||||
|
emit('update:value', dt.id);
|
||||||
|
emit('change', { templateName: dt?.name });
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const onSelectChange = (keys: string[]) => {
|
const onSelectChange = (keys: string[]) => {
|
||||||
|
@ -176,10 +181,9 @@ watch(
|
||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less">
|
||||||
.search {
|
.action-search {
|
||||||
margin-bottom: 0;
|
padding: 0 0 24px 0;
|
||||||
padding: 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
|
|
Loading…
Reference in New Issue