chenrui 4 gadi atpakaļ
vecāks
revīzija
6e334d4e76

+ 2 - 2
src/components/tools/UserMenu.vue

@@ -7,11 +7,11 @@
         </span>
       </a> -->
       <!-- <notice-icon class="action"/> -->
+      <span style="margin: 0 5px;">{{ nickname }}</span>
       <a-dropdown>
         <span class="action ant-dropdown-link user-dropdown-menu">
           <!-- <a-avatar class="avatar" size="small" :src="avatar==''?defaultAvatar:avatar"/> -->
-          <a-icon type="user" />
-          <span style="margin: 0 5px;">{{ nickname }}</span>
+          <!-- <a-icon type="user" /> -->
           <a-icon type="down" />
         </span>
         <a-menu slot="overlay" class="user-dropdown-menu-wrapper">

+ 1 - 1
src/views/power/role/roleList.vue

@@ -17,7 +17,7 @@
 
           <a-col :md="6" :sm="24">
             <a-form-item label="状态">
-              <v-select code="CHECK_ENABLE_STATE" v-model="queryParam.isEnable" allowClear placeholder="请选择状态" id="roleList-isEnable"></v-select>
+              <v-select code="ENABLE_FLAG" v-model="queryParam.isEnable" allowClear placeholder="请选择状态" id="roleList-isEnable"></v-select>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">

+ 2 - 20
src/views/power/role/roleModal.vue

@@ -41,12 +41,11 @@
             placeholder="请输入描述(最多500个字符)"
             autosize />
         </a-form-item>
-
         <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
           <a-button type="primary" @click="handleSubmit()">
             保存
           </a-button>
-          <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()">
+          <a-button :style="{ marginLeft: '8px' }" @click="cancel">
             取消
           </a-button>
         </a-form-item>
@@ -95,7 +94,6 @@ export default {
       this.clear()
       this.$emit('close')
     },
-
     // 保存提交
     handleSubmit () {
       const _this = this
@@ -117,20 +115,6 @@ export default {
         }
       })
     },
-    // 取消
-    handleCancel () {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '确定取消吗?',
-        okText: '确定',
-        cancelText: '取消',
-        onOk () {
-          _this.clear()
-          _this.cancel()
-        }
-      })
-    },
     clear () {
       this.form.resetFields()
       delete this.formData.id
@@ -138,10 +122,8 @@ export default {
       this.formData.isEnable = ''
       this.formData.remarks = ''
     }
-
-  },
-  mounted () {
   },
+  mounted () {},
   beforeCreate () {
     this.form = this.$form.createForm(this, { name: 'roleModal' })
   },

+ 15 - 8
src/views/power/user/userList.vue

@@ -5,23 +5,22 @@
         <a-row :gutter="48">
           <a-col :md="6" :sm="24">
             <a-form-item label="用户名称">
-              <a-input allowClear v-model="queryParam.name" placeholder="请输入用户名称"/>
+              <a-input id="userList-name" allowClear v-model="queryParam.name" placeholder="请输入用户名称" @pressEnter="$refs.table.refresh(true)"/>
             </a-form-item>
           </a-col>
-
           <a-col :md="6" :sm="24">
             <a-form-item label="手机号码">
-              <a-input allowClear v-model="queryParam.phone" placeholder="请输入手机号码"/>
+              <a-input id="userList-phone" allowClear v-model="queryParam.phone" placeholder="请输入手机号码" @pressEnter="$refs.table.refresh(true)"/>
             </a-form-item>
           </a-col>
-
           <a-col :md="6" :sm="24">
             <a-form-item label="状态">
-              <v-select code="CHECK_ENABLE_STATE" v-model="queryParam.loginFlag" allowClear placeholder="请选择状态"></v-select>
+              <v-select id="userList-loginFlag" code="ENABLE_FLAG" v-model="queryParam.loginFlag" allowClear placeholder="请选择状态"></v-select>
             </a-form-item>
           </a-col>
           <a-col :md="4" :sm="24">
-            <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
+            <a-button type="primary" @click="$refs.table.refresh(true)" id="userList-search">查询</a-button>
+            <a-button type="" @click="reset" id="userList-reset" style="margin-left: 10px;">重置</a-button>
           </a-col>
         </a-row>
       </a-form>
