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

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"
@ok="onRegister" @cancel="handleModalCancel">
@ok="onRegister" @cancel="handleModalCancel" :maskClosable="false">
<a-form :model="organizationData" :rules="organizationRules" layout="horizontal"
ref="organizationFormRef" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
<!-- 集团单选字符串 -->
<a-form-item name="groupCode" label="集 团">
<a-select v-model:value="organizationData.groupCode" placeholder="请选择集团" style="width: 100%"
show-search :filter-option="filterOption">
<a-select-option v-for="item in groupList" :key="item.hycd" :value="item.hycd" :label="item.hynm">
show-search :filter-option="filterOption" @change="onGroupChange">
<a-select-option v-for="item in groupList" :key="item.hycd" :value="item.hycd"
:label="item.hynm">
{{ item.hynm }}
</a-select-option>
</a-select>
@ -371,7 +372,7 @@ const loadGroupList = async () => {
const res = await getGroupList();
groupList.value = res.data || [];
} catch (error) {
console.error("加载集团列表失败", error);
// console.error("", error);
}
};
@ -380,10 +381,12 @@ const onGroupChange = async () => {
//
// if (value) {
try {
// const res = await getCompanyList(organizationData.groupCode ? organizationData.groupCode : '');
const res = await getCompanyList();
companyList.value = res.data || [];
} catch (error) {
message.error("加载公司列表失败");
// message.error("");
}
// }
};
@ -396,7 +399,7 @@ const onCompanyChange = async () => {
const res = await getBasinList();
basinList.value = res.data || [];
} catch (error) {
message.error("加载流域列表失败");
// message.error("");
}
// }
};
@ -409,7 +412,7 @@ const onBasinChange = async (ids: any) => {
const res = await getStationList(ids);
stationList.value = res.data || [];
} catch (error) {
message.error("加载电站列表失败");
// message.error("");
}
// }
};
@ -449,7 +452,7 @@ const handleSendSms = async () => {
}
}, 1000);
} catch (error: any) {
message.error(error.message || "发送失败,请重试");
// message.error(error.message || "");
}
};
@ -484,7 +487,7 @@ const onRegister = async () => {
try {
await organizationFormRef.value.validate();
} catch (error) {
message.error("请完善组织信息");
// message.error("");
return; //
}
@ -569,6 +572,7 @@ onMounted(() => {
loadGroupList()
onGroupChange()
onCompanyChange()
// modalVisible.value = true
});
@ -786,7 +790,8 @@ const filterOption = (inputValue: string, option: any) => {
}
// 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 {
.right-section {
padding: clamp(12px, 1.5vw, 20px);

View File

@ -15,31 +15,19 @@
<template v-if="column.dataIndex === 'bizType'">
{{ handName(record.bizType, yeWuType) }}
</template>
<template v-if="column.dataIndex === 'status'">
<!-- <template v-if="column.dataIndex === 'status'">
{{ handName(record.status, shenStatus) }}
</template>
</template> -->
</template>
</BasicTable>
<!-- 审批操作日志弹框 -->
<a-modal
v-model:open="approvalLogVisible"
title="审批操作日志"
width="1600px"
:footer="null"
destroy-on-close="false"
>
<a-modal v-model:open="approvalLogVisible" title="审批操作日志" width="1600px" :footer="null"
destroy-on-close="false">
<div class="approval-log-modal-content">
<ApprovalLogSearch
:action-type-dict="actionTypeDict"
@search-finish="handleApprovalLogSearch"
@reset="handleApprovalLogReset"
/>
<BasicTable
ref="approvalLogTableRef"
:columns="approvalLogColumns"
:list-url="getApprovalLogList"
>
<ApprovalLogSearch :action-type-dict="actionTypeDict" @search-finish="handleApprovalLogSearch"
@reset="handleApprovalLogReset" />
<BasicTable ref="approvalLogTableRef" :columns="approvalLogColumns" :list-url="getApprovalLogList">
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'action'">
{{ handName(record.action, actionTypeDict) }}
@ -50,24 +38,11 @@
</a-modal>
<!-- 数据变更记录弹框 -->
<a-modal
v-model:open="changeLogVisible"
title="数据变更记录"
width="1600px"
:footer="null"
destroy-on-close="false"
>
<a-modal v-model:open="changeLogVisible" title="数据变更记录" width="1600px" :footer="null" destroy-on-close="false">
<div class="change-log-modal-content">
<ChangeLogSearch
:operation-type-dict="operationTypeDict"
@search-finish="handleChangeLogSearch"
@reset="handleChangeLogReset"
/>
<BasicTable
ref="changeLogTableRef"
:columns="changeLogColumns"
:list-url="getApprovalChangeLogList"
>
<ChangeLogSearch :operation-type-dict="operationTypeDict" @search-finish="handleChangeLogSearch"
@reset="handleChangeLogReset" />
<BasicTable ref="changeLogTableRef" :columns="changeLogColumns" :list-url="getApprovalChangeLogList">
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'operationType'">
{{ handName(record.operationType, operationTypeDict) }}
@ -86,8 +61,9 @@
</template>
<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 { Tag } from "ant-design-vue"; // Tag
import BasicTable from "@/components/BasicTable/index.vue";
import GuoYuSheShiShuJuTianBaoSearch from "./shengPiJiLuSearch.vue";
import ApprovalLogSearch from "./approvalLogSearch.vue";
@ -136,6 +112,16 @@ let columns = ref([
key: 'status',
width: 80,
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 || "-"
);
},
},
{
@ -399,7 +385,7 @@ onMounted(() => {
const shenStatus = ref([])
const yeWuType = ref([])
const dictNmae = () => {
getDictItemsByCode({ dictCode: 'shenStatus' }).then((res) => {
getDictItemsByCode({ dictCode: 'approvalStatus' }).then((res) => {
shenStatus.value = res.data;
});
getDictItemsByCode({ dictCode: 'yeWuType' }).then((res) => {
@ -407,10 +393,15 @@ const dictNmae = () => {
});
// TODO:
getDictItemsByCode({ dictCode: 'caoType' }).then((res) => {
actionTypeDict.value = res.data;
});
getDictItemsByCode({ dictCode: 'caoTypeTwo' }).then((res) => {
operationTypeDict.value = res.data;
res.data.forEach((item: any) => {
if (item.itemCode == 'UPDATE' || item.itemCode == 'DELETE') {
operationTypeDict.value.push(item);
} else {
actionTypeDict.value.push(item)
}
})
});
}
const handName = (val: any, arr: any) => {

View File

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

View File

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