Browse Source

feat:[模板管理][update]

lkf
luojie 3 months ago
parent
commit
f1ee27dcd0
3 changed files with 15 additions and 5 deletions
  1. +1
    -1
      src/components/Template/CustomTable.vue
  2. +2
    -3
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/Recovery.vue
  3. +12
    -1
      src/views/business/comps/template/mixins/templateMixin.js

+ 1
- 1
src/components/Template/CustomTable.vue View File

@ -370,7 +370,7 @@ export default {
}
}
//
if (col.otherCode) {
if (col.otherCode && col.bodySubType !== 'span') {
const otherValue = row[col.otherCode];
if (this.isValueEmpty(otherValue)) {

+ 2
- 3
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/Recovery.vue View File

@ -51,7 +51,7 @@
</div>
</div>
</div>
<!-- <button @click = "onSave">保存</button> -->
<button @click = "onSave">保存</button>
<SelectReagentDialog @submit="onSelectReagentSubmit" ref="selectReagentDialogRef">
</SelectReagentDialog>
</div>
@ -379,7 +379,6 @@ export default {
console.log(content)
//resource
let tmpResource = []
debugger
//
tmpResource.push({
mc: content.targetName,
@ -403,7 +402,7 @@ export default {
return content;
},
async onSave() {
const formData = await this.getFilledFormData();
const formData = await this.validFormFields(["rongyeTableRef", "tableRef"])
console.log(formData, "formData")
},

+ 12
- 1
src/views/business/comps/template/mixins/templateMixin.js View File

@ -155,7 +155,18 @@ export default {
})
if (validFormData) {
validFormData.forEach((item) => {
result = { ...result, ...item }
for (const [key, value] of Object.entries(item)) {
let index = 0;
// 如果当前键是可能重复的字段,且结果对象中已经存在该键,则添加索引后缀
if ((key === 'headerSelectFields' || key === 'stepTableFormData') && result.hasOwnProperty(key)) {
// 为重复字段生成带索引的键名,从1开始(因为第一个组件不需要后缀)
const newKey = `${key}_${++index}`;
result[newKey] = value;
} else {
// 正常合并其他字段
result[key] = value;
}
}
})
return result
}

Loading…
Cancel
Save