1
|
<template>
|
1
|
<template>
|
2
|
- <div>
|
|
|
3
|
- <BasicModal
|
|
|
4
|
- title="物模型TSL"
|
|
|
5
|
- :maskClosable="false"
|
|
|
6
|
- v-bind="$attrs"
|
|
|
7
|
- width="55rem"
|
|
|
8
|
- @register="register"
|
|
|
9
|
- @ok="handleSubmit"
|
|
|
10
|
- @cancel="handleCancel"
|
|
|
11
|
- >
|
|
|
12
|
- <TslContent ref="TslConRef" />
|
|
|
13
|
- </BasicModal>
|
|
|
14
|
- </div>
|
2
|
+ <BasicModal
|
|
|
3
|
+ title="物模型TSL"
|
|
|
4
|
+ :maskClosable="false"
|
|
|
5
|
+ v-bind="$attrs"
|
|
|
6
|
+ width="55rem"
|
|
|
7
|
+ @register="register"
|
|
|
8
|
+ @ok="handleSubmit"
|
|
|
9
|
+ @cancel="handleCancel"
|
|
|
10
|
+ >
|
|
|
11
|
+ <TslContent :record="$props.record" ref="TslConRef" />
|
|
|
12
|
+ </BasicModal>
|
15
|
</template>
|
13
|
</template>
|
16
|
<script lang="ts" setup>
|
14
|
<script lang="ts" setup>
|
17
|
import { ref } from 'vue';
|
15
|
import { ref } from 'vue';
|
18
|
import { BasicModal, useModalInner } from '/@/components/Modal';
|
16
|
import { BasicModal, useModalInner } from '/@/components/Modal';
|
19
|
- // import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
20
|
import TslContent from './cpns/TslContent.vue';
|
17
|
import TslContent from './cpns/TslContent.vue';
|
|
|
18
|
+ import { DeviceRecord } from '/@/api/device/model/deviceModel';
|
21
|
|
19
|
|
22
|
defineEmits(['register']);
|
20
|
defineEmits(['register']);
|
23
|
- // const { createMessage } = useMessage();
|
21
|
+
|
|
|
22
|
+ defineProps<{
|
|
|
23
|
+ record: DeviceRecord;
|
|
|
24
|
+ }>();
|
|
|
25
|
+
|
24
|
const TslConRef = ref<InstanceType<typeof TslContent>>();
|
26
|
const TslConRef = ref<InstanceType<typeof TslContent>>();
|
25
|
const isUpdate = ref(false);
|
27
|
const isUpdate = ref(false);
|
26
|
|
28
|
|
27
|
const [register, { closeModal, setModalProps }] = useModalInner(async (data) => {
|
29
|
const [register, { closeModal, setModalProps }] = useModalInner(async (data) => {
|
|
|
30
|
+ // const record = await getModelTsl({
|
|
|
31
|
+ // functionType: FunctionType.PROPERTIES,
|
|
|
32
|
+ // deviceProfileId: props.record.id,
|
|
|
33
|
+ // });
|
28
|
setModalProps({ confirmLoading: true });
|
34
|
setModalProps({ confirmLoading: true });
|
29
|
isUpdate.value = data.isUpdate;
|
35
|
isUpdate.value = data.isUpdate;
|
30
|
setModalProps({ confirmLoading: false });
|
36
|
setModalProps({ confirmLoading: false });
|
31
|
// const jsCode = TslConRef?.value.aceEditor.getValue();
|
37
|
// const jsCode = TslConRef?.value.aceEditor.getValue();
|
32
|
// TslConRef?.value.aceEditor.setValue(jsCode);
|
38
|
// TslConRef?.value.aceEditor.setValue(jsCode);
|
33
|
});
|
39
|
});
|
|
|
40
|
+
|
34
|
const handleCancel = () => {
|
41
|
const handleCancel = () => {
|
35
|
TslConRef.value?.resetFormData();
|
42
|
TslConRef.value?.resetFormData();
|
36
|
closeModal();
|
43
|
closeModal();
|