feat: 矩阵问卷可以左右滑动

- 矩阵多选、矩阵填空现在可以左右滚动
This commit is contained in:
Huangzhe
2025-03-19 17:51:36 +08:00
parent 1356c5e72c
commit aa1e26cc0b
5 changed files with 83 additions and 117 deletions

View File

@@ -1,39 +1,10 @@
<template>
<!-- <table class="matrix-table">-->
<!-- <thead>-->
<!-- <tr>-->
<!-- <th></th>-->
<!-- <th v-for="col in cols" :key="col.option">-->
<!-- <contenteditable-->
<!-- v-if="col.option"-->
<!-- v-model="col.option"-->
<!-- :active="active"-->
<!-- @blur="emitValue"-->
<!-- />-->
<!-- <van-field v-else placeholder="请输入" v-model="col.option" v-focus />-->
<!-- </th>-->
<!-- </tr>-->
<!-- </thead>-->
<!-- <tbody>-->
<!-- <tr v-for="(row, rowIndex) in rows" :key="rowIndex">-->
<!-- <contenteditable v-model="row.option" :active="active" @blur="emitValue" />-->
<!-- <td v-for="(col, colIndex) in cols" :key="colIndex">-->
<!-- <input-->
<!-- type="radio"-->
<!-- class="van-icon matrix-radio"-->
<!-- :name="`R${rowIndex + 1}`"-->
<!-- :value="`${rowIndex + 1}_${colIndex + 1}`"-->
<!-- :checked="isOptionChecked(rowIndex, colIndex)"-->
<!-- @change="handleMatrixRadioChange(rowIndex, colIndex)"-->
<!-- />-->
<!-- </td>-->
<!-- </tr>-->
<!-- </tbody>-->
<!-- </table>-->
<el-table :data="rows" style="width: 100%">
<el-table-column width="140">
<el-table-column width="80">
<template #header></template>
<template #default="{ row /*, column, $index*/ }"> <div v-html="row.option"></div></template>
<template #default="{ row /*, column, $index*/ }">
<contenteditable v-model="row.option" :active="active" @blur="emitValue" />
</template>
</el-table-column>
<el-table-column v-for="(col, colIndex) in cols" :key="col.option" width="100">
<template #header>