meixioacomponent 0.3.97 → 0.4.0

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.
@@ -9310,6 +9310,8 @@
9310
9310
  bottom: 0px;
9311
9311
  width: 100%;
9312
9312
  height: 14px;
9313
+ z-index: 1;
9314
+ pointer-events: none;
9313
9315
  background: transparent !important;
9314
9316
  border-top: 1px solid var(--color-table-border);
9315
9317
  border-bottom: 1px solid var(--color-table-border);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meixioacomponent",
3
- "version": "0.3.97",
3
+ "version": "0.4.00",
4
4
  "private": false,
5
5
  "author": "YuRi",
6
6
  "main": "lib/meixioacomponent.umd.min.js",
@@ -5,6 +5,7 @@
5
5
  @click="handletoggle(item)"
6
6
  class="toggle-item-wrap"
7
7
  :class="{
8
+ disabled: disabled,
8
9
  selected: item.value == module,
9
10
  }"
10
11
  v-for="(item, index) in toggleList"
@@ -12,9 +13,9 @@
12
13
  <base-icon
13
14
  :size="`l`"
14
15
  :color="`s`"
15
- :event="true"
16
16
  v-if="item.icon"
17
17
  :name="item.icon"
18
+ :event="disabled ? false : true"
18
19
  @iconClick="handletoggle(item)"
19
20
  ></base-icon>
20
21
  <span v-else>{{ item.label }}</span>
@@ -43,6 +44,11 @@ export default {
43
44
  beforeHandle: {
44
45
  type: Function,
45
46
  },
47
+
48
+ disabled: {
49
+ type: Boolean,
50
+ default: false,
51
+ },
46
52
  },
