| | |
| | | :style="{ |
| | | width: |
| | | index == 0 || |
| | | index == chapter005.tableData151.length - 1 |
| | | ? '100px' |
| | | index == chapter005.headersData.length - 1 |
| | | ? '150px' |
| | | : '', |
| | | }" |
| | | v-for="(header, index) in chapter005.headersData" |
| | |
| | | > |
| | | <td v-for="(cell, cellIndex) in row" :key="cellIndex"> |
| | | <template v-if="cell === ''"> |
| | | <input |
| | | type="text" |
| | | v-model="chapter005.tableData151[rowIndex][cellIndex]" |
| | | @blur=" |
| | | updateCell(rowIndex, cellIndex, $event.target.value) |
| | | " |
| | | /> |
| | | <div |
| | | contenteditable |
| | | @blur="updateCell(rowIndex, cellIndex, $event)" |
| | | > |
| | | {{ chapter005.tableData151[rowIndex][cellIndex] }} |
| | | </div> |
| | | </template> |
| | | <template v-else> |
| | | <input |
| | | :readonly="cellIndex == 0" |
| | | type="text" |
| | | :value="chapter005.tableData151[rowIndex][cellIndex]" |
| | | @blur=" |
| | | updateCell(rowIndex, cellIndex, $event.target.value) |
| | | " |
| | | /> |
| | | <div |
| | | :contenteditable="cellIndex != 0" |
| | | @blur="updateCell(rowIndex, cellIndex, $event)" |
| | | > |
| | | {{ chapter005.tableData151[rowIndex][cellIndex] }} |
| | | </div> |
| | | </template> |
| | | </td> |
| | | </tr> |
| | |
| | | > |
| | | <td v-for="(cell, cellIndex) in row" :key="cellIndex"> |
| | | <template v-if="cell === ''"> |
| | | <input |
| | | type="text" |
| | | v-model="chapter005.tableData155[rowIndex][cellIndex]" |
| | | @blur=" |
| | | updateCell155( |
| | | rowIndex, |
| | | cellIndex, |
| | | $event.target.value |
| | | ) |
| | | " |
| | | /> |
| | | <div |
| | | contenteditable |
| | | @blur="updateCell155(rowIndex, cellIndex, $event)" |
| | | > |
| | | {{ chapter005.tableData155[rowIndex][cellIndex] }} |
| | | </div> |
| | | </template> |
| | | <template v-else> |
| | | <input |
| | | type="text" |
| | | :value="chapter005.tableData155[rowIndex][cellIndex]" |
| | | @blur=" |
| | | updateCell155( |
| | | rowIndex, |
| | | cellIndex, |
| | | $event.target.value |
| | | ) |
| | | " |
| | | /> |
| | | <div |
| | | contenteditable |
| | | @blur="updateCell155(rowIndex, cellIndex, $event)" |
| | | > |
| | | {{ chapter005.tableData155[rowIndex][cellIndex] }} |
| | | </div> |
| | | </template> |
| | | </td> |
| | | </tr> |
| | |
| | | } |
| | | localStorage.setItem("chapter005", JSON.stringify(this.chapter005)); |
| | | }, |
| | | updateCell(rowIndex, cellIndex, value) { |
| | | updateCell(rowIndex, cellIndex, e) { |
| | | // 更新单元格数据 |
| | | this.$set(this.chapter005.tableData151[rowIndex], cellIndex, value); |
| | | this.$set(this.chapter005.tableData151[rowIndex], cellIndex, e.target.innerText); |
| | | localStorage.setItem("chapter005", JSON.stringify(this.chapter005)); |
| | | }, |
| | | updateCell152(rowIndex, cellIndex, value) { |
| | |
| | | this.$set(this.chapter005.tableData154[rowIndex], cellIndex, value); |
| | | localStorage.setItem("chapter005", JSON.stringify(this.chapter005)); |
| | | }, |
| | | updateCell155(rowIndex, cellIndex, value) { |
| | | updateCell155(rowIndex, cellIndex, e) { |
| | | // 更新单元格数据 |
| | | this.$set(this.chapter005.tableData155[rowIndex], cellIndex, value); |
| | | this.$set( |
| | | this.chapter005.tableData155[rowIndex], |
| | | cellIndex, |
| | | e.target.innerText |
| | | ); |
| | | localStorage.setItem("chapter005", JSON.stringify(this.chapter005)); |
| | | }, |
| | | updateCell156(rowIndex, cellIndex, value) { |