feat: 右键功能新增'新建文件夹'
This commit is contained in:
parent
88c1801496
commit
82c6b84be3
@ -1823,6 +1823,7 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.newFolderLoading = true
|
this.newFolderLoading = true
|
||||||
|
this.createFileLoading = true
|
||||||
api.uploadFolder({
|
api.uploadFolder({
|
||||||
isFolder: true,
|
isFolder: true,
|
||||||
filename: encodeURI(this.newFolderName),
|
filename: encodeURI(this.newFolderName),
|
||||||
@ -1837,6 +1838,8 @@ export default {
|
|||||||
type: 'warning'
|
type: 'warning'
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
this.createFileLoading = false
|
||||||
|
this.newCreateFileDialog = false
|
||||||
this.newFolderLoading = false
|
this.newFolderLoading = false
|
||||||
this.showNewFolder = false
|
this.showNewFolder = false
|
||||||
this.isShowNewFolder = false
|
this.isShowNewFolder = false
|
||||||
@ -1853,6 +1856,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.newFolderLoading = false
|
this.newFolderLoading = false
|
||||||
|
this.createFileLoading = false
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.newFolderLoading = false
|
this.newFolderLoading = false
|
||||||
@ -1864,6 +1868,11 @@ export default {
|
|||||||
},
|
},
|
||||||
// 新建文件
|
// 新建文件
|
||||||
createFile(newFileName) {
|
createFile(newFileName) {
|
||||||
|
if (this.newCreateFileDialogTitle === "新建文件夹") {
|
||||||
|
this.newFolderName = newFileName
|
||||||
|
this.newFolderNameClick()
|
||||||
|
return
|
||||||
|
}
|
||||||
if (newFileName) {
|
if (newFileName) {
|
||||||
if (/[\[\]\/\\"<>\?\*]/gi.test(newFileName)) {
|
if (/[\[\]\/\\"<>\?\*]/gi.test(newFileName)) {
|
||||||
this.$message({
|
this.$message({
|
||||||
@ -2636,6 +2645,10 @@ export default {
|
|||||||
this.newCreateFileDialogTitle = "新建文本文件"
|
this.newCreateFileDialogTitle = "新建文本文件"
|
||||||
this.createNewFile('txt')
|
this.createNewFile('txt')
|
||||||
break
|
break
|
||||||
|
case 'createFolder':
|
||||||
|
this.newCreateFileDialogTitle = "新建文件夹"
|
||||||
|
this.createNewFile('')
|
||||||
|
break
|
||||||
case 'createDrawioFile':
|
case 'createDrawioFile':
|
||||||
this.newCreateFileDialogTitle = "新建流程图"
|
this.newCreateFileDialogTitle = "新建流程图"
|
||||||
this.createNewFile('drawio')
|
this.createNewFile('drawio')
|
||||||
@ -2663,7 +2676,11 @@ export default {
|
|||||||
},
|
},
|
||||||
// 新建文件
|
// 新建文件
|
||||||
createNewFile(suffix) {
|
createNewFile(suffix) {
|
||||||
this.newCreateFileName = `未命名文件.${suffix}`
|
if (this.newCreateFileDialogTitle === "新建文件夹") {
|
||||||
|
this.newCreateFileName = `新建文件夹`
|
||||||
|
} else {
|
||||||
|
this.newCreateFileName = `未命名文件.${suffix}`
|
||||||
|
}
|
||||||
this.newCreateFileName = this.getNewFileName(this.fileList, this.newCreateFileName)
|
this.newCreateFileName = this.getNewFileName(this.fileList, this.newCreateFileName)
|
||||||
this.newCreateFileDialog = true
|
this.newCreateFileDialog = true
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
|||||||
@ -34,6 +34,8 @@ export default {
|
|||||||
{ label: '刷新', operation: 'refresh'},
|
{ label: '刷新', operation: 'refresh'},
|
||||||
{ divider: true, operation: 'divider' },
|
{ divider: true, operation: 'divider' },
|
||||||
{ label: '新建', operation: 'create' ,child: [
|
{ label: '新建', operation: 'create' ,child: [
|
||||||
|
{ label: '文件夹', operation: 'createFolder', iconClass: 'folder'},
|
||||||
|
{ divider: true, operation: 'divider' },
|
||||||
{ label: '文本', operation: 'createTextFile', iconClass: 'file-txt'},
|
{ label: '文本', operation: 'createTextFile', iconClass: 'file-txt'},
|
||||||
{ label: '思维导图', operation: 'createMinderFile', iconClass: 'file-mind'},
|
{ label: '思维导图', operation: 'createMinderFile', iconClass: 'file-mind'},
|
||||||
{ label: '流程图', operation: 'createDrawioFile', iconClass: 'file-drawio'},
|
{ label: '流程图', operation: 'createDrawioFile', iconClass: 'file-drawio'},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user