|
@@ -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()
|