字典统一变动,重置密码功能,用户审核管理页面样式,逻辑优化,审批记录页面样式逻辑优化,注册页面样式逻辑优化

This commit is contained in:
王兴凯 2026-04-29 10:51:30 +08:00
parent 163f37dd1e
commit 2181329316
6 changed files with 123 additions and 93 deletions

View File

@ -96,15 +96,16 @@
<!-- 注册确认弹框 --> <!-- 注册确认弹框 -->
<a-modal v-model:open="modalVisible" title="选择所属组织" width="600px" :confirm-loading="loading" <a-modal v-model:open="modalVisible" title="选择所属组织" width="600px" :confirm-loading="loading"
@ok="onRegister" @cancel="handleModalCancel"> @ok="onRegister" @cancel="handleModalCancel" :maskClosable="false">
<a-form :model="organizationData" :rules="organizationRules" layout="horizontal" <a-form :model="organizationData" :rules="organizationRules" layout="horizontal"
ref="organizationFormRef" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }"> ref="organizationFormRef" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
<!-- 集团单选字符串 --> <!-- 集团单选字符串 -->
<a-form-item name="groupCode" label="集 团"> <a-form-item name="groupCode" label="集 团">
<a-select v-model:value="organizationData.groupCode" placeholder="请选择集团" style="width: 100%" <a-select v-model:value="organizationData.groupCode" placeholder="请选择集团" style="width: 100%"
show-search :filter-option="filterOption"> show-search :filter-option="filterOption" @change="onGroupChange">
<a-select-option v-for="item in groupList" :key="item.hycd" :value="item.hycd" :label="item.hynm"> <a-select-option v-for="item in groupList" :key="item.hycd" :value="item.hycd"
:label="item.hynm">
{{ item.hynm }} {{ item.hynm }}
</a-select-option> </a-select-option>
</a-select> </a-select>
@ -371,7 +372,7 @@ const loadGroupList = async () => {
const res = await getGroupList(); const res = await getGroupList();
groupList.value = res.data || []; groupList.value = res.data || [];
} catch (error) { } catch (error) {
console.error("加载集团列表失败", error); // console.error("", error);
} }
}; };
@ -380,10 +381,12 @@ const onGroupChange = async () => {
// //
// if (value) { // if (value) {
try { try {
// const res = await getCompanyList(organizationData.groupCode ? organizationData.groupCode : '');
const res = await getCompanyList(); const res = await getCompanyList();
companyList.value = res.data || []; companyList.value = res.data || [];
} catch (error) { } catch (error) {
message.error("加载公司列表失败"); // message.error("");
} }
// } // }
}; };
@ -396,7 +399,7 @@ const onCompanyChange = async () => {
const res = await getBasinList(); const res = await getBasinList();
basinList.value = res.data || []; basinList.value = res.data || [];
} catch (error) { } catch (error) {
message.error("加载流域列表失败"); // message.error("");
} }
// } // }
}; };
@ -409,7 +412,7 @@ const onBasinChange = async (ids: any) => {
const res = await getStationList(ids); const res = await getStationList(ids);
stationList.value = res.data || []; stationList.value = res.data || [];
} catch (error) { } catch (error) {
message.error("加载电站列表失败"); // message.error("");
} }
// } // }
}; };
@ -449,7 +452,7 @@ const handleSendSms = async () => {
} }
}, 1000); }, 1000);
} catch (error: any) { } catch (error: any) {
message.error(error.message || "发送失败,请重试"); // message.error(error.message || "");
} }
}; };
@ -484,7 +487,7 @@ const onRegister = async () => {
try { try {
await organizationFormRef.value.validate(); await organizationFormRef.value.validate();
} catch (error) { } catch (error) {
message.error("请完善组织信息"); // message.error("");
return; // return; //
} }
@ -569,6 +572,7 @@ onMounted(() => {
loadGroupList() loadGroupList()
onGroupChange() onGroupChange()
onCompanyChange() onCompanyChange()
// modalVisible.value = true
}); });
@ -617,7 +621,7 @@ const filterOption = (inputValue: string, option: any) => {
color: #040504; color: #040504;
font-size: clamp(24px, 3vw, 40px); // font-size: clamp(24px, 3vw, 40px); //
line-height: 1.5; line-height: 1.5;
p { p {
margin: 0; margin: 0;
word-wrap: break-word; // word-wrap: break-word; //
@ -644,12 +648,12 @@ const filterOption = (inputValue: string, option: any) => {
&::-webkit-scrollbar { &::-webkit-scrollbar {
width: 6px; width: 6px;
} }
&::-webkit-scrollbar-thumb { &::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.2); background-color: rgba(0, 0, 0, 0.2);
border-radius: 3px; border-radius: 3px;
} }
&::-webkit-scrollbar-track { &::-webkit-scrollbar-track {
background-color: transparent; background-color: transparent;
} }
@ -786,15 +790,16 @@ const filterOption = (inputValue: string, option: any) => {
} }
// 125%150% // 125%150%
@media (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi) { @media (-webkit-min-device-pixel-ratio: 1.25),
(min-resolution: 120dpi) {
.register-container { .register-container {
.right-section { .right-section {
padding: clamp(12px, 1.5vw, 20px); padding: clamp(12px, 1.5vw, 20px);
.form-section { .form-section {
margin-bottom: clamp(10px, 1.2vh, 16px); margin-bottom: clamp(10px, 1.2vh, 16px);
} }
:deep(.ant-form-item) { :deep(.ant-form-item) {
margin-bottom: clamp(8px, 1vh, 14px); margin-bottom: clamp(8px, 1vh, 14px);
} }
@ -808,17 +813,17 @@ const filterOption = (inputValue: string, option: any) => {
.right-section { .right-section {
max-height: 95vh; max-height: 95vh;
padding: 10px 15px; padding: 10px 15px;
.form-section { .form-section {
margin-bottom: 8px; margin-bottom: 8px;
.section-title { .section-title {
margin-bottom: 6px; margin-bottom: 6px;
padding-bottom: 6px; padding-bottom: 6px;
font-size: 13px; font-size: 13px;
} }
} }
:deep(.ant-form-item) { :deep(.ant-form-item) {
margin-bottom: 8px; margin-bottom: 8px;
} }

View File

@ -15,31 +15,19 @@
<template v-if="column.dataIndex === 'bizType'"> <template v-if="column.dataIndex === 'bizType'">
{{ handName(record.bizType, yeWuType) }} {{ handName(record.bizType, yeWuType) }}
</template> </template>
<template v-if="column.dataIndex === 'status'"> <!-- <template v-if="column.dataIndex === 'status'">
{{ handName(record.status, shenStatus) }} {{ handName(record.status, shenStatus) }}
</template> </template> -->
</template> </template>
</BasicTable> </BasicTable>
<!-- 审批操作日志弹框 --> <!-- 审批操作日志弹框 -->
<a-modal <a-modal v-model:open="approvalLogVisible" title="审批操作日志" width="1600px" :footer="null"
v-model:open="approvalLogVisible" destroy-on-close="false">
title="审批操作日志"
width="1600px"
:footer="null"
destroy-on-close="false"
>
<div class="approval-log-modal-content"> <div class="approval-log-modal-content">
<ApprovalLogSearch <ApprovalLogSearch :action-type-dict="actionTypeDict" @search-finish="handleApprovalLogSearch"
:action-type-dict="actionTypeDict" @reset="handleApprovalLogReset" />
@search-finish="handleApprovalLogSearch" <BasicTable ref="approvalLogTableRef" :columns="approvalLogColumns" :list-url="getApprovalLogList">
@reset="handleApprovalLogReset"
/>
<BasicTable
ref="approvalLogTableRef"
:columns="approvalLogColumns"
:list-url="getApprovalLogList"
>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'action'"> <template v-if="column.dataIndex === 'action'">
{{ handName(record.action, actionTypeDict) }} {{ handName(record.action, actionTypeDict) }}
@ -50,24 +38,11 @@
</a-modal> </a-modal>
<!-- 数据变更记录弹框 --> <!-- 数据变更记录弹框 -->
<a-modal <a-modal v-model:open="changeLogVisible" title="数据变更记录" width="1600px" :footer="null" destroy-on-close="false">
v-model:open="changeLogVisible"
title="数据变更记录"
width="1600px"
:footer="null"
destroy-on-close="false"
>
<div class="change-log-modal-content"> <div class="change-log-modal-content">
<ChangeLogSearch <ChangeLogSearch :operation-type-dict="operationTypeDict" @search-finish="handleChangeLogSearch"
:operation-type-dict="operationTypeDict" @reset="handleChangeLogReset" />
@search-finish="handleChangeLogSearch" <BasicTable ref="changeLogTableRef" :columns="changeLogColumns" :list-url="getApprovalChangeLogList">
@reset="handleChangeLogReset"
/>
<BasicTable
ref="changeLogTableRef"
:columns="changeLogColumns"
:list-url="getApprovalChangeLogList"
>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'operationType'"> <template v-if="column.dataIndex === 'operationType'">
{{ handName(record.operationType, operationTypeDict) }} {{ handName(record.operationType, operationTypeDict) }}
@ -86,8 +61,9 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, reactive, onMounted } from 'vue'; import { ref, reactive, onMounted,h } from 'vue';
import { queryPageList, getApprovalLogList, getApprovalChangeLogList } from '@/api/shengPiJiLu'; import { queryPageList, getApprovalLogList, getApprovalChangeLogList } from '@/api/shengPiJiLu';
import { Tag } from "ant-design-vue"; // Tag
import BasicTable from "@/components/BasicTable/index.vue"; import BasicTable from "@/components/BasicTable/index.vue";
import GuoYuSheShiShuJuTianBaoSearch from "./shengPiJiLuSearch.vue"; import GuoYuSheShiShuJuTianBaoSearch from "./shengPiJiLuSearch.vue";
import ApprovalLogSearch from "./approvalLogSearch.vue"; import ApprovalLogSearch from "./approvalLogSearch.vue";
@ -120,14 +96,14 @@ let columns = ref([
dataIndex: 'applyUserName', dataIndex: 'applyUserName',
key: 'applyUserName', key: 'applyUserName',
width: 120, width: 120,
align: 'center' align: 'center'
}, },
{ {
title: '提交时间', title: '提交时间',
dataIndex: 'applyTime', dataIndex: 'applyTime',
key: 'applyTime', key: 'applyTime',
width: 160, width: 160,
align: 'center' align: 'center'
}, },
{ {
@ -136,6 +112,16 @@ let columns = ref([
key: 'status', key: 'status',
width: 80, width: 80,
align: 'center', align: 'center',
customRender: ({ text }: any) => {
let data = shenStatus.value.find((item: any) => item.itemCode === text);
return h(
Tag,
{
color: data?.custom1 || "error", // Antdv Tag
},
() => data?.dictName || "-"
);
},
}, },
{ {
@ -143,14 +129,14 @@ let columns = ref([
dataIndex: 'approverName', dataIndex: 'approverName',
key: 'approverName', key: 'approverName',
width: 120, width: 120,
align: 'center' align: 'center'
}, },
{ {
title: '审批时间', title: '审批时间',
dataIndex: 'approveTime', dataIndex: 'approveTime',
key: 'approveTime', key: 'approveTime',
width: 160, width: 160,
align: 'center' align: 'center'
}, },
{ {
@ -222,7 +208,7 @@ const approvalLogColumns = ref([
key: 'operateTime', key: 'operateTime',
width: 180 width: 180
}, },
{ {
title: '创建时间', title: '创建时间',
dataIndex: 'createdAt', dataIndex: 'createdAt',
key: 'createdAt', key: 'createdAt',
@ -234,7 +220,7 @@ const approvalLogColumns = ref([
key: 'commentInfo', key: 'commentInfo',
ellipsis: true, ellipsis: true,
}, },
]); ]);
// //
@ -281,7 +267,7 @@ const changeLogColumns = ref([
key: 'changeJson', key: 'changeJson',
ellipsis: true ellipsis: true
}, },
]); ]);
const currentApprovalId = ref(''); const currentApprovalId = ref('');
@ -399,7 +385,7 @@ onMounted(() => {
const shenStatus = ref([]) const shenStatus = ref([])
const yeWuType = ref([]) const yeWuType = ref([])
const dictNmae = () => { const dictNmae = () => {
getDictItemsByCode({ dictCode: 'shenStatus' }).then((res) => { getDictItemsByCode({ dictCode: 'approvalStatus' }).then((res) => {
shenStatus.value = res.data; shenStatus.value = res.data;
}); });
getDictItemsByCode({ dictCode: 'yeWuType' }).then((res) => { getDictItemsByCode({ dictCode: 'yeWuType' }).then((res) => {
@ -407,10 +393,15 @@ const dictNmae = () => {
}); });
// TODO: // TODO:
getDictItemsByCode({ dictCode: 'caoType' }).then((res) => { getDictItemsByCode({ dictCode: 'caoType' }).then((res) => {
actionTypeDict.value = res.data;
});
getDictItemsByCode({ dictCode: 'caoTypeTwo' }).then((res) => { res.data.forEach((item: any) => {
operationTypeDict.value = res.data; if (item.itemCode == 'UPDATE' || item.itemCode == 'DELETE') {
operationTypeDict.value.push(item);
} else {
actionTypeDict.value.push(item)
}
})
}); });
} }
const handName = (val: any, arr: any) => { const handName = (val: any, arr: any) => {
@ -420,7 +411,7 @@ const handName = (val: any, arr: any) => {
dictName1 = item.dictName dictName1 = item.dictName
} }
}) })
return dictName1 return dictName1
} }
</script> </script>

View File

@ -77,7 +77,7 @@ onMounted(() => {
}); });
const statusData = ref(false) const statusData = ref(false)
const getstatusData = () => { const getstatusData = () => {
getDictItemsByCode({ dictCode: "shenStatus" }).then((res) => { getDictItemsByCode({ dictCode: "approvalStatus" }).then((res) => {
statusData.value = res.data; statusData.value = res.data;
}); });
}; };

View File

@ -25,6 +25,7 @@ import {
import { ElMessageBox, ElMessage } from "element-plus"; import { ElMessageBox, ElMessage } from "element-plus";
import Page from '@/components/Pagination/page.vue' import Page from '@/components/Pagination/page.vue'
import { Search } from '@element-plus/icons-vue' import { Search } from '@element-plus/icons-vue'
import { p } from "vue-router/dist/router-CWoNjPRp.mjs";
// //
const loading = ref(false); const loading = ref(false);
// //
@ -173,9 +174,11 @@ function handleClose() {
// //
const userid = ref(""); const userid = ref("");
const resultPawss = ref(false)
const msgText = ref('')
function setpassword(row: any) { function setpassword(row: any) {
ElMessageBox.confirm( ElMessageBox.confirm(
'确定将该账号密码重置为123456吗?', '确定要重置此账号密码吗?',
'重置密码', '重置密码',
{ {
confirmButtonText: '确定', confirmButtonText: '确定',
@ -187,11 +190,15 @@ function setpassword(row: any) {
const params = { const params = {
id: userid.value id: userid.value
} }
setpass(params).then(() => { setpass(params).then((res: any) => {
ElMessage({ if (res.code == 0) {
type: 'success', resultPawss.value = true
message: '密码重置成功', msgText.value = res.data
}) }
// ElMessage({
// type: 'success',
// message: '',
// })
}) })
}) })
userid.value = row.id userid.value = row.id
@ -660,11 +667,29 @@ function getName(arr: any[], type: any): string {
return items?.dictName || '' return items?.dictName || ''
} }
// Tag
function getRegStatusColor(type: any): string {
if (!regStatusArr.value || !Array.isArray(regStatusArr.value) || type === undefined || type === null) {
return 'info'
}
const items = regStatusArr.value.find((item: any) => item?.itemCode == type)
const color = items?.custom1 || 'info'
// custom1Element Plus Tag
const colorMap: Record<string, string> = {
'blue': 'primary', // -
'green': 'success', // - 绿
'red': 'danger' // -
}
return colorMap[color] || 'info'
}
// ==================== ==================== // ==================== ====================
// //
const auditDialogVisible = ref(false); const auditDialogVisible = ref(false);
// 1-2- // 1-2-
const auditType = ref(1); const auditType = ref('');
// ID // ID
const currentAuditUserId = ref(''); const currentAuditUserId = ref('');
// //
@ -684,7 +709,7 @@ const auditRules = ref({
// //
function handleAuditPass(row: any) { function handleAuditPass(row: any) {
currentAuditUserId.value = row.id; currentAuditUserId.value = row.id;
auditType.value = 1; auditType.value = 'APPROVED';
auditForm.value.commentInfo = ''; auditForm.value.commentInfo = '';
auditDialogVisible.value = true; auditDialogVisible.value = true;
} }
@ -692,7 +717,7 @@ function handleAuditPass(row: any) {
// //
function handleAuditReject(row: any) { function handleAuditReject(row: any) {
currentAuditUserId.value = row.id; currentAuditUserId.value = row.id;
auditType.value = 2; auditType.value = 'REJECTED';
auditForm.value.commentInfo = ''; auditForm.value.commentInfo = '';
auditDialogVisible.value = true; auditDialogVisible.value = true;
} }
@ -719,7 +744,7 @@ function submitAudit(formEl: any) {
auditUser(params).then(() => { auditUser(params).then(() => {
ElMessage({ ElMessage({
type: 'success', type: 'success',
message: auditType.value === 1 ? '审批通过成功' : '审批驳回成功' message: auditType.value === 'APPROVED' ? '审批通过成功' : '审批驳回成功'
}); });
handleAuditClose(); handleAuditClose();
getdata(); // getdata(); //
@ -743,7 +768,7 @@ function getdictdata() {
getDictItemsByCode({ dictCode: 'resourceType' }).then(res => { getDictItemsByCode({ dictCode: 'resourceType' }).then(res => {
dictData.value = res.data dictData.value = res.data
}) })
getDictItemsByCode({ dictCode: 'regStatus' }).then(res => { getDictItemsByCode({ dictCode: 'approvalStatus' }).then(res => {
regStatusArr.value = res.data regStatusArr.value = res.data
}) })
} }
@ -921,9 +946,11 @@ function handleClearSelection() {
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="rolename" label="审核状态" width="120" align="center"> <el-table-column prop="regStatus" label="审核状态" width="120" align="center">
<template #default="scope"> <template #default="scope">
{{ getName(regStatusArr, scope.row.regStatus) }} <el-tag :type="getRegStatusColor(scope.row.regStatus)" size="small">
{{ getName(regStatusArr, scope.row.regStatus) }}
</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="lastmodifier" label="最近修改者" width="120"></el-table-column> <el-table-column prop="lastmodifier" label="最近修改者" width="120"></el-table-column>
@ -936,15 +963,17 @@ function handleClearSelection() {
<template #default="scope"> <template #default="scope">
<span <span
style="display: flex;display: -webkit-flex;justify-content: space-around;-webkit-justify-content: space-around; "> style="display: flex;display: -webkit-flex;justify-content: space-around;-webkit-justify-content: space-around; ">
<img src="@/assets/MenuIcon/lbcz_xg.png" alt="" title="修改"
@click="editdepartment(scope.row)" style="cursor: pointer;"> <img v-if="scope.row.regStatus == 'PENDING'" src="@/assets/MenuIcon/lbcz_xg.png" alt=""
title="修改" @click="editdepartment(scope.row)" style="cursor: pointer;">
<!-- frontend/src/assets/components/fish.png --> <!-- frontend/src/assets/components/fish.png -->
<img src="@/assets/components/fish.png" alt="" title="过鱼设施权限维护" <img v-if="scope.row.regStatus == 'PENDING'" src="@/assets/components/fish.png" alt=""
@click="openFishway(scope.row)" style="cursor: pointer;"> title="过鱼设施权限维护" @click="openFishway(scope.row)" style="cursor: pointer;">
<img src="@/assets/components/shenpitongguo.png" alt="" title="审批通过" <img v-if="scope.row.regStatus == 'PENDING'" src="@/assets/components/shenpitongguo.png"
@click="handleAuditPass(scope.row)" style="cursor: pointer;"> alt="" title="审批通过" @click="handleAuditPass(scope.row)" style="cursor: pointer;">
<img src="@/assets/components/shenpibohui.png" alt="" title="审批驳回" <img v-if="scope.row.regStatus == 'PENDING'" src="@/assets/components/shenpibohui.png"
@click="handleAuditReject(scope.row)" style="cursor: pointer;"> alt="" title="审批驳回" @click="handleAuditReject(scope.row)" style="cursor: pointer;">
<img src="@/assets/MenuIcon/lbcz_czmm.png" alt="" title="重置密码" <img src="@/assets/MenuIcon/lbcz_czmm.png" alt="" title="重置密码"
@click="setpassword(scope.row)" style="cursor: pointer;"> @click="setpassword(scope.row)" style="cursor: pointer;">
<!-- <img src="@/assets/MenuIcon/lbcz_sc.png" alt="" title="删除" @click="delclick(scope.row)" <!-- <img src="@/assets/MenuIcon/lbcz_sc.png" alt="" title="删除" @click="delclick(scope.row)"
@ -1054,11 +1083,12 @@ function handleClearSelection() {
</el-dialog> </el-dialog>
<!-- 审批意见对话框 --> <!-- 审批意见对话框 -->
<el-dialog v-model="auditDialogVisible" :title="auditType === 1 ? '审批通过' : '审批驳回'" width="500px" append-to-body <el-dialog v-model="auditDialogVisible" :title="auditType === 'APPROVED' ? '审批通过' : '审批驳回'" width="500px"
:before-close="handleAuditClose"> append-to-body :before-close="handleAuditClose">
<el-form ref="auditFormRef" :model="auditForm" :rules="auditRules" label-width="80px"> <el-form ref="auditFormRef" :model="auditForm" :rules="auditRules" label-width="80px">
<el-form-item label="审批意见" prop="commentInfo"> <el-form-item label="审批意见" prop="commentInfo">
<el-input v-model="auditForm.commentInfo" type="textarea" :rows="4" placeholder="请输入审批意见" /> <el-input v-model="auditForm.commentInfo" type="textarea" :rows="4" placeholder="请输入审批意见"
maxlength="200" show-word-limit />
</el-form-item> </el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
@ -1068,6 +1098,10 @@ function handleClearSelection() {
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
<!-- 重置密码后的回显 -->
<el-dialog v-model="resultPawss" width="500px" append-to-body :before-close="handleAuditClose">
已将密码重置为{{ msgText }}
</el-dialog>
</div> </div>
</template> </template>