|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div class="panorama con">
|
|
|
<div class="top">
|
|
|
- <crumbs :list="tablist" />
|
|
|
+ <crumbs :list="folderPath" @click-path="onClickPath" />
|
|
|
</div>
|
|
|
<div class="second-line">
|
|
|
<div class="btn">
|
|
@@ -16,6 +16,13 @@
|
|
|
media-type="image" :limit="120" @file-change="onFileChange"></upload>
|
|
|
</button>
|
|
|
</div>
|
|
|
+ <button
|
|
|
+ class="ui-button submit"
|
|
|
+ @click="isShowNewFolder = true"
|
|
|
+ >
|
|
|
+ {{$i18n.t(`gather.new_folder`)}}
|
|
|
+ </button>
|
|
|
+ <button class="ui-button cancel">{{$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>
|
|
@@ -60,19 +67,49 @@
|
|
|
</i>
|
|
|
</div>
|
|
|
<!-- 图片型单元格 -->
|
|
|
- <div class="img" v-else-if="sub.type == 'image'" @click="previewImage(item)">
|
|
|
+ <div
|
|
|
+ v-else-if="sub.type == 'image' && item.type !== 'dir'"
|
|
|
+ class="img"
|
|
|
+ @click="previewImage(item)"
|
|
|
+ >
|
|
|
<img :src="data + (Number(item.fileSize) > 512 ? $imgsuffix : '')"
|
|
|
alt="" />
|
|
|
</div>
|
|
|
- <span style="cursor: pointer;" @click="previewImage(item)" v-else-if="sub.key == 'name'">{{ data || "-" }}
|
|
|
+ <div
|
|
|
+ v-else-if="sub.type == 'image' && item.type === 'dir'"
|
|
|
+ class="img dir"
|
|
|
+ >
|
|
|
+ <img
|
|
|
+ :src="require('@/assets/images/icons/folder-blue.png')"
|
|
|
+ alt=""
|
|
|
+ @click="onClickFolder(item)"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <span
|
|
|
+ v-else-if="sub.key == 'name' && item.type !== 'dir'"
|
|
|
+ class="textItem"
|
|
|
+ style="cursor: pointer;"
|
|
|
+ @click="previewImage(item)"
|
|
|
+ >
|
|
|
+ {{ data || "-" }}
|
|
|
+ </span>
|
|
|
+ <span
|
|
|
+ v-else-if="sub.key === 'name' && item.type === 'dir'"
|
|
|
+ class="textItem dirName"
|
|
|
+ @click="onClickFolder(item)"
|
|
|
+ >
|
|
|
+ {{ data || "-" }}
|
|
|
</span>
|
|
|
-
|
|
|
<!-- 文字型单元格 -->
|
|
|
- <span v-else>{{ data || "-" }}
|
|
|
+ <span
|
|
|
+ v-else
|
|
|
+ class="textItem"
|
|
|
+ >
|
|
|
+ {{ data || "-" }}
|
|
|
</span>
|
|
|
</div>
|
|
|
</tableList>
|
|
|
- <UploadTaskList class="upload-task-list" fileType="IMAGE" :taskList="uploadListForUI" @cancel-task="onCancelTask">
|
|
|
+ <UploadTaskList class="upload-task-list" fileType="IMAGE" :taskList="uploadListForUI" :targetFolderId="currentFolderId" @cancel-task="onCancelTask">
|
|
|
</UploadTaskList>
|
|
|
<div class="total-number" v-if="list.length !== 0 || hasMoreData">{{ had_load }}</div>
|
|
|
<div class="nodata" v-if="list.length == 0 && !hasMoreData && lastestUsedSearchKey">
|
|
@@ -86,10 +123,30 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <rename v-if="showRename" :item="popupItem" @rename="handleRename" @close="showRename = false" />
|
|
|
- <preview ref="image-previewer" :sceneCodeList="list.map(item => item.sceneCode)"
|
|
|
- :imageTitleList="list.map(item => item.name)" @click-delete="onClickDeleteInPreview" />
|
|
|
- <cover @panocover="handlePanoCover" :item="popupItem" v-if="showCover" @close="showCover = false" />
|
|
|
+ <CreateFolder
|
|
|
+ v-if="isShowNewFolder"
|
|
|
+ :validate=validateNewFolderName
|
|
|
+ @close="isShowNewFolder = false"
|
|
|
+ @submit="onSubmitNewFolder"
|
|
|
+ />
|
|
|
+ <rename
|
|
|
+ v-if="showRename"
|
|
|
+ :item="popupItem"
|
|
|
+ @rename="handleRename"
|
|
|
+ @close="showRename = false"
|
|
|
+ />
|
|
|
+ <preview
|
|
|
+ ref="image-previewer"
|
|
|
+ :sceneCodeList="list.map(item => item.sceneCode)"
|
|
|
+ :imageTitleList="list.map(item => item.name)"
|
|
|
+ @click-delete="onClickDeleteInPreview"
|
|
|
+ />
|
|
|
+ <cover
|
|
|
+ @panocover="handlePanoCover"
|
|
|
+ :item="popupItem"
|
|
|
+ v-if="showCover"
|
|
|
+ @close="showCover = false"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -106,6 +163,8 @@ import { getImgWH, changeByteUnit } from "@/utils/file";
|
|
|
import UploadTaskList from "../components/uploadList1.1.0.vue";
|
|
|
import { debounce } from "@/utils/other.js"
|
|
|
import { mapState } from 'vuex';
|
|
|
+import { i18n } from "@/lang"
|
|
|
+import folderMixinFactory from "../folderMixinFactory.js";
|
|
|
|
|
|
import {
|
|
|
getMaterialList,
|
|
@@ -117,13 +176,15 @@ import {
|
|
|
checkUserSize
|
|
|
} from "@/api";
|
|
|
|
|
|
-import { i18n } from "@/lang"
|
|
|
-
|
|
|
|
|
|
const TYPE = "pano";
|
|
|
const LONG_POLLING_INTERVAL = 5;
|
|
|
+const folderMixin = folderMixinFactory(TYPE)
|
|
|
|
|
|
export default {
|
|
|
+ mixins: [
|
|
|
+ folderMixin,
|
|
|
+ ],
|
|
|
name: 'Pano',
|
|
|
components: {
|
|
|
tableList,
|
|
@@ -155,21 +216,13 @@ export default {
|
|
|
tabHeader: data,
|
|
|
selectedArr: [],
|
|
|
|
|
|
- searchKey: "",
|
|
|
// 因为searchKey的变化经过debounce、异步请求的延时,才会反映到数据列表的变化上,所以是否显示、显示哪种无数据提示,也要等到数据列表变化后,根据数据列表是否为空,以及引发本次变化的那个searchKey瞬时值来决定。本变量就是用来保存那个瞬时值。
|
|
|
lastestUsedSearchKey: '',
|
|
|
isFilterFocus: false,
|
|
|
-
|
|
|
- tablist: [
|
|
|
- {
|
|
|
- name: i18n.t("gather.panorama"),
|
|
|
- id: TYPE,
|
|
|
- },
|
|
|
- ],
|
|
|
+ searchKey: "",
|
|
|
list: [],
|
|
|
hasMoreData: true,
|
|
|
isRequestingMoreData: false,
|
|
|
- uploadList: [],
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -233,7 +286,7 @@ export default {
|
|
|
this.isRequestingMoreData = false
|
|
|
this.hasMoreData = true
|
|
|
this.$refs['table-list'].requestMoreData()
|
|
|
- }, 700, false),
|
|
|
+ }, 700, true),
|
|
|
clearinter() {
|
|
|
this.interval && clearInterval(this.interval);
|
|
|
this.interval = null;
|
|
@@ -457,15 +510,15 @@ export default {
|
|
|
uid: `u_${this.$randomWord(true, 8, 8)}`,
|
|
|
abortHandler: null,
|
|
|
backendId: '',
|
|
|
+ parentFolderId: this.currentFolderId,
|
|
|
};
|
|
|
|
|
|
itemInUploadList.abortHandler = uploadMaterial(
|
|
|
{
|
|
|
- file: eachFile
|
|
|
- },
|
|
|
- {
|
|
|
+ dirId: this.currentFolderId,
|
|
|
+ file: eachFile,
|
|
|
+ tempId: itemInUploadList.uid,
|
|
|
type: TYPE,
|
|
|
- uid: itemInUploadList.uid,
|
|
|
},
|
|
|
(response) => { // 上传成功
|
|
|
itemInUploadList.statusText = i18n.t("gather.cutting")
|
|
@@ -506,6 +559,7 @@ export default {
|
|
|
const lastestUsedSearchKey = this.searchKey
|
|
|
getMaterialList(
|
|
|
{
|
|
|
+ dirId: this.currentFolderId,
|
|
|
pageNum: Math.floor(this.list.length / config.PAGE_SIZE) + 1,
|
|
|
pageSize: config.PAGE_SIZE,
|
|
|
searchKey: this.searchKey,
|
|
@@ -514,7 +568,9 @@ export default {
|
|
|
},
|
|
|
(data) => {
|
|
|
const newData = data.data.list.map((i) => {
|
|
|
- i.fileSize = changeByteUnit(Number(i.fileSize));
|
|
|
+ if (i.type !== 'dir') {
|
|
|
+ i.fileSize = changeByteUnit(Number(i.fileSize));
|
|
|
+ }
|
|
|
i.createTime = i.createTime.substring(0, i.createTime.length - 3)
|
|
|
i.updateTime = i.updateTime.substring(0, i.updateTime.length - 3)
|
|
|
return i;
|