@@ -95,7 +94,7 @@ export default {
           align: 'center'
         },
         {
-		  title: '创建时间',
+          title: '创建时间',
           dataIndex: 'createDate',
           width: 150,
           align: 'center'
@@ -116,7 +115,8 @@ export default {
           title: '角色',
           width: 200,
           align: 'center',
-          dataIndex: 'roleNames'
+          dataIndex: 'roleNames',
+          customRender: function (text) { return text || '--' }
         },
         {
           title: '状态',
@@ -151,6 +151,13 @@ export default {
     refreshTable () {
       this.$refs.table.refresh(true)
     },
+    // 重置
+    reset () {
+      this.queryParam.name = ''
+      this.queryParam.phone = ''
+      this.queryParam.loginFlag = ''
+      this.$refs.table.refresh(true)
+    },
     // 新建
     openModal () {
       this.showModal = true

+ 2 - 21
src/views/power/user/userModal.vue

@@ -117,7 +117,7 @@
           <a-button type="primary" @click="handleSubmit()" :style="{ marginRight: '8px' }">
             保存
           </a-button>
-          <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()">
+          <a-button :style="{ marginLeft: '8px' }" @click="cancel">
             取消
           </a-button>
         </a-form-item>
@@ -170,7 +170,6 @@ export default {
       this.clear()
       this.$emit('close')
     },
-
     // 保存提交
     handleSubmit () {
       const _this = this
@@ -194,21 +193,6 @@ export default {
         }
       })
     },
-    // 取消
-    handleCancel () {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '确定取消吗?',
-        centered: true,
-        okText: '确定',
-        cancelText: '取消',
-        onOk () {
-          _this.clear()
-          _this.cancel()
-        }
-      })
-    },
     clear () {
       this.form.resetFields()
       delete this.formData.id
@@ -219,19 +203,16 @@ export default {
       this.formData.sex = ''
       this.formData.remarks = ''
     },
-
     // 获取角色列表接口
     getRoleList () {
       getRoleList().then(res => {
-        console.log(res, 'res--role')
-        if (res.status + '' === '200') {
+        if (res.status == 200) {
           this.roleList = res.data
         } else {
           this.$message.warning(res.message)
         }
       })
     }
-
   },
   mounted () {
     this.getRoleList()

+ 20 - 6
src/views/user/ChangePwd.vue

@@ -16,10 +16,11 @@
                 'formCustom.oldPwd',
                 { initialValue: formCustom.oldPwd,
                   rules: [
-                    { required: true, message: '请输入原始密码' },
+                    { required: true, message: '请输入原始密码' }
                   ]
                 },
-              ]">
+              ]"
+              placeholder="请输入原始密码">
             </a-input>
           </a-form-item>
           <!-- 新密码 -->
@@ -34,10 +35,13 @@
                 'formCustom.passwd',
                 { initialValue: formCustom.passwd,
                   rules: [
-                    { required: true, message: '请输入新密码' }
+                    { required: true, message: '请输入新密码(6~12位)' },
+                    { validator: passwordValid }
                   ]
                 },
-              ]">
+              ]"
+              :maxLength="12"
+              placeholder="请输入新密码(6~12位)">
             </a-input>
           </a-form-item>
           <!-- 再次确认 -->
@@ -52,11 +56,13 @@
                 'formCustom.passwdCheck',
                 { initialValue: formCustom.passwdCheck,
                   rules: [
-                    { required: true, message: '请再次输入密码' },
+                    { required: true, message: '请再次输入密码(6~12位)' },
                     { validator: compareToFirstPassword }
                   ]
                 },
-              ]">
+              ]"
+              :maxLength="12"
+              placeholder="请再次输入密码(6~12位)">
             </a-input>
           </a-form-item>
           <a-col span="16" offset="8">
@@ -101,6 +107,14 @@ export default {
   },
   methods: {
     ...mapActions(['Logout']),
+    //  密码位数校验
+    passwordValid (rule, value, callback) {
+      if (value.length < 6 || value.length > 12) {
+        callback('请输入6~12位密码!')
+      } else {
+        callback()
+      }
+    },
     // 密码校验
     compareToFirstPassword (rule, value, callback) {
       const form = this.form

+ 2 - 2
vue.config.js

@@ -108,8 +108,8 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        target: 'http://192.168.16.103:8501/qpls-it',
-        // target: 'http://it.test.zyucgj.com/zyit',
+        // target: 'http://192.168.16.103:8501/qpls-it',
+        target: 'http://qpls-it.360arrow.com.cn/qpls-it',
         // target: 'https://it.test.qiubcar.com/zyit',
         ws: false,
         changeOrigin: true,