Browse Source

站内信 角色展示

master_hella_20240701
chenfang 8 months ago
parent
commit
37fb23d643
  1. 1
      src/api/system/notify/template/index.ts
  2. 12
      src/views/system/notify/template/NotifyTemplateForm.vue

1
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

12
src/views/system/notify/template/NotifyTemplateForm.vue

@ -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) // 12
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

Loading…
Cancel
Save