Skip to content

Commit 6b194bb

Browse files
committed
Vue3 重构:REVIEW 短信日志
1 parent 2a3fe7d commit 6b194bb

File tree

17 files changed

+516
-669
lines changed

17 files changed

+516
-669
lines changed

src/api/system/sms/smsChannel/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const getSmsChannelPageApi = (params: SmsChannelPageReqVO) => {
3131
}
3232

3333
// 获得短信渠道精简列表
34-
export function getSimpleSmsChannels() {
34+
export function getSimpleSmsChannelList() {
3535
return request.get({ url: '/system/sms-channel/list-all-simple' })
3636
}
3737

src/api/system/sms/smsLog/index.ts

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,31 +28,12 @@ export interface SmsLogVO {
2828
createTime: Date | null
2929
}
3030

31-
export interface SmsLogPageReqVO extends PageParam {
32-
channelId?: number | null
33-
templateId?: number | null
34-
mobile?: string
35-
sendStatus?: number | null
36-
sendTime?: Date[]
37-
receiveStatus?: number | null
38-
receiveTime?: Date[]
39-
}
40-
export interface SmsLogExportReqVO {
41-
channelId?: number
42-
templateId?: number
43-
mobile?: string
44-
sendStatus?: number
45-
sendTime?: Date[]
46-
receiveStatus?: number
47-
receiveTime?: Date[]
48-
}
49-
5031
// 查询短信日志列表
51-
export const getSmsLogPageApi = (params: SmsLogPageReqVO) => {
32+
export const getSmsLogPage = (params: PageParam) => {
5233
return request.get({ url: '/system/sms-log/page', params })
5334
}
5435

5536
// 导出短信日志
56-
export const exportSmsLogApi = (params: SmsLogExportReqVO) => {
37+
export const exportSmsLog = (params) => {
5738
return request.download({ url: '/system/sms-log/export-excel', params })
5839
}

src/components/RightToolbar/index.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/components/RightToolbar/src/index.vue

Lines changed: 0 additions & 104 deletions
This file was deleted.

src/components/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { XButton, XTextButton } from '@/components/XButton'
99
import { DictTag } from '@/components/DictTag'
1010
import { ContentWrap } from '@/components/ContentWrap'
1111
import { Descriptions } from '@/components/Descriptions'
12-
import { RightToolbar } from '@/components/RightToolbar'
1312

1413
export const setupGlobCom = (app: App<Element>): void => {
1514
app.component('Icon', Icon)
@@ -23,5 +22,4 @@ export const setupGlobCom = (app: App<Element>): void => {
2322
app.component('DictTag', DictTag)
2423
app.component('ContentWrap', ContentWrap)
2524
app.component('Descriptions', Descriptions)
26-
app.component('RightToolbar', RightToolbar)
2725
}

src/locales/zh-CN.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -303,14 +303,7 @@ export default {
303303
dialog: {
304304
dialog: '弹窗',
305305
open: '打开',
306-
close: '关闭',
307-
sms: {
308-
template: {
309-
addTitle: '添加短信模板',
310-
updtaeTitle: '修改短信模板',
311-
sendSms: '发送短信'
312-
}
313-
}
306+
close: '关闭'
314307
},
315308
sys: {
316309
api: {

src/types/auto-components.d.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
// generated by unplugin-vue-components
2-
// We suggest you to commit this file into source control
1+
/* eslint-disable */
2+
/* prettier-ignore */
3+
// @ts-nocheck
4+
// Generated by unplugin-vue-components
35
// Read more: https://github.com/vuejs/core/pull/3399
46
import '@vue/runtime-core'
57

src/types/auto-imports.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,5 @@ declare global {
7272
// for type re-export
7373
declare global {
7474
// @ts-ignore
75-
export type { Component,ComponentPublicInstance,ComputedRef,InjectionKey,PropType,Ref,VNode } from 'vue'
75+
export type { Component, ComponentPublicInstance, ComputedRef, InjectionKey, PropType, Ref, VNode } from 'vue'
7676
}

src/utils/dict.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ export const getDictObj = (dictType: string, value: any) => {
6969
}
7070
})
7171
}
72+
73+
/**
74+
* 获得字典数据的文本展示
75+
*
76+
* @param dictType 字典类型
77+
* @param value 字典数据的值
78+
*/
7279
export const getDictLabel = (dictType: string, value: any) => {
7380
const dictOptions: DictDataType[] = getDictOptions(dictType)
7481
const dictLabel = ref('')
@@ -79,6 +86,7 @@ export const getDictLabel = (dictType: string, value: any) => {
7986
})
8087
return dictLabel.value
8188
}
89+
8290
export enum DICT_TYPE {
8391
USER_TYPE = 'user_type',
8492
COMMON_STATUS = 'common_status',

src/utils/formatTime.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,19 @@ import dayjs from 'dayjs'
1111
* @description format 季度 + 星期 + 几周:"YYYY-mm-dd HH:MM:SS WWW QQQQ ZZZ"
1212
* @returns 返回拼接后的时间字符串
1313
*/
14-
export function formatDate(date: Date, format: string): string {
14+
export function formatDate(date: Date, format?: string): string {
15+
// 日期不存在,则返回空
16+
if (!date) {
17+
return ''
18+
}
19+
// 日期存在,则进行格式化
20+
if (format === undefined) {
21+
format = 'YYYY-MM-DD HH:mm:ss'
22+
}
1523
return dayjs(date).format(format)
1624
}
25+
26+
// TODO 芋艿:稍后去掉
1727
// 日期格式化
1828
export function parseTime(time: any, pattern?: string) {
1929
if (arguments.length === 0 || !time) {

0 commit comments

Comments
 (0)