eoss-ui 0.5.45 → 0.5.46

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 (71) hide show
  1. package/lib/button.js +135 -135
  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 +17 -6
  8. package/lib/date-picker.js +2 -2
  9. package/lib/dialog.js +8 -4
  10. package/lib/enterprise.js +2 -2
  11. package/lib/eoss-ui.common.js +1214 -630
  12. package/lib/error-page.js +2 -2
  13. package/lib/flow-group.js +2 -2
  14. package/lib/flow-list.js +2 -2
  15. package/lib/form.js +215 -231
  16. package/lib/handle-user.js +2 -2
  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/calendar.css +0 -0
  42. package/lib/theme-chalk/cascader.css +1 -0
  43. package/lib/theme-chalk/data-table-form.css +1 -1
  44. package/lib/theme-chalk/index.css +1 -1
  45. package/lib/theme-chalk/toolbar.css +1 -1
  46. package/lib/tips.js +2 -2
  47. package/lib/toolbar.js +17 -33
  48. package/lib/tree-group.js +2 -2
  49. package/lib/tree.js +2 -2
  50. package/lib/wujie.js +2 -2
  51. package/lib/wxlogin.js +2 -2
  52. package/package.json +1 -1
  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 +12 -1
  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 +3 -0
  59. package/packages/nav/src/main.vue +1 -1
  60. package/packages/theme-chalk/lib/calendar.css +0 -0
  61. package/packages/theme-chalk/lib/cascader.css +1 -0
  62. package/packages/theme-chalk/lib/data-table-form.css +1 -1
  63. package/packages/theme-chalk/lib/index.css +1 -1
  64. package/packages/theme-chalk/lib/toolbar.css +1 -1
  65. package/packages/theme-chalk/src/calendar.scss +0 -0
  66. package/packages/theme-chalk/src/cascader.scss +93 -0
  67. package/packages/theme-chalk/src/data-table-form.scss +11 -0
  68. package/packages/theme-chalk/src/index.scss +2 -1
  69. package/packages/theme-chalk/src/toolbar.scss +13 -11
  70. package/packages/toolbar/src/main.vue +34 -48
  71. package/src/index.js +7 -4
