fix:优化我的常用

This commit is contained in:
大黑 2025-12-25 20:29:01 +08:00
parent 4e1b7168a5
commit 2ab9517ed0
8 changed files with 704 additions and 544 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -160,12 +160,12 @@
<el-dialog
:title="approvalDialogTitle"
:visible.sync="approvalDialogVisible"
width="500px"
width="600px"
:close-on-click-modal="false"
append-to-body
@close="handleApprovalDialogClose"
>
<el-form ref="approvalForm" :model="approvalFormData" :rules="approvalFormRules" label-width="80px">
<el-form ref="approvalForm" :model="approvalFormData" :rules="approvalFormRules" label-width="100px">
<el-form-item
:label="approvalActionType === 'reject' ? '退回意见:' : '提交意见:'"
prop="opinion"
@ -173,7 +173,7 @@
<el-input
v-model="approvalFormData.opinion"
type="textarea"
:rows="4"
:rows="2"
:placeholder="approvalActionType === 'reject' ? '请输入退回意见' : '请输入提交意见'"
/>
</el-form-item>
@ -715,7 +715,8 @@ export default {
this.approvalSubmitting = true
const request = {
...api.HANDLE_APPROVAL,
params: submitData
params: submitData,
disableSuccessMsg: true
}
this.$request(request)
@ -725,12 +726,19 @@ export default {
this.getApprovalSpet()
this.getApprovalChange()
//
this.$message({
message: '审批提交成功',
type: 'success'
})
this.$emit('refresh')
this.approvalSubmitting = false
})
.asyncErrorCatch((err) => {
console.error('审批提交失败:', err)
this.$message.error('审批提交失败,请重试')
this.$message({
message: '审批提交失败,请重试',
type: 'error'
})
this.approvalSubmitting = false
})
.finally(() => {

View File

@ -969,8 +969,8 @@ export default {
max: chart.yAxisMax !== null && chart.yAxisMax !== '' ? chart.yAxisMax : 100,
interval: 20,
axisLabel: {
formatter: '{value}%',
color: '#606266'
formatter: '{value}',
color: '#000'
},
axisLine: {
lineStyle: {

View File

@ -398,54 +398,14 @@ export default {
return a.parameterName.localeCompare(b.parameterName)
})
// 1. 2.
// hiddenParams
// hideMissingParamsByNode
return allParams.filter(param => {
// 使keysubsystemName-parameterName
// 使keysubsystemName-parameterName
const key = `${param.subsystemName}-${param.parameterName}`
if (this.hiddenParams.includes(key)) {
return false
}
//
// param allParams
// 使
if (this.currentCommonConfig && this.currentCommonConfig.subsystems) {
//
const subsystemConfig = this.currentCommonConfig.subsystems.find(s => {
return s.subsystem === param.subsystemName ||
s.subsystem.includes(param.subsystemName) ||
param.subsystemName.includes(s.subsystem)
})
if (!subsystemConfig) {
// 使
return false
}
// parameterId parameterName parameters
// 使 parameterId 使 parameterName
if (param.parameterId) {
const isInCommon = subsystemConfig.parameters.some(
p => p.parameterId === param.parameterId
)
if (!isInCommon) {
// 使
return false
}
} else {
// parameterId使 parameterName
const isInCommon = subsystemConfig.parameters.some(p => {
return p.parameterName === param.parameterName ||
(p.parameterName && param.parameterName &&
(p.parameterName.includes(param.parameterName) ||
param.parameterName.includes(p.parameterName)))
})
if (!isInCommon) {
// 使
return false
}
}
}
return true
})
},
@ -580,6 +540,11 @@ export default {
//
// 使
this.checkedKeys = checkedInfo.checkedKeys
//
//
// hideMissingParamsByNode
//
this.reloadModelDetailsForCheckedNodes()
},
@ -1047,14 +1012,7 @@ export default {
//
this.currentCommonConfig = selectedFavorite.data
//
this.hideMissingParamsByNode()
//
// hideParamsNotInCommon displayParams
//
// 使
//
// 1.
if (this.allTreeData && this.allTreeData.length > 0 && Object.keys(this.allNodeMap).length > 0) {
this.updateCheckedKeysByDisplayParams()
} else {
@ -1062,6 +1020,13 @@ export default {
// loadTreeData loadAllParametersData
console.log('树数据还未加载完成,等待加载完成后再更新选中状态')
}
// 2. displayParams
// 3.
// 使 $nextTick displayParams
this.$nextTick(() => {
this.hideParamsNotInCommonByDisplayParams()
})
},
//
handleDownloadComparisonData() {
@ -1272,9 +1237,9 @@ export default {
this.$refs.paramTree.setCheckedKeys([])
}
}
//
this.reloadModelDetailsForCheckedNodes()
})
//
this.reloadModelDetailsForCheckedNodes()
},
//
rebuildNodeMap(nodes, parentLabel = null) {
@ -1292,13 +1257,21 @@ export default {
}
})
},
//
hideMissingParamsByNode() {
//
//
//
hideParamsNotInCommonByDisplayParams() {
if (!this.currentCommonConfig || !this.currentCommonConfig.subsystems) {
return
}
if (!this.allParametersData || Object.keys(this.allParametersData).length === 0) {
//
// displayParams displayParams computed
// hiddenParams
const { subsystemNames, parameterTypes, subsystemTypes } = this.getSelectedSubsystemsAndTypes()
//
if (subsystemNames.length === 0 && parameterTypes.length === 0) {
return
}
@ -1318,56 +1291,95 @@ export default {
commonParamsMap.set(subsystemName, paramKeys)
})
//
const paramsToHide = []
Object.keys(this.allParametersData).forEach(subsystemName => {
//
const currentDisplayParams = []
subsystemNames.forEach(subsystemName => {
const paramList = this.allParametersData[subsystemName]
if (!Array.isArray(paramList) || paramList.length === 0) {
return
}
//
const commonParamKeys = commonParamsMap.get(subsystemName) || new Set()
//
if (!commonParamsMap.has(subsystemName)) {
paramList.forEach(item => {
const parameterName = item.parameterName || ''
const key = `${subsystemName}-${parameterName}`
if (!paramsToHide.includes(key)) {
paramsToHide.push(key)
}
})
return
}
//
//
paramList.forEach(item => {
const parameterName = item.parameterName || ''
const parameterId = item.parameterId || ''
// 使 parameterId parameterName
const matchKey = parameterId || parameterName
const partsName = item.partsName || ''
const subsystem = item.subsystem || subsystemName
//
const isInCommon = commonParamKeys.has(matchKey)
// partsName
const displayPartsName = partsName === '/' ? subsystem : partsName
if (!isInCommon) {
//
const key = `${subsystemName}-${parameterName}`
if (!paramsToHide.includes(key)) {
paramsToHide.push(key)
//
let isInSelectedNodes = false
if (parameterTypes.length === 0) {
//
isInSelectedNodes = true
} else {
//
isInSelectedNodes = parameterTypes.includes(displayPartsName) ||
subsystemTypes.includes(`${subsystemName}-${displayPartsName}`)
//
if (!isInSelectedNodes) {
const isSubsystemDirectlySelected = this.checkedKeys.some(nodeId => {
const nodeInfo = this.nodeMap[nodeId]
return nodeInfo &&
nodeInfo.isParent &&
nodeInfo.label === subsystemName &&
!this.checkedKeys.some(childNodeId => {
const childNodeInfo = this.nodeMap[childNodeId]
return childNodeInfo &&
!childNodeInfo.isParent &&
childNodeInfo.parentLabel === subsystemName
})
})
if (isSubsystemDirectlySelected && (partsName === '/' || displayPartsName === subsystemName)) {
isInSelectedNodes = true
}
}
}
//
if (isInSelectedNodes) {
currentDisplayParams.push({
subsystemName,
parameterName,
parameterId,
partsName
})
}
})
})
//
paramsToHide.forEach(key => {
if (!this.hiddenParams.includes(key)) {
this.hiddenParams.push(key)
//
const paramsToHide = []
currentDisplayParams.forEach(param => {
const subsystemName = param.subsystemName
const parameterName = param.parameterName
const parameterId = param.parameterId
//
const isSubsystemInCommon = commonParamsMap.has(subsystemName)
const commonParamKeys = commonParamsMap.get(subsystemName) || new Set()
// 使 parameterId parameterName
const matchKey = parameterId || parameterName
//
const isInCommon = isSubsystemInCommon && commonParamKeys.has(matchKey)
if (!isInCommon) {
//
const key = `${subsystemName}-${parameterName}`
if (!paramsToHide.includes(key)) {
paramsToHide.push(key)
}
}
})
// hiddenParams
//
this.hiddenParams = paramsToHide
},
//
hideParamsNotInCommon() {
@ -1792,11 +1804,13 @@ export default {
this.loadAllParametersData().then(() => {
//
if (this.currentCommonConfig) {
//
// hideParamsNotInCommon displayParams
//
// 1.
this.$nextTick(() => {
this.updateCheckedKeysByDisplayParams()
// 2.
this.$nextTick(() => {
this.hideParamsNotInCommonByDisplayParams()
})
})
} else {
//
@ -1845,10 +1859,14 @@ export default {
})
}
this.allParametersData = result
//
this.savedAllParametersData = JSON.parse(JSON.stringify(result))
//
this.loadFavoritesList()
} else {
this.allParametersData = {}
// 使
this.savedAllParametersData = {}
// 使
this.loadFavoritesList()
}
@ -1856,6 +1874,8 @@ export default {
.asyncErrorCatch((err) => {
console.error('获取所有参数数据失败:', err)
this.allParametersData = {}
// 使
this.savedAllParametersData = {}
// 使
this.loadFavoritesList()
})

View File

@ -816,25 +816,37 @@ export default {
)
if (requiredStepsWithoutHandlers.length > 0) {
const stepNames = requiredStepsWithoutHandlers.map((step) => step.name).join('、')
this.$message.warning(`请为必填环节"${stepNames}"选择处理人`)
this.$message({
type: 'warning',
message: `请为必填环节"${stepNames}"选择处理人`
})
return
}
if (!this.currentLaunchRow) {
this.$message.error('缺少报告信息')
this.$message({
type: 'error',
message: '缺少报告信息'
})
return
}
//
const processTitle = (this.launchProcessTitle || '').trim()
if (!processTitle) {
this.$message.warning('请填写流程主题')
this.$message({
type: 'warning',
message: '请填写流程主题'
})
return
}
const reportId = this.currentLaunchRow.reportId || this.currentLaunchRow.id
if (!reportId) {
this.$message.error('缺少报告ID')
this.$message({
type: 'error',
message: '缺少报告ID'
})
return
}
const nodeList = this.launchWorkflowSteps.map((step, index) => ({
@ -870,7 +882,10 @@ export default {
.asyncErrorCatch((err) => {
console.error('发起失败:', err)
this.launching = false
this.$message.error('发起失败,请重试')
this.$message({
type: 'error',
message: '发起失败,请重试'
})
})
},
handleLaunchRemoteSearch(query, stepIndex) {
@ -1310,12 +1325,18 @@ export default {
handleApprovalSubmit() {
//
if (!this.approvalFormData.result) {
this.$message.warning('请选择审核结果(通过或退回)')
this.$message({
type: 'warning',
message: '请选择审核结果(通过或退回)'
})
return
}
if (!this.currentApprovalRow) {
this.$message.error('缺少审批信息')
this.$message({
type: 'error',
message: '缺少审批信息'
})
return
}
@ -1344,7 +1365,10 @@ export default {
.asyncErrorCatch((err) => {
console.error('审批提交失败:', err)
this.approvalSubmitting = false
this.$message.error('审批提交失败,请重试')
this.$message({
type: 'error',
message: '审批提交失败,请重试'
})
})
},
pageSizeChange(size) {