|
@@ -0,0 +1,116 @@
|
|
|
+<script setup lang='ts'>
|
|
|
+import { PropType } from 'vue';
|
|
|
+
|
|
|
+const props = defineProps({
|
|
|
+ data: {
|
|
|
+ type: Array as PropType<any[]>,
|
|
|
+ required: true
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
+<template>
|
|
|
+<div class="table-wrapper">
|
|
|
+ <table cellpadding="0" cellspacing="0">
|
|
|
+ <thead>
|
|
|
+ <tr class="th">
|
|
|
+ <td
|
|
|
+ class="head-column"
|
|
|
+ v-for="(item,index) in props.data[0]"
|
|
|
+ :key="index"
|
|
|
+ :colspan="item.mc.cs||1"
|
|
|
+ :rowspan="item.mc.rs||1"
|
|
|
+ >
|
|
|
+ {{item.m}}
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ <tr
|
|
|
+ v-for="(item,index) in props.data.slice(1)"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
+ <td
|
|
|
+ :class="['data-cell',{'one-bg':index%2, 'tow-bg': index%2!==0}]"
|
|
|
+ v-for="(cell,cell_index) in item"
|
|
|
+ :key="cell_index"
|
|
|
+ :colspan="cell.mc.cs||1"
|
|
|
+ :rowspan="cell.mc.rs||1"
|
|
|
+ >
|
|
|
+ {{cell.m}}
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+</div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<style lang='less' scoped>
|
|
|
+::-webkit-scrollbar {
|
|
|
+ width: 6px;
|
|
|
+ height: 6px;
|
|
|
+}
|
|
|
+::-webkit-scrollbar-track {
|
|
|
+ background: rgb(239, 239, 239);
|
|
|
+ border-radius: 2px;
|
|
|
+}
|
|
|
+::-webkit-scrollbar-thumb {
|
|
|
+ background: #ccc;
|
|
|
+ border-radius: 10px;
|
|
|
+}
|
|
|
+::-webkit-scrollbar-thumb:hover {
|
|
|
+ background: #888;
|
|
|
+}
|
|
|
+::-webkit-scrollbar-corner {
|
|
|
+ background: #666;
|
|
|
+}
|
|
|
+.table-wrapper {
|
|
|
+ max-width: calc(100vw - 20px);
|
|
|
+ margin: 0 auto;
|
|
|
+ // margin-right: -5px;
|
|
|
+ overflow: hidden;
|
|
|
+ overflow-x: auto;
|
|
|
+}
|
|
|
+table {
|
|
|
+ width: 100%;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #666;
|
|
|
+ td,
|
|
|
+ th {
|
|
|
+ width: 120px;
|
|
|
+ min-width: 120px;
|
|
|
+ // word-break: break-all;
|
|
|
+ border: 1px solid #dcdfe6;
|
|
|
+ height: 40px;
|
|
|
+ line-height: 40px;
|
|
|
+ text-align: center;
|
|
|
+ background-color: #fff;
|
|
|
+ border-left: none;
|
|
|
+ border-top: none;
|
|
|
+ &:first-child {
|
|
|
+ border-left: 1px solid #dcdfe6;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .head-column {
|
|
|
+ background-color: #505B78;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+
|
|
|
+ .data-cell{
|
|
|
+ color: #666;
|
|
|
+ &.one-bg {
|
|
|
+ background-color: #EFEEF1;
|
|
|
+ }
|
|
|
+ &.two-bg {
|
|
|
+ background-color: #fff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .thead-sticky {
|
|
|
+ position: sticky;
|
|
|
+ top: 0;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|