|
@@ -218,28 +218,32 @@ const saveGroup = () => {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
-const onMove = (src, target) => new Promise(reslove => request.send('/resource/move', { src: src.id, groupId: target.groupId || target.id }).success(r => {
|
|
|
|
- const msgId = src.folder ? 'resource.moveGroup' : 'resource.moveResource'
|
|
|
|
- const path = getFullPath(src)
|
|
|
|
- if(r){
|
|
|
|
- if(src.folder){
|
|
|
|
- bus.status(msgId + 'Success', true, props.title, path)
|
|
|
|
- } else {
|
|
|
|
- bus.status(msgId + 'Success', true, path)
|
|
|
|
- }
|
|
|
|
- src[src.folder ? 'parentId' : 'groupId'] = target.groupId || target.id
|
|
|
|
|
|
+const onMove = (src, target) => new Promise(reslove => {
|
|
|
|
+ proxy.$confirm($i('message.move'), $i('resource.move', getFullPath(src)), ()=> {
|
|
|
|
+ request.send('/resource/move', { src: src.id, groupId: target.groupId || target.id }).success(r => {
|
|
|
|
+ const msgId = src.folder ? 'resource.moveGroup' : 'resource.moveResource'
|
|
|
|
+ const path = getFullPath(src)
|
|
|
|
+ if(r){
|
|
|
|
+ if(src.folder){
|
|
|
|
+ bus.status(msgId + 'Success', true, props.title, path)
|
|
|
|
+ } else {
|
|
|
|
+ bus.status(msgId + 'Success', true, path)
|
|
|
|
+ }
|
|
|
|
+ src[src.folder ? 'parentId' : 'groupId'] = target.groupId || target.id
|
|
|
|
|
|
- }else{
|
|
|
|
- if(src.folder){
|
|
|
|
- bus.status(msgId + 'Failed', false, props.title, path)
|
|
|
|
- proxy.$alert($i(msgId + 'Failed', props.title, path))
|
|
|
|
- } else {
|
|
|
|
- bus.status(msgId + 'Failed', false, path)
|
|
|
|
- proxy.$alert($i(msgId + 'Failed', path))
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- reslove(r)
|
|
|
|
-}))
|
|
|
|
|
|
+ }else{
|
|
|
|
+ if(src.folder){
|
|
|
|
+ bus.status(msgId + 'Failed', false, props.title, path)
|
|
|
|
+ proxy.$alert($i(msgId + 'Failed', props.title, path))
|
|
|
|
+ } else {
|
|
|
|
+ bus.status(msgId + 'Failed', false, path)
|
|
|
|
+ proxy.$alert($i(msgId + 'Failed', path))
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ reslove(r)
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+})
|
|
const deleteNode = (node, data) => {
|
|
const deleteNode = (node, data) => {
|
|
data = data || tree.value
|
|
data = data || tree.value
|
|
const index = data.findIndex(it => it === node || it.id === node.id)
|
|
const index = data.findIndex(it => it === node || it.id === node.id)
|