diff --git a/src/api/account/notificationRecord.ts b/src/api/account/notificationRecord.ts
index 58cb612f..2485069e 100644
--- a/src/api/account/notificationRecord.ts
+++ b/src/api/account/notificationRecord.ts
@@ -1,7 +1,9 @@
import server from '@/utils/request'
// 获取记录列表
-export const getList_api = (data:object): any =>server.post(`/notifications/_query`,data)
+export const getList_api = (data:object): any =>server.get(`/notifications/_query`,encodeParams(data))
+// 获取未读记录列表
+export const getListByUnRead_api = (data:object): any =>server.post(`/notifications/_query`,data)
// 修改记录状态
export const changeStatus_api = (type:'_read'|'_unread',data:string[]): any =>server.post(`/notifications/${type}`,data)
diff --git a/src/components/Layout/components/Notice.vue b/src/components/Layout/components/Notice.vue
index 42ada485..36e6bb38 100644
--- a/src/components/Layout/components/Notice.vue
+++ b/src/components/Layout/components/Notice.vue
@@ -19,7 +19,7 @@
\ No newline at end of file
diff --git a/src/views/device/Instance/Detail/ChildDevice/SaveChild/index.vue b/src/views/device/Instance/Detail/ChildDevice/SaveChild/index.vue
index 8bebc5f3..6138d3f9 100644
--- a/src/views/device/Instance/Detail/ChildDevice/SaveChild/index.vue
+++ b/src/views/device/Instance/Detail/ChildDevice/SaveChild/index.vue
@@ -2,7 +2,7 @@
- 返回
+ 返回
@@ -39,7 +39,10 @@
@@ -64,67 +67,80 @@ const formRef = ref();
const emit = defineEmits(['closeChildSave']);
const productList = ref();
const visible = ref(false);
+/**
+ * 获取产品列表
+ */
const getProductList = async () => {
const res = await getProductListNoPage({
terms: [{ column: 'accessProvider', value: 'edge-child-device' }],
});
if (res.status === 200) {
productList.value = res.result;
- if (props.childData?.id) {
- current.value.parentId = props.childData.id;
- form.name = props.childData?.name;
- form.productId = props.childData?.productId;
- selectChange(form.productId);
- if (current.value.metadata) {
- const metadata = current.value.metadata;
- if (metadata && metadata.length !== 0) {
- getEdgeMap(current.value.id, {
- deviceId: props.childData.id,
- query: {},
- }).then((res) => {
- if (res.status === 200) {
- // console.log(res.result)
- //合并物模型
- const array = res.result[0]?.reduce(
- (x: any, y: any) => {
- const metadataId = metadata.find(
- (item: any) =>
- item.metadataId === y.metadataId,
- );
- if (metadataId) {
- Object.assign(metadataId, y);
- } else {
- x.push(y);
- }
- return x;
- },
- metadata,
- );
- //删除物模型
- const items = array.filter(
- (item: any) => item.metadataName,
- );
- current.value.metadata = items;
- const delList = array
- .filter((a: any) => !a.metadataName)
- .map((b: any) => b.id);
- //删除后解绑
- if (delList && delList.length !== 0) {
- removeEdgeMap(current.value.id, {
- deviceId: props.childData.id,
- idList: [...delList],
- });
- }
- }
- });
- }
- }
- visible.value = true;
- } else {
- current.value.parentId = '';
- }
+ getEdgeMapData();
}
};
+/**
+ * 获取映射数据
+ */
+const getEdgeMapData = () => {
+ if (props.childData?.id) {
+ current.value.parentId = props.childData.id;
+ form.name = props.childData?.name;
+ form.productId = props.childData?.productId;
+ selectChange(form.productId);
+ if (current.value.metadata) {
+ const metadata = current.value.metadata;
+ if (metadata && metadata.length !== 0) {
+ getEdgeMap(current.value.id, {
+ deviceId: props.childData.id,
+ query: {},
+ }).then((res) => {
+ if (res.status === 200) {
+ // console.log(res.result)
+ //合并物模型
+ const array = res.result[0]?.reduce(
+ (x: any, y: any) => {
+ const metadataId = metadata.find(
+ (item: any) =>
+ item.metadataId === y.metadataId,
+ );
+ if (metadataId) {
+ Object.assign(metadataId, y);
+ } else {
+ x.push(y);
+ }
+ return x;
+ },
+ metadata,
+ );
+ //删除物模型
+ const items = array.filter(
+ (item: any) => item.metadataName,
+ );
+ current.value.metadata = items;
+ const delList = array
+ .filter((a: any) => !a.metadataName)
+ .map((b: any) => b.id);
+ //删除后解绑
+ if (delList && delList.length !== 0) {
+ removeEdgeMap(current.value.id, {
+ deviceId: props.childData.id,
+ idList: [...delList],
+ });
+ }
+ }
+ });
+ }
+ }
+ visible.value = true;
+ } else {
+ current.value.parentId = '';
+ }
+};
+/**
+ * 根据产品id获取对应映射列表
+ * @param e 产品id
+ */
const selectChange = (e: any) => {
if (e) {
visible.value = true;
diff --git a/src/views/device/Instance/Detail/ChildDevice/index.vue b/src/views/device/Instance/Detail/ChildDevice/index.vue
index e3e298f2..d723385f 100644
--- a/src/views/device/Instance/Detail/ChildDevice/index.vue
+++ b/src/views/device/Instance/Detail/ChildDevice/index.vue
@@ -1,12 +1,12 @@
-
+
-
+