修改代理机构
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 { getPage, delObj, getAgentSummary, resetPassword } from '/@/api/purchase/purchaseagent';
|
||||||
import { deptTree } from '/@/api/admin/dept';
|
import { deptTree } from '/@/api/admin/dept';
|
||||||
import { useMessage, useMessageBox } from '/@/hooks/message';
|
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';
|
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 {
|
try {
|
||||||
const res = await resetPassword(row.id);
|
const res = await resetPassword(row.id);
|
||||||
const newPassword = res?.data || res;
|
const newPassword = res?.data || res;
|
||||||
useMessageBox().success(`新密码:${newPassword}`);
|
const username = row.username || '';
|
||||||
useMessage().success('密码重置成功');
|
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) {
|
} catch (err: any) {
|
||||||
useMessage().error(err?.msg || err?.message || '重置密码失败');
|
useMessage().error(err?.msg || err?.message || '重置密码失败');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user