@@ -1 +1 @@
1
- @charset "UTF-8";.es-toolbar{padding:6px 12px;border-bottom:1px solid #d9d9d9;position:relative;background-color:#fff}.es-toolbar .es-toolbar-content{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.es-toolbar .es-toolbar-content .es-button-content{-webkit-box-flex:1;-ms-flex:1;flex:1}.es-toolbar .es-toolbar-content .es-button-content .el-button{padding:4px 8px}.es-toolbar .es-toolbar-content .es-button-content .el-button+.el-button,.es-toolbar .es-toolbar-content .es-button-content .el-button+.es-button-badge,.es-toolbar .es-toolbar-content .es-button-content .es-button-badge+.el-button{margin-left:6px}.es-toolbar .es-toolbar-content .es-form{background:0 0}.es-toolbar .es-toolbar-content .es-form .es-form-content{padding:0}.es-toolbar .es-toolbar-content .es-form .el-form-item{margin-bottom:0}.es-toolbar .es-toolbar-content .es-advanced-btn{margin-left:6px;height:32px}.es-toolbar .es-toolbar-content .es-advanced-btn .es-advanced-icon{margin-right:-8px}.es-toolbar .es-toolbar-content .es-toolbar-text{line-height:32px}.es-toolbar .es-toolbar-content .es-toolbar-info{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.es-toolbar .es-toolbar-content .es-toolbar-info .es-info{font-size:13px;margin-left:20px}.es-toolbar .es-toolbar-content .el-menu--horizontal{border-bottom:0;position:relative;bottom:-6px}.es-toolbar .es-toolbar-content .el-menu-item{height:32px;line-height:24px}.es-toolbar .es-toolbar-content .el-input__inner,.es-toolbar .es-toolbar-content .es-checkbox-group{height:32px;line-height:32px}.es-toolbar .es-toolbar-content .es-radio-group,.es-toolbar .es-toolbar-content .es-switch-content{line-height:32px}.es-toolbar .es-toolbar-content .el-switch{top:-2px}.es-toolbar .es-toolbar-content .el-button span{line-height:14px}.es-toolbar .es-toolbar-content .el-checkbox:not(:last-child),.es-toolbar .es-toolbar-content .el-radio:not(:last-child){margin-right:8px}.es-toolbar .es-toolbar-content .el-form-item.es-toolbar-item-checkbox+.el-form-item,.es-toolbar .es-toolbar-content .el-form-item.es-toolbar-item-radio+.el-form-item,.es-toolbar .es-toolbar-content .el-form-item.es-toolbar-item-switch+.el-form-item{margin-left:16px}.es-toolbar .es-toolbar-content .el-form-item .el-input__icon{line-height:32px;vertical-align:top}.es-toolbar .es-toolbar-content .es-form-search-small .el-input__inner{width:100%;max-width:156px}.es-toolbar .es-toolbar-content .es-form-search-small .el-input__inner.el-date-editor--daterange{max-width:300px}.es-toolbar .es-toolbar-content .es-form-search-small .el-input__inner.el-date-editor--daterange .el-input__icon,.es-toolbar .es-toolbar-content .es-form-search-small .el-input__inner.el-date-editor--daterange .el-range-separator{line-height:24px}.es-toolbar .es-advanced-filter{margin-top:20px;z-index:9}.es-toolbar .es-advanced-filter.es-absolute{position:absolute;left:0;top:45px;right:0;margin-top:0;-webkit-box-shadow:0 1px 10px rgba(0,0,0,.05),0 4px 5px rgba(0,0,0,.08),0 2px 4px -1px rgba(0,0,0,.12);box-shadow:0 1px 10px rgba(0,0,0,.05),0 4px 5px rgba(0,0,0,.08),0 2px 4px -1px rgba(0,0,0,.12);border-bottom-left-radius:6px;border-bottom-right-radius:6px}.es-toolbar .es-advanced-filter.es-absolute .es-form{background-color:#fff;border:1px solid #d9d9d9;border-bottom-left-radius:6px;border-bottom-right-radius:6px;border-top:0;padding:20px 20px 20px 10px}.es-toolbar .el-form-item__content{line-height:32px!important}.es-toolbar .el-form-item__label{line-height:32px!important;height:32px}.es-toolbar .el-button.es-upload{padding:0!important;border:0!important}
1
+ @charset "UTF-8";.es-toolbar{padding:6px 12px;border-bottom:1px solid #d9d9d9;position:relative;background-color:#fff}.es-toolbar .es-toolbar-content{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.es-toolbar .es-toolbar-content .es-button-content{-webkit-box-flex:1;-ms-flex:1;flex:1}.es-toolbar .es-toolbar-content .es-button-content .el-button{padding:4px 8px}.es-toolbar .es-toolbar-content .es-button-content .el-button+.el-button,.es-toolbar .es-toolbar-content .es-button-content .el-button+.es-button-badge,.es-toolbar .es-toolbar-content .es-button-content .es-button-badge+.el-button{margin-left:6px}.es-toolbar .es-toolbar-content .es-form{background:0 0}.es-toolbar .es-toolbar-content .es-form .es-form-content{padding:0}.es-toolbar .es-toolbar-content .es-form .el-form-item{margin-bottom:0}.es-toolbar .es-toolbar-content .es-advanced-btn{margin-left:6px;height:32px}.es-toolbar .es-toolbar-content .es-advanced-btn .es-advanced-icon{margin-right:-8px}.es-toolbar .es-toolbar-content .es-toolbar-text{line-height:32px}.es-toolbar .es-toolbar-content .es-toolbar-info{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.es-toolbar .es-toolbar-content .es-toolbar-info .es-info{font-size:13px;margin-left:20px}.es-toolbar .es-toolbar-content .el-menu--horizontal{border-bottom:0;position:relative;bottom:-6px}.es-toolbar .es-toolbar-content .el-menu-item{height:32px;line-height:24px}.es-toolbar .es-toolbar-content .el-input__inner,.es-toolbar .es-toolbar-content .es-checkbox-group{height:32px;line-height:32px}.es-toolbar .es-toolbar-content .es-radio-group,.es-toolbar .es-toolbar-content .es-switch-content{line-height:32px}.es-toolbar .es-toolbar-content .el-switch{top:-2px}.es-toolbar .es-toolbar-content .el-button span{line-height:14px}.es-toolbar .es-toolbar-content .el-checkbox:not(:last-child),.es-toolbar .es-toolbar-content .el-radio:not(:last-child){margin-right:8px}.es-toolbar .es-toolbar-content .el-form-item.es-toolbar-item-checkbox+.el-form-item,.es-toolbar .es-toolbar-content .el-form-item.es-toolbar-item-radio+.el-form-item,.es-toolbar .es-toolbar-content .el-form-item.es-toolbar-item-switch+.el-form-item{margin-left:16px}.es-toolbar .es-toolbar-content .el-form-item .el-input__icon{line-height:32px;vertical-align:top}.es-toolbar .es-toolbar-content .es-form-search-small .el-input__inner{width:100%;max-width:156px}.es-toolbar .es-toolbar-content .es-form-search-small .el-input__inner.el-date-editor--daterange{max-width:300px}.es-toolbar .es-toolbar-content .es-form-search-small .el-input__inner.el-date-editor--daterange .el-input__icon,.es-toolbar .es-toolbar-content .es-form-search-small .el-input__inner.el-date-editor--daterange .el-range-separator{line-height:24px}.es-toolbar .es-form-search-small .el-form-item__content{line-height:32px!important}.es-toolbar .es-form-search-small .el-form-item__label{line-height:32px!important;height:32px}.es-toolbar .el-button.es-upload{padding:0!important;border:0!important}.es-toolbar .es-advanced-filter{margin-top:20px;z-index:9}.es-toolbar .es-advanced-filter.es-absolute{position:absolute;left:0;top:45px;right:0;margin-top:0;-webkit-box-shadow:0 1px 10px rgba(0,0,0,.05),0 4px 5px rgba(0,0,0,.08),0 2px 4px -1px rgba(0,0,0,.12);box-shadow:0 1px 10px rgba(0,0,0,.05),0 4px 5px rgba(0,0,0,.08),0 2px 4px -1px rgba(0,0,0,.12);border-bottom-left-radius:6px;border-bottom-right-radius:6px}.es-toolbar .es-advanced-filter.es-absolute .es-form{background-color:#fff;border:1px solid #d9d9d9;border-bottom-left-radius:6px;border-bottom-right-radius:6px;border-top:0;padding:20px 20px 20px 10px}
package/lib/tips.js CHANGED
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 63);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 64);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -3565,7 +3565,7 @@ module.exports = require("json-bigint");
3565
3565
 
