zb-tables.vue 41 KB

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