eoss-ui 0.5.28 → 0.5.29

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/lib/upload.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 = 35);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 36);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ([
@@ -3630,13 +3630,13 @@ window.__store = store;
3630
3630
  /* 22 */,
3631
3631
  /* 23 */,
3632
3632
  /* 24 */,
3633
- /* 25 */,
3634
- /* 26 */
3633
+ /* 25 */
3635
3634
  /***/ (function(module, exports) {
3636
3635
 
3637
3636
  module.exports = require("js-base64");
3638
3637
 
3639
3638
  /***/ }),
3639
+ /* 26 */,
3640
3640
  /* 27 */,
3641
3641
  /* 28 */,
3642
3642
  /* 29 */,
@@ -3645,7 +3645,8 @@ module.exports = require("js-base64");
3645
3645
  /* 32 */,
3646
3646
  /* 33 */,
3647
3647
  /* 34 */,
3648
- /* 35 */
3648
+ /* 35 */,
3649
+ /* 36 */
3649
3650
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3650
3651
 
3651
3652
  "use strict";
@@ -4064,7 +4065,7 @@ var util = __webpack_require__(0);
4064
4065
  var store = __webpack_require__(11);
4065
4066
 
4066
4067
  // EXTERNAL MODULE: external "js-base64"
4067
- var external_js_base64_ = __webpack_require__(26);
4068
+ var external_js_base64_ = __webpack_require__(25);
4068
4069
 
4069
4070
  // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/main.vue?vue&type=script&lang=js&
4070
4071
  var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eoss-ui",
3
- "version": "0.5.28",
3
+ "version": "0.5.29",
4
4
  "description": "eoss内部业务组件",
5
5
  "main": "lib/eoss-ui.common.js",
6
6
  "files": [
@@ -96,7 +96,7 @@
96
96
  "cp-cli": "^1.0.2",
97
97
  "cross-env": "^3.1.3",
98
98
  "css-loader": "^2.1.0",
99
- "eoss-element": "^0.2.80",
99
+ "eoss-element": "^0.2.81",
100
100
  "es6-promise": "^4.0.5",
101
101
  "eslint": "4.18.2",
102
102
  "eslint-config-elemefe": "0.1.1",
@@ -46,7 +46,8 @@ export default {
46
46
  syncKeys: Object,
47
47
  text: String,
48
48
  onClick: Function,
49
- badge: [Object, Number]
49
+ badge: [Object, Number],
50
+ float: String
50
51
  },
51
52
  computed: {
52
53
  _type() {
@@ -268,7 +269,8 @@ export default {
268
269
  clas = clas.concat([
269
270
  'el-button',
270
271
  this._type ? `el-button--${this._type}` : 'el-button--default',
271
- this.size ? `el-button--${this.size}` : ''
272
+ this.size ? `el-button--${this.size}` : '',
273
+ this.float ? `es-button--${this.float}` : ''
272
274
  ]);
273
275
  }
274
276
  if (this.badge) {
@@ -97,6 +97,7 @@
97
97
  label="操作"
98
98
  fixed="right"
99
99
  class="eoss-ui-eidt-column"
100
+ :button="headButton"
100
101
  :total="false"
101
102
  >
102
103
  <template slot-scope="scope">
@@ -108,7 +109,7 @@
108
109
  <i class="el-icon-circle-plus-outline"></i>
109
110
  </el-button>
110
111
  <el-button
111
- v-if="!scope.row.cantDelete"
112
+ v-if="!scope.row.cantDelete && !isLeast"
112
113
  type="text"
113
114
  @click="handleClickDeleteData(scope)"
114
115
  >
@@ -142,7 +143,6 @@ import sizer from './sizer.vue';
142
143
  import util from 'eoss-ui/src/utils/util';
143
144
  import bus from 'eoss-ui/src/utils/bus';
144
145
  import qs from 'qs';
145
- import itemVue from '../../layout/src/item.vue';
146
146
  export default {
147
147
  name: 'EsDataTable',
148
148
  inheritAttrs: false,
@@ -303,6 +303,10 @@ export default {
303
303
  type: Boolean,
304
304
  default: false
305
305
  },
306
+ theadAdd: {
307
+ type: Boolean,
308
+ default: true
309
+ },
306
310
  // 单元格点击事件
307
311
  click: {
308
312
  type: Boolean,
@@ -356,6 +360,11 @@ export default {
356
360
  default() {
357
361
  return [];
358
362
  }
363
+ },
364
+ rowData: [Object, Boolean],
365
+ least: {
366
+ type: Boolean,
367
+ default: false
359
368
  }
360
369
  },
361
370
  data() {
@@ -490,6 +499,18 @@ export default {
490
499
  set(val) {
491
500
  return val;
492
501
  }
502
+ },
503
+ headButton() {
504
+ return this.theadAdd
505
+ ? {
506
+ icon: 'el-icon-circle-plus-outline',
507
+ type: 'text',
508
+ event: this.handleClickAddData
509
+ }
510
+ : false;
511
+ },
512
+ isLeast() {
513
+ return this.data.length < 2 && this.least;
493
514
  }
494
515
  },
495
516
  watch: {
@@ -708,18 +729,43 @@ export default {
708
729
  this.$emit('row-click', row, column, event);
709
730
  },
710
731
  handleClickAddData(scope) {
711
- const data = JSON.parse(JSON.stringify(scope.row));
712
- let index = scope.$index + 1;
713
- if (this.page) {
714
- index += (this.config.pageNum - 1) * this.config.pageSize;
732
+ if (scope && scope.row) {
733
+ const data = JSON.parse(JSON.stringify(scope.row));
734
+ let index = scope.$index + 1;
735
+ if (this.page) {
736
+ index += (this.config.pageNum - 1) * this.config.pageSize;
737
+ }
738
+ this.data.splice(index, 0, data);
739
+ this.$emit('dataChange', 'add', data);
740
+ this.$emit('btnClick', {
741
+ event: 'addRow',
742
+ row: data,
743
+ index: index,
744
+ data: this.data
745
+ });
746
+ } else {
747
+ let index = this.data.length;
748
+ if (this.page) {
749
+ index += (this.config.pageNum - 1) * this.config.pageSize;
750
+ }
751
+ let rows = {};
752
+ if (this.rowData && typeof this.rowData == 'object') {
753
+ rows = this.rowData;
754
+ } else if (index && this.rowData === true) {
755
+ rows = JSON.parse(JSON.stringify(this.data[index - 1]));
756
+ } else {
757
+ this.getRow(this.thead, rows);
758
+ }
759
+ this.data.splice(index, 0, rows);
715
760
  }
716
- this.data.splice(index, 0, data);
717
- this.$emit('dataChange', 'add', data);
718
- this.$emit('btnClick', {
719
- event: 'addRow',
720
- row: data,
721
- index: index,
722
- data: this.data
761
+ },
762
+ getRow(thead, obj) {
763
+ thead.forEach((item) => {
764
+ if (item.field) {
765
+ obj[item['field']] = item.defaultValue || '';
766
+ } else if (item.children && item.children.length) {
767
+ this.getRow(item.children, obj);
768
+ }
723
769
  });
724
770
  },
725
771
  handleClickDeleteData(scope) {
@@ -316,6 +316,7 @@ export default {
316
316
  key: 'userId',
317
317
  value: value.value
318
318
  });
319
+ util.removeStorage('mainConfig');
319
320
  this.$message({
320
321
  message: res.msg,
321
322
  type: 'success',
@@ -105,6 +105,7 @@
105
105
  readonly
106
106
  :name="name"
107
107
  type="text"
108
+ wqwq
108
109
  v-show="false"
109
110
  ></el-input>
110
111
  </template>
@@ -209,6 +210,7 @@
209
210
  import util from 'eoss-ui/src/utils/util.js';
210
211
  import { getSelectorOrgDetail } from 'eoss-ui/src/config/api.js';
211
212
  import Clickoutside from 'eoss-element/src/utils/clickoutside';
213
+ import { debounce } from 'eoss-element/src/utils/util';
212
214
  export default {
213
215
  name: 'EsSelector',
214
216
  inheritAttrs: false,
@@ -324,6 +326,10 @@ export default {
324
326
  noMatchText: {
325
327
  type: String,
326
328
  default: '无匹配数据'
329
+ },
330
+ emptySerach: {
331
+ type: Boolean,
332
+ default: false
327
333
  }
328
334
  },
329
335
  data() {
@@ -338,7 +344,8 @@ export default {
338
344
  options: '',
339
345
  show: false,
340
346
  focus: false,
341
- reference: undefined
347
+ reference: undefined,
348
+ timer: null
342
349
  };
343
350
  },
344
351
  computed: {
@@ -384,7 +391,7 @@ export default {
384
391
  if (this.selected && this.selected.length) {
385
392
  return '';
386
393
  } else if (this.filterable) {
387
- return '输入关键字按回车搜索';
394
+ return '输入关键字搜索';
388
395
  } else {
389
396
  return this.placeholder;
390
397
  }
@@ -412,6 +419,12 @@ export default {
412
419
  this.resetInputHeight();
413
420
  }
414
421
  }
422
+ },
423
+ words(val) {
424
+ if (this.emptySerach || val !== '') {
425
+ clearTimeout(this.timer);
426
+ this.timer = setTimeout(this.handleSearch, 500);
427
+ }
415
428
  }
416
429
  },
417
430
  created() {
@@ -424,7 +437,6 @@ export default {
424
437
  this.$refs.reference &&
425
438
  (this.minWidth = this.$refs.reference.$el.children[0].offsetWidth);
426
439
  });
427
- this.$el.addEventListener('keyup', this.doSearch);
428
440
  }
429
441
  if (this.$refs.openDialog) {
430
442
  this.$refs.openDialog.$el.parentNode.addEventListener('click', () => {
@@ -433,16 +445,6 @@ export default {
433
445
  }
434
446
  },
435
447
  methods: {
436
- doSearch(e) {
437
- if (util.win.event == undefined) {
438
- var key = e.keyCode;
439
- } else {
440
- var key = util.win.event.keyCode;
441
- }
442
- if (key == 13) {
443
- this.handleSearch();
444
- }
445
- },
446
448
  isObject(obj) {
447
449
  return util.isObject(obj);
448
450
  },
@@ -1 +1 @@
1
- .el-button+.es-button-badge,.es-button-badge+.el-button{margin-left:10px}.es-button-badge{vertical-align:unset}
1
+ .el-button+.es-button-badge,.es-button-badge+.el-button{margin-left:10px}.es-button-badge{vertical-align:unset}.el-button[float=left],.el-button[float=right],.es-button--left,.es-button--right{float:left}