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