eoss-ui 0.5.63 → 0.5.65

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 (82) hide show
  1. package/lib/button-group.js +43 -23
  2. package/lib/button.js +65 -39
  3. package/lib/calendar.js +13 -5
  4. package/lib/checkbox-group.js +4 -2
  5. package/lib/data-table-form.js +4 -2
  6. package/lib/data-table.js +112 -25
  7. package/lib/date-picker.js +4 -2
  8. package/lib/dialog.js +4 -2
  9. package/lib/eoss-ui.common.js +635 -393
  10. package/lib/flow-group.js +4 -2
  11. package/lib/flow-list.js +4 -2
  12. package/lib/flow.js +153 -123
  13. package/lib/form.js +9 -4
  14. package/lib/handle-user.js +4 -2
  15. package/lib/handler.js +4 -2
  16. package/lib/icon.js +4 -2
  17. package/lib/index.js +1 -1
  18. package/lib/input-number.js +4 -2
  19. package/lib/input.js +4 -2
  20. package/lib/login.js +23 -6
  21. package/lib/main.js +189 -128
  22. package/lib/nav.js +4 -2
  23. package/lib/page.js +4 -2
  24. package/lib/player.js +4 -2
  25. package/lib/qr-code.js +13 -13
  26. package/lib/radio-group.js +4 -2
  27. package/lib/retrial-auth.js +4 -2
  28. package/lib/select-ganged.js +4 -2
  29. package/lib/select.js +4 -2
  30. package/lib/selector-panel.js +4 -2
  31. package/lib/selector.js +4 -2
  32. package/lib/sizer.js +4 -2
  33. package/lib/steps.js +4 -2
  34. package/lib/switch.js +4 -2
  35. package/lib/table-form.js +4 -2
  36. package/lib/tabs.js +4 -2
  37. package/lib/theme-chalk/base.css +1 -1
  38. package/lib/theme-chalk/button-group.css +1 -1
  39. package/lib/theme-chalk/button.css +1 -1
  40. package/lib/theme-chalk/calendar.css +1 -1
  41. package/lib/theme-chalk/index.css +1 -1
  42. package/lib/theme-chalk/main.css +1 -1
  43. package/lib/theme-chalk/menu.css +1 -1
  44. package/lib/theme-chalk/qr-code.css +1 -1
  45. package/lib/theme-chalk/sizer.css +1 -1
  46. package/lib/theme-chalk/upload.css +1 -1
  47. package/lib/tips.js +4 -2
  48. package/lib/tree-group.js +4 -2
  49. package/lib/tree.js +4 -2
  50. package/lib/upload.js +12 -8
  51. package/lib/utils/util.js +4 -2
  52. package/lib/wujie.js +4 -2
  53. package/lib/wxlogin.js +4 -2
  54. package/package.json +2 -2
  55. package/packages/button/src/main.vue +92 -56
  56. package/packages/button-group/src/main.vue +10 -1
  57. package/packages/calendar/src/main.vue +11 -4
  58. package/packages/data-table/src/children.vue +3 -1
  59. package/packages/data-table/src/main.vue +55 -10
  60. package/packages/flow/src/processForm.vue +32 -4
  61. package/packages/form/src/main.vue +3 -0
  62. package/packages/login/src/main.vue +12 -1
  63. package/packages/main/src/main.vue +147 -101
  64. package/packages/qr-code/src/main.vue +10 -5
  65. package/packages/theme-chalk/lib/base.css +1 -1
  66. package/packages/theme-chalk/lib/button-group.css +1 -1
  67. package/packages/theme-chalk/lib/button.css +1 -1
  68. package/packages/theme-chalk/lib/calendar.css +1 -1
  69. package/packages/theme-chalk/lib/index.css +1 -1
  70. package/packages/theme-chalk/lib/main.css +1 -1
  71. package/packages/theme-chalk/lib/menu.css +1 -1
  72. package/packages/theme-chalk/lib/qr-code.css +1 -1
  73. package/packages/theme-chalk/lib/sizer.css +1 -1
  74. package/packages/theme-chalk/lib/upload.css +1 -1
  75. package/packages/theme-chalk/src/base.scss +3 -0
  76. package/packages/theme-chalk/src/button-group.scss +110 -0
  77. package/packages/theme-chalk/src/button.scss +6 -0
  78. package/packages/theme-chalk/src/calendar.scss +3 -0
  79. package/packages/theme-chalk/src/qr-code.scss +1 -1
  80. package/packages/upload/src/main.vue +3 -1
  81. package/src/index.js +1 -1
  82. package/src/utils/util.js +4 -1
