z-table.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782
  1. <template>
  2. <view class="z-table">
  3. <view class="z-table-main" :style="compluteHeight">
  4. <view v-if="!tableLoaded && (!tableData || !columns)" :class="['z-loading', {ztableLoading: tableShow}]">
  5. <view class="z-loading-animate"></view>
  6. </view>
  7. <view class="z-table-container">
  8. <view class="z-table-pack">
  9. <view class="z-table-title">
  10. <view class="z-table-title-item" :class="{ 'z-table-stick-side': stickSide && index == 0 }" :style="{ width: item.width ? item.width + 'rpx' : '200rpx' }"
  11. v-for="(item, index) in columns" :key="index" @click="sort(item.key, index)">
  12. <view v-if="showSelect && !singleSelect && index === 0" class="select-box" @click="doSelect(true)">
  13. <view :class="['select-tip', {'selected': selectAll}]"></view>
  14. </view>
  15. <view :class="['z-table-col-text', {'text-left': titleTextAlign === 'left', 'text-center': titleTextAlign === 'center', 'text-right': titleTextAlign === 'right'}]">
  16. <view v-html="getTitleText(item.title)"></view>
  17. <view v-if="item.hasOwnProperty('key') && item.hasOwnProperty('sort') && tableData.length" class="sort">
  18. <view class="up-arrow" :class="{ action: nowSortKey == item.key && sortType == 'asc' }"></view>
  19. <view class="down-arrow" :class="{ action: nowSortKey == item.key && sortType == 'desc' }"></view>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. <view v-if="tableData.length" :class="['table-container-box', {'short-table': !longTable && showBottomSum}]">
  25. <view class="z-table-container-row" :class="{ 'z-table-has-bottom': showBottomSum }" v-for="(row, iIndex) in tableData"
  26. :key="iIndex">
  27. <view :class="['z-table-container-col', { 'z-table-stick-side': stickSide && jIndex == 0 }]" :style="{ width: col.width ? col.width + 'rpx' : '200rpx' }"
  28. v-for="(col, jIndex) in columns" :key="jIndex" @click="itemClick(row, col)">
  29. <view v-if="showSelect && jIndex === 0" class="select-box" @click="doSelect(false, iIndex)">
  30. <view :class="['select-tip', {'selected': selectArr.includes(iIndex)}]"></view>
  31. </view>
  32. <view :class="['z-table-col-text', {'text-left': textAlign === 'left', 'text-center': textAlign === 'center', 'text-right': textAlign === 'right'}]">
  33. <view v-if="!col.isLink" v-html="getRowContent(row, col)">
  34. <!-- <view v-if="!col.render" v-html="getRowContent(row, col)"></view> -->
  35. <!-- <renderComponents v-else :row="row" :col="col" /> -->
  36. </view>
  37. <!-- #ifdef H5 -->
  38. <router-link v-else-if="setUrl(row, col).indexOf('http') != 0" :to="setUrl(row, col)" v-html="getRowContent(row, col)"></router-link>
  39. <a v-else-if="col.isLink" :href="setUrl(row, col)" v-html="getRowContent(row, col)"></a>
  40. <!-- #endif -->
  41. <!-- #ifndef H5 -->
  42. <navigator v-else-if="col.isLink" :url="setUrl(row, col)" v-html="getRowContent(row, col)"></navigator>
  43. <!-- #endif -->
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. <view :class="['z-table-bottom', {'long-table': longTable}]" v-if="showBottomSum && tableData.length">
  49. <view class="z-table-bottom-col" :class="{ 'z-table-stick-side': stickSide && sumIndex == 0 }" :style="{ width: sumCol.width ? sumCol.width + 'rpx' : '200rpx' }"
  50. v-for="(sumCol, sumIndex) in columns" :key="sumIndex">
  51. <view class="z-table-bottom-text">
  52. <!-- <view v-if="sumIndex != 0" class="z-table-bottom-text-title">{{ sumCol.title }}</view> -->
  53. <text :class="{ sum: sumIndex == 0 }">{{ sumIndex == 0 ? '总计' : dosum(sumCol.key) }}</text>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. <view v-if="tableData && tableData.length == 0 && !tableLoaded" class="table-empty">
  60. <!-- image v-if="!showLoading" class="empty-img" src="../static/empty.png"></image -->
  61. <view v-html="showLoading ? '' : emptyText"></view>
  62. </view>
  63. </view>
  64. </view>
  65. </template>
  66. <script>
  67. /*
  68. * 表格使用
  69. * 注意如果需要异步加载,需要把tableData初始值设为false,当没有数据的时候值为空数组
  70. * props: tableData [Array | Boolean] | 表格数据 如果为false则显示loading
  71. * columns [Array | Boolean] | 数据映射表 如果为false则显示loading 每列params => title(表头文字可以是html字符串模版), width(每列宽度) [, key(对应tableData的字段名) || format(自定义内容), sort(是否要排序), isLink(是否显示为超链接Object)]
  72. * format格式: {template: 字符串模版用#key#表示需要被替换的数据,names: 对应template属性内要被替换的内容的key}
  73. * isLink格式: {url: 链接地址, params: 地址带的参数Array[key|value, key|value, ...]每一项都是key和value以'|'链接,如果不带'|'默认键值同名
  74. * listenerClick(是否监听点击事件Boolean)}
  75. * stickSide Boolean | 是否固定右侧首栏 默认不显示
  76. * showBottomSum Boolean | 是否显示底部统计 默认不显示
  77. * showLoading Boolean | 是否首次加载首次加载不显示暂无数据内容
  78. * emptyText String | 空数据显示的文字内容
  79. * tableHeight Number | 设置表格高度会滚动
  80. * sort Boolean | 开启排序
  81. * showSelect Boolean | 开启选择
  82. * singleSelect Boolean | 在开启选择的状态下是否开起单选
  83. * textAlign String | 内容对齐方式 left center right
  84. * titleTextAlign String | 表头对齐方式 left center right
  85. *
  86. * event: onSort | 排序事件 返回{key: 被排序列的字段名, type: 正序'asc'/倒序'desc'}
  87. * onSelect | 选中时触发 返回选择的行的下标
  88. * onClick | 单元格点击事件 返回点击单元格所属行的数据
  89. *
  90. * function: resetSort | 调用后重置排序 *注意:不会触发sort事件
  91. *
  92. * */
  93. import Vue from 'vue'
  94. // import tableRender from './table-render'
  95. export default {
  96. data() {
  97. return {
  98. version: '1.1.0',
  99. nowSortKey: '',
  100. sortType: 'desc', // asc/desc 升序/降序
  101. longTable: true,
  102. lineHeight: uni.upx2px(64),
  103. tableLoaded: false,
  104. tableShow: true,
  105. selectAll: false,
  106. selectArr: []
  107. }
  108. },
  109. // mixin: [tableRender],
  110. computed: {
  111. compluteHeight() {
  112. return this.tableHeight ?
  113. 'height: ' + uni.upx2px(this.tableHeight) + 'px' :
  114. ''
  115. }
  116. },
  117. props: {
  118. tableData: {
  119. type: [Array, Boolean],
  120. default () {
  121. return false
  122. }
  123. },
  124. columns: {
  125. /*
  126. *
  127. * [{title: xxx, key: 当前列展示对象名, width: 列宽, render: function}]
  128. *
  129. * */
  130. type: [Array, Boolean],
  131. required: true
  132. },
  133. stickSide: {
  134. type: Boolean,
  135. default: false
  136. },
  137. showBottomSum: {
  138. type: Boolean,
  139. default: false
  140. },
  141. showLoading: {
  142. type: Boolean,
  143. default: true
  144. },
  145. emptyText: {
  146. type: String,
  147. default: '暂无数据'
  148. },
  149. tableHeight: {
  150. type: [Number, Boolean],
  151. default: 0
  152. },
  153. showSelect: {
  154. type: Boolean,
  155. default: false
  156. },
  157. singleSelect: {
  158. type: Boolean,
  159. default: false
  160. },
  161. textAlign: {
  162. type: String,
  163. default: 'left' // right|center|left
  164. },
  165. titleTextAlign: {
  166. type: String,
  167. default: 'left' // right|center|left
  168. }
  169. },
  170. mounted() {
  171. this.init()
  172. },
  173. // components: {
  174. // renderComponents: {
  175. // functional: true,
  176. // props: {
  177. // row: {
  178. // type: Object,
  179. // required: true
  180. // },
  181. // col: {
  182. // type: Object,
  183. // required: true
  184. // }
  185. // },
  186. // render: function(h, ctx) {
  187. // return _this[ctx.props.col.render](h, ctx.props)
  188. // }
  189. // }
  190. // },
  191. watch: {
  192. columns() {
  193. this.init()
  194. },
  195. tableData() {
  196. this.init()
  197. }
  198. },
  199. methods: {
  200. async init() {
  201. // 重置选择内容
  202. this.selectAll = false
  203. this.selectArr = []
  204. this.tableLoaded = false
  205. this.tableShow = true
  206. let _this = this
  207. let container = await _this.getPageSize('.z-table-container'),
  208. pack = await _this.getPageSize('.z-table-pack')
  209. _this.timer && clearTimeout(_this.timer)
  210. if (container && pack) {
  211. _this.$nextTick(function() {
  212. if (_this.tableData && _this.tableData.length) {
  213. _this.tableShow = false
  214. _this.timer = setTimeout(function() {
  215. _this.tableLoaded = true
  216. }, 300)
  217. }
  218. })
  219. if (container.height != pack.height) {
  220. _this.longTable = true
  221. } else {
  222. _this.longTable = false
  223. }
  224. } else {
  225. _this.tableLoaded = false
  226. _this.$nextTick(function() {
  227. _this.tableShow = true
  228. })
  229. }
  230. },
  231. getPageSize(selecter) {
  232. // 获取元素信息
  233. let query = uni.createSelectorQuery().in(this),
  234. _this = this
  235. return new Promise((resolve, reject) => {
  236. query
  237. .select(selecter)
  238. .boundingClientRect(res => {
  239. resolve(res)
  240. })
  241. .exec()
  242. })
  243. },
  244. dosum(key) {
  245. let sum = '-'
  246. if (this.tableData) {
  247. if (
  248. this.tableData.every(item => {
  249. return !Number.isNaN(item[key] - 0)
  250. })
  251. ) {
  252. sum = 0
  253. this.tableData.map((item, index) => {
  254. if (!key && index != 0) {
  255. sum = '-'
  256. } else {
  257. let val = item[key] - 0
  258. if (Number.isNaN(val)) {
  259. sum += 0
  260. } else {
  261. sum += val
  262. }
  263. }
  264. })
  265. }
  266. }
  267. // sum = sum == 0 ? "-" : sum
  268. return this.numTransform(sum)
  269. },
  270. getRowContent(row, col) {
  271. // 表格值处理函数
  272. // 如果columns带了key则显示对应的key
  273. // 如果columns带的format则按规定返回format后的html
  274. // format规定: params names <Array> 对应tableData的键名,作为匹配template中两个#之间动态内容的名字
  275. // params template <String> html字符串模版
  276. let tempHTML = ''
  277. let rowKey = row[col.key]
  278. if ([null, ''].includes(rowKey)) {
  279. rowKey = '-'
  280. }
  281. if (rowKey || rowKey === 0) {
  282. tempHTML = isNaN(rowKey - 0) ?
  283. rowKey :
  284. this.numTransform(rowKey - 0)
  285. // tempHTML = tempHTML == 0 ? "-" : tempHTML
  286. } else if (!!col.format) {
  287. let tempFormat = col.format.template
  288. col.format.names.map(item => {
  289. let regexp = new RegExp(`\#${item}\#`, 'mg')
  290. tempFormat = tempFormat.replace(regexp, row[item])
  291. })
  292. tempHTML = tempFormat
  293. } else if (!col.render) {
  294. let error = new Error('数据的key或format值至少一个不为空')
  295. throw error
  296. }
  297. // console.log(tempHTML)
  298. return tempHTML.toString()
  299. },
  300. sort(key, index) {
  301. if (!key || !this.columns[index].sort) {
  302. return
  303. }
  304. // 排序功能: 如果点击的排序按钮是原先的 那么更改排序类型
  305. // 如果点击的另一个排序按钮 那么选择当前排序并且排序类型改为降序(desc)
  306. if (key != this.nowSortKey) {
  307. this.nowSortKey = key
  308. this.sortType = 'desc'
  309. } else {
  310. this.toggleSort()
  311. }
  312. this.$emit('onSort', {
  313. key: this.nowSortKey,
  314. type: this.sortType
  315. })
  316. },
  317. toggleSort() {
  318. this.sortType = this.sortType == 'asc' ? 'desc' : 'asc'
  319. },
  320. numTransform(n) {
  321. if (Number.isNaN(n - 0)) {
  322. return n
  323. }
  324. if (Math.abs(n) >= 100000000) {
  325. n = Number((n / 100000000).toFixed(1)) + '亿'
  326. } else if (Math.abs(n) >= 10000) {
  327. n = Number((n / 10000).toFixed(1)) + '万'
  328. }
  329. return n.toString()
  330. },
  331. resetSort() {
  332. // 重置排序状态
  333. this.nowSortKey = ''
  334. this.sortType = 'desc'
  335. },
  336. setUrl(row, col) {
  337. if (!col.isLink) {
  338. return
  339. }
  340. let urlParam = {}
  341. let {
  342. isLink: {
  343. url,
  344. params = []
  345. }
  346. } = col
  347. params.forEach(item => {
  348. if (~item.indexOf('|')) {
  349. let temp = item.split('|')
  350. urlParam[temp[0]] = row[temp[1]]
  351. } else {
  352. urlParam[item] = row[item]
  353. }
  354. })
  355. url = this.setUrlParams(url, urlParam)
  356. return url
  357. },
  358. setUrlParams(url, params) {
  359. let tempUrl = url,
  360. keyArr = Object.keys(params)
  361. keyArr.forEach(item => {
  362. tempUrl += `&${item}=${params[item]}`
  363. })
  364. tempUrl = tempUrl.replace(/\&/, '?')
  365. return tempUrl
  366. },
  367. itemClick(row, col) {
  368. if (col.listenerClick) {
  369. this.$emit('onClick', row)
  370. }
  371. },
  372. doSelect(isAll = false, index) {
  373. let temp = new Set()
  374. if (isAll) {
  375. // 全选
  376. if (!this.selectAll) {
  377. for (let i = 0; i < this.tableData.length; i++) {
  378. temp.add(i)
  379. }
  380. }
  381. } else {
  382. // if (!this.singleSelect) {
  383. // this.selectArr.forEach(item => {
  384. // temp.add(item)
  385. // })
  386. // }
  387. this.selectArr.forEach(item => {
  388. temp.add(item)
  389. })
  390. if (temp.has(index)) {
  391. temp.delete(index)
  392. } else {
  393. if (this.singleSelect) {
  394. temp.clear()
  395. }
  396. temp.add(index)
  397. }
  398. }
  399. this.selectArr = Array.from(temp)
  400. // console.log(this.selectArr)
  401. if (this.selectArr.length == this.tableData.length) {
  402. this.selectAll = true
  403. } else {
  404. this.selectAll = false
  405. }
  406. this.$emit('onSelect', this.selectArr)
  407. },
  408. // 1.1.1
  409. getTitleText(title) {
  410. // 自定义表头
  411. let tempHTML = title
  412. return tempHTML.toString()
  413. }
  414. }
  415. }
  416. </script>
  417. <style lang="scss">
  418. .navigator-hover {
  419. background: transparent;
  420. opacity: 1;
  421. }
  422. @mixin ellipsis($num: 1) {
  423. overflow: hidden;
  424. text-overflow: ellipsis;
  425. @if $num==1 {
  426. white-space: nowrap;
  427. }
  428. @else {
  429. display: -webkit-box;
  430. -webkit-line-clamp: $num;
  431. /* autoprefixer: off */
  432. -webkit-box-orient: vertical;
  433. /* autoprefixer: on */
  434. }
  435. }
  436. // 三角形
  437. %triangle-basic {
  438. content: '';
  439. height: 0;
  440. width: 0;
  441. overflow: hidden;
  442. }
  443. @mixin triangle($direction, $size, $borderColor) {
  444. @extend %triangle-basic;
  445. @if $direction==top {
  446. border-bottom: $size solid $borderColor;
  447. border-left: $size dashed transparent;
  448. border-right: $size dashed transparent;
  449. border-top: 0;
  450. }
  451. @else if $direction==right {
  452. border-left: $size solid $borderColor;
  453. border-top: $size dashed transparent;
  454. border-bottom: $size dashed transparent;
  455. border-right: 0;
  456. }
  457. @else if $direction==bottom {
  458. border-top: $size solid $borderColor;
  459. border-left: $size dashed transparent;
  460. border-right: $size dashed transparent;
  461. border-bottom: 0;
  462. }
  463. @else if $direction==left {
  464. border-right: $size solid $borderColor;
  465. border-top: $size dashed transparent;
  466. border-bottom: $size dashed transparent;
  467. border-left: 0;
  468. }
  469. }
  470. a {
  471. text-decoration: none;
  472. }
  473. .z-table {
  474. position: relative;
  475. display: inline-block;
  476. height: 100%;
  477. min-height: 130rpx;
  478. width: 100%;
  479. background: #fff;
  480. border: solid 2rpx #ccc;
  481. font-size: $uni-font-size-sm;
  482. box-sizing: border-box;
  483. transform: translateZ(0);
  484. .z-table-main {
  485. height: 100%;
  486. box-sizing: border-box;
  487. }
  488. .z-table-container {
  489. height: 100%;
  490. overflow: scroll;
  491. box-sizing: border-box;
  492. }
  493. .z-table-pack {
  494. position: relative;
  495. min-height: 100%;
  496. width: fit-content;
  497. }
  498. .z-table-title {
  499. position: sticky;
  500. top: 0;
  501. height: 64rpx;
  502. z-index: 1;
  503. .z-table-title-item {
  504. border-bottom: solid 1rpx #dbdbdb;
  505. background: #f8f8f8;
  506. }
  507. .z-table-stick-side {
  508. position: sticky;
  509. top: 0;
  510. left: 0;
  511. border-right: solid 1rpx #dbdbdb;
  512. box-sizing: border-box;
  513. }
  514. }
  515. .table-container-box.short-table {
  516. padding-bottom: 48rpx;
  517. }
  518. .z-table-title,
  519. .z-table-container-row {
  520. display: flex;
  521. width: fit-content;
  522. white-space: nowrap;
  523. box-sizing: border-box;
  524. .z-table-title-item,
  525. .z-table-container-col {
  526. @include ellipsis();
  527. display: inline-flex;
  528. padding: 0 16rpx;
  529. height: 64rpx;
  530. align-items: center;
  531. line-height: 64rpx;
  532. box-sizing: border-box;
  533. }
  534. }
  535. .z-table-container-row {
  536. z-index: 0;
  537. border-bottom: solid 1rpx #f4f4f4;
  538. box-sizing: border-box;
  539. }
  540. .z-table-stick-side {
  541. position: sticky;
  542. left: 0;
  543. background: #f7f9ff;
  544. border-right: solid 1rpx #dbdbdb;
  545. box-sizing: border-box;
  546. }
  547. .z-table-bottom {
  548. position: absolute;
  549. bottom: 0;
  550. z-index: 9;
  551. display: flex;
  552. justify-items: center;
  553. width: fit-content;
  554. background: #4298f7 !important;
  555. color: #fff !important;
  556. white-space: nowrap;
  557. box-sizing: border-box;
  558. &.long-table {
  559. position: sticky;
  560. }
  561. .z-table-stick-side {
  562. background: #4298f7 !important;
  563. box-sizing: border-box;
  564. }
  565. .z-table-bottom-col {
  566. display: inline-flex;
  567. align-items: center;
  568. text-align: center;
  569. padding: 16rpx;
  570. box-sizing: border-box;
  571. }
  572. .z-table-bottom-text {
  573. line-height: 100%;
  574. box-sizing: border-box;
  575. }
  576. .z-table-bottom-text-title {
  577. margin-bottom: 10rpx;
  578. font-size: 22rpx;
  579. color: #aad0ff;
  580. box-sizing: border-box;
  581. }
  582. .sum {
  583. margin-left: 14rpx;
  584. font-size: 28rpx;
  585. box-sizing: border-box;
  586. }
  587. }
  588. .table-empty {
  589. position: absolute;
  590. top: 64rpx;
  591. height: 64rpx;
  592. line-height: 64rpx;
  593. width: 100%;
  594. text-align: center;
  595. }
  596. .sort {
  597. display: flex;
  598. padding: 5rpx;
  599. flex-direction: column;
  600. justify-content: center;
  601. .up-arrow {
  602. @include triangle(top, 10rpx, #ccc);
  603. display: block;
  604. margin-bottom: 5rpx;
  605. &.action {
  606. @include triangle(top, 10rpx, #4298f7);
  607. }
  608. }
  609. .down-arrow {
  610. @include triangle(bottom, 10rpx, #ccc);
  611. display: block;
  612. &.action {
  613. @include triangle(bottom, 10rpx, #4298f7);
  614. }
  615. }
  616. }
  617. // 1.0.5
  618. .z-loading {
  619. position: absolute;
  620. top: 0;
  621. left: 0;
  622. z-index: 2;
  623. display: flex;
  624. align-items: center;
  625. justify-content: center;
  626. height: 100%;
  627. width: 100%;
  628. background: #fff;
  629. opacity: 0;
  630. transition: all 0.3s;
  631. &.ztableLoading {
  632. opacity: 1;
  633. }
  634. .z-loading-animate {
  635. position: relative;
  636. display: inline-block;
  637. width: 30rpx;
  638. height: 30rpx;
  639. margin-right: 20rpx;
  640. border-radius: 100%;
  641. border: solid 6rpx #ccc;
  642. vertical-align: middle;
  643. animation: rotate 1s ease-in-out infinite;
  644. &::after {
  645. content: '';
  646. display: block;
  647. position: absolute;
  648. top: -10rpx;
  649. z-index: 1;
  650. background: #fff;
  651. width: 20rpx;
  652. height: 20rpx;
  653. border-radius: 10rpx;
  654. }
  655. }
  656. @keyframes rotate {
  657. from {
  658. transform: rotate(0deg);
  659. }
  660. to {
  661. transform: rotate(360deg);
  662. }
  663. }
  664. }
  665. // 1.1.0
  666. .select-box {
  667. display: inline-block;
  668. width: 26rpx;
  669. height: 26rpx;
  670. line-height: 14rpx;
  671. margin-right: 15rpx;
  672. border: solid 2rpx #4298f7;
  673. border-radius: 4rpx;
  674. background: #fff;
  675. text-align: center;
  676. }
  677. .select-tip {
  678. display: inline-block;
  679. opacity: 0;
  680. transform: rotate(90deg);
  681. transition: all .3s;
  682. &.selected {
  683. position: relative;
  684. top: 4rpx;
  685. left: -4rpx;
  686. height: 4rpx;
  687. background: #4298f7;
  688. width: 10rpx;
  689. opacity: 1;
  690. transform: rotate(45deg);
  691. &:before,
  692. &:after {
  693. content: '';
  694. position: absolute;
  695. display: block;
  696. height: 4rpx;
  697. background: #4298f7;
  698. }
  699. &:before {
  700. bottom: -2rpx;
  701. left: -4rpx;
  702. width: 8rpx;
  703. transform: rotate(-90deg);
  704. }
  705. &:after {
  706. bottom: 16rpx;
  707. right: -16rpx;
  708. width: 34rpx;
  709. transform: rotate(-90deg);
  710. }
  711. }
  712. }
  713. // 1.1.1
  714. .z-table-col-text {
  715. display: flex;
  716. width: 100%;
  717. flex: 1;
  718. justify-content: flex-start;
  719. align-content: center;
  720. &.text-center {
  721. justify-content: center;
  722. }
  723. &.text-right {
  724. justify-content: flex-end;
  725. }
  726. }
  727. }
  728. </style>