12345678910111213141516171819202122232425 |
- import {VxeColumnPropTypes} from "vxe-table";
- import {VXETable} from 'vxe-table'
- import XEUtils from "xe-utils";
- VXETable.formats.mixin({
- formatDate({cellValue}, format: string = 'yy-MM-dd HH:mm') {
- return XEUtils.toDateString(cellValue, format)
- },
- formatSex({cellValue}) {
- if (cellValue) {
- if (cellValue == 1) {
- return '男'
- }
- if (cellValue == 2) {
- return '女'
- }
- return '其他'
- }
- return ''
- },
- })
- export const vxeFormatTime: VxeColumnPropTypes.Formatter = ({cellValue}) => {
- return XEUtils.toDateString(cellValue, 'yy-MM-dd HH:mm')
- }
|