47
53
  computed: {
48
54
  module: {
@@ -56,6 +62,8 @@ export default {
56
62
  },
57
63
  methods: {
58
64
  handletoggle(item) {
65
+ const { disabled } = this.$props
66
+ if (disabled) return
59
67
  const { beforeHandle } = this.$props
60
68
  if (beforeHandle) {
61
69
  beforeHandle(() => {
@@ -106,6 +114,21 @@ export default {
106
114
  background: var(--bg-white);
107
115
  box-shadow: 0 3px 5px rgba(13, 20, 36, 0.18), 0 0 1px rgba(13, 20, 36, 0.29);
108
116
  }
117
+ .disabled {
118
+ cursor: not-allowed;
119
+ span {
120
+ color: var(--font-color-s);
121
+ }
122
+
123
+ &:not(.selected) {
124
+ &:hover {
125
+ background: transparent;
126
+ span {
127
+ color: var(--font-color-s);
128
+ }
129
+ }
130
+ }
131
+ }
109
132
  }
110
133
  .min {
111
134
  padding: var(--padding-1) !important;
@@ -23,6 +23,7 @@
23
23
  <div class="oa-pro-table-search">
24
24
  <oa_pro_table_searchVue
25
25
  v-model="module"
26
+ v-show="!isCheckTableRow"
26
27
  ref="oaProTableSearch"
27
28
  :screenList="screenList"
28
29
  :placeholder="placeholder"
@@ -34,6 +35,17 @@
34
35
  <slot name="search-extend"></slot>
35
36
  </template>
36
37
  </oa_pro_table_searchVue>
38
+
39
+ <oa_pro_table_check_handle_barVue
40
+ :del-fn="delFn"
41
+ :export-fn="exportFn"
42
+ v-if="isCheckTableRow"
43
+ :checked-value="tableCheckboxConfig.value"
44
+ >
45
+ <template slot="check-handle">
46
+ <slot name="check-handle-plugin"></slot>
47
+ </template>
48
+ </oa_pro_table_check_handle_barVue>
37
49
  </div>
38
50
 
39
51
  <!-- 表格内容 -->
@@ -46,10 +58,10 @@
46
58
  }"
47
59
  >
48
60
  <el-table
61
+ :fit="true"
49
62
  ref="elTable"
50
63
  :row-key="rowKey"
51
64
  :stripe="stripe"
52
- :fit="true"
53
65
  :data="tableData"
54
66
  :border="borderColu"
55
67
  :height="tableHeight"
@@ -158,13 +170,6 @@
158
170
  </template>
159
171
  </el-table-column>
160
172
  </el-table>
161
-
162
- <div class="table-suffix" v-if="!isAverageWidth">
163
- <oa_pro_colum_configVue
164
- :config="tableConfig"
165
- @setTableHeaderConfig="setTableHeaderConfig"
166
- ></oa_pro_colum_configVue>
167
- </div>
168
173
  </div>
169
174
 
170
175
  <!-- 表格尾部 -->
@@ -223,6 +228,7 @@ import oa_pro_colum_configVue from './oa_pro_colum_config.vue' //表格列配置
223
228
  import oa_pro_table_skeletonVue from './oa_pro_table_skeleton.vue' //表格骨架屏
224
229
  import baseDefaultSvgVue from '../base/baseDefaultSvg/baseDefaultSvg.vue' //缺省页组件
225
230
  import baseButtonHandle from '../base/baseButtonHandle/baseButtonHandle.vue' //通用组件 排列尾部按钮的组件
231
+ import oa_pro_table_check_handle_barVue from './oa_pro_table_check_handle_bar.vue' // 当表格有行被选中的时候
226
232
 
227
233
  //
228
234
  import componentConfig from '../../config/componentConfig'
@@ -270,7 +276,7 @@ export default {
270
276
  componentConfig.eventBus.$on('handleTableBorder', this.handleTableBorder)
271
277
  },
272
278
  mounted() {
273
- // this.init();
279
+ this.initTableColumWidth()
274
280
  },
275
281
  beforeDestroy() {
276
282
  componentConfig.eventBus.$off('handleTableBorder', this.handleTableBorder)
@@ -317,6 +323,11 @@ export default {
317
323
  return item.show
318
324
  })
319
325
  },
326
+
327
+ isCheckTableRow() {
328
+ const { tableCheckboxConfig } = this.$props
329
+ return tableCheckboxConfig.value.length > 0
330
+ },
320
331
  },
321
332
  props: {
322
333
  // 当加载树形结构的表格时必须传入该值
@@ -443,6 +454,16 @@ export default {
443
454
  type: Boolean,
444
455
  default: true,
445
456
  },
457
+
458
+ // 行被选中删除的方法
459
+ delFn: {
460
+ type: Function,
461
+ },
462
+
463
+ // 行被选中导出的方法
464
+ exportFn: {
465
+ type: Function,
466
+ },
446
467
  },
447
468
  components: {
448
469
  oaProHeader,
@@ -454,6 +475,7 @@ export default {
454
475
  oa_pro_table_searchVue,
455
476
  oa_pro_colum_configVue,
456
477
  oa_pro_table_skeletonVue,
478
+ oa_pro_table_check_handle_barVue,
457
479
  },
458
480
  methods: {
459
481
  isToolTip(value) {
@@ -483,6 +505,26 @@ export default {
483
505
 
484
506
  this.refreshData()
485
507
  },
508
+
509
+ initTableColumWidth() {
510
+ const { isAverageWidth } = this
511
+ if (isAverageWidth) true
512
+
513
+ const tableWidth = this.$refs.elTable.$el.offsetWidth
514
+ let totalWidth = 0
515
+ const { tableConfig } = this.$props
516
+ tableConfig.forEach((item) => {
517
+ totalWidth += item.width
518
+ })
519
+
520
+ const sub = tableWidth - totalWidth
521
+ if (sub > 0) {
522
+ const aver = sub / tableConfig.length
523
+ tableConfig.forEach((item) => {
524
+ item.width += aver
525
+ })
526
+ }
527
+ },
486
528
  searchContentHeightChange(height) {
487
529
  this.searchContentHeight = height
488
530
  },
@@ -783,6 +825,11 @@ export default {
783
825
  this.preSingleTableValue = val[0]
784
826
  tableCheckboxConfig.value = val
785
827
  } else {
828
+ if (val.length == 0) {
829
+ this.preSingleTableValue = null
830
+ tableCheckboxConfig.value = []
831
+ return
832
+ }
786
833
  let index = val.findIndex((item) => {
787
834
  return item == this.preSingleTableValue
788
835
  })
@@ -799,7 +846,6 @@ export default {
799
846
  } else {
800
847
  tableCheckboxConfig.value = val
801
848
  }
802
- //console.log(tableCheckboxConfig.value);
803
849
  },
804
850
 
805
851
  // 返回被选中的值
@@ -0,0 +1,78 @@
1
+ <template>
2
+ <div class="check-handle-bar-wrap">
3
+ <div class="handle-notify-data">
4
+ <span class="handle-text">
5
+ 已选中
6
+ <span style="color: var(--color-primary); margin: 0px var(--margin-2);">
7
+ {{ checkNum }}
8
+ </span>
9
+
10
+ </span>
11
+ </div>
12
+
13
+ <div class="handle-plugin-wrap">
14
+ <el-button
15
+ type="info"
16
+ size="mini"
17
+ icon="el-icon-upload2"
18
+ v-if="exportFn"
19
+ @click="exportFn"
20
+ >
21
+ 导出选中
22
+ </el-button>
23
+ <el-button
24
+ type="info"
25
+ size="mini"
26
+ v-if="delFn"
27
+ @click="delFn"
28
+ icon="el-icon-delete"
29
+ >
30
+ 删除
31
+ </el-button>
32
+
33
+ <slot name="check-handle"></slot>
34
+ </div>
35
+ </div>
36
+ </template>
37
+
38
+ <script>
39
+ export default {
40
+ data() {
41
+ return {}
42
+ },
43
+ props: {
44
+ delFn: {},
45
+ exportFn: {},
46
+ checkedValue: {},
47
+ },
48
+ computed: {
49
+ checkNum() {
50
+ const { checkedValue } = this.$props
51
+ return checkedValue.length
52
+ },
53
+ },
54
+ methods: {},
55
+ }
56
+ </script>
57
+
58
+ <style lang="less" scoped>
59
+ .check-handle-bar-wrap {
60
+ width: 100%;
61
+ height: 32px;
62
+ display: flex;
63
+ align-items: center;
64
+ margin: calc(var(--margin-5) * 2) 0px;
65
+
66
+ .handle-notify-data {
67
+ .handle-text {
68
+ color: var(--font-color-d);
69
+ font-size: var(--font-size-s);
70
+ margin-right: var(--margin-4);
71
+ font-weight: var(--font-weight-kg);
72
+ }
73
+ }
74
+ .handle-plugin-wrap {
75
+ display: flex;
76
+ }
77
+ }
78
+ </style>
@@ -9310,6 +9310,8 @@
9310
9310
  bottom: 0px;
9311
9311
  width: 100%;
9312
9312
  height: 14px;
9313
+ z-index: 1;
9314
+ pointer-events: none;
9313
9315
  background: transparent !important;
9314
9316
  border-top: 1px solid var(--color-table-border);
9315
9317
  border-bottom: 1px solid var(--color-table-border);
package/src/App.vue CHANGED
@@ -25,6 +25,10 @@ export default {
25
25
  data() {
26
26
  return {
27
27
  test: false,
28
+ toggleList: [
29
+ { label: '开启', value: true },
30
+ { label: '关闭', value: false },
31
+ ],
28
32
  }
29
33
  },
30
34
  mounted() {
@@ -319,7 +319,7 @@ export default {
319
319
  :align="`left`"
320
320
  v-model="keyWords"
321
321
  :height="pageHeight"
322
- :isAverageWidth="true"
322
+ :isAverageWidth="false"
323
323
  :pageProps="pageProps"
324
324
  :pageConfig="pageConfig"
325
325
  :screenList="screenList"
@@ -328,7 +328,6 @@ export default {
328
328
  :headerConfig="headerConfig"
329
329
  :totalPropsList="totalPropsList"
330
330
  :proScreenConfig="proScreenConfig"
331
- :sortByApi="true"
332
331
  >
333
332
  <template>
334
333
  <base-icon
@@ -442,7 +441,7 @@ export default {
442
441
  label: '岗位编码',
443
442
  key: 'postCode',
444
443
  lock: false,
445
- width: 150,
444
+ width: 10,
446
445
  template: false,
447
446
  screen: false,
448
447
  },
@@ -450,7 +449,7 @@ export default {
450
449
  label: '岗位名称',
451
450
  key: 'postName',
452
451
  lock: false,
453
- width: 150,
452
+ width: 10,
454
453
  template: false,
455
454
  click: () => {},
456
455
  },
@@ -458,7 +457,7 @@ export default {
458
457
  label: '岗位排序',
459
458
  key: 'postSort',
460
459
  lock: false,
461
- width: 150,
460
+ width: 10,
462
461
  screen: false,
463
462
  template: false,
464
463
  },
@@ -466,20 +465,27 @@ export default {
466
465
  label: '状态',
467
466
  key: 'state',
468
467
  lock: false,
469
- width: 199,
468
+ width: 10,
470
469
  template: true,
471
470
  },
472
471
  {
473
472
  label: '创建时间',
474
473
  key: 'createTime',
475
474
  lock: false,
476
- width: 280,
475
+ width: 10,
476
+ template: false,
477
+ },
478
+ {
479
+ label: '创建时间',
480
+ key: 'createTime',
481
+ lock: false,
482
+ width: 10,
477
483
  template: false,
478
484
  },
479
485
  {
480
486
  label: '操作',
481
487
  key: 'options',
482
- lock: false,
488
+ lock: 'right',
483
489
  width: 280,
484
490
  template: true,
485
491
  },