mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-06 23:25:06 +08:00
perf: vxe
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import { App, unref } from 'vue'
|
||||
import 'xe-utils'
|
||||
import XEUtils from 'xe-utils'
|
||||
import './renderer'
|
||||
import { i18n } from '@/plugins/vueI18n'
|
||||
import zhCN from 'vxe-table/es/locale/lang/zh-CN'
|
||||
import enUS from 'vxe-table/lib/locale/lang/en-US'
|
||||
@ -138,6 +139,10 @@ VXETable.formats.mixin({
|
||||
formatDate({ cellValue }, format) {
|
||||
return XEUtils.toDateString(cellValue, format || 'yyyy-MM-dd HH:mm:ss')
|
||||
},
|
||||
// 格式字典
|
||||
formatDict() {
|
||||
return 'cellValue 123'
|
||||
},
|
||||
// 四舍五入金额,每隔3位逗号分隔,默认2位数
|
||||
formatAmount({ cellValue }, digits = 2) {
|
||||
return XEUtils.commafy(Number(cellValue), { digits })
|
||||
|
12
yudao-ui-admin-vue3/src/plugins/vxeTable/renderer/dict.tsx
Normal file
12
yudao-ui-admin-vue3/src/plugins/vxeTable/renderer/dict.tsx
Normal file
@ -0,0 +1,12 @@
|
||||
import { DictTag } from '@/components/DictTag'
|
||||
import { VXETable } from 'vxe-table'
|
||||
|
||||
// 创建一个简单的超链接渲染
|
||||
VXETable.renderer.add('XDict', {
|
||||
// 默认显示模板
|
||||
renderDefault(renderOpts, params) {
|
||||
const { row, column } = params
|
||||
const { content } = renderOpts
|
||||
return <DictTag type={content as unknown as string} value={row[column.field]}></DictTag>
|
||||
}
|
||||
})
|
@ -0,0 +1 @@
|
||||
import './dict'
|
Reference in New Issue
Block a user