meixioacomponent 0.3.39 → 0.3.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -46,6 +46,7 @@
46
46
  ref="elTable"
47
47
  :row-key="rowKey"
48
48
  :stripe="stripe"
49
+ :fit="true"
49
50
  :data="tableData"
50
51
  :border="borderColu"
51
52
  :height="tableHeight"
@@ -54,8 +55,6 @@
54
55
  'no-row-bordel': !borderRow,
55
56
  }"
56
57
  @sort-change="sortChange"
57
- @cell-mouse-enter="cellMouseEnter"
58
- @cell-mouse-leave="cellMouseLeave"
59
58
  @selection-change="handleSelectionChange"
60
59
  :style="{
61
60
  width: width,
@@ -87,11 +86,10 @@
87
86
  :selectable="selected"
88
87
  ></el-table-column>
89
88
  <el-table-column
90
- :key="index"
89
+ :key="item.key"
91
90
  :align="align"
92
91
  sortable="custom"
93
92
  :fixed="item.lock"
94
- v-show="item.show"
95
93
  :prop="item.key"
96
94
  :label="item.label"
97
95
  :width="isAverageWidth ? '' : item.width"
@@ -106,7 +104,14 @@
106
104
  @headerItemLock="headerItemLock"
107
105
  @headerItemUnlock="headerItemUnlock"
108
106
  @handleScreenItem="handleScreenItem"
109
- ></oaProtableHeader>
107
+ >
108
+ <oa_pro_colum_configVue
109
+ slot="flex-slot"
110
+ :config="tableConfig"
111
+ v-if="isListLast(item.key)"
112
+ @setTableHeaderConfig="setTableHeaderConfig"
113
+ ></oa_pro_colum_configVue>
114
+ </oaProtableHeader>
110
115
  </template>
111
116
 
112
117
  <template slot-scope="scope">
@@ -116,6 +121,25 @@
116
121
  v-if="item.template"
117
122
  ></slot>
118
123
 
124
+ <el-tooltip
125
+ effect="dark"
126
+ placement="top"
127
+ :content="scope.row[`${item.key}`]"
128
+ v-else-if="item.toolTip && scope.row[`${item.key}`].length > 8"
129
+ >
130
+ <span
131
+ class="cell-content-text"
132
+ :class="[
133
+ item.fun ? 'fun' : '',
134
+ item.click ? 'primary' : '',
135
+ item.color ? item.color : '',
136
+ ]"
137
+ @click="rowClick(item, scope.row)"
138
+ >
139
+ {{ scope.row[`${item.key}`] }}
140
+ </span>
141
+ </el-tooltip>
142
+
119
143
  <span
120
144
  v-else
121
145
  :class="
@@ -137,19 +161,6 @@
137
161
  @setTableHeaderConfig="setTableHeaderConfig"
138
162
  ></oa_pro_colum_configVue>
139
163
  </div>
140
- <!-- 每一个单元格提示内容 -->
141
- <el-tooltip
142
- class="item"
143
- effect="dark"
144
- :manual="true"
145
- placement="top"
146
- ref="tableTooltip"
147
- v-model="tooltip.show"
148
- :visible-arrow="false"
149
- :content="`${tooltip.content}`"
150
- >
151
- <span class="table-tooltip-wrap" :style="toolTipsStyle"></span>
152
- </el-tooltip>
153
164
  </div>
154
165
 
155
166
  <!-- 表格尾部 -->
@@ -202,6 +213,7 @@ import baseButtonHandle from '../base/baseButtonHandle/baseButtonHandle.vue' //
202
213
 
203
214
  //
204
215
  import componentConfig from '../../config/componentConfig'
