大屏页面初始化

This commit is contained in:
2026-03-06 10:47:14 +08:00
parent 526d16284e
commit 4c62e80407
22 changed files with 126 additions and 63 deletions

View File

@@ -58,6 +58,7 @@
"integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@babel/code-frame": "^7.29.0",
"@babel/generator": "^7.29.0",
@@ -1404,6 +1405,7 @@
"resolved": "https://registry.npmmirror.com/@types/lodash-es/-/lodash-es-4.17.12.tgz",
"integrity": "sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==",
"license": "MIT",
"peer": true,
"dependencies": {
"@types/lodash": "*"
}
@@ -1897,6 +1899,7 @@
}
],
"license": "MIT",
"peer": true,
"dependencies": {
"baseline-browser-mapping": "^2.9.0",
"caniuse-lite": "^1.0.30001759",
@@ -2637,13 +2640,15 @@
"version": "4.17.23",
"resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.23.tgz",
"integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==",
"license": "MIT"
"license": "MIT",
"peer": true
},
"node_modules/lodash-es": {
"version": "4.17.23",
"resolved": "https://registry.npmmirror.com/lodash-es/-/lodash-es-4.17.23.tgz",
"integrity": "sha512-kVI48u3PZr38HdYz98UmfPnXl2DXrpdctLrFLCd3kOx1xUkOmpFPx7gCWWM5MPkL/fD8zb+Ph0QzjGFs4+hHWg==",
"license": "MIT"
"license": "MIT",
"peer": true
},
"node_modules/lodash-unified": {
"version": "1.0.3",
@@ -2873,7 +2878,7 @@
},
"node_modules/pinia": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/pinia/-/pinia-3.0.4.tgz",
"resolved": "https://registry.npmmirror.com/pinia/-/pinia-3.0.4.tgz",
"integrity": "sha512-l7pqLUFTI/+ESXn6k3nu30ZIzW5E2WZF/LaHJEpoq6ElcLD+wduZoB2kBN19du6K/4FDpPMazY2wJr+IndBtQw==",
"license": "MIT",
"dependencies": {
@@ -3259,6 +3264,7 @@
"integrity": "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"esbuild": "^0.27.0",
"fdir": "^6.5.0",
@@ -3437,6 +3443,7 @@
"resolved": "https://registry.npmmirror.com/vue/-/vue-3.5.28.tgz",
"integrity": "sha512-BRdrNfeoccSoIZeIhyPBfvWSLFP4q8J3u8Ju8Ug5vu3LdD+yTM13Sg4sKtljxozbnuMu1NB1X5HBHRYUzFocKg==",
"license": "MIT",
"peer": true,
"dependencies": {
"@vue/compiler-dom": "3.5.28",
"@vue/compiler-sfc": "3.5.28",

View File

@@ -41,4 +41,16 @@ export function updatePasswd(params) {
method: 'post',
params: params
})
}
/**
* 初始化密码
*/
export function initPasswd(params) {
return request({
url: '/initPasswd',
method: 'post',
params: params
})
}

View File

@@ -68,6 +68,7 @@ const submitForm = async () => {
userId: userStore.loginUser?.userId || ''
}
const res = await updatePasswd(reqParams)
ElMessage.success(res.msg);
await new Promise(res => setTimeout(res, 800))
isMounted.value && emit('success')
return true

View File

@@ -377,7 +377,6 @@ const submitEditPwd = () => {
const handlePwdModifySuccess = () => {
if (!isMounted.value) return
closeEditPwdDialog();
ElMessage.success('密码修改成功,请重新登录');
userStore.logout();
router.push('/login');
}

View File

@@ -73,6 +73,10 @@
<el-icon><Edit /></el-icon>
编辑
</el-button>
<el-button size="small" type="warning" @click="handleResetPwd(scope.row)">
<el-icon><Key /></el-icon>
初始化
</el-button>
<el-button size="small" type="danger" @click="handleDelete(scope.row)">
<el-icon><Delete /></el-icon>
删除
@@ -98,8 +102,9 @@
<script setup>
import { ref, reactive, onMounted } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { ElMessage, ElMessageBox, ElNotification } from 'element-plus'
import { Plus, Download, Edit, Delete } from '@element-plus/icons-vue'
import { initPasswd } from '@/api/user'
import { getHomeUserList, getHomeUserSave, getHomeUserDelete } from '@/api/bizUser'
import CSearch from '@/components/Search/proSearch.vue'
@@ -191,21 +196,45 @@ const handleExport = () => {
}
const handleDelete = async (row) => {
try {
await ElMessageBox.confirm('确定要删除该条数据吗?', '删除确认', {
type: 'warning',
closeOnClickModal: false,
showClose: false
})
ElMessageBox.confirm('确定要删除该条数据吗?', '删除确认', {
type: 'warning',
closeOnClickModal: false,
showClose: false
})
.then(async () => {
const reqParams = {
userId: row.userId
}
const res = await getHomeUserDelete(reqParams);
ElMessage.success(res.msg);
getDataList();
})
.catch(() => {
ElMessage.info('已取消删除数据操作');
});
}
const handleResetPwd = async (row) => {
ElMessageBox.confirm('确定要初始化该用户的密码吗?', '初始化确认', {
type: 'warning',
closeOnClickModal: false,
showClose: false
})
.then(async () => {
const reqParams = {
userId: row.userId
}
const res = await getHomeUserDelete(reqParams);
ElMessage.success('删除成功');
getDataList();
} catch (error) {
ElMessage.error('删除数据失败,请重试' ,error);
}
const res = await initPasswd(reqParams);
ElNotification({
title: '初始化密码',
message: res.msg,
type: 'success',
})
getDataList();
})
.catch(() => {
ElMessage.info('已取消密码初始化操作');
});
}
const handleSizeChange = (val) => {