From 7697e5c358436a1ff86b013918bff74ad99481f7 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Tue, 21 Mar 2023 16:17:44 +0800 Subject: [PATCH 01/18] =?UTF-8?q?add:=20=E6=B7=BB=E5=8A=A0=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=8C=87=E5=AE=9A=E5=AD=97=E5=85=B8=E6=8C=87=E5=AE=9A?= =?UTF-8?q?=E5=80=BC=E5=AF=B9=E5=BA=94=E7=9A=84label=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/dict.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 15e57ff2..4f5d63fb 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -69,7 +69,16 @@ export const getDictObj = (dictType: string, value: any) => { } }) } - +export const getDictLabel = (dictType: string, value: any) => { + const dictOptions: DictDataType[] = getDictOptions(dictType) + const dictLabel = ref('') + dictOptions.forEach((dict: DictDataType) => { + if (dict.value === value) { + dictLabel.value = dict.label + } + }) + return dictLabel.value +} export enum DICT_TYPE { USER_TYPE = 'user_type', COMMON_STATUS = 'common_status', From 9adf80c9141db8260d5f0b42b8f884d78a2954b8 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Tue, 21 Mar 2023 16:20:03 +0800 Subject: [PATCH 02/18] =?UTF-8?q?add:=20=E6=94=B9=E9=80=A0vue2=E4=B8=AD?= =?UTF-8?q?=E7=9A=84RightToolbar=E5=88=B0vue3=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/RightToolbar/index.ts | 9 ++ src/components/RightToolbar/src/index.vue | 104 ++++++++++++++++++++++ 2 files changed, 113 insertions(+) create mode 100644 src/components/RightToolbar/index.ts create mode 100644 src/components/RightToolbar/src/index.vue 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 @@ + + + From c1b1ffa46706bd2b7d3e21c78167a4eb1342bf12 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Tue, 21 Mar 2023 16:21:23 +0800 Subject: [PATCH 03/18] =?UTF-8?q?add:=20=E6=94=B9=E9=80=A0vue2=E4=B8=AD?= =?UTF-8?q?=E7=9A=84RightToolbar=E5=88=B0vue3=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/index.ts | 2 ++ 1 file changed, 2 insertions(+) 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) } From 6e90bbe2e1b03f8f4f9c05d4256f291d21eb639a Mon Sep 17 00:00:00 2001 From: puhui999 Date: Tue, 21 Mar 2023 16:29:11 +0800 Subject: [PATCH 04/18] =?UTF-8?q?add:=20=E6=94=B9=E9=80=A0vue2=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E7=9F=AD=E4=BF=A1=E6=A8=A1=E6=9D=BF=E5=88=B0vue3?= =?UTF-8?q?=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/sms/smsChannel/index.ts | 6 + src/api/system/sms/smsTemplate/index.ts | 22 +- src/locales/zh-CN.ts | 9 +- src/views/system/sms/smsTemplate/form.vue | 262 +++++++++ src/views/system/sms/smsTemplate/index.vue | 532 +++++++++++------- .../sms/smsTemplate/sms.template.data.ts | 107 ---- 6 files changed, 607 insertions(+), 331 deletions(-) create mode 100644 src/views/system/sms/smsTemplate/form.vue delete mode 100644 src/views/system/sms/smsTemplate/sms.template.data.ts 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/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/locales/zh-CN.ts b/src/locales/zh-CN.ts index 7c5742c4..985ffb7c 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -302,7 +302,14 @@ export default { dialog: { dialog: '弹窗', open: '打开', - close: '关闭' + close: '关闭', + sms: { + template: { + addTitle: '添加短信模板', + updtaeTitle: '修改短信模板', + sendSms: '发送短信' + } + } }, sys: { api: { diff --git a/src/views/system/sms/smsTemplate/form.vue b/src/views/system/sms/smsTemplate/form.vue new file mode 100644 index 00000000..193ae2e3 --- /dev/null +++ b/src/views/system/sms/smsTemplate/form.vue @@ -0,0 +1,262 @@ + + diff --git a/src/views/system/sms/smsTemplate/index.vue b/src/views/system/sms/smsTemplate/index.vue index bbc7c863..a7d6ded1 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) From 16c4bb5dca18177a2c78d0de8573df870e58aeff Mon Sep 17 00:00:00 2001 From: puhui999 Date: Tue, 21 Mar 2023 16:46:16 +0800 Subject: [PATCH 05/18] =?UTF-8?q?update:=20=E4=BF=AE=E5=A4=8D=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=9F=AD=E4=BF=A1=E5=8F=91=E9=80=81=E6=88=90=E5=8A=9F?= =?UTF-8?q?=E5=90=8E=E5=BC=B9=E7=AA=97=E4=B8=8D=E5=85=B3=E9=97=AD=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/types/auto-components.d.ts | 13 +++---------- src/types/auto-imports.d.ts | 2 +- src/views/system/sms/smsTemplate/form.vue | 11 ++++++++--- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/types/auto-components.d.ts b/src/types/auto-components.d.ts index 7b10d679..d6c922f8 100644 --- a/src/types/auto-components.d.ts +++ b/src/types/auto-components.d.ts @@ -1,7 +1,5 @@ -/* eslint-disable */ -/* prettier-ignore */ -// @ts-nocheck -// Generated by unplugin-vue-components +// generated by unplugin-vue-components +// We suggest you to commit this file into source control // Read more: https://github.com/vuejs/core/pull/3399 import '@vue/runtime-core' @@ -23,8 +21,6 @@ declare module '@vue/runtime-core' { DictTag: typeof import('./../components/DictTag/src/DictTag.vue')['default'] Echart: typeof import('./../components/Echart/src/Echart.vue')['default'] Editor: typeof import('./../components/Editor/src/Editor.vue')['default'] - ElAutoResizer: typeof import('element-plus/es')['ElAutoResizer'] - ElAvatar: typeof import('element-plus/es')['ElAvatar'] ElBadge: typeof import('element-plus/es')['ElBadge'] ElButton: typeof import('element-plus/es')['ElButton'] ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup'] @@ -54,7 +50,6 @@ declare module '@vue/runtime-core' { ElForm: typeof import('element-plus/es')['ElForm'] ElFormItem: typeof import('element-plus/es')['ElFormItem'] ElIcon: typeof import('element-plus/es')['ElIcon'] - ElImage: typeof import('element-plus/es')['ElImage'] ElImageViewer: typeof import('element-plus/es')['ElImageViewer'] ElInput: typeof import('element-plus/es')['ElInput'] ElInputNumber: typeof import('element-plus/es')['ElInputNumber'] @@ -69,15 +64,12 @@ declare module '@vue/runtime-core' { ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] ElSelect: typeof import('element-plus/es')['ElSelect'] ElSkeleton: typeof import('element-plus/es')['ElSkeleton'] - ElSpace: typeof import('element-plus/es')['ElSpace'] ElSwitch: typeof import('element-plus/es')['ElSwitch'] ElTable: typeof import('element-plus/es')['ElTable'] ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] ElTabPane: typeof import('element-plus/es')['ElTabPane'] ElTabs: typeof import('element-plus/es')['ElTabs'] ElTag: typeof import('element-plus/es')['ElTag'] - ElTimeline: typeof import('element-plus/es')['ElTimeline'] - ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem'] ElTooltip: typeof import('element-plus/es')['ElTooltip'] ElTransfer: typeof import('element-plus/es')['ElTransfer'] ElTree: typeof import('element-plus/es')['ElTree'] @@ -105,6 +97,7 @@ declare module '@vue/runtime-core' { ScriptTask: typeof import('./../components/bpmnProcessDesigner/package/penal/task/task-components/ScriptTask.vue')['default'] Search: typeof import('./../components/Search/src/Search.vue')['default'] SignalAndMessage: typeof import('./../components/bpmnProcessDesigner/package/penal/signal-message/SignalAndMessage.vue')['default'] + Src: typeof import('./../components/RightToolbar/src/index.vue')['default'] Sticky: typeof import('./../components/Sticky/src/Sticky.vue')['default'] Table: typeof import('./../components/Table/src/Table.vue')['default'] Tooltip: typeof import('./../components/Tooltip/src/Tooltip.vue')['default'] diff --git a/src/types/auto-imports.d.ts b/src/types/auto-imports.d.ts index 7c9f5ff1..bd749b8e 100644 --- a/src/types/auto-imports.d.ts +++ b/src/types/auto-imports.d.ts @@ -70,5 +70,5 @@ declare global { // for type re-export declare global { // @ts-ignore - export type { Component, ComponentPublicInstance, ComputedRef, InjectionKey, PropType, Ref, VNode } from 'vue' + export type { Component,ComponentPublicInstance,ComputedRef,InjectionKey,PropType,Ref,VNode } from 'vue' } diff --git a/src/views/system/sms/smsTemplate/form.vue b/src/views/system/sms/smsTemplate/form.vue index 193ae2e3..4c9825f9 100644 --- a/src/views/system/sms/smsTemplate/form.vue +++ b/src/views/system/sms/smsTemplate/form.vue @@ -1,5 +1,6 @@ From 36729f52828619082c1c21481491b30a47351177 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Wed, 22 Mar 2023 17:53:55 +0800 Subject: [PATCH 11/18] =?UTF-8?q?add:=20=E7=9F=AD=E4=BF=A1=E6=97=A5?= =?UTF-8?q?=E5=BF=97vue2=E8=BF=81=E7=A7=BB=E5=88=B0vue3=EF=BC=8C=E4=BD=BF?= =?UTF-8?q?=E7=94=A8ts=E6=94=B9=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/sms/smsLog/index.vue | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/views/system/sms/smsLog/index.vue b/src/views/system/sms/smsLog/index.vue index 78bfd937..2e690134 100644 --- a/src/views/system/sms/smsLog/index.vue +++ b/src/views/system/sms/smsLog/index.vue @@ -50,12 +50,11 @@ @@ -72,12 +71,11 @@ From ef3fbc5a04a0e9fb0ce0147a8c8c7f3a838225f6 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Wed, 22 Mar 2023 18:13:28 +0800 Subject: [PATCH 12/18] =?UTF-8?q?update:=20=E4=BF=AE=E5=A4=8D=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E8=AF=A6=E6=83=85=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E8=A7=A3=E5=86=B3=E8=A1=A8=E5=8D=95ref?= =?UTF-8?q?=E5=91=BD=E5=90=8D=E5=92=8C=E8=A1=A8=E5=8D=95=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E5=91=BD=E5=90=8D=E5=86=B2=E7=AA=81=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/sms/smsLog/index.vue | 53 +++++++++++++++------------ 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/src/views/system/sms/smsLog/index.vue b/src/views/system/sms/smsLog/index.vue index 2e690134..f3d17666 100644 --- a/src/views/system/sms/smsLog/index.vue +++ b/src/views/system/sms/smsLog/index.vue @@ -175,78 +175,83 @@ /> - + - {{ form.id }} + {{ formData.id }} - {{ formatChannelSignature(form.channelId) }} - + {{ formatChannelSignature(formData.channelId) }} + - {{ form.templateId }} | {{ form.templateCode }} - + {{ formData.templateId }} | {{ formData.templateCode }} + - {{ form.apiTemplateId }} + {{ formData.apiTemplateId }} {{ form.mobile }} - - ({{ form.userId }}) + >{{ formData.mobile }} + + ({{ + formData.userId + }}) - {{ form.templateContent }} + {{ formData.templateContent }} - {{ form.templateParams }} + {{ formData.templateParams }} - {{ parseTime(form.createTime) }} + {{ parseTime(formData.createTime) }} - + - {{ parseTime(form.sendTime) }} + {{ parseTime(formData.sendTime) }} {{ form.sendCode }} | {{ form.sendMsg }} + >{{ formData.sendCode }} | {{ formData.sendMsg }} {{ form.apiSendCode }} | {{ form.apiSendMsg }}{{ formData.apiSendCode }} | {{ formData.apiSendMsg }} - {{ form.apiSerialNo }} + {{ formData.apiSerialNo }} - {{ form.apiRequestId }} + {{ formData.apiRequestId }} - + - {{ parseTime(form.receiveTime) }} + {{ parseTime(formData.receiveTime) }} {{ form.apiReceiveCode }} | {{ form.apiReceiveMsg }} + >{{ formData.apiReceiveCode }} | {{ formData.apiReceiveMsg }} @@ -363,7 +368,7 @@ const getList = () => { } // ================== 详情 ==================== const open = ref(false) -const form = ref({ +const formData = ref({ id: null, channelId: null, channelCode: '', @@ -392,8 +397,8 @@ const form = ref({ }) /** 详细按钮操作 */ const handleView = (row: SmsLogApi.SmsLogVO) => { + formData.value = row open.value = true - form.value = row } getList() From 42128709aa88dfb0578cb8a4e405201b04ae75f2 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Wed, 22 Mar 2023 23:53:39 +0800 Subject: [PATCH 13/18] =?UTF-8?q?update:=20=E4=BF=AE=E6=94=B9=E4=BD=BF?= =?UTF-8?q?=E7=94=A8el-descriptions=E5=B1=95=E7=A4=BA=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/sms/smsLog/index.vue | 144 +++++++++++--------------- 1 file changed, 61 insertions(+), 83 deletions(-) diff --git a/src/views/system/sms/smsLog/index.vue b/src/views/system/sms/smsLog/index.vue index f3d17666..55b1a956 100644 --- a/src/views/system/sms/smsLog/index.vue +++ b/src/views/system/sms/smsLog/index.vue @@ -174,92 +174,70 @@ @pagination="getList" /> - - - - - {{ formData.id }} - - - - {{ formatChannelSignature(formData.channelId) }} - - - - - - {{ formData.templateId }} | {{ formData.templateCode }} - - - - - {{ formData.apiTemplateId }} - - - {{ formData.mobile }} - - ({{ - formData.userId - }}) - - - - - {{ formData.templateContent }} - - - {{ formData.templateParams }} - - - {{ parseTime(formData.createTime) }} - - - - - - - - {{ parseTime(formData.sendTime) }} - - - {{ formData.sendCode }} | {{ formData.sendMsg }} - - - - {{ formData.apiSendCode }} | {{ formData.apiSendMsg }} - - - {{ formData.apiSerialNo }} - - - {{ formData.apiRequestId }} - - - - - - - - {{ parseTime(formData.receiveTime) }} - - - {{ formData.apiReceiveCode }} | {{ formData.apiReceiveMsg }} - - - - + + + {{ + formData.id + }} + + {{ formatChannelSignature(formData.channelId) }} + + + + {{ formData.templateId }} | {{ formData.templateCode }} + + + + {{ formData.apiTemplateId }} + + + {{ formData.mobile }} + + + ({{ formData.userId }}) + + + + {{ formData.templateContent }} + + + {{ formData.templateParams }} + + + {{ parseTime(formData.createTime) }} + + + + + + {{ parseTime(formData.sendTime) }} + + + {{ formData.sendCode }} | {{ formData.sendMsg }} + + + {{ formData.apiSendCode }} | {{ formData.apiSendMsg }} + + + {{ formData.apiSerialNo }} + + + {{ formData.apiRequestId }} + + + + + + {{ parseTime(formData.receiveTime) }} + + + {{ formData.apiReceiveCode }} | {{ formData.apiReceiveMsg }} + + - +