|
@@ -27,8 +27,9 @@
|
|
|
>
|
|
|
|
|
|
<span slot-scope="{ node, data }" style="width:100%;" class="custom-tree-node" @mouseenter="mouseenter(data)" @mouseleave="mouseleave(data)">
|
|
|
- <span :title="data.label" class="span_el" @dblclick="dblclick(data)">{{ node.label | ellipsis }}</span>
|
|
|
+ <span v-if="!data.que1" :title="data.label" class="span_el" @dblclick="dblclick(data)">{{ node.label | ellipsis }}</span>
|
|
|
<el-input v-if="data.que" ref="get_Input" v-model="node_Name.name" size="mini" @blur="queryNodeName(node_Name.name, data)">输入框</el-input>
|
|
|
+ <el-input v-if="data.que1" ref="get_Input1" v-model="node_Name.names" size="mini" placeholder="新建文件夹" @blur="blurEvent(node_Name.names, data)">输入框</el-input>
|
|
|
<el-dropdown v-show="data.del" style="margin-left:10px" trigger="click">
|
|
|
<span class="el-dropdown-link">
|
|
|
···<i class="el-icon--right" />
|
|
@@ -288,12 +289,61 @@ export default {
|
|
|
this.$refs.get_Input.focus()
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
// 添加节点
|
|
|
append(data) {
|
|
|
+ this.key_arr = []
|
|
|
+ const newChild = { id: Math.round(Math.random()), label: '', children: [] }
|
|
|
+ if (!data.children) {
|
|
|
+ this.$set(data, 'children', [])
|
|
|
+ }
|
|
|
+ data.children.push(newChild)
|
|
|
+ this.$set(newChild, 'que1', true)
|
|
|
+ this.$set(this.node_Name, 'names', '新建文件夹')
|
|
|
+ this.key_arr.push(newChild.id)
|
|
|
+ this.$nextTick(() => {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$refs.get_Input1.focus()
|
|
|
+ })
|
|
|
+ this.$refs.get_Input1.focus()
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // // 添加节点
|
|
|
+ // append(data) {
|
|
|
+ // this.formData = {
|
|
|
+ // bizId: this.bizJson,
|
|
|
+ // folderName: '新建子节点',
|
|
|
+ // xmindUrl: '',
|
|
|
+ // parentFolderId: this.startId,
|
|
|
+ // creator: this.userInformation,
|
|
|
+ // modifier: this.userInformation
|
|
|
+ // }
|
|
|
+ // createFolderData(this.formData).then(res => {
|
|
|
+ // if (res.code === 200) {
|
|
|
+ // this.key_arr = []
|
|
|
+ // const newChild = { id: res.data, label: '新建子节点', children: [] }
|
|
|
+ // if (!data.children) {
|
|
|
+ // this.$set(data, 'children', [])
|
|
|
+ // }
|
|
|
+ // data.children.push(newChild)
|
|
|
+ // this.$message({ message: res.msg, type: 'success', duration: 1000, offset: 150 })
|
|
|
+ // this.data1 = []
|
|
|
+ // this.AllQueryFolderData(this.bizJson)
|
|
|
+ // this.key_arr.push(this.startId)
|
|
|
+ // this.add_Folder = ''
|
|
|
+ // } else {
|
|
|
+ // this.$message({ message: res.msg, type: 'error', duration: 1000, offset: 150 })
|
|
|
+ // this.add_Folder = ''
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // },
|
|
|
+
|
|
|
+ blurEvent(name, data) {
|
|
|
+ this.key_arr = []
|
|
|
+ this.$set(data, 'que1', false)
|
|
|
this.formData = {
|
|
|
bizId: this.bizJson,
|
|
|
- folderName: '新建子节点',
|
|
|
+ folderName: name,
|
|
|
xmindUrl: '',
|
|
|
parentFolderId: this.startId,
|
|
|
creator: this.userInformation,
|
|
@@ -301,20 +351,13 @@ export default {
|
|
|
}
|
|
|
createFolderData(this.formData).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
- this.key_arr = []
|
|
|
- const newChild = { id: res.data, label: '新建子节点', children: [] }
|
|
|
- if (!data.children) {
|
|
|
- this.$set(data, 'children', [])
|
|
|
- }
|
|
|
- data.children.push(newChild)
|
|
|
this.$message({ message: res.msg, type: 'success', duration: 1000, offset: 150 })
|
|
|
this.data1 = []
|
|
|
this.AllQueryFolderData(this.bizJson)
|
|
|
this.key_arr.push(this.startId)
|
|
|
- this.add_Folder = ''
|
|
|
} else {
|
|
|
+ this.AllQueryFolderData(this.bizJson)
|
|
|
this.$message({ message: res.msg, type: 'error', duration: 1000, offset: 150 })
|
|
|
- this.add_Folder = ''
|
|
|
}
|
|
|
})
|
|
|
},
|