zb-tablesearch.vue 41 KB

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