|
|
@ -16,6 +16,11 @@ |
|
|
|
<el-form-item label="发件人名称" prop="nickname"> |
|
|
|
<el-input v-model="formData.nickname" placeholder="请输入发件人名称" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="角色" prop="roleIds"> |
|
|
|
<el-select v-model="formData.roleIds" multiple placeholder="请选择角色"> |
|
|
|
<el-option v-for="item in roleList" :key="item.id" :label="item.name" :value="item.id" /> |
|
|
|
/></el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="模板内容" prop="content"> |
|
|
|
<el-input type="textarea" v-model="formData.content" placeholder="请输入模板内容" /> |
|
|
|
</el-form-item> |
|
|
@ -54,12 +59,15 @@ |
|
|
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' |
|
|
|
import * as NotifyTemplateApi from '@/api/system/notify/template' |
|
|
|
import { CommonStatusEnum } from '@/utils/constants' |
|
|
|
import * as RoleApi from '@/api/system/role' |
|
|
|
const message = useMessage() // 消息弹窗 |
|
|
|
|
|
|
|
const dialogVisible = ref(false) // 弹窗的是否展示 |
|
|
|
const dialogTitle = ref('') // 弹窗的标题 |
|
|
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 |
|
|
|
const formType = ref('') // 表单的类型 |
|
|
|
const roleList = ref([]) // 角色的列表 |
|
|
|
|
|
|
|
const formData = ref<NotifyTemplateApi.NotifyTemplateVO>({ |
|
|
|
id: null, |
|
|
|
name: '', |
|
|
@ -67,6 +75,7 @@ const formData = ref<NotifyTemplateApi.NotifyTemplateVO>({ |
|
|
|
code: '', |
|
|
|
content: '', |
|
|
|
type: null, |
|
|
|
roleIds: [], |
|
|
|
params: '', |
|
|
|
status: CommonStatusEnum.ENABLE, |
|
|
|
remark: '' |
|
|
@ -76,6 +85,7 @@ const formRules = reactive({ |
|
|
|
status: [{ required: true, message: '开启状态不能为空', trigger: 'blur' }], |
|
|
|
code: [{ required: true, message: '模板编码不能为空', trigger: 'blur' }], |
|
|
|
name: [{ required: true, message: '模板名称不能为空', trigger: 'blur' }], |
|
|
|
roleIds: [{ required: true, message: '角色不能为空', trigger: 'blur' }], |
|
|
|
nickname: [{ required: true, message: '发件人姓名不能为空', trigger: 'blur' }], |
|
|
|
content: [{ required: true, message: '模板内容不能为空', trigger: 'blur' }] |
|
|
|
}) |
|
|
@ -96,6 +106,8 @@ const open = async (type: string, id?: number) => { |
|
|
|
formLoading.value = false |
|
|
|
} |
|
|
|
} |
|
|
|
// 获得角色列表 |
|
|
|
roleList.value = await RoleApi.getSimpleRoleList() |
|
|
|
} |
|
|
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
|
|
|
|
|
|
|