...
|
...
|
@@ -19,11 +19,13 @@ |
19
|
19
|
</template>
|
20
|
20
|
</template>
|
21
|
21
|
<script lang="ts" setup name="SelectDevice">
|
22
|
|
- import { ref, Ref, PropType, unref, nextTick } from 'vue';
|
|
22
|
+ import { ref, Ref, PropType, unref, nextTick, onMounted } from 'vue';
|
23
|
23
|
import { Select } from 'ant-design-vue';
|
24
|
24
|
import SelectDevice from './SelectDevice.vue';
|
25
|
25
|
import { createPickerSearch } from '/@/utils/pickerSearch';
|
26
|
26
|
|
|
27
|
+ import { getDeviceProfile } from '/@/api/alarm/position';
|
|
28
|
+
|
27
|
29
|
defineProps({
|
28
|
30
|
selectOptions: {
|
29
|
31
|
type: Array as PropType<any[]>,
|
...
|
...
|
@@ -36,6 +38,7 @@ |
36
|
38
|
});
|
37
|
39
|
|
38
|
40
|
const selectValue = ref([]);
|
|
41
|
+ const selectOptions = ref<any>([]);
|
39
|
42
|
|
40
|
43
|
const bindDeviceRef = {
|
41
|
44
|
deviceAttrRef: ref([]),
|
...
|
...
|
@@ -62,12 +65,10 @@ |
62
|
65
|
};
|
63
|
66
|
|
64
|
67
|
const setValue = (value: any) => {
|
65
|
|
- console.log(value);
|
66
|
68
|
selectValue.value = value.map((item) => ({
|
67
|
69
|
label: item.name,
|
68
|
70
|
key: item.profileId,
|
69
|
71
|
}));
|
70
|
|
-
|
71
|
72
|
profileList.value = value.map((item) => {
|
72
|
73
|
return {
|
73
|
74
|
label: item.name,
|
...
|
...
|
@@ -81,6 +82,14 @@ |
81
|
82
|
profileList.value = [];
|
82
|
83
|
};
|
83
|
84
|
|
|
85
|
+ onMounted(async () => {
|
|
86
|
+ const values = await getDeviceProfile();
|
|
87
|
+ selectOptions.value = values.map((item) => ({
|
|
88
|
+ label: item.name,
|
|
89
|
+ value: item.id,
|
|
90
|
+ }));
|
|
91
|
+ });
|
|
92
|
+
|
84
|
93
|
defineExpose({
|
85
|
94
|
getSelectDevice,
|
86
|
95
|
setValue,
|
...
|
...
|
|