meixioacomponent 0.2.67 → 0.2.70

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.2.67",
3
+ "version": "0.2.70",
4
4
  "private": false,
5
5
  "author": "YuRi",
6
6
  "main": "lib/meixioacomponent.umd.min.js",
@@ -10,11 +10,11 @@
10
10
  <el-button
11
11
  size="medium"
12
12
  :class="{
13
- 'is-plain': !showProScreenList,
13
+ 'is-plain': !proScreenCardShow,
14
14
  }"
15
- :disabled="_proScreenList.length <= 0"
16
- @click="handleProScreenList"
17
- :type="showProScreenList ? 'selected' : 'info'"
15
+ :disabled="_proScreenList.length <= 0 && !proScreenCardShow"
16
+ @click="handleProScreenList(false)"
17
+ :type="proScreenCardShow ? 'selected' : 'info'"
18
18
  >{{ handleScreenText }} <i :class="handleScreenIcon"></i>
19
19
  </el-button>
20
20
  <el-button size="medium" plain type="info" @click="handleOpenProScreen">
@@ -23,7 +23,7 @@
23
23
  </el-button>
24
24
  </searchHeaderVue>
25
25
 
26
- <div class="search-mid-content" v-show="showProScreenList">
26
+ <div class="search-mid-content" v-show="proScreenCardShow">
27
27
  <el-card class="box-card">
28
28
  <div class="box-card-title">
29
29
  <span class="tips-text">筛选条件</span>
@@ -106,11 +106,14 @@ export default {
106
106
  oa_pro_screen_itemVue,
107
107
  },