3566
3566
  /***/ }),
3567
3567
 
3568
- /***/ 63:
3568
+ /***/ 64:
3569
3569
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3570
3570
 
3571
3571
  "use strict";
package/lib/toolbar.js CHANGED
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 79);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 80);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -192,7 +192,7 @@ function normalizeComponent(
192
192
 
193
193
  /***/ }),
194
194
 
195
- /***/ 79:
195
+ /***/ 80:
196
196
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
197
197
 
198
198
  "use strict";
@@ -256,41 +256,25 @@ function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in ob
256
256
  default: 'auto'
257
257
  }
258
258
  },
259
- computed: {
260
- searchData: {
261
- get: function get() {
262
- var value = void 0;
263
- for (var i = 0; i < this.contents.length; i++) {
264
- if (this.contents[i].type === 'search') {
265
- value = this.contents[i].value || this.contents[i].searchValue;
266
- break;
267
- }
268
- }
269
- return value ? value : this.searchValue;
270
- },
271
- set: function set(val) {
272
- return val;
259
+ watch: {
260
+ searchValue: {
261
+ deep: true,
262
+ handler: function handler(val) {
263
+ this.searchData = val;
273
264
  }
274
265
  },
275
- advancedData: {
276
- get: function get() {
277
- var value = void 0;
278
- for (var i = 0; i < this.contents.length; i++) {
279
- if (this.contents[i].type === 'filter') {
280
- value = this.contents[i].value || this.contents[i].searchValue;
281
- break;
282
- }
283
- }
284
- return value ? value : this.advanceValue;
285
- },
286
- set: function set(val) {
287
- return val;
266
+ advanceValue: {
267
+ deep: true,
268
+ handler: function handler(val) {
269
+ this.advancedData = val;
288
270
  }
289
271
  }
290
272
  },
291
273
  data: function data() {
292
274
  return {
293
- show: false
275
+ show: false,
276
+ searchData: this.searchValue,
277
+ advancedData: this.advanceValue
294
278
  };
295
279
  },
296
280
  created: function created() {
@@ -483,8 +467,8 @@ function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in ob
483
467
  name: 'show',
484
468
  value: _this2.show
485
469
  }]
486
- }, [h('es-form', {
487
- class: 'es-form-search',
470
+ }, [_this2.show ? h('es-form', {
471
+ class: 'es-form-advanced-filter',
488
472
  ref: 'filter',
489
473
  props: _extends({}, other, config || {}, {
490
474
  size: 'medium',
@@ -496,7 +480,7 @@ function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in ob
496
480
  submit: _this2.hanleSubmit,
497
481
  reset: _this2.hanleCancel
498
482
  }
499
- }, [])])]);
483
+ }, []) : ''])]);
500
484
  }
