diff --git a/.gitignore b/.gitignore index ba12c396..2500fdef 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ dist-ssr *.local /dist* *-lock.* -pnpm-debug \ No newline at end of file +pnpm-debug +.idea diff --git a/src/api/system/sensitiveWord/index.ts b/src/api/system/sensitiveWord/index.ts index ffda89c0..7da2c28e 100644 --- a/src/api/system/sensitiveWord/index.ts +++ b/src/api/system/sensitiveWord/index.ts @@ -24,41 +24,41 @@ export interface SensitiveWordExportReqVO { } // 查询敏感词列表 -export const getSensitiveWordPageApi = (params: SensitiveWordPageReqVO) => { +export const getSensitiveWordPage = (params: SensitiveWordPageReqVO) => { return request.get({ url: '/system/sensitive-word/page', params }) } // 查询敏感词详情 -export const getSensitiveWordApi = (id: number) => { +export const getSensitiveWord = (id: number) => { return request.get({ url: '/system/sensitive-word/get?id=' + id }) } // 新增敏感词 -export const createSensitiveWordApi = (data: SensitiveWordVO) => { +export const createSensitiveWord = (data: SensitiveWordVO) => { return request.post({ url: '/system/sensitive-word/create', data }) } // 修改敏感词 -export const updateSensitiveWordApi = (data: SensitiveWordVO) => { +export const updateSensitiveWord = (data: SensitiveWordVO) => { return request.put({ url: '/system/sensitive-word/update', data }) } // 删除敏感词 -export const deleteSensitiveWordApi = (id: number) => { +export const deleteSensitiveWord = (id: number) => { return request.delete({ url: '/system/sensitive-word/delete?id=' + id }) } // 导出敏感词 -export const exportSensitiveWordApi = (params: SensitiveWordExportReqVO) => { +export const exportSensitiveWord = (params: SensitiveWordExportReqVO) => { return request.download({ url: '/system/sensitive-word/export-excel', params }) } // 获取所有敏感词的标签数组 -export const getSensitiveWordTagsApi = () => { +export const getSensitiveWordTags = () => { return request.get({ url: '/system/sensitive-word/get-tags' }) } // 获得文本所包含的不合法的敏感词数组 -export const validateTextApi = (id: number) => { +export const validateText = (id: number) => { return request.get({ url: '/system/sensitive-word/validate-text?' + id }) } diff --git a/src/api/system/sms/smsChannel/index.ts b/src/api/system/sms/smsChannel/index.ts index 176d075f..7c8ccea9 100644 --- a/src/api/system/sms/smsChannel/index.ts +++ b/src/api/system/sms/smsChannel/index.ts @@ -12,6 +12,12 @@ export interface SmsChannelVO { createTime: Date } +export interface SmsChannelListVO { + id: number + code: string + signature: string +} + export interface SmsChannelPageReqVO extends PageParam { signature?: string code?: string diff --git a/src/api/system/sms/smsLog/index.ts b/src/api/system/sms/smsLog/index.ts index 863eabb6..269b609d 100644 --- a/src/api/system/sms/smsLog/index.ts +++ b/src/api/system/sms/smsLog/index.ts @@ -1,39 +1,40 @@ import request from '@/config/axios' export interface SmsLogVO { - id: number - channelId: number + id: number | null + channelId: number | null channelCode: string - templateId: number + templateId: number | null templateCode: string - templateType: number + templateType: number | null templateContent: string - templateParams: Map + templateParams: Map | null + apiTemplateId: string mobile: string - userId: number - userType: number - sendStatus: number - sendTime: Date - sendCode: number + userId: number | null + userType: number | null + sendStatus: number | null + sendTime: Date | null + sendCode: number | null sendMsg: string apiSendCode: string apiSendMsg: string apiRequestId: string apiSerialNo: string - receiveStatus: number - receiveTime: Date + receiveStatus: number | null + receiveTime: Date | null apiReceiveCode: string apiReceiveMsg: string - createTime: Date + createTime: Date | null } export interface SmsLogPageReqVO extends PageParam { - channelId?: number - templateId?: number + channelId?: number | null + templateId?: number | null mobile?: string - sendStatus?: number + sendStatus?: number | null sendTime?: Date[] - receiveStatus?: number + receiveStatus?: number | null receiveTime?: Date[] } export interface SmsLogExportReqVO { diff --git a/src/api/system/sms/smsTemplate/index.ts b/src/api/system/sms/smsTemplate/index.ts index 0433fe3a..55a61762 100644 --- a/src/api/system/sms/smsTemplate/index.ts +++ b/src/api/system/sms/smsTemplate/index.ts @@ -1,18 +1,18 @@ import request from '@/config/axios' export interface SmsTemplateVO { - id: number - type: number - status: number + id: number | null + type: number | null + status: number | null code: string name: string content: string remark: string apiTemplateId: string - channelId: number - channelCode: string - params: string[] - createTime: Date + channelId: number | null + channelCode?: string + params?: string[] + createTime?: Date } export interface SendSmsReqVO { @@ -21,13 +21,13 @@ export interface SendSmsReqVO { templateParams: Map } -export interface SmsTemplatePageReqVO { - type?: number - status?: number +export interface SmsTemplatePageReqVO extends PageParam { + type?: number | null + status?: number | null code?: string content?: string apiTemplateId?: string - channelId?: number + channelId?: number | null createTime?: Date[] } diff --git a/src/components/RightToolbar/index.ts b/src/components/RightToolbar/index.ts new file mode 100644 index 00000000..eb9d1112 --- /dev/null +++ b/src/components/RightToolbar/index.ts @@ -0,0 +1,9 @@ +import RightToolbar from './src/index.vue' + +export interface columnsType { + key?: number + label?: string + visible?: boolean +} + +export { RightToolbar } diff --git a/src/components/RightToolbar/src/index.vue b/src/components/RightToolbar/src/index.vue new file mode 100644 index 00000000..11e021dc --- /dev/null +++ b/src/components/RightToolbar/src/index.vue @@ -0,0 +1,104 @@ + + + diff --git a/src/components/index.ts b/src/components/index.ts index 19b2aac6..97c2b4b0 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -9,6 +9,7 @@ import { XButton, XTextButton } from '@/components/XButton' import { DictTag } from '@/components/DictTag' import { ContentWrap } from '@/components/ContentWrap' import { Descriptions } from '@/components/Descriptions' +import { RightToolbar } from '@/components/RightToolbar' export const setupGlobCom = (app: App): void => { app.component('Icon', Icon) @@ -22,4 +23,5 @@ export const setupGlobCom = (app: App): void => { app.component('DictTag', DictTag) app.component('ContentWrap', ContentWrap) app.component('Descriptions', Descriptions) + app.component('RightToolbar', RightToolbar) } diff --git a/src/layout/components/Message/src/Message.vue b/src/layout/components/Message/src/Message.vue index 94347812..4ac85860 100644 --- a/src/layout/components/Message/src/Message.vue +++ b/src/layout/components/Message/src/Message.vue @@ -1,5 +1,5 @@ diff --git a/src/views/system/sms/smsLog/sms.log.data.ts b/src/views/system/sms/smsLog/sms.log.data.ts deleted file mode 100644 index c975bb0f..00000000 --- a/src/views/system/sms/smsLog/sms.log.data.ts +++ /dev/null @@ -1,93 +0,0 @@ -import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' -import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' - -const { t } = useI18n() // 国际化 - -const authorizedGrantOptions = getStrDictOptions(DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE) -// CrudSchema -const crudSchemas = reactive({ - primaryKey: 'id', - primaryType: 'id', - primaryTitle: '日志编号', - action: true, - columns: [ - { - title: '手机号', - field: 'mobile', - isSearch: true - }, - { - title: '短信内容', - field: 'templateContent' - }, - { - title: '模板编号', - field: 'templateId', - isSearch: true - }, - { - title: '短信渠道', - field: 'channelId', - // dictType: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE, - // dictClass: 'number', - isSearch: true, - // table: { - // component: 'Select', - componentProps: { - options: authorizedGrantOptions - // multiple: false, - // filterable: true - } - // } - }, - { - title: '发送状态', - field: 'sendStatus', - dictType: DICT_TYPE.SYSTEM_SMS_SEND_STATUS, - dictClass: 'number', - isSearch: true - }, - { - title: '发送时间', - field: 'sendTime', - formatter: 'formatDate', - search: { - show: true, - itemRender: { - name: 'XDataTimePicker' - } - } - }, - { - title: '短信类型', - field: 'templateType', - dictType: DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE, - dictClass: 'number', - isSearch: true - }, - { - title: '接收状态', - field: 'receiveStatus', - dictType: DICT_TYPE.SYSTEM_SMS_RECEIVE_STATUS, - dictClass: 'number', - isSearch: true - }, - { - title: '接收时间', - field: 'receiveTime', - formatter: 'formatDate', - search: { - show: true, - itemRender: { - name: 'XDataTimePicker' - } - } - }, - { - title: t('common.createTime'), - field: 'createTime', - formatter: 'formatDate' - } - ] -}) -export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/src/views/system/sms/smsTemplate/form.vue b/src/views/system/sms/smsTemplate/form.vue new file mode 100644 index 00000000..4c9825f9 --- /dev/null +++ b/src/views/system/sms/smsTemplate/form.vue @@ -0,0 +1,267 @@ + + diff --git a/src/views/system/sms/smsTemplate/index.vue b/src/views/system/sms/smsTemplate/index.vue index bbc7c863..ed934c0f 100644 --- a/src/views/system/sms/smsTemplate/index.vue +++ b/src/views/system/sms/smsTemplate/index.vue @@ -1,232 +1,340 @@ diff --git a/src/views/system/sms/smsTemplate/sms.template.data.ts b/src/views/system/sms/smsTemplate/sms.template.data.ts deleted file mode 100644 index 6178d6c2..00000000 --- a/src/views/system/sms/smsTemplate/sms.template.data.ts +++ /dev/null @@ -1,107 +0,0 @@ -import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' -import * as smsApi from '@/api/system/sms/smsChannel' -const { t } = useI18n() // 国际化 -const tenantPackageOption = [] -const getTenantPackageOptions = async () => { - const res = await smsApi.getSimpleSmsChannels() - console.log(res, 'resresres') - res.forEach((tenantPackage: TenantPackageVO) => { - tenantPackageOption.push({ - key: tenantPackage.id, - value: tenantPackage.id, - label: tenantPackage.signature - }) - }) -} -getTenantPackageOptions() -// 表单校验 -export const rules = reactive({ - type: [required], - status: [required], - code: [required], - name: [required], - content: [required], - apiTemplateId: [required], - channelId: [required] -}) - -// CrudSchema -const crudSchemas = reactive({ - primaryKey: 'id', - primaryType: 'id', - primaryTitle: '模板编号', - action: true, - actionWidth: '280', - columns: [ - { - title: '短信渠道编码', - field: 'channelId', - isSearch: false, - isForm: true, - isTable: false, - form: { - component: 'Select', - componentProps: { - options: tenantPackageOption - } - } - }, - { - title: '模板编码', - field: 'code', - isSearch: true - }, - { - title: '模板名称', - field: 'name', - isSearch: true - }, - { - title: '模板内容', - field: 'content' - }, - { - title: '短信 API 的模板编号', - field: 'apiTemplateId', - isSearch: true - }, - { - title: '短信类型', - field: 'type', - dictType: DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE, - dictClass: 'number', - isSearch: true, - table: { - width: 80 - } - }, - { - title: t('common.status'), - field: 'status', - dictType: DICT_TYPE.COMMON_STATUS, - dictClass: 'number', - isSearch: true, - table: { - width: 80 - } - }, - { - title: t('form.remark'), - field: 'remark', - isTable: false - }, - { - title: t('common.createTime'), - field: 'createTime', - formatter: 'formatDate', - isForm: false, - search: { - show: true, - itemRender: { - name: 'XDataTimePicker' - } - } - } - ] -}) -export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/tsconfig.json b/tsconfig.json index 6b412cd8..b97c7079 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -32,6 +32,7 @@ "vite-plugin-svg-icons/client", "@form-create/element-ui/types" ], + "outDir": "target", // 请保留这个属性,防止tsconfig.json文件报错 "typeRoots": ["./node_modules/@types/", "./types"] }, "include": [ @@ -40,5 +41,5 @@ "src/types/auto-imports.d.ts", "src/types/auto-components.d.ts" ], - "exclude": ["dist", "node_modules"] + "exclude": ["dist", "target", "node_modules"] }