|
@@ -45,12 +45,13 @@
|
|
|
<div v-if="showActionDiv" ref="actionDiv" :style="actionDivStyle" class="action-div">
|
|
|
<div @click="actionDelete">删除</div>
|
|
|
<div @click="actionRename">重命名</div>
|
|
|
+ <div @click="actionAdd" v-if="actionType.split('-').length == 1" ref="addTypeAction">添加分类</div>
|
|
|
<div class="move" v-if="pidArray.length">
|
|
|
<span>移动</span>
|
|
|
<div class="pid_box">
|
|
|
<div v-for="(item, index) in pidArray" :key="index" @click="actionMove(item)">
|
|
|
<!-- <el-tooltip :content="item.name" placement="right" effect="dark"> -->
|
|
|
- <span>{{ item.name }}</span>
|
|
|
+ <span>{{ item.name }}</span>
|
|
|
<!-- </el-tooltip> -->
|
|
|
</div>
|
|
|
</div>
|
|
@@ -59,7 +60,8 @@
|
|
|
</div>
|
|
|
<div class="l_file_box">
|
|
|
<div class="l_none" v-if="pid != 'wu' && pid.split('-').length == 1">请添加二级分类</div>
|
|
|
- <fileBox :userid="userid" :typeArray="typeArray" :pid="pid" :type='type' @addFile="addFile" ref="fileBox" v-else></fileBox>
|
|
|
+ <fileBox :userid="userid" :typeArray="typeArray" :pid="pid" :type='type' @addFile="addFile" ref="fileBox" v-else>
|
|
|
+ </fileBox>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -123,18 +125,18 @@ export default {
|
|
|
|
|
|
let _pid = this.pid.split('-')
|
|
|
if (_pid.length === 1 && this.pid != 'wu') {
|
|
|
- if(pid[_pid[0]]){
|
|
|
+ if (pid[_pid[0]]) {
|
|
|
pid[_pid[0]].open = true
|
|
|
this.pid = this.pid + '-0'
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
this.pid = 'wu'
|
|
|
};
|
|
|
this.checkType(this.pid);
|
|
|
- }else if(_pid.length > 1){
|
|
|
- if (this.typeArray[_pid[0]].child.length > 0 && (parseInt(_pid[1])+1) > this.typeArray[_pid[0]].child.length) {
|
|
|
+ } else if (_pid.length > 1) {
|
|
|
+ if (this.typeArray[_pid[0]].child.length > 0 && (parseInt(_pid[1]) + 1) > this.typeArray[_pid[0]].child.length) {
|
|
|
this.pid = _pid[0] + '-0';
|
|
|
this.checkType(this.pid);
|
|
|
- }else if((parseInt(_pid[1])+1) > this.typeArray[_pid[0]].child.length){
|
|
|
+ } else if ((parseInt(_pid[1]) + 1) > this.typeArray[_pid[0]].child.length) {
|
|
|
this.checkType(_pid[0]);
|
|
|
}
|
|
|
}
|
|
@@ -147,20 +149,20 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
addClick() {
|
|
|
- if (this.pid == 'wu') {
|
|
|
- this.addVisbile = true;
|
|
|
- this.addInput = '一级分类标签'
|
|
|
- setTimeout(() => {
|
|
|
- this.$refs.divToHide.children[0].select()
|
|
|
- }, 500);
|
|
|
- } else {
|
|
|
- let check = this.pid.split('-')
|
|
|
- this.addVisbile2 = parseInt(check[0]);
|
|
|
- this.addInput = '二级分类标签'
|
|
|
- setTimeout(() => {
|
|
|
- this.$refs.divToHide2[0].children[0].select()
|
|
|
- }, 500);
|
|
|
- }
|
|
|
+ // if (this.pid == 'wu') {
|
|
|
+ this.addVisbile = true;
|
|
|
+ this.addInput = '一级分类标签'
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$refs.divToHide.children[0].select()
|
|
|
+ }, 500);
|
|
|
+ // } else {
|
|
|
+ // let check = this.pid.split('-')
|
|
|
+ // this.addVisbile2 = parseInt(check[0]);
|
|
|
+ // this.addInput = '二级分类标签'
|
|
|
+ // setTimeout(() => {
|
|
|
+ // this.$refs.divToHide2[0].children[0].select()
|
|
|
+ // }, 500);
|
|
|
+ // }
|
|
|
|
|
|
},
|
|
|
addType() {
|
|
@@ -217,6 +219,7 @@ export default {
|
|
|
const target = event.target;
|
|
|
const divToHide = this.$refs.divToHide; // 获取需要隐藏的 div 的引用
|
|
|
const divToHide2 = this.$refs.divToHide2; // 获取需要隐藏的 div 的引用
|
|
|
+ const addTypeAction = this.$refs.addTypeAction
|
|
|
const divToHide3 = this.$refs.divToHide3; // 获取需要隐藏的 div 的引用
|
|
|
const divToHide4 = this.$refs.actionDiv; // 获取需要隐藏的 div 的引用
|
|
|
const divToHide5 = this.$refs.divToHide5; // 获取需要隐藏的 div 的引用
|
|
@@ -226,7 +229,11 @@ export default {
|
|
|
// 点击的不是需要隐藏的 div,则隐藏它
|
|
|
this.addVisbile = false
|
|
|
}
|
|
|
- if (divToHide2 && divToHide2[0] && !divToHide2[0].contains(target) && divToHide3 && !divToHide3.contains(target)) {
|
|
|
+ // if (divToHide2 && divToHide2[0] && !divToHide2[0].contains(target) && divToHide3 && !divToHide3.contains(target)) {
|
|
|
+ // // 点击的不是需要隐藏的 div,则隐藏它
|
|
|
+ // this.addVisbile2 = ''
|
|
|
+ // }
|
|
|
+ if (divToHide2 && divToHide2[0] && !divToHide2[0].contains(target) && addTypeAction && !addTypeAction.contains(target)) {
|
|
|
// 点击的不是需要隐藏的 div,则隐藏它
|
|
|
this.addVisbile2 = ''
|
|
|
}
|
|
@@ -261,7 +268,7 @@ export default {
|
|
|
let type = this.actionType.split('-')
|
|
|
let id = this.typeArray[type[0]].child[type[1]].id
|
|
|
this
|
|
|
- .$confirm('确定移动到'+pid.name+'吗?并且此分类的底下的文件也会跟随!', "提示", {
|
|
|
+ .$confirm('确定移动到' + pid.name + '吗?并且此分类的底下的文件也会跟随!', "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning",
|
|
@@ -302,6 +309,20 @@ export default {
|
|
|
this.showActionDiv = false
|
|
|
}, 500);
|
|
|
},
|
|
|
+ actionAdd() {
|
|
|
+ let type = this.actionType.split('-')
|
|
|
+ if (type.length > 1) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let check = type
|
|
|
+ this.checkType(this.actionType)
|
|
|
+ this.addVisbile2 = parseInt(check[0]);
|
|
|
+ this.addInput = '二级分类标签'
|
|
|
+ this.showActionDiv = false
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$refs.divToHide2[0].children[0].select()
|
|
|
+ }, 500);
|
|
|
+ },
|
|
|
rename() {
|
|
|
if (!this.renameInput) {
|
|
|
this.$message.error('请输入分类名字');
|
|
@@ -368,7 +389,7 @@ export default {
|
|
|
.catch(() => {
|
|
|
});
|
|
|
},
|
|
|
- addFile(file){
|
|
|
+ addFile(file) {
|
|
|
this.$emit('addFile', file)
|
|
|
}
|
|
|
},
|
|
@@ -719,7 +740,7 @@ export default {
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
|
|
|
-.l_none{
|
|
|
+.l_none {
|
|
|
color: #00000069;
|
|
|
width: 100%;
|
|
|
height: 100%;
|