PhysicalModelTsl.vue
1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<template>
<div>
<BasicModal
title="物模型TSL"
:maskClosable="false"
v-bind="$attrs"
width="55rem"
@register="register"
@ok="handleSubmit"
@cancel="handleCancel"
>
<TslContent ref="TslConRef" />
</BasicModal>
</div>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
// import { useMessage } from '/@/hooks/web/useMessage';
import TslContent from './cpns/TslContent.vue';
defineEmits(['register']);
// const { createMessage } = useMessage();
const TslConRef = ref<InstanceType<typeof TslContent>>();
const isUpdate = ref(false);
const [register, { closeModal, setModalProps }] = useModalInner(async (data) => {
setModalProps({ confirmLoading: true });
isUpdate.value = data.isUpdate;
setModalProps({ confirmLoading: false });
// const jsCode = TslConRef?.value.aceEditor.getValue();
// TslConRef?.value.aceEditor.setValue(jsCode);
});
const handleCancel = () => {
TslConRef.value?.resetFormData();
closeModal();
};
const handleSubmit = () => {
const value = TslConRef.value?.getFormData();
if (!value) return;
console.log('搜集值', value);
};
</script>
<style lang="less" scope>
#jsoneditor {
width: 100%;
height: 450px;
}
</style>