eoss-ui 0.5.45 → 0.5.47

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.
Files changed (127) hide show
  1. package/lib/button.js +137 -144
  2. package/lib/calendar.js +769 -0
  3. package/lib/cascader.js +2 -2
  4. package/lib/checkbox-group.js +4 -2
  5. package/lib/clients.js +2 -2
  6. package/lib/data-table-form.js +36 -13
  7. package/lib/data-table.js +39 -37
  8. package/lib/date-picker.js +2 -2
  9. package/lib/dialog.js +10 -13
  10. package/lib/enterprise.js +2 -2
  11. package/lib/eoss-ui.common.js +1265 -721
  12. package/lib/error-page.js +2 -2
  13. package/lib/flow-group.js +9 -21
  14. package/lib/flow-list.js +2 -2
  15. package/lib/form.js +215 -231
  16. package/lib/handle-user.js +5 -11
  17. package/lib/handler.js +2 -2
  18. package/lib/icons.js +2 -2
  19. package/lib/index.js +1 -1
  20. package/lib/input-number.js +2 -2
  21. package/lib/input.js +2 -2
  22. package/lib/label.js +2 -2
  23. package/lib/menu.js +2 -2
  24. package/lib/nav.js +5 -5
  25. package/lib/notify.js +2 -2
  26. package/lib/page.js +2 -2
  27. package/lib/pagination.js +2 -2
  28. package/lib/player.js +2 -2
  29. package/lib/qr-code.js +2 -2
  30. package/lib/radio-group.js +2 -2
  31. package/lib/retrial-auth.js +2 -2
  32. package/lib/select-ganged.js +2 -2
  33. package/lib/select.js +2 -2
  34. package/lib/selector.js +2 -2
  35. package/lib/sizer.js +9 -9
  36. package/lib/steps.js +2 -2
  37. package/lib/switch.js +2 -2
  38. package/lib/table-form.js +2 -2
  39. package/lib/tabs-panel.js +2 -2
  40. package/lib/tabs.js +2 -2
  41. package/lib/theme-chalk/cascader.css +1 -0
  42. package/lib/theme-chalk/data-table-form.css +1 -1
  43. package/lib/theme-chalk/index.css +1 -1
  44. package/lib/theme-chalk/toolbar.css +1 -1
  45. package/lib/tips.js +2 -2
  46. package/lib/toolbar.js +22 -37
  47. package/lib/tree-group.js +2 -2
  48. package/lib/tree.js +2 -2
  49. package/lib/wujie.js +2 -2
  50. package/lib/wxlogin.js +2 -2
  51. package/package.json +1 -1
  52. package/packages/button/src/main.vue +2 -9
  53. package/packages/calendar/index.js +5 -0
  54. package/packages/calendar/src/main.vue +386 -0
  55. package/packages/data-table/src/main.vue +40 -28
  56. package/packages/data-table-form/src/main.vue +30 -23
  57. package/packages/data-table-form/src/table.vue +16 -3
  58. package/packages/dialog/src/main.vue +5 -9
  59. package/packages/flow-group/src/main.vue +5 -17
  60. package/packages/handle-user/src/main.vue +1 -7
  61. package/packages/nav/src/main.vue +1 -1
  62. package/packages/theme-chalk/gulpfile.js +25 -0
  63. package/packages/theme-chalk/src/cascader.scss +93 -0
  64. package/packages/theme-chalk/src/data-table-form.scss +11 -0
  65. package/packages/theme-chalk/src/index.scss +2 -1
  66. package/packages/theme-chalk/src/toolbar.scss +13 -11
  67. package/packages/toolbar/src/main.vue +39 -52
  68. package/src/index.js +7 -4
  69. package/CHANGELOG.md +0 -929
  70. package/packages/theme-chalk/lib/base.css +0 -1
  71. package/packages/theme-chalk/lib/button-group.css +0 -1
  72. package/packages/theme-chalk/lib/button.css +0 -1
  73. package/packages/theme-chalk/lib/card.css +0 -1
  74. package/packages/theme-chalk/lib/checkbox-group.css +0 -1
  75. package/packages/theme-chalk/lib/clients.css +0 -1
  76. package/packages/theme-chalk/lib/data-table-form.css +0 -1
  77. package/packages/theme-chalk/lib/data-table.css +0 -1
  78. package/packages/theme-chalk/lib/date-picker.css +0 -1
  79. package/packages/theme-chalk/lib/dialog.css +0 -1
  80. package/packages/theme-chalk/lib/enterprise.css +0 -1
  81. package/packages/theme-chalk/lib/error-page.css +0 -1
  82. package/packages/theme-chalk/lib/flow-group.css +0 -1
  83. package/packages/theme-chalk/lib/flow-list.css +0 -1
  84. package/packages/theme-chalk/lib/flow.css +0 -1
  85. package/packages/theme-chalk/lib/fonts/iconfont.ttf +0 -0
  86. package/packages/theme-chalk/lib/fonts/iconfont.woff +0 -0
  87. package/packages/theme-chalk/lib/form.css +0 -1
  88. package/packages/theme-chalk/lib/handle-user.css +0 -1
  89. package/packages/theme-chalk/lib/handler.css +0 -1
  90. package/packages/theme-chalk/lib/icon.css +0 -1
  91. package/packages/theme-chalk/lib/icons.css +0 -1
  92. package/packages/theme-chalk/lib/index.css +0 -1
  93. package/packages/theme-chalk/lib/input-number.css +0 -0
  94. package/packages/theme-chalk/lib/input.css +0 -1
  95. package/packages/theme-chalk/lib/label.css +0 -1
  96. package/packages/theme-chalk/lib/layout.css +0 -1
  97. package/packages/theme-chalk/lib/login.css +0 -1
  98. package/packages/theme-chalk/lib/main.css +0 -1
  99. package/packages/theme-chalk/lib/mainComp.css +0 -0
  100. package/packages/theme-chalk/lib/menu.css +0 -1
  101. package/packages/theme-chalk/lib/nav.css +0 -1
  102. package/packages/theme-chalk/lib/notify.css +0 -0
  103. package/packages/theme-chalk/lib/page.css +0 -1
  104. package/packages/theme-chalk/lib/pagination.css +0 -1
  105. package/packages/theme-chalk/lib/player.css +0 -1
  106. package/packages/theme-chalk/lib/qr-code.css +0 -1
  107. package/packages/theme-chalk/lib/radio-group.css +0 -1
  108. package/packages/theme-chalk/lib/retrial-auth.css +0 -1
  109. package/packages/theme-chalk/lib/select-ganged.css +0 -1
  110. package/packages/theme-chalk/lib/select.css +0 -1
  111. package/packages/theme-chalk/lib/selector-panel.css +0 -1
  112. package/packages/theme-chalk/lib/selector.css +0 -1
  113. package/packages/theme-chalk/lib/sizer.css +0 -1
  114. package/packages/theme-chalk/lib/steps.css +0 -1
  115. package/packages/theme-chalk/lib/switch.css +0 -1
  116. package/packages/theme-chalk/lib/table-form.css +0 -0
  117. package/packages/theme-chalk/lib/tabs-panel.css +0 -0
  118. package/packages/theme-chalk/lib/tabs.css +0 -1
  119. package/packages/theme-chalk/lib/tips.css +0 -1
  120. package/packages/theme-chalk/lib/toolbar.css +0 -1
  121. package/packages/theme-chalk/lib/tree-group.css +0 -1
  122. package/packages/theme-chalk/lib/tree.css +0 -1
  123. package/packages/theme-chalk/lib/upload.css +0 -1
  124. package/packages/theme-chalk/lib/wujie.css +0 -0
  125. package/packages/theme-chalk/lib/wxlogin.css +0 -1
  126. /package/{packages/theme-chalk/lib/cascader.css → lib/theme-chalk/calendar.css} +0 -0
  127. /package/packages/theme-chalk/{lib/flow-chart.css → src/calendar.scss} +0 -0
