Explorar o código

Merge branch 'iteration-20240912' into jenkins

lex-xin hai 1 mes
pai
achega
cb2c7ee451

+ 4 - 0
src/components/col-upload/index.module.less

@@ -35,6 +35,10 @@
     }
   }
 
+  &.isOnlyUpload {
+    cursor: default;
+  }
+
   .isPreview {
     text-decoration: underline;
     color: #14BC9C;

+ 9 - 3
src/components/col-upload/index.tsx

@@ -64,6 +64,11 @@ export default defineComponent({
     isPreview: {
       type: Boolean,
       default: false
+    },
+    // 只预览
+    isOnlyUpload: {
+      type: Boolean,
+      default: false
     }
   },
   emits: ['preview'],
@@ -196,7 +201,7 @@ export default defineComponent({
     return (
       <div class={[styles.colUpload, 'w-full']}>
         <ElUpload
-          disabled={this.disabled || this.isPreview}
+          disabled={this.disabled || this.isPreview || this.isOnlyUpload}
           action={this.ossUploadUrl}
           data={this.dataObj}
           httpRequest={this.handleSuccess}
@@ -229,7 +234,8 @@ export default defineComponent({
                 <div
                   class={[
                     styles.uploadFile,
-                    this.disabled && 'cursor-not-allowed'
+                    this.disabled && 'cursor-not-allowed',
+                    this.isOnlyUpload && styles.isOnlyUpload,
                   ]}
                   onClick={() => {
                     if(this.isPreview) {
@@ -248,7 +254,7 @@ export default defineComponent({
                     )}
                   </ElIcon>
                   <span
-                    class={["whitespace-nowrap overflow-hidden text-ellipsis flex-1", this.isPreview && styles.isPreview]}
+                    class={["whitespace-nowrap overflow-hidden text-ellipsis flex-1",  this.isPreview && styles.isPreview]}
                     style={{ lineHeight: '1.2' }}
                   >
                     {this.fileName(this.modelValue)}

+ 2 - 0
src/views/user-info/music-operation/index.tsx

@@ -416,6 +416,7 @@ export default defineComponent({
               rules={[{ required: true, message: '请选择MIDI文件' }]}
             >
               <ColUpload
+                isPreview={this.form.midiFileUrl ? true : false}
                 v-model:modelValue={this.form.midiFileUrl}
                 bucket={'cloud-coach'}
                 accept={'.midi,.mid'}
@@ -439,6 +440,7 @@ export default defineComponent({
               bucket={'cloud-coach'}
               accept={'application/xml'}
               uploadType={'file'}
+              isOnlyUpload={this.form.xmlFileUrl ? true : false}
               disabled={this.auditDisabled}
               type="music"
               btnText="上传XML文件"