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

View File

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

View File

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

View File

@ -347,6 +347,30 @@ export default {
// parameterTypes subsystemTypes -
shouldInclude = parameterTypes.includes(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) {
@ -1023,6 +1047,9 @@ export default {
//
this.currentCommonConfig = selectedFavorite.data
//
this.hideMissingParamsByNode()
//
// hideParamsNotInCommon displayParams
//
@ -1112,7 +1139,6 @@ export default {
console.error('下载失败:', err)
console.log('下载失败,请稍后重试')
})
},
//
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() {
if (!this.currentCommonConfig || !this.currentCommonConfig.subsystems) {
return

View File

@ -37,10 +37,10 @@
<el-button type="primary" @click="handleDownloadImportTemplate">
下载导入模板
</el-button>
<el-button class="import-btn" @click="handleImportTemplate()">
<el-button v-if="isAdmin()" class="import-btn" @click="handleImportTemplate()">
导入参数模板
</el-button>
<el-button type="primary" @click="handleAddTemplate()">
<el-button v-if="isAdmin()" type="primary" @click="handleAddTemplate()">
添加参数模板
</el-button>
</div>
@ -104,7 +104,7 @@
</a>
<span class="link-separator"></span>
<a
v-if="row.status === 'DRAFT'"
v-if="row.status === 'DRAFT' && isAdmin()"
href="javascript:void(0)"
class="el-link el-link--primary"
@click.stop="handleRowEdit(row)"
@ -330,6 +330,24 @@ export default {
this.loadData()
},
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() {
localStorage.setItem('user_self_role', [])

View File

@ -1217,20 +1217,36 @@ export default {
const checkSubsystem = subsystem || this.displayTemplateName
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
hasParameterEditPermission(subsystem, partsName) {
//
if (this.isAdmin()) {
return true
}
if (!subsystem || !partsName) {
return false
}
// 使
if (this.templateManagementPermissions && this.templateManagementPermissions.length > 0) {
const templateName = this.displayTemplateName
const matchedPermissions = this.templateManagementPermissions.filter((perm) => {
// subsystem templateName
if (templateName && perm.subsystem !== templateName) {
return false
}
// subsystem
if (perm.subsystem !== subsystem) {
return false
@ -1247,7 +1263,7 @@ export default {
return matchedPermissions.length > 0
}
// localStorage
// localStorage user_self_role
try {
const permissionDataStr = localStorage.getItem('user_self_role')
if (!permissionDataStr) {
@ -1258,27 +1274,20 @@ export default {
return false
}
// menuPath""subsystempartsNameparameterPer""
const templateName = this.displayTemplateName
// subsystempartsNameparameterPer""
const matchedPermissions = permissionData.filter((perm) => {
// menuPath
const menuMatch = perm.menuPath && perm.menuPath.includes('模板管理')
if (!menuMatch) {
return false
}
// subsystem templateName templateName
if (templateName && perm.subsystem !== templateName) {
// menuPath ""
if (perm.menuPath && perm.menuPath.trim() !== '' && !perm.menuPath.includes('模板管理')) {
return false
}
// subsystem
if (perm.subsystem !== subsystem) {
if (!perm.subsystem || perm.subsystem !== subsystem) {
return false
}
// partsName
if (perm.partsName !== partsName) {
if (!perm.partsName || perm.partsName !== partsName) {
return false
}
@ -1297,6 +1306,10 @@ export default {
if (!row) {
return false
}
// /
if (this.isAdmin()) {
return true
}
// createdBy ID/
if (row.createdBy === getUserId()) {
return true

View File

@ -1,6 +1,10 @@
<template>
<div class="apaas-custom-page-todo custom-page">
<template v-if="!showEngineDetail && !showEngineCheck && !showApprovalProgressDetail && !showReportDetail">
<template
v-if="
!showEngineDetail && !showEngineCheck && !showApprovalProgressDetail && !showReportDetail
"
>
<div class="page-header">
<div class="title">
我的已办
@ -35,9 +39,17 @@
@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">
<a href="javascript:void(0)" class="el-link el-link--primary" @click.stop="handleRowView(row)">查看</a>
<a
href="javascript:void(0)"
class="el-link el-link--primary"
@click.stop="handleRowView(row)"
>查看</a
>
</div>
</template>
@ -93,16 +105,16 @@
@close="handleBackFromReport"
/>
</div>
</template>
</template>
<script>
import EngineDetail from './engineDetail.vue'
import EngineCheck from './engineCheck.vue'
import ApprovalProgressDetail from './approvalProgressDetail.vue'
import ReportDetail from './reportDetail.vue'
import { getUserId } from '@/utils'
import api from '@/api/demo'
export default {
<script>
import EngineDetail from './engineDetail.vue'
import EngineCheck from './engineCheck.vue'
import ApprovalProgressDetail from './approvalProgressDetail.vue'
import ReportDetail from './reportDetail.vue'
import { getUserId } from '@/utils'
import api from '@/api/demo'
export default {
name: 'TodoPage',
components: {
EngineDetail,
@ -140,10 +152,29 @@
{ prop: 'currentNode', label: '当前环节', showOverflowTooltip: true, minWidth: '140' },
// { prop: 'statusCode', 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: '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: '',
seqConfig: {},
@ -165,12 +196,12 @@
},
handleRowView(row) {
//
const processTitle = row.processTitle || ''
const isFillParameterMode = processTitle === '数据维护'
const isResponsibleDispatchMode = processTitle === '任务分解'
const isInApprovalMode = processTitle === '数据审批'
const isModelCheck = processTitle === '模板审核'
const isReportCheck = processTitle === '对标报告审核'
const dataType = row.dataType
const isFillParameterMode = dataType === '数据维护'
const isResponsibleDispatchMode = dataType === '任务分解'
const isInApprovalMode = dataType === '数据审批'
const isModelCheck = dataType === '模板审核'
const isReportCheck = dataType === '对标报告审核'
//
this.currentModel = row.modelName || row.productFullName || ''
@ -200,6 +231,7 @@
this.currentApprovalDetail = {
flowId: row.documentNo || '',
templateId: row.modelId || '',
id: row.documentNo || '',
...row
}
return
@ -336,11 +368,11 @@
}
}
}
}
</script>
}
</script>
<style lang="scss">
.custom-page {
<style lang="scss">
.custom-page {
width: 100%;
height: 100%;
overflow-y: auto !important;
@ -418,6 +450,5 @@
flex-direction: column;
min-height: 0;
}
}
</style>
}
</style>

View File

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

View File

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