Commit d62a76a0181ac4a4ffdbb6478be88aa39a060dfd

Authored by ww
1 parent 2bc93fc2

wip: model of matter tsl

1 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 13 </template>
16 14 <script lang="ts" setup>
17 15 import { ref } from 'vue';
18 16 import { BasicModal, useModalInner } from '/@/components/Modal';
19   - // import { useMessage } from '/@/hooks/web/useMessage';
20 17 import TslContent from './cpns/TslContent.vue';
  18 + import { DeviceRecord } from '/@/api/device/model/deviceModel';
21 19
22 20 defineEmits(['register']);
23   - // const { createMessage } = useMessage();
  21 +
  22 + defineProps<{
  23 + record: DeviceRecord;
  24 + }>();
  25 +
24 26 const TslConRef = ref<InstanceType<typeof TslContent>>();
25 27 const isUpdate = ref(false);
26 28
27 29 const [register, { closeModal, setModalProps }] = useModalInner(async (data) => {
  30 + // const record = await getModelTsl({
  31 + // functionType: FunctionType.PROPERTIES,
  32 + // deviceProfileId: props.record.id,
  33 + // });
28 34 setModalProps({ confirmLoading: true });
29 35 isUpdate.value = data.isUpdate;
30 36 setModalProps({ confirmLoading: false });
31 37 // const jsCode = TslConRef?.value.aceEditor.getValue();
32 38 // TslConRef?.value.aceEditor.setValue(jsCode);
33 39 });
  40 +
34 41 const handleCancel = () => {
35 42 TslConRef.value?.resetFormData();
36 43 closeModal();
... ...
... ... @@ -3,11 +3,11 @@
3 3 <div>
4 4 <Typography>
5 5 <TypographyParagraph>
6   - <blockquote style="background: #f2f2f2">{{ useBlockContent }}</blockquote>
  6 + <blockquote class="bg-gray-50">{{ useBlockContent }}</blockquote>
7 7 </TypographyParagraph>
8 8 </Typography>
9 9 </div>
10   - <div style="display: flex; justify-content: space-between; align-items: center">
  10 + <div class="flex justify-between items-center">
11 11 <div>模型内容</div>
12 12 <div>
13 13 <Button @click="handlePremitter">
... ...