From 9a33c4f0c961d80ee928fac2ee6360db7f24343b Mon Sep 17 00:00:00 2001 From: smallchill Date: Sun, 12 Apr 2020 20:33:50 +0800 Subject: [PATCH] =?UTF-8?q?:ok=5Fhand:=20=E8=B0=83=E6=95=B4loading?= =?UTF-8?q?=E3=80=81done=E9=A1=BA=E5=BA=8F=E4=BB=A5=E7=AC=A6=E5=90=88?= =?UTF-8?q?=E6=9C=80=E6=96=B0api=EF=BC=8C=E9=9D=9E=E5=BC=BA=E8=BF=AB?= =?UTF-8?q?=E7=97=87=E5=8F=AF=E4=BB=A5=E6=97=A0=E8=A7=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/authority/apiscope.vue | 28 +++--- src/views/authority/datascope.vue | 28 +++--- src/views/authority/role.vue | 12 +-- src/views/desk/notice.vue | 16 ++-- src/views/resource/oss.vue | 12 +-- src/views/resource/sms.vue | 14 +-- src/views/system/client.vue | 12 +-- src/views/system/dept.vue | 22 ++--- src/views/system/dict.vue | 108 +++++++++++------------ src/views/system/dictbiz.vue | 108 +++++++++++------------ src/views/system/menu.vue | 22 ++--- src/views/system/param.vue | 12 +-- src/views/system/post.vue | 14 +-- src/views/system/tenant.vue | 14 +-- src/views/system/topmenu.vue | 12 +-- src/views/system/user.vue | 14 +-- src/views/tool/code.vue | 12 +-- src/views/tool/datasource.vue | 12 +-- src/views/util/demo/dict-classic.vue | 54 ++++++------ src/views/util/demo/dict-horizontal.vue | 108 +++++++++++------------ src/views/util/demo/dict-vertical.vue | 110 +++++++++++------------- 21 files changed, 345 insertions(+), 399 deletions(-) diff --git a/src/views/authority/apiscope.vue b/src/views/authority/apiscope.vue index 7e5c938..df39686 100644 --- a/src/views/authority/apiscope.vue +++ b/src/views/authority/apiscope.vue @@ -401,30 +401,30 @@ }, methods: { // 菜单管理模块 - rowSave(row, loading, done) { + rowSave(row, done, loading) { add(row).then(() => { - loading(); this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" }); - }, error => { done(); + }, error => { window.console.log(error); + loading(); }); }, - rowUpdate(row, index, loading, done) { + rowUpdate(row, index, done, loading) { update(row).then(() => { - loading(); this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" }); - }, error => { done(); + }, error => { window.console.log(error); + loading(); }); }, rowDel(row) { @@ -526,38 +526,38 @@ handleDrawerClose(hide) { hide(); }, - rowSaveScope(row, loading, done) { + rowSaveScope(row, done, loading) { row = { ...row, menuId: this.scopeMenuId, - } + }; addApiScope(row).then(() => { - loading(); this.onLoadScope(this.pageScope); this.$message({ type: "success", message: "操作成功!" }); - }, error => { done(); + }, error => { window.console.log(error); + loading(); }); }, - rowUpdateScope(row, index, loading, done) { + rowUpdateScope(row, index, done, loading) { row = { ...row, menuId: this.scopeMenuId, - } + }; updateApiScope(row).then(() => { - loading(); this.onLoadScope(this.pageScope); this.$message({ type: "success", message: "操作成功!" }); - }, error => { done(); + }, error => { window.console.log(error); + loading(); }); }, rowDelScope(row) { diff --git a/src/views/authority/datascope.vue b/src/views/authority/datascope.vue index fa745c5..69039f8 100644 --- a/src/views/authority/datascope.vue +++ b/src/views/authority/datascope.vue @@ -478,30 +478,30 @@ }); }, // 菜单管理模块 - rowSave(row, loading, done) { + rowSave(row, done, loading) { add(row).then(() => { - loading(); this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" }); - }, error => { done(); + }, error => { window.console.log(error); + loading(); }); }, - rowUpdate(row, index, loading, done) { + rowUpdate(row, index, done, loading) { update(row).then(() => { - loading(); this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" }); - }, error => { done(); + }, error => { window.console.log(error); + loading(); }); }, rowDel(row) { @@ -604,38 +604,38 @@ handleDrawerClose(hide) { hide(); }, - rowSaveScope(row, loading, done) { + rowSaveScope(row, done, loading) { row = { ...row, menuId: this.scopeMenuId, - } + }; addDataScope(row).then(() => { - loading(); this.onLoadScope(this.pageScope); this.$message({ type: "success", message: "操作成功!" }); - }, error => { done(); + }, error => { window.console.log(error); + loading(); }); }, - rowUpdateScope(row, index, loading, done) { + rowUpdateScope(row, index, done, loading) { row = { ...row, menuId: this.scopeMenuId, - } + }; updateDataScope(row).then(() => { - loading(); this.onLoadScope(this.pageScope); this.$message({ type: "success", message: "操作成功!" }); - }, error => { done(); + }, error => { window.console.log(error); + loading(); }); }, rowDelScope(row) { diff --git a/src/views/authority/role.vue b/src/views/authority/role.vue index e8b9291..3c37a86 100644 --- a/src/views/authority/role.vue +++ b/src/views/authority/role.vue @@ -248,30 +248,30 @@ this.onLoad(this.page); }); }, - rowSave(row, loading, done) { + rowSave(row, done, loading) { add(row).then(() => { - loading(); this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" }); - }, error => { done(); + }, error => { window.console.log(error); + loading(); }); }, - rowUpdate(row, index, loading, done) { + rowUpdate(row, index, done, loading) { update(row).then(() => { this.onLoad(this.page); - loading(); this.$message({ type: "success", message: "操作成功!" }); - }, error => { done(); + }, error => { window.console.log(error); + loading(); }); }, rowDel(row) { diff --git a/src/views/desk/notice.vue b/src/views/desk/notice.vue index 3fae5c1..3a886f5 100644 --- a/src/views/desk/notice.vue +++ b/src/views/desk/notice.vue @@ -168,30 +168,30 @@ } }, methods: { - rowSave(row, loading, done) { + rowSave(row, done, loading) { add(row).then(() => { - loading(); this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" }); - }, error => { done(); + }, error => { window.console.log(error); + loading(); }); }, - rowUpdate(row, index, loading, done) { + rowUpdate(row, index, done, loading) { update(row).then(() => { - loading(); this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" }); - }, error => { done(); + }, error => { window.console.log(error); + loading(); }); }, rowDel(row) { @@ -271,13 +271,13 @@ const {releaseTimeRange} = params; let values = { ...params, - } + }; if (releaseTimeRange) { values = { ...params, releaseTime_datege: releaseTimeRange[0], releaseTime_datelt: releaseTimeRange[1], - } + }; values.releaseTimeRange = null; this.query.releaseTimeRange = null; } diff --git a/src/views/resource/oss.vue b/src/views/resource/oss.vue index b626307..28b3134 100644 --- a/src/views/resource/oss.vue +++ b/src/views/resource/oss.vue @@ -271,30 +271,30 @@ } }, methods: { - rowSave(row, loading, done) { + rowSave(row, done, loading) { add(row).then(() => { - loading(); this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" }); - }, error => { done(); + }, error => { window.console.log(error); + loading(); }); }, - rowUpdate(row, index, loading, done) { + rowUpdate(row, index, done, loading) { update(row).then(() => { - loading(); this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" }); - }, error => { done(); + }, error => { window.console.log(error); + loading(); }); }, rowDel(row) { diff --git a/src/views/resource/sms.vue b/src/views/resource/sms.vue index 1eed72c..e67bfb1 100644 --- a/src/views/resource/sms.vue +++ b/src/views/resource/sms.vue @@ -287,30 +287,30 @@ } }, methods: { - rowSave(row, loading, done) { + rowSave(row, done, loading) { add(row).then(() => { - loading(); this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" }); - }, error => { done(); + }, error => { window.console.log(error); + loading(); }); }, - rowUpdate(row, index, loading, done) { + rowUpdate(row, index, done, loading) { update(row).then(() => { - loading(); this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" }); - }, error => { done(); + }, error => { window.console.log(error); + loading(); }); }, rowDel(row) { @@ -362,8 +362,8 @@ window.console.log(res); this.box = false; }, error => { - done(); window.console.log(error); + loading(); }); }, handleDelete() { diff --git a/src/views/system/client.vue b/src/views/system/client.vue index c50a47f..09cefb3 100644 --- a/src/views/system/client.vue +++ b/src/views/system/client.vue @@ -193,30 +193,30 @@ } }, methods: { - rowSave(row, loading, done) { + rowSave(row, done, loading) { add(row).then(() => { - loading(); this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" }); - }, error => { done(); + }, error => { window.console.log(error); + loading(); }); }, - rowUpdate(row, index, loading, done) { + rowUpdate(row, index, done, loading) { update(row).then(() => { - loading(); this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" }); - }, error => { done(); + }, error => { window.console.log(error); + loading(); }); }, rowDel(row) { diff --git a/src/views/system/dept.vue b/src/views/system/dept.vue index 0a1bfac..7c3c99b 100644 --- a/src/views/system/dept.vue +++ b/src/views/system/dept.vue @@ -221,38 +221,38 @@ }); this.$refs.crud.rowAdd(); }, - rowSave(row, loading, done) { + rowSave(row, done, loading) { add(row).then((res) => { // 获取新增数据的相关字段 const data = res.data.data; row.id = data.id; row.deptCategoryName = data.deptCategoryName; row.tenantId = data.tenantId; - // 数据回调进行刷新 - loading(row); this.$message({ type: "success", message: "操作成功!" }); + // 数据回调进行刷新 + done(row); }, error => { - done(); window.console.log(error); + loading(); }); }, - rowUpdate(row, index, loading, done) { + rowUpdate(row, index, done, loading) { update(row).then(() => { - // 数据回调进行刷新 - loading(row); this.$message({ type: "success", message: "操作成功!" }); + // 数据回调进行刷新 + done(row); }, error => { - done(); window.console.log(error); + loading(); }); }, - rowDel(row, index, loading) { + rowDel(row, index, done) { this.$confirm("确定将选择数据删除?", { confirmButtonText: "确定", cancelButtonText: "取消", @@ -262,12 +262,12 @@ return remove(row.id); }) .then(() => { - // 数据回调进行刷新 - loading(row); this.$message({ type: "success", message: "操作成功!" }); + // 数据回调进行刷新 + done(row); }); }, handleDelete() { diff --git a/src/views/system/dict.vue b/src/views/system/dict.vue index 6472666..6bd0707 100644 --- a/src/views/system/dict.vue +++ b/src/views/system/dict.vue @@ -163,41 +163,35 @@ }); }, methods: { - rowSave(row, loading, done) { + rowSave(row, done, loading) { const form = { ...row, dictKey: -1, }; - add(form).then( - () => { - loading(); - this.onLoadParent(this.pageParent); - this.$message({ - type: "success", - message: "操作成功!" - }); - }, - error => { - done(); - window.console.log(error); - } - ); + add(form).then(() => { + this.onLoadParent(this.pageParent); + this.$message({ + type: "success", + message: "操作成功!" + }); + done(); + }, error => { + window.console.log(error); + loading(); + }); }, - rowUpdate(row, index, loading, done) { - update(row).then( - () => { - loading(); - this.onLoadParent(this.pageParent); - this.$message({ - type: "success", - message: "操作成功!" - }); - }, - error => { - done(); - window.console.log(error); - } - ); + rowUpdate(row, index, done, loading) { + update(row).then(() => { + this.onLoadParent(this.pageParent); + this.$message({ + type: "success", + message: "操作成功!" + }); + done(); + }, error => { + window.console.log(error); + loading(); + }); }, rowDel(row) { this.$confirm("确定将选择数据删除?", { @@ -287,37 +281,31 @@ refreshChange() { this.onLoadParent(this.pageParent, this.query); }, - rowSaveChild(row, loading, done) { - add(row).then( - () => { - loading(); - this.onLoadChild(this.pageChild); - this.$message({ - type: "success", - message: "操作成功!" - }); - }, - error => { - done(); - window.console.log(error); - } - ); + rowSaveChild(row, done, loading) { + add(row).then(() => { + this.onLoadChild(this.pageChild); + this.$message({ + type: "success", + message: "操作成功!" + }); + done(); + }, error => { + window.console.log(error); + loading(); + }); }, - rowUpdateChild(row, index, loading, done) { - update(row).then( - () => { - loading(); - this.onLoadChild(this.pageChild); - this.$message({ - type: "success", - message: "操作成功!" - }); - }, - error => { - done(); - window.console.log(error); - } - ); + rowUpdateChild(row, index, done, loading) { + update(row).then(() => { + this.onLoadChild(this.pageChild); + this.$message({ + type: "success", + message: "操作成功!" + }); + done(); + }, error => { + window.console.log(error); + loading(); + }); }, rowDelChild(row) { this.$confirm("确定将选择数据删除?", { diff --git a/src/views/system/dictbiz.vue b/src/views/system/dictbiz.vue index 2790f6a..8eaff10 100644 --- a/src/views/system/dictbiz.vue +++ b/src/views/system/dictbiz.vue @@ -163,41 +163,35 @@ }); }, methods: { - rowSave(row, loading, done) { + rowSave(row, done, loading) { const form = { ...row, dictKey: -1, }; - add(form).then( - () => { - loading(); - this.onLoadParent(this.pageParent); - this.$message({ - type: "success", - message: "操作成功!" - }); - }, - error => { - done(); - window.console.log(error); - } - ); + add(form).then(() => { + this.onLoadParent(this.pageParent); + this.$message({ + type: "success", + message: "操作成功!" + }); + done(); + }, error => { + window.console.log(error); + loading(); + }); }, - rowUpdate(row, index, loading, done) { - update(row).then( - () => { - loading(); - this.onLoadParent(this.pageParent); - this.$message({ - type: "success", - message: "操作成功!" - }); - }, - error => { - done(); - window.console.log(error); - } - ); + rowUpdate(row, index, done, loading) { + update(row).then(() => { + this.onLoadParent(this.pageParent); + this.$message({ + type: "success", + message: "操作成功!" + }); + done(); + }, error => { + window.console.log(error); + loading(); + }); }, rowDel(row) { this.$confirm("确定将选择数据删除?", { @@ -287,37 +281,31 @@ refreshChange() { this.onLoadParent(this.pageParent, this.query); }, - rowSaveChild(row, loading, done) { - add(row).then( - () => { - loading(); - this.onLoadChild(this.pageChild); - this.$message({ - type: "success", - message: "操作成功!" - }); - }, - error => { - done(); - window.console.log(error); - } - ); + rowSaveChild(row, done, loading) { + add(row).then(() => { + this.onLoadChild(this.pageChild); + this.$message({ + type: "success", + message: "操作成功!" + }); + done(); + }, error => { + window.console.log(error); + loading(); + }); }, - rowUpdateChild(row, index, loading, done) { - update(row).then( - () => { - loading(); - this.onLoadChild(this.pageChild); - this.$message({ - type: "success", - message: "操作成功!" - }); - }, - error => { - done(); - window.console.log(error); - } - ); + rowUpdateChild(row, index, done, loading) { + update(row).then(() => { + this.onLoadChild(this.pageChild); + this.$message({ + type: "success", + message: "操作成功!" + }); + done(); + }, error => { + window.console.log(error); + loading(); + }); }, rowDelChild(row) { this.$confirm("确定将选择数据删除?", { diff --git a/src/views/system/menu.vue b/src/views/system/menu.vue index bd2fb7a..9bb3a55 100644 --- a/src/views/system/menu.vue +++ b/src/views/system/menu.vue @@ -254,36 +254,36 @@ }); this.$refs.crud.rowAdd(); }, - rowSave(row, loading, done) { + rowSave(row, done, loading) { add(row).then((res) => { // 获取新增数据的相关字段 const data = res.data.data; row.id = data.id; - // 数据回调进行刷新 - loading(row); this.$message({ type: "success", message: "操作成功!" }); + // 数据回调进行刷新 + done(row); }, error => { - done(); window.console.log(error); + loading(); }); }, - rowUpdate(row, index, loading, done) { + rowUpdate(row, index, done, loading) { update(row).then(() => { - // 数据回调进行刷新 - loading(row); this.$message({ type: "success", message: "操作成功!" }); + // 数据回调进行刷新 + done(row); }, error => { - done(); window.console.log(error); + loading(); }); }, - rowDel(row, index, loading) { + rowDel(row, index, done) { this.$confirm("确定将选择数据删除?", { confirmButtonText: "确定", cancelButtonText: "取消", @@ -293,12 +293,12 @@ return remove(row.id); }) .then(() => { - // 数据回调进行刷新 - loading(row); this.$message({ type: "success", message: "操作成功!" }); + // 数据回调进行刷新 + done(row); }); }, handleDelete() { diff --git a/src/views/system/param.vue b/src/views/system/param.vue index bab20b3..53908a2 100644 --- a/src/views/system/param.vue +++ b/src/views/system/param.vue @@ -116,30 +116,30 @@ } }, methods: { - rowSave(row, loading, done) { + rowSave(row, done, loading) { add(row).then(() => { - loading(); this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" }); - }, error => { done(); + }, error => { window.console.log(error); + loading(); }); }, - rowUpdate(row, index, loading, done) { + rowUpdate(row, index, done, loading) { update(row).then(() => { - loading(); this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" }); - }, error => { done(); + }, error => { window.console.log(error); + loading(); }); }, rowDel(row) { diff --git a/src/views/system/post.vue b/src/views/system/post.vue index 7ad39ae..d395c7b 100644 --- a/src/views/system/post.vue +++ b/src/views/system/post.vue @@ -164,30 +164,30 @@ } }, methods: { - rowSave(row, loading, done) { + rowSave(row, done, loading) { add(row).then(() => { - loading(); this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" }); - }, error => { done(); + }, error => { window.console.log(error); + loading(); }); }, - rowUpdate(row, index, loading, done) { + rowUpdate(row, index, done, loading) { update(row).then(() => { - loading(); this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" }); - }, error => { done(); - console.log(error); + }, error => { + window.console.log(error); + loading(); }); }, rowDel(row) { diff --git a/src/views/system/tenant.vue b/src/views/system/tenant.vue index 4d6c2ba..04c6355 100644 --- a/src/views/system/tenant.vue +++ b/src/views/system/tenant.vue @@ -208,30 +208,30 @@ } }, methods: { - rowSave(row, loading, done) { + rowSave(row, done, loading) { add(row).then(() => { - loading(); this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" }); - }, error => { done(); + }, error => { window.console.log(error); + loading(); }); }, - rowUpdate(row, index, loading, done) { + rowUpdate(row, index, done, loading) { update(row).then(() => { - loading(); this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" }); - }, error => { done(); + }, error => { window.console.log(error); + loading(); }); }, rowDel(row) { @@ -332,8 +332,8 @@ done(); this.box = false; }, error => { - done(); window.console.log(error); + loading(); }); }, currentChange(currentPage) { diff --git a/src/views/system/topmenu.vue b/src/views/system/topmenu.vue index 1105fb8..b6c9faa 100644 --- a/src/views/system/topmenu.vue +++ b/src/views/system/topmenu.vue @@ -179,30 +179,30 @@ this.onLoad(this.page); }); }, - rowSave(row, loading, done) { + rowSave(row, done, loading) { add(row).then(() => { - loading(); this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" }); - }, error => { done(); + }, error => { window.console.log(error); + loading(); }); }, - rowUpdate(row, index, loading, done) { + rowUpdate(row, index, done, loading) { update(row).then(() => { - loading(); this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" }); - }, error => { done(); + }, error => { window.console.log(error); + loading(); }); }, rowDel(row) { diff --git a/src/views/system/user.vue b/src/views/system/user.vue index 2eb8510..4286713 100644 --- a/src/views/system/user.vue +++ b/src/views/system/user.vue @@ -548,36 +548,36 @@ this.onLoad(this.page); }); }, - rowSave(row, loading, done) { + rowSave(row, done, loading) { row.deptId = row.deptId.join(","); row.roleId = row.roleId.join(","); row.postId = row.postId.join(","); add(row).then(() => { - loading(); this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" }); - }, error => { done(); + }, error => { window.console.log(error); + loading(); }); }, - rowUpdate(row, index, loading, done) { + rowUpdate(row, index, done, loading) { row.deptId = row.deptId.join(","); row.roleId = row.roleId.join(","); row.postId = row.postId.join(","); update(row).then(() => { - loading(); this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" }); - }, error => { done(); + }, error => { window.console.log(error); + loading(); }); }, rowDel(row) { @@ -677,9 +677,9 @@ }, uploadAfter(res, done, loading, column) { window.console.log(column); - done(); this.excelBox = false; this.refreshChange(); + done(); }, handleExport() { this.$confirm("是否导出用户数据?", "提示", { diff --git a/src/views/tool/code.vue b/src/views/tool/code.vue index cdf78d0..b8c936f 100644 --- a/src/views/tool/code.vue +++ b/src/views/tool/code.vue @@ -233,30 +233,30 @@ } }, methods: { - rowSave(row, loading, done) { + rowSave(row, done, loading) { add(row).then(() => { - loading(); this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" }); - }, error => { done(); + }, error => { window.console.log(error); + loading(); }); }, - rowUpdate(row, index, loading, done) { + rowUpdate(row, index, done, loading) { update(row).then(() => { - loading(); this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" }); - }, error => { done(); + }, error => { window.console.log(error); + loading(); }); }, rowDel(row) { diff --git a/src/views/tool/datasource.vue b/src/views/tool/datasource.vue index 90e67f9..de8b4a8 100644 --- a/src/views/tool/datasource.vue +++ b/src/views/tool/datasource.vue @@ -155,30 +155,30 @@ } }, methods: { - rowSave(row, loading, done) { + rowSave(row, done, loading) { add(row).then(() => { - loading(); this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" }); - }, error => { done(); + }, error => { window.console.log(error); + loading(); }); }, - rowUpdate(row, index, loading, done) { + rowUpdate(row, index, done, loading) { update(row).then(() => { - loading(); this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" }); - }, error => { done(); + }, error => { window.console.log(error); + loading(); }); }, rowDel(row) { diff --git a/src/views/util/demo/dict-classic.vue b/src/views/util/demo/dict-classic.vue index 390b4d8..1865e98 100644 --- a/src/views/util/demo/dict-classic.vue +++ b/src/views/util/demo/dict-classic.vue @@ -223,37 +223,31 @@ }); this.$refs.crud.rowAdd(); }, - rowSave(row, loading, done) { - add(row).then( - () => { - loading(); - this.onLoad(this.page); - this.$message({ - type: "success", - message: "操作成功!" - }); - }, - error => { - done(); - window.console.log(error); - } - ); + rowSave(row, done, loading) { + add(row).then(() => { + this.onLoad(this.page); + this.$message({ + type: "success", + message: "操作成功!" + }); + done(); + }, error => { + window.console.log(error); + loading(); + }); }, - rowUpdate(row, index, loading, done) { - update(row).then( - () => { - loading(); - this.onLoad(this.page); - this.$message({ - type: "success", - message: "操作成功!" - }); - }, - error => { - done(); - window.console.log(error); - } - ); + rowUpdate(row, index, done, loading) { + update(row).then(() => { + this.onLoad(this.page); + this.$message({ + type: "success", + message: "操作成功!" + }); + done(); + }, error => { + window.console.log(error); + loading(); + }); }, rowDel(row) { this.$confirm("确定将选择数据删除?", { diff --git a/src/views/util/demo/dict-horizontal.vue b/src/views/util/demo/dict-horizontal.vue index 25a75ec..31c123f 100644 --- a/src/views/util/demo/dict-horizontal.vue +++ b/src/views/util/demo/dict-horizontal.vue @@ -230,37 +230,31 @@ } }, methods: { - rowSave(row, loading, done) { - add(row).then( - () => { - loading(); - this.onLoadParent(this.pageParent); - this.$message({ - type: "success", - message: "操作成功!" - }); - }, - error => { - done(); - window.console.log(error); - } - ); + rowSave(row, done, loading) { + add(row).then(() => { + this.onLoadParent(this.pageParent); + this.$message({ + type: "success", + message: "操作成功!" + }); + done(); + }, error => { + window.console.log(error); + loading(); + }); }, - rowUpdate(row, index, loading, done) { - update(row).then( - () => { - loading(); - this.onLoadParent(this.pageParent); - this.$message({ - type: "success", - message: "操作成功!" - }); - }, - error => { - done(); - window.console.log(error); - } - ); + rowUpdate(row, index, done, loading) { + update(row).then(() => { + this.onLoadParent(this.pageParent); + this.$message({ + type: "success", + message: "操作成功!" + }); + done(); + }, error => { + window.console.log(error); + loading(); + }); }, rowDel(row) { this.$confirm("确定将选择数据删除?", { @@ -339,37 +333,31 @@ refreshChange() { this.onLoadParent(this.page, this.query); }, - rowSaveChild(row, loading, done) { - add(row).then( - () => { - loading(); - this.onLoadChild(this.pageChild); - this.$message({ - type: "success", - message: "操作成功!" - }); - }, - error => { - done(); - window.console.log(error); - } - ); + rowSaveChild(row, done, loading) { + add(row).then(() => { + this.onLoadChild(this.pageChild); + this.$message({ + type: "success", + message: "操作成功!" + }); + done(); + }, error => { + window.console.log(error); + loading(); + }); }, - rowUpdateChild(row, index, loading, done) { - update(row).then( - () => { - loading(); - this.onLoadChild(this.pageChild); - this.$message({ - type: "success", - message: "操作成功!" - }); - }, - error => { - done(); - window.console.log(error); - } - ); + rowUpdateChild(row, index, done, loading) { + update(row).then(() => { + this.onLoadChild(this.pageChild); + this.$message({ + type: "success", + message: "操作成功!" + }); + done(); + }, error => { + window.console.log(error); + loading(); + }); }, rowDelChild(row) { this.$confirm("确定将选择数据删除?", { diff --git a/src/views/util/demo/dict-vertical.vue b/src/views/util/demo/dict-vertical.vue index 5d3436a..ffc2c44 100644 --- a/src/views/util/demo/dict-vertical.vue +++ b/src/views/util/demo/dict-vertical.vue @@ -235,37 +235,31 @@ } }, methods: { - rowSave(row, loading, done) { - add(row).then( - () => { - loading(); - this.onLoadParent(this.pageParent); - this.$message({ - type: "success", - message: "操作成功!" - }); - }, - error => { - done(); - window.console.log(error); - } - ); + rowSave(row, done, loading) { + add(row).then(() => { + this.onLoadParent(this.pageParent); + this.$message({ + type: "success", + message: "操作成功!" + }); + done(); + }, error => { + window.console.log(error); + loading(); + }); }, - rowUpdate(row, index, loading, done) { - update(row).then( - () => { - loading(); - this.onLoadParent(this.pageParent); - this.$message({ - type: "success", - message: "操作成功!" - }); - }, - error => { - done(); - window.console.log(error); - } - ); + rowUpdate(row, index, done, loading) { + update(row).then(() => { + this.onLoadParent(this.pageParent); + this.$message({ + type: "success", + message: "操作成功!" + }); + done(); + }, error => { + window.console.log(error); + loading(); + }); }, rowDel(row) { this.$confirm("确定将选择数据删除?", { @@ -284,7 +278,7 @@ }); }); }, - handleRowClick (row) { + handleRowClick(row) { this.parentId = row.id; this.onLoadChild(this.pageChild); }, @@ -344,37 +338,31 @@ refreshChange() { this.onLoadParent(this.page, this.query); }, - rowSaveChild(row, loading, done) { - add(row).then( - () => { - loading(); - this.onLoadChild(this.pageChild); - this.$message({ - type: "success", - message: "操作成功!" - }); - }, - error => { - done(); - window.console.log(error); - } - ); + rowSaveChild(row, done, loading) { + add(row).then(() => { + this.onLoadChild(this.pageChild); + this.$message({ + type: "success", + message: "操作成功!" + }); + done(); + }, error => { + window.console.log(error); + loading(); + }); }, - rowUpdateChild(row, index, loading, done) { - update(row).then( - () => { - loading(); - this.onLoadChild(this.pageChild); - this.$message({ - type: "success", - message: "操作成功!" - }); - }, - error => { - done(); - window.console.log(error); - } - ); + rowUpdateChild(row, index, done, loading) { + update(row).then(() => { + this.onLoadChild(this.pageChild); + this.$message({ + type: "success", + message: "操作成功!" + }); + done(); + }, error => { + window.console.log(error); + loading(); + }); }, rowDelChild(row) { this.$confirm("确定将选择数据删除?", {