|
|
|
@ -2933,10 +2933,16 @@ const zdtcszTree = computed(()=>{ |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
// 使用 ref 替代 computed,使其可写 |
|
|
|
const zdtcszTableData = ref([]) |
|
|
|
|
|
|
|
// 获取当前正在设置自动填充的组件("结果"组件)的选项 |
|
|
|
const currentComponentOptions = computed(() => { |
|
|
|
|
|
|
|
return controlData.value.options |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
// 获取当前选择的索引列节点(用于获取label) |
|
|
|
const currentIndexColumnNode = computed(() => { |
|
|
|
if (!controlData.value?.control?.zdtcsz?.tby) return null |
|
|
|
@ -2949,23 +2955,23 @@ const currentTitleColumnNode = computed(() => { |
|
|
|
return zdtcszTree.value.find(item => item.id == controlData.value.control.zdtcsz.tbx) |
|
|
|
}) |
|
|
|
|
|
|
|
//左上角 |
|
|
|
const leftTopLabel = computed(()=>{ |
|
|
|
return `${indexColumnLabel.value}\\${titleColumnLabel.value}` |
|
|
|
}) |
|
|
|
|
|
|
|
// 索引列的标签(用于第一列的表头) |
|
|
|
// 索引列的标签 |
|
|
|
const indexColumnLabel = computed(() => { |
|
|
|
if (!currentIndexColumnNode.value) return "索引列" |
|
|
|
return currentIndexColumnNode.value.label |
|
|
|
}) |
|
|
|
|
|
|
|
// 标题行的标签(如果需要,可以用于其他地方) |
|
|
|
// 标题行的标签 |
|
|
|
const titleColumnLabel = computed(() => { |
|
|
|
if (!currentTitleColumnNode.value) return "标题行" |
|
|
|
return currentTitleColumnNode.value.label |
|
|
|
}) |
|
|
|
|
|
|
|
// 左上角标签:格式为"索引列\标题行" |
|
|
|
const leftTopLabel = computed(() => { |
|
|
|
return `${indexColumnLabel.value}\\${titleColumnLabel.value}` |
|
|
|
}) |
|
|
|
|
|
|
|
// 原始选项数组(标题行=列,索引列=行) |
|
|
|
const titleOptions = computed(() => { |
|
|
|
return currentTitleColumnNode.value?.options || [] |
|
|
|
@ -3045,8 +3051,8 @@ const handleDetermineZdtcszDialogFlag = () => { |
|
|
|
|
|
|
|
// 可以在这里添加其他处理逻辑 |
|
|
|
/* console.log('保存的数据:', controlData.value.control.zdtcsz.tableData) |
|
|
|
console.log('索引列:', indexColumnLabel.value) |
|
|
|
console.log('标题行:', titleColumnLabel.value) */ |
|
|
|
console.log('当前组件选项:', currentComponentOptions.value) |
|
|
|
console.log('左上角标签:', leftTopLabel.value) */ |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@ -6802,7 +6808,7 @@ const formatTooltip = (val: number) => { |
|
|
|
showHide(['radio', 'select'], true) && controlData.config.optionsType == 0 |
|
|
|
" |
|
|
|
> |
|
|
|
<el-button style="position: relative; top: -1px;right:-12px" @click="handelZdtcszDialog">自动填充设置</el-button> |
|
|
|
<el-button style="position: relative; top: -1px;right:-12px" @click="handelZdtcszDialog">矩阵填充设置</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
@ -8535,7 +8541,7 @@ const formatTooltip = (val: number) => { |
|
|
|
class="glxxsztc" |
|
|
|
top="150px" |
|
|
|
:close-on-click-modal="false" |
|
|
|
:title="`自动填充设置--` + controlData.name" |
|
|
|
:title="`矩阵填充设置--` + controlData.name" |
|
|
|
:show-close="false" |
|
|
|
style="margin-top: 70px" |
|
|
|
width="50%" |
|
|
|
@ -8581,7 +8587,7 @@ const formatTooltip = (val: number) => { |
|
|
|
:header-cell-style="{ textAlign: 'center' }" |
|
|
|
:cell-style="{ textAlign: 'center' }" |
|
|
|
> |
|
|
|
<!-- 第一列:动态列标题,显示索引列的label --> |
|
|
|
<!-- 第一列:动态列标题,显示"索引列\标题行"的格式 --> |
|
|
|
<el-table-column |
|
|
|
:label="leftTopLabel" |
|
|
|
prop="rowLabel" |
|
|
|
@ -8598,12 +8604,21 @@ const formatTooltip = (val: number) => { |
|
|
|
align="center" |
|
|
|
> |
|
|
|
<template #default="scope"> |
|
|
|
<el-input |
|
|
|
<!-- 改为下拉选择器 --> |
|
|
|
<el-select |
|
|
|
v-model="scope.row[`col_${col.value}`]" |
|
|
|
size="small" |
|
|
|
placeholder="请输入" |
|
|
|
@input="handleTableDataChange" |
|
|
|
/> |
|
|
|
placeholder="请选择" |
|
|
|
style="width: 100%;" |
|
|
|
@change="handleTableDataChange" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="option in currentComponentOptions" |
|
|
|
:key="option.value" |
|
|
|
:label="option.label" |
|
|
|
:value="option.value" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
|