package/lib/tree-group.js CHANGED
@@ -2201,7 +2201,7 @@ var isLogined = function isLogined(_ref8) {
2201
2201
  });
2202
2202
  }
2203
2203
  }).catch(function (e) {});
2204
- } else if (token || to.path === '/' || to.path === '/404' || typeof exclude === 'boolean' && exclude || exclude.indexOf(to.path) > -1 || exclude.indexOf(to.name) > -1 || to.path === '/login' || token && to.path === '/main') {
2204
+ } else if (token || to.path === '/' || to.path === '/404' || to.path === '/error' || typeof exclude === 'boolean' && exclude || exclude.indexOf(to.path) > -1 || exclude.indexOf(to.name) > -1 || to.path === '/login' || token && to.path === '/main') {
2205
2205
  if (redirect && (to.path === '/main' || to.path === '/login')) {
2206
2206
  window.location.replace(urlJoinParams({ url: '.' + to.path + '.html', param: to.query }));
2207
2207
  } else {
@@ -2891,7 +2891,9 @@ var toFunction = function toFunction(str) {
2891
2891
  * @param {string} [$color] - 颜色值
2892
2892
  **/
2893
2893
  var updateTheme = function updateTheme(color, send) {
2894
- color = color && startWith(color, '#') ? color : '#409eff';
2894
+ if (!color) {
2895
+ return false;
2896
+ }
2895
2897
 
2896
2898
  if (send === undefined) {
2897
2899
  send = true;
package/lib/tree.js CHANGED
@@ -2201,7 +2201,7 @@ var isLogined = function isLogined(_ref8) {
2201
2201
  });
2202
2202
  }
2203
2203
  }).catch(function (e) {});
2204
- } else if (token || to.path === '/' || to.path === '/404' || typeof exclude === 'boolean' && exclude || exclude.indexOf(to.path) > -1 || exclude.indexOf(to.name) > -1 || to.path === '/login' || token && to.path === '/main') {
2204
+ } else if (token || to.path === '/' || to.path === '/404' || to.path === '/error' || typeof exclude === 'boolean' && exclude || exclude.indexOf(to.path) > -1 || exclude.indexOf(to.name) > -1 || to.path === '/login' || token && to.path === '/main') {
2205
2205
  if (redirect && (to.path === '/main' || to.path === '/login')) {
2206
2206
  window.location.replace(urlJoinParams({ url: '.' + to.path + '.html', param: to.query }));
2207
2207
  } else {
@@ -2891,7 +2891,9 @@ var toFunction = function toFunction(str) {
2891
2891
  * @param {string} [$color] - 颜色值
2892
2892
  **/
2893
2893
  var updateTheme = function updateTheme(color, send) {
2894
- color = color && startWith(color, '#') ? color : '#409eff';
2894
+ if (!color) {
2895
+ return false;
2896
+ }
2895
2897
 
2896
2898
  if (send === undefined) {
2897
2899
  send = true;
package/lib/upload.js CHANGED
@@ -2200,7 +2200,7 @@ var isLogined = function isLogined(_ref8) {
2200
2200
  });
2201
2201
  }
2202
2202
  }).catch(function (e) {});
2203
- } else if (token || to.path === '/' || to.path === '/404' || typeof exclude === 'boolean' && exclude || exclude.indexOf(to.path) > -1 || exclude.indexOf(to.name) > -1 || to.path === '/login' || token && to.path === '/main') {
2203
+ } else if (token || to.path === '/' || to.path === '/404' || to.path === '/error' || typeof exclude === 'boolean' && exclude || exclude.indexOf(to.path) > -1 || exclude.indexOf(to.name) > -1 || to.path === '/login' || token && to.path === '/main') {
2204
2204
  if (redirect && (to.path === '/main' || to.path === '/login')) {
2205
2205
  window.location.replace(urlJoinParams({ url: '.' + to.path + '.html', param: to.query }));
2206
2206
  } else {
@@ -2890,7 +2890,9 @@ var toFunction = function toFunction(str) {
2890
2890
  * @param {string} [$color] - 颜色值
2891
2891
  **/
2892
2892
  var updateTheme = function updateTheme(color, send) {
2893
- color = color && startWith(color, '#') ? color : '#409eff';
2893
+ if (!color) {
2894
+ return false;
2895
+ }
2894
2896
 
2895
2897
  if (send === undefined) {
2896
2898
  send = true;
@@ -3826,8 +3828,8 @@ module.exports = require("js-base64");
3826
3828
  // ESM COMPAT FLAG
3827
3829
  __webpack_require__.r(__webpack_exports__);
3828
3830
 
3829
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/main.vue?vue&type=template&id=789e2154&
3830
- var mainvue_type_template_id_789e2154_render = function () {
3831
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/main.vue?vue&type=template&id=031cebad&
3832
+ var mainvue_type_template_id_031cebad_render = function () {
3831
3833
  var _vm = this
3832
3834
  var _h = _vm.$createElement
3833
3835
  var _c = _vm._self._c || _h
@@ -4208,10 +4210,10 @@ var mainvue_type_template_id_789e2154_render = function () {
4208
4210
  : _vm._e()
4209
4211
  }
4210
4212
  var staticRenderFns = []
4211
- mainvue_type_template_id_789e2154_render._withStripped = true
4213
+ mainvue_type_template_id_031cebad_render._withStripped = true
4212
4214
 
4213
4215
 
4214
- // CONCATENATED MODULE: ./packages/upload/src/main.vue?vue&type=template&id=789e2154&
4216
+ // CONCATENATED MODULE: ./packages/upload/src/main.vue?vue&type=template&id=031cebad&
4215
4217
 
4216
4218
  // EXTERNAL MODULE: ./src/config/api.js
4217
4219
  var api = __webpack_require__(1);
@@ -4958,7 +4960,9 @@ var _props;
4958
4960
  }
4959
4961
  });
4960
4962
  _this3.filesTotalSize = filesTotalSize;
4961
- _this3.$emit('input', _this3.lists.length ? _this3.lists : '');
4963
+ if (_this3.lists.length) {
4964
+ _this3.$emit('input', _this3.lists);
4965
+ }
4962
4966
  }
4963
4967
  } else {
4964
4968
  var msg = res.msg || '系统错误,请联系管理员!';
@@ -5311,7 +5315,7 @@ var componentNormalizer = __webpack_require__(3);
5311
5315
 
5312
5316
  var component = Object(componentNormalizer["a" /* default */])(
5313
5317
  src_mainvue_type_script_lang_js_,
5314
- mainvue_type_template_id_789e2154_render,
5318
+ mainvue_type_template_id_031cebad_render,
5315
5319
  staticRenderFns,
5316
5320
  false,
5317
5321
  null,
package/lib/utils/util.js CHANGED
@@ -2118,7 +2118,7 @@ var isLogined = function isLogined(_ref8) {
2118
2118
  });
2119
2119
  }
2120
2120
  }).catch(function (e) {});
