mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-06 23:25:06 +08:00
perf: typo
This commit is contained in:
@ -175,6 +175,14 @@ VXETable.formats.mixin({
|
||||
// 格式化图片,将图片链接转换为html标签
|
||||
formatImg({ cellValue }) {
|
||||
return '<img height="40" src="' + cellValue + '"> '
|
||||
},
|
||||
// 格式化文件大小
|
||||
formatSize({ cellValue }, digits = 0) {
|
||||
const unitArr = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
|
||||
const srcSize = parseFloat(cellValue)
|
||||
const index = Math.floor(Math.log(srcSize) / Math.log(1024))
|
||||
const size = srcSize / Math.pow(1024, index)
|
||||
return XEUtils.toFixed(XEUtils.floor(size, 2), 2) + ' ' + unitArr[digits]
|
||||
}
|
||||
})
|
||||
export const setupVxeTable = (app: App<Element>) => {
|
||||
|
@ -0,0 +1,20 @@
|
||||
import { ElDatePicker } from 'element-plus'
|
||||
import { VXETable } from 'vxe-table'
|
||||
|
||||
// 日期区间选择渲染
|
||||
VXETable.renderer.add('XDataPicker', {
|
||||
// 默认显示模板
|
||||
renderItemContent(renderOpts, params) {
|
||||
const { data, field } = params
|
||||
const { content } = renderOpts
|
||||
return (
|
||||
<ElDatePicker
|
||||
v-model={data[field]}
|
||||
style="width: 100%"
|
||||
type={content ? (content as any) : 'datetime'}
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
clearable
|
||||
></ElDatePicker>
|
||||
)
|
||||
}
|
||||
})
|
@ -1,4 +1,5 @@
|
||||
import './dataTimePicker'
|
||||
import './dataPicker'
|
||||
import './dataTimeRangePicker'
|
||||
import './dict'
|
||||
import './html'
|
||||
import './link'
|
||||
|
Reference in New Issue
Block a user