diff --git a/src/api/system/notify/template/index.ts b/src/api/system/notify/template/index.ts
index cd0e12238..b7ce8a2f3 100644
--- a/src/api/system/notify/template/index.ts
+++ b/src/api/system/notify/template/index.ts
@@ -5,6 +5,7 @@ export interface NotifyTemplateVO {
name: string
nickname: string
code: string
+ roleIds: []
content: string
type: number
params: string
diff --git a/src/views/system/notify/template/NotifyTemplateForm.vue b/src/views/system/notify/template/NotifyTemplateForm.vue
index 919c6549f..30399a481 100644
--- a/src/views/system/notify/template/NotifyTemplateForm.vue
+++ b/src/views/system/notify/template/NotifyTemplateForm.vue
@@ -16,6 +16,11 @@
+
+
+
+ />
+
@@ -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({
id: null,
name: '',
@@ -67,6 +75,7 @@ const formData = ref({
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 方法,用于打开弹窗