Jelajahi Sumber

Merge branch 'master' of http://52.130.252.100:10000/TEAMMODEL/MiniPrograms

zhangsl 3 tahun lalu
induk
melakukan
b47bc169dd
2 mengubah file dengan 8 tambahan dan 11 penghapusan
  1. 7 7
      components/z-table/z-table.vue
  2. 1 4
      pages/home/home.vue

+ 7 - 7
components/z-table/z-table.vue

@@ -7,7 +7,7 @@
 			<view class="z-table-container">
 				<view class="z-table-pack">
 					<view class="z-table-title">
-						<view class="z-table-title-item" :class="{ 'z-table-stick-side': stickSide && index == 0 }" :style="{ width: item.width ? item.width + 'rpx' : '200rpx' }"
+						<view class="z-table-title-item" :class="{ 'z-table-stick-side': stickSide && index == 0 }" :style="{ width: item.width ? item.width + 'rpx' : '25%' }"
 						 v-for="(item, index) in columns" :key="index" @click="sort(item.key, index)">
 							<view v-if="showSelect && !singleSelect && index === 0" class="select-box" @click="doSelect(true)">
 								<view :class="['select-tip', {'selected': selectAll}]"></view>
@@ -24,7 +24,7 @@
 					<view v-if="tableData.length" :class="['table-container-box', {'short-table': !longTable && showBottomSum}]">
 						<view class="z-table-container-row" :class="{ 'z-table-has-bottom': showBottomSum }" v-for="(row, iIndex) in tableData"
 						 :key="iIndex">
-							<view :class="['z-table-container-col', { 'z-table-stick-side': stickSide && jIndex == 0 }]" :style="{ width: col.width ? col.width + 'rpx' : '200rpx' }"
+							<view :class="['z-table-container-col', { 'z-table-stick-side': stickSide && jIndex == 0 }]" :style="{ width: col.width ? col.width + 'rpx' : '25%' }"
 							 v-for="(col, jIndex) in columns" :key="jIndex" @click="itemClick(row, col)">
 								<view v-if="showSelect && jIndex === 0" class="select-box" @click="doSelect(false, iIndex)">
 									<view :class="['select-tip', {'selected': selectArr.includes(iIndex)}]"></view>
@@ -46,7 +46,7 @@
 						</view>
 					</view>
 					<view :class="['z-table-bottom', {'long-table': longTable}]" v-if="showBottomSum && tableData.length">
-						<view class="z-table-bottom-col" :class="{ 'z-table-stick-side': stickSide && sumIndex == 0 }" :style="{ width: sumCol.width ? sumCol.width + 'rpx' : '200rpx' }"
+						<view class="z-table-bottom-col" :class="{ 'z-table-stick-side': stickSide && sumIndex == 0 }" :style="{ width: sumCol.width ? sumCol.width + 'rpx' : '25%' }"
 						 v-for="(sumCol, sumIndex) in columns" :key="sumIndex">
 							<view class="z-table-bottom-text">
 								<!-- <view v-if="sumIndex != 0" class="z-table-bottom-text-title">{{ sumCol.title }}</view> -->
@@ -513,7 +513,7 @@
 		.z-table-pack {
 			position: relative;
 			min-height: 100%;
-			width: fit-content;
+			width: 100% !important;
 		}
 
 		.z-table-title {
@@ -521,6 +521,7 @@
 			top: 0;
 			height: 64rpx;
 			z-index: 1;
+			width: 100% !important;
 
 			.z-table-title-item {
 				border-bottom: solid 1rpx #DCDCDC;
@@ -544,8 +545,7 @@
 		.z-table-title,
 		.z-table-container-row {
 			display: flex;
-			
-			width: fit-content;
+			width: 100%;
 			white-space: nowrap;
 			box-sizing: border-box;
 			
@@ -581,7 +581,7 @@
 			z-index: 9;
 			display: flex;
 			justify-items: center;
-			width: fit-content;
+			width: 100%;
 			background: #6495ED !important;
 			color: #fff !important;
 			white-space: nowrap;

+ 1 - 4
pages/home/home.vue

@@ -94,22 +94,18 @@
 					{
 						'title':'科目',
 						'key':'name',
-						'width':'120',
 					},
 					{
 						'title':'开学',
 						'key':'open',
-						'width':'140',
 					},
 					{
 						'title':'期中',
 						'key':'mid',
-						'width':'140',
 					},
 					{
 						'title':'期末',
 						'key':'final',
-						'width':'140',
 					}
 				]
 				
@@ -224,6 +220,7 @@
 			}
 			.table{
 				margin: 10px;
+				width: 90%;
 			}
 		}