216
+ let canPush = true
205
217
  export default {
206
218
  name: 'baseProTable',
207
219
  data() {
@@ -221,26 +233,14 @@ export default {
221
233
  /* 控制loading动画 */
222
234
  loading: false,
223
235
  defaultSvg: false,
224
- /* 黑色提示框数据 */
225
- tooltip: {
226
- top: null,
227
- left: null,
228
- width: null,
229
- height: null,
230
- show: false,
231
- content: '',
232
- },
233
236
  /* 单选表格 记录之前选择的表格数据 */
234
237
  preSingleTableValue: null,
235
-
236
238
  // 是否开启斑马纹
237
239
  stripe: true,
238
240
  // 是否开启表格竖向条纹
239
241
  borderColu: true,
240
-
241
242
  // 是否开启表格横向条纹
242
243
  borderRow: true,
243
-
244
244
  // 倒计时
245
245
  triggerDown: null,
246
246
  }
@@ -275,7 +275,8 @@ export default {
275
275
  },
276
276
  fixedList() {
277
277
  return this.$props.tableConfig.filter((item) => {
278
- return item.lock
278
+ const { lock } = item
279
+ return lock && lock != 'right'
279
280
  })
280
281
  },
281
282
 
@@ -293,15 +294,6 @@ export default {
293
294
  return item.show
294
295
  })
295
296
  },
296
-
297
- toolTipsStyle() {
298
- return {
299
- top: `${this.tooltip.top}px`,
300
- left: `${this.tooltip.left}px`,
301
- width: `${this.tooltip.width}px`,
302
- height: `${this.tooltip.height}px`,
303
- }
304
- },
305
297
  },
