|
@@ -32,12 +32,12 @@
|
|
|
<template #operate="{ row }">
|
|
|
<div class="table-operations">
|
|
|
<t-link
|
|
|
- v-if="perm.LINK_UpdatePwd"
|
|
|
+ v-if="perm.LINK_InitPwd"
|
|
|
theme="primary"
|
|
|
hover="color"
|
|
|
@click="handleModifyPwd(row)"
|
|
|
>
|
|
|
- 修改密码
|
|
|
+ 初始化密码
|
|
|
</t-link>
|
|
|
|
|
|
<t-link
|
|
@@ -69,7 +69,6 @@
|
|
|
></AddUserDialog>
|
|
|
|
|
|
<UpdateUserPwdDialog
|
|
|
- v-if="perm.LINK_UpdatePwd"
|
|
|
v-model:visible="showUpdateUserPwdDialog"
|
|
|
:curRow="curRow"
|
|
|
@success="updatePwdSuccess"
|
|
@@ -80,7 +79,7 @@
|
|
|
|
|
|
<script setup name="User">
|
|
|
import { ref } from 'vue';
|
|
|
-import { getUserList } from '@/api/user';
|
|
|
+import { getUserList, initUserPassword } from '@/api/user';
|
|
|
import useFetchTable from '@/hooks/useFetchTable';
|
|
|
import AddUserDialog from './add-user-dialog.vue';
|
|
|
import UpdateUserPwdDialog from './update-user-pwd-dialog.vue';
|
|
@@ -151,7 +150,21 @@ const handleEnable = (row) => {
|
|
|
|
|
|
const handleModifyPwd = (row) => {
|
|
|
curRow.value = row;
|
|
|
- showUpdateUserPwdDialog.value = true;
|
|
|
+ const confirmDia = DialogPlugin({
|
|
|
+ header: `提示`,
|
|
|
+ body: `初始密码为手机后6位,是否初始化用户 [ ${row.realName} ] 的密码?`,
|
|
|
+ confirmBtn: '确定',
|
|
|
+ cancelBtn: '取消',
|
|
|
+ onConfirm: async () => {
|
|
|
+ confirmDia.hide();
|
|
|
+ const res = await initUserPassword({
|
|
|
+ id: row.id,
|
|
|
+ }).catch(() => {});
|
|
|
+ if (!res) return;
|
|
|
+ MessagePlugin.success('操作成功');
|
|
|
+ },
|
|
|
+ });
|
|
|
+ // showUpdateUserPwdDialog.value = true;
|
|
|
};
|
|
|
|
|
|
const addSuccess = () => {
|
|
@@ -160,7 +173,7 @@ const addSuccess = () => {
|
|
|
search();
|
|
|
};
|
|
|
const updatePwdSuccess = () => {
|
|
|
- showUpdateUserPwdDialog.value = false;
|
|
|
+ // showUpdateUserPwdDialog.value = false;
|
|
|
MessagePlugin.success('操作成功');
|
|
|
};
|
|
|
</script>
|