|
@@ -156,7 +156,7 @@ const getFullPath = (item, onlyPath) => {
|
|
|
}
|
|
|
const filterText = (item) => getFullPath(item)
|
|
|
const cachedItems = []
|
|
|
-const onItemClick = item => {
|
|
|
+const onItemClick = (item, force) => {
|
|
|
if(item) {
|
|
|
if(item.folder){
|
|
|
bus.$emit(Message.OPEN_GROUP, item)
|
|
@@ -186,7 +186,7 @@ const onItemClick = item => {
|
|
|
})
|
|
|
cachedItems.push(opened)
|
|
|
}
|
|
|
- bus.$emit(Message.OPEN, opened)
|
|
|
+ bus.$emit(Message.OPEN, opened, force)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -275,7 +275,7 @@ const updateNode = (node, data) => {
|
|
|
bus.$on(Message.OPEN_ITEM, item => {
|
|
|
const array = toRaw(tree.value)
|
|
|
if(array){
|
|
|
- onItemClick(deepFind(toRaw(item), array, [], []))
|
|
|
+ onItemClick(deepFind(toRaw(item), array, [], []), true)
|
|
|
}
|
|
|
})
|
|
|
const onContextMenu = (item, event) => {
|
|
@@ -293,7 +293,7 @@ const onContextMenu = (item, event) => {
|
|
|
path: config.requirePath ? '' : undefined
|
|
|
}
|
|
|
updateNode(info)
|
|
|
- onItemClick(info)
|
|
|
+ onItemClick(info, true)
|
|
|
}
|
|
|
},{
|
|
|
label: $i('resource.createGroup'),
|
|
@@ -383,7 +383,7 @@ const onContextMenu = (item, event) => {
|
|
|
request.send(`/resource/file/${item.id}`).success(res => {
|
|
|
res.id = `copy${new Date().getTime()}d${parseInt(Math.random() * 100000)}`
|
|
|
updateNode(res)
|
|
|
- onItemClick(res)
|
|
|
+ onItemClick(res, true)
|
|
|
res.name = res.name + `(${$i('message.copy')})`
|
|
|
if(config.requirePath){
|
|
|
res.path = res.path + '_copy'
|