zb-tablesearch.vue 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333
  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. }else{
  590. var indexNum = (this.selectArr || []).findIndex((ite) => ite.userId === item.userId);
  591. if(indexNum!=-1){
  592. this.selectArr[indexNum].type=item.type
  593. }
  594. }
  595. }else{
  596. var indexNum = (this.selectArr || []).findIndex((ite) => ite.userId === item.userId);
  597. if(indexNum!=-1){
  598. this.selectArr.splice(indexNum,1)
  599. }
  600. }
  601. }
  602. if(this.rowKey){
  603. if(typeof this.rowKey==='function'){
  604. item.key = Object.freeze(this.rowKey(item))||Date.now()
  605. }else {
  606. item.key = Object.freeze(item[this.rowKey])||Date.now()
  607. }
  608. }else {
  609. item.key = index
  610. }
  611. })
  612. if(flag&&this.data.length){
  613. let le = this.data.filter(item=>item.checked).length
  614. if(le){
  615. if(le===this.data.length){
  616. this.checkedAll = true
  617. }else {
  618. this.indeterminate = true
  619. }
  620. }
  621. }
  622. return this.data
  623. },
  624. isHighlight(){
  625. return (item,index)=>{
  626. if(this.rowKey){
  627. return item.key === this.currentRow['key']
  628. }else{
  629. return index === this.currentRowIndex
  630. }
  631. }
  632. },
  633. getHeaderCellStyle() {
  634. return (column, columnIndex,childIndex)=>{
  635. const cellStyle = this.cellHeaderStyle;
  636. if(typeof cellStyle==='function'){
  637. return cellStyle({ column, columnIndex})
  638. }
  639. return {}
  640. }
  641. },
  642. getCellStyle() {
  643. return (row, column, rowIndex, columnIndex)=>{
  644. const cellStyle = this.cellStyle;
  645. if(typeof cellStyle==='function'){
  646. return cellStyle({row, column, rowIndex, columnIndex})
  647. }
  648. return {}
  649. }
  650. },
  651. },
  652. data() {
  653. return {
  654. button:[],
  655. alipayScrollTop:0,
  656. alipayScrollOldTop:0,
  657. alipayFlag:false,
  658. bodyTableLeft:0,
  659. headerTableLeft:0,
  660. lastScrollLeft:0,
  661. isLoadMore:false,
  662. headerFooterTableLeft:0,
  663. leftFiexScrollTop:0,
  664. bodyScrollTop:0,
  665. currentDriver:null,
  666. currentDriver1:null,
  667. bodyTime:null,
  668. currentRowIndex:null,
  669. currentRow: {},
  670. bodyTime1:null,
  671. headerTime:null,
  672. debounceTime:null,
  673. operation:{},
  674. completedFlag:false,
  675. selectArr:[],
  676. indeterminate:false,
  677. checkedAll:false,
  678. completeLoading:false,
  679. aliTime:null,
  680. }
  681. },
  682. created(){
  683. },
  684. mounted(){
  685. },
  686. methods: {
  687. kayType(value,datas){
  688. var actions = [];
  689. var idx=0;
  690. Object.keys(datas).some((key) => {
  691. if (datas[key].value == ('' + value)) {
  692. actions.push(datas[key].label);
  693. return true;
  694. }
  695. })
  696. return actions.join('')
  697. },
  698. getMove(){
  699. },
  700. formatterAction(row,column,rowIndex,columnIndex){
  701. if(column.formatter&&typeof this.formatter==='function'){
  702. return this.formatter(row,column,rowIndex,columnIndex)
  703. }
  704. return (row[column.name]==null||row[column.name]==='')?column.emptyString:row[column.name]
  705. },
  706. permission(item,renders,index){
  707. if(this.permissionBtn&&typeof this.permissionBtn==='function'){
  708. return this.permissionBtn(item,renders,index)
  709. }
  710. return renders
  711. },
  712. pullUpCompleteLoading(type){
  713. this.isLoadMore = false
  714. if(type==='ok'){
  715. this.completeLoading = true
  716. }
  717. },
  718. scrollAlipay(e){
  719. if(!this.alipayScrollOldTop){
  720. this.alipayScrollOldTop = e.detail.scrollTop
  721. }
  722. this.aliTime&&clearTimeout(this.aliTime)
  723. this.aliTime = setTimeout(()=>{
  724. if(this.alipayFlag&&e.detail.scrollTop>this.alipayScrollOldTop){
  725. this.pullLoad()
  726. }
  727. this.alipayFlag = false
  728. this.alipayScrollOldTop = null
  729. },500)
  730. },
  731. pullLoad(){
  732. if(this.isShowLoadMore){
  733. this.isLoadMore = true
  734. this.$emit('pullUpLoading')
  735. let that = this
  736. this.pullUpLoading&&this.pullUpLoading.call(this.$parent.$parent, (type)=>{
  737. that.isLoadMore = false
  738. if(type==='ok'){
  739. that.completeLoading=true
  740. }
  741. })
  742. }
  743. },
  744. scrolltolower(e){
  745. this.alipayFlag = true
  746. if(e.detail.direction==='bottom'){
  747. this.pullLoad()
  748. }
  749. // this.pullUpLoading.call(this.$parent)
  750. },
  751. previewImage(item,url,current){
  752. uni.previewImage({
  753. current,
  754. urls:[url]
  755. })
  756. },
  757. resetHighlight(){
  758. this.currentRowIndex = null
  759. this.currentRow = {}
  760. },
  761. rowClick(row,index){
  762. if(this.highlight){
  763. this.currentRowIndex = index
  764. this.currentRow = row
  765. this.$emit('currentChange',row,index)
  766. }
  767. this.$emit('rowClick',row,index)
  768. },
  769. checkboxSelectedAll(e){
  770. this.indeterminate = false
  771. if(e.checked){
  772. this.selectArr = []
  773. this.checkedAll = true
  774. this.data.forEach(item=>{
  775. // this.$set(item,'checked',true)
  776. item.checked = true
  777. this.selectArr.push(item)
  778. })
  779. }else{
  780. this.checkedAll = false
  781. this.data.forEach(item=>{
  782. this.$set(item,'checked',false)
  783. })
  784. this.selectArr = []
  785. }
  786. // #ifndef H5 || APP-PLUS
  787. this.$forceUpdate()
  788. // #endif
  789. this.$emit('toggleAllSelection',e.checked,this.selectArr)
  790. },
  791. checkboxSelected(e,item){
  792. // #ifdef H5 || APP-PLUS
  793. this.$set(item,'checked',e.checked)
  794. // #endif
  795. // #ifndef H5 || APP-PLUS
  796. this.data.forEach(item=>{
  797. if(item.key===e.data.key){
  798. item.checked = e.checked
  799. }
  800. })
  801. // #endif
  802. item.checked = e.checked
  803. e.data.checked = e.checked
  804. if(e.checked){
  805. this.selectArr.push(e.data)
  806. }else{
  807. this.selectArr = this.selectArr.filter(item=>item.userId!==e.data.userId)
  808. }
  809. if(this.selectArr.length===this.transData.length){
  810. this.indeterminate = false
  811. this.checkedAll = true
  812. }else{
  813. this.indeterminate = true
  814. this.checkedAll = false
  815. }
  816. if(!this.selectArr.length){
  817. this.checkedAll = false
  818. this.indeterminate = false
  819. }
  820. // #ifndef H5 || APP-PLUS
  821. this.$forceUpdate()
  822. // #endif
  823. this.$emit('toggleRowSelection',e.checked,this.selectArr,e)
  824. },
  825. itemFilter(item,ite){
  826. if(ite.filters&&ite.name){
  827. let key = item[ite.name]
  828. return ite.filters[key]||''
  829. }
  830. return item[ite.name]||ite.emptyString
  831. },
  832. // 默认字体为微软雅黑 Microsoft YaHei,字体大小为 14px
  833. getTextWidth(str) {
  834. if(str.length<3){
  835. return 80
  836. }
  837. let regx = /^[0-9]+.?[0-9]*$/
  838. let flexWidth = 0
  839. for (const char of str) {
  840. if ((char >= 'A' && char <= 'Z') || (char >= 'a' && char <= 'z')) {
  841. // 如果是英文字符,为字符分配8个单位宽度
  842. flexWidth += 20
  843. } else if (char >= '\u4e00' && char <= '\u9fa5') {
  844. // 如果是中文字符,为字符分配15个单位宽度
  845. flexWidth += 30
  846. } else if(regx.test(char)){
  847. flexWidth += 18
  848. }else {
  849. // 其他种类字符,为字符分配8个单位宽度
  850. flexWidth += 14
  851. }
  852. }
  853. return flexWidth
  854. },
  855. width(item){
  856. return `${item.width?item.width:'200'}rpx`
  857. },
  858. showStripe(index){
  859. if(this.currentDriver)return
  860. if(this.stripe){
  861. return (index % 2) != 0?'odd':'even'
  862. }else{
  863. return ''
  864. }
  865. },
  866. //验证字符串是否是数字
  867. checkNumber(theObj) {
  868. var reg = /^[0-9]+.?[0-9]*$/;
  869. if (reg.test(theObj)) {
  870. return true;
  871. }
  872. return false;
  873. },
  874. isDate(data){
  875. if(isNaN(data)&&!isNaN(Date.parse(data))){
  876. return true
  877. }
  878. return false
  879. },
  880. sortAction(item,index){
  881. if(!item.sorter){return false}
  882. this.$set(item,'sorterMode',item.sorterMode==='_asc'?'_desc':'_asc')
  883. if(item.sorter==='custom'){
  884. this.$emit('sort-change',item,item.sorterMode.replace('_',''),index)
  885. }else {
  886. this.sortData(item)
  887. }
  888. // #ifndef H5 || APP-PLUS
  889. this.$forceUpdate()
  890. // #endif
  891. },
  892. sortData(item){
  893. let key = item.name
  894. if(item.sorterMode==='_asc'){
  895. this.data.sort((a,b)=>{
  896. if(this.checkNumber(a[key])){
  897. return a[key]-b[key]
  898. }
  899. if(this.isDate(a[key])){
  900. let a1 = new Date(a[key]).getTime()
  901. let b1 = new Date(b[key]).getTime()
  902. return a1-b1
  903. }
  904. })
  905. }else {
  906. this.data.sort((a,b)=>{
  907. if(this.checkNumber(a[key])){
  908. return b[key]-a[key]
  909. }
  910. if(this.isDate(a[key])){
  911. let a1 = new Date(a[key]).getTime()
  912. let b1 = new Date(b[key]).getTime()
  913. return b1-a1
  914. }
  915. })
  916. }
  917. },
  918. throttle(method,delay=60){
  919. let time = null
  920. return (...args)=>{
  921. if(!time){
  922. time = setTimeout(()=>{
  923. method(...args)
  924. time = null;
  925. },delay)
  926. }
  927. }
  928. },
  929. debounce(method,delay=1000){
  930. return (...args)=>{
  931. this.debounceTime&&clearTimeout(this.debounceTime)
  932. this.debounceTime = setTimeout(()=>{
  933. method(...args)
  934. },delay)
  935. }
  936. },
  937. handleBodyScroll(e){
  938. if(this.currentDriver&&this.currentDriver!==e.currentTarget.id)return
  939. this.currentDriver = e.currentTarget.id
  940. this.headerTableLeft = e.detail.scrollLeft
  941. this.headerFooterTableLeft = e.detail.scrollLeft
  942. this.leftFiexScrollTop = e.detail.scrollTop
  943. this.bodyTime&&clearTimeout(this.bodyTime)
  944. this.bodyTime = setTimeout(()=>{
  945. this.currentDriver=null
  946. },200)
  947. },
  948. leftFixedScrollAction(e){
  949. if(this.currentDriver&&this.currentDriver!==e.currentTarget.id)return
  950. this.currentDriver = e.currentTarget.id
  951. this.bodyScrollTop = e.detail.scrollTop
  952. this.bodyTime&&clearTimeout(this.bodyTime)
  953. this.bodyTime = setTimeout(()=>{
  954. this.currentDriver=null
  955. },200)
  956. },
  957. scrollToLeft(e){
  958. if(this.currentDriver1&&this.currentDriver1!==e.currentTarget.id)return
  959. this.currentDriver1 = e.currentTarget.id
  960. if(e.detail.direction==='left'&&this.headerTableLeft<10){
  961. this.headerTableLeft = 0
  962. }else if(e.detail.direction==='top'&&this.leftFiexScrollTop<10){
  963. this.leftFiexScrollTop = 0
  964. }
  965. this.bodyTime&&clearTimeout(this.bodyTime)
  966. this.bodyTime = setTimeout(()=>{
  967. this.currentDriver1=null
  968. },200)
  969. },
  970. scrollToFixedLeft(e){
  971. if(this.currentDriver1&&this.currentDriver1!==e.currentTarget.id)return
  972. this.currentDriver1 = e.currentTarget.id
  973. if(e.detail.direction==='top'&&this.bodyScrollTop<10){
  974. this.bodyScrollTop = 0
  975. }
  976. this.bodyTime&&clearTimeout(this.bodyTime)
  977. this.bodyTime = setTimeout(()=>{
  978. this.currentDriver1=null
  979. },200)
  980. },
  981. handleTableScrollLeft(e,type){
  982. if(this.currentDriver&&this.currentDriver!==e.currentTarget.id)return
  983. this.currentDriver = e.currentTarget.id
  984. this.bodyTableLeft = e.detail.scrollLeft
  985. this.headerFooterTableLeft = e.detail.scrollLeft
  986. this.bodyTime&&clearTimeout(this.bodyTime)
  987. this.bodyTime = setTimeout(()=>{
  988. this.currentDriver=null
  989. },200)
  990. },
  991. handleFooterTableScrollLeft(e){
  992. if(this.currentDriver&&this.currentDriver!==e.currentTarget.id)return
  993. this.currentDriver = e.currentTarget.id
  994. this.bodyTableLeft = e.detail.scrollLeft
  995. this.headerTableLeft = e.detail.scrollLeft
  996. this.bodyTime&&clearTimeout(this.bodyTime)
  997. this.bodyTime = setTimeout(()=>{
  998. this.currentDriver=null
  999. },200)
  1000. }
  1001. }
  1002. }
  1003. </script>
  1004. <style lang="scss">
  1005. .zb-table-fixed-left{
  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. .zb-table-header{
  1016. ///*去除头部滚动条 */
  1017. scroll-view ::-webkit-scrollbar {
  1018. display: none !important;
  1019. width: 0 !important;
  1020. height: 0 !important;
  1021. -webkit-appearance: none;
  1022. background: transparent;
  1023. }
  1024. }
  1025. </style>
  1026. <style lang="scss" scoped>
  1027. .sorter-table{
  1028. position: absolute;
  1029. right: 2rpx;
  1030. top:50%;
  1031. transform:translateY(-50%);
  1032. .sorter-table-icon{
  1033. width: 0;
  1034. height: 0;
  1035. color: #dcdcdc;
  1036. border-right: 8rpx solid transparent;
  1037. border-left: 8rpx solid transparent;
  1038. }
  1039. .sorter-table-icon:first-child{
  1040. border-bottom: 14rpx solid currentColor;
  1041. }
  1042. .sorter-table-icon:last-child{
  1043. margin-top: 3rpx;
  1044. border-top: 14rpx solid currentColor;
  1045. }
  1046. .sorting_desc{
  1047. color: #2979ff;
  1048. }
  1049. .sorting_asc{
  1050. color: #2979ff;
  1051. }
  1052. }
  1053. .checkbox-item{
  1054. display: flex;align-items: center;justify-content: center;width: 100%;height: 100%
  1055. }
  1056. .no-data{
  1057. width: 100%;
  1058. height: 80rpx;
  1059. display: flex;
  1060. justify-content: center;
  1061. align-items: center;
  1062. // border-bottom: 1px solid #e8e8e8;
  1063. }
  1064. .item-th{
  1065. position: relative;
  1066. flex-shrink: 0;
  1067. width: 200rpx;
  1068. overflow-wrap: break-word;
  1069. color: #222327;
  1070. font-weight: bold;
  1071. border-bottom: 2rpx solid #e8e8e8;
  1072. transition: background 0.3s;
  1073. padding-right: 8rpx;
  1074. word-break:keep-all; /* 不换行 */
  1075. white-space:nowrap; /* 不换行 */
  1076. overflow:hidden; /* 内容超出宽度时隐藏超出部分的内容 */
  1077. text-overflow:ellipsis; /* 当对象内文本溢出时显示省略标记(...) ;需与overflow:hidden;一起使用。*/
  1078. overflow-wrap: break-word;
  1079. &.nborder{
  1080. border: none;
  1081. }
  1082. }
  1083. .zb-table{
  1084. height: 100%;
  1085. overflow: hidden;
  1086. width: 100%;
  1087. display: flex;
  1088. flex-direction: column;
  1089. font-size: 28rpx;
  1090. position: relative;
  1091. .zb-table-content{
  1092. //height: 100%;
  1093. //flex: 1;
  1094. position: relative;
  1095. overflow: hidden;
  1096. }
  1097. .zb-table-fixed{
  1098. min-width: 100%;
  1099. }
  1100. .zb-table-body{
  1101. position: relative;
  1102. background: #fff;
  1103. transition: opacity 0.3s;
  1104. }
  1105. .item-tr{
  1106. display: flex;
  1107. //height: 41px;
  1108. }
  1109. .item-td{
  1110. flex-shrink: 0;
  1111. width:200rpx;
  1112. padding-left: 8rpx;
  1113. height: 64rpx;
  1114. line-height: 64rpx;
  1115. padding-right: 8rpx;
  1116. font-weight: 500;
  1117. color: #222327;
  1118. box-sizing: border-box;
  1119. word-break:keep-all; /* 不换行 */
  1120. white-space:nowrap; /* 不换行 */
  1121. overflow:hidden; /* 内容超出宽度时隐藏超出部分的内容 */
  1122. text-overflow:ellipsis; /* 当对象内文本溢出时显示省略标记(...) ;需与overflow:hidden;一起使用。*/
  1123. overflow-wrap: break-word;
  1124. border-bottom: 2rpx solid #e8e8e8;
  1125. &.nborder{
  1126. border: none;
  1127. }
  1128. //transition: background 0.3s;
  1129. }
  1130. .zb-table-fixed-left .zb-table-header{
  1131. overflow-y: hidden;
  1132. }
  1133. .zb-table-header {
  1134. overflow: hidden;
  1135. // background: #fafafa;
  1136. .item-th{
  1137. padding-left: 8rpx;
  1138. line-height: 78rpx;
  1139. height: 80rpx;
  1140. //display: flex;
  1141. //align-items: center;
  1142. box-sizing: border-box;
  1143. }
  1144. }
  1145. .zb-table-fixed-left .zb-table-fixed{
  1146. background: #fff;
  1147. }
  1148. .zb-table-fixed-right .zb-table-fixed{
  1149. background: #fff;
  1150. }
  1151. .zb-table-body-inner{
  1152. height: 100%;
  1153. // overflow: scroll;
  1154. }
  1155. .zb-table-fixed-left{
  1156. position: absolute;
  1157. top: 0;
  1158. z-index: 1;
  1159. overflow: hidden;
  1160. border-radius: 0;
  1161. height: 100%;
  1162. //transition: box-shadow 0.3s ease;
  1163. }
  1164. .odd{
  1165. background-color:rgba(249,249,249,0.6);
  1166. //height: 100%;
  1167. width: 100%;
  1168. }
  1169. .even{
  1170. background-color:white ;
  1171. //height: 100%;
  1172. width: 100%;
  1173. }
  1174. }
  1175. .scroll-left-fixed{
  1176. .zb-table-fixed-left {
  1177. left: 0;
  1178. box-shadow: 12rpx 0 12rpx -8rpx #ccc;
  1179. }
  1180. }
  1181. .zb-table-applet{
  1182. height: 100%;
  1183. //overflow: hidden;
  1184. width: 100%;
  1185. position: relative;
  1186. display: flex;
  1187. flex-direction: column;
  1188. font-size: 28rpx;
  1189. .zb-table-content{
  1190. //height: 100%;
  1191. flex: 1;
  1192. overflow: hidden;
  1193. position: relative;
  1194. }
  1195. .zb-table-fixed{
  1196. min-width: 100%;
  1197. width: fit-content;
  1198. }
  1199. .zb-table-body{
  1200. position: relative;
  1201. background: #fff;
  1202. transition: opacity 0.3s;
  1203. }
  1204. .item-tr{
  1205. display: flex;
  1206. //height: 41px;
  1207. }
  1208. .item-td{
  1209. flex-shrink: 0;
  1210. width: 200rpx;
  1211. padding-left: 8rpx;
  1212. height: 80rpx;
  1213. line-height: 80rpx;
  1214. padding-right:8rpx;
  1215. box-sizing: border-box;
  1216. word-break:keep-all; /* 不换行 */
  1217. white-space:nowrap; /* 不换行 */
  1218. overflow:hidden; /* 内容超出宽度时隐藏超出部分的内容 */
  1219. text-overflow:ellipsis; /* 当对象内文本溢出时显示省略标记(...) ;需与overflow:hidden;一起使用。*/
  1220. overflow-wrap: break-word;
  1221. border-bottom: 2rpx solid #e8e8e8;
  1222. //transition: background 0.3s;
  1223. }
  1224. .zb-table-header {
  1225. //overflow: hidden;
  1226. position: sticky;
  1227. top: 0;
  1228. z-index: 2;
  1229. //width: fit-content;
  1230. .item-th{
  1231. padding-left: 8rpx;
  1232. line-height: 78rpx;
  1233. height: 80rpx;
  1234. box-sizing: border-box;
  1235. background: #fafafa;
  1236. }
  1237. .zb-stick-side{
  1238. position: sticky;
  1239. top: 0;
  1240. left: 0;
  1241. z-index: 2;
  1242. //border-right: solid 1rpx #dbdbdb;
  1243. box-sizing: border-box;
  1244. background: #fafafa;
  1245. //box-shadow: 6px 0 6px -4px #ccc;
  1246. }
  1247. }
  1248. .zb-table-fixed-left .zb-table-fixed{
  1249. background: #fff;
  1250. }
  1251. .zb-table-fixed-right .zb-table-fixed{
  1252. background: #fff;
  1253. }
  1254. .zb-table-fixed-header .zb-table-body-inner{
  1255. height: 100%;
  1256. // overflow: scroll;
  1257. }
  1258. .zb-table-fixed-left{
  1259. position: absolute;
  1260. top: 0;
  1261. z-index: 1;
  1262. overflow: hidden;
  1263. border-radius: 0;
  1264. height: 100%;
  1265. //transition: box-shadow 0.3s ease;
  1266. }
  1267. .scroll-left-fixed{
  1268. .zb-table-fixed-left {
  1269. left: 0;
  1270. box-shadow: 12rpx 0 12rpx -8rpx #ccc;
  1271. }
  1272. }
  1273. .odd{
  1274. background-color:rgba(249,249,249,0.6);
  1275. //height: 100%;
  1276. width: 100%;
  1277. }
  1278. .even{
  1279. background-color:white ;
  1280. //height: 100%;
  1281. width: 100%;
  1282. }
  1283. .zb-table-tbody {
  1284. .zb-stick-side{
  1285. position: sticky;
  1286. left: 0;
  1287. z-index: 1;
  1288. box-sizing: border-box;
  1289. background:white;
  1290. //box-shadow: 6px 0 6px -2px #ccc;
  1291. }
  1292. .odd{
  1293. background:#f9f9f9;
  1294. //height: 100%;
  1295. width: 100%;
  1296. }
  1297. .even{
  1298. background:white ;
  1299. //height: 100%;
  1300. width: 100%;
  1301. }
  1302. }
  1303. .current-row{
  1304. .item-td{
  1305. background-color: #ecf5ff;
  1306. }
  1307. }
  1308. }
  1309. .current-row{
  1310. .item-td{
  1311. background-color: #ecf5ff;
  1312. }
  1313. }
  1314. .zb-table-header{
  1315. height: 80rpx;
  1316. }
  1317. </style>