|
@@ -99,35 +99,6 @@
|
|
const { createMessage } = useMessage();
|
|
const { createMessage } = useMessage();
|
|
const schemas: FormSchema[] = [
|
|
const schemas: FormSchema[] = [
|
|
{
|
|
{
|
|
- field: 'file',
|
|
|
|
- component: 'InputTextArea',
|
|
|
|
- // component: 'Upload',
|
|
|
|
- label: t('routes.product.file'),
|
|
|
|
- slot: 'file',
|
|
|
|
- // rules: [{ required: true, message: t('common.uploadMessge') }],
|
|
|
|
- // // helpMessage: t('routes.corporation.uploadHelp'),
|
|
|
|
- // itemProps: {
|
|
|
|
- // validateTrigger: 'onBlur',
|
|
|
|
- // },
|
|
|
|
- // componentProps: {
|
|
|
|
- // api: uploadApi,
|
|
|
|
- // maxNumber: 1,
|
|
|
|
- // maxSize: 2000,
|
|
|
|
- // fileFlow: true,
|
|
|
|
- // accept: ['jpg', 'jpg', 'png', 'jpeg', 'mp4', 'wav', 'mp3', 'shp', 'zip'],
|
|
|
|
- // afterFetch: function (data) {
|
|
|
|
- // console.log('afterFetch', data);
|
|
|
|
- // // Reflect.set(data, 'url', data.name);
|
|
|
|
- // fileFlow.file = data.file;
|
|
|
|
- // return data;
|
|
|
|
- // },
|
|
|
|
- // },
|
|
|
|
-
|
|
|
|
- colProps: {
|
|
|
|
- span: 16,
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
field: 'dictId',
|
|
field: 'dictId',
|
|
label: '分组',
|
|
label: '分组',
|
|
component: 'ApiSelect',
|
|
component: 'ApiSelect',
|
|
@@ -155,6 +126,16 @@
|
|
xxl: 18,
|
|
xxl: 18,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ field: 'file',
|
|
|
|
+ component: 'InputTextArea',
|
|
|
|
+ // component: 'Upload',
|
|
|
|
+ label: t('routes.product.file'),
|
|
|
|
+ slot: 'file',
|
|
|
|
+ colProps: {
|
|
|
|
+ span: 16,
|
|
|
|
+ },
|
|
|
|
+ },
|
|
];
|
|
];
|
|
const [registerForm, { validate, resetFields, setFieldsValue }] = useForm({
|
|
const [registerForm, { validate, resetFields, setFieldsValue }] = useForm({
|
|
labelWidth: 120,
|
|
labelWidth: 120,
|
|
@@ -168,6 +149,7 @@
|
|
let addListFunc = () => {};
|
|
let addListFunc = () => {};
|
|
const [register, { closeModal }] = useModalInner((data) => {
|
|
const [register, { closeModal }] = useModalInner((data) => {
|
|
console.log(data);
|
|
console.log(data);
|
|
|
|
+ fileFlow.dictId = null;
|
|
data && onDataReceive(data);
|
|
data && onDataReceive(data);
|
|
});
|
|
});
|
|
|
|
|
|
@@ -224,7 +206,7 @@
|
|
};
|
|
};
|
|
|
|
|
|
const beforeUpload: UploadProps['beforeUpload'] = (file) => {
|
|
const beforeUpload: UploadProps['beforeUpload'] = (file) => {
|
|
- console.log('beforeUpload', file);
|
|
|
|
|
|
+ console.log('beforeUpload', file, isAnimation.value);
|
|
const filetype = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
|
|
const filetype = file.name.substring(file.name.lastIndexOf('.') + 1).toLowerCase();
|
|
const isExcel = ['jpg', 'jpg', 'png', 'jpeg', 'mp4', 'wav', 'mp3', 'shp', 'zip'].includes(
|
|
const isExcel = ['jpg', 'jpg', 'png', 'jpeg', 'mp4', 'wav', 'mp3', 'shp', 'zip'].includes(
|
|
filetype,
|
|
filetype,
|
|
@@ -232,12 +214,12 @@
|
|
const isdonghua = ['glb', 'zip'].includes(
|
|
const isdonghua = ['glb', 'zip'].includes(
|
|
filetype,
|
|
filetype,
|
|
);
|
|
);
|
|
- if (!isExcel && isAnimation.value) {
|
|
|
|
|
|
+ if (!isdonghua && isAnimation.value) {
|
|
createMessage.error('支持obj、glb格式文件上传');
|
|
createMessage.error('支持obj、glb格式文件上传');
|
|
fileList.value = [];
|
|
fileList.value = [];
|
|
return Upload.LIST_IGNORE;
|
|
return Upload.LIST_IGNORE;
|
|
}
|
|
}
|
|
- if (!isdonghua && !isAnimation.value) {
|
|
|
|
|
|
+ if (!isExcel && !isAnimation.value) {
|
|
createMessage.error('支持jpg、png、jpeg、mp4、wav、mp3 、shp、zip格式文件上传');
|
|
createMessage.error('支持jpg、png、jpeg、mp4、wav、mp3 、shp、zip格式文件上传');
|
|
fileList.value = [];
|
|
fileList.value = [];
|
|
return Upload.LIST_IGNORE;
|
|
return Upload.LIST_IGNORE;
|