Commit 262f0bf7 by lijiabin

【需求 17679】 perf: 调整格式等

parent 0ca6abec
......@@ -8,6 +8,7 @@
<script setup lang="ts">
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import { initWxConfig } from '@/utils/wxUtil/initWXConfig'
const locale = ref(zhCn)
onMounted(() => {
......
......@@ -8,7 +8,7 @@ export const useDeviceStore = defineStore({
device: '',
isPc: false,
AndroidOrIphone: ''
AndroidOrIphone: '',
}
},
actions: {
......@@ -24,6 +24,6 @@ export const useDeviceStore = defineStore({
// 判断设备
handleUserAgent() {
this.AndroidOrIphone = checkUserAgent()
}
}
},
},
})
......@@ -19,7 +19,7 @@ export const useEmojiStore = defineStore({
id: 'emoji',
state: () => {
return {
emoji: {} as IGroupEmojy
emoji: {} as IGroupEmojy,
}
},
actions: {
......@@ -49,10 +49,10 @@ export const useEmojiStore = defineStore({
if (!jsonData) return null
const obj: IEmojiObj = {}
jsonData.default.forEach(v => {
jsonData.default.forEach((v) => {
obj[v.name] = v
})
return obj
}
}
},
},
})
......@@ -23,7 +23,7 @@ export function aesEncrypt(plaintext: string, key: string): string {
// 加密数据
const encrypted = CryptoJS.AES.encrypt(plaintext, CryptoJS.enc.Utf8.parse(key), {
mode: CryptoJS.mode.ECB,
padding: CryptoJS.pad.Pkcs7
padding: CryptoJS.pad.Pkcs7,
})
return encrypted.toString()
......
......@@ -43,7 +43,7 @@ export const ERROR_STATUS = {
502: '502: 错误网关~',
503: '503: 服务不可用',
504: '504: 网关超时~',
505: '505: http版本不支持该请求~'
505: '505: http版本不支持该请求~',
}
/** 不弹出错误信息的code */
......
......@@ -23,7 +23,7 @@ class LocalCache {
setCache(key: string, value: unknown, expireTime = 0) {
const obj = {
data: value,
time: expireTime ? new Date().getTime() + expireTime : 0
time: expireTime ? new Date().getTime() + expireTime : 0,
}
window.localStorage.setItem(key, JSON.stringify(obj))
}
......
......@@ -6,7 +6,7 @@
export function splitArray<T = unknown>(arr: T[], callback: (item: T) => boolean) {
const arr1: T[] = []
const arr2: T[] = []
arr.forEach(v => {
arr.forEach((v) => {
if (callback(v)) {
arr1.push(v)
} else {
......@@ -15,6 +15,6 @@ export function splitArray<T = unknown>(arr: T[], callback: (item: T) => boolean
})
return {
false: arr2,
true: arr1
true: arr1,
}
}
......@@ -24,7 +24,11 @@ export function time_format(value?: string | number, format = 'YYYY-MM-DD', useA
}
// 将日期格式化成对应的格式
export const formatDate = function (str: string | number, format = 'YYYY-MM-DD HH:mm', shortStr = false) {
export const formatDate = function (
str: string | number,
format = 'YYYY-MM-DD HH:mm',
shortStr = false,
) {
// 兼容苹果
if (typeof str === 'string') {
str = str.replace(/-/g, '/')
......
......@@ -13,7 +13,11 @@ interface IObject {
[key: string]: any
children?: IObject[]
}
export function arrayToTree<T extends IObject>(items: T[], parentKey = 'parentId', primaryKey = 'id') {
export function arrayToTree<T extends IObject>(
items: T[],
parentKey = 'parentId',
primaryKey = 'id',
) {
const result: T[] = []
const itemMap = new Map<string | number, T>()
// 遍历源数组,给map添加数据
......
......@@ -3,9 +3,17 @@
<!-- 头部Tabs -->
<div class="header h-40px items-center justify-between">
<div class="left flex gap-3 flex items-center">
<Tabs :modelValue="activeTab" @update:modelValue="(e) => updateActiveTab(e as string)" :tabs="tabs" />
<Tabs
:modelValue="activeTab"
@update:modelValue="(e) => updateActiveTab(e as string)"
:tabs="tabs"
/>
<!-- 刷新图标 -->
<el-icon size="15" class="cursor-pointer hover:rotate-180 transition-all duration-300" @click="handleRefresh">
<el-icon
size="15"
class="cursor-pointer hover:rotate-180 transition-all duration-300"
@click="handleRefresh"
>
<Refresh />
</el-icon>
</div>
......@@ -52,7 +60,10 @@ const handleRefresh = () => {
const updateActiveTab = (val: string) => {
if (val === '关爱基金') {
window.open('https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww42a2d34b42b8d721&redirect_uri=oa.yswg.com.cn:3456/careFund/publicNotice/index&response_type=code&scope=snsapi_base&state=#wechat_redirect', '_blank')
window.open(
'https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww42a2d34b42b8d721&redirect_uri=oa.yswg.com.cn:3456/careFund/publicNotice/index&response_type=code&scope=snsapi_base&state=#wechat_redirect',
'_blank',
)
return
}
activeTab.value = val
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment