Browse Source

移动素材功能 开了个头

任一存 2 years ago
parent
commit
9cb55cde14

+ 5 - 3
packages/qjkankan-editor/src/lang/_en.json

@@ -565,9 +565,7 @@
       "drag_to_cut":"Drag the screen to have a screenshot",
       "cutting":"Screenshot",
       "preview_cover":"View",
-      "rename_material":"Rename the material",
-      "new_folder": "新建文件夹",
-      "new_folder_placeholder": "请输入文件夹名,限15字"
+      "rename_material":"Rename the material"
     }
   },
   "gather": {
@@ -599,7 +597,11 @@
     "audio_fail": "Format error. Support MP3 files: ≤ 20MB",
     "upload_material": "Upload materials",
     "new_folder": "新建文件夹",
+    "new_folder_placeholder": "请输入文件夹名,限15字",
+    "folder_name_already_used": "文件夹已存在",
     "move_folder": "移动",
+    "move_folder_to": "移动到",
+    "no_folder_need_create": "暂无文件夹,请先创建文件夹",
     "video_size": "Support MP4 files: ≤ 200MB",
     "video_limit": "The file is too large.Support MP4 files: ≤ 200MB",
     "video_fail": "Format error. Support MP4 files: ≤ 200MB",

+ 5 - 3
packages/qjkankan-editor/src/lang/_zh.json

@@ -567,9 +567,7 @@
       "drag_to_cut":"拖动画面截取封面",
       "cutting":"截图",
       "preview_cover":"封面预览",
-      "rename_material":"重命名素材",
-      "new_folder": "新建文件夹",
-      "new_folder_placeholder": "请输入文件夹名,限15字"
+      "rename_material":"重命名素材"
     }
   },
   "gather": {
@@ -601,7 +599,11 @@
     "audio_fail": "格式错误,请上传20MB以内、mp3格式的音频",
     "upload_material": "上传素材",
     "new_folder": "新建文件夹",
+    "new_folder_placeholder": "请输入文件夹名,限15字",
+    "folder_name_already_used": "文件夹已存在",
     "move_folder": "移动",
+    "move_folder_to": "移动到",
+    "no_folder_need_create": "暂无文件夹,请先创建文件夹",
     "video_size": "请上传200MB以内、mp4格式的视频",
     "video_limit": "过大,请上传200MB以内、mp4格式的视频",
     "video_fail": "格式错误,请上传200MB以内、mp4格式的视频",

+ 6 - 1
packages/qjkankan-editor/src/views/material/audio/index.vue

@@ -33,7 +33,12 @@
       >
         {{$i18n.t(`gather.new_folder`)}}
       </button>
-      <button class="ui-button cancel">{{$i18n.t(`gather.move_folder`)}}</button>
+      <button
+        class="ui-button cancel"
+        @click="onClickMoveFolder"
+      >
+        {{$i18n.t(`gather.move_folder`)}}
+      </button>
       <div class="filter">
         <div :class="{active: isFilterFocus}" @focusin="onFilterFocus" @focusout="onFilterBlur">
           <i class="iconfont icon-works_search search" ></i>

+ 17 - 6
packages/qjkankan-editor/src/views/material/folderMixinFactory.js

@@ -30,11 +30,6 @@ export default function(materialType) {
       }
     },
     mounted() {
-      getFolderTree({
-        type: materialType,
-      }).then((res) => {
-        this.folderTree = res.data
-      })
       this.getAllFolderInPath()
     },
     watch: {
@@ -74,7 +69,7 @@ export default function(materialType) {
         } else {
           return {
             isValid: false,
-            tip: '文件夹已存在'
+            tip: this.$i18n.t('gather.folder_name_already_used')
           }
         }
       },
@@ -95,6 +90,22 @@ export default function(materialType) {
           }
         )
       },
+      onClickMoveFolder() {
+        console.log('asdfsf');
+        getFolderTree({
+          type: materialType,
+        }).then((res) => {
+          this.folderTree = res.data
+          if (true) {
+            this.$confirm({
+              title: this.$i18n.t('gather.move_folder_to'),
+              content: this.$i18n.t('gather.no_folder_need_create'),
+            })
+          } else {
+  
+          }
+        })
+      },
       onClickPath(idx) {
         this.folderPath = this.folderPath.slice(0, idx + 1)
       },

+ 6 - 1
packages/qjkankan-editor/src/views/material/image/index.vue

@@ -33,7 +33,12 @@
       >
         {{$i18n.t(`gather.new_folder`)}}
       </button>
-      <button class="ui-button cancel">{{$i18n.t(`gather.move_folder`)}}</button>
+      <button
+        class="ui-button cancel"
+        @click="onClickMoveFolder"
+      >
+        {{$i18n.t(`gather.move_folder`)}}
+      </button>
       <div class="filter">
         <div :class="{active: isFilterFocus}" @focusin="onFilterFocus" @focusout="onFilterBlur">
           <i class="iconfont icon-works_search search" ></i>

+ 6 - 1
packages/qjkankan-editor/src/views/material/pano/index.vue

@@ -22,7 +22,12 @@
       >
         {{$i18n.t(`gather.new_folder`)}}
       </button>
-      <button class="ui-button cancel">{{$i18n.t(`gather.move_folder`)}}</button>
+      <button
+        class="ui-button cancel"
+        @click="onClickMoveFolder"
+      >
+        {{$i18n.t(`gather.move_folder`)}}
+      </button>
       <div class="filter">
         <div :class="{ active: isFilterFocus }" @focusin="onFilterFocus" @focusout="onFilterBlur">
           <i class="iconfont icon-works_search search"></i>

+ 2 - 2
packages/qjkankan-editor/src/views/material/popup/CreateFolder.vue

@@ -2,7 +2,7 @@
   <popup>
     <div class="ui-message ui-message-confirm" style="width: 400px">
       <div class="ui-message-header">
-        <span>{{$i18n.t(`material.components.new_folder`)}}</span>
+        <span>{{$i18n.t(`gather.new_folder`)}}</span>
         <span @click="$emit('close')">
           <i class="iconfont icon_close"></i>
         </span>
@@ -15,7 +15,7 @@
           }"
           type="text"
           maxlength="15"
-          :placeholder="$i18n.t(`material.components.new_folder_placeholder`)"
+          :placeholder="$i18n.t(`gather.new_folder_placeholder`)"
           @input="emojistr" v-model="key"
         />
         <div v-if="!validateRes.isValid" class="invalid-tip">

+ 6 - 1
packages/qjkankan-editor/src/views/material/video/index.vue

@@ -33,7 +33,12 @@
       >
         {{$i18n.t(`gather.new_folder`)}}
       </button>
-      <button class="ui-button cancel">{{$i18n.t(`gather.move_folder`)}}</button>
+      <button
+        class="ui-button cancel"
+        @click="onClickMoveFolder"
+      >
+        {{$i18n.t(`gather.move_folder`)}}
+      </button>
       <div class="filter">
           <div :class="{active: isFilterFocus}" @focusin="onFilterFocus" @focusout="onFilterBlur">
             <i class="iconfont icon-works_search search"></i>