zb-tablesearch.vue 41 KB

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