Browse Source

Merge branch 'feature/0429-musicV2' into develop

lex 11 months ago
parent
commit
7936e3e3d6

+ 74 - 68
src/components/upload-file/index.tsx

@@ -6,9 +6,9 @@ import {
   UploadFileInfo,
   useMessage
 } from 'naive-ui'
-import {defineComponent, watch, PropType, reactive, ref} from 'vue'
+import { defineComponent, watch, PropType, reactive, ref } from 'vue'
 import Copper from './copper'
-import {getUploadSign, onFileUpload, onOnlyFileUpload} from '@/utils/oss-file-upload'
+import { getUploadSign, onFileUpload, onOnlyFileUpload } from '@/utils/oss-file-upload'
 
 export default defineComponent({
   name: 'upload-file',
@@ -105,8 +105,14 @@ export default defineComponent({
     }
   },
   // readFileInputEventAsArrayBuffer 只会在文件的时间回调
-  emits: ['update:fileList', 'upload:success', 'close', 'readFileInputEventAsArrayBuffer', 'remove'],
-  setup(props, {slots, attrs, emit, expose}) {
+  emits: [
+    'update:fileList',
+    'upload:success',
+    'close',
+    'readFileInputEventAsArrayBuffer',
+    'remove'
+  ],
+  setup(props, { slots, attrs, emit, expose }) {
     const ossUploadUrl = `https://${props.bucketName}.ks3-cn-beijing.ksyuncs.com/`
     const message = useMessage()
     const visiable = ref<boolean>(false)
@@ -124,7 +130,7 @@ export default defineComponent({
 
     const fileListRef = ref<UploadFileInfo[]>([])
     const initFileList = () => {
-      console.log('desc',props.desc)
+      console.log('desc', props.desc)
       if (props.fileList) {
         console.log('downloadUrl', props.fileList)
         const splitName = props.fileList.split('/')
@@ -137,7 +143,7 @@ export default defineComponent({
           }
         ]
       } else if (Array.isArray(props.imageList)) {
-        console.log(Array.isArray(props.imageList), props.imageList, 'Array.isArray(props.imageList)')
+        // console.log(Array.isArray(props.imageList), props.imageList, 'Array.isArray(props.imageList)')
         let list: any = []
         props.imageList.forEach((n: any) => {
           const splitName = n.split('/')
@@ -155,18 +161,18 @@ export default defineComponent({
     }
     initFileList()
     watch(
-        () => props.imageList,
-        () => {
-          initFileList()
-        },
-        {deep: true}
+      () => props.imageList,
+      () => {
+        initFileList()
+      },
+      { deep: true }
     )
     watch(
-        () => props.fileList,
-        () => {
-          console.log('list')
-          initFileList()
-        }
+      () => props.fileList,
+      () => {
+        console.log('list')
+        initFileList()
+      }
     )
     const handleClearFile = () => {
       uploadRef.value?.clear()
@@ -226,7 +232,7 @@ export default defineComponent({
           }
         }
         // const { data } = await policy(obj)
-        const {data} = await getUploadSign(obj)
+        const { data } = await getUploadSign(obj)
 
         state.policy = data.policy
         state.signature = data.signature
@@ -250,19 +256,19 @@ export default defineComponent({
     }
 
     const onCustomRequest = ({
-                               file,
-                               // data,
-                               // headers,
-                               // withCredentials,
-                               action,
-                               onFinish,
-                               onError,
-                               onProgress
-                             }: UploadCustomRequestOptions) => {
+      file,
+      // data,
+      // headers,
+      // withCredentials,
+      action,
+      onFinish,
+      onError,
+      onProgress
+    }: UploadCustomRequestOptions) => {
       const item = state
 
       item.file = file
-      onFileUpload({file, action, data: item, onProgress, onFinish, onError})
+      onFileUpload({ file, action, data: item, onProgress, onFinish, onError })
     }
 
     const onFinish = (options: any) => {
@@ -302,7 +308,7 @@ export default defineComponent({
           }
         }
         // const { data } = await policy(obj)
-        const {data} = await getUploadSign(obj)
+        const { data } = await getUploadSign(obj)
 
         state.policy = data.policy
         state.signature = data.signature
@@ -333,47 +339,47 @@ export default defineComponent({
       }
     }
     return () => (
-        <div>
-          <NUpload
-              ref={uploadRef}
-              action={ossUploadUrl}
-              customRequest={onCustomRequest}
-              data={state}
-              v-model:fileList={fileListRef.value}
-              listType={props.listType}
-              accept={props.accept}
-              multiple={props.multiple}
-              max={props.max}
-              disabled={props.disabled}
-              showFileList={props.showFileList}
-              showPreviewButton
-              onBeforeUpload={(options: any) => onBeforeUpload(options)}
-              onFinish={(options: any) => onFinish(options)}
-              onRemove={(options: any) => onRemove(options)}
-          >
-            {props.listType === 'image' && (
-                <NButton loading={btnLoading.value} type="primary">
-                  {props.text}
-                </NButton>
-            )}
-          </NUpload>
-          {props.tips && <p style="font-size: 13px; color: #666; padding-top: 4px;">{props.tips}</p>}
+      <div>
+        <NUpload
+          ref={uploadRef}
+          action={ossUploadUrl}
+          customRequest={onCustomRequest}
+          data={state}
+          v-model:fileList={fileListRef.value}
+          listType={props.listType}
+          accept={props.accept}
+          multiple={props.multiple}
+          max={props.max}
+          disabled={props.disabled}
+          showFileList={props.showFileList}
+          showPreviewButton
+          onBeforeUpload={(options: any) => onBeforeUpload(options)}
+          onFinish={(options: any) => onFinish(options)}
+          onRemove={(options: any) => onRemove(options)}
+        >
+          {props.listType === 'image' && (
+            <NButton loading={btnLoading.value} type="primary">
+              {props.text}
+            </NButton>
+          )}
+        </NUpload>
+        {props.tips && <p style="font-size: 13px; color: #666; padding-top: 4px;">{props.tips}</p>}
 
-          <NModal
-              v-model:show={visiable.value}
-              preset="dialog"
-              showIcon={false}
-              title="上传图片"
-              style={{width: '800px'}}
-          >
-            {/* @cropper-no="error" @cropper-ok="success" */}
-            <Copper
-                ref={CropperModal}
-                onClose={() => (visiable.value = false)}
-                onCropperOk={cropperOk}
-            />
-          </NModal>
-        </div>
+        <NModal
+          v-model:show={visiable.value}
+          preset="dialog"
+          showIcon={false}
+          title="上传图片"
+          style={{ width: '800px' }}
+        >
+          {/* @cropper-no="error" @cropper-ok="success" */}
+          <Copper
+            ref={CropperModal}
+            onClose={() => (visiable.value = false)}
+            onCropperOk={cropperOk}
+          />
+        </NModal>
+      </div>
     )
   }
 })

+ 3 - 5
src/views/music-library/music-sheet/component/music-list.tsx

@@ -146,11 +146,9 @@ export default defineComponent({
                 <NDescriptionsItem label="分类">
                   <TheTooltip content={row.musicCategoryName} />
                 </NDescriptionsItem>
-                {!row.isAllSubject && (
-                    <NDescriptionsItem label="可用声部">
-                      <TheTooltip content={row.subjectNames}/>
-                    </NDescriptionsItem>
-                )}
+                <NDescriptionsItem label="可用声部">
+                  <TheTooltip content={row.subjectNames}/>
+                </NDescriptionsItem>
                 {/*<NDescriptionsItem label="可用乐器">*/}
                 {/*  <TheTooltip content={row.musicalInstrumentNames} />*/}
                 {/*</NDescriptionsItem>*/}

+ 2 - 2
src/views/music-library/music-sheet/modal/music-create-img.tsx

@@ -60,10 +60,10 @@ export default defineComponent({
         }
         imgs = imgs.filter((item: any) => item.base64)
         if (imgs.length === 3) {
-          message.success('生成成功')
+          message.success('图片生成成功')
           handleUploadImg(imgs)
         } else {
-          message.error('生成失败')
+          message.error('图片生成失败')
         }
         // console.log('🚀 ~ 上传之前', [...imgs])
       }

File diff suppressed because it is too large
+ 391 - 200
src/views/music-library/music-sheet/modal/music-operationV2.tsx


+ 2 - 2
src/views/music-library/music-sheet/modal/musiceBeatTime/index.tsx

@@ -37,11 +37,11 @@ export default defineComponent({
           singTimeList: singBeatTime,
           solmizationTimeList: mingBeatTime
         })
-        message.success('生成成功')
+        message.success('节拍器生成成功')
         emit("close")
       }catch (err){
         console.log('🚀 ~ 音频合成失败', err)
-        message.error('生成失败')
+        message.error('节拍器生成失败')
         emit("close")
       }
     }

+ 1 - 1
vite.config.ts

@@ -21,7 +21,7 @@ function pathResolve(dir: string) {
 // const proxyUrl = 'https://dev.lexiaoya.cn'
 // const proxyUrl = 'http://127.0.0.1:7293/'
 // const proxyUrl = 'https://resource.colexiu.com/'
-const proxyUrl = 'https://dev.resource.colexiu.com'
+const proxyUrl = 'https://test.resource.colexiu.com/'
 // https://test.resource.colexiu.com/
 
 export default ({ command, mode }: ConfigEnv): UserConfig => {

Some files were not shown because too many files changed in this diff