108
108
  computed: {
109
+ proScreenCardShow() {
110
+ return this._proScreenList.length > 0 && this.showProScreenList;
111
+ },
109
112
  handleScreenIcon() {
110
- return this.showProScreenList ? "el-icon-arrow-up" : "el-icon-arrow-down";
113
+ return this.proScreenCardShow ? "el-icon-arrow-up" : "el-icon-arrow-down";
111
114
  },
112
115
  handleScreenText() {
113
- return this.showProScreenList ? "收起筛选" : "展开筛选";
116
+ return this.proScreenCardShow ? "收起筛选" : "展开筛选";
114
117
  },
115
118
 
116
119
  _proScreenList() {
@@ -141,8 +144,13 @@ export default {
141
144
  handleSearch() {
142
145
  this.$parent.refreshData();
143
146
  },
144
- handleProScreenList() {
145
- this.showProScreenList = !this.showProScreenList;
147
+ handleProScreenList(flag = false) {
148
+ if (!flag) {
149
+ this.showProScreenList = !this.showProScreenList;
150
+ } else {
151
+ this.showProScreenList = true;
152
+ }
153
+
146
154
  this.computedHeight();
147
155
  },
148
156
  handleScreen(index) {
@@ -176,15 +184,19 @@ export default {
176
184
  type: "info",
177
185
  plain: true,
178
186
  click: () => {
179
- this.$parent.cleanProscreenCondition();
180
- this.$nextTick(() => {
181
- this.$parent.refreshData();
182
- });
187
+ this.$parent.cleanProscreenCondition(true);
183
188
  },
184
189
  },
185
190
  ];
186
191
  },
187
192
  },
193
+ watch: {
194
+ proScreenCardShow(newVal, oldVal) {
195
+ if (!newVal) {
196
+ this.showProScreenList = false;
197
+ }
198
+ },
199
+ },
188
200
  };
189
201
  </script>
190
202
 
@@ -119,10 +119,13 @@ export default {
119
119
 
120
120
  deleteProscreen() {
121
121
  const { config } = this.$props;
122
- let index = config.findIndex((configItem) => {
123
- return configItem.key == this.item.key;
124
- });
125
- config[index].isCheck = false;
122
+ if (config) {
123
+ let index = config.findIndex((configItem) => {
124
+ return configItem.key == this.item.key;
125
+ });
126
+ config[index].isCheck = false;
127
+ }
128
+
126
129
  this.$emit("deleteProscreenItem");
127
130
  },
128
131
  trigerCheck(index, params) {
@@ -24,6 +24,7 @@
24
24
  <div class="oa-pro-table-search">
25
25
  <oa_pro_table_searchVue
26
26
  v-model="module"
27
+ ref="oaProTableSearch"
27
28
  :screenList="screenList"
28
29
  :placeholder="placeholder"
29
30
  :proScreenList="proScreenList"
@@ -231,6 +232,9 @@ export default {
231
232
 
232
233
  // 是否开启表格横向条纹
233
234
  borderRow: true,
235
+
236
+ // 倒计时
237
+ triggerDown: null,
234
238
  };
235
239
  },
236
240
  created() {
@@ -242,6 +246,7 @@ export default {
242
246
  },
243
247
  beforeDestroy() {
244
248
  componentConfig.eventBus.$off("handleTableBorder", this.handleTableBorder);
249
+ clearTimeout(this.triggerDown);
245
250
  },
246
251
  computed: {
247
252
  config() {
@@ -447,7 +452,8 @@ export default {
447
452
  cellMouseEnter(row, column, cell, event) {
448
453
  let content = row[`${column.property}`];
449
454
  this.tooltip.show = false;
450
- if (!content) return;
455
+ if (typeof content == Boolean || typeof content == Object || !content)
456
+ return;
451
457
  const { tooltip } = this;
452
458
  let style = event.target;
453
459
  let position = style.getBoundingClientRect();
@@ -620,6 +626,7 @@ export default {
620
626
  plain: false,
621
627
  click: () => {
622
628
  this.dialogProscreenConfirm(true);
629
+ this.$refs.oaProTableSearch.handleProScreenList(true);
623
630
  },
624
631
  },
625
632
  ];
@@ -630,12 +637,14 @@ export default {
630
637
  if (this.$props.screenList) {
631
638
  let _screenListIndexItem =
632
639
  this.$props.screenList.list[this.$props.screenList.index];
633
- result[`keyword`] = this.module;
634
640
  result[`${_screenListIndexItem.key}`] = _screenListIndexItem.value;
635
641
  }
636
-
642
+ result[`keyword`] = this.module;
637
643
  this.proScreenList.forEach((item) => {
638
- result[`${item.key}`] = item.value;
644
+ const { key, value } = item;
645
+ if (typeof value == Number || typeof value == Boolean || value) {
646
+ result[`${key}`] = value;
647
+ }
639
648
  });
640
649
  result = Object.assign(result, this.$props.pageProps);
641
650
  return result;
@@ -650,24 +659,19 @@ export default {
650
659
  }
651
660
 
652
661
  let screenResult = this.returnProScreenResult();
653
- this.$props.httpRequire(screenResult).then((res) => {
654
- this.setTableData(res);
662
+ this.$props.httpRequire(screenResult).then((res, immediately = false) => {
663
+ this.setTableData(res, immediately);
655
664
  });
656
665
  },
657
666
  // 设置表格数据
658
- setTableData(data) {
667
+ setTableData(data, immediately = false) {
659
668
  this.tableData = [];
660
- setTimeout(() => {
661
- this.tableData = data;
662
- if (this.tableData.length == 0) {
663
- this.defaultSvg = true;
664
- }
665
- this.loading = false;
666
- this.computedTotalList();
667
- this.$nextTick(() => {
668
- this.scrollToTop();
669
- });
670
- }, 1000);
669
+ this.tableData = data;
670
+ if (immediately) {
671
+ this.tableDataCompleted();
672
+ } else {
673
+ this.setTriggerDown();
674
+ }
671
675
  },
672
676
 
673
677
  // 表格如果有滚动条将滚动条拉到顶部
@@ -685,11 +689,14 @@ export default {
685
689
  });
686
690
  },
687
691
  // 清空高级筛选的条件
688
- cleanProscreenCondition() {
692
+ cleanProscreenCondition(flag = false) {
689
693
  if (this.proScreenList.length <= 0) return;
690
694
  this.proScreenList.forEach((item) => {
691
695
  item.value = null;
692
696
  });
697
+ if (flag) {
698
+ this.refreshData(true);
699
+ }
693
700
  },
694
701
  // 自定义表格的列
695
702
  setTableHeaderConfig(configList) {
@@ -706,7 +713,7 @@ export default {
706
713
  label: "",
707
714
  key: "noData",
708
715
  lock: false,
709
- width: 80,
716
+ width: 30,
710
717
  show: true,
711
718
  template: false,
712
719
  });
@@ -761,10 +768,26 @@ export default {
761
768
  handleTableBorder(params) {
762
769
  this[`${params.key}`] = params.value;
763
770
  },
771
+
772
+ setTriggerDown() {
773
+ clearTimeout(this.triggerDown);
774
+ this.triggerDown = setTimeout(() => {
775
+ this.tableDataCompleted();
776
+ }, 1000);
777
+ },
778
+
779
+ tableDataCompleted() {
780
+ if (this.tableData.length == 0) {
781
+ this.defaultSvg = true;
782
+ }
783
+ this.loading = false;
784
+ this.computedTotalList();
785
+ this.$nextTick(() => {
786
+ this.scrollToTop();
787
+ });
788
+ },
764
789
  },
765
- watch: {
766
- fixedList(newValue, oldValue) {},
767
- },
790
+ watch: {},
768
791
  };
769
792
  </script>
770
793