You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ds-wms-client-web/src/App.vue

71 lines
2.4 KiB
Vue

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!--
* @Author: 张同海 14166000+zhangtonghai@user.noreply.gitee.com
* @Date: 2024-05-06 09:18:47
* @LastEditors: lijingjia lijj_xl@163.com
* @LastEditTime: 2024-06-13 16:19:00
* @FilePath: \ds-wms-client-web\src\App.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<ConfigProvider :locale="getAntdLocale">
<AppProvider>
<RouterView />
</AppProvider>
</ConfigProvider>
</template>
<script lang="ts" setup>
import { ConfigProvider } from 'ant-design-vue'
import { AppProvider } from '/@/components/Application'
import { useTitle } from '/@/hooks/web/useTitle'
import { useLocale } from '/@/locales/useLocale'
import VXETable from 'vxe-table'
import XEUtils from 'xe-utils'
import dayjs from 'dayjs'
import 'dayjs/locale/zh-cn'
dayjs.locale('zh-cn')
// 自定义全局的格式化处理函数
VXETable.formats.mixin({
// 格式化性别
formatSex({ cellValue }) {
return cellValue ? (cellValue === '1' ? '男' : '女') : ''
},
// 格式化下拉选项
formatSelect({ cellValue }, list) {
const item = list.find((item) => item.value === cellValue)
return item ? item.label : ''
},
// 格式化日期,默认 yyyy-MM-dd HH:mm:ss
formatDate({ cellValue }, format) {
return XEUtils.toDateString(cellValue, format || 'yyyy-MM-dd HH:mm:ss')
},
// 四舍五入金额每隔3位逗号分隔默认2位数
formatAmount({ cellValue }, digits = 2) {
return XEUtils.commafy(Number(cellValue), { digits })
},
// 格式化银行卡默认每4位空格隔开
formatBankcard({ cellValue }) {
return XEUtils.commafy(XEUtils.toValueString(cellValue), { spaceNumber: 4, separator: ' ' })
},
// 四舍五入,默认两位数
formatFixedNumber({ cellValue }, digits = 2) {
return XEUtils.toFixed(XEUtils.round(cellValue, digits), digits)
},
// 向下舍入,默认两位数
formatCutNumber({ cellValue }, digits = 2) {
return XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits)
},
})
// support Multi-language
const { getAntdLocale } = useLocale()
// Listening to page changes and dynamically changing site titles
useTitle()
</script>
<style>
/* .ant-select-dropdown {
top: 36px !important;
z-index: 3000 !important;
} */
</style>