liujq 2 年之前
父节点
当前提交
8c591a690f

文件差异内容过多而无法显示
+ 0 - 0
dist/index.html


+ 0 - 0
dist/static/css/chunk-543444f7.b667bd8d.css → dist/static/css/chunk-b3888dca.b667bd8d.css


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/app.8195fdbc.js


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/app.be3f700d.js


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/chunk-7899c9a7.87618b83.js


文件差异内容过多而无法显示
+ 0 - 0
dist/static/js/chunk-b3888dca.1873afc6.js


+ 3 - 0
src/api/user.js

@@ -19,6 +19,9 @@ export default {
   admuserdel: params => { // 用户删除
     return getRequestNoSort('/adm/user/del', params, 'loading')
   },
+  admuserchangepwd: params => { // 用户 修改密码
+    return getRequestNoSort('/adm/user/change/pwd', params, 'loading')
+  },
   admuserauthlist: params => { // 认证列表
     return getRequestNoSort('/adm/user/auth/list', params, 'loading')
   },

+ 74 - 0
src/views/user/components/popup/PwdEdit.vue

@@ -0,0 +1,74 @@
+<template>
+  <div>
+    <el-dialog
+      v-loading="loading"
+      :show-close="false"
+      :close-on-click-modal="false"
+      :visible.sync="isShow"
+      :title="'修改密码'"
+      :fullscreen="false"
+      width="470px"
+      custom-class="xl-dialog"
+      center
+    >
+      <base-form ref="ruleForm" :data="formData" :is-inline="false" label-width="110px">
+        <div slot="footer">
+          <el-button class="xl-form-btn t2" @click="close">关 闭</el-button>
+          <el-button class="xl-form-btn t1" @click="close('confirm')">确定</el-button>
+        </div>
+      </base-form>
+    </el-dialog>
+  </div>
+</template>
+<script>
+export default {
+  components: {},
+  mixins: [...mixins],
+  props: {
+    isShow: Boolean,
+    curObj: Object
+  },
+  inject: ['parentData'],
+  data() {
+    return {
+      formData: [],
+      loading: true,
+      cObj: {},
+      isShowMap: false
+    }
+  },
+  watch: {
+    isShow: function(val) {
+      if (val) {
+        this.getDef()
+      }
+    },
+  },
+  methods: {
+    getDef() {
+      const params = { ...this.curObj }
+      this.formData = [
+        { label: '新密码', key: 'new_pwd', rules: 1 },
+        { label: '确认密码', key: 'repeat_pwd', rules: 1 },
+      ]
+      this.setDefaultValue(params)
+    },
+    close(str) {
+      if (str === 'confirm') {
+        this.$refs['ruleForm'].$refs['baseForm'].validate((valid) => {
+          if (valid) {
+            const oldform = this.$refs.ruleForm.baseForm
+            let newForm = { ...oldform }
+            this.$emit('close', newForm)
+          }
+        })
+      } else {
+        this.$emit('close')
+        this.setDefaultValue()
+      }
+    },
+  }
+}
+</script>
+<style lang="scss" scoped>
+</style>

+ 31 - 2
src/views/user/index.vue

@@ -22,18 +22,25 @@
       :curObj="curObj"
       @close="closePopup"
     />
+    <pwd-edit
+      :isShow="isPwdShow"
+      :curObj="curObj"
+      @close="closePwdPopup"
+    />
   </div>
 </template>
 <script>
 import { arrToObj } from '@/utils'
 import SearchForm from './components/searchForm/Index'
 import PopupEdit from './components/popup/IndexEdit'
+import PwdEdit from './components/popup/PwdEdit'
 import baseTable from '_m/baseTable.js'
 export default {
   name: 'index',
   components: {
     SearchForm,
     PopupEdit,
+    PwdEdit,
   },
   provide() {
     return {
@@ -46,6 +53,7 @@ export default {
       apiStr: 'user.admuserlist',
       searchForm: null,
       isDtlShow: false,
+      isPwdShow: false,
       curObj: {},
     }
   },
@@ -77,7 +85,7 @@ export default {
         { label: '更新时间', prop: 'update_at' },
         // { label: '系统', prop: 'is_admin', type: 'tag', tags: arrToObj(this.$dictData.sys_yesno), tagTypeObj: {'1': 'success', '2': 'danger'} },
         { label: '系统', prop: 'is_admin' },
-        { label: '操作', width: 180, type: 'handle2', operations:
+        { label: '操作', width: 260, type: 'handle2', operations:
           [
             { label: '编辑', func: this.openPopup, btnType: 'primary' },
             { label: '删除', func: this.delHandle, btnType: 'danger' },
@@ -93,12 +101,33 @@ export default {
                 }
               }
             },
+            { label: '重置密码', func: this.openPwdPopup, btnType: 'danger' },
           ]
         }
       ]
     }
   },
   methods: {
+    closePwdPopup (obj) {
+      if (obj) {
+        const params = obj
+        let apiStr = 'admuserchangepwd'
+        this.$api.user[apiStr]({
+          ...params,
+          user_id: this.curObj.id
+        }).then(data => {
+          this.$msgs('修改成功')
+          this.fetchData()
+          this.isDtlShow = false
+        })
+      } else {
+        this.isDtlShow = false
+      }
+    },
+    openPwdPopup (row) {
+      this.curObj = row
+      this.isPwdShow = true
+    },
     adminHandle (row) {
       const is_admin = Number(row.is_admin) === 1 ? 2 : 1
       const msgText = Number(row.is_admin) === 1 ? '禁用' : '设置'
@@ -136,7 +165,7 @@ export default {
         let apiStr = 'admuseradd'
         if (obj.id) apiStr = 'admuseredit'
         this.$api.user[apiStr]({
-          ...params
+          ...params,
         }).then(data => {
           this.$msgs(obj.id ? '编辑成功' : '新增成功')
           this.fetchData()

部分文件因为文件数量过多而无法显示