Commit d62a76a0181ac4a4ffdbb6478be88aa39a060dfd

Authored by ww
1 parent 2bc93fc2

wip: model of matter tsl

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();
@@ -3,11 +3,11 @@ @@ -3,11 +3,11 @@
3 <div> 3 <div>
4 <Typography> 4 <Typography>
5 <TypographyParagraph> 5 <TypographyParagraph>
6 - <blockquote style="background: #f2f2f2">{{ useBlockContent }}</blockquote> 6 + <blockquote class="bg-gray-50">{{ useBlockContent }}</blockquote>
7 </TypographyParagraph> 7 </TypographyParagraph>
8 </Typography> 8 </Typography>
9 </div> 9 </div>
10 - <div style="display: flex; justify-content: space-between; align-items: center"> 10 + <div class="flex justify-between items-center">
11 <div>模型内容</div> 11 <div>模型内容</div>
12 <div> 12 <div>
13 <Button @click="handlePremitter"> 13 <Button @click="handlePremitter">