提交 d70d9125 authored 作者: 李忠利's avatar 李忠利
...@@ -60,6 +60,16 @@ export const getFoldTree = (params) => { ...@@ -60,6 +60,16 @@ export const getFoldTree = (params) => {
}) })
} }
// 获取文件目录树by path
export const getFoldTreeByPath = (params) => {
return request({
url: baseUrl + '/file/getfiletreeByPath',
method: 'get',
params
})
}
/** /**
* 单文件操作相关接口 * 单文件操作相关接口
*/ */
......
...@@ -11,4 +11,5 @@ export const verity = params => { ...@@ -11,4 +11,5 @@ export const verity = params => {
method: 'post', method: 'post',
params params
}) })
} }
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1691980701595" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1118" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M896.021502 255.956996 607.897867 255.956996c-17.717453 0-31.994625-14.277171-31.994625-31.994625 0-17.717453 14.277171-31.994625 31.994625-31.994625l287.951621 0c17.717453 0 31.994625 14.277171 31.994625 31.994625C928.016126 241.679825 913.738955 255.956996 896.021502 255.956996z" p-id="1119"></path><path d="M896.021502 415.930119 607.897867 415.930119c-17.717453 0-31.994625-14.277171-31.994625-31.994625s14.277171-31.994625 31.994625-31.994625l287.951621 0c17.717453 0 31.994625 14.277171 31.994625 31.994625S913.738955 415.930119 896.021502 415.930119z" p-id="1120"></path><path d="M896.021502 672.05913 607.897867 672.05913c-17.717453 0-31.994625-14.277171-31.994625-31.994625s14.277171-31.994625 31.994625-31.994625l287.951621 0c17.717453 0 31.994625 14.277171 31.994625 31.994625S913.738955 672.05913 896.021502 672.05913z" p-id="1121"></path><path d="M896.021502 832.032253 607.897867 832.032253c-17.717453 0-31.994625-14.277171-31.994625-31.994625s14.277171-31.994625 31.994625-31.994625l287.951621 0c17.717453 0 31.994625 14.277171 31.994625 31.994625S913.738955 832.032253 896.021502 832.032253z" p-id="1122"></path><path d="M383.935495 479.919368 191.967747 479.919368c-52.980346 0-95.983874-43.003528-95.983874-95.983874L95.983874 191.967747c0-52.980346 43.003528-95.983874 95.983874-95.983874l191.967747 0c52.980346 0 95.983874 43.003528 95.983874 95.983874l0 191.967747C479.919368 436.915841 436.915841 479.919368 383.935495 479.919368zM191.967747 159.973123c-17.545439 0-31.994625 14.449185-31.994625 31.994625l0 191.967747c0 17.545439 14.449185 31.994625 31.994625 31.994625l191.967747 0c17.545439 0 31.994625-14.449185 31.994625-31.994625L415.930119 191.967747c0-17.545439-14.449185-31.994625-31.994625-31.994625L191.967747 159.973123 191.967747 159.973123z" p-id="1123"></path><path d="M383.935495 928.016126 191.967747 928.016126c-52.980346 0-95.983874-43.003528-95.983874-95.983874L95.983874 639.892491c0-52.980346 43.003528-95.983874 95.983874-95.983874l191.967747 0c52.980346 0 95.983874 43.003528 95.983874 95.983874l0 191.967747C479.919368 884.840585 436.915841 928.016126 383.935495 928.016126zM191.967747 607.897867c-17.545439 0-31.994625 14.277171-31.994625 31.994625l0 191.967747c0 17.717453 14.449185 31.994625 31.994625 31.994625l191.967747 0c17.545439 0 31.994625-14.277171 31.994625-31.994625L415.930119 639.892491c0-17.717453-14.449185-31.994625-31.994625-31.994625L191.967747 607.897867 191.967747 607.897867z" p-id="1124"></path></svg>
\ No newline at end of file
<template>
<el-select
v-model="childSelectedValue"
:filterable="remote"
multiple
:loading="loading"
:remote="remote"
:size="size"
:remote-method="remoteMethod"
:clearable="clearable"
@change="handleChange"
@clear="handleClear"
@focus="handleFocus"
:style="{ width: '93%' }"
:placeholder="placeholder"
>
<el-option
v-for="item in optionSource"
:key="item[valueKey]"
:label="item[labelKey]"
:value="item[valueKey]"
>
</el-option>
<!-- {{ optionSource }} -->
<el-pagination
small
layout="prev, pager, next"
@current-change="changeNumber"
:hide-on-single-page="true"
:page-size="paginationOption.pageSize"
:current-page="paginationOption.currentPage"
:pager-count="paginationOption.pagerCount"
:total="paginationOption.total"
>
</el-pagination>
</el-select>
</template>
<script>
export default {
name: "PaginationSelect",
props: {
//此参数只是为了父组件实现 v-model指令接受参数用,子组件中无实际意义
// 在子组件中通过监听childSelectedValue值,来触发 input 事件,实现子父组件数据绑定
value: {
type: String | Array,
default: "",
},
valueKey: {
//传入的option数组中,要作为最终选择项的键值名称
type: String,
},
labelKey: {
//传入的option数组中,要作为显示项的键值名称
type: String,
},
clearable: {
//是否支持清除,默认支持
type: Boolean,
default: true,
},
remote: {
//是否支持远程搜索,默认支持
type: Boolean,
default: false,
},
size: {
//组件尺寸,配置项同select String | medium/small/mini
type: String,
default: "medium",
},
loading: {
//远程数据加载状态显示
type: Boolean,
default: false,
},
placeholder: {
type: String,
default: "选择用户",
},
optionSource: {
//下拉框组件数据源
type: Array,
required: true,
},
paginationOption: {
//分页配置项
type: Object,
default: function () {
return {
pageSize: 5, //每页显示条数 6条刚好
currentPage: 1, //当前页
pagerCount: 5, //按钮数,超过时会折叠
total: 10, //总条数
};
},
},
},
data() {
return {
childSelectedValue: this.value,
};
},
watch: {
//监听子组件中选择的值得变化,每当选择一个项后,触发input事件,
// 将子组件中选择的值通过input事件传递给父组件,实现父组件中v-model绑定的值的双向绑定
childSelectedValue(val) {
this.$emit("input", val);
},
value(val) {
if (val != null && val.length < 1) {
this.childSelectedValue = "";
}
},
},
mounted() {},
methods: {
//子组件分页器,页码选择事件,父组件中监听子组件的 pageNationChange 事件,获取当前页码
changeNumber(val) {
//此处的val是页码
this.$emit("pageNationChange", val);
},
// 远程调用方法,在父组件中实现远程方法
remoteMethod(val) {
if (val != null && val.length > 0) {
//只有输入的字符串长度大于1时,触发
this.$emit("remote-method", val);
} else {
this.childSelectedValue = " ";
}
},
//使组件支持change事件
handleChange(val) {
this.$emit("change", val);
},
//使组件支持clear事件
handleClear(val) {
this.$emit("clear", val);
},
//解决远程搜索无结果时,显示清除按钮问题
handleFocus() {
if (this.childSelectedValue.length < 1) {
this.childSelectedValue = "";
}
},
},
};
</script>
<style scoped></style>
...@@ -12,19 +12,21 @@ ...@@ -12,19 +12,21 @@
@blur="handleInputBlurEnter" @blur="handleInputBlurEnter"
@change="handleInputBlurEnter" @change="handleInputBlurEnter"
></el-input> ></el-input>
<!-- {{ breadCrumbList }} -->
<div <div
class="breadcrumb-box" class="breadcrumb-box"
:class="{ 'able-input': fileType === 0 }" :class="{ 'able-input': fileType === 0 }"
v-show="!isShowInput" v-show="!isShowInput"
@click.self="handleClickBreadCrumbSelf" @click.self="handleClickBreadCrumbSelf"
> >
<el-breadcrumb <!-- <el-breadcrumb
v-if="![0, 8].includes(fileType) && !['Share'].includes($route.name)" v-if="![0, 8].includes(fileType) && !['Share'].includes($route.name)"
separator-class="el-icon-arrow-right" separator-class="el-icon-arrow-right"
> >
<el-breadcrumb-item>{{ fileTypeMap[fileType] }}</el-breadcrumb-item> <el-breadcrumb-item>{{ fileTypeMap[fileType] }}</el-breadcrumb-item>
</el-breadcrumb> </el-breadcrumb> -->
<el-breadcrumb v-else separator-class="el-icon-arrow-right">
<el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item <el-breadcrumb-item
v-for="(item, index) in breadCrumbList" v-for="(item, index) in breadCrumbList"
:key="index" :key="index"
...@@ -66,48 +68,85 @@ export default { ...@@ -66,48 +68,85 @@ export default {
}, },
isShowInput: false, // 是否展示路径输入框 isShowInput: false, // 是否展示路径输入框
inputFilePath: "", // 路径输入 inputFilePath: "", // 路径输入
breadCrumbList: [],
}; };
}, },
watch: {
$route(value) {
// console.log(123, value);
const { filePath } = value.query;
// debugger;
let filePathList = filePath ? filePath.split("/") : [];
let res = []; // 返回结果数组
let _path = []; // 存放祖先路径
for (let i = 0; i < filePathList.length; i++) {
if (filePathList[i]) {
_path.push(filePathList[i]);
res.push({
path: _path.join("/"),
name: filePathList[i],
});
} else if (i === 0) {
// 根目录
filePathList[i] = "";
_path.push(filePathList[i]);
// res.push({
// path: "/",
// name:
// this.fileType === 0
// ? "全部文件"
// : this.fileType === 8
// ? "我的分享"
// : this.$route.name === "Share"
// ? "全部分享"
// : "",
// });
}
}
console.log("res", res);
this.breadCrumbList = res;
},
},
computed: { computed: {
/** /**
* 面包屑导航栏数组 * 面包屑导航栏数组
*/ */
breadCrumbList: { // breadCrumbList: {
get() { // get() {
let filePath = this.$route.query.filePath; // let filePath = this.$route.query.filePath;
let filePathList = filePath ? filePath.split("/") : []; // let filePathList = filePath ? filePath.split("/") : [];
let res = []; // 返回结果数组 // let res = []; // 返回结果数组
let _path = []; // 存放祖先路径 // let _path = []; // 存放祖先路径
for (let i = 0; i < filePathList.length; i++) { // for (let i = 0; i < filePathList.length; i++) {
if (filePathList[i]) { // if (filePathList[i]) {
_path.push(filePathList[i]); // _path.push(filePathList[i]);
res.push({ // res.push({
path: _path.join("/"), // path: _path.join("/"),
name: filePathList[i], // name: filePathList[i],
}); // });
} else if (i === 0) { // } else if (i === 0) {
// 根目录 // // 根目录
filePathList[i] = ""; // filePathList[i] = "";
_path.push(filePathList[i]); // _path.push(filePathList[i]);
res.push({ // res.push({
path: "/", // path: "/",
name: // name:
this.fileType === 0 // this.fileType === 0
? "全部文件" // ? "全部文件"
: this.fileType === 8 // : this.fileType === 8
? "我的分享" // ? "我的分享"
: this.$route.name === "Share" // : this.$route.name === "Share"
? "全部分享" // ? "全部分享"
: "", // : "",
}); // });
} // }
} // }
return res; // return res;
}, // },
set() { // set() {
return []; // return [];
}, // },
}, // },
}, },
methods: { methods: {
/** /**
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<div class="file-table-wrapper"> <div class="file-table-wrapper">
<!-- 文件表格 --> <!-- 文件表格 -->
<el-table <el-table
v-if="fileList.length > 0"
class="file-table" class="file-table"
:class="['file-type-' + fileType, routeName === 'Share' ? 'share' : '']" :class="['file-type-' + fileType, routeName === 'Share' ? 'share' : '']"
ref="multipleTable" ref="multipleTable"
...@@ -41,7 +42,11 @@ ...@@ -41,7 +42,11 @@
:title="`${scope.row.isDir ? '' : '点击预览'}`" :title="`${scope.row.isDir ? '' : '点击预览'}`"
style="width: 30px; max-height: 30px; cursor: pointer" style="width: 30px; max-height: 30px; cursor: pointer"
@click=" @click="
$file.handleFileNameClick(scope.row, scope.$index, sortedFileList) $file.handleFileNameClickNew(
scope.row,
scope.$index,
sortedFileList
)
" "
v-else v-else
/> />
...@@ -60,7 +65,11 @@ ...@@ -60,7 +65,11 @@
<template slot-scope="scope"> <template slot-scope="scope">
<span <span
@click=" @click="
$file.handleFileNameClick(scope.row, scope.$index, sortedFileList) $file.handleFileNameClickNew(
scope.row,
scope.$index,
sortedFileList
)
" "
> >
<span <span
...@@ -114,7 +123,11 @@ ...@@ -114,7 +123,11 @@
:sort-by="['isDir', 'extendName']" :sort-by="['isDir', 'extendName']"
sortable sortable
show-overflow-tooltip show-overflow-tooltip
v-if="selectedColumnList.includes('extendName') && screenWidth > 768" v-if="
selectedColumnList &&
selectedColumnList.includes('extendName') &&
screenWidth > 768
"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ $file.getFileType(scope.row) }}</span> <span>{{ $file.getFileType(scope.row) }}</span>
...@@ -128,7 +141,11 @@ ...@@ -128,7 +141,11 @@
:sort-by="['isDir', 'fileSize']" :sort-by="['isDir', 'fileSize']"
sortable sortable
align="right" align="right"
v-if="selectedColumnList.includes('fileSize') && screenWidth > 768" v-if="
selectedColumnList &&
selectedColumnList.includes('fileSize') &&
screenWidth > 768
"
> >
<template slot-scope="scope"> <template slot-scope="scope">
{{ {{
...@@ -147,6 +164,7 @@ ...@@ -147,6 +164,7 @@
sortable sortable
align="center" align="center"
v-if=" v-if="
selectedColumnList &&
selectedColumnList.includes('uploadTime') && selectedColumnList.includes('uploadTime') &&
![7, 8].includes(fileType) && ![7, 8].includes(fileType) &&
!['Share'].includes(this.routeName) && !['Share'].includes(this.routeName) &&
...@@ -163,6 +181,7 @@ ...@@ -163,6 +181,7 @@
align="center" align="center"
v-if=" v-if="
fileType === 6 && fileType === 6 &&
selectedColumnList &&
selectedColumnList.includes('deleteTime') && selectedColumnList.includes('deleteTime') &&
screenWidth > 768 screenWidth > 768
" "
...@@ -227,6 +246,7 @@ ...@@ -227,6 +246,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-empty v-else> </el-empty>
</div> </div>
</template> </template>
...@@ -281,21 +301,27 @@ export default { ...@@ -281,21 +301,27 @@ export default {
*/ */
filePath() { filePath() {
this.clearSelectedTable(); this.clearSelectedTable();
this.$refs.multipleTable.clearSort(); this.$nextTick(() => {
this.$refs.multipleTable.clearSort();
});
}, },
/** /**
* 文件类型变化时清空表格已选行 * 文件类型变化时清空表格已选行
*/ */
fileType() { fileType() {
this.clearSelectedTable(); this.clearSelectedTable();
this.$refs.multipleTable.clearSort(); this.$nextTick(() => {
this.$refs.multipleTable.clearSort();
});
}, },
/** /**
* 文件列表变化时清空表格已选行 * 文件列表变化时清空表格已选行
*/ */
fileList() { fileList() {
this.clearSelectedTable(); this.clearSelectedTable();
this.$refs.multipleTable.clearSort(); this.$nextTick(() => {
this.$refs.multipleTable.clearSort();
});
this.sortedFileList = this.fileList; this.sortedFileList = this.fileList;
}, },
}, },
...@@ -303,7 +329,7 @@ export default { ...@@ -303,7 +329,7 @@ export default {
/** /**
* 当表格的排序条件发生变化的时候会触发该事件 * 当表格的排序条件发生变化的时候会触发该事件
*/ */
handleSortChange() { handleSortChange() {
this.sortedFileList = this.$refs.multipleTable.tableData; this.sortedFileList = this.$refs.multipleTable.tableData;
}, },
...@@ -320,14 +346,19 @@ export default { ...@@ -320,14 +346,19 @@ export default {
// xs 以上的屏幕 // xs 以上的屏幕
if (this.screenWidth > 768) { if (this.screenWidth > 768) {
event.preventDefault(); event.preventDefault();
this.$refs.multipleTable.setCurrentRow(row); // 选中当前行 this.$nextTick(() => {
this.$refs.multipleTable.setCurrentRow(row); // 选中当前行
});
this.$openBox this.$openBox
.contextMenu({ .contextMenu({
selectedFile: row, selectedFile: row,
domEvent: event, domEvent: event,
}) })
.then((res) => { .then((res) => {
this.$refs.multipleTable.setCurrentRow(); // 取消当前选中行 this.$nextTick(() => {
this.$refs.multipleTable.setCurrentRow(row); // 选中当前行
});
if (res === "confirm") { if (res === "confirm") {
this.$emit("getTableDataByType"); // 刷新文件列表 this.$emit("getTableDataByType"); // 刷新文件列表
// this.$store.dispatch("showStorage"); // 刷新存储容量 // this.$store.dispatch("showStorage"); // 刷新存储容量
...@@ -340,7 +371,10 @@ export default { ...@@ -340,7 +371,10 @@ export default {
* @description 用于父组件调用 | 本组件调用,请勿删除 * @description 用于父组件调用 | 本组件调用,请勿删除
*/ */
clearSelectedTable() { clearSelectedTable() {
this.$refs.multipleTable.clearSelection(); this.$nextTick(() => {
console.log("this.$refs.multipleTable", this.$refs.multipleTable);
this.$refs.multipleTable.clearSelection();
});
}, },
/** /**
* 表格选择项发生变化时的回调函数 * 表格选择项发生变化时的回调函数
...@@ -364,7 +398,9 @@ export default { ...@@ -364,7 +398,9 @@ export default {
domEvent: event, domEvent: event,
}) })
.then((res) => { .then((res) => {
this.$refs.multipleTable.setCurrentRow(); // 取消当前选中行 this.$nextTick(() => {
this.$refs.multipleTable.setCurrentRow(row); // 选中当前行
});
if (res === "confirm") { if (res === "confirm") {
this.$emit("getTableDataByType"); // 刷新文件列表 this.$emit("getTableDataByType"); // 刷新文件列表
// this.$store.dispatch("showStorage"); // 刷新存储容量 // this.$store.dispatch("showStorage"); // 刷新存储容量
...@@ -381,11 +417,11 @@ export default { ...@@ -381,11 +417,11 @@ export default {
.file-table-wrapper { .file-table-wrapper {
margin-top: 2px; margin-top: 2px;
height: calc(100vh - 262px) !important;
.file-type-0 { .file-type-0 {
height: calc(100vh - 206px) !important; // height: calc(100vh - 206px) !important;
>>> .el-table__body-wrapper { ::v-deep .el-table__body-wrapper {
height: calc(100vh - 262px) !important; height: calc(100vh - 262px) !important;
} }
} }
...@@ -393,7 +429,7 @@ export default { ...@@ -393,7 +429,7 @@ export default {
.file-type-6 { .file-type-6 {
height: calc(100vh - 211px) !important; height: calc(100vh - 211px) !important;
>>> .el-table__body-wrapper { ::v-deep .el-table__body-wrapper {
height: calc(100vh - 263px) !important; height: calc(100vh - 263px) !important;
} }
} }
...@@ -401,16 +437,16 @@ export default { ...@@ -401,16 +437,16 @@ export default {
.file-table.share { .file-table.share {
height: calc(100vh - 109px) !important; height: calc(100vh - 109px) !important;
>>> .el-table__body-wrapper { ::v-deep .el-table__body-wrapper {
height: calc(100vh - 161px) !important; height: calc(100vh - 161px) !important;
} }
} }
.file-table { .file-table {
width: 100% !important; width: 100% !important;
height: calc(100vh - 203px); height: calc(100vh - 290px);
>>> .el-table__header-wrapper { ::v-deep .el-table__header-wrapper {
th { th {
// background: $tabBackColor; // background: $tabBackColor;
padding: 4px 0; padding: 4px 0;
...@@ -429,7 +465,7 @@ export default { ...@@ -429,7 +465,7 @@ export default {
} }
} }
>>> .el-table__body-wrapper { ::v-deep .el-table__body-wrapper {
height: calc(100vh - 255px); height: calc(100vh - 255px);
overflow-y: auto; overflow-y: auto;
// setScrollbar(6px, transparent, #C0C4CC); // setScrollbar(6px, transparent, #C0C4CC);
......
...@@ -323,7 +323,7 @@ export default { ...@@ -323,7 +323,7 @@ export default {
} }
} }
>>> .el-menu { ::v-deep .el-menu {
background: transparent; background: transparent;
} }
...@@ -357,7 +357,7 @@ export default { ...@@ -357,7 +357,7 @@ export default {
.storage-wrapper.fold { .storage-wrapper.fold {
padding: 0; padding: 0;
>>> .el-progress--circle { ::v-deep .el-progress--circle {
margin: 0 auto; margin: 0 auto;
width: 32px; width: 32px;
display: block; display: block;
...@@ -409,7 +409,7 @@ export default { ...@@ -409,7 +409,7 @@ export default {
// box-shadow: 0 4px 12px 0 $BorderExtralight; // box-shadow: 0 4px 12px 0 $BorderExtralight;
// } // }
// } // }
// >>> .el-menu { // ::v-deep .el-menu {
// background: transparent; // background: transparent;
// } // }
// // 对展开状态下的菜单设置宽度 // // 对展开状态下的菜单设置宽度
...@@ -440,7 +440,7 @@ export default { ...@@ -440,7 +440,7 @@ export default {
// } // }
// .storage-wrapper.fold { // .storage-wrapper.fold {
// padding: 0; // padding: 0;
// >>> .el-progress--circle { // ::v-deep .el-progress--circle {
// margin: 0 auto; // margin: 0 auto;
// width: 32px; // width: 32px;
// display: block; // display: block;
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
:filePath="filePath" :filePath="filePath"
:fileList="fileList" :fileList="fileList"
:loading.sync="loading" :loading.sync="loading"
v-if="fileModel === 0" v-if="fileModel == 0"
@getTableDataByType="getTableDataByType" @getTableDataByType="getTableDataByType"
@click.native.right="handleClickRight" @click.native.right="handleClickRight"
></FileTable> ></FileTable>
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
:filePath="filePath" :filePath="filePath"
:fileList="fileList" :fileList="fileList"
:loading="loading" :loading="loading"
v-if="fileModel === 1" v-if="fileModel == 1"
@getTableDataByType="getTableDataByType" @getTableDataByType="getTableDataByType"
@click.native.right="handleClickRight" @click.native.right="handleClickRight"
></FileGrid> ></FileGrid>
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
@click.native.right="handleClickRight" @click.native.right="handleClickRight"
></FileTimeLine> ></FileTimeLine>
<div class="pagination-wrapper"> <div class="pagination-wrapper">
<div class="current-page-count">当前页{{ this.fileList.length }}</div> <div class="current-page-count">当前页{{ fileList.length }}</div>
<!-- 回收站不展示分页组件 --> <!-- 回收站不展示分页组件 -->
<el-pagination <el-pagination
:current-page="pageData.currentPage" :current-page="pageData.currentPage"
...@@ -104,6 +104,7 @@ export default { ...@@ -104,6 +104,7 @@ export default {
pageCount: 50, pageCount: 50,
total: 0, total: 0,
}, },
searchFileName: "", //当前搜索的文件名称,支持文件名和文件夹名
}; };
}, },
computed: { computed: {
...@@ -115,7 +116,9 @@ export default { ...@@ -115,7 +116,9 @@ export default {
}, },
// 当前所在路径 // 当前所在路径
filePath() { filePath() {
return this.$route.query.filePath ? this.$route.query.filePath : "/我的创作"; return this.$route.query.filePath
? this.$route.query.filePath
: "/我的创作";
}, },
// 文件查看模式 0列表模式 1网格模式 2 时间线模式 // 文件查看模式 0列表模式 1网格模式 2 时间线模式
fileModel() { fileModel() {
...@@ -128,11 +131,14 @@ export default { ...@@ -128,11 +131,14 @@ export default {
}, },
watch: { watch: {
filePath() { filePath() {
// debugger;
// 当左侧菜单选择“全部”或“我的分享”,文件路径发生变化时,再重新获取文件列表 // 当左侧菜单选择“全部”或“我的分享”,文件路径发生变化时,再重新获取文件列表
if (this.$route.name === "File" && [0, 8].includes(this.fileType)) { // if (this.$route.name === "File" && [0, 8].includes(this.fileType)) {
this.setPageCount(); // this.setPageCount();
this.getTableDataByType(); // this.getTableDataByType();
} // }
this.setPageCount();
this.getTableDataByType();
}, },
fileType() { fileType() {
if (this.$route.name === "File") { if (this.$route.name === "File") {
...@@ -144,6 +150,12 @@ export default { ...@@ -144,6 +150,12 @@ export default {
fileModel() { fileModel() {
this.setPageCount(); this.setPageCount();
}, },
// 监听搜索文件
searchFileName() {
console.log("searchFileName");
this.setPageCount();
this.getTableDataByType();
},
}, },
created() { created() {
this.setPageCount(); this.setPageCount();
...@@ -189,7 +201,7 @@ export default { ...@@ -189,7 +201,7 @@ export default {
*/ */
getTableDataByType() { getTableDataByType() {
this.loading = true; this.loading = true;
console.log("type:",this.fileType) console.log("type:", this.fileType);
// 分类型 // 分类型
if (Number(this.fileType)) { if (Number(this.fileType)) {
switch (Number(this.fileType)) { switch (Number(this.fileType)) {
...@@ -228,18 +240,20 @@ export default { ...@@ -228,18 +240,20 @@ export default {
* 表格数据获取相关事件 | 获取当前路径下的文件列表 * 表格数据获取相关事件 | 获取当前路径下的文件列表
*/ */
showFileList() { showFileList() {
console.log("showFileList");
let data = { let data = {
fileType: this.fileType, fileType: this.fileType,
filePath: this.filePath, filePath: this.filePath,
currentPage: this.pageData.currentPage, currentPage: this.pageData.currentPage,
pageCount: this.pageData.pageCount, pageCount: this.pageData.pageCount,
fileName: this.searchFileName,
}; };
const params = new URLSearchParams(); const params = new URLSearchParams();
for (const key in data) { for (const key in data) {
params.append(key, data[key]); params.append(key, data[key]);
} }
getFileListByPath(params).then((res) => { getFileListByPath(params).then((res) => {
if (res.code==200) { if (res.code == 200) {
this.fileList = res.data.records; this.fileList = res.data.records;
this.pageData.total = res.data.total; this.pageData.total = res.data.total;
this.loading = false; this.loading = false;
...@@ -278,22 +292,25 @@ export default { ...@@ -278,22 +292,25 @@ export default {
/** /**
* 表格数据获取相关事件 | 获取我的创作文件列表 * 表格数据获取相关事件 | 获取我的创作文件列表
*/ */
showMyCreateFile() { showMyCreateFile() {
console.log("showMyCreateFile");
let data = { let data = {
fileType: this.fileType, fileType: this.fileType,
filePath: this.filePath, filePath: this.filePath,
currentPage: this.pageData.currentPage, currentPage: this.pageData.currentPage,
pageCount: this.pageData.pageCount, pageCount: this.pageData.pageCount,
fileName: this.searchFileName,
}; };
const params = new URLSearchParams(); const params = new URLSearchParams();
for (const key in data) { for (const key in data) {
params.append(key, data[key]); params.append(key, data[key]);
} }
getFileListByPath(params).then((res) => { getFileListByPath(params).then((res) => {
if (res.code==200) { if (res.code == 200) {
this.fileList = res.data.records; this.fileList = res.data.records;
this.pageData.total = res.data.total; this.pageData.total = res.data.total;
this.loading = false; this.loading = false;
console.log("200");
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
...@@ -302,49 +319,51 @@ export default { ...@@ -302,49 +319,51 @@ export default {
/** /**
* 表格数据获取相关事件 | 获取我的收藏文件列表 * 表格数据获取相关事件 | 获取我的收藏文件列表
*/ */
showMyFavoriteFile() { showMyFavoriteFile() {
let data = { let data = {
fileType: this.fileType, fileType: this.fileType,
filePath: this.filePath, filePath: this.filePath,
currentPage: this.pageData.currentPage, currentPage: this.pageData.currentPage,
pageCount: this.pageData.pageCount, pageCount: this.pageData.pageCount,
fileName: this.searchFileName,
}; };
const params = new URLSearchParams(); const params = new URLSearchParams();
for (const key in data) { for (const key in data) {
params.append(key, data[key]); params.append(key, data[key]);
} }
getFileListByPath(params).then((res) => { getFileListByPath(params).then((res) => {
if (res.code==200) { if (res.code == 200) {
this.fileList = res.data.records; this.fileList = res.data.records;
this.pageData.total = res.data.total; this.pageData.total = res.data.total;
this.loading = false;
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
this.loading = false;
}); });
}, },
/** /**
* 表格数据获取相关事件 | 获取我的笔记文件列表 * 表格数据获取相关事件 | 获取我的笔记文件列表
*/ */
showMyNoteFile() { showMyNoteFile() {
let data = { let data = {
fileType: this.fileType, fileType: this.fileType,
filePath: this.filePath, filePath: this.filePath,
currentPage: this.pageData.currentPage, currentPage: this.pageData.currentPage,
pageCount: this.pageData.pageCount, pageCount: this.pageData.pageCount,
fileName: this.searchFileName,
}; };
const params = new URLSearchParams(); const params = new URLSearchParams();
for (const key in data) { for (const key in data) {
params.append(key, data[key]); params.append(key, data[key]);
} }
getFileListByPath(params).then((res) => { getFileListByPath(params).then((res) => {
if (res.code==200) { if (res.code == 200) {
this.fileList = res.data.records; this.fileList = res.data.records;
this.pageData.total = res.data.total; this.pageData.total = res.data.total;
this.loading = false;
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
this.loading = false;
}); });
}, },
/** /**
...@@ -358,13 +377,13 @@ export default { ...@@ -358,13 +377,13 @@ export default {
pageCount: this.pageData.pageCount, pageCount: this.pageData.pageCount,
}; };
getMyShareFileList(data).then((res) => { getMyShareFileList(data).then((res) => {
if (res.code==200) { if (res.code == 200) {
this.fileList = res.data.records; this.fileList = res.data.records;
this.pageData.total = Number(res.data.total); this.pageData.total = Number(res.data.total);
this.loading = false;
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }
this.loading = false;
}); });
}, },
/** /**
...@@ -378,7 +397,7 @@ export default { ...@@ -378,7 +397,7 @@ export default {
pageCount: this.pageData.pageCount, pageCount: this.pageData.pageCount,
}; };
getFileListByType(data).then((res) => { getFileListByType(data).then((res) => {
if (res.code==200) { if (res.code == 200) {
this.fileList = res.data.records; this.fileList = res.data.records;
this.pageData.total = Number(res.data.total); this.pageData.total = Number(res.data.total);
this.loading = false; this.loading = false;
...@@ -393,20 +412,21 @@ export default { ...@@ -393,20 +412,21 @@ export default {
* @param {string} fileName 文件名称 * @param {string} fileName 文件名称
*/ */
getSearchFileList(fileName) { getSearchFileList(fileName) {
this.loading = true; // this.loading = true;
searchFile({ this.searchFileName = fileName;
currentPage: this.pageData.currentPage, // searchFile({
pageCount: this.pageData.pageCount, // currentPage: this.pageData.currentPage,
fileName: fileName, // pageCount: this.pageData.pageCount,
}).then((res) => { // fileName: fileName,
this.loading = false; // }).then((res) => {
if (res.code==200) { // this.loading = false;
this.fileList = res.data.records; // if (res.code == 200) {
this.pageData.total = res.data.total; // this.fileList = res.data.records;
} else { // this.pageData.total = res.data.total;
this.$message.error(res.msg); // } else {
} // this.$message.error(res.msg);
}); // }
// });
}, },
}, },
}; };
...@@ -427,10 +447,11 @@ export default { ...@@ -427,10 +447,11 @@ export default {
.pagination-wrapper { .pagination-wrapper {
position: relative; position: relative;
border-top: 1px solid $BorderBase; // border-top: 1px solid $BorderBase;
height: 44px; height: 44px;
line-height: 44px; line-height: 44px;
text-align: center; text-align: center;
padding-top: 10px;
.current-page-count { .current-page-count {
position: absolute; position: absolute;
......
...@@ -344,7 +344,7 @@ export default { ...@@ -344,7 +344,7 @@ export default {
getFileDetail({ userFileId: this.activeFileObj.userFileId }) getFileDetail({ userFileId: this.activeFileObj.userFileId })
.then((res) => { .then((res) => {
this.loading = false; this.loading = false;
if (res.success) { if (res.code == 200) {
this.audioInfo = { this.audioInfo = {
...res.data.music, ...res.data.music,
duration: res.data.music.trackLength, duration: res.data.music.trackLength,
...@@ -806,7 +806,7 @@ export default { ...@@ -806,7 +806,7 @@ export default {
margin-right: 16px; margin-right: 16px;
flex: 1; flex: 1;
>>> .el-slider__runway { ::v-deep .el-slider__runway {
height: 2px; height: 2px;
.el-slider__button-wrapper { .el-slider__button-wrapper {
...@@ -1072,7 +1072,7 @@ export default { ...@@ -1072,7 +1072,7 @@ export default {
// .progress-bar { // .progress-bar {
// margin-right: 16px; // margin-right: 16px;
// flex: 1; // flex: 1;
// >>> .el-slider__runway { // ::v-deep .el-slider__runway {
// height: 2px; // height: 2px;
// .el-slider__button-wrapper { // .el-slider__button-wrapper {
// top: -17px; // top: -17px;
...@@ -1118,7 +1118,7 @@ export default { ...@@ -1118,7 +1118,7 @@ export default {
// } // }
// .volume-bar { // .volume-bar {
// width: 100px; // width: 100px;
// >>> .el-slider__runway { // ::v-deep .el-slider__runway {
// height: 2px; // height: 2px;
// .el-slider__button-wrapper { // .el-slider__button-wrapper {
// top: -19px; // top: -19px;
......
...@@ -260,7 +260,7 @@ export default { ...@@ -260,7 +260,7 @@ export default {
}) })
.then((res) => { .then((res) => {
this.codeMirrorLoading = false; this.codeMirrorLoading = false;
if (res.success) { if (res.code == 200) {
this.$message.success("已保存"); this.$message.success("已保存");
this.getCodeText(); this.getCodeText();
} else { } else {
...@@ -403,7 +403,7 @@ export default { ...@@ -403,7 +403,7 @@ export default {
.editor-set-form { .editor-set-form {
flex: 1; flex: 1;
text-align: right; text-align: right;
>>> .el-form-item { ::v-deep .el-form-item {
margin-bottom: 0; margin-bottom: 0;
&.font-size { &.font-size {
.el-form-item__content { .el-form-item__content {
...@@ -431,7 +431,7 @@ export default { ...@@ -431,7 +431,7 @@ export default {
} }
.code-editor { .code-editor {
height: calc(100vh - 129px); height: calc(100vh - 129px);
>>> .CodeMirror { ::v-deep .CodeMirror {
border-radius: 0 0 8px 8px; border-radius: 0 0 8px 8px;
height: inherit; height: inherit;
font-size: inherit; font-size: inherit;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
> >
<li <li
class="right-menu-item" class="right-menu-item"
@click="$file.handleFileNameClick(selectedFile, 0, [selectedFile])" @click="$file.handleFileNameClickNew(selectedFile, 0, [selectedFile])"
v-if="seeBtnShow" v-if="seeBtnShow"
> >
<i class="el-icon-view"></i> 查看 <i class="el-icon-view"></i> 查看
......
...@@ -420,7 +420,7 @@ export default { ...@@ -420,7 +420,7 @@ export default {
width: 100px; width: 100px;
display: flex; display: flex;
>>> .el-input-number { ::v-deep .el-input-number {
width: 40px; width: 40px;
.el-input-number__decrease, .el-input-number__decrease,
...@@ -569,7 +569,7 @@ export default { ...@@ -569,7 +569,7 @@ export default {
width: 600px; width: 600px;
display: flex; display: flex;
>>> .el-slider { ::v-deep .el-slider {
flex: 1; flex: 1;
.el-slider__bar { .el-slider__bar {
......
...@@ -213,7 +213,7 @@ export default { ...@@ -213,7 +213,7 @@ export default {
}) })
.then((res) => { .then((res) => {
this.markdownLoading = false; this.markdownLoading = false;
if (res.success) { if (res.code == 200) {
this.$message.success("已保存"); this.$message.success("已保存");
this.getMarkdownText(); this.getMarkdownText();
} else { } else {
...@@ -330,7 +330,7 @@ export default { ...@@ -330,7 +330,7 @@ export default {
} }
} }
>>> .v-note-wrapper { ::v-deep .v-note-wrapper {
box-shadow: none !important; box-shadow: none !important;
border: 1px solid $BorderBase; border: 1px solid $BorderBase;
.v-note-op { .v-note-op {
...@@ -357,7 +357,7 @@ export default { ...@@ -357,7 +357,7 @@ export default {
} }
} }
} }
>>> .v-note-wrapper:not(.fullscreen) { ::v-deep .v-note-wrapper:not(.fullscreen) {
margin: 56px auto 0 auto; margin: 56px auto 0 auto;
width: 90vw; width: 90vw;
height: calc(100vh - 80px); height: calc(100vh - 80px);
......
...@@ -531,7 +531,7 @@ export default { ...@@ -531,7 +531,7 @@ export default {
flex: 1; flex: 1;
text-align: right; text-align: right;
>>> .el-button--text { ::v-deep .el-button--text {
color: $PrimaryText; color: $PrimaryText;
i[class^="el-icon-"] { i[class^="el-icon-"] {
...@@ -566,7 +566,7 @@ export default { ...@@ -566,7 +566,7 @@ export default {
position: relative; position: relative;
background-color: #fff; background-color: #fff;
>>> .uploader-file { ::v-deep .uploader-file {
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
...@@ -599,7 +599,7 @@ export default { ...@@ -599,7 +599,7 @@ export default {
} }
} }
>>> .uploader-file[status="success"] { ::v-deep .uploader-file[status="success"] {
.uploader-file-progress { .uploader-file-progress {
border: none; border: none;
} }
...@@ -607,7 +607,7 @@ export default { ...@@ -607,7 +607,7 @@ export default {
} }
.file-item.custom-status-item { .file-item.custom-status-item {
>>> .uploader-file-status { ::v-deep .uploader-file-status {
visibility: hidden; visibility: hidden;
} }
......
...@@ -76,7 +76,7 @@ export default { ...@@ -76,7 +76,7 @@ export default {
color: $Primary; color: $Primary;
// 播放按钮 // 播放按钮
>>> .vjs-big-play-button { ::v-deep .vjs-big-play-button {
border-radius: 50%; border-radius: 50%;
border: 6px solid $Primary; border: 6px solid $Primary;
left: calc(50% - 1em); left: calc(50% - 1em);
...@@ -94,14 +94,14 @@ export default { ...@@ -94,14 +94,14 @@ export default {
} }
} }
// 改变各种“条”的颜色 // 改变各种“条”的颜色
>>> .vjs-volume-level, ::v-deep .vjs-volume-level,
>>> .vjs-play-progress, ::v-deep .vjs-play-progress,
>>> .vjs-slider-bar { ::v-deep .vjs-slider-bar {
background: $Primary; background: $Primary;
} }
// 控制条按钮的大小 // 控制条按钮的大小
>>> .vjs-control-bar { ::v-deep .vjs-control-bar {
font-size: 14px; font-size: 14px;
} }
} }
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
:title="$file.getFileNameComplete(item)" :title="$file.getFileNameComplete(item)"
:style="`width: ${gridSize + 40}px; `" :style="`width: ${gridSize + 40}px; `"
:class="item.userFileId === selectedFile.userFileId ? 'active' : ''" :class="item.userFileId === selectedFile.userFileId ? 'active' : ''"
@click="$file.handleFileNameClick(item, index, fileListSorted)" @click="$file.handleFileNameClickNew(item, index, fileListSorted)"
@contextmenu.prevent="handleContextMenu(item, index, $event)" @contextmenu.prevent="handleContextMenu(item, index, $event)"
> >
<video <video
...@@ -184,6 +184,137 @@ export default { ...@@ -184,6 +184,137 @@ export default {
@import "@/assets/styles/varibles.scss"; @import "@/assets/styles/varibles.scss";
// .file-grid-wrapper {
// border-top: 1px solid $BorderBase;
// .file-list {
// height: calc(100vh - 206px);
// overflow-y: auto;
// display: flex;
// flex-wrap: wrap;
// align-items: flex-start;
// align-content: flex-start;
// list-style: none;
// @include setScrollbar(6px, transparent, #c0c4cc);
// .file-item {
// margin: 0 16px 16px 0;
// position: relative;
// padding: 8px;
// text-align: center;
// cursor: pointer;
// z-index: 1;
// &:hover {
// background: $tabBackColor;
// .file-name {
// font-weight: 550;
// }
// }
// .file-name {
// margin-top: 8px;
// height: 44px;
// line-height: 22px;
// font-size: 12px;
// word-break: break-all;
// @include setEllipsis(2);
// ::v-deep .keyword {
// color: $Danger;
// }
// }
// .file-checked-wrapper {
// position: absolute;
// top: 0;
// left: 0;
// z-index: 2;
// background: rgba(245, 247, 250, 0.5);
// width: 100%;
// height: 100%;
// .file-checked {
// position: absolute;
// top: 16px;
// left: 24px;
// }
// }
// &.checked {
// .file-checked-wrapper {
// background: rgba(245, 247, 250, 0);
// }
// }
// &.active {
// background: $tabBackColor;
// }
// }
// }
// .right-menu-list {
// position: fixed;
// display: flex;
// flex-direction: column;
// background: #fff;
// border: 1px solid $BorderLighter;
// border-radius: 4px;
// box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
// z-index: 2;
// padding: 4px 0;
// color: $RegularText;
// .right-menu-item,
// .unzip-item {
// padding: 0 16px;
// height: 36px;
// line-height: 36px;
// cursor: pointer;
// &:hover {
// background: $PrimaryHover;
// color: $Primary;
// }
// i {
// margin-right: 8px;
// }
// }
// .unzip-menu-item {
// position: relative;
// &:hover {
// .unzip-list {
// display: block;
// }
// }
// .unzip-list {
// position: absolute;
// display: none;
// .unzip-item {
// width: 200px;
// @include setEllipsis(1);
// }
// }
// }
// }
// .right-menu-list,
// .unzip-list {
// background: #fff;
// border: 1px solid $BorderLighter;
// border-radius: 4px;
// box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
// z-index: 2;
// padding: 4px 0;
// color: $RegularText;
// }
// }
.file-grid-wrapper { .file-grid-wrapper {
border-top: 1px solid $BorderBase; border-top: 1px solid $BorderBase;
...@@ -220,7 +351,7 @@ export default { ...@@ -220,7 +351,7 @@ export default {
font-size: 12px; font-size: 12px;
word-break: break-all; word-break: break-all;
@include setEllipsis(2); @include setEllipsis(2);
>>> .keyword { ::v-deep .keyword {
color: $Danger; color: $Danger;
} }
} }
...@@ -241,16 +372,13 @@ export default { ...@@ -241,16 +372,13 @@ export default {
} }
} }
&.checked { .file-checked-wrapper.checked {
.file-checked-wrapper { background: rgba(245, 247, 250, 0);
background: rgba(245, 247, 250, 0);
}
}
&.active {
background: $tabBackColor;
} }
} }
.file-item.active {
background: $tabBackColor;
}
} }
.right-menu-list { .right-menu-list {
...@@ -271,12 +399,10 @@ export default { ...@@ -271,12 +399,10 @@ export default {
height: 36px; height: 36px;
line-height: 36px; line-height: 36px;
cursor: pointer; cursor: pointer;
&:hover { &:hover {
background: $PrimaryHover; background: $PrimaryHover;
color: $Primary; color: $Primary;
} }
i { i {
margin-right: 8px; margin-right: 8px;
} }
...@@ -284,17 +410,14 @@ export default { ...@@ -284,17 +410,14 @@ export default {
.unzip-menu-item { .unzip-menu-item {
position: relative; position: relative;
&:hover { &:hover {
.unzip-list { .unzip-list {
display: block; display: block;
} }
} }
.unzip-list { .unzip-list {
position: absolute; position: absolute;
display: none; display: none;
.unzip-item { .unzip-item {
width: 200px; width: 200px;
@include setEllipsis(1); @include setEllipsis(1);
...@@ -302,7 +425,6 @@ export default { ...@@ -302,7 +425,6 @@ export default {
} }
} }
} }
.right-menu-list, .right-menu-list,
.unzip-list { .unzip-list {
background: #fff; background: #fff;
...@@ -314,126 +436,4 @@ export default { ...@@ -314,126 +436,4 @@ export default {
color: $RegularText; color: $RegularText;
} }
} }
// .file-grid-wrapper {
// border-top: 1px solid $BorderBase;
// .file-list {
// height: calc(100vh - 206px);
// overflow-y: auto;
// display: flex;
// flex-wrap: wrap;
// align-items: flex-start;
// align-content: flex-start;
// list-style: none;
// setScrollbar(6px, transparent, #C0C4CC);
// .file-item {
// margin: 0 16px 16px 0;
// position: relative;
// padding: 8px;
// text-align: center;
// cursor: pointer;
// z-index: 1;
// &:hover {
// background: $tabBackColor;
// .file-name {
// font-weight: 550;
// }
// }
// .file-name {
// margin-top: 8px;
// height: 44px;
// line-height: 22px;
// font-size: 12px;
// word-break: break-all;
// setEllipsis(2);
// >>> .keyword {
// color: $Danger;
// }
// }
// .file-checked-wrapper {
// position: absolute;
// top: 0;
// left: 0;
// z-index: 2;
// background: rgba(245, 247, 250, 0.5);
// width: 100%;
// height: 100%;
// .file-checked {
// position: absolute;
// top: 16px;
// left: 24px;
// }
// }
// .file-checked-wrapper.checked {
// background: rgba(245, 247, 250, 0);
// }
// }
// .file-item.active {
// background: $tabBackColor;
// }
// }
// .right-menu-list {
// position: fixed;
// display: flex;
// flex-direction: column;
// background: #fff;
// border: 1px solid $BorderLighter;
// border-radius: 4px;
// box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
// z-index: 2;
// padding: 4px 0;
// color: $RegularText;
// .right-menu-item,
// .unzip-item {
// padding: 0 16px;
// height: 36px;
// line-height: 36px;
// cursor: pointer;
// &:hover {
// background: $PrimaryHover;
// color: $Primary;
// }
// i {
// margin-right: 8px;
// }
// }
// .unzip-menu-item {
// position: relative;
// &:hover {
// .unzip-list {
// display: block;
// }
// }
// .unzip-list {
// position: absolute;
// display: none;
// .unzip-item {
// width: 200px;
// setEllipsis(1)
// }
// }
// }
// }
// .right-menu-list,
// .unzip-list {
// background: #fff;
// border: 1px solid $BorderLighter;
// border-radius: 4px;
// box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
// z-index: 2;
// padding: 4px 0;
// color: $RegularText;
// }
// }
</style> </style>
...@@ -165,7 +165,7 @@ export default { ...@@ -165,7 +165,7 @@ export default {
font-size: 12px; font-size: 12px;
word-break: break-all; word-break: break-all;
@include setEllipsis(2); @include setEllipsis(2);
>>> .keyword { ::v-deep .keyword {
color: $Danger; color: $Danger;
} }
} }
...@@ -211,7 +211,7 @@ export default { ...@@ -211,7 +211,7 @@ export default {
// font-size: 12px; // font-size: 12px;
// word-break: break-all; // word-break: break-all;
// setEllipsis(2); // setEllipsis(2);
// >>> .keyword { // ::v-deep .keyword {
// color: $Danger; // color: $Danger;
// } // }
// } // }
......
...@@ -6,7 +6,10 @@ ...@@ -6,7 +6,10 @@
> >
<el-button-group <el-button-group
class="create-operate-group" class="create-operate-group"
v-if="(!selectedFiles.length || !isBatchOperation) && [0,10,11,12].includes(fileType) " v-if="
(!selectedFiles.length || !isBatchOperation) &&
[0, 10, 11, 12].includes(fileType)
"
> >
<el-dropdown class="upload-drop" trigger="hover"> <el-dropdown class="upload-drop" trigger="hover">
<el-button <el-button
...@@ -101,7 +104,6 @@ ...@@ -101,7 +104,6 @@
<!-- 全局搜索文件 --> <!-- 全局搜索文件 -->
<el-input <el-input
v-if="fileType === 0"
class="select-file-input" class="select-file-input"
v-model="searchFile.fileName" v-model="searchFile.fileName"
placeholder="搜索您的文件" placeholder="搜索您的文件"
...@@ -135,13 +137,20 @@ ...@@ -135,13 +137,20 @@
></i> ></i>
<el-divider direction="vertical"></el-divider> <el-divider direction="vertical"></el-divider>
<template v-if="screenWidth > 768"> <template v-if="screenWidth > 768">
<!-- fileGroupLable:{{ fileGroupLable }} -->
<!-- 文件展示模式 --> <!-- 文件展示模式 -->
<i <!-- <i
class="model-icon iconfont icon-liebiao1" class="model-icon iconfont icon-liebiao"
:class="{ active: fileGroupLable === 0 }" :class="{ active: fileGroupLable === 0 }"
title="列表模式" title="列表模式"
@click="handleFileDisplayModelChange(0)" @click="handleFileDisplayModelChange(0)"
></i> ></i> -->
<svg-icon
icon-class="icon-liebiao"
@click="handleFileDisplayModelChange(0)"
title="列表模式"
:class="{ active: fileGroupLable === 0, 'model-icon': true }"
></svg-icon>
<i <i
class="model-icon el-icon-s-grid" class="model-icon el-icon-s-grid"
:class="{ active: fileGroupLable === 1 }" :class="{ active: fileGroupLable === 1 }"
...@@ -283,8 +292,14 @@ export default { ...@@ -283,8 +292,14 @@ export default {
}, },
// 批量下载文件链接 // 批量下载文件链接
batchDownloadLink() { batchDownloadLink() {
const baseApi = "/api"; // return `${
return `${baseApi}/filetransfer/batchDownloadFile?userFileIds=${this.selectedFiles // process.env.VUE_APP_BASE_API
// }/filetransfer/batchDownloadFile?userFileIds=${this.selectedFiles
// .map((item) => item.userFileId)
// .join(",")}`;
return `${
process.env.VUE_APP_BASE_API
}/v1/api/folder/transfer/batchDownloadFile?userFileIds=${this.selectedFiles
.map((item) => item.userFileId) .map((item) => item.userFileId)
.join(",")}`; .join(",")}`;
}, },
...@@ -326,7 +341,7 @@ export default { ...@@ -326,7 +341,7 @@ export default {
filePath: this.$route.query.filePath || "/", filePath: this.$route.query.filePath || "/",
}) })
.then((res) => { .then((res) => {
console.log("确认结果:",res) console.log("确认结果:", res);
if (res === "confirm") { if (res === "confirm") {
this.$emit("getTableDataByType"); this.$emit("getTableDataByType");
} }
...@@ -525,7 +540,7 @@ export default { ...@@ -525,7 +540,7 @@ export default {
.model-icon { .model-icon {
margin-right: 8px; margin-right: 8px;
&:last-of-type { &:last-of-type {
margin-right: 0; // margin-right: 0;
} }
} }
......
...@@ -83,7 +83,7 @@ export default { ...@@ -83,7 +83,7 @@ export default {
}) })
.then((res) => { .then((res) => {
this.sureBtnLoading = false; this.sureBtnLoading = false;
if (res.success && res.code === 0) { if (res.code == 200) {
this.$message.success("文件创建成功"); this.$message.success("文件创建成功");
this.$refs[formName].resetFields(); this.$refs[formName].resetFields();
this.visible = false; this.visible = false;
......
...@@ -116,7 +116,7 @@ export default { ...@@ -116,7 +116,7 @@ export default {
}) })
.then((res) => { .then((res) => {
this.sureBtnLoading = false; this.sureBtnLoading = false;
if (res.success) { if (res.code == 200) {
this.$message.success("文件夹创建成功"); this.$message.success("文件夹创建成功");
this.$refs[formName].resetFields(); this.$refs[formName].resetFields();
this.visible = false; this.visible = false;
......
...@@ -56,7 +56,7 @@ export default { ...@@ -56,7 +56,7 @@ export default {
) { ) {
console.log("getWeChatAuthStateData", getWeChatAuthStateData); console.log("getWeChatAuthStateData", getWeChatAuthStateData);
// getWeChatAuthState().then((res) => { // getWeChatAuthState().then((res) => {
// if (res.success) { // if (res.code == 200) {
// if (res.data) { // if (res.data) {
// this.callback("go"); // this.callback("go");
// } else { // } else {
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
</template> </template>
<script> <script>
import { getFoldTree, copyFile } from "@/api/qwFile.js"; import { getFoldTreeByPath, copyFile } from "@/api/qwFile.js";
export default { export default {
name: "CopyFileDialog", name: "CopyFileDialog",
...@@ -90,11 +90,37 @@ export default { ...@@ -90,11 +90,37 @@ export default {
* 初始化文件目录树 * 初始化文件目录树
*/ */
initFileTree(id) { initFileTree(id) {
// this.loading = true;
// getFoldTree().then((res) => {
// this.loading = false;
// if (res.code == 200) {
// this.fileTree = [res.data];
// this.defaultExpandedKeys = id ? [id] : [this.fileTree[0].id];
// } else {
// this.$message.error(res.message);
// }
// });
this.loading = true; this.loading = true;
getFoldTree().then((res) => { // 通过当前路由判断传入参数
const { pathname } = window.location;
let path = "/我的创作";
if (pathname.includes("myCreate")) {
path = "/我的创作";
} else if (pathname.includes("myTemplate")) {
path = "/我的模板";
} else if (pathname.includes("myCollect")) {
path = "/我的收藏";
} else if (pathname.includes("myNote")) {
path = "/我的笔记";
} else if (pathname.includes("myShare")) {
path = "/我的共享";
}
this.targetPath = path;
const params = { path };
getFoldTreeByPath(params).then((res) => {
this.loading = false; this.loading = false;
if (res.success) { if (res.code == 200) {
this.fileTree = [res.data]; this.fileTree = res.data.children; //隐藏掉根目录
this.defaultExpandedKeys = id ? [id] : [this.fileTree[0].id]; this.defaultExpandedKeys = id ? [id] : [this.fileTree[0].id];
} else { } else {
this.$message.error(res.message); this.$message.error(res.message);
...@@ -135,7 +161,7 @@ export default { ...@@ -135,7 +161,7 @@ export default {
copyFile(data) copyFile(data)
.then((res) => { .then((res) => {
this.sureBtnLoading = false; this.sureBtnLoading = false;
if (res.success) { if (res.code == 200) {
this.$message.success("复制成功"); this.$message.success("复制成功");
this.visible = false; this.visible = false;
this.callback("confirm"); this.callback("confirm");
...@@ -155,7 +181,7 @@ export default { ...@@ -155,7 +181,7 @@ export default {
@import "@/assets/styles/varibles.scss"; @import "@/assets/styles/varibles.scss";
@import "@/assets/styles/qw-mixins.scss"; @import "@/assets/styles/qw-mixins.scss";
>>> .el-dialog { ::v-deep .el-dialog {
.el-dialog__header { .el-dialog__header {
display: flex; display: flex;
} }
......
...@@ -100,7 +100,7 @@ export default { ...@@ -100,7 +100,7 @@ export default {
} }
} }
} }
if (res.success) { if (res.code == 200) {
this.sureBtnLoading = false; this.sureBtnLoading = false;
this.$message.success("删除成功"); this.$message.success("删除成功");
this.visible = false; this.visible = false;
......
...@@ -58,14 +58,19 @@ ...@@ -58,14 +58,19 @@
</template> </template>
<script> <script>
import { getFoldTree, moveFile, batchMoveFile } from "@/api/qwFile.js"; import {
getFoldTree,
getFoldTreeByPath,
moveFile,
batchMoveFile,
} from "@/api/qwFile.js";
export default { export default {
name: "MoveFileDialog", name: "MoveFileDialog",
data() { data() {
return { return {
visible: false, // 对话框是否可见 visible: false, // 对话框是否可见
targetPath: "/", // 目标路径 targetPath: "/我的创作", // 目标路径
fileTree: [], // 文件夹目录树 fileTree: [], // 文件夹目录树
loading: false, // 文件夹目录树 loading 状态 loading: false, // 文件夹目录树 loading 状态
defaultExpandedKeys: [], defaultExpandedKeys: [],
...@@ -86,15 +91,38 @@ export default { ...@@ -86,15 +91,38 @@ export default {
handleDialogOpen() { handleDialogOpen() {
this.initFileTree(); this.initFileTree();
}, },
getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (r != null) return r[2];
return null;
},
/** /**
* 初始化文件目录树 * 初始化文件目录树
*/ */
initFileTree(id) { initFileTree(id) {
this.loading = true; this.loading = true;
getFoldTree().then((res) => { // 通过当前路由判断传入参数
const { pathname } = window.location;
let path = "/我的创作";
if (pathname.includes("myCreate")) {
path = "/我的创作";
} else if (pathname.includes("myTemplate")) {
path = "/我的模板";
} else if (pathname.includes("myCollect")) {
path = "/我的收藏";
} else if (pathname.includes("myNote")) {
path = "/我的笔记";
} else if (pathname.includes("myShare")) {
path = "/我的共享";
}
this.targetPath = path;
const params = { path };
getFoldTreeByPath(params).then((res) => {
this.loading = false; this.loading = false;
if (res.success) { if (res.code == 200) {
this.fileTree = [res.data]; this.fileTree = res.data.children; //隐藏掉根目录
this.defaultExpandedKeys = id ? [id] : [this.fileTree[0].id]; this.defaultExpandedKeys = id ? [id] : [this.fileTree[0].id];
} else { } else {
this.$message.error(res.message); this.$message.error(res.message);
...@@ -141,7 +169,7 @@ export default { ...@@ -141,7 +169,7 @@ export default {
batchMoveFile(data) batchMoveFile(data)
.then((res) => { .then((res) => {
this.sureBtnLoading = false; this.sureBtnLoading = false;
if (res.success) { if (res.code == 200) {
this.$message.success("移动成功"); this.$message.success("移动成功");
this.visible = false; this.visible = false;
this.fileInfo = {}; this.fileInfo = {};
...@@ -162,7 +190,7 @@ export default { ...@@ -162,7 +190,7 @@ export default {
moveFile(data) moveFile(data)
.then((res) => { .then((res) => {
this.sureBtnLoading = false; this.sureBtnLoading = false;
if (res.success) { if (res.code == 200) {
this.$message.success("移动成功"); this.$message.success("移动成功");
this.visible = false; this.visible = false;
this.callback("confirm"); this.callback("confirm");
...@@ -183,7 +211,7 @@ export default { ...@@ -183,7 +211,7 @@ export default {
@import "@/assets/styles/varibles.scss"; @import "@/assets/styles/varibles.scss";
@import "@/assets/styles/qw-mixins.scss"; @import "@/assets/styles/qw-mixins.scss";
>>> .el-dialog { ::v-deep .el-dialog {
.el-dialog__header { .el-dialog__header {
display: flex; display: flex;
} }
......
...@@ -90,7 +90,7 @@ export default { ...@@ -90,7 +90,7 @@ export default {
}) })
.then((res) => { .then((res) => {
this.sureBtnLoading = false; this.sureBtnLoading = false;
if (res.success) { if (res.code == 200) {
this.$message.success("重命名成功"); this.$message.success("重命名成功");
this.$refs[formName].resetFields(); this.$refs[formName].resetFields();
this.visible = false; this.visible = false;
......
...@@ -34,7 +34,7 @@ export default { ...@@ -34,7 +34,7 @@ export default {
deleteBatchNum: this.deleteBatchNum, deleteBatchNum: this.deleteBatchNum,
filePath: this.filePath, filePath: this.filePath,
}).then((res) => { }).then((res) => {
if (res.success) { if (res.code == 200) {
this.$message.success("文件已还原"); this.$message.success("文件已还原");
this.visible = false; this.visible = false;
this.callback("confirm"); this.callback("confirm");
......
...@@ -93,7 +93,7 @@ export default { ...@@ -93,7 +93,7 @@ export default {
this.loading = true; this.loading = true;
getFoldTree().then((res) => { getFoldTree().then((res) => {
this.loading = false; this.loading = false;
if (res.success) { if (res.code == 200) {
this.fileTree = [res.data]; this.fileTree = [res.data];
this.defaultExpandedKeys = id ? [id] : [this.fileTree[0].id]; this.defaultExpandedKeys = id ? [id] : [this.fileTree[0].id];
} else { } else {
...@@ -135,7 +135,7 @@ export default { ...@@ -135,7 +135,7 @@ export default {
}) })
.then((res) => { .then((res) => {
this.sureBtnLoading = false; this.sureBtnLoading = false;
if (res.success) { if (res.code == 200) {
this.visible = false; this.visible = false;
this.$message.success("保存成功"); this.$message.success("保存成功");
} else { } else {
...@@ -154,7 +154,7 @@ export default { ...@@ -154,7 +154,7 @@ export default {
@import "@/assets/styles/varibles.scss"; @import "@/assets/styles/varibles.scss";
@import "@/assets/styles/qw-mixins.scss"; @import "@/assets/styles/qw-mixins.scss";
>>> .el-dialog { ::v-deep .el-dialog {
.el-dialog__header { .el-dialog__header {
display: flex; display: flex;
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
title="分享文件" title="分享文件"
:visible.sync="visible" :visible.sync="visible"
:close-on-click-modal="false" :close-on-click-modal="false"
width="550px" width="680px"
@close="handleDialogCancel" @close="handleDialogCancel"
> >
<el-form <el-form
...@@ -13,10 +13,45 @@ ...@@ -13,10 +13,45 @@
:model="form" :model="form"
ref="shareFileForm" ref="shareFileForm"
label-suffix=":" label-suffix=":"
label-width="130px" label-width="180px"
:label-position="screenWidth <= 520 ? 'top' : 'right'" :label-position="screenWidth <= 520 ? 'top' : 'right'"
:rules="rules" :rules="rules"
> >
<el-form-item label="分享给部门或个人" prop="shareType">
<el-radio-group v-model="form.shareType">
<el-radio :label="0">分享到公共社区</el-radio>
<el-radio :label="1">分享到部门</el-radio>
<el-radio :label="2">分享到个人</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
:label="getChooseDataLabel"
v-if="form.shareType == 1 || form.shareType == 2"
>
<el-tree
v-if="form.shareType == 1"
class="tree-border"
:data="deptOptions"
show-checkbox
default-expand-all
ref="dept"
node-key="id"
empty-text="加载中,请稍候"
:props="defaultProps"
></el-tree>
<PaginationSelector
v-if="form.shareType == 2"
@pageNationChange="pageNationChange"
@change="handleChangUserName"
:optionSource="userListAllByLocal"
v-model="userIds"
labelKey="userName"
valueKey="userId"
:paginationOption="setSelectPage"
/>
<!-- {{ userListAllByLocal }} -->
<!-- <div v-if="form.shareType == 2">人员列表</div> -->
</el-form-item>
<el-form-item label="链接有效期至" prop="endTime"> <el-form-item label="链接有效期至" prop="endTime">
<el-date-picker <el-date-picker
v-model="form.endTime" v-model="form.endTime"
...@@ -31,7 +66,7 @@ ...@@ -31,7 +66,7 @@
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="是否需要提取码" prop="shareType"> <el-form-item label="是否需要提取码" prop="shareType">
<el-radio-group v-model="form.shareType"> <el-radio-group v-model="form.isNeedCode">
<el-radio :label="1"></el-radio> <el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio> <el-radio :label="0"></el-radio>
</el-radio-group> </el-radio-group>
...@@ -89,19 +124,27 @@ ...@@ -89,19 +124,27 @@
<script> <script>
import store from "@/store/index.js"; import store from "@/store/index.js";
import { shareFile } from "@/api/qwFile.js"; import { shareFile } from "@/api/qwFile";
import { deptTreeSelect, listUser } from "@/api/system/user";
import PaginationSelector from "@/components/PaginationSelector";
export default { export default {
name: "ShareFileDialog", name: "ShareFileDialog",
components: {
PaginationSelector,
},
data() { data() {
return { return {
visible: false, // 对话框是否可见 visible: false, // 对话框是否可见
// 分享文件对话框数据 // 分享文件对话框数据
form: { form: {
isNeedCode: 0, //是否需要提取码,0-是 1-否
endTime: "", endTime: "",
shareType: 0, shareType: 0, //分享类型 0公共分享,1部门分享,2个人分享
}, },
rules: { rules: {
shareType: [
{ required: true, message: "请选择分享类别", trigger: "blur" },
],
endTime: [ endTime: [
{ required: true, message: "请选择链接有效期", trigger: "blur" }, { required: true, message: "请选择链接有效期", trigger: "blur" },
], ],
...@@ -158,6 +201,23 @@ export default { ...@@ -158,6 +201,23 @@ export default {
shareBatchNum: "", shareBatchNum: "",
extractionCode: "", extractionCode: "",
}, },
// 部门列表
deptOptions: [],
defaultProps: {
children: "children",
label: "label",
},
//分页信息
setSelectPage: {
pageSize: 5, //每页显示条数 3条刚好
pageNum: 1, //当前页
pagerCount: 5, //按钮数,超过时会折叠
total: 0, //总条数
},
userIds: "", //用户id集合,用于绑定数据
userIdsParams: "", //用户id集合,用于提交给后台
userListAllByLocal: [],
userListAllPaged: [],
}; };
}, },
computed: { computed: {
...@@ -165,6 +225,30 @@ export default { ...@@ -165,6 +225,30 @@ export default {
screenWidth() { screenWidth() {
return store.state.common.screenWidth; return store.state.common.screenWidth;
}, },
getChooseDataLabel() {
if (this.form.shareType == 1) {
return "选择部门";
} else if (this.form.shareType == 2) {
return "选择个人";
}
},
},
watch: {
"form.shareType"(value) {
if (value == 1) {
this.getDeptTree();
// 清空人员的选择
this.clearCheckedUser();
} else if (value == 2) {
this.getUserList();
// 清空部门的选择
this.clearCheckedDept();
} else {
// 选择分享给全部时,要清空部门和人员的所有选择
this.clearCheckedUser();
this.clearCheckedDept();
}
},
}, },
methods: { methods: {
/** /**
...@@ -175,6 +259,9 @@ export default { ...@@ -175,6 +259,9 @@ export default {
this.$refs["shareFileForm"].resetFields(); this.$refs["shareFileForm"].resetFields();
this.visible = false; this.visible = false;
this.callback("cancel"); this.callback("cancel");
// 清空部门和人员的所有选择
this.clearCheckedUser();
this.clearCheckedDept();
}, },
/** /**
* 分享文件对话框 | 确定按钮点击事件 * 分享文件对话框 | 确定按钮点击事件
...@@ -182,6 +269,11 @@ export default { ...@@ -182,6 +269,11 @@ export default {
* @param {string} formName 表单ref值 * @param {string} formName 表单ref值
*/ */
handleDialogSure(formName) { handleDialogSure(formName) {
if (this.form.shareType == 1) {
this.form.shareTo = this.getDeptAllCheckedKeys();
} else if (this.form.shareType == 2) {
this.form.shareTo = this.userIdsParams;
}
this.sureBtnLoading = true; this.sureBtnLoading = true;
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
...@@ -192,7 +284,7 @@ export default { ...@@ -192,7 +284,7 @@ export default {
}) })
.then((res) => { .then((res) => {
this.sureBtnLoading = false; this.sureBtnLoading = false;
if (res.success) { if (res.code == 200) {
this.shareData = res.data; this.shareData = res.data;
this.shareIsSuccess = true; this.shareIsSuccess = true;
this.callback("confirm"); this.callback("confirm");
...@@ -209,6 +301,77 @@ export default { ...@@ -209,6 +301,77 @@ export default {
} }
}); });
}, },
/**
* 根据角色ID查询部门树结构
* @param {string} roleId 当前用户角色id
*/
getDeptTree() {
// 若已经加载过不再重复调取接口
if (this.deptOptions.length > 0) {
return;
}
deptTreeSelect().then((response) => {
this.deptOptions = response.data;
});
},
/**
* 获取被选择的组织id
* @returns {string} 组织Id以逗号隔开的字符串
*/
getDeptAllCheckedKeys() {
// 目前被选中的部门节点
let checkedKeys = this.$refs.dept.getCheckedKeys();
// 半选中的部门节点
// let halfCheckedKeys = this.$refs.dept.getHalfCheckedKeys();
// checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
return checkedKeys.join(",");
},
//下拉列表分页的点击的事件
pageNationChange(val) {
//设置当前页为点击的页
this.setSelectPage.pageNum = val;
//重新调用分页查询的方法
this.getUserList(this.setSelectPage);
},
//获取下拉框中的运动员编号--保存方案
handleChangUserName(val) {
this.userIdsParams = val.join(",");
},
// 清空选中的人员
clearCheckedUser() {
this.userIds = "";
this.userIdsParams = "";
},
// 清空组织的选择
clearCheckedDept() {
if (this.$refs.dept) {
this.$refs.dept.setCheckedKeys([]);
}
},
//查询所有用户列表
getUserList(setSelectPage) {
const { pageNum, pageSize } = this.setSelectPage;
const params = { pageNum, pageSize };
listUser(params).then((res) => {
//下拉列表数据源绑定
this.userListAllByLocal = res.rows;
//绑定总记录数
this.setSelectPage.total = res.total;
//
if (this.userListAllPaged.length === 0) {
this.userListAllPaged = res.rows;
} else {
//追加数据
for (let i = 0; i < res.rows.length; i++) {
this.userListAllPaged.push(res.rows[i]);
}
}
});
},
}, },
}; };
</script> </script>
......
...@@ -147,7 +147,7 @@ export default { ...@@ -147,7 +147,7 @@ export default {
width: 40%; width: 40%;
height: auto; height: auto;
} }
>>> .el-form.file-info-form { ::v-deep .el-form.file-info-form {
.el-form-item { .el-form-item {
margin-bottom: 16px; margin-bottom: 16px;
.el-input__inner { .el-input__inner {
......
...@@ -101,7 +101,7 @@ export default { ...@@ -101,7 +101,7 @@ export default {
this.loading = true; this.loading = true;
getFoldTree().then((res) => { getFoldTree().then((res) => {
this.loading = false; this.loading = false;
if (res.success) { if (res.code == 200) {
this.fileTree = [res.data]; this.fileTree = [res.data];
this.defaultExpandedKeys = id ? [id] : [this.fileTree[0].id]; this.defaultExpandedKeys = id ? [id] : [this.fileTree[0].id];
} else { } else {
...@@ -155,7 +155,7 @@ export default { ...@@ -155,7 +155,7 @@ export default {
} }
unzipFile(reqData).then((res) => { unzipFile(reqData).then((res) => {
this.sureBtnLoading = false; this.sureBtnLoading = false;
if (res.success) { if (res.code == 200) {
this.$message.success("解压成功"); this.$message.success("解压成功");
this.visible = false; this.visible = false;
this.callback("confirm"); this.callback("confirm");
...@@ -172,7 +172,7 @@ export default { ...@@ -172,7 +172,7 @@ export default {
@import "@/assets/styles/varibles.scss"; @import "@/assets/styles/varibles.scss";
@import "@/assets/styles/qw-mixins.scss"; @import "@/assets/styles/qw-mixins.scss";
>>> .el-dialog { ::v-deep .el-dialog {
.el-dialog__header { .el-dialog__header {
display: flex; display: flex;
} }
......
...@@ -14,7 +14,7 @@ const commonFunction = { ...@@ -14,7 +14,7 @@ const commonFunction = {
* @param {object} others 域名、路径、有效期等,封装到对象中 * @param {object} others 域名、路径、有效期等,封装到对象中
*/ */
setCookies(name, value, others = null) { setCookies(name, value, others = null) {
Cookies.set(name, value, { domain: config.domain, ...others }) Cookies.set(name, value, { domain: qwConfig.domain, ...others })
}, },
/** /**
* 获取 Cookies * 获取 Cookies
...@@ -23,7 +23,7 @@ const commonFunction = { ...@@ -23,7 +23,7 @@ const commonFunction = {
* @returns {string} Cookies 值 * @returns {string} Cookies 值
*/ */
getCookies(name, others = null) { getCookies(name, others = null) {
return Cookies.get(name, { domain: config.domain, ...others }) return Cookies.get(name, { domain: qwConfig.domain, ...others })
}, },
/** /**
* 移除 Cookies * 移除 Cookies
...@@ -31,7 +31,7 @@ const commonFunction = { ...@@ -31,7 +31,7 @@ const commonFunction = {
* @param {object} others 域名、路径等,封装到对象中 * @param {object} others 域名、路径等,封装到对象中
*/ */
removeCookies(name, others = null) { removeCookies(name, others = null) {
Cookies.remove(name, { domain: config.domain, ...others }) Cookies.remove(name, { domain: qwConfig.domain, ...others })
} }
} }
export default commonFunction export default commonFunction
...@@ -9,6 +9,7 @@ import { ...@@ -9,6 +9,7 @@ import {
markdownFileType markdownFileType
} from '@/libs/qiwen/map.js' } from '@/libs/qiwen/map.js'
import { officeFileType } from '@/libs/qiwen/map.js' import { officeFileType } from '@/libs/qiwen/map.js'
import { getViewUrlDbPath } from '@/api/wps'
// 全局函数 - 文件相关 // 全局函数 - 文件相关
const fileFunction = { const fileFunction = {
...@@ -286,8 +287,98 @@ const fileFunction = { ...@@ -286,8 +287,98 @@ const fileFunction = {
Number(router.currentRoute.query.fileType) === 4 ? currentIndex : 0 Number(router.currentRoute.query.fileType) === 4 ? currentIndex : 0
Vue.prototype.$openBox.audioPreview({ audioList, defaultIndex }) Vue.prototype.$openBox.audioPreview({ audioList, defaultIndex })
}, },
/**
* 文件预览——word使用wps预览,pdf使用pdf组件进行预览
* @description 若当前点击的为文件夹,则进入文件夹内部;若是文件,则进行相应的预览。
* @param {object} row 文件信息
* @param {number} currentIndex 当前文件索引
* @param {array} fileList 文件列表
*/
handleFileNameClickNew(row, currentIndex, fileList = []) {
// 如果当前文件在回收站中,则不允许预览
if (row.deleteFlag !== undefined && row.deleteFlag !== 0) {
return false
}
// 若是文件夹则进入该文件夹
if (row.isDir) {
// debugger
if (router.currentRoute.name === 'Share') {
// 当前是查看他人分享列表的页面
router.push({
query: {
filePath: `${row.shareFilePath === '/' ? '' : row.shareFilePath}/${row.fileName
}`
}
})
} else if (Number(router.currentRoute.query.fileType) === 8) {
// 当前是我的已分享列表页面
router.push({
query: {
fileType: 8,
filePath: `${row.shareFilePath === '/' ? '' : row.shareFilePath}/${row.fileName
}`,
shareBatchNum: row.shareBatchNum
}
})
} else if (Number(router.currentRoute.query.fileType) !== 6) {
// 回收站页面不允许打开文件夹
// 网盘页面
router.push({
query: {
filePath: `${row.filePath === '/' ? '' : row.filePath}/${row.fileName
}`,
fileType: router.currentRoute.query.fileType
}
})
}
} else {
const WORD = ['doc', 'docx']
const PDF = ['pdf']
// 若当前点击项是word
if (WORD.includes(row.extendName.toLowerCase())) {
let flag = false
// 根据当前路由判断,是否支持编辑,目前只要我的创作才能够编辑
console.log('router.currentRoute', router.currentRoute);
if (router.currentRoute.name === 'MyCreate') {
flag = true
}
console.log(123, row);
const { fileId, identifier } = row
const params = {
fileId: identifier,
flag
}
getViewUrlDbPath(params).then(res => {
if (res.data) {
console.log(res.data);
// 跳转 使用sessionStorage,避免关键信息在ip中暴露
// 使用push会停留当前页面,故不采纳
// params 传递参数,子组件无法渲染iframe组件,故不采纳
// localStorage.wpsUrl = res.data.wpsUrl
// localStorage.token = res.data.token
// let resolve = $el.$router.resolve({
// path: '/wpsReader',
// query: {
// wpsUrl: res.data.wpsUrl,
// token: res.data.token
// }
// })
// window.open(resolve.href, '_blank')
}
})
// router.push('/wpsReader')
return false
}
// 若当前点击项是pdf
if (PDF.includes(row.extendName.toLowerCase())) {
router.push('/pdfReader')
return false
}
}
},
/** /**
* 文件预览 * 文件预览——原始奇文的方法,使用的onlyoffice预览
* @description 若当前点击的为文件夹,则进入文件夹内部;若是文件,则进行相应的预览。 * @description 若当前点击的为文件夹,则进入文件夹内部;若是文件,则进行相应的预览。
* @param {object} row 文件信息 * @param {object} row 文件信息
* @param {number} currentIndex 当前文件索引 * @param {number} currentIndex 当前文件索引
...@@ -300,6 +391,7 @@ const fileFunction = { ...@@ -300,6 +391,7 @@ const fileFunction = {
} }
// 若是文件夹则进入该文件夹 // 若是文件夹则进入该文件夹
if (row.isDir) { if (row.isDir) {
// debugger
if (router.currentRoute.name === 'Share') { if (router.currentRoute.name === 'Share') {
// 当前是查看他人分享列表的页面 // 当前是查看他人分享列表的页面
router.push({ router.push({
...@@ -325,7 +417,7 @@ const fileFunction = { ...@@ -325,7 +417,7 @@ const fileFunction = {
query: { query: {
filePath: `${row.filePath === '/' ? '' : row.filePath}/${row.fileName filePath: `${row.filePath === '/' ? '' : row.filePath}/${row.fileName
}`, }`,
fileType: 0 fileType: router.currentRoute.query.fileType
} }
}) })
} }
......
...@@ -36,17 +36,17 @@ export const staticRouters = [ ...@@ -36,17 +36,17 @@ export const staticRouters = [
affix: false affix: false
} }
}, },
{ // {
path: 'myTemplate', // path: 'myTemplate',
component: () => import('@/views/mine/myTemplate/index.vue'), // component: () => import('@/views/mine/myTemplate/index.vue'),
name: 'MyTemplate', // name: 'MyTemplate',
meta: { // meta: {
title: '我的模板', // title: '我的模板',
icon: 'dashboard', // icon: 'dashboard',
noCache: false, // noCache: false,
affix: false // affix: false
} // }
}, // },
{ {
path: 'myCollect', path: 'myCollect',
component: () => import('@/views/mine/myCollect/index.vue'), component: () => import('@/views/mine/myCollect/index.vue'),
......
import { allColumnList } from '@/libs/qiwen/map.js'
const getters = { const getters = {
sidebar: state => state.app.sidebar, sidebar: state => state.app.sidebar,
size: state => state.app.size, size: state => state.app.size,
...@@ -16,7 +18,15 @@ const getters = { ...@@ -16,7 +18,15 @@ const getters = {
defaultRoutes: state => state.permission.defaultRoutes, defaultRoutes: state => state.permission.defaultRoutes,
sidebarRouters: state => state.permission.sidebarRouters, sidebarRouters: state => state.permission.sidebarRouters,
//奇文 //奇文
fileModel: state => state.fileList.fileModel, // 文件查看模式
fileModel: (state) =>
state.fileList.fileModel === null ? 0 : Number(state.fileList.fileModel),
// 表格显示列
selectedColumnList: (state) =>
state.fileList.selectedColumnList === null
? allColumnList
: state.fileList.selectedColumnList.split(','),
// 网格模式 & 时间线模式下 文件图标大小
gridSize: (state) => state.fileList.gridSize,
} }
export default getters export default getters
...@@ -34,7 +34,7 @@ const qwConfig = { ...@@ -34,7 +34,7 @@ const qwConfig = {
/** /**
* 存放 token 时的命名方式 * 存放 token 时的命名方式
*/ */
tokenKeyName: 'token' tokenKeyName: 'Admin-Token'
} }
export default qwConfig export default qwConfig
<template> <template>
<div>阅读wps</div> <div>
阅读wps
<div id="viewFile"></div>
</div>
</template> </template>
<script> <script>
export default {}; import WebOfficeSDK from "/public/weboffice/web-office-sdk-v1.1.8.es";
export default {
mounted() {
// this.getBookList();
console.log("WebOfficeSDK", WebOfficeSDK);
this.openWps(this.$route.query.wpsUrl, this.$route.query.token);
},
methods: {
async openWps(url, token) {
this.wps = WebOfficeSDK.config({
wpsUrl: url, // 如果需要通过js-sdk传递token方式鉴权,则需要包含_w_tokentype=1参数
mount: document.querySelector("#viewFile"),
});
this.wps.setToken({ token });
this.wps.ready();
},
},
};
</script> </script>
<style lang=""></style> <style lang=""></style>
...@@ -35,7 +35,7 @@ module.exports = { ...@@ -35,7 +35,7 @@ module.exports = {
proxy: { proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
target: `http://192.168.1.230:9600`, target: `http://222.85.214.245:9600`,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: '' ['^' + process.env.VUE_APP_BASE_API]: ''
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论