501
485
  });
502
486
  var box = [h('div', {
package/lib/tree-group.js CHANGED
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 65);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 66);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -3565,7 +3565,7 @@ module.exports = require("json-bigint");
3565
3565
 
3566
3566
  /***/ }),
3567
3567
 
3568
- /***/ 65:
3568
+ /***/ 66:
3569
3569
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3570
3570
 
3571
3571
  "use strict";
package/lib/tree.js CHANGED
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 64);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 65);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -3565,7 +3565,7 @@ module.exports = require("json-bigint");
3565
3565
 
3566
3566
  /***/ }),
3567
3567
 
3568
- /***/ 64:
3568
+ /***/ 65:
3569
3569
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3570
3570
 
3571
3571
  "use strict";
package/lib/wujie.js CHANGED
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 67);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 68);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -3565,7 +3565,7 @@ module.exports = require("json-bigint");
3565
3565
 
3566
3566
  /***/ }),
3567
3567
 
3568
- /***/ 67:
3568
+ /***/ 68:
3569
3569
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3570
3570
 
3571
3571
  "use strict";
package/lib/wxlogin.js CHANGED
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 68);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 69);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ({
@@ -3565,7 +3565,7 @@ module.exports = require("json-bigint");
3565
3565
 
3566
3566
  /***/ }),
3567
3567
 
3568
- /***/ 68:
3568
+ /***/ 69:
3569
3569
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3570
3570
 
3571
3571
  "use strict";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eoss-ui",
3
- "version": "0.5.45",
3
+ "version": "0.5.46",
4
4
  "description": "eoss内部业务组件",
5
5
  "main": "lib/eoss-ui.common.js",
