diff --git a/src/api/system/messageSet/index.ts b/src/api/system/messageSet/index.ts new file mode 100644 index 000000000..d7814b7b0 --- /dev/null +++ b/src/api/system/messageSet/index.ts @@ -0,0 +1,60 @@ +import request from '@/config/axios' + +export interface MessageSetVO { + id: number + tableName: string + action: number + available: string + remark: string + deletionTime: Date + deleterId: string + extraProperties: string + concurrencyStamp: number + siteId: string +} + +// 查询消息设置列表 +export const getMessageSetPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/system/message-set/senior', data }) + } else { + return await request.get({ url: `/system/message-set/page`, params }) + } +} + +// 查询消息设置详情 +export const getMessageSet = async (id: number) => { + return await request.get({ url: `/system/message-set/get?id=` + id }) +} + +// 新增消息设置 +export const createMessageSet = async (data: MessageSetVO) => { + return await request.post({ url: `/system/message-set/create`, data }) +} + +// 修改消息设置 +export const updateMessageSet = async (data: MessageSetVO) => { + return await request.put({ url: `/system/message-set/update`, data }) +} + +// 删除消息设置 +export const deleteMessageSet = async (id: number) => { + return await request.delete({ url: `/system/message-set/delete?id=` + id }) +} + +// 导出消息设置 Excel +export const exportMessageSet = async (params) => { + return await request.download({ url: `/system/message-set/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/system/message-set/get-import-template' }) +} + +// 查询消息设置列表不分页 +export const getMessageSetNoPage = async (params) => { + return await request.get({ url: `/system/message-set/noPage`, params }) +} diff --git a/src/api/system/notify/template/index.ts b/src/api/system/notify/template/index.ts index b7ce8a2f3..6681e4bb3 100644 --- a/src/api/system/notify/template/index.ts +++ b/src/api/system/notify/template/index.ts @@ -11,6 +11,10 @@ export interface NotifyTemplateVO { params: string status: number remark: string + roleIdList: [] + deptIdList: [] + postIdList: [] + userIdList: [] } export interface NotifySendReqVO { diff --git a/src/api/system/sms/smsTemplate/index.ts b/src/api/system/sms/smsTemplate/index.ts index 35cb489dc..b103eb3c4 100644 --- a/src/api/system/sms/smsTemplate/index.ts +++ b/src/api/system/sms/smsTemplate/index.ts @@ -13,6 +13,10 @@ export interface SmsTemplateVO { channelCode?: string params?: string[] createTime?: Date + roleIdList: [] + deptIdList: [] + postIdList: [] + userIdList: [] } export interface SendSmsReqVO { diff --git a/src/api/system/tableActionRel/index.ts b/src/api/system/tableActionRel/index.ts new file mode 100644 index 000000000..481d2ebdb --- /dev/null +++ b/src/api/system/tableActionRel/index.ts @@ -0,0 +1,64 @@ +import request from '@/config/axios' + +export interface TableActionRelVO { + id: number + tableName: string + action: number + type: number + name: string + available: string + activeTime: Date + expireTime: Date + remark: string + deletionTime: Date + deleterId: string + extraProperties: string + concurrencyStamp: number + siteId: string +} + +// 查询表名动作关系列表 +export const getTableActionRelPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/system/table-action-rel/senior', data }) + } else { + return await request.get({ url: `/system/table-action-rel/page`, params }) + } +} + +// 查询表名动作关系详情 +export const getTableActionRel = async (id: number) => { + return await request.get({ url: `/system/table-action-rel/get?id=` + id }) +} + +// 新增表名动作关系 +export const createTableActionRel = async (data: TableActionRelVO) => { + return await request.post({ url: `/system/table-action-rel/create`, data }) +} + +// 修改表名动作关系 +export const updateTableActionRel = async (data: TableActionRelVO) => { + return await request.put({ url: `/system/table-action-rel/update`, data }) +} + +// 删除表名动作关系 +export const deleteTableActionRel = async (id: number) => { + return await request.delete({ url: `/system/table-action-rel/delete?id=` + id }) +} + +// 导出表名动作关系 Excel +export const exportTableActionRel = async (params) => { + return await request.download({ url: `/system/table-action-rel/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/system/table-action-rel/get-import-template' }) +} + +// 查询表名动作关系列表 +export const getTableActionRelNoPage = async (params) => { + return await request.get({ url: `/system/table-action-rel/noPage`, params }) +} \ No newline at end of file diff --git a/src/utils/dict.ts b/src/utils/dict.ts index ca6b004c2..d195b9d2b 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -322,4 +322,11 @@ export enum DICT_TYPE { SUPPLIERINVOICE_REQUEST_STATUS = 'supplierinvoice_request_status', //发票申请状态 SUPPLIERINVOICE_STATUS = 'supplierinvoice_status', //待开票审核状态 + + // ========== system - 消息通知优化 - ========== + MESSAGE_NOTICE_TABLE = 'message_notice_table',//消息通知表 + NOTICE_ACTION_TYPE = 'notice_action_type',//消息通知动作类型 + FALSE_OR_TRUE = 'false_or_true',//是或否 + RECEIVER_TYPE = 'receiver_type',//接收人类型 + } diff --git a/src/utils/tree.ts b/src/utils/tree.ts index c8503f544..6f3f9bb3e 100644 --- a/src/utils/tree.ts +++ b/src/utils/tree.ts @@ -397,3 +397,45 @@ export const treeToString = (tree: any[], nodeId) => { } return str } + + + +export type FormValueType = string | number | string[] | number[] | boolean | undefined | null + +interface Recordable { + [key: string]: T; +} + +export type ComponentOptions = { + label?: string; + value?: FormValueType; + disabled?: boolean; + key?: string | number; + children?: ComponentOptions[]; + options?: ComponentOptions[]; +} & Recordable; + + +export const handleTreeToComponentOptions = (data: any[], id?: string, parentId?: string, children?: string)=> { + const deptTree = handleTree(data, id, parentId, children) + return convertFieldToOptions(deptTree) +} + +function convertFieldToOptions(deptTree: any[]): ComponentOptions[] { + return deptTree.map((item) => { + // 构建当前节点的基本结构 + const option: ComponentOptions = { + label: item.name, + value: item.id, + key: item.id, + disabled: false, // 这里假设所有项默认都是启用的 + }; + // 如果存在子部门,递归调用转换函数 + if (item.children && item.children.length > 0) { + const childrenOptions = convertFieldToOptions(item.children); + option.children = childrenOptions; + option.options = childrenOptions; // 确保 options 也被赋值 + } + return option; + }); +} diff --git a/src/views/system/mail/template/MailTemplateForm.vue b/src/views/system/mail/template/MailTemplateForm.vue index 0d9fa8999..d771921a5 100644 --- a/src/views/system/mail/template/MailTemplateForm.vue +++ b/src/views/system/mail/template/MailTemplateForm.vue @@ -6,7 +6,7 @@ :title="dialogTitle" :width="800" > -
+ diff --git a/src/views/system/mail/template/template.data.ts b/src/views/system/mail/template/template.data.ts index e68f875a1..87a6836dc 100644 --- a/src/views/system/mail/template/template.data.ts +++ b/src/views/system/mail/template/template.data.ts @@ -2,9 +2,30 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' import { TableColumn } from '@/types/table' import * as MailAccountApi from '@/api/system/mail/account' +import { getIntDictOptions } from '@/utils/dict' +import { handleTreeToComponentOptions } from '@/utils/tree' +import * as RoleApi from '@/api/system/role' +import * as PostApi from '@/api/system/post' +import * as DeptApi from '@/api/system/dept' +import * as UserApi from '@/api/system/user' // 邮箱账号的列表 const accountList = await MailAccountApi.getSimpleMailAccountList() +const receiverTypeOptions = getIntDictOptions(DICT_TYPE.RECEIVER_TYPE) +const roleList = ref([]) // 角色的列表 +const deptList = ref([]) // 树形结构 +const postList = ref([]) // 岗位列表 +const userList = ref([]) // 用户列表 + +// 获得角色列表 +roleList.value = await RoleApi.getSimpleRoleList() +// 加载部门树(默认格式) +deptList.value = handleTreeToComponentOptions(await DeptApi.getSimpleDeptList()) +// 加载岗位列表 +postList.value = await PostApi.getSimplePostList() +// 加载用户列表 +userList.value = await UserApi.getSimpleUserList() + // 表单校验 export const rules = reactive({ @@ -44,6 +65,105 @@ const crudSchemas = reactive([ } } }, + { + label: '接收人类型', + field: 'receiverType', + isTable: false, + isDetail: false, + isSearch: false, + isTableForm: false, + form: { + component: 'Select', + componentProps: { + options: receiverTypeOptions, // 假设这是获取选项的函数 + placeholder: "请选择角色" + } + } + }, + { + label: '角色', + field: 'roleIdList', + isTable: false, + isDetail: false, + isSearch: false, + isTableForm: false, + form: { + component: 'Select', + componentProps: { + options: roleList.value, + optionsAlias: { + labelField: 'name', + valueField: 'id' + }, + disabled: true, + filterable: true, + multiple: true, + placeholder: "请选择角色" + } + } + }, + { + label: '部门', + field: 'deptIdList', + isTable: false, + isDetail: false, + isSearch: false, + isTableForm: false, + form: { + component: 'TreeSelect', + componentProps: { // 假设deptList是部门数据列表 + data: deptList, + disabled: true, + placeholder: "请选择部门", + filterable: true, + multiple: true, + } + } + }, + { + label: '岗位', + field: 'postIdList', + isTable: false, + isDetail: false, + isSearch: false, + isTableForm: false, + form: { + component: 'Select', + componentProps: { + options: postList.value, + optionsAlias: { + labelField: 'name', + valueField: 'id' + }, + disabled: true, + filterable: true, + multiple: true, + placeholder: "请选择" + } + } + }, + { + label: '用户', + field: 'userIdList', + isTable: false, + isDetail: false, + isSearch: false, + isTableForm: false, + form: { + component: 'Select', + componentProps: { + options: userList.value, + optionsAlias: { + labelField: 'nickname', + valueField: 'id' + }, + disabled: true, + filterable: true, + multiple: true, + placeholder: "请选择" + } + } + }, { label: '邮箱账号', field: 'accountId', diff --git a/src/views/system/messageSet/index.vue b/src/views/system/messageSet/index.vue new file mode 100644 index 000000000..2c308097b --- /dev/null +++ b/src/views/system/messageSet/index.vue @@ -0,0 +1,276 @@ + + + diff --git a/src/views/system/messageSet/messageSet.data.ts b/src/views/system/messageSet/messageSet.data.ts new file mode 100644 index 000000000..bf51ddc2b --- /dev/null +++ b/src/views/system/messageSet/messageSet.data.ts @@ -0,0 +1,156 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' +import * as TableActionRelApi from '@/api/system/tableActionRel' +import { getStrDictOptions } from '@/utils/dict' + + +// 假设这是TableActionRelApi.getTableActionRelNoPage({})的返回类型 +interface Table { + tableName: string; + tableLabel: string; + // 可以添加其他字段 +} + +// 假设的异步调用,这里假定返回类型为Table[] +const tableList: Table[] = await TableActionRelApi.getTableActionRelNoPage({}); +const noticeTableList = getStrDictOptions(DICT_TYPE.MESSAGE_NOTICE_TABLE); +const noticeActionList = getStrDictOptions(DICT_TYPE.NOTICE_ACTION_TYPE); +// 使用Set记录已经出现过的tableName +const seen = new Set(); + +// 使用filter方法去重 +const uniqueTableList: Table[] = tableList.filter(table => { + if (seen.has(table.tableName)) { + // 如果seen中已经有了tableName,表示这个tableName已经处理过,应该被过滤掉 + return false; + } else { + // 如果seen中没有tableName,将其添加到seen中,并保留在结果数组中 + seen.add(table.tableName); + return true; + } +}); + +// 此时,uniqueTableList应该是去重后的结果 +uniqueTableList.forEach(table => { + // 在noticeActionList中查找与当前table.tableName匹配的value + const matchingAction = noticeTableList.find(action => action.value === table.tableName); + // 如果找到了匹配项,就将其label值赋给table的tableLabel字段 + if (matchingAction) { + table.tableLabel = matchingAction.label; + } else { + // 如果没有找到匹配项,可以根据需要决定是否给tableLabel赋一个默认值 + table.tableLabel = ''; // 或者可以选择不赋值 + } +}); + + +const actionList = ref(tableList) + +// 表单校验 +export const MessageSetRules = reactive({ + tableName: [required], + act: [required], + available: [required], +}) + +export const MessageSet = useCrudSchemas(reactive([ + // { + // label: 'id', + // field: 'id', + // sort: 'custom', + // isForm: false, + // isSearch: false, + // isDetail: false, + // isTable: false, + // isTableForm: false, + // fixed: 'left' + // }, + { + label: '表名', + field: 'tableName', + sort: 'custom', + isSearch: true, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return uniqueTableList.find(item=>cellValue==item.tableName).tableLabel + }, + form: { + component: 'Select', + componentProps: { + options: uniqueTableList, + optionsAlias:{ + labelField: 'tableLabel', + valueField: 'tableName' + } + } + }, + search: { + component: 'Select', + componentProps: { + options: uniqueTableList, + optionsAlias:{ + labelField: 'tableLabel', + valueField: 'tableName' + }, + onChange: (val) => {{ + actionList.value = tableList.filter(item=>item.tableName==val) + }} + }, + + } + }, + { + label: '动作', + field: 'act', + sort: 'custom', + isSearch: true, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return noticeActionList.find(item=>cellValue==item.value).label + }, + form: { + component: 'Select', + componentProps: { + options: noticeActionList, + optionsAlias: { + valueField: 'value', + labelField: 'label' + } + } + }, + search: { + component: 'Select', + componentProps: { + options: actionList.value, + optionsAlias: { + valueField: 'act', + labelField: 'name' + } + } + } + }, + { + label: '是否可用', + field: 'available', + sort: 'custom', + isSearch: true, + dictType: DICT_TYPE.FALSE_OR_TRUE, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + form: { + component: 'SelectV2', + } + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + isSearch: true + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +])) diff --git a/src/views/system/notify/template/NotifyTemplateForm.vue b/src/views/system/notify/template/NotifyTemplateForm.vue index 30399a481..76f5c47f7 100644 --- a/src/views/system/notify/template/NotifyTemplateForm.vue +++ b/src/views/system/notify/template/NotifyTemplateForm.vue @@ -21,6 +21,52 @@ /> + + + + + + + + /> + + + + + + + + + + + + + + @@ -59,7 +105,11 @@ import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' import * as NotifyTemplateApi from '@/api/system/notify/template' import { CommonStatusEnum } from '@/utils/constants' +import { defaultProps, handleTree } from '@/utils/tree' import * as RoleApi from '@/api/system/role' +import * as PostApi from '@/api/system/post' +import * as DeptApi from '@/api/system/dept' +import * as UserApi from '@/api/system/user' const message = useMessage() // 消息弹窗 const dialogVisible = ref(false) // 弹窗的是否展示 @@ -67,6 +117,13 @@ const dialogTitle = ref('') // 弹窗的标题 const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 const formType = ref('') // 表单的类型 const roleList = ref([]) // 角色的列表 +const deptList = ref([]) // 树形结构 +const postList = ref([]) // 岗位列表 +const userList = ref([]) // 用户列表 +const userShow = ref(false) +const roleShow = ref(false) +const deptShow = ref(false) +const postShow = ref(false) const formData = ref({ id: null, @@ -78,7 +135,11 @@ const formData = ref({ roleIds: [], params: '', status: CommonStatusEnum.ENABLE, - remark: '' + remark: '', + roleIdList: [], + deptIdList: [], + postIdList: [], + userIdList: [] }) const formRules = reactive({ type: [{ required: true, message: '消息类型不能为空', trigger: 'change' }], @@ -97,6 +158,10 @@ const open = async (type: string, id?: number) => { dialogTitle.value = type formType.value = type resetForm() + // 获取选定信息 + getReceiverData() + // 重置选定人信息 + resetReceiverType() // 修改时,设置数据 if (id) { formLoading.value = true @@ -105,9 +170,8 @@ const open = async (type: string, id?: number) => { } finally { formLoading.value = false } + showReceiver(formData.value) } - // 获得角色列表 - roleList.value = await RoleApi.getSimpleRoleList() } defineExpose({ open }) // 提供 open 方法,用于打开弹窗 @@ -125,6 +189,7 @@ const submitForm = async () => { await NotifyTemplateApi.createNotifyTemplate(data) message.success('新增成功') } else { + debugger await NotifyTemplateApi.updateNotifyTemplate(data) message.success('修改成功') } @@ -146,8 +211,67 @@ const resetForm = () => { type: null, params: '', status: CommonStatusEnum.ENABLE, - remark: '' + remark: '', + postIdList: [], + userIdList: [], + deptIdList: [], + roleIdList: [], } formRef.value?.resetFields() } + +const onChangeReceiverType = (val) => { + // 重置 + resetReceiverType() + + // 根据val的值更新相应的显示状态 + if (val === 1) { + roleShow.value = true; + } else if (val === 2) { + deptShow.value = true; + } else if (val === 3) { + postShow.value = true; + } else if (val === 4) { + userShow.value = true; + } + // 不需要特别处理val === '5'的情况,因为所有显示状态已经被重置为false +} + +const getReceiverData = async() =>{ + // 获得角色列表 + roleList.value = await RoleApi.getSimpleRoleList() + // 加载部门树 + deptList.value = handleTree(await DeptApi.getSimpleDeptList()) + // 加载岗位列表 + postList.value = await PostApi.getSimplePostList() + // 加载用户列表 + userList.value = await UserApi.getSimpleUserList() +} + +const resetReceiverType = () => { + formData.value.postIdList = []; + formData.value.userIdList = []; + formData.value.deptIdList = []; + formData.value.roleIdList = []; + roleShow.value = false; + deptShow.value = false; + postShow.value = false; + userShow.value = false; +} + +const showReceiver = (formValue) => { + if(formValue){ + if(formValue.receiverType == 1){ + roleShow.value = true; + }else if(formValue.receiverType == 2){ + deptShow.value = true; + }else if(formValue.receiverType == 3){ + postShow.value = true; + }else if(formValue.receiverType == 4){ + userShow.value = true; + } + } +} + + diff --git a/src/views/system/sms/template/SmsTemplateForm.vue b/src/views/system/sms/template/SmsTemplateForm.vue index 83906cd42..48622d0fa 100644 --- a/src/views/system/sms/template/SmsTemplateForm.vue +++ b/src/views/system/sms/template/SmsTemplateForm.vue @@ -35,6 +35,51 @@ + + + + + + + + /> + + + + + + + + + + + + + @@ -68,6 +113,12 @@ import { DICT_TYPE, getDictLabel, getIntDictOptions } from '@/utils/dict' import * as SmsTemplateApi from '@/api/system/sms/smsTemplate' import * as SmsChannelApi from '@/api/system/sms/smsChannel' import { CommonStatusEnum } from '@/utils/constants' +import { defaultProps, handleTree } from '@/utils/tree' +import * as RoleApi from '@/api/system/role' +import * as PostApi from '@/api/system/post' +import * as DeptApi from '@/api/system/dept' +import * as UserApi from '@/api/system/user' +import { async } from '@antv/x6/lib/registry/marker/async' defineOptions({ name: 'SystemSmsTemplateForm' }) @@ -78,6 +129,14 @@ const dialogVisible = ref(false) // 弹窗的是否展示 const dialogTitle = ref('') // 弹窗的标题 const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 const formType = ref('') // 表单的类型 +const roleList = ref([]) // 角色的列表 +const deptList = ref([]) // 树形结构 +const postList = ref([]) // 岗位列表 +const userList = ref([]) // 用户列表 +const userShow = ref(false) +const roleShow = ref(false) +const deptShow = ref(false) +const postShow = ref(false) const formData = ref({ id: null, type: null, @@ -87,7 +146,11 @@ const formData = ref({ content: '', remark: '', apiTemplateId: '', - channelId: null + channelId: null, + roleIdList: [], + deptIdList: [], + postIdList: [], + userIdList: [] }) const formRules = reactive({ type: [{ required: true, message: '短信类型不能为空', trigger: 'change' }], @@ -106,6 +169,10 @@ const open = async (type: string, id?: number) => { dialogTitle.value = t('action.' + type) formType.value = type resetForm() + // 获取选定信息 + getReceiverData() + // 重置选定人信息 + resetReceiverType() // 修改时,设置数据 if (id) { formLoading.value = true @@ -114,6 +181,7 @@ const open = async (type: string, id?: number) => { } finally { formLoading.value = false } + showReceiver(formData.value) } // 加载渠道列表 channelList.value = await SmsChannelApi.getSimpleSmsChannelList() @@ -156,8 +224,66 @@ const resetForm = () => { content: '', remark: '', apiTemplateId: '', - channelId: null + channelId: null, + roleIdList: [], + deptIdList: [], + postIdList: [], + userIdList: [] } formRef.value?.resetFields() } + +const onChangeReceiverType = (val) => { + // 重置 + resetReceiverType() + + // 根据val的值更新相应的显示状态 + if (val === 1) { + roleShow.value = true; + } else if (val === 2) { + deptShow.value = true; + } else if (val === 3) { + postShow.value = true; + } else if (val === 4) { + userShow.value = true; + } + // 不需要特别处理val === '5'的情况,因为所有显示状态已经被重置为false +} + +const getReceiverData = async() =>{ + // 获得角色列表 + roleList.value = await RoleApi.getSimpleRoleList() + // 加载部门树 + deptList.value = handleTree(await DeptApi.getSimpleDeptList()) + // 加载岗位列表 + postList.value = await PostApi.getSimplePostList() + // 加载用户列表 + userList.value = await UserApi.getSimpleUserList() +} + +const resetReceiverType = () => { + formData.value.postIdList = []; + formData.value.userIdList = []; + formData.value.deptIdList = []; + formData.value.roleIdList = []; + roleShow.value = false; + deptShow.value = false; + postShow.value = false; + userShow.value = false; +} + +const showReceiver = (formValue) => { + if(formValue){ + if(formValue.receiverType == 1){ + roleShow.value = true; + }else if(formValue.receiverType == 2){ + deptShow.value = true; + }else if(formValue.receiverType == 3){ + postShow.value = true; + }else if(formValue.receiverType == 4){ + userShow.value = true; + } + } +} + diff --git a/src/views/system/tableActionRel/index.vue b/src/views/system/tableActionRel/index.vue new file mode 100644 index 000000000..10f7d8370 --- /dev/null +++ b/src/views/system/tableActionRel/index.vue @@ -0,0 +1,275 @@ + + + diff --git a/src/views/system/tableActionRel/tableActionRel.data.ts b/src/views/system/tableActionRel/tableActionRel.data.ts new file mode 100644 index 000000000..155dfa039 --- /dev/null +++ b/src/views/system/tableActionRel/tableActionRel.data.ts @@ -0,0 +1,144 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' + +// 表单校验 +export const TableActionRelRules = reactive({ + tableName: [required], + available: [required], + concurrencyStamp: [required] +}) + +export const TableActionRel = useCrudSchemas(reactive([ + // { + // label: 'id', + // field: 'id', + // sort: 'custom', + // isForm: false, + // isSearch: false, + // isDetail: false, + // isTable: false, + // isTableForm: false, + // fixed: 'left' + // }, + { + label: '表名', + field: 'tableName', + sort: 'custom', + dictType: DICT_TYPE.MESSAGE_NOTICE_TABLE, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + isSearch: true, + form: { + component: 'SelectV2', + componentProps: { + filterable: true, + } + }, + search: { + component: 'SelectV2', + componentProps: { + filterable: true, + } + } + }, + { + label: '动作', + field: 'act', + sort: 'custom', + isSearch: true, + isDetail: false, + dictType: DICT_TYPE.NOTICE_ACTION_TYPE, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + form: { + component: 'SelectV2', + componentProps: { + filterable: true, + } + }, + search: { + component: 'SelectV2', + componentProps: { + filterable: true, + } + } + }, + { + label: '动作', + field: 'name', + sort: 'custom', + isForm: false, + isSearch: false, + isDetail: true, + isTable: false, + isTableForm: false, + }, + { + label: '是否可用', + field: 'available', + sort: 'custom', + isSearch: true, + dictType: DICT_TYPE.FALSE_OR_TRUE, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + form: { + component: 'SelectV2', + } + }, + { + label: '生效时间', + field: 'activeTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: true, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + } + }, + { + label: '失效时间', + field: 'expireTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: true, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + } + }, + { + label: '备注', + field: 'remark', + sort: 'custom', + isSearch: true + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +]))