From 6b194bb95f48043fd53050b222b7f311adc9c7d7 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 24 Mar 2023 23:07:51 +0800 Subject: [PATCH] =?UTF-8?q?Vue3=20=E9=87=8D=E6=9E=84=EF=BC=9AREVIEW=20?= =?UTF-8?q?=E7=9F=AD=E4=BF=A1=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/sms/smsChannel/index.ts | 2 +- src/api/system/sms/smsLog/index.ts | 23 +- src/components/RightToolbar/index.ts | 9 - src/components/RightToolbar/src/index.vue | 104 ----- src/components/index.ts | 2 - src/locales/zh-CN.ts | 9 +- src/types/auto-components.d.ts | 6 +- src/types/auto-imports.d.ts | 2 +- src/utils/dict.ts | 8 + src/utils/formatTime.ts | 12 +- .../sms/{smsChannel => channel}/form.vue | 274 ++++++------- .../sms/{smsChannel => channel}/index.vue | 0 src/views/system/sms/log/SmsLogDetail.vue | 87 ++++ src/views/system/sms/log/index.vue | 263 ++++++++++++ src/views/system/sms/smsLog/index.vue | 382 ------------------ .../sms/{smsTemplate => template}/form.vue | 0 .../sms/{smsTemplate => template}/index.vue | 2 +- 17 files changed, 516 insertions(+), 669 deletions(-) delete mode 100644 src/components/RightToolbar/index.ts delete mode 100644 src/components/RightToolbar/src/index.vue rename src/views/system/sms/{smsChannel => channel}/form.vue (97%) rename src/views/system/sms/{smsChannel => channel}/index.vue (100%) create mode 100644 src/views/system/sms/log/SmsLogDetail.vue create mode 100644 src/views/system/sms/log/index.vue delete mode 100644 src/views/system/sms/smsLog/index.vue rename src/views/system/sms/{smsTemplate => template}/form.vue (100%) rename src/views/system/sms/{smsTemplate => template}/index.vue (99%) diff --git a/src/api/system/sms/smsChannel/index.ts b/src/api/system/sms/smsChannel/index.ts index 7c8ccea9..ee0e6167 100644 --- a/src/api/system/sms/smsChannel/index.ts +++ b/src/api/system/sms/smsChannel/index.ts @@ -31,7 +31,7 @@ export const getSmsChannelPageApi = (params: SmsChannelPageReqVO) => { } // 获得短信渠道精简列表 -export function getSimpleSmsChannels() { +export function getSimpleSmsChannelList() { return request.get({ url: '/system/sms-channel/list-all-simple' }) } diff --git a/src/api/system/sms/smsLog/index.ts b/src/api/system/sms/smsLog/index.ts index 269b609d..3d54fac1 100644 --- a/src/api/system/sms/smsLog/index.ts +++ b/src/api/system/sms/smsLog/index.ts @@ -28,31 +28,12 @@ export interface SmsLogVO { createTime: Date | null } -export interface SmsLogPageReqVO extends PageParam { - channelId?: number | null - templateId?: number | null - mobile?: string - sendStatus?: number | null - sendTime?: Date[] - receiveStatus?: number | null - receiveTime?: Date[] -} -export interface SmsLogExportReqVO { - channelId?: number - templateId?: number - mobile?: string - sendStatus?: number - sendTime?: Date[] - receiveStatus?: number - receiveTime?: Date[] -} - // 查询短信日志列表 -export const getSmsLogPageApi = (params: SmsLogPageReqVO) => { +export const getSmsLogPage = (params: PageParam) => { return request.get({ url: '/system/sms-log/page', params }) } // 导出短信日志 -export const exportSmsLogApi = (params: SmsLogExportReqVO) => { +export const exportSmsLog = (params) => { return request.download({ url: '/system/sms-log/export-excel', params }) } diff --git a/src/components/RightToolbar/index.ts b/src/components/RightToolbar/index.ts deleted file mode 100644 index eb9d1112..00000000 --- a/src/components/RightToolbar/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -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 deleted file mode 100644 index 11e021dc..00000000 --- a/src/components/RightToolbar/src/index.vue +++ /dev/null @@ -1,104 +0,0 @@ - - - diff --git a/src/components/index.ts b/src/components/index.ts index 97c2b4b0..19b2aac6 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -9,7 +9,6 @@ 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) @@ -23,5 +22,4 @@ 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/locales/zh-CN.ts b/src/locales/zh-CN.ts index 0a1e9e19..6f46f1ab 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -303,14 +303,7 @@ export default { dialog: { dialog: '弹窗', open: '打开', - close: '关闭', - sms: { - template: { - addTitle: '添加短信模板', - updtaeTitle: '修改短信模板', - sendSms: '发送短信' - } - } + close: '关闭' }, sys: { api: { diff --git a/src/types/auto-components.d.ts b/src/types/auto-components.d.ts index 5c679fa9..2b199f1a 100644 --- a/src/types/auto-components.d.ts +++ b/src/types/auto-components.d.ts @@ -1,5 +1,7 @@ -// generated by unplugin-vue-components -// We suggest you to commit this file into source control +/* eslint-disable */ +/* prettier-ignore */ +// @ts-nocheck +// Generated by unplugin-vue-components // Read more: https://github.com/vuejs/core/pull/3399 import '@vue/runtime-core' diff --git a/src/types/auto-imports.d.ts b/src/types/auto-imports.d.ts index 2c68c6ce..75cf16d9 100644 --- a/src/types/auto-imports.d.ts +++ b/src/types/auto-imports.d.ts @@ -72,5 +72,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/utils/dict.ts b/src/utils/dict.ts index 4f5d63fb..395f7157 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -69,6 +69,13 @@ export const getDictObj = (dictType: string, value: any) => { } }) } + +/** + * 获得字典数据的文本展示 + * + * @param dictType 字典类型 + * @param value 字典数据的值 + */ export const getDictLabel = (dictType: string, value: any) => { const dictOptions: DictDataType[] = getDictOptions(dictType) const dictLabel = ref('') @@ -79,6 +86,7 @@ export const getDictLabel = (dictType: string, value: any) => { }) return dictLabel.value } + export enum DICT_TYPE { USER_TYPE = 'user_type', COMMON_STATUS = 'common_status', diff --git a/src/utils/formatTime.ts b/src/utils/formatTime.ts index 35c783a6..ec7f3744 100644 --- a/src/utils/formatTime.ts +++ b/src/utils/formatTime.ts @@ -11,9 +11,19 @@ import dayjs from 'dayjs' * @description format 季度 + 星期 + 几周:"YYYY-mm-dd HH:MM:SS WWW QQQQ ZZZ" * @returns 返回拼接后的时间字符串 */ -export function formatDate(date: Date, format: string): string { +export function formatDate(date: Date, format?: string): string { + // 日期不存在,则返回空 + if (!date) { + return '' + } + // 日期存在,则进行格式化 + if (format === undefined) { + format = 'YYYY-MM-DD HH:mm:ss' + } return dayjs(date).format(format) } + +// TODO 芋艿:稍后去掉 // 日期格式化 export function parseTime(time: any, pattern?: string) { if (arguments.length === 0 || !time) { diff --git a/src/views/system/sms/smsChannel/form.vue b/src/views/system/sms/channel/form.vue similarity index 97% rename from src/views/system/sms/smsChannel/form.vue rename to src/views/system/sms/channel/form.vue index 7c20a90d..9c3881d8 100644 --- a/src/views/system/sms/smsChannel/form.vue +++ b/src/views/system/sms/channel/form.vue @@ -1,137 +1,137 @@ - - + + diff --git a/src/views/system/sms/smsChannel/index.vue b/src/views/system/sms/channel/index.vue similarity index 100% rename from src/views/system/sms/smsChannel/index.vue rename to src/views/system/sms/channel/index.vue diff --git a/src/views/system/sms/log/SmsLogDetail.vue b/src/views/system/sms/log/SmsLogDetail.vue new file mode 100644 index 00000000..736d0b8e --- /dev/null +++ b/src/views/system/sms/log/SmsLogDetail.vue @@ -0,0 +1,87 @@ + + diff --git a/src/views/system/sms/log/index.vue b/src/views/system/sms/log/index.vue new file mode 100644 index 00000000..a0acdfaa --- /dev/null +++ b/src/views/system/sms/log/index.vue @@ -0,0 +1,263 @@ + + diff --git a/src/views/system/sms/smsLog/index.vue b/src/views/system/sms/smsLog/index.vue deleted file mode 100644 index f4a0ca9f..00000000 --- a/src/views/system/sms/smsLog/index.vue +++ /dev/null @@ -1,382 +0,0 @@ - - diff --git a/src/views/system/sms/smsTemplate/form.vue b/src/views/system/sms/template/form.vue similarity index 100% rename from src/views/system/sms/smsTemplate/form.vue rename to src/views/system/sms/template/form.vue diff --git a/src/views/system/sms/smsTemplate/index.vue b/src/views/system/sms/template/index.vue similarity index 99% rename from src/views/system/sms/smsTemplate/index.vue rename to src/views/system/sms/template/index.vue index ed934c0f..ffdd4240 100644 --- a/src/views/system/sms/smsTemplate/index.vue +++ b/src/views/system/sms/template/index.vue @@ -275,7 +275,7 @@ const resetForm = () => { // 短信渠道 const channelOptions = ref([]) onMounted(() => { - SmsChannelApi.getSimpleSmsChannels().then((res) => { + SmsChannelApi.getSimpleSmsChannelList().then((res) => { channelOptions.value = res }) })