306
298
  props: {
307
299
  // 当加载树形结构的表格时必须传入该值
@@ -430,6 +422,7 @@ export default {
430
422
  },
431
423
  methods: {
432
424
  init() {
425
+ canPush = !this.isAverageWidth
433
426
  this.initProScreenConfig()
434
427
  this.initFooterHandleConfig()
435
428
  this.$props.tableConfig.forEach((item, index) => {
@@ -438,17 +431,13 @@ export default {
438
431
  if (!item.width || item.width < 100) {
439
432
  item.width = 100
440
433
  }
434
+ if (item.lock == 'right') {
435
+ canPush = false
436
+ }
441
437
  })
442
438
 
443
- if (!this.isAverageWidth) {
444
- this.$props.tableConfig.push({
445
- label: '',
446
- key: 'noData',
447
- lock: false,
448
- width: 30,
449
- show: true,
450
- template: false,
451
- })
439
+ if (canPush) {
440
+ this.tableConfigPushEmpty()
452
441
  }
453
442
 
454
443
  this.refreshData()
@@ -457,29 +446,6 @@ export default {
457
446
  this.searchContentHeight = height
458
447
  },
459
448
 
460
- cellMouseEnter(row, column, cell, event) {
461
- let content = row[`${column.property}`]
462
- this.tooltip.show = false
463
- if (typeof content == 'number' || typeof content == 'string') {
464
- const { tooltip } = this
465
- let style = event.target
466
- let position = style.getBoundingClientRect()
467
- const { top, left } = position
468
- const { clientWidth, clientHeight } = style
469
- tooltip.width = clientWidth
470
- tooltip.height = clientHeight
471
- tooltip.top = top
472
- tooltip.left = left
473
- tooltip.content = content
474
- this.$nextTick(() => {
475
- tooltip.show = true
476
- })
477
- }
478
- },
479
-
480
- cellMouseLeave() {
481
- this.tooltip.show = false
482
- },
483
449
  headerItemLock(params) {
484
450
  let { preIndex, index } = { ...params }
485
451
  let tableConfig = this.$props.tableConfig
@@ -711,23 +677,45 @@ export default {
711
677
  },
712
678
  // 自定义表格的列
713
679
  setTableHeaderConfig(configList) {
714
- //console.log(configList);
715
- const index = this.$props.tableConfig.filter((item) => {
716
- return item.lock
717
- }).length
718
- this.$props.tableConfig.splice(index, configList.length + 1)
719
- this.$nextTick(() => {
720
- configList.forEach((item) => {
721
- this.$props.tableConfig.push(item)
722
- })
723
- this.$props.tableConfig.push({
724
- label: '',
725
- key: 'noData',
726
- lock: false,
727
- width: 30,
728
- show: true,
729
- template: false,
680
+ let leftFixedList = []
681
+ let rightFixedList = []
682
+ const { tableConfig } = this.$props
683
+ tableConfig.forEach((item) => {
684
+ const { lock } = item
685
+ if (lock && lock != 'right') {
686
+ leftFixedList.push(item)
687
+ } else if (lock && lock == 'right') {
688
+ rightFixedList.push(item)
689
+ }
690
+ })
691
+
692
+ tableConfig.splice(
693
+ leftFixedList.length,
694
+ configList.length - rightFixedList.length + 1,
695
+ )
696
+
697
+ configList.forEach((item, index) => {
698
+ const length = leftFixedList.length
699
+ tableConfig.splice(index + length, 1, item)
700
+ })
701
+ if (rightFixedList.length > 0) {
702
+ rightFixedList.forEach((item) => {
703
+ tableConfig.push(item)
730
704
  })
705
+ }
706
+ if (canPush) {
707
+ this.tableConfigPushEmpty()
708
+ }
709
+ },
710
+ tableConfigPushEmpty() {
711
+ const { tableConfig } = this.$props
712
+ tableConfig.push({
713
+ label: '',
714
+ key: 'noData',
715
+ lock: false,
716
+ width: 40,
717
+ show: true,
718
+ template: false,
731
719
  })
732
720
  },
733
721
  // 表格行被选中时
@@ -798,6 +786,7 @@ export default {
798
786
  })
799
787
  },
800
788
  sortChange(column) {
789
+ console.log('sort')
801
790
  this.tableData = this.tableData.sort(
802
791
  this.sortFun(
803
792
  column.prop,
@@ -823,6 +812,15 @@ export default {
823
812
  return 0
824
813
  }
825
814
  },
815
+
816
+ isListLast(key) {
817
+ const { tableConfig } = this.$props
818
+ let index = tableConfig.findIndex((item) => {
819
+ return item.key == key
820
+ })
821
+
822
+ return index == tableConfig.length - 1
823
+ },
826
824
  },
827
825
  watch: {},
828
826
  }
@@ -894,11 +892,15 @@ export default {
894
892
  color: var(--font-color-d) !important;
895
893
  font-size: var(--font-size-base) !important;
896
894
  }
897
- .active {
898
- cursor: pointer;
895
+
896
+ .primary,
897
+ .fun {
899
898
  font-weight: var(--font-weight-g);
900
- font-size: var(--font-size-base) !important;
901
899
  color: var(--color-primary) !important;
900
+ font-size: var(--font-size-base) !important;
901
+ }
902
+ .fun {
903
+ cursor: pointer;
902
904
  &:hover {
903
905
  text-decoration: underline;
904
906
  }
@@ -8923,16 +8923,7 @@
8923
8923
  outline-width: 0;
8924
8924
  }
8925
8925
 
8926
- .el-tooltip__popper {
8927
- position: absolute;
8928
- border-radius: 4px;
8929
- padding: 10px;
8930
- z-index: 2000;
8931
- font-size: 12px;
8932
- line-height: 1.2;
8933
- min-width: 10px;
8934
- word-wrap: break-word;
8935
- }
8926
+
8936
8927
 
8937
8928
  .el-tooltip__popper .popper__arrow,
8938
8929
  .el-tooltip__popper .popper__arrow::after {
@@ -14276,16 +14267,6 @@
14276
14267
  outline-width: 0;
14277
14268
  }
14278
14269
 
14279
- .el-tooltip__popper {
14280
- position: absolute;
14281
- border-radius: 4px;
14282
- padding: 10px;
14283
- z-index: 2000;
14284
- font-size: 12px;
14285
- line-height: 1.2;
14286
- min-width: 10px;
14287
- word-wrap: break-word;
14288
- }
14289
14270
 
14290
14271
  .el-tooltip__popper .popper__arrow,
14291
14272
  .el-tooltip__popper .popper__arrow::after {
@@ -18390,7 +18371,7 @@
18390
18371
  .el-tooltip__popper {
18391
18372
  position: absolute;
18392
18373
  border-radius: 4px;
18393
- padding: 10px;
18374
+ padding: 4px;
18394
18375
  z-index: 2000;
18395
18376
  font-size: 12px;
18396
18377
  line-height: 1.2;
@@ -13,6 +13,10 @@ body {
13
13
  margin: 0px;
14
14
  --footer-height: 40px;
15
15
  --header-height: 63px;
16
+
17
+ .popper__arrow {
18
+ display: none !important;
19
+ }
16
20
  }
17
21
 
18
22
  html {
@@ -109,4 +113,4 @@ h6 {
109
113
 
110
114
  #nprogress .bar {
111
115
  background: var(--color-primary) !important;
112
- }
116
+ }
package/src/App.vue CHANGED
@@ -1,36 +1,38 @@
1
1
  <template>
2
2
  <div id="app">
3
- <div style="height: 100vh">
4
-
3
+ <div style="height: 100vh;">
4
+ <test></test>
5
5
  </div>
6
6
  </div>
7
7
  </template>
8
8
 
9
9
  <script>
10
- import test from "./component/test.vue";
10
+ import test from './component/test.vue'
11
11
 
12
- import BaseArea from "../packages/components/base/baseArea/baseArea.vue";
13
- import BaseTimeLine from "../packages/components/base/baseTimeLine/baseTimeLine.vue";
12
+ import BaseArea from '../packages/components/base/baseArea/baseArea.vue'
13
+ import BaseTimeLine from '../packages/components/base/baseTimeLine/baseTimeLine.vue'
14
14
  export default {
15
15
  components: { test, BaseArea, BaseTimeLine },
16
16
  data() {
17
17
  return {
18
18
  test: [],
19
19
  items: [
20
- { type: "", label: "标签一" },
21
- { type: "success", label: "标签二" },
22
- { type: "info", label: "标签三" },
23
- { type: "danger", label: "标签四" },
24
- { type: "warning", label: "标签五" },
20
+ { type: '', label: '标签一' },
21
+ { type: 'success', label: '标签二' },
22
+ { type: 'info', label: '标签三' },
23
+ { type: 'danger', label: '标签四' },
24
+ { type: 'warning', label: '标签五' },
25
25
  ],
26
26
  value: [],
27
27
  value2: [],
28
28
  value3: [],
29
- };
29
+
30
+ flag: false,
31
+ }
30
32
  },
31
33
  mounted() {},
32
34
  methods: {},
33
- };
35
+ }
34
36
  </script>
35
37
 
36
38
  <style lang="less" scoped>
@@ -456,6 +456,7 @@ export default {
456
456
  width: 150,
457
457
  template: false,
458
458
  screen: true,
459
+ toolTip: true,
459
460
  },
460
461
  {
461
462
  label: '合同名称',
@@ -486,10 +487,32 @@ export default {
486
487
  width: 280,
487
488
  template: false,
488
489
  },
490
+ {
491
+ label: '审核状态2',
492
+ key: 'status1',
493
+ lock: false,
494
+ width: 280,
495
+ template: false,
496
+ },
497
+ {
498
+ label: '审核状态3',
499
+ key: 'status2',
500
+ lock: false,
501
+ width: 280,
502
+ template: false,
503
+ },
504
+ {
505
+ label: '审核状态4',
506
+ key: 'status3',
507
+ lock: false,
508
+ width: 280,
509
+ template: false,
510
+ },
489
511
  {
490
512
  label: '签署时间',
491
513
  key: 'gmtCreate',
492
- lock: false,
514
+ lock: 'right',
515
+ // lock: false,
493
516
  width: 280,
494
517
  template: false,
495
518
  },
package/src/test.js CHANGED
@@ -1,8 +1,8 @@
1
- import { reactive } from "vue"
1
+ import { reactive, ref } from "vue"
2
2
 
3
3
 
4
- let tableTable = reactive([{ firmName: 1 },
5
- { firmName: 2 },
4
+ let tableTable = ref([{ firmName: 1 },
5
+ { firmName: '这是一段八个字的文字' },
6
6
  { firmName: 3 },
7
7
  { firmName: 4 },
8
8
  { firmName: 5 },