|
|
@@ -531,7 +531,7 @@
|
|
|
</div>
|
|
|
<span slot="footer">
|
|
|
<el-button @click="moveBox = false">{{ lang.cancel }}</el-button>
|
|
|
- <el-button type="primary" @click="createFolder(2)">{{
|
|
|
+ <el-button type="primary" @click="createFolder(2)" v-loading="addLoading">{{
|
|
|
lang.confirm
|
|
|
}}</el-button>
|
|
|
</span>
|
|
|
@@ -560,6 +560,8 @@ import copy1 from "../../../assets/copy1.svg";
|
|
|
import JSZip from "jszip";
|
|
|
import FileSaver from "file-saver";
|
|
|
|
|
|
+import _ from "lodash";
|
|
|
+
|
|
|
const getFile = (url) => {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
var credentials = {
|
|
|
@@ -687,6 +689,7 @@ export default {
|
|
|
stype2: 1,
|
|
|
userArray: [],
|
|
|
user: "",
|
|
|
+ addLoading: false,
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -931,11 +934,15 @@ export default {
|
|
|
this.folderDescription = "";
|
|
|
this.moveBox = true;
|
|
|
},
|
|
|
- createFolder(im) {
|
|
|
+ createFolder: _.debounce(function(im) {
|
|
|
if (!this.folderName) {
|
|
|
this.$message.error(this.lang.folderNameMust);
|
|
|
return;
|
|
|
}
|
|
|
+ if (this.addLoading) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.addLoading = true;
|
|
|
let params = [
|
|
|
{
|
|
|
n: this.folderName,
|
|
|
@@ -947,18 +954,20 @@ export default {
|
|
|
this.ajax
|
|
|
.post(this.$store.state.fileApi + "addFolder", params)
|
|
|
.then((res) => {
|
|
|
+ this.moveBox = false;
|
|
|
+ this.addLoading = false;
|
|
|
this.$message({
|
|
|
message: this.lang.createSuccess,
|
|
|
type: "success",
|
|
|
});
|
|
|
- this.moveBox = false;
|
|
|
this.getData();
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
- this.$message.error(this.lang.deleteFail);
|
|
|
+ this.addLoading = false;
|
|
|
+ this.$message.error(this.lang.createFail);
|
|
|
console.error(err);
|
|
|
});
|
|
|
- },
|
|
|
+ }, 500),
|
|
|
editFile(id, folderid) {
|
|
|
console.log(id);
|
|
|
|