lex hai 1 ano
pai
achega
b1a34d6059

+ 1 - 1
src/views/natural-resources/components/my-collect/index.tsx

@@ -73,7 +73,7 @@ export default defineComponent({
       <>
         <SearchGroupResources onSearch={(item: any) => onSearch(item)} />
 
-        <NSpin v-model:show={state.loading}>
+        <NSpin v-model:show={state.loading} style={{ 'min-height': '50vh' }}>
           <div class={styles.list}>
             {state.tableList.map((item: any) => {
               const tmpItem = {

+ 0 - 1
src/views/natural-resources/components/my-resources/index.module.less

@@ -4,7 +4,6 @@
   flex-flow: row wrap;
   justify-content: flex-start;
   gap: 22px;
-  min-height: 220px;
 }
 
 .searchGroup {

+ 1 - 1
src/views/natural-resources/components/my-resources/index.tsx

@@ -162,7 +162,7 @@ export default defineComponent({
           onDelete={onDelete}
         />
 
-        <NSpin v-model:show={state.loading}>
+        <NSpin v-model:show={state.loading} style={{ 'min-height': '50vh' }}>
           <div class={styles.list}>
             {state.tableList.map((item: any) => (
               <div class={styles.itemSection}>

+ 1 - 25
src/views/natural-resources/components/my-resources/upload-modal/index.tsx

@@ -126,29 +126,6 @@ export default defineComponent({
       uploadForms.list.splice(index, 1);
     };
 
-    // const getImgBase64 = (url: any) => {
-    //   return new Promise(function (resolve) {
-    //     let dataURL = '';
-    //     const video = document.createElement('video');
-    //     video.currentTime = 1; //指定帧数
-    //     video.setAttribute('crossOrigin', 'anonymous'); //处理跨域
-    //     video.setAttribute('src', url);
-    //     video.setAttribute('width', '100');
-    //     video.setAttribute('height', '100');
-
-    //     video.addEventListener('loadeddata', function () {
-    //       const canvas: any = document.createElement('canvas'),
-    //         width = video.width, //canvas的尺寸和图片一样
-    //         height = video.height;
-    //       canvas.width = width;
-    //       canvas.height = height;
-    //       canvas.getContext('2d').drawImage(video, 0, 0, width, height); //绘制canvas
-    //       dataURL = canvas.toDataURL('image/jpeg'); //转换为base64
-    //       resolve(dataURL);
-    //     });
-    //   });
-    // };
-
     const isUpdate = computed(() => (props.list.length > 0 ? true : false));
 
     onMounted(async () => {
@@ -189,7 +166,7 @@ export default defineComponent({
                   <div class={styles.previewModal}>
                     <NImage
                       class={[styles.titleType]}
-                      src={formatType('MUSIC')}
+                      src={formatType(item.type)}
                       previewDisabled
                       objectFit="cover"
                     />
@@ -271,7 +248,6 @@ export default defineComponent({
                       fixedBox: true
                     }}
                     onFinished={(val: any) => {
-                      console.log(val, 'val');
                       uploadForms.list.push({
                         subjectIds: uploadForms.subjectIds || [],
                         openFlag: true,

+ 25 - 23
src/views/natural-resources/components/my-resources/upload-modal/upload-file.tsx

@@ -1,4 +1,4 @@
-import { NModal, NUpload, UploadFileInfo, useMessage } from 'naive-ui';
+import { NModal, NSpin, NUpload, UploadFileInfo, useMessage } from 'naive-ui';
 import { defineComponent, watch, PropType, reactive, ref } from 'vue';
 import { policy } from '@/components/upload-file/api';
 import Copper from '@/components/upload-file/copper';
@@ -386,28 +386,30 @@ export default defineComponent({
 
     return () => (
       <div class={styles.uploadFile}>
-        <NUpload
-          ref={uploadRef}
-          action={ossUploadUrl}
-          data={state}
-          v-model:fileList={fileListRef.value}
-          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={() => onRemove()}>
-          {props.showType === 'default' && (
-            <div class={styles.uploadBtn}>
-              <img src={iconUploadAdd} class={styles.iconUploadAdd} />
-              <p>上传</p>
-            </div>
-          )}
-          {props.showType === 'custom' && slots.custom && slots.custom()}
-        </NUpload>
+        <NSpin show={btnLoading.value} description="上传中...">
+          <NUpload
+            ref={uploadRef}
+            action={ossUploadUrl}
+            data={state}
+            v-model:fileList={fileListRef.value}
+            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={() => onRemove()}>
+            {props.showType === 'default' && (
+              <div class={styles.uploadBtn}>
+                <img src={iconUploadAdd} class={styles.iconUploadAdd} />
+                <p>上传</p>
+              </div>
+            )}
+            {props.showType === 'custom' && slots.custom && slots.custom()}
+          </NUpload>
+        </NSpin>
 
         <NModal
           v-model:show={visiable.value}

+ 1 - 1
src/views/natural-resources/components/share-resources/index.tsx

@@ -90,7 +90,7 @@ export default defineComponent({
           onAdd={() => (state.teachingStatus = true)}
         />
 
-        <NSpin v-model:show={state.loading}>
+        <NSpin v-model:show={state.loading} style={{ 'min-height': '50vh' }}>
           <div class={styles.list}>
             {state.tableList.map((item: any) => (
               <CardType

+ 2 - 0
src/views/natural-resources/index.module.less

@@ -2,6 +2,7 @@
   padding: 32px 20px;
   background-color: #fff;
   border-radius: 20px;
+  // min-height: calc(100% - 104px);
 
   :global {
     .n-tabs-tab-pad {
@@ -115,6 +116,7 @@
     width: 360px;
     height: 42px;
     font-size: 16px;
+
     :global {
       .n-input-wrapper {
         padding-left: 12px;