This commit is contained in:
大黑 2025-12-25 15:24:54 +08:00
parent f280a779b3
commit 94897e9265
13 changed files with 1973 additions and 1707 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

@ -189,11 +189,6 @@
添加/修改公式 添加/修改公式
</el-button> </el-button>
</div> </div>
<div v-if="chart.chartType === 'scatter'" class="config-item">
<el-checkbox v-model="chart.scatterTrendline" @change="updateChart(index)">
显示趋势线
</el-checkbox>
</div>
<div v-if="chart.chartType !== 'pie'" class="config-item"> <div v-if="chart.chartType !== 'pie'" class="config-item">
<span class="config-label">Y轴范围:</span> <span class="config-label">Y轴范围:</span>
<el-input <el-input
@ -254,69 +249,69 @@
class="formula-dialog" class="formula-dialog"
> >
<div class="formula-dialog-content"> <div class="formula-dialog-content">
<div class="formula-input-section"> <el-form :model="formulaFormData" label-width="100px">
<el-form-item label="公式名称:" required> <el-form-item label="公式名称:" required>
<el-input <el-input
v-model="formulaName" v-model="formulaFormData.name"
placeholder="请输入公式名称" placeholder="请输入公式名称"
maxlength="50" maxlength="50"
show-word-limit show-word-limit
/> />
</el-form-item> </el-form-item>
<div class="formula-input-section"> <el-form-item label="参数1:" required>
<span class="formula-label">*计算公式:</span> <el-select
<div class="formula-editor"> v-model="formulaFormData.param1"
<div v-for="(item, index) in formulaItems" :key="index" class="formula-item"> placeholder="请选择参数"
<el-select style="width: 100%"
v-if="item.type === 'param'" >
v-model="item.value" <el-option
class="formula-select" v-for="opt in yAxisParamOptions"
placeholder="选择参数" :key="opt.value"
@change="updateFormula" :label="opt.label"
> :value="opt.value"
<el-option />
v-for="opt in yAxisParamOptions" </el-select>
:key="opt.value" </el-form-item>
:label="opt.label" <el-form-item label="运算符:" required>
:value="opt.value" <el-select
/> v-model="formulaFormData.operator"
</el-select> placeholder="请选择运算符"
<el-select style="width: 100%"
v-else-if="item.type === 'operator'" >
v-model="item.value" <el-option
class="formula-select" v-for="opt in operatorOptions"
placeholder="选择运算符" :key="opt.value"
@change="updateFormula" :label="opt.label"
> :value="opt.value"
<el-option />
v-for="opt in operatorOptions" </el-select>
:key="opt.value" </el-form-item>
:label="opt.label" <el-form-item label="参数2:" required>
:value="opt.value" <el-select
/> v-model="formulaFormData.param2"
</el-select> placeholder="请选择参数"
<i class="el-icon-delete formula-delete-icon" @click="removeFormulaItem(index)"></i> style="width: 100%"
</div> >
<div v-if="formulaItems.length === 0" class="formula-empty-hint"> <el-option
请添加参数和运算符 v-for="opt in yAxisParamOptions"
</div> :key="opt.value"
:label="opt.label"
:value="opt.value"
/>
</el-select>
</el-form-item>
<el-form-item label="公式预览:">
<div class="formula-preview">
{{ getFormulaPreview() }}
</div> </div>
</div> </el-form-item>
</div> </el-form>
<div class="formula-buttons">
<el-button type="primary" :disabled="yAxisParamOptions.length === 0" @click="addFormulaParam">
添加参数
</el-button>
<el-button type="primary" @click="addFormulaOperator">
添加符号
</el-button>
</div>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="handleFormulaDialogClose"> <el-button @click="handleFormulaDialogClose">
取消 取消
</el-button> </el-button>
<el-button type="primary" :disabled="!formulaName || formulaItems.length === 0" @click="handleSaveFormula"> <el-button type="primary" :disabled="!isFormulaValid" @click="handleSaveFormula">
确定 确定
</el-button> </el-button>
</span> </span>
@ -379,14 +374,18 @@ export default {
formulaDialogVisible: false, formulaDialogVisible: false,
currentFormulaChartIndex: -1, currentFormulaChartIndex: -1,
currentFormulaId: null, // IDnull currentFormulaId: null, // IDnull
formulaName: '', // formulaFormData: {
name: '',
param1: '',
operator: '+',
param2: ''
},
isResizing: false, isResizing: false,
resizingChartIndex: -1, resizingChartIndex: -1,
resizeStartY: 0, resizeStartY: 0,
resizeStartHeight: 0, resizeStartHeight: 0,
formulaItems: [],
// //
savedFormulas: [], // : [{ id: 'formula1', name: '1', formulaItems: [...] }] savedFormulas: [], // : [{ id: 'formula1', name: '1', param1: '1', operator: '+', param2: '2' }]
formulaIdCounter: 0, // ID formulaIdCounter: 0, // ID
operatorOptions: [ operatorOptions: [
{ label: '+', value: '+' }, { label: '+', value: '+' },
@ -396,6 +395,19 @@ export default {
] ]
} }
}, },
computed: {
//
isFormulaValid() {
return !!(
this.formulaFormData.name &&
this.formulaFormData.name.trim() &&
this.formulaFormData.param1 &&
this.formulaFormData.param2 &&
this.formulaFormData.operator &&
this.formulaFormData.param1 !== this.formulaFormData.param2
)
}
},
watch: { watch: {
activeTab: { activeTab: {
immediate: true, immediate: true,
@ -451,13 +463,7 @@ export default {
// }) // })
// 使 // 使
this.yAxisParamOptions = [ this.yAxisParamOptions = []
{ label: '参数1', value: 'param1' },
{ label: '参数2', value: 'param2' },
{ label: '参数3', value: 'param3' },
{ label: '参数4', value: 'param4' },
{ label: '参数5', value: 'param5' }
]
}, },
handleTabClick(tab) { handleTabClick(tab) {
// Tab // Tab
@ -694,8 +700,8 @@ export default {
let formulaData = null let formulaData = null
if (chart.yAxisFormula) { if (chart.yAxisFormula) {
const selectedFormula = this.savedFormulas.find(f => f.id === chart.yAxisFormula) const selectedFormula = this.savedFormulas.find(f => f.id === chart.yAxisFormula)
if (selectedFormula && selectedFormula.formulaItems && selectedFormula.formulaItems.length > 0) { if (selectedFormula && selectedFormula.param1 && selectedFormula.param2 && selectedFormula.operator) {
formulaData = this.calculateFormula(selectedFormula.formulaItems, xAxisData, xAxisDataMap) formulaData = this.calculateFormula(selectedFormula, xAxisData, xAxisDataMap)
} }
} }
@ -725,8 +731,7 @@ export default {
trigger: 'item', trigger: 'item',
formatter(params) { formatter(params) {
const value = parseFloat(params.value).toFixed(2) const value = parseFloat(params.value).toFixed(2)
const percent = parseFloat(params.percent).toFixed(2) return `${params.seriesName}<br/>${params.name}: ${value} `
return `${params.seriesName}<br/>${params.name}: ${value}% (${percent}%)`
} }
}, },
legend: { legend: {
@ -837,15 +842,15 @@ export default {
const formulaName = selectedFormula ? selectedFormula.name : '公式' const formulaName = selectedFormula ? selectedFormula.name : '公式'
series.push({ series.push({
name: formulaName, name: formulaName,
type: 'line', type: chartType === 'bar' ? 'bar' : chartType === 'scatter' ? 'scatter' : 'line',
data: formulaData, data: formulaData,
lineStyle: { lineStyle: {
color: '#F56C6C', color: '#F56C6C',
type: 'dashed', type: 'dashed',
width: 2 width: 2
}, },
symbol: 'circle', symbol: chartType === 'scatter' ? 'diamond' : 'circle',
symbolSize: 6, symbolSize: chartType === 'scatter' ? 8 : 6,
itemStyle: { color: '#F56C6C' } itemStyle: { color: '#F56C6C' }
}) })
legendData.push(formulaName) legendData.push(formulaName)
@ -907,13 +912,13 @@ export default {
let result = `${params[0].axisValue}<br/>` let result = `${params[0].axisValue}<br/>`
params.forEach((item) => { params.forEach((item) => {
if (item.value !== undefined && item.value !== null && item.value !== '') { if (item.value !== undefined && item.value !== null && item.value !== '') {
result += `${item.marker}${item.seriesName}: ${item.value}%<br/>` result += `${item.marker}${item.seriesName}: ${item.value}<br/>`
} }
}) })
return result return result
} }
if (params.value !== undefined && params.value !== null && params.value !== '') { if (params.value !== undefined && params.value !== null && params.value !== '') {
return `${params.seriesName}<br/>${params.marker}${params.name}: ${params.value}%` return `${params.seriesName}<br/>${params.marker}${params.name}: ${params.value}`
} }
return '' return ''
} }
@ -1033,19 +1038,8 @@ export default {
const chart = this.chartList[index] const chart = this.chartList[index]
if (!chart) return if (!chart) return
// //
if (chart.yAxisFormula) { this.updateChart(index)
const selectedFormula = this.savedFormulas.find(f => f.id === chart.yAxisFormula)
if (selectedFormula) {
//
chart.formulaItems = JSON.parse(JSON.stringify(selectedFormula.formulaItems))
this.updateChart(index)
}
} else {
//
chart.formulaItems = []
this.updateChart(index)
}
}, },
startEditTitle(index) { startEditTitle(index) {
const chart = this.chartList[index] const chart = this.chartList[index]
@ -1063,6 +1057,16 @@ export default {
}) })
} }
}, },
//
getFormulaPreview() {
if (!this.formulaFormData.param1 || !this.formulaFormData.param2 || !this.formulaFormData.operator) {
return '请选择参数和运算符'
}
const param1Label = this.yAxisParamOptions.find(opt => opt.value === this.formulaFormData.param1)?.label || this.formulaFormData.param1
const param2Label = this.yAxisParamOptions.find(opt => opt.value === this.formulaFormData.param2)?.label || this.formulaFormData.param2
const operatorLabel = this.operatorOptions.find(opt => opt.value === this.formulaFormData.operator)?.label || this.formulaFormData.operator
return `${param1Label} ${operatorLabel} ${param2Label}`
},
handleEditFormula(index) { handleEditFormula(index) {
this.currentFormulaChartIndex = index this.currentFormulaChartIndex = index
const chart = this.chartList[index] const chart = this.chartList[index]
@ -1074,57 +1078,39 @@ export default {
const existingFormula = this.savedFormulas.find(f => f.id === chart.yAxisFormula) const existingFormula = this.savedFormulas.find(f => f.id === chart.yAxisFormula)
if (existingFormula) { if (existingFormula) {
this.currentFormulaId = existingFormula.id this.currentFormulaId = existingFormula.id
this.formulaName = existingFormula.name this.formulaFormData = {
this.formulaItems = JSON.parse(JSON.stringify(existingFormula.formulaItems)) name: existingFormula.name || '',
param1: existingFormula.param1 || '',
operator: existingFormula.operator || '+',
param2: existingFormula.param2 || ''
}
} else { } else {
// //
this.currentFormulaId = null this.currentFormulaId = null
this.formulaName = '' this.formulaFormData = {
this.formulaItems = JSON.parse(JSON.stringify(chart.formulaItems || [])) name: '',
param1: '',
operator: '+',
param2: ''
}
} }
} else { } else {
// //
this.currentFormulaId = null this.currentFormulaId = null
this.formulaName = '' this.formulaFormData = {
this.formulaItems = JSON.parse(JSON.stringify(chart.formulaItems || [])) name: '',
param1: '',
operator: '+',
param2: ''
}
} }
this.formulaDialogVisible = true this.formulaDialogVisible = true
}, },
addFormulaParam() {
// 使Y
const defaultParam = this.yAxisParamOptions.length > 0 ? this.yAxisParamOptions[0].value : ''
this.formulaItems.push({ type: 'param', value: defaultParam })
this.updateFormula()
},
addFormulaOperator() {
this.formulaItems.push({ type: 'operator', value: '+' })
this.updateFormula()
},
removeFormulaItem(index) {
this.formulaItems.splice(index, 1)
this.updateFormula()
},
updateFormula() {
//
},
handleSaveFormula() { handleSaveFormula() {
// //
if (!this.formulaName || this.formulaName.trim() === '') { if (!this.isFormulaValid) {
this.$message.warning('请输入公式名称') this.$message.warning('请完整填写公式信息,且两个参数不能相同')
return
}
//
if (this.formulaItems.length === 0) {
this.$message.warning('请至少添加一个参数')
return
}
//
const paramCount = this.formulaItems.filter(item => item.type === 'param').length
if (paramCount < 1) {
this.$message.warning('公式至少需要包含一个参数')
return return
} }
@ -1134,16 +1120,23 @@ export default {
// //
const formulaIndex = this.savedFormulas.findIndex(f => f.id === formulaId) const formulaIndex = this.savedFormulas.findIndex(f => f.id === formulaId)
if (formulaIndex >= 0) { if (formulaIndex >= 0) {
this.savedFormulas[formulaIndex].name = this.formulaName.trim() this.savedFormulas[formulaIndex] = {
this.savedFormulas[formulaIndex].formulaItems = JSON.parse(JSON.stringify(this.formulaItems)) ...this.savedFormulas[formulaIndex],
name: this.formulaFormData.name.trim(),
param1: this.formulaFormData.param1,
operator: this.formulaFormData.operator,
param2: this.formulaFormData.param2
}
} }
} else { } else {
// //
formulaId = `formula_${this.formulaIdCounter++}` formulaId = `formula_${this.formulaIdCounter++}`
this.savedFormulas.push({ this.savedFormulas.push({
id: formulaId, id: formulaId,
name: this.formulaName.trim(), name: this.formulaFormData.name.trim(),
formulaItems: JSON.parse(JSON.stringify(this.formulaItems)) param1: this.formulaFormData.param1,
operator: this.formulaFormData.operator,
param2: this.formulaFormData.param2
}) })
} }
@ -1152,7 +1145,6 @@ export default {
const chart = this.chartList[this.currentFormulaChartIndex] const chart = this.chartList[this.currentFormulaChartIndex]
if (chart) { if (chart) {
chart.yAxisFormula = formulaId chart.yAxisFormula = formulaId
chart.formulaItems = JSON.parse(JSON.stringify(this.formulaItems))
this.updateChart(this.currentFormulaChartIndex) this.updateChart(this.currentFormulaChartIndex)
} }
} }
@ -1164,16 +1156,19 @@ export default {
this.formulaDialogVisible = false this.formulaDialogVisible = false
this.currentFormulaChartIndex = -1 this.currentFormulaChartIndex = -1
this.currentFormulaId = null this.currentFormulaId = null
this.formulaName = '' this.formulaFormData = {
this.formulaItems = [] name: '',
param1: '',
operator: '+',
param2: ''
}
}, },
// // param1, operator, param2
calculateFormula(formulaItems, xAxisData, xAxisDataMap) { calculateFormula(formula, xAxisData, xAxisDataMap) {
if (!formulaItems || formulaItems.length === 0) { if (!formula || !formula.param1 || !formula.param2 || !formula.operator) {
return [] return []
} }
//
const formulaData = [] const formulaData = []
xAxisData.forEach(xValue => { xAxisData.forEach(xValue => {
@ -1181,58 +1176,33 @@ export default {
let result = null let result = null
try { try {
// // 1
const stack = [] const param1Value = this.getParamValueFromData(formula.param1, xValue, xAxisDataMap)
// 2
const param2Value = this.getParamValueFromData(formula.param2, xValue, xAxisDataMap)
formulaItems.forEach(item => { if (param1Value !== null && param1Value !== undefined && param2Value !== null && param2Value !== undefined) {
if (item.type === 'param') { const num1 = parseFloat(param1Value)
// const num2 = parseFloat(param2Value)
const paramValue = this.getParamValueFromData(item.value, xValue, xAxisDataMap)
if (paramValue !== null && paramValue !== undefined) {
const numValue = parseFloat(paramValue)
if (!isNaN(numValue)) {
stack.push(numValue)
} else {
stack.push(null)
}
} else {
stack.push(null)
}
} else if (item.type === 'operator') {
//
if (stack.length >= 2) {
const b = stack.pop()
const a = stack.pop()
if (a !== null && b !== null && !isNaN(a) && !isNaN(b)) { if (!isNaN(num1) && !isNaN(num2)) {
let calcResult = null switch (formula.operator) {
switch (item.value) { case '+':
case '+': result = num1 + num2
calcResult = a + b break
break case '-':
case '-': result = num1 - num2
calcResult = a - b break
break case '*':
case '*': result = num1 * num2
calcResult = a * b break
break case '/':
case '/': result = num2 !== 0 ? num1 / num2 : null
calcResult = b !== 0 ? a / b : null break
break default:
default: result = null
calcResult = null
}
stack.push(calcResult)
} else {
stack.push(null)
}
} }
} }
})
//
if (stack.length === 1) {
result = stack[0]
} }
} catch (err) { } catch (err) {
console.error('计算公式失败:', err) console.error('计算公式失败:', err)
@ -1708,63 +1678,16 @@ export default {
} }
.formula-dialog-content { .formula-dialog-content {
.formula-note { .formula-preview {
color: #f56c6c; padding: 12px;
font-size: 12px; background: #f5f7fa;
margin-bottom: 16px; border-radius: 4px;
} border: 1px solid #dcdfe6;
font-size: 14px;
.formula-input-section { color: #303133;
.formula-label { min-height: 40px;
display: block;
margin-bottom: 8px;
font-size: 14px;
font-weight: 500;
}
.formula-editor {
display: flex;
flex-wrap: wrap;
gap: 8px;
padding: 12px;
background: #f5f7fa;
border-radius: 4px;
min-height: 50px;
align-items: center;
border: 1px solid #dcdfe6;
.formula-item {
display: flex;
align-items: center;
gap: 4px;
.formula-select {
width: 120px;
::v-deep .el-input__inner {
background: white;
}
}
.formula-delete-icon {
cursor: pointer;
color: #909399;
font-size: 16px;
margin-left: 4px;
padding: 4px;
&:hover {
color: #f56c6c;
}
}
}
}
}
.formula-buttons {
margin-top: 16px;
display: flex; display: flex;
gap: 8px; align-items: center;
} }
} }
} }

View File

@ -20,9 +20,6 @@
<el-form-item label="名称:" prop="name"> <el-form-item label="名称:" prop="name">
<el-input v-model="formData.templateName" placeholder="请输入名称" maxlength="100" /> <el-input v-model="formData.templateName" placeholder="请输入名称" maxlength="100" />
</el-form-item> </el-form-item>
<el-form-item label="排序号:" prop="orderNum">
<el-input-number v-model="formData.orderNum" placeholder="请输入排序号" min="0" />
</el-form-item>
</el-form> </el-form>
<template v-slot:footer> <template v-slot:footer>
<div class="dialog-footer"> <div class="dialog-footer">
@ -51,12 +48,10 @@ export default {
formData: { formData: {
templateName: '', templateName: '',
template_status: '', template_status: '',
createdBy: '', createdBy: ''
orderNum: ''
}, },
formRules: { formRules: {
templateName: [{ required: true, message: '请输入名称', trigger: 'blur' }], templateName: [{ required: true, message: '请输入名称', trigger: 'blur' }]
orderNum: [{ required: true, message: '请输入排序号', trigger: 'blur' }]
}, },
statusOptions: [ statusOptions: [
{ label: '草稿', value: '草稿' }, { label: '草稿', value: '草稿' },

View File

@ -1256,12 +1256,17 @@ export default {
this.$forceUpdate() this.$forceUpdate()
}, },
shouldShowSection(sectionName) { shouldShowSection(sectionName) {
// "" // ""
if (this.isWholeEngineParamsSelected && !this.checkedKeys.some(nodeId => { if (this.isWholeEngineParamsSelected) {
const nodeInfo = this.nodeMap[nodeId] //
return nodeInfo && !nodeInfo.isWholeEngineParams && !nodeInfo.isParent const hasNonWholeEngineParamsNode = this.checkedKeys.some(nodeId => {
})) { const nodeInfo = this.nodeMap[nodeId]
return false return nodeInfo && !nodeInfo.isWholeEngineParams
})
//
if (!hasNonWholeEngineParamsNode) {
return false
}
} }
// sectionName"" // sectionName""
const data = this.versionData[this.currentVersionId] || {} const data = this.versionData[this.currentVersionId] || {}
@ -1286,18 +1291,11 @@ export default {
// section // section
if (nodeInfo.isParent) { if (nodeInfo.isParent) {
const sectionData = data[sectionName] || [] const sectionData = data[sectionName] || []
// sectionName "/" const hasDataInSubsystem = sectionData.some(
// sectionName (param) => param.subsystemName === nodeInfo.label
if (sectionName === nodeInfo.label) { )
if (hasDataInSubsystem) {
hasMatch = true hasMatch = true
} else {
// section
const hasDataInSubsystem = sectionData.some(
(param) => param.subsystemName === nodeInfo.label
)
if (hasDataInSubsystem) {
hasMatch = true
}
} }
} }
} }

View File

@ -347,6 +347,30 @@ export default {
// parameterTypes subsystemTypes - // parameterTypes subsystemTypes -
shouldInclude = parameterTypes.includes(displayPartsName) || shouldInclude = parameterTypes.includes(displayPartsName) ||
subsystemTypes.includes(`${subsystemName}-${displayPartsName}`) subsystemTypes.includes(`${subsystemName}-${displayPartsName}`)
//
// partsName '/'
if (!shouldInclude) {
//
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
})
})
// partsName '/'
if (isSubsystemDirectlySelected && (partsName === '/' || displayPartsName === subsystemName)) {
shouldInclude = true
}
}
} }
if (shouldInclude) { if (shouldInclude) {
@ -1023,6 +1047,9 @@ export default {
// //
this.currentCommonConfig = selectedFavorite.data this.currentCommonConfig = selectedFavorite.data
//
this.hideMissingParamsByNode()
// //
// hideParamsNotInCommon displayParams // hideParamsNotInCommon displayParams
// //
@ -1112,7 +1139,6 @@ export default {
console.error('下载失败:', err) console.error('下载失败:', err)
console.log('下载失败,请稍后重试') console.log('下载失败,请稍后重试')
}) })
}, },
// //
updateCheckedKeysByDisplayParams() { updateCheckedKeysByDisplayParams() {
@ -1266,7 +1292,84 @@ export default {
} }
}) })
}, },
// //
hideMissingParamsByNode() {
if (!this.currentCommonConfig || !this.currentCommonConfig.subsystems) {
return
}
if (!this.allParametersData || Object.keys(this.allParametersData).length === 0) {
return
}
// subsystem -> Set<parameterKey>
// parameterKey 使 parameterId使 parameterName
const commonParamsMap = new Map()
this.currentCommonConfig.subsystems.forEach(subsystemConfig => {
const subsystemName = subsystemConfig.subsystem
const paramKeys = new Set()
subsystemConfig.parameters.forEach(p => {
// 使 parameterId使 parameterName
const key = p.parameterId || p.parameterName
if (key) {
paramKeys.add(key)
}
})
commonParamsMap.set(subsystemName, paramKeys)
})
//
const paramsToHide = []
Object.keys(this.allParametersData).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 isInCommon = commonParamKeys.has(matchKey)
if (!isInCommon) {
//
const key = `${subsystemName}-${parameterName}`
if (!paramsToHide.includes(key)) {
paramsToHide.push(key)
}
}
})
})
//
paramsToHide.forEach(key => {
if (!this.hiddenParams.includes(key)) {
this.hiddenParams.push(key)
}
})
},
//
hideParamsNotInCommon() { hideParamsNotInCommon() {
if (!this.currentCommonConfig || !this.currentCommonConfig.subsystems) { if (!this.currentCommonConfig || !this.currentCommonConfig.subsystems) {
return return

View File

@ -37,10 +37,10 @@
<el-button type="primary" @click="handleDownloadImportTemplate"> <el-button type="primary" @click="handleDownloadImportTemplate">
下载导入模板 下载导入模板
</el-button> </el-button>
<el-button class="import-btn" @click="handleImportTemplate()"> <el-button v-if="isAdmin()" class="import-btn" @click="handleImportTemplate()">
导入参数模板 导入参数模板
</el-button> </el-button>
<el-button type="primary" @click="handleAddTemplate()"> <el-button v-if="isAdmin()" type="primary" @click="handleAddTemplate()">
添加参数模板 添加参数模板
</el-button> </el-button>
</div> </div>
@ -104,7 +104,7 @@
</a> </a>
<span class="link-separator"></span> <span class="link-separator"></span>
<a <a
v-if="row.status === 'DRAFT'" v-if="row.status === 'DRAFT' && isAdmin()"
href="javascript:void(0)" href="javascript:void(0)"
class="el-link el-link--primary" class="el-link el-link--primary"
@click.stop="handleRowEdit(row)" @click.stop="handleRowEdit(row)"
@ -330,6 +330,24 @@ export default {
this.loadData() this.loadData()
}, },
methods: { methods: {
// isAdmin === 1
isAdmin() {
try {
const permissionDataStr = localStorage.getItem('user_self_role')
if (!permissionDataStr) {
return false
}
const permissionData = JSON.parse(permissionDataStr)
if (!Array.isArray(permissionData)) {
return false
}
// isAdmin === 1
return permissionData.some((perm) => perm.isAdmin === 1 || perm.isAdmin === '1')
} catch (err) {
console.error('检查管理员权限失败:', err)
return false
}
},
// //
loadUserSelfRole() { loadUserSelfRole() {
localStorage.setItem('user_self_role', []) localStorage.setItem('user_self_role', [])

View File

@ -1217,20 +1217,36 @@ export default {
const checkSubsystem = subsystem || this.displayTemplateName const checkSubsystem = subsystem || this.displayTemplateName
return this.checkPermission('模板管理', checkSubsystem, '编辑') return this.checkPermission('模板管理', checkSubsystem, '编辑')
}, },
// isAdmin === 1
isAdmin() {
try {
const permissionDataStr = localStorage.getItem('user_self_role')
if (!permissionDataStr) {
return false
}
const permissionData = JSON.parse(permissionDataStr)
if (!Array.isArray(permissionData)) {
return false
}
// isAdmin === 1
return permissionData.some((perm) => perm.isAdmin === 1 || perm.isAdmin === '1')
} catch (err) {
console.error('检查管理员权限失败:', err)
return false
}
},
// subsystempartsName // subsystempartsName
hasParameterEditPermission(subsystem, partsName) { hasParameterEditPermission(subsystem, partsName) {
//
if (this.isAdmin()) {
return true
}
if (!subsystem || !partsName) { if (!subsystem || !partsName) {
return false return false
} }
// 使 // 使
if (this.templateManagementPermissions && this.templateManagementPermissions.length > 0) { if (this.templateManagementPermissions && this.templateManagementPermissions.length > 0) {
const templateName = this.displayTemplateName
const matchedPermissions = this.templateManagementPermissions.filter((perm) => { const matchedPermissions = this.templateManagementPermissions.filter((perm) => {
// subsystem templateName
if (templateName && perm.subsystem !== templateName) {
return false
}
// subsystem // subsystem
if (perm.subsystem !== subsystem) { if (perm.subsystem !== subsystem) {
return false return false
@ -1247,7 +1263,7 @@ export default {
return matchedPermissions.length > 0 return matchedPermissions.length > 0
} }
// localStorage // localStorage user_self_role
try { try {
const permissionDataStr = localStorage.getItem('user_self_role') const permissionDataStr = localStorage.getItem('user_self_role')
if (!permissionDataStr) { if (!permissionDataStr) {
@ -1258,27 +1274,20 @@ export default {
return false return false
} }
// menuPath""subsystempartsNameparameterPer"" // subsystempartsNameparameterPer""
const templateName = this.displayTemplateName
const matchedPermissions = permissionData.filter((perm) => { const matchedPermissions = permissionData.filter((perm) => {
// menuPath // menuPath ""
const menuMatch = perm.menuPath && perm.menuPath.includes('模板管理') if (perm.menuPath && perm.menuPath.trim() !== '' && !perm.menuPath.includes('模板管理')) {
if (!menuMatch) {
return false
}
// subsystem templateName templateName
if (templateName && perm.subsystem !== templateName) {
return false return false
} }
// subsystem // subsystem
if (perm.subsystem !== subsystem) { if (!perm.subsystem || perm.subsystem !== subsystem) {
return false return false
} }
// partsName // partsName
if (perm.partsName !== partsName) { if (!perm.partsName || perm.partsName !== partsName) {
return false return false
} }
@ -1297,6 +1306,10 @@ export default {
if (!row) { if (!row) {
return false return false
} }
// /
if (this.isAdmin()) {
return true
}
// createdBy ID/ // createdBy ID/
if (row.createdBy === getUserId()) { if (row.createdBy === getUserId()) {
return true return true

View File

@ -1,423 +1,454 @@
<template> <template>
<div class="apaas-custom-page-todo custom-page"> <div class="apaas-custom-page-todo custom-page">
<template v-if="!showEngineDetail && !showEngineCheck && !showApprovalProgressDetail && !showReportDetail"> <template
<div class="page-header"> v-if="
<div class="title"> !showEngineDetail && !showEngineCheck && !showApprovalProgressDetail && !showReportDetail
我的已办 "
</div> >
<div class="operation"> <div class="page-header">
<x-svg-icon <div class="title">
:name="'refresh-icon'" 我的已办
class="pointer"
style="cursor: pointer;"
@click.native="handleRefresh()"
></x-svg-icon>
</div>
</div> </div>
<div class="operation">
<div class="page-data-list"> <x-svg-icon
<x-vxe-table :name="'refresh-icon'"
ref="vxeTable" class="pointer"
:border="true" style="cursor: pointer;"
:seqWidth="40" @click.native="handleRefresh()"
:colConfigs="tableConfig.colConfigs" ></x-svg-icon>
:tableData="tableData" </div>
:rowDraggable="tableConfig.rowDraggable" </div>
:seqType="tableConfig.seqType"
:pagination="pagination" <div class="page-data-list">
:layout="tableConfig.layout" <x-vxe-table
:seqConfig="tableConfig.seqConfig" ref="vxeTable"
:autoSize="tableConfig.autoSize" :border="true"
:pageConfig="tableConfig.pageConfig" :seqWidth="40"
class="block-table" :colConfigs="tableConfig.colConfigs"
@table-row-click="rowClickEvent" :tableData="tableData"
@size-change="pageSizeChange" :rowDraggable="tableConfig.rowDraggable"
@current-page-change="currentChange" :seqType="tableConfig.seqType"
@select-data-change="selectDataChange" :pagination="pagination"
:layout="tableConfig.layout"
:seqConfig="tableConfig.seqConfig"
:autoSize="tableConfig.autoSize"
:pageConfig="tableConfig.pageConfig"
class="block-table"
@table-row-click="rowClickEvent"
@size-change="pageSizeChange"
@current-page-change="currentChange"
@select-data-change="selectDataChange"
>
<template
v-for="(colConfig, index) in tableConfig.colConfigs"
v-slot:[colConfig.customSlot]="{ row, rowIndex }"
> >
<template v-for="(colConfig, index) in tableConfig.colConfigs" v-slot:[colConfig.customSlot]="{ row, rowIndex }"> <div v-if="colConfig.customSlot === 'options'" :key="'op' + index + '' + rowIndex">
<div v-if="colConfig.customSlot === 'options'" :key="'op' + index + '' + rowIndex"> <a
<a href="javascript:void(0)" class="el-link el-link--primary" @click.stop="handleRowView(row)">查看</a> href="javascript:void(0)"
</div> class="el-link el-link--primary"
</template> @click.stop="handleRowView(row)"
>查看</a
<template slot="empty"> >
<div class="table-empty"> </div>
<x-empty-page></x-empty-page> </template>
</div>
</template> <template slot="empty">
</x-vxe-table> <div class="table-empty">
</div> <x-empty-page></x-empty-page>
</template> </div>
</template>
<!-- 发动机详情组件 --> </x-vxe-table>
<engine-detail </div>
v-if="showEngineDetail && !showEngineCheck" </template>
:model="currentModel"
:detail="currentEngineDetail" <!-- 发动机详情组件 -->
:engine-model-i-d="currentEngineModelID" <engine-detail
:is-dispatch-mode="isDispatchMode" v-if="showEngineDetail && !showEngineCheck"
:dispatch-type="dispatchType" :model="currentModel"
:responsible-person-id="responsiblePersonId" :detail="currentEngineDetail"
:filled-by="filledBy" :engine-model-i-d="currentEngineModelID"
class="engine-detail-wrapper" :is-dispatch-mode="isDispatchMode"
@back="handleBackFromDetail" :dispatch-type="dispatchType"
/> :responsible-person-id="responsiblePersonId"
:filled-by="filledBy"
<!-- 发动机审批组件 --> class="engine-detail-wrapper"
<engine-check @back="handleBackFromDetail"
v-if="showEngineCheck" />
:detail="currentEngineDetail"
:visible="showEngineCheck" <!-- 发动机审批组件 -->
:engine-type="engineType" <engine-check
class="engine-check-wrapper" v-if="showEngineCheck"
@close="handleBackFromCheck" :detail="currentEngineDetail"
/> :visible="showEngineCheck"
:engine-type="engineType"
<!-- 模板审核组件 --> class="engine-check-wrapper"
<approval-progress-detail @close="handleBackFromCheck"
v-if="showApprovalProgressDetail" />
:detail="currentApprovalDetail"
:visible="showApprovalProgressDetail" <!-- 模板审核组件 -->
class="approval-progress-detail-wrapper" <approval-progress-detail
@refresh="handleBackFromApprovalProgress" v-if="showApprovalProgressDetail"
@close="handleBackFromApprovalProgress" :detail="currentApprovalDetail"
/> :visible="showApprovalProgressDetail"
class="approval-progress-detail-wrapper"
<!-- 对标报告审核组件 --> @refresh="handleBackFromApprovalProgress"
<report-detail @close="handleBackFromApprovalProgress"
v-if="showReportDetail" />
:detail="currentReportDetail"
:visible="showReportDetail" <!-- 对标报告审核组件 -->
class="report-detail-wrapper" <report-detail
@close="handleBackFromReport" v-if="showReportDetail"
/> :detail="currentReportDetail"
</div> :visible="showReportDetail"
</template> class="report-detail-wrapper"
@close="handleBackFromReport"
<script> />
import EngineDetail from './engineDetail.vue' </div>
import EngineCheck from './engineCheck.vue' </template>
import ApprovalProgressDetail from './approvalProgressDetail.vue'
import ReportDetail from './reportDetail.vue' <script>
import { getUserId } from '@/utils' import EngineDetail from './engineDetail.vue'
import api from '@/api/demo' import EngineCheck from './engineCheck.vue'
export default { import ApprovalProgressDetail from './approvalProgressDetail.vue'
name: 'TodoPage', import ReportDetail from './reportDetail.vue'
components: { import { getUserId } from '@/utils'
EngineDetail, import api from '@/api/demo'
EngineCheck, export default {
ApprovalProgressDetail, name: 'TodoPage',
ReportDetail components: {
}, EngineDetail,
data: function() { EngineCheck,
ApprovalProgressDetail,
ReportDetail
},
data: function() {
return {
tableData: [],
pagination: { currentPage: 1, pageSize: 10, total: 0 },
showEngineDetail: false,
showEngineCheck: false,
currentModel: '',
currentEngineModelID: '',
currentEngineDetail: null,
isDispatchMode: false,
dispatchType: 'todo', //
responsiblePersonId: '', // responsiblePersonId
filledBy: '', // filledBy
engineType: '玉柴', //
showApprovalProgressDetail: false, //
currentApprovalDetail: null, //
showReportDetail: false, //
currentReportDetail: null //
}
},
computed: {
tableConfig() {
return { return {
tableData: [], rowDraggable: false,
pagination: { currentPage: 1, pageSize: 10, total: 0 }, colConfigs: [
showEngineDetail: false,
showEngineCheck: false,
currentModel: '',
currentEngineModelID: '',
currentEngineDetail: null,
isDispatchMode: false,
dispatchType: 'todo', //
responsiblePersonId: '', // responsiblePersonId
filledBy: '', // filledBy
engineType: '玉柴', //
showApprovalProgressDetail: false, //
currentApprovalDetail: null, //
showReportDetail: false, //
currentReportDetail: null //
}
},
computed: {
tableConfig() {
return {
rowDraggable: false,
colConfigs: [
// { prop: 'documentNo', label: '', showOverflowTooltip: true, minWidth: '140' }, // { prop: 'documentNo', label: '', showOverflowTooltip: true, minWidth: '140' },
{ prop: 'processTitle', label: '流程主题', showOverflowTooltip: true, minWidth: '160' }, { prop: 'processTitle', label: '流程主题', showOverflowTooltip: true, minWidth: '160' },
{ prop: 'currentNode', label: '当前环节', showOverflowTooltip: true, minWidth: '140' }, { prop: 'currentNode', label: '当前环节', showOverflowTooltip: true, minWidth: '140' },
// { prop: 'statusCode', label: '', showOverflowTooltip: true, minWidth: '120' }, // { prop: 'statusCode', label: '', showOverflowTooltip: true, minWidth: '120' },
// { prop: 'modelName', label: '', showOverflowTooltip: true, minWidth: '120' }, // { prop: 'modelName', label: '', showOverflowTooltip: true, minWidth: '120' },
{ prop: 'currentProcessor', label: '当前处理人', showOverflowTooltip: true, minWidth: '120' }, {
prop: 'currentProcessor',
label: '当前处理人',
showOverflowTooltip: true,
minWidth: '120'
},
{ prop: 'createdBy', label: '创建人', showOverflowTooltip: true, minWidth: '120' }, { prop: 'createdBy', label: '创建人', showOverflowTooltip: true, minWidth: '120' },
{ prop: 'creationDate', label: '创建时间', showOverflowTooltip: true, minWidth: '160', align: 'center', formatter: this.formatDateTime }, {
{ prop: 'options', label: '操作', customSlot: 'options', align: 'center', width: '100', fixed: 'right' } prop: 'creationDate',
label: '创建时间',
showOverflowTooltip: true,
minWidth: '160',
align: 'center',
formatter: this.formatDateTime
},
{
prop: 'options',
label: '操作',
customSlot: 'options',
align: 'center',
width: '100',
fixed: 'right'
}
], ],
seqType: '', seqType: '',
seqConfig: {}, seqConfig: {},
layout: 'total, prev, pager, next, jumper, sizes' layout: 'total, prev, pager, next, jumper, sizes'
}
} }
}, }
mounted() { },
mounted() {
this.loadData()
},
methods: {
pageSizeChange(size) {
this.pagination.pageSize = size
this.pagination.currentPage = 1
this.loadData() this.loadData()
}, },
methods: { rowClickEvent(row) {
pageSizeChange(size) { console.warn(row)
this.pagination.pageSize = size },
this.pagination.currentPage = 1 handleRowView(row) {
this.loadData() //
}, const dataType = row.dataType
rowClickEvent(row) { const isFillParameterMode = dataType === '数据维护'
console.warn(row) const isResponsibleDispatchMode = dataType === '任务分解'
}, const isInApprovalMode = dataType === '数据审批'
handleRowView(row) { const isModelCheck = dataType === '模板审核'
// const isReportCheck = dataType === '对标报告审核'
const processTitle = row.processTitle || ''
const isFillParameterMode = processTitle === '数据维护' //
const isResponsibleDispatchMode = processTitle === '任务分解' this.currentModel = row.modelName || row.productFullName || ''
const isInApprovalMode = processTitle === '数据审批' // engineModelID
const isModelCheck = processTitle === '模板审核' this.currentEngineModelID = row.modelId
const isReportCheck = processTitle === '对标报告审核'
// ""
// if (isInApprovalMode) {
this.currentModel = row.modelName || row.productFullName || '' this.currentEngineDetail = { ...row, id: row.documentNo }
// engineModelID this.showEngineCheck = true
this.currentEngineModelID = row.modelId this.showEngineDetail = false
// ""
if (isInApprovalMode) {
this.currentEngineDetail = { ...row, id: row.documentNo }
this.showEngineCheck = true
this.showEngineDetail = false
this.showApprovalProgressDetail = false
this.showReportDetail = false
//
// dataType
this.engineType = row.dataType === '竞品' ? '竞品' : '玉柴'
return
}
// ""
if (isModelCheck) {
this.showApprovalProgressDetail = true
this.showEngineDetail = false
this.showEngineCheck = false
this.showReportDetail = false
// documentNo flowIdmodelId templateId
this.currentApprovalDetail = {
flowId: row.documentNo || '',
templateId: row.modelId || '',
...row
}
return
}
// ""
if (isReportCheck) {
this.showReportDetail = true
this.showEngineDetail = false
this.showEngineCheck = false
this.showApprovalProgressDetail = false
// documentNo flowIdmodelId reportId
this.currentReportDetail = {
flowId: row.documentNo || '',
reportId: row.modelId || '',
...row
}
return
}
// ""
// ""UPDATE_PARAM
//
if (isFillParameterMode) {
this.currentEngineDetail = { ...row, id: row.modelId }
// filledBy
this.isDispatchMode = false
this.dispatchType = 'todo'
this.filledBy = row.ownerId || ''
this.responsiblePersonId = ''
} else if (isResponsibleDispatchMode) {
this.currentEngineDetail = { ...row, id: row.modelId }
// responsiblePersonId
this.isDispatchMode = true
this.dispatchType = 'update_param'
this.responsiblePersonId = row.ownerId || ''
this.filledBy = ''
} else {
//
this.isDispatchMode = true
this.dispatchType = 'todo'
this.responsiblePersonId = ''
this.filledBy = ''
}
this.showEngineDetail = true
this.showEngineCheck = false
this.showApprovalProgressDetail = false this.showApprovalProgressDetail = false
this.showReportDetail = false this.showReportDetail = false
}, //
handleBackFromDetail() { // dataType
this.engineType = row.dataType === '竞品' ? '竞品' : '玉柴'
return
}
// ""
if (isModelCheck) {
this.showApprovalProgressDetail = true
this.showEngineDetail = false this.showEngineDetail = false
this.currentModel = '' this.showEngineCheck = false
this.currentEngineModelID = '' this.showReportDetail = false
this.currentEngineDetail = null // documentNo flowIdmodelId templateId
this.currentApprovalDetail = {
flowId: row.documentNo || '',
templateId: row.modelId || '',
id: row.documentNo || '',
...row
}
return
}
// ""
if (isReportCheck) {
this.showReportDetail = true
this.showEngineDetail = false
this.showEngineCheck = false
this.showApprovalProgressDetail = false
// documentNo flowIdmodelId reportId
this.currentReportDetail = {
flowId: row.documentNo || '',
reportId: row.modelId || '',
...row
}
return
}
// ""
// ""UPDATE_PARAM
//
if (isFillParameterMode) {
this.currentEngineDetail = { ...row, id: row.modelId }
// filledBy
this.isDispatchMode = false this.isDispatchMode = false
this.dispatchType = 'todo' this.dispatchType = 'todo'
this.filledBy = row.ownerId || ''
this.responsiblePersonId = ''
} else if (isResponsibleDispatchMode) {
this.currentEngineDetail = { ...row, id: row.modelId }
// responsiblePersonId
this.isDispatchMode = true
this.dispatchType = 'update_param'
this.responsiblePersonId = row.ownerId || ''
this.filledBy = ''
} else {
//
this.isDispatchMode = true
this.dispatchType = 'todo'
this.responsiblePersonId = '' this.responsiblePersonId = ''
this.filledBy = '' this.filledBy = ''
this.engineType = '玉柴' }
}, this.showEngineDetail = true
handleBackFromCheck() { this.showEngineCheck = false
this.showEngineCheck = false this.showApprovalProgressDetail = false
this.currentEngineDetail = null this.showReportDetail = false
this.engineType = '玉柴' },
this.loadData() // handleBackFromDetail() {
}, this.showEngineDetail = false
handleBackFromApprovalProgress() { this.currentModel = ''
this.showApprovalProgressDetail = false this.currentEngineModelID = ''
this.currentApprovalDetail = null this.currentEngineDetail = null
this.loadData() // this.isDispatchMode = false
}, this.dispatchType = 'todo'
handleBackFromReport() { this.responsiblePersonId = ''
this.showReportDetail = false this.filledBy = ''
this.currentReportDetail = null this.engineType = '玉柴'
this.loadData() // },
}, handleBackFromCheck() {
currentChange(currentPage) { this.showEngineCheck = false
this.pagination.currentPage = currentPage this.currentEngineDetail = null
this.loadData() this.engineType = '玉柴'
}, this.loadData() //
selectDataChange(data) { },
this.$emit('select-data-change', data) handleBackFromApprovalProgress() {
}, this.showApprovalProgressDetail = false
handleRefresh() { this.currentApprovalDetail = null
this.pagination.currentPage = 1 this.loadData() //
this.loadData() },
}, handleBackFromReport() {
loadData() { this.showReportDetail = false
const request = { this.currentReportDetail = null
...api.GET_TODO_LIST, this.loadData() //
params: { },
page: this.pagination.currentPage, currentChange(currentPage) {
size: this.pagination.pageSize, this.pagination.currentPage = currentPage
isFinished: 1, this.loadData()
personId: getUserId() },
}, selectDataChange(data) {
disableSuccessMsg: true this.$emit('select-data-change', data)
} },
this.$request(request) handleRefresh() {
.asyncThen((resp) => { this.pagination.currentPage = 1
this.tableData = resp.data.list this.loadData()
this.pagination.total = resp.data.totalCount },
}) loadData() {
.asyncErrorCatch((err) => { const request = {
console.error('获取待办列表失败:', err) ...api.GET_TODO_LIST,
this.$message.error('获取待办列表失败') params: {
}) page: this.pagination.currentPage,
}, size: this.pagination.pageSize,
formatDate(date) { isFinished: 1,
personId: getUserId()
},
disableSuccessMsg: true
}
this.$request(request)
.asyncThen((resp) => {
this.tableData = resp.data.list
this.pagination.total = resp.data.totalCount
})
.asyncErrorCatch((err) => {
console.error('获取待办列表失败:', err)
this.$message.error('获取待办列表失败')
})
},
formatDate(date) {
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
const hours = String(date.getHours()).padStart(2, '0')
const minutes = String(date.getMinutes()).padStart(2, '0')
return `${year}-${month}-${day} ${hours}:${minutes}`
},
formatDateTime({ cellValue }) {
if (!cellValue) return ''
// ISO 8601 : 2025-12-02T06:36:21.000+0000
try {
const date = new Date(cellValue)
if (isNaN(date.getTime())) return cellValue //
const year = date.getFullYear() const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0') const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0') const day = String(date.getDate()).padStart(2, '0')
const hours = String(date.getHours()).padStart(2, '0') const hours = String(date.getHours()).padStart(2, '0')
const minutes = String(date.getMinutes()).padStart(2, '0') const minutes = String(date.getMinutes()).padStart(2, '0')
return `${year}-${month}-${day} ${hours}:${minutes}` const seconds = String(date.getSeconds()).padStart(2, '0')
}, return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
formatDateTime({ cellValue }) { } catch (error) {
if (!cellValue) return '' console.error('日期格式化错误:', error)
// ISO 8601 : 2025-12-02T06:36:21.000+0000 return cellValue
try {
const date = new Date(cellValue)
if (isNaN(date.getTime())) return cellValue //
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
const hours = String(date.getHours()).padStart(2, '0')
const minutes = String(date.getMinutes()).padStart(2, '0')
const seconds = String(date.getSeconds()).padStart(2, '0')
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
} catch (error) {
console.error('日期格式化错误:', error)
return cellValue
}
} }
} }
} }
</script> }
</script>
<style lang="scss">
.custom-page { <style lang="scss">
width: 100%; .custom-page {
height: 100%; width: 100%;
overflow-y: auto !important; height: 100%;
display: flex; overflow-y: auto !important;
flex-direction: column; display: flex;
flex-direction: column;
.page-header {
display: flex; .page-header {
align-items: center; display: flex;
height: 56px; align-items: center;
position: relative; height: 56px;
width: 100%; position: relative;
min-height: 56px; width: 100%;
background: #fff; min-height: 56px;
border-bottom: 1px solid #ebeef5; background: #fff;
flex-shrink: 0; border-bottom: 1px solid #ebeef5;
flex-shrink: 0;
.title {
color: #303133; .title {
font-weight: 700; color: #303133;
margin-left: 20px; font-weight: 700;
flex: 1; margin-left: 20px;
font-size: 12px; flex: 1;
} font-size: 12px;
.operation {
display: flex;
min-width: 330px;
justify-content: flex-end !important;
margin-right: 20px;
}
}
.page-data-list {
display: flex;
flex: 1;
min-height: 0;
padding: 20px;
.x-empty-page {
top: 0;
}
}
.engine-detail-wrapper {
width: 100%;
height: 100%;
flex: 1;
display: flex;
flex-direction: column;
}
.engine-check-wrapper {
width: 100%;
height: 100%;
flex: 1;
display: flex;
flex-direction: column;
}
.approval-progress-detail-wrapper {
width: 100%;
height: 100%;
flex: 1;
display: flex;
flex-direction: column;
min-height: 0;
}
.report-detail-wrapper {
width: 100%;
height: 100%;
flex: 1;
display: flex;
flex-direction: column;
min-height: 0;
}
} }
</style>
.operation {
display: flex;
min-width: 330px;
justify-content: flex-end !important;
margin-right: 20px;
}
}
.page-data-list {
display: flex;
flex: 1;
min-height: 0;
padding: 20px;
.x-empty-page {
top: 0;
}
}
.engine-detail-wrapper {
width: 100%;
height: 100%;
flex: 1;
display: flex;
flex-direction: column;
}
.engine-check-wrapper {
width: 100%;
height: 100%;
flex: 1;
display: flex;
flex-direction: column;
}
.approval-progress-detail-wrapper {
width: 100%;
height: 100%;
flex: 1;
display: flex;
flex-direction: column;
min-height: 0;
}
.report-detail-wrapper {
width: 100%;
height: 100%;
flex: 1;
display: flex;
flex-direction: column;
min-height: 0;
}
}
</style>

View File

@ -186,12 +186,12 @@ export default {
}, },
handleRowView(row) { handleRowView(row) {
// //
const processTitle = row.processTitle || '' const dataType = row.dataType || ''
const isFillParameterMode = processTitle === '数据维护' const isFillParameterMode = dataType === '数据维护'
const isResponsibleDispatchMode = processTitle === '任务分解' const isResponsibleDispatchMode = dataType === '任务分解'
const isInApprovalMode = processTitle === '数据审批' const isInApprovalMode = dataType === '数据审批'
const isModelCheck = processTitle === '模板审核' const isModelCheck = dataType === '模板审核'
const isReportCheck = processTitle === '对标报告审核' const isReportCheck = dataType === '对标报告审核'
// //
this.currentModel = row.modelName || row.productFullName || '' this.currentModel = row.modelName || row.productFullName || ''

View File

@ -1037,6 +1037,8 @@ export default {
} }
const file = this.selectedFile const file = this.selectedFile
console.log(file,2222);
const formData = new FormData() const formData = new FormData()
formData.append('file', file) formData.append('file', file)
formData.append('createBy', getUserId()) formData.append('createBy', getUserId())
@ -1095,6 +1097,7 @@ export default {
const fileUrl = await this.handleFileUpload() const fileUrl = await this.handleFileUpload()
// formData // formData
this.createFormData.fileUrl = fileUrl || '' this.createFormData.fileUrl = fileUrl || ''
this.createFormData.fileName = this.selectedFile.name
} catch (err) { } catch (err) {
console.error('文件上传失败:', err) console.error('文件上传失败:', err)
this.$message.error('文件上传失败,请重试') this.$message.error('文件上传失败,请重试')