• el-table进阶(每条数据分行或合并)


    最麻烦的还是css样式,表格样式自己调吧

    1. <div style="display: flex">
    2. <div style="width: 100px">
    3. <div
    4. style="
    5. height: 41px;
    6. border: 1px solid #8f8e8e;
    7. border-right: none;
    8. background-color: #555555;
    9. "
    10. >div>
    11. <div
    12. class="runwayState"
    13. style="
    14. border: 1px solid #8f8e8e;
    15. border-right: none;
    16. height: 100%;
    17. display: flex;
    18. "
    19. >
    20. 使用跑道 灯光情况
    21. div>
    22. div>
    23. <div style="flex: 1">
    24. <el-table :data="tableData" style="width: 100%" class="custom-table">
    25. <el-table-column label="使用跑道" width="150">
    26. <template slot-scope="scope">
    27. <el-row>
    28. <el-col :span="6">
    29. <div>div>
    30. el-col>
    31. <el-col :span="18">
    32. <div>
    33. <el-form-item :prop="'way' + scope.$index + '_3'">
    34. <el-input
    35. v-model="scope.row['way' + scope.$index + '_3']"
    36. maxlength="10"
    37. >el-input>
    38. el-form-item>
    39. div>
    40. el-col>
    41. el-row>
    42. <el-row>
    43. <el-col :span="6">
    44. <div>div>
    45. el-col>
    46. <el-col :span="18">
    47. <div>
    48. <el-form-item :prop="'way' + scope.$index + '_3'">
    49. <el-input
    50. v-model="scope.row['way' + scope.$index + '_3']"
    51. maxlength="10"
    52. >el-input>
    53. el-form-item>
    54. div>
    55. el-col>
    56. el-row>
    57. template>
    58. el-table-column>
    59. <el-table-column label="坡度灯">
    60. <template slot-scope="scope">
    61. <el-row>
    62. <el-col :span="24">
    63. <div>
    64. <el-form-item :prop="'way' + scope.$index + '_3'">
    65. <el-input
    66. v-model="scope.row['way' + scope.$index + '_3']"
    67. maxlength="3"
    68. >el-input>
    69. el-form-item>
    70. div>
    71. el-col>
    72. el-row>
    73. <el-row>
    74. <el-col :span="24">
    75. <div>
    76. <el-form-item :prop="'way' + scope.$index + '_4'">
    77. <el-input
    78. v-model="scope.row['way' + scope.$index + '_4']"
    79. maxlength="3"
    80. >el-input>
    81. el-form-item>
    82. div>
    83. el-col>
    84. el-row>
    85. template>
    86. el-table-column>
    87. <el-table-column label="进近灯">
    88. <template slot-scope="scope">
    89. <el-row>
    90. <el-col :span="24">
    91. <div>
    92. <el-form-item :prop="'way' + scope.$index + '_5'">
    93. <el-input
    94. v-model="scope.row['way' + scope.$index + '_5']"
    95. maxlength="3"
    96. >el-input>
    97. el-form-item>
    98. div>
    99. el-col>
    100. el-row>
    101. <el-row>
    102. <el-col :span="24">
    103. <div>
    104. <el-form-item :prop="'way' + scope.$index + '_6'">
    105. <el-input
    106. v-model="scope.row['way' + scope.$index + '_6']"
    107. maxlength="3"
    108. >el-input>
    109. el-form-item>
    110. div>
    111. el-col>
    112. el-row>
    113. template>
    114. el-table-column>
    115. <el-table-column label="跑道灯">
    116. <template slot-scope="scope">
    117. <el-row>
    118. <el-col :span="24">
    119. <div>
    120. <el-form-item :prop="'way' + scope.$index + '_7'">
    121. <el-input
    122. v-model="scope.row['way' + scope.$index + '_7']"
    123. maxlength="3"
    124. >el-input>
    125. el-form-item>
    126. div>
    127. el-col>
    128. el-row>
    129. <el-row>
    130. <el-col :span="24">
    131. <div>
    132. <el-form-item :prop="'way' + scope.$index + '_8'">
    133. <el-input
    134. v-model="scope.row['way' + scope.$index + '_8']"
    135. maxlength="3"
    136. >el-input>
    137. el-form-item>
    138. div>
    139. el-col>
    140. el-row>
    141. template>
    142. el-table-column>
    143. <el-table-column label="滑行灯">
    144. <template slot-scope="scope">
    145. <el-row>
    146. <el-col :span="24">
    147. <div>
    148. <el-form-item :prop="'way' + scope.$index + '_9'">
    149. <el-input
    150. v-model="scope.row['way' + scope.$index + '_9']"
    151. maxlength="3"
    152. >el-input>
    153. el-form-item>
    154. div>
    155. el-col>
    156. el-row>
    157. <el-row>
    158. <el-col :span="24">
    159. <div>
    160. <el-form-item :prop="'way' + scope.$index + '_10'">
    161. <el-input
    162. v-model="scope.row['way' + scope.$index + '_10']"
    163. maxlength="3"
    164. >el-input>
    165. el-form-item>
    166. div>
    167. el-col>
    168. el-row>
    169. template>
    170. el-table-column>
    171. <el-table-column label="灯光科">
    172. <template slot-scope="scope">
    173. <el-form-item :prop="'way' + scope.$index + '_11'">
    174. <el-input
    175. v-model="scope.row['way' + scope.$index + '_11']"
    176. maxlength="3"
    177. >el-input>
    178. el-form-item>
    179. template>
    180. el-table-column>
    181. <el-table-column label="AWOS旋钮">
    182. <template slot-scope="scope">
    183. <el-form-item :prop="'way' + scope.$index + '_12'">
    184. <el-input
    185. v-model="scope.row['way' + scope.$index + '_12']"
    186. maxlength="5"
    187. >el-input>
    188. el-form-item>
    189. template>
    190. el-table-column>
    191. <el-table-column label="时间">
    192. <template slot-scope="scope">
    193. <el-form-item :prop="'way' + scope.$index + '_13'">
    194. <el-input
    195. v-model="scope.row['way' + scope.$index + '_13']"
    196. maxlength="5"
    197. >el-input>
    198. el-form-item>
    199. template>
    200. el-table-column>
    201. <el-table-column label="签名">
    202. <template slot-scope="scope">
    203. <el-form-item :prop="'way' + scope.$index + '_14'">
    204. <el-input
    205. v-model="scope.row['way' + scope.$index + '_14']"
    206. maxlength="3"
    207. >el-input>
    208. el-form-item>
    209. template>
    210. el-table-column>
    211. el-table>
    212. div>
    213. div>

    数据形式:

    1. tableData: [
    2. {
    3. way0_1: "起",
    4. way0_2: "降",
    5. way0_3: "10",
    6. way0_4: "12",
    7. way0_5: "5",
    8. way0_6: "7",
    9. way0_7: "8",
    10. way0_8: "10",
    11. way0_9: "9",
    12. way0_10: "11",
    13. way0_11: "3",
    14. way0_12: "25°C",
    15. way0_13: "14:30",
    16. way0_14: "John",
    17. },
    18. {
    19. way1_1: "起",
    20. way1_2: "降",
    21. way1_3: "9",
    22. way1_4: "11",
    23. way1_5: "4",
    24. way1_6: "6",
    25. way1_7: "7",
    26. way1_8: "9",
    27. way1_9: "8",
    28. way1_10: "10",
    29. way1_11: "2",
    30. way1_12: "24°C",
    31. way1_13: "15:00",
    32. way1_14: "Alice",
    33. },
    34. {
    35. way2_1: "起",
    36. way2_2: "降",
    37. way2_3: "10",
    38. way2_4: "12",
    39. way2_5: "5",
    40. way2_6: "7",
    41. way2_7: "8",
    42. way2_8: "10",
    43. way2_9: "9",
    44. way2_10: "11",
    45. way2_11: "3",
    46. way2_12: "25°C",
    47. way2_13: "14:30",
    48. way2_14: "John",
    49. },
    50. // 可以继续添加更多的数据行
    51. ],

  • 相关阅读:
    迷你无人车 Gazebo 仿真
    go拾遗(2)-函数返回数组、多个值、不显示指定返回
    制造业MES系统如何管理生产车间
    【docker】docker容器与服务器时间区不一样【已解决】
    vector的动态分配内存实验
    统信系统UOS桌面版V20 用户手册
    07-prometheus的自定义监控-pushgateway工具组件
    面试题54:浏览器/HTTP缓存机制
    2023下半年软考考后注意事项
    el-tree横向纵向滚动条
  • 原文地址:https://blog.csdn.net/qq_42192641/article/details/133647000