meixioacomponent 0.3.99 → 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meixioacomponent",
3
- "version": "0.3.99",
3
+ "version": "0.4.00",
4
4
  "private": false,
5
5
  "author": "YuRi",
6
6
  "main": "lib/meixioacomponent.umd.min.js",
@@ -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
  <!-- 表格内容 -->
@@ -216,6 +228,7 @@ import oa_pro_colum_configVue from './oa_pro_colum_config.vue' //表格列配置
216
228
  import oa_pro_table_skeletonVue from './oa_pro_table_skeleton.vue' //表格骨架屏
217
229
  import baseDefaultSvgVue from '../base/baseDefaultSvg/baseDefaultSvg.vue' //缺省页组件
218
230
  import baseButtonHandle from '../base/baseButtonHandle/baseButtonHandle.vue' //通用组件 排列尾部按钮的组件
231
+ import oa_pro_table_check_handle_barVue from './oa_pro_table_check_handle_bar.vue' // 当表格有行被选中的时候
219
232
 
220
233
  //
221
234
  import componentConfig from '../../config/componentConfig'
@@ -310,6 +323,11 @@ export default {
310
323
  return item.show
311
324
  })
312
325
  },
326
+
327
+ isCheckTableRow() {
328
+ const { tableCheckboxConfig } = this.$props
329
+ return tableCheckboxConfig.value.length > 0
330
+ },
313
331
  },
314
332
  props: {
315
333
  // 当加载树形结构的表格时必须传入该值
@@ -436,6 +454,16 @@ export default {
436
454
  type: Boolean,
437
455
  default: true,
438
456
  },
457
+
458
+ // 行被选中删除的方法
459
+ delFn: {
460
+ type: Function,
461
+ },
462
+
463
+ // 行被选中导出的方法
464
+ exportFn: {
465
+ type: Function,
466
+ },
439
467
  },
440
468
  components: {
441
469
  oaProHeader,
@@ -447,6 +475,7 @@ export default {
447
475
  oa_pro_table_searchVue,
448
476
  oa_pro_colum_configVue,
449
477
  oa_pro_table_skeletonVue,
478
+ oa_pro_table_check_handle_barVue,
450
479
  },
451
480
  methods: {
452
481
  isToolTip(value) {
@@ -796,6 +825,11 @@ export default {
796
825
  this.preSingleTableValue = val[0]
797
826
  tableCheckboxConfig.value = val
798
827
  } else {
828
+ if (val.length == 0) {
829
+ this.preSingleTableValue = null
830
+ tableCheckboxConfig.value = []
831
+ return
832
+ }
799
833
  let index = val.findIndex((item) => {
800
834
  return item == this.preSingleTableValue
801
835
  })
@@ -812,7 +846,6 @@ export default {
812
846
  } else {
813
847
  tableCheckboxConfig.value = val
814
848
  }
815
- //console.log(tableCheckboxConfig.value);
816
849
  },
817
850
 
818
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>
package/src/App.vue CHANGED
@@ -1,13 +1,7 @@
1
1
  <template>
2
2
  <div id="app">
3
3
  <div style="height: 100vh;">
4
- <!-- <testVue></testVue> -->
5
-
6
- <base-toggle
7
- :toggleList="toggleList"
8
- v-model="test"
9
- :disabled="true"
10
- ></base-toggle>
4
+ <testVue></testVue>
11
5
  </div>
12
6
  </div>
13
7
  </template>