From 56464e599f7f3c69a707b4ccd0cbd993dd986e14 Mon Sep 17 00:00:00 2001 From: xuyiming Date: Tue, 16 Jun 2020 17:54:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=83=E9=99=90=E7=AE=A1=E7=90=86fixed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/authority/organization.vue | 20 +- src/pages/authority/organizationdetail.vue | 119 +++--- src/pages/authority/organizationedit.vue | 464 ++++++++++----------- 3 files changed, 310 insertions(+), 293 deletions(-) diff --git a/src/pages/authority/organization.vue b/src/pages/authority/organization.vue index 86bd390..2e29612 100644 --- a/src/pages/authority/organization.vue +++ b/src/pages/authority/organization.vue @@ -85,14 +85,22 @@ export default { }) .then(({ data }) => { // console.log(data); - this.$message({ - message: `已删除${this.deleteItem.department_name}.`, - type: "success", - }); - this.deleteItem = null; - this.initDatas(this.tempFilter); + if (data.success == 1) { + this.$message({ + message: `已删除${this.deleteItem.department_name}.`, + type: "success", + }); + this.deleteItem = null; + this.initDatas(this.tempFilter); + } else { + this.$message({ + message: `删除${this.deleteItem.department_name}失败`, + type: "warning", + }); + } }) .catch((error) => { + console.log(error); this.$message({ message: `删除${this.deleteItem.department_name}失败`, type: "warning", diff --git a/src/pages/authority/organizationdetail.vue b/src/pages/authority/organizationdetail.vue index 35553e0..02277d8 100644 --- a/src/pages/authority/organizationdetail.vue +++ b/src/pages/authority/organizationdetail.vue @@ -153,57 +153,63 @@ export default { `/apaas/backmgt/user/list?limit=${this.pageSize}&page=${this.currentPage}&department_id=${this.$route.params.id}&search=${this.input}` ) .then((response) => { - console.log(response); + // console.log(response); let data = response.data.data; this.listTotal = response.data.total; this.datas = data; - var _this = this - setTimeout(()=>{ - this.header_arr = [ - { - prop: "user_name", - label: "账号", - minWidth: "25%", - align: "left", + var _this = this; + setTimeout(() => { + this.header_arr = [ + { + prop: "user_name", + label: "账号", + minWidth: "25%", + align: "left", + type: "button", + callback(item) { + _this.$router.push(`/authority/users/detail/${item.user_id}`); }, - { - prop: "system_name", - label: "业务系统名称", - minWidth: "25%", - align: "left", + }, + { + prop: "system_name", + label: "业务系统名称", + minWidth: "25%", + align: "left", + }, + { + prop: "is_admin", + label: "用户类型", + minWidth: "25%", + align: "center", + getText(item) { + return _this.admin_arr[item.is_admin || 0]; }, - { - prop: "is_admin", - label: "用户类型", - minWidth: "25%", - align: "center", - getText(item) { - return _this.admin_arr[item.is_admin||0]; + }, + { + prop: "operat_time", + label: "上次操作修改时间", + minWidth: "25%", + align: "center", + }, + { + label: "操作", + type: "buttons", + width: "120px", + align: "center", + width: 140, + actionList: [ + { + label: "删除", + callback: this.adelete, }, - }, - { - prop: "operat_time", - label: "上次操作修改时间", - minWidth: "25%", - align: "center", - }, - { - label: "操作", - type: "buttons", - width: "120px", - align: "center", - width: 140, - actionList: [ - { - label: "删除", - callback: this.adelete, - }, - ], - }, - ]; - }) + ], + }, + ]; + }); }) - .catch((response) => {}); + .catch((error) => { + console.log(error); + }); }, adelete(val) { this.tipsOptions = { @@ -213,7 +219,7 @@ export default { btnCancelText: "", position: "", }; - this.tipsOptions.message = "是否删除该数据"; + this.tipsOptions.message = "是否移除该用户?"; this.tipsOptions.confirmSubmit = () => { console.log("deleteItem - " + JSON.stringify(val)); this.delete_data(val); @@ -226,11 +232,26 @@ export default { .post(`/apaas/backmgt/user/delete`, { id: [val.user_id], }) - .then((response) => { - console.log(response); - this.get_list() + .then(({ data }) => { + if (data.success == 1) { + this.$message({ + message: `删除${val.user_name}成功`, + type: "success", + }); + this.get_list(); + } else { + this.$message({ + message: `删除${val.user_name}失败`, + type: "warning", + }); + } }) - .catch((response) => {}); + .catch((error) => { + this.$message({ + message: `删除${val.user_name}失败`, + type: "warning", + }); + }); }, }, }; diff --git a/src/pages/authority/organizationedit.vue b/src/pages/authority/organizationedit.vue index 5ab440d..0a800d7 100644 --- a/src/pages/authority/organizationedit.vue +++ b/src/pages/authority/organizationedit.vue @@ -1,8 +1,10 @@ - @@ -313,8 +301,8 @@ export default { box-shadow: 0px 3px 6px 0px #f4f7fc; border-radius: 12px; min-height: calc(100% - 20px); - margin-bottom: 20px; - position: relative; + margin-bottom: 20px; + position: relative; } .now_page_title { margin: 15px 0; @@ -323,14 +311,14 @@ export default { .now_page_title span { color: #242c43; } -.formname{ +.formname { color: #58617a; } -.right{ +.right { float: right; margin-left: 20px; } -.removepic{ +.removepic { display: inline-block; margin-top: -40px; float: left; @@ -344,16 +332,16 @@ export default { color: #e6ebfe; cursor: pointer; } -.edit_change{ +.edit_change { width: 100%; border-bottom: 2px solid #f4f7fc; overflow: hidden; } -.edit_change_box{ +.edit_change_box { width: 163px; height: 48px; line-height: 48px; - background-color: #e3e5ef; + background-color: #e3e5ef; border-radius: 8px; color: #8890a7; text-align: center; @@ -364,69 +352,69 @@ export default { font-size: 16px; cursor: pointer; } -.edit_change_box img{ +.edit_change_box img { vertical-align: -3px; margin-right: 5px; } -.safe_title{ - width: 100%; - height: 65px; - line-height: 65px; - border-bottom: 2px solid #f4f7fc; +.safe_title { + width: 100%; + height: 65px; + line-height: 65px; + border-bottom: 2px solid #f4f7fc; } -.safe_select{ - float: left; - width: auto; - margin-right: 40px; - height: 65px; - cursor: pointer; +.safe_select { + float: left; + width: auto; + margin-right: 40px; + height: 65px; + cursor: pointer; } -.safe_box_select{ - padding: 30px 10px 10px 10px; - width: 100%; - height: 100%; +.safe_box_select { + padding: 30px 10px 10px 10px; + width: 100%; + height: 100%; } -.openbgc{ +.openbgc { width: 56px; - height: 23px; - background-image: url('~@/assets/imgs/btn_on_hov.png'); - background-size:contain; + height: 23px; + background-image: url("~@/assets/imgs/btn_on_hov.png"); + background-size: contain; cursor: pointer; } -.formtitle{ +.formtitle { color: #58617a; margin: 15px 0; } -.savebtn{ +.savebtn { position: absolute; right: 20px; - bottom:20px; + bottom: 20px; width: 278px; overflow: hidden; } -.btnsty{ +.btnsty { width: 124px; - height: 44px; + height: 44px; line-height: 44px; - background-color: rgba(195, 202, 248, 0.5); - border-radius: 8px; + background-color: rgba(195, 202, 248, 0.5); + border-radius: 8px; color: rgba(15, 38, 131, 1); text-align: center; float: left; margin-right: 30px; cursor: pointer; } -.savebtn .btnsty:nth-last-of-type(1){ +.savebtn .btnsty:nth-last-of-type(1) { margin-right: 0px; background-color: rgba(15, 38, 131, 1); color: rgba(248, 249, 253, 1); } -.limitsd{ +.limitsd { position: relative; width: 1022px; } -.limitsd .timeslect{ +.limitsd .timeslect { position: absolute; right: 0; } -- 2.26.0