|
@@ -1,52 +1,69 @@
|
|
|
<template>
|
|
|
- <basic-container>
|
|
|
- <el-row :gutter="20">
|
|
|
+ <basic-container
|
|
|
+ ref="container"
|
|
|
+ style="height:100%;"
|
|
|
+ >
|
|
|
+ <el-row
|
|
|
+ :gutter="20"
|
|
|
+ :style="{'height':heights-80+'px','overflow': 'hidden'}"
|
|
|
+ >
|
|
|
<el-col
|
|
|
- span="9"
|
|
|
+ span="12"
|
|
|
class='marleft20'
|
|
|
>
|
|
|
- <h2>归档目录树</h2>
|
|
|
- <el-tree
|
|
|
- v-if="leftTree"
|
|
|
- :props="props"
|
|
|
- :load="loadNode"
|
|
|
- :data="data"
|
|
|
- lazy
|
|
|
- >
|
|
|
- <span
|
|
|
- class=" flexStar"
|
|
|
- slot-scope="{ node, data }"
|
|
|
+ <div>
|
|
|
+ <h2>归档目录树</h2>
|
|
|
+ <el-tree
|
|
|
+ v-if="leftTree"
|
|
|
+ :props="props"
|
|
|
+ :load="loadNode"
|
|
|
+ :data="data"
|
|
|
+ lazy
|
|
|
>
|
|
|
- <span>{{ data.title }}</span>
|
|
|
- <span class="marleft10">
|
|
|
- <i
|
|
|
- @click.stop='addtree(data)'
|
|
|
- class="el-icon-circle-plus-outline"
|
|
|
- style="fontSize:18px;"
|
|
|
- v-if="data.isStorageNode!=1"
|
|
|
- ></i>
|
|
|
- <i
|
|
|
- @click.stop='edittree(data)'
|
|
|
- class="el-icon-edit-outline marleft5"
|
|
|
- style="fontSize:18px;"
|
|
|
- v-if="node.level!=1"
|
|
|
- ></i>
|
|
|
- <i
|
|
|
- @click.stop='deletetree(data)'
|
|
|
- class="el-icon-delete marleft5"
|
|
|
- style="fontSize:18px;"
|
|
|
- v-if="node.level!=1"
|
|
|
- ></i>
|
|
|
+ <span
|
|
|
+ class=" flexStar"
|
|
|
+ slot-scope="{ node, data }"
|
|
|
+ @mouseover="mouseOver(data)"
|
|
|
+ @mouseleave="mouseLeave(data)"
|
|
|
+ style="box-sizing: border-box;width:100%;"
|
|
|
+ >
|
|
|
+ <span>{{ data.title }}</span>
|
|
|
+ <span
|
|
|
+ class="marleft10"
|
|
|
+ v-show="data.moreShow"
|
|
|
+ >
|
|
|
+ <i
|
|
|
+ @click.stop='addtree(data)'
|
|
|
+ class="el-icon-circle-plus-outline"
|
|
|
+ style="fontSize:18px;"
|
|
|
+ v-if="data.isStorageNode!=1"
|
|
|
+ ></i>
|
|
|
+ <i
|
|
|
+ @click.stop='edittree(data)'
|
|
|
+ class="el-icon-edit-outline marleft5"
|
|
|
+ style="fontSize:18px;"
|
|
|
+ v-if="node.level!=1"
|
|
|
+ ></i>
|
|
|
+ <i
|
|
|
+ @click.stop='deletetree(data)'
|
|
|
+ class="el-icon-delete marleft5"
|
|
|
+ style="fontSize:18px;"
|
|
|
+ v-if="node.level!=1"
|
|
|
+ ></i>
|
|
|
+ </span>
|
|
|
</span>
|
|
|
- </span>
|
|
|
- </el-tree>
|
|
|
+ </el-tree>
|
|
|
+ </div>
|
|
|
</el-col>
|
|
|
<el-col
|
|
|
- span="7"
|
|
|
+ span="9"
|
|
|
style="padding-top:30px;"
|
|
|
>
|
|
|
<h3>上传文件入口显示配置</h3>
|
|
|
- <div class="peizhi">
|
|
|
+ <div
|
|
|
+ class="peizhi"
|
|
|
+ :style="{'height':heights-210+'px','overflow': 'hidden'}"
|
|
|
+ >
|
|
|
<div class="flexEnd">
|
|
|
<i
|
|
|
@click="rightPushTree"
|
|
@@ -416,6 +433,7 @@ export default {
|
|
|
dialogData: [],
|
|
|
checkXuan: [],
|
|
|
//#endregion
|
|
|
+ heights: '',
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -423,12 +441,12 @@ export default {
|
|
|
async loadNode (node, resolve) {
|
|
|
console.log(node);
|
|
|
if (node.level === 0) {
|
|
|
- resolve([{
|
|
|
- title: '系统级归档模板',
|
|
|
- hasChildren: false,
|
|
|
- id: 0,
|
|
|
- isStorageNode: 0,
|
|
|
- }])
|
|
|
+ let ks = await this.lazyTree(0)
|
|
|
+ if (ks.length) {
|
|
|
+ resolve(ks)
|
|
|
+ } else {
|
|
|
+ this.archiveTreeInit()
|
|
|
+ }
|
|
|
} else {
|
|
|
resolve(await this.lazyTree(node.data.id))
|
|
|
}
|
|
@@ -436,6 +454,14 @@ export default {
|
|
|
async archiveTreeInit () {//添加根节点
|
|
|
const { data: res } = await archiveTreeInit()
|
|
|
console.log(res);
|
|
|
+ if (res.code == 200 && res.msg == '操作成功') {
|
|
|
+ res.data.forEach(val => {
|
|
|
+ val.hasChildren = !val.hasChildren
|
|
|
+ });
|
|
|
+ return res.data
|
|
|
+ } else if (res.code == 200 && res.msg == "未查询到信息") {
|
|
|
+ return []
|
|
|
+ }
|
|
|
},
|
|
|
async lazyTree (parentId) {//树节点懒加载
|
|
|
const { data: res } = await lazyTree({
|
|
@@ -452,6 +478,17 @@ export default {
|
|
|
return []
|
|
|
}
|
|
|
},
|
|
|
+ mouseLeave (data) {
|
|
|
+ if (data.moreShow) {
|
|
|
+ console.log(this.$set(data, 'moreShow', false));
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mouseOver (data) {
|
|
|
+ if (!data.moreShow) {
|
|
|
+ console.log(this.$set(data, 'moreShow', true));
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
addtree (data) {//添加树
|
|
|
if (this.JobTypeList.length == 0) {
|
|
|
this.roletree()
|
|
@@ -745,15 +782,22 @@ export default {
|
|
|
saveFile () {//保存按钮
|
|
|
let arr = this.$refs.trees.getCheckedKeys()
|
|
|
console.log(arr);
|
|
|
- // this.$refs.trees.setCheckedKeys(this.checkXuan);
|
|
|
- // let ids = ''
|
|
|
- // arr.forEach((val, key) => {
|
|
|
- // ids += val
|
|
|
- // if (key != arr.length - 1) {
|
|
|
- // ids += ','
|
|
|
- // }
|
|
|
- // })
|
|
|
- // this.submitDisplayConfigTree(ids)
|
|
|
+ if (arr.length > 0) {
|
|
|
+ // this.$refs.trees.setCheckedKeys(this.checkXuan);
|
|
|
+ // let ids = ''
|
|
|
+ // arr.forEach((val, key) => {
|
|
|
+ // ids += val
|
|
|
+ // if (key != arr.length - 1) {
|
|
|
+ // ids += ','
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // this.submitDisplayConfigTree(ids)
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: '请先设置配置文件'
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
handleCheckChange (data, checked, indeterminate) {
|
|
|
console.log(data, checked, indeterminate);
|
|
@@ -774,6 +818,9 @@ export default {
|
|
|
nodeType: 2,
|
|
|
})
|
|
|
},
|
|
|
+ mounted () {
|
|
|
+ this.heights = this.$refs.container.$el.offsetHeight
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
|
|
@@ -782,6 +829,5 @@ export default {
|
|
|
border: 1px solid #e5e5e5;
|
|
|
border-radius: 5px;
|
|
|
padding: 15px 10px;
|
|
|
- min-height: 600px;
|
|
|
}
|
|
|
</style>
|