|
@@ -55,7 +55,6 @@ |
|
@@ -55,7 +55,6 @@ |
55
|
import { screenLinkPageByDeptIdGetDevice } from '/@/api/ruleengine/ruleengineApi';
|
55
|
import { screenLinkPageByDeptIdGetDevice } from '/@/api/ruleengine/ruleengineApi';
|
56
|
import { Select } from 'ant-design-vue';
|
56
|
import { Select } from 'ant-design-vue';
|
57
|
import DeviceAttrCpns from './cpns/DeviceAttrCpns.vue';
|
57
|
import DeviceAttrCpns from './cpns/DeviceAttrCpns.vue';
|
58
|
- import { SelectTypes } from 'ant-design-vue/es/select';
|
|
|
59
|
import { SchemaFiled } from './config.data';
|
58
|
import { SchemaFiled } from './config.data';
|
60
|
import { QueryWay } from '../../device/localtion/cpns/TimePeriodForm/config';
|
59
|
import { QueryWay } from '../../device/localtion/cpns/TimePeriodForm/config';
|
61
|
import { AggregateDataEnum } from '../../device/localtion/cpns/TimePeriodForm/config';
|
60
|
import { AggregateDataEnum } from '../../device/localtion/cpns/TimePeriodForm/config';
|
|
@@ -68,6 +67,14 @@ |
|
@@ -68,6 +67,14 @@ |
68
|
device?: string;
|
67
|
device?: string;
|
69
|
name?: string;
|
68
|
name?: string;
|
70
|
attributes?: string | undefined;
|
69
|
attributes?: string | undefined;
|
|
|
70
|
+ deviceProfileId?: string;
|
|
|
71
|
+ id?: string;
|
|
|
72
|
+ };
|
|
|
73
|
+ type TSelectOption = {
|
|
|
74
|
+ value?: string;
|
|
|
75
|
+ label?: string;
|
|
|
76
|
+ deviceProfileId?: string;
|
|
|
77
|
+ id?: string;
|
71
|
};
|
78
|
};
|
72
|
const emit = defineEmits(['success', 'register']);
|
79
|
const emit = defineEmits(['success', 'register']);
|
73
|
const bindDeviceRefObj = {
|
80
|
const bindDeviceRefObj = {
|
|
@@ -76,7 +83,7 @@ |
|
@@ -76,7 +83,7 @@ |
76
|
const isUpdate = ref(true);
|
83
|
const isUpdate = ref(true);
|
77
|
const editId = ref('');
|
84
|
const editId = ref('');
|
78
|
const orgId = ref('');
|
85
|
const orgId = ref('');
|
79
|
- const selectOptions: Ref<SelectTypes['options']> = ref([]);
|
86
|
+ const selectOptions: Ref<TSelectOption[]> = ref([]);
|
80
|
const selectDevice = ref([]);
|
87
|
const selectDevice = ref([]);
|
81
|
const deviceList: Ref<TDeviceList[]> = ref([]);
|
88
|
const deviceList: Ref<TDeviceList[]> = ref([]);
|
82
|
const editDeviceList: Ref<TDeviceList[]> = ref([]);
|
89
|
const editDeviceList: Ref<TDeviceList[]> = ref([]);
|
|
@@ -126,18 +133,20 @@ |
|
@@ -126,18 +133,20 @@ |
126
|
return {
|
133
|
return {
|
127
|
label: item.name,
|
134
|
label: item.name,
|
128
|
value: item.tbDeviceId,
|
135
|
value: item.tbDeviceId,
|
|
|
136
|
+ id: item.id,
|
|
|
137
|
+ deviceProfileId: item.deviceProfileId,
|
129
|
};
|
138
|
};
|
130
|
});
|
139
|
});
|
131
|
}
|
140
|
}
|
132
|
}
|
141
|
}
|
133
|
);
|
142
|
);
|
134
|
//设备Select选中
|
143
|
//设备Select选中
|
135
|
- const handleDeviceChange = (e) => {
|
144
|
+ const handleDeviceChange = (_, o) => {
|
136
|
if (unref(isUpdate)) {
|
145
|
if (unref(isUpdate)) {
|
137
|
//编辑
|
146
|
//编辑
|
138
|
let temp: any = [];
|
147
|
let temp: any = [];
|
139
|
editDeviceAttr.value.forEach((f) => {
|
148
|
editDeviceAttr.value.forEach((f) => {
|
140
|
- temp = [f, ...e];
|
149
|
+ temp = [f, ...o];
|
141
|
});
|
150
|
});
|
142
|
let deWeightThree = () => {
|
151
|
let deWeightThree = () => {
|
143
|
let map = new Map();
|
152
|
let map = new Map();
|
|
@@ -150,11 +159,11 @@ |
|
@@ -150,11 +159,11 @@ |
150
|
};
|
159
|
};
|
151
|
temp = deWeightThree();
|
160
|
temp = deWeightThree();
|
152
|
deviceList.value = temp;
|
161
|
deviceList.value = temp;
|
153
|
- if (e.length !== 0) {
|
|
|
154
|
- deviceList.value = e;
|
162
|
+ if (o.length !== 0) {
|
|
|
163
|
+ deviceList.value = o;
|
155
|
}
|
164
|
}
|
156
|
} else {
|
165
|
} else {
|
157
|
- deviceList.value = e;
|
166
|
+ deviceList.value = o;
|
158
|
}
|
167
|
}
|
159
|
};
|
168
|
};
|
160
|
//设备取消删除
|
169
|
//设备取消删除
|
|
@@ -284,6 +293,8 @@ |
|
@@ -284,6 +293,8 @@ |
284
|
return {
|
293
|
return {
|
285
|
label: item.name,
|
294
|
label: item.name,
|
286
|
value: item.tbDeviceId,
|
295
|
value: item.tbDeviceId,
|
|
|
296
|
+ id: item.id,
|
|
|
297
|
+ deviceProfileId: item.deviceProfileId,
|
287
|
};
|
298
|
};
|
288
|
});
|
299
|
});
|
289
|
const deviceIds = editResData.data.executeAttributes.map((m) => {
|
300
|
const deviceIds = editResData.data.executeAttributes.map((m) => {
|
|
@@ -295,7 +306,16 @@ |
|
@@ -295,7 +306,16 @@ |
295
|
selectDevice.value = deviceIds;
|
306
|
selectDevice.value = deviceIds;
|
296
|
//回显设备属性
|
307
|
//回显设备属性
|
297
|
editDeviceAttr.value = editResData.data.executeAttributes?.map((item) => {
|
308
|
editDeviceAttr.value = editResData.data.executeAttributes?.map((item) => {
|
|
|
309
|
+ const T = selectOptions.value.find((o) => {
|
|
|
310
|
+ if (item.device === o.value) {
|
|
|
311
|
+ return {
|
|
|
312
|
+ id: o.id,
|
|
|
313
|
+ deviceProfileId: o.deviceProfileId,
|
|
|
314
|
+ };
|
|
|
315
|
+ }
|
|
|
316
|
+ });
|
298
|
return {
|
317
|
return {
|
|
|
318
|
+ ...T,
|
299
|
label: item.name,
|
319
|
label: item.name,
|
300
|
value: item.device,
|
320
|
value: item.device,
|
301
|
attributes: item.attributes,
|
321
|
attributes: item.attributes,
|