<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>
|