Commit 9f367568 authored by 夏敏伟's avatar 夏敏伟

增加外部邮箱链接 增加弹框内树状结构目录树

parent e87cd2b3
<template>
<div>
<div style="margin-bottom:20px;display: grid;grid-template-columns: 80px auto;">
<span style="margin-top:20px;color: white;">选择目录:</span>
<el-tree class="myTree" :data="treeData" node-key="id" show-checkbox :expand-on-click-node="false" :default-expanded-keys="[fl_type]"
highlight-current :props="defaultProps" :check-strictly="true" ref="tree" @check-change="handleCheckChange"
:indent=1>
</el-tree>
</div>
<div class="uploadWrapper">
<div class="btnUpload">
<div id="picker" class="form-control-focus">点击选择文件上传</div>
......@@ -19,6 +27,7 @@
</div>
<el-button class="startUpload" type="primary" @click="upload()">开始上传</el-button>
</div>
</div>
</template>
<script>
import $ from "jquery";
......@@ -32,12 +41,25 @@ export default {
},
checkFileExist: {
type: Function
},
treeDataBig: {
type: Array
},
flType:{
type:Number
}
},
data() {
return {
fileList: [],
headers: { 'x-requested-with': 'XMLHttpRequest' }
headers: { 'x-requested-with': 'XMLHttpRequest' },
clientDetails_check_type: [],
treeData: [],
defaultProps: {
children: 'children',
label: 'label'
},
fl_type:0
};
},
mounted() {
......@@ -139,8 +161,9 @@ export default {
name: file.name,
size: file.size,
type: file.ext,
uuid: file.uid + "." + file.ext,
}
uuid: file.uid + "." + file.ext
},
treeId: _self.clientDetails_check_type
});
} else {
return Promise.resolve(res);
......@@ -235,6 +258,13 @@ export default {
},
methods: {
upload() {
if (this.clientDetails_check_type.length == 0 || this.clientDetails_check_type.includes(1) || this.clientDetails_check_type.includes(2) || this.clientDetails_check_type.includes(3) || this.clientDetails_check_type.includes(4)) {
this.$message({
type: "warning",
message: "请选择文档列表子节点",
});
return;
}
this.uploader.upload();
},
removeFile(item, index) {
......@@ -275,13 +305,38 @@ export default {
}
}).catch(err => reject(err));
})
},
handleCheckChange(node, isSelected) {
if (isSelected) {
this.clientDetails_check_type.push(node.id);
} else {
this.clientDetails_check_type = this.clientDetails_check_type.filter(item => {
return item != node.id
})
}
console.log(this.clientDetails_check_type);
}
},
watch: {
treeDataBig: {
handler(newVal, oldVal) {
this.treeData = newVal;
this.clientDetails_check_type = [];
},
immediate: true
},
flType:{
handler(newVal, oldVal) {
this.fl_type = newVal;
},
immediate: true
}
}
};
</script>
<style lang="scss" scope>
.uploadWrapper {
height: 524px;
min-height: 300px;
}
#picker>div:nth-child(2) {
......
......@@ -36,6 +36,7 @@
<el-dropdown-menu slot="dropdown" class="hide-drop">
<el-dropdown-item v-for="(item, index) in manager_module_backstage" v-text="item.name"
:command="item.name" :key="index"></el-dropdown-item>
<el-dropdown-item command="邮箱">邮箱</el-dropdown-item>
<el-dropdown-item command="修改密码">修改密码</el-dropdown-item>
<el-dropdown-item command="安全退出">安全退出</el-dropdown-item>
</el-dropdown-menu>
......@@ -81,7 +82,7 @@ import { endLoading, get, post, httpSSERequest, fetchEventSource, httpSSERequest
import { queryDictItem } from '../api/dictitem';
import Push from 'push.js'
import dayjs from 'dayjs';
import { SYSTEM_NAME } from "@/constant/user";
import { SYSTEM_NAME, MAIL_ADDRESS } from "@/constant/user";
export default {
name: "home",
data() {
......@@ -168,6 +169,8 @@ export default {
this.$router.push("xx");
} else if (command == '修改密码') {
this.dialogVisible = true;
} else if (command == '邮箱') {
window.open(MAIL_ADDRESS);
}
},
handleClose(key, keyPath) { },
......
......@@ -3,10 +3,10 @@
<div class="left-div">
<el-input class="public-input" placeholder="输入关键字进行过滤" suffix-icon="el-icon-search"
v-model="filterText"></el-input>
<el-tree class="myTree" :data="tree_data" node-key="id" show-checkbox :expand-on-click-node="false"
<el-tree class="myTree" :data="tree_data" node-key="id" :expand-on-click-node="false"
:filter-node-method="filterNode" highlight-current :default-expanded-keys="[this.fl_type]" :props="defaultProps"
:check-strictly="true" ref="tree" :current-node-key="this.fl_type" @node-click="handleNodeClick"
@check-change="handleCheckChange" :indent=1>
ref="tree" :current-node-key="this.fl_type" @node-click="handleNodeClick"
:indent=1>
<span class="custom-tree-node" slot-scope="{ node, data }">
<span class="first-span" :title="node.label">{{ node.label }}</span>
<span class="list-span">
......@@ -34,7 +34,7 @@
</el-tree>
</div>
<div class="right-div">
<component :is="currentRole" :clientDetails="clientDetails_s" ref="mychild" />
<component :is="currentRole" :clientDetails="clientDetails_s" :treeData="tree_data" ref="mychild" />
</div>
<el-dialog title="新增文件夹" :visible.sync="dialogVisible">
<span class="dialogContent"><span><span style="color:red">*</span>名称:</span>
......@@ -66,7 +66,7 @@ export default {
components: { navs },
data() {
return {
clientDetails_s: { type: [this.fl_type], module_name: this.module_name, type_folder: this.type_folder, fl_type: this.fl_type, checkList: [] },
clientDetails_s: { type: [this.fl_type], module_name: this.module_name, type_folder: this.type_folder, fl_type: this.fl_type},
currentRole: "navs",
tree_data: [], //左侧树结构的数据
dialogVisible: false, //新增子节点弹出框
......@@ -83,7 +83,6 @@ export default {
module_name: '',
fl_type: '',
type_folder: '',
checkboxList: [],
nodeClickList: []
};
},
......@@ -222,7 +221,7 @@ export default {
if (res.length > 0) {
arr.push(res[0].id)
}
this.clientDetails_s = { type: arr, module_name: this.module_name, type_folder: this.type_folder, fl_type: this.fl_type, checkList: this.checkboxList };
this.clientDetails_s = { type: arr, module_name: this.module_name, type_folder: this.type_folder, fl_type: this.fl_type};
})
.catch((err) => {
this.$message.warning(err.message);
......@@ -239,19 +238,7 @@ export default {
if (data.childNodes.length > 0) {
this.nodeClickList.push(data.childNodes[0].data.id)
}
this.clientDetails_s = { type: this.nodeClickList, module_name: this.module_name, type_folder: this.type_folder, fl_type: this.fl_type, checkList: this.checkboxList };
},
handleCheckChange(node, isSelected) {
this.currentRole = "navs";
if (isSelected) {
this.checkboxList.push(node.id);
} else {
this.checkboxList = this.checkboxList.filter(item => {
return item != node.id
})
}
// this.clientDetails_s['checkList'] = this.checkboxList;
this.clientDetails_s = { type: this.nodeClickList, module_name: this.module_name, type_folder: this.type_folder, fl_type: this.fl_type, checkList: this.checkboxList };
this.clientDetails_s = { type: this.nodeClickList, module_name: this.module_name, type_folder: this.type_folder, fl_type: this.fl_type};
}
},
watch: {
......@@ -262,7 +249,6 @@ export default {
this.module_name = val.module_name;
this.fl_type = val.fl_type;
this.type_folder = val.type_folder;
this.checkboxList = [];
this.query_tree();
},
},
......
......@@ -198,7 +198,8 @@
</div>
</div>
</div>
<el-dialog title="新增文档" :visible.sync="centerDialogVisible_add" width="30%" center class="xzwd">
<el-dialog v-if="centerDialogVisible_add" title="新增文档" :visible.sync="centerDialogVisible_add" width="30%"
center class="xzwd">
<el-form :model="form_add" label-width="80px" style="margin-bottom: 0px" ref="forms" :rules="rules">
<el-form-item label="文档名称" prop="name">
<el-input v-model="form_add.name" maxlength="20" show-word-limit placeholder="请输入文档名称"></el-input>
......@@ -232,6 +233,12 @@
</div>
</el-upload>
</el-form-item>
<el-form-item label="选择目录">
<el-tree class="myTree" :data="tree_data" node-key="id" show-checkbox :expand-on-click-node="false"
highlight-current :props="defaultProps" :check-strictly="true" ref="tree"
:default-expanded-keys="[this.fl_type]" @check-change="handleCheckChange" :indent=1>
</el-tree>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="centerDialogVisible_add = false">取 消</el-button>
......@@ -270,9 +277,10 @@
</span>
</el-dialog>
<el-dialog title="大文件上传" :visible.sync="centerDialogVisible_bigFile" width="30%" center class="xzwd">
<BigfileUpload :checkFileExist="checkFileExist" :addFileInfo="addFileInfo"
@Finished="bigFileUploadFinished">
<el-dialog v-if="centerDialogVisible_bigFile" title="大文件上传" :visible.sync="centerDialogVisible_bigFile"
width="30%" center class="xzwd">
<BigfileUpload :checkFileExist="checkFileExist" :addFileInfo="addFileInfo" :treeDataBig="tree_data"
:flType="fl_type" @Finished="bigFileUploadFinished">
</BigfileUpload>
</el-dialog>
......@@ -380,6 +388,11 @@ export default {
fileList: [
{ required: true, message: '请选择文件', trigger: 'change' }
]
},
tree_data: [],
defaultProps: {
children: 'children',
label: 'label'
}
};
},
......@@ -392,6 +405,10 @@ export default {
type: Object,
default: {},
},
treeData: {
type: Array,
default: []
}
},
methods: {
//列表动画效果结束让全文动画开始
......@@ -602,7 +619,6 @@ export default {
},
//文件下载
downloadLiterature(index, row) {
debugger
downloadDocument('Document', row.file.uuid, row.file.name);
},
//打开软件
......@@ -704,13 +720,13 @@ export default {
//新增弹出框弹出
handleAdd() {
if (this.clientDetails_check_type.length == 0 || this.clientDetails_check_type.includes(1) || this.clientDetails_check_type.includes(2) || this.clientDetails_check_type.includes(3) || this.clientDetails_check_type.includes(4)) {
this.$message({
type: "warning",
message: "请选择文档列表子节点",
});
return;
}
// if (this.clientDetails_check_type.length == 0 || this.clientDetails_check_type.includes(1) || this.clientDetails_check_type.includes(2) || this.clientDetails_check_type.includes(3) || this.clientDetails_check_type.includes(4)) {
// this.$message({
// type: "warning",
// message: "请选择文档列表子节点",
// });
// return;
// }
let _this = this;
//设置下拉框默认选择第一条
// _this.form_add.region = _this.options[0].value;
......@@ -721,13 +737,13 @@ export default {
},
bigFileUploadAdd() {//弹出
if (this.clientDetails_check_type.length == 0 || this.clientDetails_check_type.includes(1) || this.clientDetails_check_type.includes(2) || this.clientDetails_check_type.includes(3) || this.clientDetails_check_type.includes(4)) {
this.$message({
type: "warning",
message: "请选择文档列表子节点",
});
return;
}
// if (this.clientDetails_check_type.length == 0 || this.clientDetails_check_type.includes(1) || this.clientDetails_check_type.includes(2) || this.clientDetails_check_type.includes(3) || this.clientDetails_check_type.includes(4)) {
// this.$message({
// type: "warning",
// message: "请选择文档列表子节点",
// });
// return;
// }
let _this = this;
_this.centerDialogVisible_bigFile = true;
},
......@@ -742,7 +758,7 @@ export default {
createId: this.$store.getters.userInfo.account,
description: null,
file: evt.file,
treeId: this.clientDetails_check_type.join(','),
treeId: evt.treeId.join(','),
name: evt.file.name,
keyword: null,
module: this.module_name
......@@ -876,6 +892,7 @@ export default {
endLoading();
console.log("loaded");
self.handleCurrentChange_lb(1);
this.clientDetails_check_type = [];
}).catch(err => {
endLoading();
console.log("error");
......@@ -980,6 +997,15 @@ export default {
this.searchs(1);
this.wjfx_qh = true;
},
handleCheckChange(node, isSelected) {
if (isSelected) {
this.clientDetails_check_type.push(node.id);
} else {
this.clientDetails_check_type = this.clientDetails_check_type.filter(item => {
return item != node.id
})
}
}
},
mounted() {
let _this = this;
......@@ -1032,7 +1058,6 @@ export default {
},
clientDetails: function (val) {
this.clientDetails_type = val.type;
this.clientDetails_check_type = val.checkList;
this.module_name = val.module_name;
this.type_folder = val.type_folder;
this.fl_type = val.fl_type;
......@@ -1047,6 +1072,9 @@ export default {
this.znjsfx_name = "";
this.searchs(1);
},
treeData: function (val) {
this.tree_data = val;
}
},
};
</script>
......@@ -1504,5 +1532,152 @@ export default {
padding: 25px 25px 0px;
}
}
.myTree>.el-tree-node>.el-tree-node__content .el-checkbox {
display: none;
}
.el-tree {
color: white;
background: transparent;
// height: 150px;
// max-height: 200px;
margin-top: 10px;
// overflow-y: auto;
.el-tree-node__content {
height: 40px;
// .el-icon-circle-plus {
// display: none;
// }
// .el-icon-error {
// display: none;
// }
// .el-icon-upload {
// display: none;
// }
// .el-icon-edit-outline {
// display: none;
// }
// .list-span{
// display: none;
// }
}
.el-tree-node {
position: relative;
padding-left: 0px; // 缩进量
}
.el-tree-node__children {
padding-left: 15px; // 缩进量
}
// 竖线
.el-tree-node::before {
content: "";
height: 100%;
width: 1px;
position: absolute;
left: -3px;
top: -17px;
border-width: 1px;
border-left: 1px solid #1895a2;
}
// 当前层最后一个节点的竖线高度固定
.el-tree-node:last-child::before {
height: 38px; // 可以自己调节到合适数值
}
// 横线
.el-tree-node::after {
content: "";
width: 13px;
height: 20px;
position: absolute;
left: -3px;
top: 20px;
border-width: 1px;
border-top: 1px solid #1895a2;
}
// 去掉最顶层的虚线,放最下面样式才不会被上面的覆盖了
&>.el-tree-node::after {
border-top: none;
}
&>.el-tree-node::before {
border-left: none;
}
// 展开关闭的icon
.el-tree-node__expand-icon {
font-size: 16px;
// 叶子节点(无子节点)
&.is-leaf {
color: transparent;
// display: none; // 也可以去掉
}
}
}
.el-tree>.el-tree-node>.el-tree-node__content {
height: 40px;
background: none !important;
border: 1px solid #146a80 !important;
box-shadow: 0 0 10px #1b6097;
// background-image: url(../../assets/img/yqjc/24.png);
// background-repeat: no-repeat;
// background-size: 100% 100%;
.el-icon-error {
display: none !important;
}
.el-icon-edit-outline {
display: none !important;
}
}
.el-tree>.el-tree-node>.el-tree-node__children>.el-tree-node>.el-tree-node__content {
height: 40px;
// background-image: url(../../assets/img/yqjc/24.png);
background-repeat: no-repeat;
background-size: 100% 100%;
}
.el-tree>.el-tree-node>.el-tree-node__content>.el-tree-node__label {
font-size: 16px !important;
}
.el-tree>.el-tree-node>.el-tree-node__children {
background-color: #1d2d46ad !important;
width: calc(100% - 15px);
// height: calc(100% - 44px);
// overflow: auto;
// position: relative;
// .el-tree-node{
// width: 300px;
// }
}
.el-tree-node:focus>.el-tree-node__content {
background-color: #00648a96 !important;
// border-radius: 5px;
}
.el-tree-node__content:hover,
.el-tree-node__content:focus {
background-color: #00638a50 !important;
// border-radius: 5px;
}
.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
background-color: #00648a96 !important;
// border-radius: 5px;
}
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment