소스 검색

用户管理

chenrui 3 년 전
부모
커밋
70258678a1
2개의 변경된 파일11개의 추가작업 그리고 8개의 파일을 삭제
  1. 1 4
      src/views/power/user/userList.vue
  2. 10 4
      src/views/power/user/userModal.vue

+ 1 - 4
src/views/power/user/userList.vue

@@ -66,7 +66,7 @@
     </s-table>
     <!-- 自建账号  新增/编辑 -->
     <userModal :visible="showModal" @refresh="$refs.table.refresh(true)" :nowData="itemData" @close="handleUserCancel"></userModal>
-    <userSyncModal :openModal="showSyncModal" :nowData="itemData" @close="handleCancel" />
+    <userSyncModal :openModal="showSyncModal" @ok="$refs.table.refresh(true)" :nowData="itemData" @close="handleCancel" />
   </a-card>
 </template>
 
@@ -172,14 +172,11 @@ export default {
             } else {
               _this.$message.error(res.message)
             }
-          }).catch(() => {
-            _this.$message.success(res.message)
           })
         }
       })
     },
     handleEdit (row) {
-      console.log(row, 'row')
       this.itemData = row
       if (row.ownerOrgFlag == 1) { //  自建
         this.showModal = true

+ 10 - 4
src/views/power/user/userModal.vue

@@ -191,15 +191,22 @@ export default {
       if (!newValue) {
         this.$emit('close')
         this.$refs.ruleForm.resetFields()
+        this.form.name = ''
+        this.form.phone = ''
+        this.form.loginName = ''
+        this.form.sex = undefined
+        this.form.loginFlag = ''
         this.form.roleNames = []
+        this.form.remarks = ''
+        this.titleText = '新增用户'
       } else {
         this.getRoleList()
       }
     },
     nowData: {
       handler (newValue, oldValue) {
-        if (this.isShow && newValue) {
-          if (this.data.id) { //  编辑
+        if (this.isshow && newValue) {
+          if (this.nowData.id) { //  编辑
             this.titleText = '编辑用户'
             this.form = Object.assign({}, this.nowData)
             if (this.nowData.roleIds) {
@@ -207,8 +214,7 @@ export default {
             } else {
               this.form.roleNames = []
             }
-          } else { //  新增
-            this.titleText = '新增用户'
+            this.form.loginFlag = Number(this.nowData.loginFlag)
           }
         }
       },