zb-tables.vue 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314
  1. <template>
  2. <!-- #ifdef H5 || APP-PLUS -->
  3. <view :class="['zb-table','zb-table-fixed-header',!border&&(bodyTableLeft>50||headerTableLeft>50)&&'scroll-left-fixed']">
  4. <view class="zb-table-content" :style="[{flex: 1, borderLeft:`${border?'2rpx solid #e8e8e8':''}`}]">
  5. <view class="zb-table-scroll" style="height: 100%;">
  6. <template v-if="showHeader">
  7. <view class="zb-table-header top-header-uni" :style="{paddingRight:`${scrollbarSize}rpx`,background:`${headbgColor}`}"
  8. >
  9. <scroll-view class="zb-table-headers"
  10. @touchmove.stop="getMove"
  11. @scroll="handleTableScrollLeft"
  12. scroll-x="true"
  13. scroll-y="false"
  14. id="tableHeaders"
  15. scroll-anchoring="true"
  16. :scroll-left="headerTableLeft"
  17. style="
  18. height: 100%">
  19. <view class="zb-table-fixed" >
  20. <view class="zb-table-thead" style="position: relative;" >
  21. <view class="item-tr">
  22. <view
  23. @click.stop="sortAction(item,index)"
  24. class="item-th"
  25. :class="border?'':'nborder'"
  26. :style="[{
  27. width:`${item.width?item.width:'200'}rpx`,
  28. flex:index===transColumns.length-1?1:'none',
  29. minWidth:`${item.width?item.width:'200'}rpx`,
  30. borderRight:`${border&&borderr?'2rpx solid #e8e8e8':''}`,
  31. borderRight:`${(scrollbarSize&&index===transColumns.length-1)?'':border&&borderr?'2rpx solid #e8e8e8':''}`,
  32. borderTop:`${border?'2rpx solid #e8e8e8':''}`,
  33. textAlign:item.align||'left',
  34. paddingRight:`${item.paddingRight?item.paddingRight:'8'}rpx`,
  35. },getHeaderCellStyle(item,index)]"
  36. v-for="(item,index) in transColumns" :key="index">
  37. <template v-if="item.type==='selection'">
  38. <view class="checkbox-item">
  39. <tableCheckbox
  40. :indeterminate="indeterminate" :checked="checkedAll" @checkboxSelected="checkboxSelectedAll"></tableCheckbox>
  41. </view>
  42. </template>
  43. <template v-else>
  44. {{ item.label }}
  45. <block v-if="item.manfen">/{{item.manfen}}</block>
  46. <view class="sorter-table" v-if="item.sorter">
  47. <view :class="['sorter-table-icon',item.sorterMode==='_asc'&&`sorting${item.sorterMode||''}`]"></view>
  48. <view :class="['sorter-table-icon',item.sorterMode==='_desc'&&`sorting${item.sorterMode||''}`]"></view>
  49. </view>
  50. </template>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. </scroll-view>
  56. </view>
  57. </template>
  58. <template v-if="!data.length">
  59. <view class="no-data">暂无数据~~</view>
  60. </template>
  61. <scroll-view
  62. class="zb-table-body" ref="tableBody" scroll-x="true" scroll-y="true" id="tableBody"
  63. :lower-threshold="40"
  64. :upper-threshold="10"
  65. @touchmove.stop="getMove"
  66. @scrolltolower="scrolltolower"
  67. @scrolltoupper="(e)=>debounce(scrollToLeft)(e)"
  68. @scroll="handleBodyScroll" :scroll-left="bodyTableLeft" :scroll-top="bodyScrollTop"
  69. :style=" `height: calc(100% - ${showSummary?160:80}rpx)`" >
  70. <view class="zb-table-fixed">
  71. <view class="zb-table-tbody">
  72. <view :class="['item-tr',highlight&&isHighlight(item,index)?'current-row':'']"
  73. @click.stop="rowClick(item,index)"
  74. v-for="(item,index) in transData" :key="item.key" >
  75. <view
  76. :style="[{
  77. width:`${ite.width?ite.width:'200'}rpx`,
  78. flex:i===transColumns.length-1?1:'none',
  79. minWidth:`${ite.width?ite.width:'200'}rpx`,
  80. borderRight:`${border&&borderr?'2rpx solid #e8e8e8':''}`,
  81. textAlign:ite.align||'left',
  82. },cellStyle&&getCellStyle(item,ite,index,i)]"
  83. :class="['item-td',stripe?(index % 2) != 0?'odd':'even':'',border?'':'nborder']"
  84. v-for="(ite,i) in transColumns" :key="i">
  85. <template v-if="ite.type==='operation'">
  86. <view style="display: flex;align-items: center;height: 100%">
  87. <view
  88. v-for="ren,ind in permission(item,ite.renders,index)"
  89. :key="ind"
  90. @click.stop="$emit(ren.func,item,index)"
  91. :style="{
  92. display:'flex',
  93. alignItems: 'center',
  94. marginRight:ite.renders.length>1?'16rpx':'0'
  95. }">
  96. <template v-if="ren.type==='custom'">
  97. <view :class="ren.class||''" style="cursor: pointer">
  98. {{ren.name}}
  99. </view>
  100. </template>
  101. <!-- 查看详情 -->
  102. <template v-if="ren.type==='detail'" >
  103. <view :class="ren.class||''" style="cursor: pointer" @click.stop="">
  104. {{ite.filters?itemFilter(item,ite):formatterAction(item,ite,index,i)}}
  105. <text v-if="item.isJoin=='否'" @click.stop="$emit(ren.func,item,index)" style="color:#1D64E2">{{item.isJoin=='否'?'(查看详情)':''}}</text>
  106. </view>
  107. </template>
  108. <template v-else>
  109. <button
  110. :class="ren.class||''"
  111. :type="ren.type||'primary'" :size="ren.size||'mini'">{{ren.name}}</button>
  112. </template>
  113. </view>
  114. </view>
  115. </template>
  116. <!-- 格式化处理 -->
  117. <template v-else-if="ite.type==='format'">
  118. <view>{{kayType(itemFilter(item,ite),parameter[ite.key])}}</view>
  119. </template>
  120. <template v-else-if="ite.type==='selection'">
  121. <view class="checkbox-item">
  122. <tableCheckbox @checkboxSelected="(e)=>checkboxSelected(e,item)" :cellData="item" :checked="item.checked"/>
  123. </view>
  124. </template>
  125. <template v-else-if="ite.type==='index'">
  126. {{index+1}}
  127. </template>
  128. <template v-else-if="ite.type==='img'">
  129. <view class="checkbox-item">
  130. <image
  131. @click.stop="previewImage(item,item[ite.name],index)"
  132. v-if="item[ite.name]"
  133. :show-menu-by-longpress="false"
  134. :src="item[ite.name]" style="width: 80rpx;height:60rpx; " mode="aspectFit"></image>
  135. <text v-else>{{ite.emptyString}}</text>
  136. </view>
  137. </template>
  138. <template v-else>
  139. <!-- {{ ite.filters?itemFilter(item,ite):(item[ite.name]==null||item[ite.name]==='')?ite.emptyString:item[ite.name] }}-->
  140. {{ ite.filters?itemFilter(item,ite):formatterAction(item,ite,index,i) }}
  141. </template>
  142. </view>
  143. </view>
  144. </view>
  145. </view>
  146. </scroll-view>
  147. <table-h5-summary
  148. :scrollbarSize="scrollbarSize"
  149. :data="data"
  150. :handleFooterTableScrollLeft="handleFooterTableScrollLeft"
  151. :headerFooterTableLeft="headerFooterTableLeft"
  152. v-if="showSummary"
  153. :showSummary="showSummary"
  154. :transColumns="transColumns"
  155. :border="border"
  156. :summary-method="summaryMethod"
  157. :sumText="sumText"
  158. :fixedLeftColumns="fixedLeftColumns"/>
  159. </view>
  160. <view class="zb-table-fixed-left"
  161. v-if="isFixedLeft"
  162. :style=" {height: `calc(100% - ${scrollbarSize}rpx)`}"
  163. >
  164. <template v-if="showHeader">
  165. <view class="zb-table-header" style="display: flex" :style="{background:`${headbgColor}`}">
  166. <view class="item-tr"
  167. style=""
  168. @click.stop="rowClick(item,index)"
  169. v-for="(item,index) in fixedLeftColumns" :key="index">
  170. <view
  171. :style="{
  172. width:`${item.width?item.width:'200'}rpx`,
  173. borderRight:`${border&&borderr?'2rpx solid #e8e8e8':''}`,
  174. borderTop:`${border?'2rpx solid #e8e8e8':''}`,
  175. textAlign:item.align||'left'
  176. }"
  177. @click.stop="sortAction(item,index)"
  178. class="item-th"
  179. :class="border?'':'nborder'"
  180. >
  181. <template v-if="item.type==='selection'">
  182. <view class="checkbox-item">
  183. <tableCheckbox
  184. :indeterminate="indeterminate" :checked="checkedAll" @checkboxSelected="checkboxSelectedAll"></tableCheckbox>
  185. </view>
  186. </template>
  187. <template v-else>
  188. {{ item.label }}
  189. <block v-if="item.manfen">/{{item.manfen}}</block>
  190. <view class="sorter-table" v-if="item.sorter">
  191. <view :class="['sorter-table-icon',item.sorterMode==='_asc'&&`sorting${item.sorterMode||''}`]"></view>
  192. <view :class="['sorter-table-icon',item.sorterMode==='_desc'&&`sorting${item.sorterMode||''}`]"></view>
  193. </view>
  194. </template>
  195. </view>
  196. </view>
  197. </view>
  198. </template>
  199. <scroll-view
  200. scroll-y="true"
  201. id="leftTableFixed"
  202. :upper-threshold="15"
  203. @scrolltoupper="(e)=>scrollToFixedLeft(e)"
  204. @scroll="leftFixedScrollAction"
  205. :scroll-top="leftFiexScrollTop"
  206. class="zb-table-body-inner"
  207. :style=" `height: calc(100% - ${showSummary?160:80}rpx)`">
  208. <view class="zb-table-fixed">
  209. <view class="zb-table-tbody">
  210. <view
  211. :class="['item-tr',stripe?(i % 2) != 0?'odd':'even':'',highlight&&isHighlight(ite,i)?'current-row':'']"
  212. v-for="(ite,i) in transData"
  213. @click.stop="rowClick(ite,i)"
  214. :key="ite.key"
  215. style="">
  216. <view class='item-td'
  217. :class="border?'':'nborder'"
  218. :style="[{
  219. width:`${item.width?item.width:'200'}rpx`,
  220. borderRight:`${border&&borderr?'2rpx solid #e8e8e8':''}`,
  221. textAlign:item.align||'left'
  222. },cellStyle&&getCellStyle(ite,item,i,index)]"
  223. :key="index"
  224. v-for="(item,index) in fixedLeftColumns">
  225. <template v-if="item.type==='selection'">
  226. <view class="checkbox-item">
  227. <tableCheckbox @checkboxSelected="(e)=>checkboxSelected(e,ite)" :cellData="ite" :checked="ite.checked"/>
  228. </view>
  229. </template>
  230. <template v-else-if="item.type==='index'">
  231. {{i+1}}
  232. </template>
  233. <template v-else>
  234. {{ite[item.name]||item.emptyString}}
  235. </template>
  236. </view>
  237. </view>
  238. </view>
  239. </view>
  240. </scroll-view>
  241. <table-side-summary
  242. :scrollbarSize="scrollbarSize"
  243. v-if="showSummary&&!(scrollbarSize>0)"
  244. :data="data"
  245. :showSummary="showSummary"
  246. :transColumns="transColumns"
  247. :border="border"
  248. :summary-method="summaryMethod"
  249. :sumText="sumText"
  250. :fixedLeftColumns="fixedLeftColumns"/>
  251. </view>
  252. </view>
  253. <zb-load-more v-if="isLoadMore&&!completeLoading"/>
  254. </view>
  255. <!-- #endif -->
  256. <!-- #ifndef H5 || APP-PLUS -->
  257. <view class="zb-table-applet">
  258. <view class="zb-table-content" :style="[{flex: 1, borderLeft:`${border?'2rpx solid #e8e8e8':''}`}]">
  259. <scroll-view
  260. <!-- #ifdef MP-ALIPAY -->
  261. @scroll="scrollAlipay"
  262. <!-- #endif -->
  263. @scrolltolower="scrolltolower"
  264. <!-- #ifdef MP-ALIPAY -->
  265. style=" height: 100%;overflow-x:scroll"
  266. <!-- #endif -->
  267. <!-- #ifndef MP-ALIPAY -->
  268. style=" height: 100%"
  269. <!-- #endif -->
  270. scroll-y="true"
  271. scroll-x="true">
  272. <view class="zb-table-scroll" >
  273. <template v-if="showHeader">
  274. <view class="zb-table-header top-header-uni" :style="{background:`${headbgColor}`}">
  275. <view class="zb-table-fixed" >
  276. <view class="zb-table-thead" style="position: relative;" >
  277. <view class="item-tr">
  278. <view
  279. @click.stop="sortAction(item,index)"
  280. :class="['item-th',index <fixedLeftColumns.length&&'zb-stick-side',border?'':'nborder']"
  281. :style="{
  282. left:`${item.left}rpx`,
  283. width:`${item.width?item.width:'200'}rpx`,
  284. flex:index===transColumns.length-1?1:'none',
  285. minWidth:`${item.width?item.width:'200'}rpx`,
  286. borderRight:`${border&&borderr?'2rpx solid #e8e8e8':''}`,
  287. borderTop:`${border?'2rpx solid #e8e8e8':''}`,
  288. textAlign:item.align||'left'
  289. }"
  290. v-for="(item,index) in transColumns" :key="index">
  291. <template v-if="item.type==='selection'">
  292. <view class="checkbox-item">
  293. <tableCheckbox
  294. :indeterminate="indeterminate" :checked="checkedAll" @checkboxSelected="checkboxSelectedAll"></tableCheckbox>
  295. </view>
  296. </template>
  297. <template v-else>
  298. {{ item.label||'' }}
  299. <block v-if="item.manfen">/{{item.manfen}}</block>
  300. <view class="sorter-table" v-if="item.sorter">
  301. <view :class="['sorter-table-icon',item.sorterMode==='_asc'&&`sorting${item.sorterMode||''}`]"></view>
  302. <view :class="['sorter-table-icon',item.sorterMode==='_desc'&&`sorting${item.sorterMode||''}`]"></view>
  303. </view>
  304. </template>
  305. </view>
  306. </view>
  307. </view>
  308. </view>
  309. </view>
  310. </template>
  311. <template v-if="!data.length">
  312. <view class="no-data">暂无数据~~</view>
  313. </template>
  314. <view class="zb-table-fixed">
  315. <view class="zb-table-tbody">
  316. <view :class="['item-tr',highlight&&isHighlight(item,index)?'current-row':'']"
  317. @click.stop="rowClick(item,index)"
  318. v-for="(item,index) in transData" :key="item.key" >
  319. <view
  320. :style="[{
  321. left:`${ite.left}rpx`,
  322. width:`${ite.width?ite.width:'200'}rpx`,
  323. flex:i===transColumns.length-1?1:'none',
  324. minWidth:`${ite.width?ite.width:'200'}rpx`,
  325. borderRight:`${border&&borderr?'2rpx solid #e8e8e8':''}`,
  326. textAlign:ite.align||'left',
  327. },getCellStyle(item,ite,index,i)]"
  328. :class="['item-td',border?'':'nborder', i <fixedLeftColumns.length&&'zb-stick-side',stripe?(index % 2) != 0?'odd':'even':'']"
  329. v-for="(ite,i) in transColumns" :key="i">
  330. <template v-if="ite.type==='operation'">
  331. <view style="display: flex;align-items: center;height: 100%">
  332. <view
  333. v-for="ren,ind in permission(item,ite.renders,index)"
  334. :key="ind"
  335. @click.stop="$emit(ren.func,item,index)"
  336. :style="{
  337. display:'flex',
  338. alignItems: 'center',
  339. marginRight:ite.renders.length>1?'16rpx':'0'
  340. }">
  341. <template v-if="ren.type==='custom'">
  342. <view :class="ren.class||''" style="cursor: pointer">
  343. {{ren.name}}
  344. </view>
  345. </template>
  346. <template v-else>
  347. <button
  348. :class="ren.class||''"
  349. :type="ren.type||'primary'" :size="ren.size||'mini'">{{ren.name}}</button>
  350. </template>
  351. </view>
  352. </view>
  353. </template>
  354. <!-- 格式化处理 -->
  355. <template v-else-if="ite.type==='format'">
  356. <view>{{kayType(itemFilter(item,ite),parameter[ite.key])}}</view>
  357. </template>
  358. <template v-else-if="ite.type==='selection'">
  359. <view class="checkbox-item">
  360. <tableCheckbox @checkboxSelected="(e)=>checkboxSelected(e,item)" :cellData="item" :checked="item.checked"/>
  361. </view>
  362. </template>
  363. <template v-else-if="ite.type==='img'">
  364. <image
  365. @click.stop="previewImage(item,item[ite.name],index)"
  366. v-if="item[ite.name]"
  367. :show-menu-by-longpress="false"
  368. :src="item[ite.name]" style="width: 80rpx;height:60rpx; " mode="aspectFit"></image>
  369. <text v-else>{{ite.emptyString}}</text>
  370. </template>
  371. <template v-else-if="ite.type==='index'">
  372. {{index+1}}
  373. </template>
  374. <template v-else>
  375. <!-- {{ ite.filters?itemFilter(item,ite):(item[ite.name]==null||item[ite.name]==='')?ite.emptyString:item[ite.name] }}-->
  376. {{ ite.filters?itemFilter(item,ite):formatterAction(item,ite,index,i) }}
  377. </template>
  378. </view>
  379. </view>
  380. </view>
  381. </view>
  382. <table-summary
  383. v-if="showSummary"
  384. :data="data"
  385. :showSummary="showSummary"
  386. :fixedLeftColumns="fixedLeftColumns"
  387. :transColumns="transColumns"
  388. :border="border"
  389. :summary-method="summaryMethod"
  390. :sumText="sumText"
  391. />
  392. </view>
  393. </scroll-view>
  394. </view>
  395. <zb-load-more v-if="isLoadMore&&!completeLoading"/>
  396. </view>
  397. <!-- #endif -->
  398. </template>
  399. <script>
  400. import TableCheckbox from './components/table-checkbox.vue'
  401. import TableSummary from "./components/table-summary.vue";
  402. import TableSideSummary from "./components/table-side-summary.vue";
  403. import TableH5Summary from './components/table-h5-summary'
  404. import ZbLoadMore from './components/zb-load-more'
  405. import {getScrollbarSize} from "./js/util";
  406. // fit 列的宽度是否自撑开
  407. // column 显示的列数据
  408. // stripe 是否为斑马纹 table
  409. // show-header 是否显示表头
  410. //headbgColor 头部背景色
  411. //borderr右侧的线
  412. // parameter 格式化数据总对象
  413. export default {
  414. components:{
  415. TableCheckbox,
  416. TableSummary,
  417. TableSideSummary,
  418. TableH5Summary,
  419. ZbLoadMore
  420. },
  421. props:{
  422. headbgColor:{},
  423. borderr:{
  424. type:Boolean,
  425. default:true
  426. },
  427. parameter:{
  428. type:Object,
  429. default:null
  430. },
  431. highlight:{
  432. type:Boolean,
  433. default:false
  434. },
  435. itemDate:{
  436. type:Object,
  437. default:()=>{}
  438. },
  439. columns:{
  440. type:Array,
  441. default:()=>[]
  442. },
  443. showSummary:{
  444. type:Boolean,
  445. default:false
  446. },
  447. isShowLoadMore:{
  448. type:Boolean,
  449. default:false
  450. },
  451. data:{
  452. type:[Object,Array],
  453. default:()=>[]
  454. },
  455. sumText:{
  456. type:String,
  457. default:'合计'
  458. },
  459. showHeader:{
  460. type:Boolean,
  461. default:true
  462. },
  463. border:{
  464. type:Boolean,
  465. default:false
  466. },
  467. stripe:{
  468. type:Boolean,
  469. default:true
  470. },
  471. fit:{
  472. type:Boolean,
  473. default:false
  474. },
  475. rowKey:[String, Function],
  476. summaryMethod:Function,
  477. pullUpLoading:Function,
  478. formatter:Function,
  479. cellStyle:Function,
  480. cellHeaderStyle:Function,
  481. permissionBtn:Function,
  482. },
  483. computed:{
  484. loadMoreHeight(){
  485. return this.isLoadMore?40:0
  486. },
  487. fixedLeftColumns(){
  488. let arr = []
  489. for(let i=0;i<this.columns.length;i++){
  490. let item = this.columns[i]
  491. if(item.fixed){
  492. arr.push(item)
  493. }else {
  494. break
  495. }
  496. }
  497. return arr
  498. },
  499. itemfilters(){
  500. return(item,ite)=>{
  501. if(item[ite.name]==null){
  502. return ite.emptyString
  503. }
  504. return item[ite.name]
  505. }
  506. },
  507. scrollbarSize(){
  508. // #ifdef H5
  509. return getScrollbarSize()
  510. // #endif
  511. // #ifndef H5
  512. return 0
  513. // #endif
  514. },
  515. isFixedLeft(){
  516. if(!this.columns.length){
  517. return false
  518. }
  519. if(!this.data.length){
  520. return false
  521. }
  522. let [firstArr] = this.columns
  523. return !!firstArr.fixed;
  524. },
  525. transColumns(){
  526. if(this.fit){
  527. this.columns.forEach(column=>{
  528. if(column.type==="operation"&&column.renders){
  529. let str = ''
  530. column.renders.map((item)=>{
  531. str+=item.name
  532. })
  533. column.width = this.getTextWidth(str)+column.renders.length*40
  534. }else if(column.type==="img"){
  535. }else if(column.type==="selection"){
  536. }else{
  537. let arr = [this.getTextWidth(column.label)]
  538. this.data.forEach(data=>{
  539. let str = (data[column.name]+'')
  540. if(str==='undefined'){
  541. arr.push(60)
  542. }else{
  543. let width = this.getTextWidth(str)
  544. arr.push(width)
  545. }
  546. })
  547. column.width = Math.max(...arr)+40
  548. }
  549. })
  550. }
  551. let number = 0
  552. this.columns.forEach((item,index)=>{
  553. if(item.type==="operation"&&item.renders&&!item.width){
  554. let str = ''
  555. item.renders.map((item)=>{
  556. str+=item.name
  557. })
  558. item.width = this.getTextWidth(str)+item.renders.length*40
  559. }
  560. if(item.fixed){
  561. if(index===0){
  562. item.left = 0
  563. number+=item.width
  564. }else {
  565. item.left = number
  566. number+=item.width
  567. }
  568. }
  569. item.emptyString = item.emptyString||'--'
  570. })
  571. return this.columns
  572. },
  573. transData(){
  574. let flag = this.columns.some(item=>item.type==='selection')
  575. this.data.forEach((item,index)=>{
  576. if(flag){
  577. if(item.checked){
  578. if(!this.selectArr.length){
  579. this.selectArr.push(item)
  580. }
  581. }
  582. }
  583. if(this.rowKey){
  584. if(typeof this.rowKey==='function'){
  585. item.key = Object.freeze(this.rowKey(item))||Date.now()
  586. }else {
  587. item.key = Object.freeze(item[this.rowKey])||Date.now()
  588. }
  589. }else {
  590. item.key = index
  591. }
  592. })
  593. if(flag&&this.data.length){
  594. let le = this.data.filter(item=>item.checked).length
  595. if(le){
  596. if(le===this.data.length){
  597. this.checkedAll = true
  598. }else {
  599. this.indeterminate = true
  600. }
  601. }
  602. }
  603. return this.data
  604. },
  605. isHighlight(){
  606. return (item,index)=>{
  607. if(this.rowKey){
  608. return item.key === this.currentRow['key']
  609. }else{
  610. return index === this.currentRowIndex
  611. }
  612. }
  613. },
  614. getHeaderCellStyle() {
  615. return (column, columnIndex,childIndex)=>{
  616. const cellStyle = this.cellHeaderStyle;
  617. if(typeof cellStyle==='function'){
  618. return cellStyle({ column, columnIndex})
  619. }
  620. return {}
  621. }
  622. },
  623. getCellStyle() {
  624. return (row, column, rowIndex, columnIndex)=>{
  625. const cellStyle = this.cellStyle;
  626. if(typeof cellStyle==='function'){
  627. return cellStyle({row, column, rowIndex, columnIndex})
  628. }
  629. return {}
  630. }
  631. },
  632. },
  633. data() {
  634. return {
  635. button:[],
  636. alipayScrollTop:0,
  637. alipayScrollOldTop:0,
  638. alipayFlag:false,
  639. bodyTableLeft:0,
  640. headerTableLeft:0,
  641. lastScrollLeft:0,
  642. isLoadMore:false,
  643. headerFooterTableLeft:0,
  644. leftFiexScrollTop:0,
  645. bodyScrollTop:0,
  646. currentDriver:null,
  647. currentDriver1:null,
  648. bodyTime:null,
  649. currentRowIndex:null,
  650. currentRow: {},
  651. bodyTime1:null,
  652. headerTime:null,
  653. debounceTime:null,
  654. operation:{},
  655. completedFlag:false,
  656. selectArr:[],
  657. indeterminate:false,
  658. checkedAll:false,
  659. completeLoading:false,
  660. aliTime:null,
  661. }
  662. },
  663. created(){
  664. },
  665. mounted(){
  666. },
  667. methods: {
  668. kayType(value,datas){
  669. var actions = [];
  670. var idx=0;
  671. Object.keys(datas).some((key) => {
  672. if (datas[key].value == ('' + value)) {
  673. actions.push(datas[key].label);
  674. return true;
  675. }
  676. })
  677. return actions.join('')
  678. },
  679. getMove(){
  680. },
  681. formatterAction(row,column,rowIndex,columnIndex){
  682. if(column.formatter&&typeof this.formatter==='function'){
  683. return this.formatter(row,column,rowIndex,columnIndex)
  684. }
  685. return (row[column.name]==null||row[column.name]==='')?column.emptyString:row[column.name]
  686. },
  687. permission(item,renders,index){
  688. if(this.permissionBtn&&typeof this.permissionBtn==='function'){
  689. return this.permissionBtn(item,renders,index)
  690. }
  691. return renders
  692. },
  693. pullUpCompleteLoading(type){
  694. this.isLoadMore = false
  695. if(type==='ok'){
  696. this.completeLoading = true
  697. }
  698. },
  699. scrollAlipay(e){
  700. if(!this.alipayScrollOldTop){
  701. this.alipayScrollOldTop = e.detail.scrollTop
  702. }
  703. this.aliTime&&clearTimeout(this.aliTime)
  704. this.aliTime = setTimeout(()=>{
  705. if(this.alipayFlag&&e.detail.scrollTop>this.alipayScrollOldTop){
  706. this.pullLoad()
  707. }
  708. this.alipayFlag = false
  709. this.alipayScrollOldTop = null
  710. },500)
  711. },
  712. pullLoad(){
  713. if(this.isShowLoadMore){
  714. this.isLoadMore = true
  715. this.$emit('pullUpLoading')
  716. let that = this
  717. this.pullUpLoading&&this.pullUpLoading.call(this.$parent.$parent, (type)=>{
  718. that.isLoadMore = false
  719. if(type==='ok'){
  720. that.completeLoading=true
  721. }
  722. })
  723. }
  724. },
  725. scrolltolower(e){
  726. this.alipayFlag = true
  727. if(e.detail.direction==='bottom'){
  728. this.pullLoad()
  729. }
  730. // this.pullUpLoading.call(this.$parent)
  731. },
  732. previewImage(item,url,current){
  733. uni.previewImage({
  734. current,
  735. urls:[url]
  736. })
  737. },
  738. resetHighlight(){
  739. this.currentRowIndex = null
  740. this.currentRow = {}
  741. },
  742. rowClick(row,index){
  743. if(this.highlight){
  744. this.currentRowIndex = index
  745. this.currentRow = row
  746. this.$emit('currentChange',row,index)
  747. }
  748. this.$emit('rowClick',row,index)
  749. },
  750. checkboxSelectedAll(e){
  751. this.indeterminate = false
  752. if(e.checked){
  753. this.selectArr = []
  754. this.checkedAll = true
  755. this.data.forEach(item=>{
  756. // this.$set(item,'checked',true)
  757. item.checked = true
  758. this.selectArr.push(item)
  759. })
  760. }else{
  761. this.checkedAll = false
  762. this.data.forEach(item=>{
  763. this.$set(item,'checked',false)
  764. })
  765. this.selectArr = []
  766. }
  767. // #ifndef H5 || APP-PLUS
  768. this.$forceUpdate()
  769. // #endif
  770. this.$emit('toggleAllSelection',e.checked,this.selectArr)
  771. },
  772. checkboxSelected(e,item){
  773. // #ifdef H5 || APP-PLUS
  774. this.$set(item,'checked',e.checked)
  775. // #endif
  776. // #ifndef H5 || APP-PLUS
  777. this.data.forEach(item=>{
  778. if(item.key===e.data.key){
  779. item.checked = e.checked
  780. }
  781. })
  782. // #endif
  783. item.checked = e.checked
  784. e.data.checked = e.checked
  785. if(e.checked){
  786. this.selectArr.push(e.data)
  787. }else{
  788. this.selectArr = this.selectArr.filter(item=>item.key!==e.data.key)
  789. }
  790. if(this.selectArr.length===this.transData.length){
  791. this.indeterminate = false
  792. this.checkedAll = true
  793. }else{
  794. this.indeterminate = true
  795. this.checkedAll = false
  796. }
  797. if(!this.selectArr.length){
  798. this.checkedAll = false
  799. this.indeterminate = false
  800. }
  801. // #ifndef H5 || APP-PLUS
  802. this.$forceUpdate()
  803. // #endif
  804. this.$emit('toggleRowSelection',e.checked,this.selectArr)
  805. },
  806. itemFilter(item,ite){
  807. if(ite.filters&&ite.name){
  808. let key = item[ite.name]
  809. return ite.filters[key]||''
  810. }
  811. return item[ite.name]||ite.emptyString
  812. },
  813. // 默认字体为微软雅黑 Microsoft YaHei,字体大小为 14px
  814. getTextWidth(str) {
  815. if(str.length<3){
  816. return 80
  817. }
  818. let regx = /^[0-9]+.?[0-9]*$/
  819. let flexWidth = 0
  820. for (const char of str) {
  821. if ((char >= 'A' && char <= 'Z') || (char >= 'a' && char <= 'z')) {
  822. // 如果是英文字符,为字符分配8个单位宽度
  823. flexWidth += 20
  824. } else if (char >= '\u4e00' && char <= '\u9fa5') {
  825. // 如果是中文字符,为字符分配15个单位宽度
  826. flexWidth += 30
  827. } else if(regx.test(char)){
  828. flexWidth += 18
  829. }else {
  830. // 其他种类字符,为字符分配8个单位宽度
  831. flexWidth += 14
  832. }
  833. }
  834. return flexWidth
  835. },
  836. width(item){
  837. return `${item.width?item.width:'200'}rpx`
  838. },
  839. showStripe(index){
  840. if(this.currentDriver)return
  841. if(this.stripe){
  842. return (index % 2) != 0?'odd':'even'
  843. }else{
  844. return ''
  845. }
  846. },
  847. //验证字符串是否是数字
  848. checkNumber(theObj) {
  849. var reg = /^[0-9]+.?[0-9]*$/;
  850. if (reg.test(theObj)) {
  851. return true;
  852. }
  853. return false;
  854. },
  855. isDate(data){
  856. if(isNaN(data)&&!isNaN(Date.parse(data))){
  857. return true
  858. }
  859. return false
  860. },
  861. sortAction(item,index){
  862. if(!item.sorter){return false}
  863. this.$set(item,'sorterMode',item.sorterMode==='_asc'?'_desc':'_asc')
  864. if(item.sorter==='custom'){
  865. this.$emit('sort-change',item,item.sorterMode.replace('_',''),index)
  866. }else {
  867. this.sortData(item)
  868. }
  869. // #ifndef H5 || APP-PLUS
  870. this.$forceUpdate()
  871. // #endif
  872. },
  873. sortData(item){
  874. let key = item.name
  875. if(item.sorterMode==='_asc'){
  876. this.data.sort((a,b)=>{
  877. if(this.checkNumber(a[key])){
  878. return a[key]-b[key]
  879. }
  880. if(this.isDate(a[key])){
  881. let a1 = new Date(a[key]).getTime()
  882. let b1 = new Date(b[key]).getTime()
  883. return a1-b1
  884. }
  885. })
  886. }else {
  887. this.data.sort((a,b)=>{
  888. if(this.checkNumber(a[key])){
  889. return b[key]-a[key]
  890. }
  891. if(this.isDate(a[key])){
  892. let a1 = new Date(a[key]).getTime()
  893. let b1 = new Date(b[key]).getTime()
  894. return b1-a1
  895. }
  896. })
  897. }
  898. },
  899. throttle(method,delay=60){
  900. let time = null
  901. return (...args)=>{
  902. if(!time){
  903. time = setTimeout(()=>{
  904. method(...args)
  905. time = null;
  906. },delay)
  907. }
  908. }
  909. },
  910. debounce(method,delay=1000){
  911. return (...args)=>{
  912. this.debounceTime&&clearTimeout(this.debounceTime)
  913. this.debounceTime = setTimeout(()=>{
  914. method(...args)
  915. },delay)
  916. }
  917. },
  918. handleBodyScroll(e){
  919. if(this.currentDriver&&this.currentDriver!==e.currentTarget.id)return
  920. this.currentDriver = e.currentTarget.id
  921. this.headerTableLeft = e.detail.scrollLeft
  922. this.headerFooterTableLeft = e.detail.scrollLeft
  923. this.leftFiexScrollTop = e.detail.scrollTop
  924. this.bodyTime&&clearTimeout(this.bodyTime)
  925. this.bodyTime = setTimeout(()=>{
  926. this.currentDriver=null
  927. },200)
  928. },
  929. leftFixedScrollAction(e){
  930. if(this.currentDriver&&this.currentDriver!==e.currentTarget.id)return
  931. this.currentDriver = e.currentTarget.id
  932. this.bodyScrollTop = e.detail.scrollTop
  933. this.bodyTime&&clearTimeout(this.bodyTime)
  934. this.bodyTime = setTimeout(()=>{
  935. this.currentDriver=null
  936. },200)
  937. },
  938. scrollToLeft(e){
  939. if(this.currentDriver1&&this.currentDriver1!==e.currentTarget.id)return
  940. this.currentDriver1 = e.currentTarget.id
  941. if(e.detail.direction==='left'&&this.headerTableLeft<10){
  942. this.headerTableLeft = 0
  943. }else if(e.detail.direction==='top'&&this.leftFiexScrollTop<10){
  944. this.leftFiexScrollTop = 0
  945. }
  946. this.bodyTime&&clearTimeout(this.bodyTime)
  947. this.bodyTime = setTimeout(()=>{
  948. this.currentDriver1=null
  949. },200)
  950. },
  951. scrollToFixedLeft(e){
  952. if(this.currentDriver1&&this.currentDriver1!==e.currentTarget.id)return
  953. this.currentDriver1 = e.currentTarget.id
  954. if(e.detail.direction==='top'&&this.bodyScrollTop<10){
  955. this.bodyScrollTop = 0
  956. }
  957. this.bodyTime&&clearTimeout(this.bodyTime)
  958. this.bodyTime = setTimeout(()=>{
  959. this.currentDriver1=null
  960. },200)
  961. },
  962. handleTableScrollLeft(e,type){
  963. if(this.currentDriver&&this.currentDriver!==e.currentTarget.id)return
  964. this.currentDriver = e.currentTarget.id
  965. this.bodyTableLeft = e.detail.scrollLeft
  966. this.headerFooterTableLeft = e.detail.scrollLeft
  967. this.bodyTime&&clearTimeout(this.bodyTime)
  968. this.bodyTime = setTimeout(()=>{
  969. this.currentDriver=null
  970. },200)
  971. },
  972. handleFooterTableScrollLeft(e){
  973. if(this.currentDriver&&this.currentDriver!==e.currentTarget.id)return
  974. this.currentDriver = e.currentTarget.id
  975. this.bodyTableLeft = e.detail.scrollLeft
  976. this.headerTableLeft = e.detail.scrollLeft
  977. this.bodyTime&&clearTimeout(this.bodyTime)
  978. this.bodyTime = setTimeout(()=>{
  979. this.currentDriver=null
  980. },200)
  981. }
  982. }
  983. }
  984. </script>
  985. <style lang="scss">
  986. .zb-table-fixed-left{
  987. /*去除左边滚动条 */
  988. scroll-view ::-webkit-scrollbar {
  989. display: none !important;
  990. width: 0 !important;
  991. height: 0 !important;
  992. -webkit-appearance: none;
  993. background: transparent;
  994. }
  995. }
  996. .zb-table-header{
  997. ///*去除头部滚动条 */
  998. scroll-view ::-webkit-scrollbar {
  999. display: none !important;
  1000. width: 0 !important;
  1001. height: 0 !important;
  1002. -webkit-appearance: none;
  1003. background: transparent;
  1004. }
  1005. }
  1006. </style>
  1007. <style lang="scss" scoped>
  1008. .sorter-table{
  1009. position: absolute;
  1010. right: 2rpx;
  1011. top:50%;
  1012. transform:translateY(-50%);
  1013. .sorter-table-icon{
  1014. width: 0;
  1015. height: 0;
  1016. color: #dcdcdc;
  1017. border-right: 8rpx solid transparent;
  1018. border-left: 8rpx solid transparent;
  1019. }
  1020. .sorter-table-icon:first-child{
  1021. border-bottom: 14rpx solid currentColor;
  1022. }
  1023. .sorter-table-icon:last-child{
  1024. margin-top: 3rpx;
  1025. border-top: 14rpx solid currentColor;
  1026. }
  1027. .sorting_desc{
  1028. color: #2979ff;
  1029. }
  1030. .sorting_asc{
  1031. color: #2979ff;
  1032. }
  1033. }
  1034. .checkbox-item{
  1035. display: flex;align-items: center;justify-content: center;width: 100%;height: 100%
  1036. }
  1037. .no-data{
  1038. width: 100%;
  1039. height: 80rpx;
  1040. display: flex;
  1041. justify-content: center;
  1042. align-items: center;
  1043. // border-bottom: 1px solid #e8e8e8;
  1044. }
  1045. .item-th{
  1046. position: relative;
  1047. flex-shrink: 0;
  1048. width: 200rpx;
  1049. overflow-wrap: break-word;
  1050. color: #222327;
  1051. font-weight: bold;
  1052. border-bottom: 2rpx solid #e8e8e8;
  1053. transition: background 0.3s;
  1054. padding-right: 8rpx;
  1055. word-break:keep-all; /* 不换行 */
  1056. white-space:nowrap; /* 不换行 */
  1057. overflow:hidden; /* 内容超出宽度时隐藏超出部分的内容 */
  1058. text-overflow:ellipsis; /* 当对象内文本溢出时显示省略标记(...) ;需与overflow:hidden;一起使用。*/
  1059. overflow-wrap: break-word;
  1060. &.nborder{
  1061. border: none;
  1062. }
  1063. }
  1064. .zb-table{
  1065. height: 100%;
  1066. overflow: hidden;
  1067. width: 100%;
  1068. display: flex;
  1069. flex-direction: column;
  1070. font-size: 28rpx;
  1071. position: relative;
  1072. .zb-table-content{
  1073. //height: 100%;
  1074. //flex: 1;
  1075. position: relative;
  1076. overflow: hidden;
  1077. }
  1078. .zb-table-fixed{
  1079. min-width: 100%;
  1080. }
  1081. .zb-table-body{
  1082. position: relative;
  1083. background: #fff;
  1084. transition: opacity 0.3s;
  1085. }
  1086. .item-tr{
  1087. display: flex;
  1088. //height: 41px;
  1089. }
  1090. .item-td{
  1091. flex-shrink: 0;
  1092. width:200rpx;
  1093. padding-left: 8rpx;
  1094. height: 64rpx;
  1095. line-height: 64rpx;
  1096. padding-right: 8rpx;
  1097. font-weight: 500;
  1098. color: #222327;
  1099. box-sizing: border-box;
  1100. word-break:keep-all; /* 不换行 */
  1101. white-space:nowrap; /* 不换行 */
  1102. overflow:hidden; /* 内容超出宽度时隐藏超出部分的内容 */
  1103. text-overflow:ellipsis; /* 当对象内文本溢出时显示省略标记(...) ;需与overflow:hidden;一起使用。*/
  1104. overflow-wrap: break-word;
  1105. border-bottom: 2rpx solid #e8e8e8;
  1106. &.nborder{
  1107. border: none;
  1108. }
  1109. //transition: background 0.3s;
  1110. }
  1111. .zb-table-fixed-left .zb-table-header{
  1112. overflow-y: hidden;
  1113. }
  1114. .zb-table-header {
  1115. overflow: hidden;
  1116. // background: #fafafa;
  1117. .item-th{
  1118. padding-left: 8rpx;
  1119. line-height: 78rpx;
  1120. height: 80rpx;
  1121. //display: flex;
  1122. //align-items: center;
  1123. box-sizing: border-box;
  1124. }
  1125. }
  1126. .zb-table-fixed-left .zb-table-fixed{
  1127. background: #fff;
  1128. }
  1129. .zb-table-fixed-right .zb-table-fixed{
  1130. background: #fff;
  1131. }
  1132. .zb-table-body-inner{
  1133. height: 100%;
  1134. // overflow: scroll;
  1135. }
  1136. .zb-table-fixed-left{
  1137. position: absolute;
  1138. top: 0;
  1139. z-index: 1;
  1140. overflow: hidden;
  1141. border-radius: 0;
  1142. height: 100%;
  1143. //transition: box-shadow 0.3s ease;
  1144. }
  1145. .odd{
  1146. background-color:rgba(249,249,249,0.6);
  1147. //height: 100%;
  1148. width: 100%;
  1149. }
  1150. .even{
  1151. background-color:white ;
  1152. //height: 100%;
  1153. width: 100%;
  1154. }
  1155. }
  1156. .scroll-left-fixed{
  1157. .zb-table-fixed-left {
  1158. left: 0;
  1159. box-shadow: 12rpx 0 12rpx -8rpx #ccc;
  1160. }
  1161. }
  1162. .zb-table-applet{
  1163. height: 100%;
  1164. //overflow: hidden;
  1165. width: 100%;
  1166. position: relative;
  1167. display: flex;
  1168. flex-direction: column;
  1169. font-size: 28rpx;
  1170. .zb-table-content{
  1171. //height: 100%;
  1172. flex: 1;
  1173. overflow: hidden;
  1174. position: relative;
  1175. }
  1176. .zb-table-fixed{
  1177. min-width: 100%;
  1178. width: fit-content;
  1179. }
  1180. .zb-table-body{
  1181. position: relative;
  1182. background: #fff;
  1183. transition: opacity 0.3s;
  1184. }
  1185. .item-tr{
  1186. display: flex;
  1187. //height: 41px;
  1188. }
  1189. .item-td{
  1190. flex-shrink: 0;
  1191. width: 200rpx;
  1192. padding-left: 8rpx;
  1193. height: 80rpx;
  1194. line-height: 80rpx;
  1195. padding-right:8rpx;
  1196. box-sizing: border-box;
  1197. word-break:keep-all; /* 不换行 */
  1198. white-space:nowrap; /* 不换行 */
  1199. overflow:hidden; /* 内容超出宽度时隐藏超出部分的内容 */
  1200. text-overflow:ellipsis; /* 当对象内文本溢出时显示省略标记(...) ;需与overflow:hidden;一起使用。*/
  1201. overflow-wrap: break-word;
  1202. border-bottom: 2rpx solid #e8e8e8;
  1203. //transition: background 0.3s;
  1204. }
  1205. .zb-table-header {
  1206. //overflow: hidden;
  1207. position: sticky;
  1208. top: 0;
  1209. z-index: 2;
  1210. //width: fit-content;
  1211. .item-th{
  1212. padding-left: 8rpx;
  1213. line-height: 78rpx;
  1214. height: 80rpx;
  1215. box-sizing: border-box;
  1216. background: #fafafa;
  1217. }
  1218. .zb-stick-side{
  1219. position: sticky;
  1220. top: 0;
  1221. left: 0;
  1222. z-index: 2;
  1223. //border-right: solid 1rpx #dbdbdb;
  1224. box-sizing: border-box;
  1225. background: #fafafa;
  1226. //box-shadow: 6px 0 6px -4px #ccc;
  1227. }
  1228. }
  1229. .zb-table-fixed-left .zb-table-fixed{
  1230. background: #fff;
  1231. }
  1232. .zb-table-fixed-right .zb-table-fixed{
  1233. background: #fff;
  1234. }
  1235. .zb-table-fixed-header .zb-table-body-inner{
  1236. height: 100%;
  1237. // overflow: scroll;
  1238. }
  1239. .zb-table-fixed-left{
  1240. position: absolute;
  1241. top: 0;
  1242. z-index: 1;
  1243. overflow: hidden;
  1244. border-radius: 0;
  1245. height: 100%;
  1246. //transition: box-shadow 0.3s ease;
  1247. }
  1248. .scroll-left-fixed{
  1249. .zb-table-fixed-left {
  1250. left: 0;
  1251. box-shadow: 12rpx 0 12rpx -8rpx #ccc;
  1252. }
  1253. }
  1254. .odd{
  1255. background-color:rgba(249,249,249,0.6);
  1256. //height: 100%;
  1257. width: 100%;
  1258. }
  1259. .even{
  1260. background-color:white ;
  1261. //height: 100%;
  1262. width: 100%;
  1263. }
  1264. .zb-table-tbody {
  1265. .zb-stick-side{
  1266. position: sticky;
  1267. left: 0;
  1268. z-index: 1;
  1269. box-sizing: border-box;
  1270. background:white;
  1271. //box-shadow: 6px 0 6px -2px #ccc;
  1272. }
  1273. .odd{
  1274. background:#f9f9f9;
  1275. //height: 100%;
  1276. width: 100%;
  1277. }
  1278. .even{
  1279. background:white ;
  1280. //height: 100%;
  1281. width: 100%;
  1282. }
  1283. }
  1284. .current-row{
  1285. .item-td{
  1286. background-color: #ecf5ff;
  1287. }
  1288. }
  1289. }
  1290. .current-row{
  1291. .item-td{
  1292. background-color: #ecf5ff;
  1293. }
  1294. }
  1295. .zb-table-header{
  1296. height: 80rpx;
  1297. }
  1298. </style>