6
6
  "files": [
@@ -0,0 +1,5 @@
1
+ import EsCalendar from './src/main';
2
+
3
+ EsCalendar.install = Vue => Vue.component(EsCalendar.name, EsCalendar);
4
+
5
+ export default EsCalendar;
@@ -0,0 +1,386 @@
1
+ <template>
2
+ <div class="es-calendar">
3
+ <div class="es-calendar-title" v-show="showTitle">
4
+ <i class="es-calendar-prev es-icon-pointer-left" @click="prev"></i>
5
+ <div class="es-title" @click="resetDate">
6
+ <slot name="title" :year="year" :month="month">
7
+ {{ year }}年{{ month }}月
8
+ </slot>
9
+ </div>
10
+ <i class="es-calendar-next es-icon-pointer-right" @click="next"></i>
11
+ </div>
12
+ <ul class="es-calendar-weeks">
13
+ <li v-for="(item, index) in weeks" :key="index" class="es-week">
14
+ {{ item }}
15
+ </li>
16
+ </ul>
17
+ <ul class="es-calendar-days">
18
+ <li
19
+ class="es-day"
20
+ @click="handleClick(item)"
21
+ v-for="(item, index) in lists"
22
+ :key="`${item.year}-${item.month}-${item.date}`"
23
+ >
24
+ <div
25
+ class="es-day-item"
26
+ :class="{
27
+ 'es-disabled-day': item.type == 0,
28
+ 'es-today': isSelect(item, today) && mark,
29
+ 'es-select': isSelect(item, select)
30
+ }"
31
+ >
32
+ {{ item.date }}
33
+ <slot name="mark" :data="item"></slot>
34
+ </div>
35
+ </li>
36
+ </ul>
37
+ <div class="es-calendar-switch" v-show="fold">
38
+ <i
39
+ class="es-icon-pointer-up es-switch-icon"
40
+ name=""
41
+ @click="handleHide"
42
+ v-show="all"
43
+ ></i>
44
+ <i
45
+ class="es-icon-pointer-down es-switch-icon"
46
+ @click="handleShow"
47
+ v-show="!all"
48
+ ></i>
49
+ </div>
50
+ </div>
51
+ </template>
52
+
53
+ <script>
54
+ export default {
55
+ name: 'esCalendar',
56
+ props: {
57
+ //显示title
58
+ showTitle: {
59
+ type: Boolean,
60
+ default: true
61
+ },
62
+ //指定日期
63
+ date: [String, Number],
64
+ //是否只显示本周
65
+ brief: Boolean,
66
+ //是否等指定日期传入后再渲染
67
+ wait: Boolean,
68
+ //是否显示收起展开按钮
69
+ fold: {
70
+ type: Boolean,
71
+ default: true
72
+ },
73
+ mark: Boolean
74
+ },
75
+ watch: {
76
+ date: {
77
+ immediate: true,
78
+ handler(val) {
79
+ if (this.wait) {
80
+ val && this.init();
81
+ } else {
82
+ this.init();
83
+ }
84
+ }
85
+ },
86
+ brief: {
87
+ immediate: true,
88
+ handler(val) {
89
+ this.all = !val;
90
+ }
91
+ }
92
+ },
93
+ computed: {
94
+ lists() {
95
+ if (this.all) {
96
+ return this.daysList;
97
+ }
98
+ return this.daysList.filter((item) => {
99
+ for (let i = 0; i < this.weekDate.length; i++) {
100
+ let ele = this.weekDate[i];
101
+ if (
102
+ item.year == ele.year &&
103
+ item.month == ele.month &&
104
+ item.date == ele.date
105
+ ) {
106
+ return true;
107
+ }
108
+ }
109
+ });
110
+ }
111
+ },
112
+ data() {
113
+ return {
114
+ year: '',
115
+ _month: '',
116
+ weeks: ['日', '一', '二', '三', '四', '五', '六'],
117
+ weekDate: [],
118
+ week7: '',
119
+ today: '',
120
+ select: '',
121
+ selectDate: '',
122
+ daysList: [],
123
+ all: true,
124
+ week: 0,
125
+ prevMonthDays: 0,
126
+ nextMonthDays: 0,
127
+ days: 0
128
+ };
129
+ },
130
+ mounted() {},
131
+ methods: {
132
+ resetDate() {
133
+ this.week = 0;
134
+ this.init();
135
+ },
136
+ init(res) {
137
+ this.daysList = [];
138
+ let dates = this.getDays(res ? res : this.date);
139
+ let {
140
+ year,
141
+ month,
142
+ today,
143
+ daysList,
144
+ weekDate,
145
+ prevMonthDays,
146
+ nextMonthDays,
147
+ days
148
+ } = dates;
149
+ if (!res) {
150
+ this.today = `${year}/${month}/${today}`;
151
+ this.selectDate = today;
152
+ this.select = `${year}/${month}/${today}`;
153
+ this.$emit('select', { year, month, date: today, type: 1 });
154
+ }
155
+ this.prevMonthDays = prevMonthDays;
156
+ this.nextMonthDays = nextMonthDays;
157
+ this.days = days;
158
+ this.daysList = daysList;
159
+ this.year = year;
160
+ this.month = month;
161
+ if (!this.weekDate.length) {
162
+ this.weekDate = weekDate;
163
+ }
164
+ this.$emit('init', dates);
165
+ return dates;
166
+ },
167
+ isShow(res) {
168
+ if (this.all) {
169
+ return true;
170
+ }
171
+ return this.weekDate.filter((item) => {
172
+ return (
173
+ item.year == res.year &&
174
+ item.month == res.month &&
175
+ item.date == res.date
176
+ );
177
+ }).length;
178
+ },
179
+ isSelect(res, target) {
180
+ let { year, month, date } = res;
181
+ return target == `${year}/${month}/${date}`;
182
+ },
183
+ handleClick(res) {
184
+ let { year, month, date } = res;
185
+ this.selectDate = date;
186
+ this.select = `${year}/${month}/${date}`;
187
+ this.$emit('select', res);
188
+ },
189
+ prev() {
190
+ if (this.all) {
191
+ this.weekDate = [];
192
+ this.prevMonth();
193
+ } else {
194
+ this.weekDate = this.getWeekDay(-1);
195
+ this.$emit('prev', this.weekDate, 'week');
196
+ }
197
+ },
198
+ next() {
199
+ if (this.all) {
200
+ this.weekDate = [];
201
+ this.nextMonth();
202
+ } else {
203
+ this.weekDate = this.getWeekDay(1);
204
+ this.$emit('next', this.weekDate, 'week');
205
+ }
206
+ },
207
+ prevMonth() {
208
+ let year = this.year;
209
+ let month = this.month;
210
+ let dates = this.select.split('/');
211
+ if (month == 1) {
212
+ year -= 1;
213
+ month = 12;
214
+ } else {
215
+ month -= 1;
216
+ }
217
+ let date =
218
+ year == dates[0] && month == dates[1] ? dates[2] : this.prevMonthDays;
219
+ date = date.toString().padStart(2, '0');
220
+ month = month.toString().padStart(2, '0');
221
+ let res = this.init(`${year}/${month}/${date}`);
222
+ this.$emit('prev', res, 'month');
223
+ },
224
+ nextMonth() {
225
+ let year = this.year;
226
+ let month = this.month;
227
+ let dates = this.select.split('/');
228
+ if (month == 12) {
229
+ year += 1;
230
+ month = 1;
231
+ } else {
232
+ month += 1;
233
+ }
234
+ let date = year == dates[0] && month == dates[1] ? dates[2] : 1;
235
+ date = date.toString().padStart(2, '0');
236
+ month = month.toString().padStart(2, '0');
237
+ let res = this.init(`${year}/${month}/${date}`);
238
+ this.$emit('next', res, 'month');
239
+ },
240
+ //获取当月或指定日期所在月天数
241
+ getDays(res) {
242
+ const date = res ? new Date(res) : new Date();
243
+ const year = date.getFullYear();
244
+ const month = date.getMonth();
245
+ const today = date.getDate();
246
+ const week = date.getDay();
247
+ //此月天数
248
+ const days = new Date(year, month + 1, 0).getDate();
249
+ //此月第一天周几
250
+ const stratDay = new Date(year, month, 1).getDay();
251
+ //此月最后一天周几
252
+ const endDay = new Date(year, month, days).getDay();
253
+ //上月天数
254
+ const prevMonthDays =
255
+ month == 0
256
+ ? new Date(year - 1, 11, 0).getDate()
257
+ : new Date(year, month, 0).getDate();
258
+ //下月天数
259
+ const nextMonthDays =
260
+ month == 11
261
+ ? new Date(year + 1, 1, 0).getDate()
262
+ : new Date(year, month + 2, 0).getDate();
263
+ //当前日期所在的周
264
+ const weekDate = [{ date: today, year: year, month: month + 1 }];
265
+ for (let i = 0; i < week; i++) {
266
+ let d = i + 1;
267
+ if (today - d > 1) {
268
+ weekDate.unshift({
269
+ date: today - d,
270
+ year: year,
271
+ month: month + 1
272
+ });
273
+ } else {
274
+ weekDate.unshift({
275
+ date: prevMonthDays - i,
276
+ year: month == 0 ? year - 1 : year,
277
+ month: month == 0 ? 12 : month
278
+ });
279
+ }
280
+ }
281
+ for (let i = 0; i < 6 - week; i++) {
282
+ let d = i + 1;
283
+ if (today + d <= days) {
284
+ weekDate.unshift({
285
+ date: today + d,
286
+ year: year,
287
+ month: month + 1
288
+ });
289
+ } else {
290
+ weekDate.push({
291
+ date: today + d - days,
292
+ year: month == 11 ? year + 1 : year,
293
+ month: month == 11 ? 1 : month + 2
294
+ });
295
+ }
296
+ }
297
+
298
+ let daysList = [];
299
+ //本月前加入数组
300
+ if (stratDay > 0) {
301
+ for (let i = prevMonthDays; i > prevMonthDays - stratDay; i--) {
302
+ daysList.unshift({
303
+ date: i,
304
+ type: 0,
305
+ year: month == 0 ? year - 1 : year,
306
+ month: month == 0 ? 12 : month
307
+ });
308
+ }
309
+ }
310
+ //本月加入数组
311
+ for (let i = 1; i <= days; i++) {
312
+ daysList.push({
313
+ date: i,
314
+ type: 1,
315
+ year: year,
316
+ month: month + 1,
317
+ row: week < 6 && today + week > days
318
+ });
319
+ }
320
+ //本月后加入数组
321
+ if (endDay < 6) {
322
+ for (var i = 1; i < 6 - endDay + 1; i++) {
323
+ daysList.push({
324
+ date: i,
325
+ type: 0,
326
+ year: month == 11 ? year + 1 : year,
327
+ month: month == 11 ? 1 : month + 2
328
+ });
329
+ }
330
+ }
331
+ return {
332
+ days: days,
333
+ prevMonthDays: prevMonthDays,
334
+ nextMonthDays: nextMonthDays,
335
+ stratDay: stratDay,
336
+ endDay: endDay,
337
+ weekDate: weekDate,
338
+ year: year,
339
+ month: month + 1,
340
+ today: today,
341
+ week: week,
342
+ daysList: daysList
343
+ };
344
+ },
345
+ getWeekDay(val) {
346
+ let flag = true;
347
+ let weekDate = JSON.parse(JSON.stringify(this.weekDate));
348
+ let days = weekDate.map((item) => {
349
+ let { date, month, year } = item;
350
+ date += val * 7;
351
+ if (date < 1) {
352
+ date += this.prevMonthDays;
353
+ month -= 1;
354
+ if (month == 0) {
355
+ month = 12;
356
+ year -= 1;
357
+ }
358
+ } else if (date > this.days) {
359
+ date -= this.days;
360
+ month += 1;
361
+ if (month > 12) {
362
+ month = 1;
363
+ year += 1;
364
+ }
365
+ }
366
+ if (this.month == month) {
367
+ flag = false;
368
+ }
369
+ return { date, month, year };
370
+ });
371
+ if (flag) {
372
+ val == 1 ? this.nextMonth() : this.prevMonth();
373
+ }
374
+ return days;
375
+ },
376
+ handleShow() {
377
+ this.all = true;
378
+ this.$emit('show', true);
379
+ },
380
+ handleHide() {
381
+ this.all = false;
382
+ this.$emit('show', false);
383
+ }
384
+ }
385
+ };
386
+ </script>
@@ -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 {
@@ -892,6 +896,13 @@ export default {
892
896
  if (this.retainSearh) {
893
897
  reqData = util.extend({}, reqData, this.wheres);
894
898
  }
899
+ if (this.isJoin) {
900
+ for (let i in reqData) {
901
+ if (Array.isArray(reqData[i])) {
902
+ reqData[i] = reqData[i].join(',');
903
+ }
904
+ }
905
+ }
895
906
  this.tableLoading = true;
896
907
  util
897
908
  .ajax({