Vue3 重构:REVIEW 短信日志

This commit is contained in:
YunaiV
2023-03-24 23:07:51 +08:00
parent 2a3fe7d2bc
commit 6b194bb95f
17 changed files with 516 additions and 669 deletions

View File

@ -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',

View File

@ -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) {