zhuoyuan.wang
2024-06-19 15ebe96f28cadec6a726c5324593a40bbf56205f
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<template>
  <app-collapse-form title="消息模版">
    <app-tinymce-formula v-bind="tinymceFormulaProps"/>
    <property-dialog v-bind="propertyDialogProps"/>
  </app-collapse-form>
</template>
 
<script setup>
import PropertyDialog from './PropertyDialog';
 
const propertyDialogRef = ref();
const tableListRef = ref();
 
import {meta} from "@/hooks";
 
const {useMetaData} = meta;
 
const tinymceFormulaRef = ref();
 
const props = defineProps({
  subBaseInfo: {
    type: Function,
    default: () => {
    }
  }
});
 
const form = reactive({
  expressionContent: ''
});
 
const tinymceFormulaProps = {
  ref: tinymceFormulaRef,
  async subProperties() {
    const data = await props.subBaseInfo();
    propertyDialogRef.value.onOpen(data);
  }
};
 
const propertyDialogProps = {
  ref: propertyDialogRef,
  subSubmit(row) {
    tinymceFormulaRef.value.setField(row);
  }
};
 
 
const onSetData = async ({template_content}) => {
  await nextTick();
  tinymceFormulaRef.value.setContext(template_content || '');
}
 
const onGetData = () => {
  return tinymceFormulaRef.value.getContext();
}
 
defineExpose({
  /**
   * 初始化
   */
  onSetData,
  onGetData
});
 
</script>