fix(Design): 修复矩阵组件逻辑
- 修复矩阵组件中行和列索引的默认值设置 - 优化矩阵组件中行和列选项的获取逻辑- 添加 QuestionBefore 组件的立即验证功能 - 优化题前题后逻辑组件的显示控制
This commit is contained in:
@@ -133,6 +133,7 @@
|
|||||||
<!-- 题前 题后逻辑 本来打算拆成两个 但是 只有最后的处理不一样-->
|
<!-- 题前 题后逻辑 本来打算拆成两个 但是 只有最后的处理不一样-->
|
||||||
<div class="before-or-after">
|
<div class="before-or-after">
|
||||||
<question-before
|
<question-before
|
||||||
|
v-if="questionBeforeShow"
|
||||||
:skipType="skipType"
|
:skipType="skipType"
|
||||||
:activeQuestion="activeQuestion"
|
:activeQuestion="activeQuestion"
|
||||||
:questionsInfo="questionsInfo"
|
:questionsInfo="questionsInfo"
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
v-model="logic.cell_index"
|
v-model="logic.cell_index"
|
||||||
:options="getOptions('col')"
|
:options="getOptions('col')"
|
||||||
class="ml10"
|
class="ml10"
|
||||||
@change="changeHanlde('col', getOptions('row'), $event)"
|
@change="changeHanlde('col', getOptions('col'), $event)"
|
||||||
></yl-select>
|
></yl-select>
|
||||||
<yl-select v-model="logic.is_select" class="ml10" :options="chooseOptions"></yl-select>
|
<yl-select v-model="logic.is_select" class="ml10" :options="chooseOptions"></yl-select>
|
||||||
|
|
||||||
@@ -42,11 +42,11 @@ const changeHanlde = (type, options, value) => {
|
|||||||
return item.option_index === value;
|
return item.option_index === value;
|
||||||
});
|
});
|
||||||
if (type === 'row') {
|
if (type === 'row') {
|
||||||
logic.value.row_index = optionInfo?.option_index || 0;
|
logic.value.row_index = optionInfo?.option_index || null;
|
||||||
logic.value.relation_question_row_index = optionInfo?.parent_question_index || 0;
|
logic.value.relation_question_row_index = optionInfo?.parent_question_index || 0;
|
||||||
logic.value.row_type = optionInfo?.type || 0;
|
logic.value.row_type = optionInfo?.type || 0;
|
||||||
} else if (type === 'col') {
|
} else if (type === 'col') {
|
||||||
logic.value.cell_index = optionInfo?.option_index || 0;
|
logic.value.cell_index = optionInfo?.option_index || null;
|
||||||
logic.value.relation_question_cell_index = optionInfo?.parent_question_index || 0;
|
logic.value.relation_question_cell_index = optionInfo?.parent_question_index || 0;
|
||||||
logic.value.cell_type = optionInfo?.type || 0;
|
logic.value.cell_type = optionInfo?.type || 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
v-model="logic.cell_index"
|
v-model="logic.cell_index"
|
||||||
:options="getOptions('col')"
|
:options="getOptions('col')"
|
||||||
class="ml10"
|
class="ml10"
|
||||||
@change="changeHanlde('col', getOptions('row'), $event)"
|
@change="changeHanlde('col', getOptions('col'), $event)"
|
||||||
></yl-select>
|
></yl-select>
|
||||||
|
|
||||||
<!--是否被选中-->
|
<!--是否被选中-->
|
||||||
@@ -65,11 +65,11 @@ const changeHanlde = (type, options, value) => {
|
|||||||
return item.option_index === value;
|
return item.option_index === value;
|
||||||
});
|
});
|
||||||
if (type === 'row') {
|
if (type === 'row') {
|
||||||
logic.value.row_index = optionInfo?.option_index || 0;
|
logic.value.row_index = optionInfo?.option_index || null;
|
||||||
logic.value.relation_question_row_index = optionInfo?.parent_question_index || 0;
|
logic.value.relation_question_row_index = optionInfo?.parent_question_index || 0;
|
||||||
logic.value.row_type = optionInfo?.type || 0;
|
logic.value.row_type = optionInfo?.type || 0;
|
||||||
} else if (type === 'col') {
|
} else if (type === 'col') {
|
||||||
logic.value.cell_index = optionInfo?.option_index || 0;
|
logic.value.cell_index = optionInfo?.option_index || null;
|
||||||
logic.value.relation_question_cell_index = optionInfo?.parent_question_index || 0;
|
logic.value.relation_question_cell_index = optionInfo?.parent_question_index || 0;
|
||||||
logic.value.cell_type = optionInfo?.type || 0;
|
logic.value.cell_type = optionInfo?.type || 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,11 +49,11 @@ const changeHanlde = (type, options, value) => {
|
|||||||
return item.option_index === value;
|
return item.option_index === value;
|
||||||
});
|
});
|
||||||
if (type === 'row') {
|
if (type === 'row') {
|
||||||
logic.value.row_index = optionInfo?.option_index || 0;
|
logic.value.row_index = optionInfo?.option_index || null;
|
||||||
logic.value.relation_question_row_index = optionInfo?.parent_question_index || 0;
|
logic.value.relation_question_row_index = optionInfo?.parent_question_index || 0;
|
||||||
logic.value.row_type = optionInfo?.type || 0;
|
logic.value.row_type = optionInfo?.type || 0;
|
||||||
} else if (type === 'col') {
|
} else if (type === 'col') {
|
||||||
logic.value.cell_index = optionInfo?.option_index || 0;
|
logic.value.cell_index = optionInfo?.option_index || null;
|
||||||
logic.value.relation_question_cell_index = optionInfo?.parent_question_index || 0;
|
logic.value.relation_question_cell_index = optionInfo?.parent_question_index || 0;
|
||||||
logic.value.cell_type = optionInfo?.type || 0;
|
logic.value.cell_type = optionInfo?.type || 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -241,6 +241,9 @@ watch(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
immediate: true
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user