tangning 4 mēneši atpakaļ
vecāks
revīzija
33dd623d09

+ 1 - 1
src/views/mediaLibrary/list.vue

@@ -25,7 +25,7 @@
             {
               label: '编辑',
               disabled: !(record.status == 1 || record.status == -2),
-              ifShow: getTypeCheckPerm('scenes-edit'),
+              ifShow: getTypeCheckPerm('scenes-edit') && record.useType != 'animation',
               onClick: handlegotoEdit.bind(null, record),
             },
             {

+ 14 - 32
src/views/mediaLibrary/modal/uploadModal.vue

@@ -99,35 +99,6 @@
       const { createMessage } = useMessage();
       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',
           label: '分组',
           component: 'ApiSelect',
@@ -155,6 +126,16 @@
             xxl: 18,
           },
         },
+        {
+          field: 'file',
+          component: 'InputTextArea',
+          // component: 'Upload',
+          label: t('routes.product.file'),
+          slot: 'file',
+          colProps: {
+            span: 16,
+          },
+        },
       ];
       const [registerForm, { validate, resetFields, setFieldsValue }] = useForm({
         labelWidth: 120,
@@ -168,6 +149,7 @@
       let addListFunc = () => {};
       const [register, { closeModal }] = useModalInner((data) => {
         console.log(data);
+        fileFlow.dictId = null;
         data && onDataReceive(data);
       });
 
@@ -224,7 +206,7 @@
       };
 
       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 isExcel = ['jpg', 'jpg', 'png', 'jpeg', 'mp4', 'wav', 'mp3', 'shp', 'zip'].includes(
           filetype,
@@ -232,12 +214,12 @@
         const isdonghua = ['glb', 'zip'].includes(
           filetype,
         );
-        if (!isExcel && isAnimation.value) {
+        if (!isdonghua && isAnimation.value) {
           createMessage.error('支持obj、glb格式文件上传');
           fileList.value = [];
           return Upload.LIST_IGNORE;
         }
-        if (!isdonghua && !isAnimation.value) {
+        if (!isExcel && !isAnimation.value) {
           createMessage.error('支持jpg、png、jpeg、mp4、wav、mp3 、shp、zip格式文件上传');
           fileList.value = [];
           return Upload.LIST_IGNORE;