修改代理机构
This commit is contained in:
@@ -199,6 +199,7 @@ import { BasicTableProps, useTable } from '/@/hooks/table';
|
||||
import { getPage, delObj, getAgentSummary, resetPassword } from '/@/api/purchase/purchaseagent';
|
||||
import { deptTree } from '/@/api/admin/dept';
|
||||
import { useMessage, useMessageBox } from '/@/hooks/message';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { List, Document, EditPen, Clock, Search, User, Phone, UserFilled, CircleCheck, Key } from '@element-plus/icons-vue';
|
||||
|
||||
// 引入组件
|
||||
@@ -346,8 +347,34 @@ const handleResetPassword = async (row: any) => {
|
||||
try {
|
||||
const res = await resetPassword(row.id);
|
||||
const newPassword = res?.data || res;
|
||||
useMessageBox().success(`新密码:${newPassword}`);
|
||||
useMessage().success('密码重置成功');
|
||||
const username = row.username || '';
|
||||
const copyText = `用户名:${username}\n密码:${newPassword}`;
|
||||
|
||||
ElMessageBox.alert(
|
||||
`<div style="line-height: 2;">
|
||||
<p><strong>用户名:</strong>${username}</p>
|
||||
<p><strong>密码:</strong>${newPassword}</p>
|
||||
</div>`,
|
||||
'密码重置成功',
|
||||
{
|
||||
dangerouslyUseHTMLString: true,
|
||||
confirmButtonText: '复制并关闭',
|
||||
type: 'success',
|
||||
beforeClose: (action, instance, done) => {
|
||||
if (action === 'confirm') {
|
||||
navigator.clipboard.writeText(copyText).then(() => {
|
||||
useMessage().success('已复制到剪贴板');
|
||||
done();
|
||||
}).catch(() => {
|
||||
useMessage().error('复制失败,请手动复制');
|
||||
done();
|
||||
});
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
},
|
||||
}
|
||||
);
|
||||
} catch (err: any) {
|
||||
useMessage().error(err?.msg || err?.message || '重置密码失败');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user