|
|
@@ -2,7 +2,7 @@ import { VxeUI } from 'vxe-pc-ui';
|
|
|
import dayjs from 'dayjs';
|
|
|
import { get, has, isEmpty, isFunction } from 'lodash';
|
|
|
import { formatMoney, formatPercentage } from '/@/components/BsUi/uitl.js';
|
|
|
-import { DISPLAY_STATE } from '/@/components/BsUi/constant.js';
|
|
|
+import { DISPLAY_STATE, FILE_TYPE_ICON_MAP } from '/@/components/BsUi/constant.js';
|
|
|
import { DeleteOutlined, EditOutlined, EyeOutlined, PlusOutlined } from '@ant-design/icons-vue';
|
|
|
import { h } from 'vue';
|
|
|
|
|
|
@@ -50,7 +50,7 @@ VxeUI.renderer.add('CellDict', {
|
|
|
// 默认显示模板
|
|
|
renderTableDefault(renderOpts, params) {
|
|
|
if (isEmpty(getValue(params))) return <></>;
|
|
|
- return <bs-dic-tag dicts={getValue(params)}></bs-dic-tag>
|
|
|
+ return <bs-dic-tag dicts={getValue(params)}></bs-dic-tag>;
|
|
|
},
|
|
|
});
|
|
|
|
|
|
@@ -98,3 +98,19 @@ VxeUI.renderer.add('CellOption', {
|
|
|
);
|
|
|
},
|
|
|
});
|
|
|
+
|
|
|
+// 文件类型
|
|
|
+VxeUI.renderer.add('CellFileType', {
|
|
|
+ // 默认显示模板
|
|
|
+ renderTableDefault(renderOpts, params) {
|
|
|
+ const { extraProps } = renderOpts;
|
|
|
+ const { row, column } = params;
|
|
|
+ const fileTypeName = row[column.field]?.toUpperCase();
|
|
|
+ const iconName = FILE_TYPE_ICON_MAP[fileTypeName] || 'undefined_icon.svg';
|
|
|
+ column.title = '文件类型';
|
|
|
+ column.width = '80';
|
|
|
+ column.align = 'center';
|
|
|
+
|
|
|
+ return <a-image preview={false} width={30} height={30} src={`/src/components/BsUi/images/${iconName}`}></a-image>;
|
|
|
+ },
|
|
|
+});
|