perf: sms test
parent
54e93835d6
commit
5c92ec8303
|
@ -170,9 +170,8 @@ export const formSchema: FormSchema[] = [
|
||||||
]
|
]
|
||||||
|
|
||||||
// 发送邮件
|
// 发送邮件
|
||||||
|
|
||||||
// 这里加上前缀 防止和表单其他字段重名
|
// 这里加上前缀 防止和表单其他字段重名
|
||||||
export const keyPrefix = 'key$-'
|
const keyPrefix = 'key$-'
|
||||||
export const baseSendSchemas: FormSchema[] = [
|
export const baseSendSchemas: FormSchema[] = [
|
||||||
{
|
{
|
||||||
field: 'code',
|
field: 'code',
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import { h } from 'vue'
|
||||||
|
import { ScrollContainer } from '@/components/Container'
|
||||||
import type { BasicColumn, FormSchema } from '@/components/Table'
|
import type { BasicColumn, FormSchema } from '@/components/Table'
|
||||||
import { useRender } from '@/components/Table'
|
import { useRender } from '@/components/Table'
|
||||||
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
|
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
|
||||||
|
@ -171,6 +173,8 @@ export const formSchema: FormSchema[] = [
|
||||||
]
|
]
|
||||||
|
|
||||||
// 发送短信
|
// 发送短信
|
||||||
|
// 这里加上前缀 防止和表单其他字段重名
|
||||||
|
const keyPrefix = 'key$-'
|
||||||
export const baseSendSchemas: FormSchema[] = [
|
export const baseSendSchemas: FormSchema[] = [
|
||||||
{
|
{
|
||||||
field: 'content',
|
field: 'content',
|
||||||
|
@ -178,10 +182,19 @@ export const baseSendSchemas: FormSchema[] = [
|
||||||
label: '模板内容 ',
|
label: '模板内容 ',
|
||||||
required: false,
|
required: false,
|
||||||
defaultValue: '',
|
defaultValue: '',
|
||||||
componentProps: {
|
render({ model }) {
|
||||||
options: {
|
let content: string = model.content
|
||||||
readonly: true,
|
Object.keys(model).forEach((key) => {
|
||||||
},
|
if (!key.startsWith(keyPrefix))
|
||||||
|
return
|
||||||
|
|
||||||
|
const realKey = key.split(keyPrefix)[1]
|
||||||
|
content = content.replace(`{${realKey}}`, model[key])
|
||||||
|
})
|
||||||
|
return h(ScrollContainer, {
|
||||||
|
innerHTML: content,
|
||||||
|
style: { border: '1px solid #e8e8e8', borderRadius: '4px', padding: '10px' },
|
||||||
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue