feat: integrate upload components into form by default

This commit is contained in:
vben
2020-11-18 23:10:29 +08:00
parent 99303a9987
commit be2b8a7e17
5 changed files with 15 additions and 15 deletions

View File

@@ -158,7 +158,7 @@ export default defineComponent({
) {
rule.type = 'object';
}
if (component.includes('RangePicker')) {
if (component.includes('RangePicker') || component.includes('Upload')) {
rule.type = 'array';
}
if (component.includes('InputNumber')) {

View File

@@ -18,6 +18,7 @@ import {
TreeSelect,
} from 'ant-design-vue';
import RadioButtonGroup from './components/RadioButtonGroup.vue';
import { BasicUpload } from '/@/components/Upload';
const componentMap = new Map<ComponentType, any>();
@@ -48,6 +49,8 @@ componentMap.set('RangePicker', DatePicker.RangePicker);
componentMap.set('WeekPicker', DatePicker.WeekPicker);
componentMap.set('TimePicker', TimePicker);
componentMap.set('Upload', BasicUpload);
export function add(compName: ComponentType, component: Component) {
componentMap.set(compName, component);
}

View File

@@ -1,7 +1,10 @@
import type { BasicColumn, ActionItem } from '/@/components/Table';
import { FileItem, PreviewFileItem, UploadResultStatus } from './types';
import { checkImgType, isImgTypeByName } from './utils';
import { Progress, Tag } from 'ant-design-vue';
import { FileItem, PreviewFileItem, UploadResultStatus } from './types';
import { BasicColumn, ActionItem, TableAction } from '/@/components/Table/index';
import TableAction from '/@/components/Table/src/components/TableAction';
// 文件上传列表
export function createTableColumns(): BasicColumn[] {