瀏覽代碼

修改审核中的逻辑

lex 8 月之前
父節點
當前提交
47c29c80a7

+ 22 - 15
src/components/col-upload/index.tsx

@@ -220,7 +220,12 @@ export default defineComponent({
                   class={styles.uploadSection}
                 />
               ) : (
-                <div class={styles.uploadFile}>
+                <div
+                  class={[
+                    styles.uploadFile,
+                    this.disabled && 'cursor-not-allowed'
+                  ]}
+                >
                   <ElIcon size={20}>
                     {this.type === 'music' ? (
                       <img src={iconDocument} />
@@ -235,20 +240,22 @@ export default defineComponent({
                     {this.fileName(this.modelValue)}
                   </span>
 
-                  <ElIcon
-                    size={18}
-                    style="margin-right: 0;"
-                    class="ml-1 cursor-pointer"
-                  >
-                    <img
-                      src={iconDelete}
-                      onClick={e => {
-                        e.stopPropagation()
-                        this.$emit('update:modelValue', '')
-                        this.onRemove()
-                      }}
-                    />
-                  </ElIcon>
+                  {!this.disabled && (
+                    <ElIcon
+                      size={18}
+                      style="margin-right: 0;"
+                      class="ml-1 cursor-pointer"
+                    >
+                      <img
+                        src={iconDelete}
+                        onClick={e => {
+                          e.stopPropagation()
+                          this.$emit('update:modelValue', '')
+                          this.onRemove()
+                        }}
+                      />
+                    </ElIcon>
+                  )}
                 </div>
               )
             ) : this.uploadType === 'image' ? (

+ 4 - 3
src/views/user-info/music-class/list.tsx

@@ -138,15 +138,16 @@ export default defineComponent({
                 {this.list.map((item: any) => (
                   <MusicItem
                     onClick={(item: any) => {
-                      if (['PASS', 'DOING'].includes(this.auditStatus)) {
+                      if (['PASS'].includes(this.auditStatus)) {
                         this.$router.push({
                           path: '/muiscDetial',
                           query: { id: item.id }
                         })
                       }
                       if (
-                        this.auditStatus === 'UNPASS' ||
-                        this.auditStatus === 'OUT_SALE'
+                        ['DOING', 'UNPASS', 'OUT_SALE'].includes(
+                          this.auditStatus
+                        )
                       ) {
                         console.log(item)
                         this.$router.push({

+ 37 - 21
src/views/user-info/music-operation/index.tsx

@@ -55,6 +55,7 @@ export default defineComponent({
       reason: '',
       formated: {} as FormatXMLInfo,
       musicSheetAuthRecordId: null as any,
+      auditStatus: '' as any,
       form: {
         musicCover: '',
         accompanimentType: 'HOMEMODE',
@@ -141,6 +142,11 @@ export default defineComponent({
       this.mergeXmlData(this.formated)
     }
   },
+  computed: {
+    auditDisabled(): boolean {
+      return this.auditStatus === 'DOING'
+    }
+  },
   methods: {
     mergeXmlData(data: FormatXMLInfo) {
       this.formated = data
@@ -163,6 +169,8 @@ export default defineComponent({
           '/api-website/open/music/sheet/detail/' + id
         )
         this.musicSheetAuthRecordId = data.musicSheetAuthRecordId // 审核编号
+        this.auditStatus = data.auditStatus // 状态
+
         this.form.playMode = data.audioType || 'MP3'
         this.form.xmlFileUrl = data.xmlFileUrl
         this.form.name = data.musicSheetName
@@ -357,6 +365,7 @@ export default defineComponent({
           model={this.form}
           ref="form"
           class="px-7 py-5"
+          disabled={this.auditDisabled}
         >
           <div class={styles.fAlert}>曲目上传</div>
           <ElFormItem
@@ -385,6 +394,7 @@ export default defineComponent({
                 bucket={'cloud-coach'}
                 accept={'.mp3'}
                 uploadType={'file'}
+                disabled={this.auditDisabled}
                 type="music"
                 btnText="上传伴奏文件"
                 size={8}
@@ -401,6 +411,7 @@ export default defineComponent({
                 v-model:modelValue={this.form.midiFileUrl}
                 bucket={'cloud-coach'}
                 accept={'.midi,.mid'}
+                disabled={this.auditDisabled}
                 uploadType={'file'}
                 type="music"
                 btnText="上传MIDI文件"
@@ -420,6 +431,7 @@ export default defineComponent({
               bucket={'cloud-coach'}
               accept={'application/xml'}
               uploadType={'file'}
+              disabled={this.auditDisabled}
               type="music"
               btnText="上传XML文件"
               extraTips="仅支持XML格式文件,文件最大不能超过8MB"
@@ -477,6 +489,7 @@ export default defineComponent({
                           bucket={'cloud-coach'}
                           accept={'.mp3'}
                           uploadType={'file'}
+                          disabled={this.auditDisabled}
                           class={styles.uploadCon}
                           size={8}
                           type="music"
@@ -552,7 +565,8 @@ export default defineComponent({
               onRemove={() => {
                 this.form.musicCover = ''
               }}
-              delete
+              delete={!this.auditDisabled}
+              disabled={this.auditDisabled}
               domSize={{ height: '150px' }}
               options={{
                 title: '曲谱封面',
@@ -650,26 +664,28 @@ export default defineComponent({
             </>
           )}
         </ElForm>
-        <div class="text-center pt-6 pb-7">
-          <ElButton
-            class="!w-44 !h-[48px]"
-            round
-            onClick={() => {
-              this.$router.back()
-            }}
-          >
-            取消
-          </ElButton>
-          <ElButton
-            type="primary"
-            class="!w-44 !h-[48px]"
-            round
-            onClick={this.onSubmit}
-            loading={this.submitLoading}
-          >
-            提交审核
-          </ElButton>
-        </div>
+        {!this.auditDisabled && (
+          <div class="text-center pt-6 pb-7">
+            <ElButton
+              class="!w-44 !h-[48px]"
+              round
+              onClick={() => {
+                this.$router.back()
+              }}
+            >
+              取消
+            </ElButton>
+            <ElButton
+              type="primary"
+              class="!w-44 !h-[48px]"
+              round
+              onClick={this.onSubmit}
+              loading={this.submitLoading}
+            >
+              提交审核
+            </ElButton>
+          </div>
+        )}
 
         {/* <ElDialog
           modelValue={this.tagStatus}