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

View File

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

View File

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

View File

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