提交 1d351b1a authored 作者: 龙菲's avatar 龙菲

文件导航面包屑完善,增加文件分享到公共社区、分享到部门、分享到个人

上级 65b05894
...@@ -12,3 +12,4 @@ export const verity = params => { ...@@ -12,3 +12,4 @@ export const verity = params => {
params params
}) })
} }
<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,15 +68,14 @@ export default { ...@@ -66,15 +68,14 @@ export default {
}, },
isShowInput: false, // 是否展示路径输入框 isShowInput: false, // 是否展示路径输入框
inputFilePath: "", // 路径输入 inputFilePath: "", // 路径输入
breadCrumbList: [],
}; };
}, },
computed: { watch: {
/** $route(value) {
* 面包屑导航栏数组 // console.log(123, value);
*/ const { filePath } = value.query;
breadCrumbList: { // debugger;
get() {
let filePath = this.$route.query.filePath;
let filePathList = filePath ? filePath.split("/") : []; let filePathList = filePath ? filePath.split("/") : [];
let res = []; // 返回结果数组 let res = []; // 返回结果数组
let _path = []; // 存放祖先路径 let _path = []; // 存放祖先路径
...@@ -102,12 +103,50 @@ export default { ...@@ -102,12 +103,50 @@ export default {
// }); // });
} }
} }
return res; console.log("res", res);
}, this.breadCrumbList = res;
set() {
return [];
}, },
}, },
computed: {
/**
* 面包屑导航栏数组
*/
// breadCrumbList: {
// get() {
// let filePath = this.$route.query.filePath;
// 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"
// ? "全部分享"
// : "",
// });
// }
// }
// return res;
// },
// set() {
// 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"
...@@ -237,6 +238,7 @@ ...@@ -237,6 +238,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-empty v-else> </el-empty>
</div> </div>
</template> </template>
...@@ -291,21 +293,27 @@ export default { ...@@ -291,21 +293,27 @@ export default {
*/ */
filePath() { filePath() {
this.clearSelectedTable(); this.clearSelectedTable();
this.$nextTick(() => {
this.$refs.multipleTable.clearSort(); this.$refs.multipleTable.clearSort();
});
}, },
/** /**
* 文件类型变化时清空表格已选行 * 文件类型变化时清空表格已选行
*/ */
fileType() { fileType() {
this.clearSelectedTable(); this.clearSelectedTable();
this.$nextTick(() => {
this.$refs.multipleTable.clearSort(); this.$refs.multipleTable.clearSort();
});
}, },
/** /**
* 文件列表变化时清空表格已选行 * 文件列表变化时清空表格已选行
*/ */
fileList() { fileList() {
this.clearSelectedTable(); this.clearSelectedTable();
this.$nextTick(() => {
this.$refs.multipleTable.clearSort(); this.$refs.multipleTable.clearSort();
});
this.sortedFileList = this.fileList; this.sortedFileList = this.fileList;
}, },
}, },
...@@ -330,14 +338,19 @@ export default { ...@@ -330,14 +338,19 @@ export default {
// xs 以上的屏幕 // xs 以上的屏幕
if (this.screenWidth > 768) { if (this.screenWidth > 768) {
event.preventDefault(); event.preventDefault();
this.$nextTick(() => {
this.$refs.multipleTable.setCurrentRow(row); // 选中当前行 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"); // 刷新存储容量
...@@ -350,7 +363,10 @@ export default { ...@@ -350,7 +363,10 @@ export default {
* @description 用于父组件调用 | 本组件调用,请勿删除 * @description 用于父组件调用 | 本组件调用,请勿删除
*/ */
clearSelectedTable() { clearSelectedTable() {
this.$nextTick(() => {
console.log("this.$refs.multipleTable", this.$refs.multipleTable);
this.$refs.multipleTable.clearSelection(); this.$refs.multipleTable.clearSelection();
});
}, },
/** /**
* 表格选择项发生变化时的回调函数 * 表格选择项发生变化时的回调函数
...@@ -374,7 +390,9 @@ export default { ...@@ -374,7 +390,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"); // 刷新存储容量
...@@ -391,7 +409,7 @@ export default { ...@@ -391,7 +409,7 @@ 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;
......
...@@ -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;
......
...@@ -447,7 +447,7 @@ export default { ...@@ -447,7 +447,7 @@ 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;
......
...@@ -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;
......
...@@ -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;
......
...@@ -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 {
......
...@@ -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;
} }
} }
......
...@@ -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,17 +372,14 @@ export default { ...@@ -241,17 +372,14 @@ export default {
} }
} }
&.checked { .file-checked-wrapper.checked {
.file-checked-wrapper {
background: rgba(245, 247, 250, 0); background: rgba(245, 247, 250, 0);
} }
} }
.file-item.active {
&.active {
background: $tabBackColor; background: $tabBackColor;
} }
} }
}
.right-menu-list { .right-menu-list {
position: fixed; position: fixed;
...@@ -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;
// } // }
// } // }
......
...@@ -155,7 +155,7 @@ export default { ...@@ -155,7 +155,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;
} }
......
...@@ -183,7 +183,7 @@ export default { ...@@ -183,7 +183,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;
} }
......
...@@ -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,14 @@ export default { ...@@ -182,6 +269,14 @@ 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;
}
// console.log("this.form.shareTo", this.form.shareTo);
// return;
this.sureBtnLoading = true; this.sureBtnLoading = true;
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
...@@ -192,7 +287,7 @@ export default { ...@@ -192,7 +287,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 +304,77 @@ export default { ...@@ -209,6 +304,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 {
......
...@@ -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;
} }
......
...@@ -18,8 +18,6 @@ const getters = { ...@@ -18,8 +18,6 @@ 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,
// selectedColumnList: state => state.fileList.selectedColumnList,
// 文件查看模式 // 文件查看模式
fileModel: (state) => fileModel: (state) =>
state.fileList.fileModel === null ? 0 : Number(state.fileList.fileModel), state.fileList.fileModel === null ? 0 : Number(state.fileList.fileModel),
...@@ -28,5 +26,7 @@ const getters = { ...@@ -28,5 +26,7 @@ const getters = {
state.fileList.selectedColumnList === null state.fileList.selectedColumnList === null
? allColumnList ? allColumnList
: state.fileList.selectedColumnList.split(','), : state.fileList.selectedColumnList.split(','),
// 网格模式 & 时间线模式下 文件图标大小
gridSize: (state) => state.fileList.gridSize,
} }
export default getters export default getters
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论