2121
- } else if (token || to.path === '/' || to.path === '/404' || typeof exclude === 'boolean' && exclude || exclude.indexOf(to.path) > -1 || exclude.indexOf(to.name) > -1 || to.path === '/login' || token && to.path === '/main') {
2121
+ } else if (token || to.path === '/' || to.path === '/404' || to.path === '/error' || typeof exclude === 'boolean' && exclude || exclude.indexOf(to.path) > -1 || exclude.indexOf(to.name) > -1 || to.path === '/login' || token && to.path === '/main') {
2122
2122
  if (redirect && (to.path === '/main' || to.path === '/login')) {
2123
2123
  window.location.replace(urlJoinParams({ url: '.' + to.path + '.html', param: to.query }));
2124
2124
  } else {
@@ -2808,7 +2808,9 @@ var toFunction = function toFunction(str) {
2808
2808
  * @param {string} [$color] - 颜色值
2809
2809
  **/
2810
2810
  var updateTheme = function updateTheme(color, send) {
2811
- color = color && startWith(color, '#') ? color : '#409eff';
2811
+ if (!color) {
2812
+ return false;
2813
+ }
2812
2814
 
2813
2815
  if (send === undefined) {
2814
2816
  send = true;
package/lib/wujie.js CHANGED
@@ -2201,7 +2201,7 @@ var isLogined = function isLogined(_ref8) {
2201
2201
  });
2202
2202
  }
2203
2203
  }).catch(function (e) {});
2204
- } else if (token || to.path === '/' || to.path === '/404' || typeof exclude === 'boolean' && exclude || exclude.indexOf(to.path) > -1 || exclude.indexOf(to.name) > -1 || to.path === '/login' || token && to.path === '/main') {
2204
+ } else if (token || to.path === '/' || to.path === '/404' || to.path === '/error' || typeof exclude === 'boolean' && exclude || exclude.indexOf(to.path) > -1 || exclude.indexOf(to.name) > -1 || to.path === '/login' || token && to.path === '/main') {
2205
2205
  if (redirect && (to.path === '/main' || to.path === '/login')) {
2206
2206
  window.location.replace(urlJoinParams({ url: '.' + to.path + '.html', param: to.query }));
2207
2207
  } else {
@@ -2891,7 +2891,9 @@ var toFunction = function toFunction(str) {
2891
2891
  * @param {string} [$color] - 颜色值
2892
2892
  **/
2893
2893
  var updateTheme = function updateTheme(color, send) {
2894
- color = color && startWith(color, '#') ? color : '#409eff';
2894
+ if (!color) {
2895
+ return false;
2896
+ }
2895
2897
 
2896
2898
  if (send === undefined) {
2897
2899
  send = true;
package/lib/wxlogin.js CHANGED
@@ -2201,7 +2201,7 @@ var isLogined = function isLogined(_ref8) {
2201
2201
  });
2202
2202
  }
2203
2203
  }).catch(function (e) {});
2204
- } else if (token || to.path === '/' || to.path === '/404' || typeof exclude === 'boolean' && exclude || exclude.indexOf(to.path) > -1 || exclude.indexOf(to.name) > -1 || to.path === '/login' || token && to.path === '/main') {
2204
+ } else if (token || to.path === '/' || to.path === '/404' || to.path === '/error' || typeof exclude === 'boolean' && exclude || exclude.indexOf(to.path) > -1 || exclude.indexOf(to.name) > -1 || to.path === '/login' || token && to.path === '/main') {
2205
2205
  if (redirect && (to.path === '/main' || to.path === '/login')) {
2206
2206
  window.location.replace(urlJoinParams({ url: '.' + to.path + '.html', param: to.query }));
2207
2207
  } else {
@@ -2891,7 +2891,9 @@ var toFunction = function toFunction(str) {
2891
2891
  * @param {string} [$color] - 颜色值
2892
2892
  **/
2893
2893
  var updateTheme = function updateTheme(color, send) {
2894
- color = color && startWith(color, '#') ? color : '#409eff';
2894
+ if (!color) {
2895
+ return false;
2896
+ }
2895
2897
 
2896
2898
  if (send === undefined) {
2897
2899
  send = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eoss-ui",
3
- "version": "0.5.63",
3
+ "version": "0.5.65",
4
4
  "description": "eoss内部业务组件",
5
5
  "main": "lib/eoss-ui.common.js",
6
6
  "files": [
@@ -97,7 +97,7 @@
97
97
  "cp-cli": "^1.0.2",
98
98
  "cross-env": "^3.1.3",
99
99
  "css-loader": "^2.1.0",
100
- "eoss-element": "^0.2.93",
100
+ "eoss-element": "^0.2.95",
101
101
  "es6-promise": "^4.0.5",
102
102
  "eslint": "4.18.2",
103
103
  "eslint-config-elemefe": "0.1.1",
@@ -47,7 +47,9 @@ export default {
47
47
  text: String,
48
48
  onClick: Function,
49
49
  badge: [Object, Number],
50
- float: String
50
+ float: String,
51
+ selector: Boolean,
52
+ upload: Boolean
51
53
  },
52
54
  computed: {
53
55
  _type() {
@@ -260,68 +262,86 @@ export default {
260
262
  }
261
263
  let tag = 'el-button';
262
264
  let clas = ['es-button'];
263
- let props = { type: this._type, size: this.size };
265
+ let props = {};
264
266
  let attrs = {};
265
- if (this.link && !this.open) {
266
- const link = this.param
267
- ? util.urlJoinParams({ url: this.link, param: this.param })
268
- : this.link;
269
- attrs = { href: link };
270
- tag = 'a';
271
- clas = clas.concat([
272
- 'el-button',
273
- this._type ? `el-button--${this._type}` : 'el-button--default',
274
- this.size ? `el-button--${this.size}` : '',
275
- this.float ? `es-button--${this.float}` : ''
276
- ]);
277
- }
278
- if (this.badge) {
279
- let config = {};
280
- if (typeof this.badge === 'number') {
281
- config = { class: 'es-button-badge', props: { value: this.badge } };
282
- } else {
283
- let { value, max, isDot, hidden, type } = this.badge;
284
- config = {
285
- class: this.badge.class
286
- ? this.badge.class + ' es-button-badge'
287
- : 'es-button-badge',
288
- props: { value, max, isDot, hidden, type }
289
- };
267
+ let listeners = {};
268
+ let config = {};
269
+ if (this.selector) {
270
+ tag = 'es-selector';
271
+ props = { ...this.$attrs, button: { type: this._type, size: this.size } };
272
+ listeners = this.$listeners;
273
+ } else if (this.upload) {
274
+ tag = 'es-upload';
275
+ props = { ...this.$attrs, showFileList: false };
276
+ listeners = this.$listeners;
277
+ config = {
278
+ type: this._type,
279
+ size: this.size
280
+ };
281
+ } else {
282
+ props = { ...this.$attrs, type: this._type, size: this.size };
283
+ listeners = { ...this.$listeners, click: this.handleClick };
284
+ if (this.link && !this.open) {
285
+ const link = this.param
286
+ ? util.urlJoinParams({ url: this.link, param: this.param })
287
+ : this.link;
288
+ attrs = { href: link };
289
+ tag = 'a';
290
+ clas = clas.concat([
291
+ 'el-button',
292
+ this._type ? `el-button--${this._type}` : 'el-button--default',
293
+ this.size ? `el-button--${this.size}` : '',
294
+ this.float ? `es-button--${this.float}` : ''
295
+ ]);
290
296
  }
291
- return h('el-badge', config, [
292
- h(
293
- tag,
294
- {
295
- class: clas,
296
- props: { ...this.$attrs, ...props },
297
- attrs: attrs,
298
- on: { ...this.$listeners, click: this.handleClick },
299
- directives: [
300
- {
301
- name: 'show',
302
- value: !this.hide
303
- }
304
- ]
305
- },
306
- this.iconPlacement === 'start'
307
- ? [
308
- this.icon ? h('i', { class: this.icon }) : '',
309
- this.$slots.default || this.text
310
- ]
311
- : [
312
- this.$slots.default || this.text,
313
- this.icon ? h('i', { class: this.icon }) : ''
297
+ if (this.badge) {
298
+ let config = {};
299
+ if (typeof this.badge === 'number') {
300
+ config = { class: 'es-button-badge', props: { value: this.badge } };
301
+ } else {
302
+ let { value, max, isDot, hidden, type } = this.badge;
303
+ config = {
304
+ class: this.badge.class
305
+ ? this.badge.class + ' es-button-badge'
306
+ : 'es-button-badge',
307
+ props: { value, max, isDot, hidden, type }
308
+ };
309
+ }
310
+ return h('el-badge', config, [
311
+ h(
312
+ tag,
313
+ {
314
+ class: clas,
315
+ props: { ...this.$attrs, ...props },
316
+ attrs: attrs,
317
+ on: { ...this.$listeners, click: this.handleClick },
318
+ directives: [
319
+ {
320
+ name: 'show',
321
+ value: !this.hide
322
+ }
314
323
  ]
315
- )
316
- ]);
324
+ },
325
+ this.iconPlacement === 'start'
326
+ ? [
327
+ this.icon ? h('i', { class: this.icon }) : '',
328
+ this.$slots.default || this.text
329
+ ]
330
+ : [
331
+ this.$slots.default || this.text,
332
+ this.icon ? h('i', { class: this.icon }) : ''
333
+ ]
334
+ )
335
+ ]);
336
+ }
317
337
  }
318
338
  return h(
319
339
  tag,
320
340
  {
321
341
  class: clas,
322
- props: { ...this.$attrs, ...props },
342
+ props: props,
323
343
  attrs: attrs,
324
- on: { ...this.$listeners, click: this.handleClick },
344
+ on: listeners,
325
345
  directives: [
326
346
  {
327
347
  name: 'show',
@@ -332,10 +352,26 @@ export default {
332
352
  this.iconPlacement === 'start'
333
353
  ? [
334
354
  this.icon ? h('i', { class: this.icon }) : '',
335
- this.$slots.default || this.text
355
+ this.upload
356
+ ? h(
357
+ 'el-button',
358
+ {
359
+ props: config
360
+ },
361
+ [this.$slots.default || this.text]
362
+ )
363
+ : this.$slots.default || this.text
336
364
  ]
337
365
  : [
338
- this.$slots.default || this.text,
366
+ this.upload
367
+ ? h(
368
+ 'el-button',
369
+ {
370
+ props: config
371
+ },
372
+ [this.$slots.default || this.text]
373
+ )
374
+ : this.$slots.default || this.text,
339
375
  this.icon ? h('i', { class: this.icon }) : ''
340
376
  ]
341
377
  );
@@ -17,10 +17,16 @@
17
17
  <es-button
18
18
  v-else
19
19
  :stop="stop"
20
- v-bind="item"
20
+ v-bind="
21
+ exclAttribute({
22
+ data: item,
23
+ attrs: ['events']
24
+ })
25
+ "
21
26
  :key="index"
22
27
  :size="size"
23
28
  :type="item.type"
29
+ v-on="item.events"
24
30
  @click="handleClick({ ...data, handle: item })"
25
31
  >
26
32
  {{
@@ -126,6 +132,9 @@ export default {
126
132
  this.resetWidth();
127
133
  },
128
134
  methods: {
135
+ exclAttribute({ data, attrs }) {
136
+ return util.exclAttribute({ data, attrs });
137
+ },
129
138
  getBtns() {
130
139
  let useCaseCodes = util.getStorage('useCaseCodes');
131
140
  let keyword =
@@ -34,7 +34,8 @@
34
34
  :class="{
35
35
  'es-disabled-day': item.type == 0,
36
36
  'es-today': isSelect(item, today) && mark,
37
- 'es-select': isSelect(item, select)
37
+ 'es-select': isSelect(item, select),
38
+ 'es-disabled': item.disabled
38
39
  }"
39
40
  >
40
41
  {{ item.date }}
@@ -78,7 +79,8 @@ export default {
78
79
  type: Boolean,
79
80
  default: true
80
81
  },
81
- mark: Boolean
82
+ mark: Boolean,
83
+ disabled: Boolean
82
84
  },
83
85
  watch: {
84
86
  date: {
@@ -191,6 +193,9 @@ export default {
191
193
  return target == `${year}/${month}/${date}`;
192
194
  },
193
195
  handleClick(res) {
196
+ if (res.disabled) {
197
+ return false;
198
+ }
194
199
  let { year, month, date } = res;
195
200
  this.selectDate = date;
196
201
  this.select = `${year}/${month}/${date}`;
@@ -322,7 +327,8 @@ export default {
322
327
  date: i,
323
328
  type: 0,
324
329
  year: month == 0 ? year - 1 : year,
325
- month: month == 0 ? 12 : month
330
+ month: month == 0 ? 12 : month,
331
+ disabled: this.disabled
326
332
  });
327
333
  }
328
334
  }
@@ -343,7 +349,8 @@ export default {
343
349
  date: i,
344
350
  type: 0,
345
351
  year: month == 11 ? year + 1 : year,
346
- month: month == 11 ? 1 : month + 2
352
+ month: month == 11 ? 1 : month + 2,
353
+ disabled: this.disabled
347
354
  });
348
355
  }
349
356
  }
@@ -8,7 +8,8 @@
8
8
  v-bind="{
9
9
  ...$attrs,
10
10
  ...item,
11
- indexs: index
11
+ indexs: index,
12
+ ...(dragSort ? { ...item, fixed: false } : item)
12
13
  }"
13
14
  v-on="$listeners"
14
15
  ></children
@@ -24,6 +25,7 @@ export default {
24
25
  [column.name]: column
25
26
  },
26
27
  props: {
28
+ dragSort: Boolean,
27
29
  children: Array,
28
30
  childHead: Array
29
31
  },
@@ -43,7 +43,6 @@
43
43
  ref="oaTable"
44
44
  v-bind="{
45
45
  ...$attrs,
46
- data: datas,
47
46
  emptyText: emptyText,
48
47
  showSummary: showTotal,
49
48
  sumText: sumText || totalText,
@@ -54,28 +53,46 @@
54
53
  : undefined,
55
54
  border: _border,
56
55
  infiniteScroll: getTableData,
57
- infiniteScrollDisabled: infiniteDisabled
56
+ infiniteScrollDisabled: infiniteDisabled,
57
+ dragSort: dragSort,
58
+ dragSortClass: dragSortIcon
58
59
  }"
60
+ :data.sync="datas"
59
61
  v-on="{
60
62
  ...$listeners,
61
63
  'row-click': rowClick,
62
64
  'selection-change': selectionChange,
63
65
  'filter-column': handleFilterColumn,
64
- 'sort-change': handleSortChange
66
+ 'sort-change': handleSortChange,
67
+ 'update-drag-sort': handleUpdateDragSort
65
68
  }"
66
69
  :class="
67
70
  'es-table' +
68
71
  (theadBorder && border != 'none' ? ' es-thead-border' : '')
69
72
  "
70
73
  >
74
+ <!-- <el-table-column v-if="dragSort" width="32" fixed>
75
+ <template slot-scope="scope">
76
+ <es-icon :contents="dragSortIcon"></es-icon>
77
+ </template>
78
+ </el-table-column> -->
71
79
  <slot name="prepend"></slot>
72
80
  <slot></slot>
73
81
  <template v-for="(item, index) in theads">
74
82
  <template v-if="item.hide !== true">
75
83
  <el-table-column
76
- v-if="item.type === 'index' || item.type === 'selection'"
84
+ v-if="item.type === 'sort'"
85
+ width="32"
86
+ :key="index"
87
+ >
88
+ <template slot-scope="scope">
89
+ <es-icon class="es-move" :contents="dragSortIcon"></es-icon>
90
+ </template>
91
+ </el-table-column>
92
+ <el-table-column
93
+ v-else-if="item.type === 'index' || item.type === 'selection'"
77
94
  :key="index"
78
- v-bind="item"
95
+ v-bind="dragSort ? { ...item, fixed: false } : item"
79
96
  ></el-table-column>
80
97
  <children
81
98
  v-else
@@ -86,7 +103,8 @@
86
103
  form: form,
87
104
  readonly: readonly,
88
105
  optionData: optionDatas,
89
- ...item
106
+ dragSort: dragSort,
107
+ ...(dragSort ? { ...item, fixed: false } : item)
90
108
  }"
91
109
  v-on="{
92
110
  handleClick: handleClick,
@@ -402,6 +420,11 @@ export default {
402
420
  default() {
403
421
  return {};
404
422
  }
423
+ },
424
+ dragSort: Boolean,
425
+ dragSortIcon: {
426
+ type: String,
427
+ default: 'es-icon-caidan'
405
428
  }
406
429
  },
407
430
  data() {
@@ -430,7 +453,8 @@ export default {
430
453
  icon: true,
431
454
  show: true,
432
455
  sysCodes: [],
433
- infiniteDisabled: this.infiniteScroll
456
+ infiniteDisabled: this.infiniteScroll,
457
+ isUpadeData: false
434
458
  };
435
459
  },
436
460
  computed: {
@@ -450,7 +474,23 @@ export default {
450
474
  theads: {
451
475
  get() {
452
476
  let thead = [];
453
- if (this.checkbox) {
477
+ let types = this.theadData
478
+ .filter((item) => {
479
+ return (
480
+ item.type == 'selection' ||
481
+ item.type == 'index' ||
482
+ item.type == 'sort'
483
+ );
484
+ })
485
+ .map((item) => {
486
+ return item.type;
487
+ });
488
+ if (this.dragSort && !types.includes('sort')) {
489
+ thead.push({
490
+ type: 'sort'
491
+ });
492
+ }
493
+ if (this.checkbox && !types.includes('selection')) {
454
494
  thead.push({
455
495
  type: 'selection',
456
496
  width: '55',
@@ -460,7 +500,7 @@ export default {
460
500
  reserveSelection: this.reserveSelection
461
501
  });
462
502
  }
463
- if (this.numbers) {
503
+ if (this.numbers && !types.includes('index')) {
464
504
  let index = 1;
465
505
  if (this.infiniteScroll) {
466
506
  index = typeof this.index == 'boolean' ? 1 : this.index;
@@ -476,7 +516,8 @@ export default {
476
516
  width: '70',
477
517
  align: 'center',
478
518
  fixed: 'left',
479
- index: index
519
+ index: index,
520
+ filterIcon: this.filter ? 'es-icon-biao' : undefined
480
521
  });
481
522
  }
482
523
  if (this.theadData.length) {
@@ -512,6 +553,7 @@ export default {
512
553
  return this.data;
513
554
  },
514
555
  set(val) {
556
+ this.$emit('update:data', val);
515
557
  return val;
516
558
  }
517
559
  },
@@ -1481,6 +1523,9 @@ export default {
1481
1523
  }
1482
1524
  this.$emit('sort-change', res);
1483
1525
  },
1526
+ handleUpdateDragSort(data, event) {
1527
+ this.$emit('update-drag-sort', data, event);
1528
+ },
1484
1529
  mergeThead(res) {
1485
1530
  this.theadData = res;
1486
1531
  this.icon = true;