fix:bug
This commit is contained in:
parent
f280a779b3
commit
94897e9265
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
@ -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,69 +249,69 @@
|
||||
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-select
|
||||
v-if="item.type === 'param'"
|
||||
v-model="item.value"
|
||||
class="formula-select"
|
||||
placeholder="选择参数"
|
||||
@change="updateFormula"
|
||||
>
|
||||
<el-option
|
||||
v-for="opt in yAxisParamOptions"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value"
|
||||
/>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-else-if="item.type === 'operator'"
|
||||
v-model="item.value"
|
||||
class="formula-select"
|
||||
placeholder="选择运算符"
|
||||
@change="updateFormula"
|
||||
>
|
||||
<el-option
|
||||
v-for="opt in operatorOptions"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
: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>
|
||||
<el-form-item label="参数1:" required>
|
||||
<el-select
|
||||
v-model="formulaFormData.param1"
|
||||
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="运算符:" required>
|
||||
<el-select
|
||||
v-model="formulaFormData.operator"
|
||||
placeholder="请选择运算符"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="opt in operatorOptions"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value"
|
||||
/>
|
||||
</el-select>
|
||||
</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>
|
||||
</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>
|
||||
</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, // 当前编辑的公式ID(如果为null则是新增)
|
||||
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)
|
||||
}
|
||||
// 如果选择了公式,更新图表
|
||||
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,58 +1176,33 @@ 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) {
|
||||
case '+':
|
||||
calcResult = a + b
|
||||
break
|
||||
case '-':
|
||||
calcResult = a - b
|
||||
break
|
||||
case '*':
|
||||
calcResult = a * b
|
||||
break
|
||||
case '/':
|
||||
calcResult = b !== 0 ? a / b : null
|
||||
break
|
||||
default:
|
||||
calcResult = null
|
||||
}
|
||||
stack.push(calcResult)
|
||||
} else {
|
||||
stack.push(null)
|
||||
}
|
||||
if (!isNaN(num1) && !isNaN(num2)) {
|
||||
switch (formula.operator) {
|
||||
case '+':
|
||||
result = num1 + num2
|
||||
break
|
||||
case '-':
|
||||
result = num1 - num2
|
||||
break
|
||||
case '*':
|
||||
result = num1 * num2
|
||||
break
|
||||
case '/':
|
||||
result = num2 !== 0 ? num1 / num2 : null
|
||||
break
|
||||
default:
|
||||
result = null
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// 栈顶元素就是结果
|
||||
if (stack.length === 1) {
|
||||
result = stack[0]
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('计算公式失败:', err)
|
||||
@ -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;
|
||||
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;
|
||||
.formula-preview {
|
||||
padding: 12px;
|
||||
background: #f5f7fa;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #dcdfe6;
|
||||
font-size: 14px;
|
||||
color: #303133;
|
||||
min-height: 40px;
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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: '草稿' },
|
||||
|
||||
@ -1256,12 +1256,17 @@ export default {
|
||||
this.$forceUpdate()
|
||||
},
|
||||
shouldShowSection(sectionName) {
|
||||
// 如果选中了"整车参数",不显示子系统参数
|
||||
if (this.isWholeEngineParamsSelected && !this.checkedKeys.some(nodeId => {
|
||||
const nodeInfo = this.nodeMap[nodeId]
|
||||
return nodeInfo && !nodeInfo.isWholeEngineParams && !nodeInfo.isParent
|
||||
})) {
|
||||
return false
|
||||
// 如果选中了"整车参数",且没有选中任何其他非整车参数的节点,则不显示子系统参数
|
||||
if (this.isWholeEngineParamsSelected) {
|
||||
// 检查是否有选中任何非整车参数的节点(不管是父节点还是子节点)
|
||||
const hasNonWholeEngineParamsNode = this.checkedKeys.some(nodeId => {
|
||||
const nodeInfo = this.nodeMap[nodeId]
|
||||
return nodeInfo && !nodeInfo.isWholeEngineParams
|
||||
})
|
||||
// 如果没有选中任何非整车参数的节点,则不显示子系统参数
|
||||
if (!hasNonWholeEngineParamsNode) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
// sectionName是参数类型(如"基本规格"),需要检查是否有对应的数据
|
||||
const data = this.versionData[this.currentVersionId] || {}
|
||||
@ -1286,18 +1291,11 @@ export default {
|
||||
// 如果选中的是父节点,检查该section的数据是否属于该父节点
|
||||
if (nodeInfo.isParent) {
|
||||
const sectionData = data[sectionName] || []
|
||||
// 如果 sectionName 等于子系统名称,说明这是零部件名称为 "/" 的分组
|
||||
// 这种情况下,sectionName 就是子系统名称,所以直接匹配
|
||||
if (sectionName === nodeInfo.label) {
|
||||
const hasDataInSubsystem = sectionData.some(
|
||||
(param) => param.subsystemName === nodeInfo.label
|
||||
)
|
||||
if (hasDataInSubsystem) {
|
||||
hasMatch = true
|
||||
} else {
|
||||
// 否则检查该section的数据是否属于该父节点
|
||||
const hasDataInSubsystem = sectionData.some(
|
||||
(param) => param.subsystemName === nodeInfo.label
|
||||
)
|
||||
if (hasDataInSubsystem) {
|
||||
hasMatch = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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', [])
|
||||
|
||||
@ -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
|
||||
}
|
||||
},
|
||||
// 检查参数是否有编辑权限(根据subsystem和partsName匹配)
|
||||
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包含"模板管理",subsystem匹配,partsName匹配,且parameterPer为"编辑"
|
||||
const templateName = this.displayTemplateName
|
||||
// 查找匹配的权限:subsystem匹配,partsName匹配,且parameterPer为"编辑"
|
||||
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
|
||||
|
||||
@ -1,423 +1,454 @@
|
||||
<template>
|
||||
<div class="apaas-custom-page-todo custom-page">
|
||||
<template v-if="!showEngineDetail && !showEngineCheck && !showApprovalProgressDetail && !showReportDetail">
|
||||
<div class="page-header">
|
||||
<div class="title">
|
||||
我的已办
|
||||
</div>
|
||||
<div class="operation">
|
||||
<x-svg-icon
|
||||
:name="'refresh-icon'"
|
||||
class="pointer"
|
||||
style="cursor: pointer;"
|
||||
@click.native="handleRefresh()"
|
||||
></x-svg-icon>
|
||||
</div>
|
||||
<div class="apaas-custom-page-todo custom-page">
|
||||
<template
|
||||
v-if="
|
||||
!showEngineDetail && !showEngineCheck && !showApprovalProgressDetail && !showReportDetail
|
||||
"
|
||||
>
|
||||
<div class="page-header">
|
||||
<div class="title">
|
||||
我的已办
|
||||
</div>
|
||||
<div class="operation">
|
||||
<x-svg-icon
|
||||
:name="'refresh-icon'"
|
||||
class="pointer"
|
||||
style="cursor: pointer;"
|
||||
@click.native="handleRefresh()"
|
||||
></x-svg-icon>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="page-data-list">
|
||||
<x-vxe-table
|
||||
ref="vxeTable"
|
||||
:border="true"
|
||||
:seqWidth="40"
|
||||
:colConfigs="tableConfig.colConfigs"
|
||||
:tableData="tableData"
|
||||
:rowDraggable="tableConfig.rowDraggable"
|
||||
:seqType="tableConfig.seqType"
|
||||
: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"
|
||||
<div class="page-data-list">
|
||||
<x-vxe-table
|
||||
ref="vxeTable"
|
||||
:border="true"
|
||||
:seqWidth="40"
|
||||
:colConfigs="tableConfig.colConfigs"
|
||||
:tableData="tableData"
|
||||
:rowDraggable="tableConfig.rowDraggable"
|
||||
:seqType="tableConfig.seqType"
|
||||
: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">
|
||||
<a href="javascript:void(0)" class="el-link el-link--primary" @click.stop="handleRowView(row)">查看</a>
|
||||
</div>
|
||||
</template>
|
||||
<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
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template slot="empty">
|
||||
<div class="table-empty">
|
||||
<x-empty-page></x-empty-page>
|
||||
</div>
|
||||
</template>
|
||||
</x-vxe-table>
|
||||
</div>
|
||||
</template>
|
||||
<template slot="empty">
|
||||
<div class="table-empty">
|
||||
<x-empty-page></x-empty-page>
|
||||
</div>
|
||||
</template>
|
||||
</x-vxe-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 发动机详情组件 -->
|
||||
<engine-detail
|
||||
v-if="showEngineDetail && !showEngineCheck"
|
||||
:model="currentModel"
|
||||
:detail="currentEngineDetail"
|
||||
:engine-model-i-d="currentEngineModelID"
|
||||
:is-dispatch-mode="isDispatchMode"
|
||||
:dispatch-type="dispatchType"
|
||||
:responsible-person-id="responsiblePersonId"
|
||||
:filled-by="filledBy"
|
||||
class="engine-detail-wrapper"
|
||||
@back="handleBackFromDetail"
|
||||
/>
|
||||
<!-- 发动机详情组件 -->
|
||||
<engine-detail
|
||||
v-if="showEngineDetail && !showEngineCheck"
|
||||
:model="currentModel"
|
||||
:detail="currentEngineDetail"
|
||||
:engine-model-i-d="currentEngineModelID"
|
||||
:is-dispatch-mode="isDispatchMode"
|
||||
:dispatch-type="dispatchType"
|
||||
:responsible-person-id="responsiblePersonId"
|
||||
:filled-by="filledBy"
|
||||
class="engine-detail-wrapper"
|
||||
@back="handleBackFromDetail"
|
||||
/>
|
||||
|
||||
<!-- 发动机审批组件 -->
|
||||
<engine-check
|
||||
v-if="showEngineCheck"
|
||||
:detail="currentEngineDetail"
|
||||
:visible="showEngineCheck"
|
||||
:engine-type="engineType"
|
||||
class="engine-check-wrapper"
|
||||
@close="handleBackFromCheck"
|
||||
/>
|
||||
<!-- 发动机审批组件 -->
|
||||
<engine-check
|
||||
v-if="showEngineCheck"
|
||||
:detail="currentEngineDetail"
|
||||
:visible="showEngineCheck"
|
||||
:engine-type="engineType"
|
||||
class="engine-check-wrapper"
|
||||
@close="handleBackFromCheck"
|
||||
/>
|
||||
|
||||
<!-- 模板审核组件 -->
|
||||
<approval-progress-detail
|
||||
v-if="showApprovalProgressDetail"
|
||||
:detail="currentApprovalDetail"
|
||||
:visible="showApprovalProgressDetail"
|
||||
class="approval-progress-detail-wrapper"
|
||||
@refresh="handleBackFromApprovalProgress"
|
||||
@close="handleBackFromApprovalProgress"
|
||||
/>
|
||||
<!-- 模板审核组件 -->
|
||||
<approval-progress-detail
|
||||
v-if="showApprovalProgressDetail"
|
||||
:detail="currentApprovalDetail"
|
||||
:visible="showApprovalProgressDetail"
|
||||
class="approval-progress-detail-wrapper"
|
||||
@refresh="handleBackFromApprovalProgress"
|
||||
@close="handleBackFromApprovalProgress"
|
||||
/>
|
||||
|
||||
<!-- 对标报告审核组件 -->
|
||||
<report-detail
|
||||
v-if="showReportDetail"
|
||||
:detail="currentReportDetail"
|
||||
:visible="showReportDetail"
|
||||
class="report-detail-wrapper"
|
||||
@close="handleBackFromReport"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<!-- 对标报告审核组件 -->
|
||||
<report-detail
|
||||
v-if="showReportDetail"
|
||||
:detail="currentReportDetail"
|
||||
:visible="showReportDetail"
|
||||
class="report-detail-wrapper"
|
||||
@close="handleBackFromReport"
|
||||
/>
|
||||
</div>
|
||||
</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 {
|
||||
name: 'TodoPage',
|
||||
components: {
|
||||
EngineDetail,
|
||||
EngineCheck,
|
||||
ApprovalProgressDetail,
|
||||
ReportDetail
|
||||
},
|
||||
data: function() {
|
||||
<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,
|
||||
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 {
|
||||
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 {
|
||||
rowDraggable: false,
|
||||
colConfigs: [
|
||||
rowDraggable: false,
|
||||
colConfigs: [
|
||||
// { prop: 'documentNo', label: '单据编号', showOverflowTooltip: true, minWidth: '140' },
|
||||
{ prop: 'processTitle', label: '流程主题', showOverflowTooltip: true, minWidth: '160' },
|
||||
{ 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: {},
|
||||
layout: 'total, prev, pager, next, jumper, sizes'
|
||||
}
|
||||
seqType: '',
|
||||
seqConfig: {},
|
||||
layout: 'total, prev, pager, next, jumper, sizes'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadData()
|
||||
},
|
||||
methods: {
|
||||
pageSizeChange(size) {
|
||||
this.pagination.pageSize = size
|
||||
this.pagination.currentPage = 1
|
||||
this.loadData()
|
||||
},
|
||||
methods: {
|
||||
pageSizeChange(size) {
|
||||
this.pagination.pageSize = size
|
||||
this.pagination.currentPage = 1
|
||||
this.loadData()
|
||||
},
|
||||
rowClickEvent(row) {
|
||||
console.warn(row)
|
||||
},
|
||||
handleRowView(row) {
|
||||
// 根据流程主题判断打开哪种页面
|
||||
const processTitle = row.processTitle || ''
|
||||
const isFillParameterMode = processTitle === '数据维护'
|
||||
const isResponsibleDispatchMode = processTitle === '任务分解'
|
||||
const isInApprovalMode = processTitle === '数据审批'
|
||||
const isModelCheck = processTitle === '模板审核'
|
||||
const isReportCheck = processTitle === '对标报告审核'
|
||||
rowClickEvent(row) {
|
||||
console.warn(row)
|
||||
},
|
||||
handleRowView(row) {
|
||||
// 根据流程主题判断打开哪种页面
|
||||
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 || ''
|
||||
// engineModelID 可能来自不同的字段,需要根据实际情况调整
|
||||
this.currentEngineModelID = row.modelId
|
||||
// 设置引擎型号信息
|
||||
this.currentModel = row.modelName || row.productFullName || ''
|
||||
// engineModelID 可能来自不同的字段,需要根据实际情况调整
|
||||
this.currentEngineModelID = row.modelId
|
||||
|
||||
// 如果是"数据审批",打开审批页面
|
||||
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 对应 flowId,modelId 对应 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 对应 flowId,modelId 对应 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
|
||||
// 如果是"数据审批",打开审批页面
|
||||
if (isInApprovalMode) {
|
||||
this.currentEngineDetail = { ...row, id: row.documentNo }
|
||||
this.showEngineCheck = true
|
||||
this.showEngineDetail = false
|
||||
this.showApprovalProgressDetail = false
|
||||
this.showReportDetail = false
|
||||
},
|
||||
handleBackFromDetail() {
|
||||
// 根据数据类型判断发动机类型(可能需要根据实际字段调整)
|
||||
// 这里假设有 dataType 字段,或者可以根据其他字段判断
|
||||
this.engineType = row.dataType === '竞品' ? '竞品' : '玉柴'
|
||||
return
|
||||
}
|
||||
|
||||
// 如果是"模板审核",打开模板审核详情页面
|
||||
if (isModelCheck) {
|
||||
this.showApprovalProgressDetail = true
|
||||
this.showEngineDetail = false
|
||||
this.currentModel = ''
|
||||
this.currentEngineModelID = ''
|
||||
this.currentEngineDetail = null
|
||||
this.showEngineCheck = false
|
||||
this.showReportDetail = false
|
||||
// documentNo 对应 flowId,modelId 对应 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 对应 flowId,modelId 对应 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.engineType = '玉柴'
|
||||
},
|
||||
handleBackFromCheck() {
|
||||
this.showEngineCheck = false
|
||||
this.currentEngineDetail = null
|
||||
this.engineType = '玉柴'
|
||||
this.loadData() // 刷新待办列表
|
||||
},
|
||||
handleBackFromApprovalProgress() {
|
||||
this.showApprovalProgressDetail = false
|
||||
this.currentApprovalDetail = null
|
||||
this.loadData() // 刷新待办列表
|
||||
},
|
||||
handleBackFromReport() {
|
||||
this.showReportDetail = false
|
||||
this.currentReportDetail = null
|
||||
this.loadData() // 刷新待办列表
|
||||
},
|
||||
currentChange(currentPage) {
|
||||
this.pagination.currentPage = currentPage
|
||||
this.loadData()
|
||||
},
|
||||
selectDataChange(data) {
|
||||
this.$emit('select-data-change', data)
|
||||
},
|
||||
handleRefresh() {
|
||||
this.pagination.currentPage = 1
|
||||
this.loadData()
|
||||
},
|
||||
loadData() {
|
||||
const request = {
|
||||
...api.GET_TODO_LIST,
|
||||
params: {
|
||||
page: this.pagination.currentPage,
|
||||
size: this.pagination.pageSize,
|
||||
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) {
|
||||
}
|
||||
this.showEngineDetail = true
|
||||
this.showEngineCheck = false
|
||||
this.showApprovalProgressDetail = false
|
||||
this.showReportDetail = false
|
||||
},
|
||||
handleBackFromDetail() {
|
||||
this.showEngineDetail = false
|
||||
this.currentModel = ''
|
||||
this.currentEngineModelID = ''
|
||||
this.currentEngineDetail = null
|
||||
this.isDispatchMode = false
|
||||
this.dispatchType = 'todo'
|
||||
this.responsiblePersonId = ''
|
||||
this.filledBy = ''
|
||||
this.engineType = '玉柴'
|
||||
},
|
||||
handleBackFromCheck() {
|
||||
this.showEngineCheck = false
|
||||
this.currentEngineDetail = null
|
||||
this.engineType = '玉柴'
|
||||
this.loadData() // 刷新待办列表
|
||||
},
|
||||
handleBackFromApprovalProgress() {
|
||||
this.showApprovalProgressDetail = false
|
||||
this.currentApprovalDetail = null
|
||||
this.loadData() // 刷新待办列表
|
||||
},
|
||||
handleBackFromReport() {
|
||||
this.showReportDetail = false
|
||||
this.currentReportDetail = null
|
||||
this.loadData() // 刷新待办列表
|
||||
},
|
||||
currentChange(currentPage) {
|
||||
this.pagination.currentPage = currentPage
|
||||
this.loadData()
|
||||
},
|
||||
selectDataChange(data) {
|
||||
this.$emit('select-data-change', data)
|
||||
},
|
||||
handleRefresh() {
|
||||
this.pagination.currentPage = 1
|
||||
this.loadData()
|
||||
},
|
||||
loadData() {
|
||||
const request = {
|
||||
...api.GET_TODO_LIST,
|
||||
params: {
|
||||
page: this.pagination.currentPage,
|
||||
size: this.pagination.pageSize,
|
||||
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 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 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
|
||||
}
|
||||
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 {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow-y: auto !important;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
<style lang="scss">
|
||||
.custom-page {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow-y: auto !important;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.page-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 56px;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
min-height: 56px;
|
||||
background: #fff;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
flex-shrink: 0;
|
||||
.page-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 56px;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
min-height: 56px;
|
||||
background: #fff;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
flex-shrink: 0;
|
||||
|
||||
.title {
|
||||
color: #303133;
|
||||
font-weight: 700;
|
||||
margin-left: 20px;
|
||||
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;
|
||||
}
|
||||
.title {
|
||||
color: #303133;
|
||||
font-weight: 700;
|
||||
margin-left: 20px;
|
||||
flex: 1;
|
||||
font-size: 12px;
|
||||
}
|
||||
</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>
|
||||
|
||||
@ -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 || ''
|
||||
|
||||
@ -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('文件上传失败,请重试')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user