@@ -373,7 +373,11 @@ export default {
373
373
  least: Boolean,
374
374
  //保留搜索参数
375
375
  retainSearh: Boolean,
376
- infiniteScroll: Boolean
376
+ infiniteScroll: Boolean,
377
+ isJoin: {
378
+ type: Boolean,
379
+ default: true
380
+ }
377
381
  },
378
382
  data() {
379
383
  return {
@@ -405,6 +409,13 @@ export default {
405
409
  };
406
410
  },
407
411
  computed: {
412
+ params() {
413
+ return {
414
+ ...(this.param || {}),
415
+ ...(this.searchValue || {}),
416
+ ...(this.advanceValue || {})
417
+ };
418
+ },
408
419
  tag() {
409
420
  return this.form && this.elForm == '' ? 'el-form' : 'div';
410
421
  },
@@ -878,7 +889,7 @@ export default {
878
889
  this.tableLoadingText = '加载中...';
879
890
  let reqData = util.extend(
880
891
  {},
881
- this.param,
892
+ this.params,
882
893
  this.page
883
894
  ? {
884
895
  pageNum: this.config.pageNum,
@@ -892,6 +903,13 @@ export default {
892
903
  if (this.retainSearh) {
893
904
  reqData = util.extend({}, reqData, this.wheres);
894
905
  }
906
+ if (this.isJoin) {
907
+ for (let i in reqData) {
908
+ if (Array.isArray(reqData[i])) {
909
+ reqData[i] = reqData[i].join(',');
910
+ }
911
+ }
912
+ }
895
913
  this.tableLoading = true;
896
914
  util
897
915
  .ajax({
@@ -1281,50 +1299,44 @@ export default {
1281
1299
  this.$emit('next', res);
1282
1300
  },
1283
1301
  hanleSearch(data) {
1284
- this.wheres = data;
1285
- if (this.url) {
1286
- if (this.response !== undefined) {
1287
- this.getTableData({
1288
- where: this.response({
1302
+ this.wheres =
1303
+ this.response !== undefined
1304
+ ? this.response({
1289
1305
  type: 'search',
1290
1306
  data: JSON.parse(JSON.stringify(data))
1291
1307
  })
1292
- });
1293
- } else {
1294
- this.getTableData({ where: this.wheres });
1295
- }
1308
+ : data;
1309
+ if (this.url) {
1310
+ this.getTableData();
1296
1311
  }
1297
- this.$emit('search', data);
1312
+ this.$emit('search', this.wheres);
1298
1313
  },
1299
1314
  hanleReset() {
1300
1315
  if (this.url) {
1301
1316
  this.wheres = {};
1302
1317
  this.getTableData();
1303
1318
  }
1304
- this.$emit('reset');
1319
+ this.$emit('reset', this.params);
1305
1320
  },
1306
1321
  hanleSubmit({ data, show }) {
1307
- this.wheres = data;
1308
- if (this.url) {
1309
- if (this.response !== undefined) {
1310
- this.getTableData({
1311
- where: this.response({
1322
+ this.wheres =
1323
+ this.response !== undefined
1324
+ ? this.response({
1312
1325
  type: 'filter',
1313
1326
  data: JSON.parse(JSON.stringify(data))
1314
1327
  })
1315
- });
1316
- } else {
1317
- this.getTableData({ where: this.wheres });
1318
- }
1328
+ : data;
1329
+ if (this.url) {
1330
+ this.getTableData();
1319
1331
  }
1320
- this.$emit('submit', { data, show });
1332
+ this.$emit('submit', { data: this.wheres, show });
1321
1333
  },
1322
1334
  hanleCancel() {
1323
- if (this.url && JSON.stringify(this.wheres) !== '{}') {
1324
- this.wheres = {};
1325
- this.getTableData();
1326
- }
1327
- this.$emit('cancel');
1335
+ // if (this.url && JSON.stringify(this.wheres) !== '{}') {
1336
+ // this.wheres = {};
1337
+ // this.getTableData();
1338
+ // }
1339
+ this.$emit('cancel', this.params);
1328
1340
  },
1329
1341
  handleTabs({ item, index }) {
1330
1342
  if (this.url) {
@@ -44,9 +44,9 @@ export default {
44
44
  },
45
45
  cols() {
46
46
  let col = [];
47
- this.theads.forEach(items => {
47
+ this.theads.forEach((items) => {
48
48
  if (Array.isArray(items)) {
49
- items.forEach(item => {
49
+ items.forEach((item) => {
50
50
  if (!item.rowspan || item.rowspan < 2) {
51
51
  col.push(item);
52
52
  }
@@ -64,9 +64,9 @@ export default {
64
64
  },
65
65
  types() {
66
66
  let types = [];
67
- this.theads.forEach(items => {
67
+ this.theads.forEach((items) => {
68
68
  if (Array.isArray(items)) {
69
- items.forEach(item => {
69
+ items.forEach((item) => {
70
70
  if (item.type && item.type !== 'text' && item.type !== 'textarea') {
71
71
  types.push(item);
72
72
  }
@@ -91,9 +91,9 @@ export default {
91
91
  deep: true,
92
92
  handler(val) {
93
93
  if (val) {
94
- val.forEach(items => {
94
+ val.forEach((items) => {
95
95
  if (Array.isArray(items)) {
96
- items.forEach(item => {
96
+ items.forEach((item) => {
97
97
  this.getOptions(item);
98
98
  });
99
99
  } else {
@@ -121,7 +121,7 @@ export default {
121
121
  params: params,
122
122
  data: params
123
123
  })
124
- .then(res => {
124
+ .then((res) => {
125
125
  if (res.rCode === 0) {
126
126
  this.option[item.field || item.prop] = JSON.parse(
127
127
  JSON.stringify(res.results)
@@ -137,7 +137,7 @@ export default {
137
137
  this.$message.error(msg);
138
138
  }
139
139
  })
140
- .catch(err => {
140
+ .catch((err) => {
141
141
  if (err.message && err.message !== 'canceled') {
142
142
  this.$message.error(err.message);
143
143
  }
@@ -147,21 +147,28 @@ export default {
147
147
  },
148
148
  render(h) {
149
149
  let tag = this.elForm ? 'div' : 'form';
150
- return h(tag, {}, [
151
- h('eo-table', {
152
- props: {
153
- cols: this.cols,
154
- thead: this.theads,
155
- numbers: this.numbers,
156
- cols: this.cols,
157
- data: this.models,
158
- types: this.types,
159
- options: this.options,
160
- page: this.page
161
- },
162
- on: this.$listeners
163
- })
164
- ]);
150
+ return h(
151
+ tag,
152
+ {
153
+ class: { 'es-data-form-full': this.full, 'es-data-table-form': 1 }
154
+ },
155
+ [
156
+ h('eo-table', {
157
+ props: {
158
+ cols: this.cols,
159
+ thead: this.theads,
160
+ numbers: this.numbers,
161
+ cols: this.cols,
162
+ data: this.models,
163
+ types: this.types,
164
+ options: this.options,
165
+ page: this.page,
166
+ ...this.$attrs
167
+ },
168
+ on: this.$listeners
169
+ })
170
+ ]
171
+ );
165
172
  }
166
173
  };
167
174
  </script>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="es-data-form">
2
+ <div class="es-data-form" :class="{ 'es-data-form-haspage': page }">
3
3
  <el-scrollbar class="es-scrollbar" :style="{ height: height }">
4
4
  <table
5
5
  class="es-data-table-form"
@@ -49,6 +49,7 @@
49
49
  <es-select
50
50
  v-else-if="item.type === 'select' && selectShow"
51
51
  class="es-data-table-form-handle"
52
+ :suffix="false"
52
53
  v-bind="exclAttribute({ data: item, attrs: 'width' })"
53
54
  v-model="selectValue"
54
55
  ref="tableSelect"
@@ -113,6 +114,11 @@ export default {
113
114
  eoTable: this
114
115
  };
115
116
  },
117
+ inject: {
118
+ esDialog: {
119
+ default: ''
120
+ }
121
+ },
116
122
  props: {
117
123
  height: String,
118
124
  readonly: Boolean,
@@ -186,8 +192,15 @@ export default {
186
192
  }
187
193
  },
188
194
  setStyle(res, data, field) {
189
- this.style.left = res ? res.left + 'px' : '';
190
- this.style.top = res ? res.top + 'px' : '';
195
+ let left = 0;
196
+ let top = 0;
197
+ if (this.esDialog) {
198
+ let style = this.esDialog.getDialog().getBoundingClientRect();
199
+ left = style.left;
200
+ top = style.top;
201
+ }
202
+ this.style.left = res ? res.left - left + 'px' : '';
203
+ this.style.top = res ? res.top - top + 'px' : '';
191
204
  this.style.width = res ? res.width + 'px' : '';
192
205
  this.target = data;
193
206
  this.field = field;
@@ -381,15 +381,8 @@ export default {
381
381
  created() {
382
382
  let availWidth = 0;
383
383
  let availHeight = 0;
384
- let win;
385
- try {
386
- util.win.top.document;
387
- win = util.win.top;
388
- } catch (error) {
389
- win = util.getMyWinTop();
390
- }
391
- availWidth = win.document.body.offsetWidth - 260;
392
- availHeight = win.document.body.offsetHeight - 60;
384
+ availWidth = util.win.top.document.body.offsetWidth - 260;
385
+ availHeight = util.win.top.document.body.offsetHeight - 60;
393
386
  this.sizes.max = { width: `${availWidth}px`, height: `${availHeight}px` };
394
387
  if (
395
388
  this.size === 'full' ||
@@ -475,6 +468,9 @@ export default {
475
468
  this.zoom = res;
476
469
  this.$set(this.scales, 'zoom', res);
477
470
  this.$emit('scale', res);
471
+ },
472
+ getDialog() {
473
+ return this.$refs[this.wujieName].$refs['dialog'];
478
474
  }
479
475
  }
480
476
  };
@@ -575,13 +575,7 @@ export default {
575
575
  let name = item.name;
576
576
  let width = 0;
577
577
  let height = 0;
578
- let win;
579
- try {
580
- util.win.top.document;
581
- win = util.win.top;
582
- } catch (error) {
583
- win = util.getMyWinTop();
584
- }
578
+ let win = util.win.top;
585
579
  width = win.screen.availWidth - 10;
586
580
  height = win.screen.availHeight - 60;
587
581
  if (item.url) {
@@ -654,16 +648,10 @@ export default {
654
648
  handleSuccess() {
655
649
  if (this.closeDialog && this.esDialog) {
656
650
  this.esDialog.handleClose();
657
- } else if (util.win.opener) {
658
- let win;
659
- try {
660
- util.win.top.document;
661
- win = util.win.top;
662
- } catch (error) {
663
- win = util.getMyWinTop();
664
- }
665
- win.close();
666
- win.postMessage({ type: 0 }, '*');
651
+ } else if (util.win.top.COOS_SDK) {
652
+ util.win.top.COOS_SDK.closePopup && util.win.top.COOS_SDK.closePopup();
653
+ } else if (util.win.top.opener) {
654
+ util.win.top.close();
667
655
  }
668
656
  if (this.events && this.events.success) {
669
657
  this.events.success();
@@ -98,13 +98,7 @@ export default {
98
98
  duration: 500,
99
99
  onClose: () => {
100
100
  util.removeStorage(['mainConfig', 'jump']);
101
- let win;
102
- try {
103
- util.win.top.document;
104
- win = util.win.top;
105
- } catch (error) {
106
- win = util.getMyWinTop();
107
- }
101
+ let win = util.win.top;
108
102
  win.location.reload();
109
103
  }
110
104
  });
@@ -109,7 +109,7 @@ export default {
109
109
  let active =
110
110
  typeof this.defaultActive === 'string'
111
111
  ? this.defaultActive
112
- : this.defaultActive.length
112
+ : this.defaultActive && this.defaultActive.length
113
113
  ? this.defaultActive[this.defaultActive.length - 1]
114
114
  : undefined;
115
115
  return active;
@@ -0,0 +1,25 @@
1
+ 'use strict';
2
+
3
+ const { series, src, dest } = require('gulp');
4
+ const sass = require('gulp-sass');
5
+ const autoprefixer = require('gulp-autoprefixer');
6
+ const cssmin = require('gulp-cssmin');
7
+
8
+ function compile() {
9
+ return src('./src/*.scss')
10
+ .pipe(sass.sync())
11
+ .pipe(autoprefixer({
12
+ overrideBrowserslist: ['ie > 9', 'last 2 versions'],
13
+ cascade: false
14
+ }))
15
+ .pipe(cssmin())
16
+ .pipe(dest('./lib'));
17
+ }
18
+
19
+ function copyfont() {
20
+ return src('./src/fonts/**')
21
+ .pipe(cssmin())
22
+ .pipe(dest('./lib/fonts'));
23
+ }
24
+
25
+ exports.build = series(compile, copyfont);
@@ -0,0 +1,93 @@
1
+ .es-calendar {
2
+ background-color: #fff;
3
+ .es-calendar-title {
4
+ height: 44px;
5
+ padding: 12px 30px;
6
+ background-color: #ffffff;
7
+ font-family: PingFang SC, PingFang SC;
8
+ font-weight: 400;
9
+ font-size: 14px;
10
+ color: #262626;
11
+ line-height: 20px;
12
+ text-align: center;
13
+ position: relative;
14
+ display: flex;
15
+ justify-content: center;
16
+ .es-calendar-prev,
17
+ .es-calendar-next {
18
+ cursor: pointer;
19
+ font-size: 14px;
20
+ color: #8c8c8c;
21
+ line-height: 20px;
22
+ }
23
+ .es-calendar-prev {
24
+ margin-right: 8px;
25
+ }
26
+ .es-calendar-next {
27
+ margin-left: 8px;
28
+ }
29
+ .es-title {
30
+ width: 86px;
31
+ }
32
+ }
33
+ .es-calendar-weeks {
34
+ display: flex;
35
+ flex-wrap: wrap;
36
+ .es-week {
37
+ width: (100% / 7);
38
+ height: 20px;
39
+ text-align: center;
40
+ line-height: 20px;
41
+ font-weight: 400;
42
+ font-size: 12px;
43
+ color: #8c8c8c;
44
+ }
45
+ }
46
+ .es-calendar-days {
47
+ display: flex;
48
+ flex-wrap: wrap;
49
+ .es-day {
50
+ width: (100% / 7);
51
+ height: 44px;
52
+ display: flex;
53
+ align-items: center;
54
+ justify-content: center;
55
+ .es-day-item {
56
+ width: 28px;
57
+ height: 28px;
58
+ font-weight: 400;
59
+ font-size: 14px;
60
+ color: #262626;
61
+ text-align: center;
62
+ line-height: 28px;
63
+ position: relative;
64
+ cursor: pointer;
65
+ &.es-disabled-day {
66
+ color: #bfbfbf;
67
+ }
68
+ &.es-today {
69
+ color: #2778e5;
70
+ border: 1px solid #2778e5;
71
+ line-height: 26px;
72
+ border-radius: 15px 15px 15px 15px;
73
+ }
74
+ &.es-select {
75
+ color: #fff;
76
+ background-color: #2778e5;
77
+ border-radius: 15px 15px 15px 15px;
78
+ }
79
+ }
80
+ }
81
+ }
82
+ .es-calendar-switch {
83
+ height: 22px;
84
+ line-height: 22px;
85
+ font-weight: bold;
86
+ text-align: center;
87
+ color: #8c8c8c;
88
+ .es-switch-icon {
89
+ font-size: 14px;
90
+ cursor: pointer;
91
+ }
92
+ }
93
+ }
@@ -38,6 +38,17 @@
38
38
  .es-data-form-head {
39
39
  background-color: $--table-header-background-color;
40
40
  }
41
+ &.es-data-form-full {
42
+ height: 100%;
43
+ .es-data-form {
44
+ height: 100%;
45
+ &.es-data-form-haspage {
46
+ .es-scrollbar {
47
+ height: calc(100% - 46px);
48
+ }
49
+ }
50
+ }
51
+ }
41
52
  }
42
53
  .es-data-form {
43
54
  position: relative;
@@ -1,9 +1,10 @@
1
1
  @import "./base.scss";
2
2
  @import "./button.scss";
3
3
  @import "./button-group.scss";
4
- @import "./checkbox-group.scss";
4
+ @import "./calendar.scss";
5
5
  @import "./card.scss";
6
6
  @import "./cascader.scss";
7
+ @import "./checkbox-group.scss";
7
8
  @import "./clients.scss";
8
9
  @import "./data-table.scss";
9
10
  @import "./data-table-form.scss";
@@ -107,6 +107,19 @@
107
107
  }
108
108
  }
109
109
  }
110
+ .es-form-search-small {
111
+ .el-form-item__content {
112
+ line-height: 32px !important;
113
+ }
114
+ .el-form-item__label {
115
+ line-height: 32px !important;
116
+ height: 32px;
117
+ }
118
+ }
119
+ .el-button.es-upload {
120
+ padding: 0 !important;
121
+ border: 0 !important;
122
+ }
110
123
  .es-advanced-filter {
111
124
  margin-top: 20px;
112
125
  z-index: 9;
@@ -129,15 +142,4 @@
129
142
  }
130
143
  }
131
144
  }
132
- .el-form-item__content {
133
- line-height: 32px !important;
134
- }
135
- .el-form-item__label {
136
- line-height: 32px !important;
137
- height: 32px;
138
- }
139
- .el-button.es-upload {
140
- padding: 0 !important;
141
- border: 0 !important;
142
- }
143
145
  }
@@ -51,41 +51,25 @@ export default {
51
51
  default: 'auto'
52
52
  }
53
53
  },
54
- computed: {
55
- searchData: {
56
- get() {
57
- let value;
58
- for (let i = 0; i < this.contents.length; i++) {
59
- if (this.contents[i].type === 'search') {
60
- value = this.contents[i].value || this.contents[i].searchValue;
61
- break;
62
- }
63
- }
64
- return value ? value : this.searchValue;
65
- },
66
- set(val) {
67
- return val;
54
+ watch: {
55
+ searchValue: {
56
+ deep: true,
57
+ handler(val) {
58
+ this.searchData = JSON.parse(JSON.stringify(val));
68
59
  }
69
60
  },
70
- advancedData: {
71
- get() {
72
- let value;
73
- for (let i = 0; i < this.contents.length; i++) {
74
- if (this.contents[i].type === 'filter') {
75
- value = this.contents[i].value || this.contents[i].searchValue;
76
- break;
77
- }
78
- }
79
- return value ? value : this.advanceValue;
80
- },
81
- set(val) {
82
- return val;
61
+ advanceValue: {
62
+ deep: true,
63
+ handler(val) {
64
+ this.advancedData = JSON.parse(JSON.stringify(val));
83
65
  }
84
66
  }
85
67
  },
86
68
  data() {
87
69
  return {
88
- show: false
70
+ show: false,
71
+ searchData: JSON.parse(JSON.stringify(this.searchValue)),
72
+ advancedData: JSON.parse(JSON.stringify(this.advanceValue))
89
73
  };
90
74
  },
91
75
  created() {
@@ -132,13 +116,14 @@ export default {
132
116
  },
133
117
  hanleReset() {
134
118
  this.$refs.filter && this.$refs.filter.resetFields();
135
- this.searchData = {};
136
- this.advancedData = {};
137
- this.$emit('reset');
119
+ this.searchData = JSON.parse(JSON.stringify(this.searchValue));
120
+ this.advancedData = JSON.parse(JSON.stringify(this.advanceValue));
121
+ this.$emit('reset', this.searchData);
138
122
  },
139
123
  hanleCancel() {
140
124
  this.show = false;
141
- this.$emit('cancel');
125
+ this.advancedData = JSON.parse(JSON.stringify(this.advanceValue));
126
+ this.$emit('cancel', this.advancedData);
142
127
  }
143
128
  },
144
129
  render(h) {
@@ -338,26 +323,28 @@ export default {
338
323
  ]
339
324
  },
340
325
  [
341
- h(
342
- 'es-form',
343
- {
344
- class: 'es-form-search',
345
- ref: 'filter',
346
- props: {
347
- ...other,
348
- ...(config || {}),
349
- size: 'medium',
350
- closeDialog: false,
351
- model: this.advancedData,
352
- contents: contents
353
- },
354
- on: {
355
- submit: this.hanleSubmit,
356
- reset: this.hanleCancel
357
- }
358
- },
359
- []
360
- )
326
+ this.show
327
+ ? h(
328
+ 'es-form',
329
+ {
330
+ class: 'es-form-advanced-filter',
331
+ ref: 'filter',
332
+ props: {
333
+ ...other,
334
+ ...(config || {}),
335
+ size: 'medium',
336
+ closeDialog: false,
337
+ model: this.advancedData,
338
+ contents: contents
339
+ },
340
+ on: {
341
+ submit: this.hanleSubmit,
342
+ reset: this.hanleCancel
343
+ }
344
+ },
345
+ []
346
+ )
347
+ : ''
361
348
  ]
362
349
  )
363
350
  ]