ai.touchui-vue 1.34.1 → 1.35.0

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 (40) hide show
  1. package/lib/ai.touchui-vue.common.js +429 -188
  2. package/lib/cascader.js +24 -22
  3. package/lib/date-picker.js +7 -6
  4. package/lib/flow.js +9 -8
  5. package/lib/form.js +8 -8
  6. package/lib/index.js +1 -1
  7. package/lib/input.js +23 -6
  8. package/lib/loading.js +47 -3
  9. package/lib/locale/lang/en.js +3 -1
  10. package/lib/locale/lang/zh-CN.js +3 -1
  11. package/lib/msg/index.js +7 -2
  12. package/lib/msg.js +47 -3
  13. package/lib/select.js +34 -8
  14. package/lib/slide.js +4 -4
  15. package/lib/space.js +3 -3
  16. package/lib/table.js +140 -13
  17. package/lib/umd/locale/en.js +3 -1
  18. package/lib/umd/locale/zh-CN.js +3 -1
  19. package/lib/utils/jsencrypt/jselib/jsrsasign/yahoo.js +60 -60
  20. package/lib/utils/validate.js +22 -4
  21. package/package.json +1 -1
  22. package/packages/cascader/src/cascader.vue +4 -4
  23. package/packages/date-picker/src/date-picker.vue +1 -1
  24. package/packages/flow/src/flowLine.vue +2 -1
  25. package/packages/form/src/form-item.vue +1 -1
  26. package/packages/input/src/input.vue +18 -4
  27. package/packages/msg/src/msg.vue +20 -1
  28. package/packages/select/src/select.vue +26 -3
  29. package/packages/slide/src/slide.vue +2 -2
  30. package/packages/space/src/space.vue +1 -1
  31. package/packages/table/src/table-body.vue +85 -3
  32. package/packages/table/src/table.vue +38 -2
  33. package/packages/theme/src/.DS_Store +0 -0
  34. package/src/index.js +1 -1
  35. package/src/locale/lang/en.js +3 -1
  36. package/src/locale/lang/zh-CN.js +3 -1
  37. package/src/msg/index.js +9 -2
  38. package/src/utils/jsencrypt/JSEncryptRSAKey.js +26 -27
  39. package/src/utils/jsencrypt/jselib/jsrsasign/yahoo.js +60 -60
  40. package/src/utils/validate.js +22 -4
package/lib/table.js CHANGED
@@ -245,7 +245,7 @@ module.exports = require("ai.touchui-vue/lib/locale");
245
245
  // ESM COMPAT FLAG
246
246
  __webpack_require__.r(__webpack_exports__);
247
247
 
248
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/table/src/table.vue?vue&type=template&id=f49d5814
248
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/table/src/table.vue?vue&type=template&id=0f1f2eda
249
249
  var render = function () {
250
250
  var _vm = this
251
251
  var _h = _vm.$createElement
@@ -1064,7 +1064,7 @@ var staticRenderFns = []
1064
1064
  render._withStripped = true
1065
1065
 
1066
1066
 
1067
- // CONCATENATED MODULE: ./packages/table/src/table.vue?vue&type=template&id=f49d5814
1067
+ // CONCATENATED MODULE: ./packages/table/src/table.vue?vue&type=template&id=0f1f2eda
1068
1068
 
1069
1069
  // EXTERNAL MODULE: external "vue"
1070
1070
  var external_vue_ = __webpack_require__(4);
@@ -2086,8 +2086,8 @@ var table_head_component = Object(componentNormalizer["a" /* default */])(
2086
2086
  )
2087
2087
 
2088
2088
  /* harmony default export */ var table_head = (table_head_component.exports);
2089
- // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/table/src/table-body.vue?vue&type=template&id=29fea657
2090
- var table_bodyvue_type_template_id_29fea657_render = function () {
2089
+ // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/table/src/table-body.vue?vue&type=template&id=4c1ad380
2090
+ var table_bodyvue_type_template_id_4c1ad380_render = function () {
2091
2091
  var _vm = this
2092
2092
  var _h = _vm.$createElement
2093
2093
  var _c = _vm._self._c || _h
@@ -2729,7 +2729,8 @@ var table_bodyvue_type_template_id_29fea657_render = function () {
2729
2729
  $event.stopPropagation()
2730
2730
  return _vm.toggleFold(
2731
2731
  dataItem,
2732
- dataIndex
2732
+ dataIndex,
2733
+ true
2733
2734
  )
2734
2735
  },
2735
2736
  },
@@ -2786,11 +2787,11 @@ var table_bodyvue_type_template_id_29fea657_render = function () {
2786
2787
  0
2787
2788
  )
2788
2789
  }
2789
- var table_bodyvue_type_template_id_29fea657_staticRenderFns = []
2790
- table_bodyvue_type_template_id_29fea657_render._withStripped = true
2790
+ var table_bodyvue_type_template_id_4c1ad380_staticRenderFns = []
2791
+ table_bodyvue_type_template_id_4c1ad380_render._withStripped = true
2791
2792
 
2792
2793
 
2793
- // CONCATENATED MODULE: ./packages/table/src/table-body.vue?vue&type=template&id=29fea657
2794
+ // CONCATENATED MODULE: ./packages/table/src/table-body.vue?vue&type=template&id=4c1ad380
2794
2795
 
2795
2796
  // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/table/src/table-body.vue?vue&type=script&lang=js
2796
2797
  //
@@ -3031,7 +3032,7 @@ table_bodyvue_type_template_id_29fea657_render._withStripped = true
3031
3032
  },
3032
3033
  inject: ['ToTable'],
3033
3034
  methods: {
3034
- toggleFold: function toggleFold(item, index) {
3035
+ toggleFold: function toggleFold(item, index, type) {
3035
3036
  var that = this;
3036
3037
  if (!item._showChild) {
3037
3038
  item._showChild = true;
@@ -3042,7 +3043,11 @@ table_bodyvue_type_template_id_29fea657_render._withStripped = true
3042
3043
  var el = this.data[i];
3043
3044
  if (item._showChild) {
3044
3045
  if (el._level === item._level + 1) {
3045
- el._show = true;
3046
+ if (type) {
3047
+ el._show = true;
3048
+ } else {
3049
+ show(el, i);
3050
+ }
3046
3051
  } else if (el._level <= item._level) {
3047
3052
  break;
3048
3053
  }
@@ -3068,6 +3073,86 @@ table_bodyvue_type_template_id_29fea657_render._withStripped = true
3068
3073
  }
3069
3074
  }
3070
3075
  }
3076
+ function show(tr, index) {
3077
+ tr._show = true;
3078
+ tr._showChild = true;
3079
+ if (tr._hasChild) {
3080
+ for (var _i2 = index + 1; _i2 < that.data.length; _i2++) {
3081
+ var _el2 = that.data[_i2];
3082
+ if (_el2._level === tr._level + 1) {
3083
+ show(_el2, _i2);
3084
+ } else {
3085
+ break;
3086
+ }
3087
+ }
3088
+ }
3089
+ }
3090
+ this.ToTable.adjust();
3091
+ },
3092
+
3093
+ // 展开全部
3094
+ expandAll: function expandAll(item, index, type) {
3095
+ var that = this;
3096
+ item._showChild = true;
3097
+ for (var i = index + 1; i < this.data.length; i++) {
3098
+ var el = this.data[i];
3099
+ if (item._showChild) {
3100
+ if (el._level === item._level + 1) {
3101
+ if (type) {
3102
+ el._show = true;
3103
+ } else {
3104
+ show(el, i);
3105
+ }
3106
+ } else if (el._level <= item._level) {
3107
+ break;
3108
+ }
3109
+ }
3110
+ }
3111
+ function show(tr, index) {
3112
+ tr._show = true;
3113
+ tr._showChild = true;
3114
+ if (tr._hasChild) {
3115
+ for (var _i3 = index + 1; _i3 < that.data.length; _i3++) {
3116
+ var _el3 = that.data[_i3];
3117
+ if (_el3._level === tr._level + 1) {
3118
+ show(_el3, _i3);
3119
+ } else {
3120
+ break;
3121
+ }
3122
+ }
3123
+ }
3124
+ }
3125
+ this.ToTable.adjust();
3126
+ },
3127
+
3128
+ // 收起全部
3129
+ collapseAll: function collapseAll(item, index) {
3130
+ var that = this;
3131
+ item._showChild = false;
3132
+ for (var i = index + 1; i < this.data.length; i++) {
3133
+ var el = this.data[i];
3134
+ if (!item._showChild) {
3135
+ if (el._level === item._level + 1) {
3136
+ hide(el, i);
3137
+ } else if (el._level <= item._level) {
3138
+ break;
3139
+ }
3140
+ }
3141
+ }
3142
+ function hide(tr, index) {
3143
+ tr._show = false;
3144
+ tr._showChild = false;
3145
+ if (tr._hasChild) {
3146
+ for (var _i4 = index + 1; _i4 < that.data.length; _i4++) {
3147
+ var _el4 = that.data[_i4];
3148
+ if (_el4._level === tr._level + 1) {
3149
+ hide(_el4, _i4);
3150
+ } else {
3151
+ break;
3152
+ }
3153
+ }
3154
+ }
3155
+ }
3071
3156
  this.ToTable.adjust();
3072
3157
  },
3073
3158
  clickHandle: function clickHandle(event) {
@@ -3116,8 +3201,8 @@ table_bodyvue_type_template_id_29fea657_render._withStripped = true
3116
3201
 
3117
3202
  var table_body_component = Object(componentNormalizer["a" /* default */])(
3118
3203
  src_table_bodyvue_type_script_lang_js,
3119
- table_bodyvue_type_template_id_29fea657_render,
3120
- table_bodyvue_type_template_id_29fea657_staticRenderFns,
3204
+ table_bodyvue_type_template_id_4c1ad380_render,
3205
+ table_bodyvue_type_template_id_4c1ad380_staticRenderFns,
3121
3206
  false,
3122
3207
  null,
3123
3208
  null,
@@ -3294,6 +3379,10 @@ var lib_locale_ = __webpack_require__(3);
3294
3379
  //
3295
3380
  //
3296
3381
  //
3382
+ //
3383
+ //
3384
+ //
3385
+ //
3297
3386
 
3298
3387
 
3299
3388
 
@@ -3515,7 +3604,8 @@ function db(fn) {
3515
3604
  fixed: false,
3516
3605
  isStartLongtap: false,
3517
3606
  longtapTimer: null,
3518
- stopClick: false
3607
+ stopClick: false,
3608
+ expandFlag: true
3519
3609
  };
3520
3610
  },
3521
3611
 
@@ -4702,6 +4792,43 @@ function db(fn) {
4702
4792
  },
4703
4793
  columnChangeHandle: function columnChangeHandle(data) {
4704
4794
  this.$emit('update:columns', data);
4795
+ },
4796
+ toggleFold: function toggleFold(item, index) {
4797
+ this.$refs.tbody.toggleFold(item, index, false);
4798
+ },
4799
+
4800
+ // 展开所有
4801
+ expandAll: function expandAll() {
4802
+ var _this18 = this;
4803
+
4804
+ if (this.iData.length > 0) {
4805
+ this.iData.forEach(function (item, index) {
4806
+ if (item._hasChild && item._level === 1 && item._show === true) {
4807
+ _this18.$refs.tbody.expandAll(item, index, false);
4808
+ }
4809
+ });
4810
+ }
4811
+ },
4812
+
4813
+ // 折叠所有
4814
+ collapseAll: function collapseAll() {
4815
+ var _this19 = this;
4816
+
4817
+ if (this.iData.length > 0) {
4818
+ this.iData.forEach(function (item, index) {
4819
+ if (item._hasChild && item._level === 1 && item._show === true) {
4820
+ _this19.$refs.tbody.collapseAll(item, index, false);
4821
+ }
4822
+ });
4823
+ }
4824
+ },
4825
+ toggleFoldAll: function toggleFoldAll() {
4826
+ if (this.expandFlag) {
4827
+ this.expandAll();
4828
+ } else {
4829
+ this.collapseAll();
4830
+ }
4831
+ this.expandFlag = !this.expandFlag;
4705
4832
  }
4706
4833
  }
4707
4834
  });
@@ -79,7 +79,9 @@
79
79
  tip: {
80
80
  common: '{0} format is incorrect. Please enter valid {1}',
81
81
  custom: '{0} format is incorrect',
82
- required: '{0} cannot be empty'
82
+ customRemark: '{0}{1}',
83
+ required: '{0} cannot be empty',
84
+ requiredRemark: '{0}'
83
85
  }
84
86
  },
85
87
  calendar: {
@@ -79,7 +79,9 @@
79
79
  tip: {
80
80
  common: '{0}格式不正确,请填写正确的{1}',
81
81
  custom: '{0}格式不正确{1}',
82
- required: '{0}不能为空'
82
+ customRemark: '{0}{1}',
83
+ required: '{0}不能为空',
84
+ requiredRemark: '{0}'
83
85
  }
84
86
  },
85
87
  calendar: {
@@ -3,64 +3,64 @@
3
3
  exports.__esModule = true;
4
4
  var YAHOO = exports.YAHOO = {};
5
5
  YAHOO.lang = {
6
- /**
7
- * Utility to set up the prototype, constructor and superclass properties to
8
- * support an inheritance strategy that can chain constructors and methods.
9
- * Static members will not be inherited.
10
- *
11
- * @method extend
12
- * @static
13
- * @param {Function} subc the object to modify
14
- * @param {Function} superc the object to inherit
15
- * @param {Object} overrides additional properties/methods to add to the
16
- * subclass prototype. These will override the
17
- * matching items obtained from the superclass
18
- * if present.
19
- */
20
- extend: function extend(subc, superc, overrides) {
21
- if (!superc || !subc) {
22
- throw new Error("YAHOO.lang.extend failed, please check that " + "all dependencies are included.");
23
- }
24
- var F = function F() {};
25
- F.prototype = superc.prototype;
26
- subc.prototype = new F();
27
- subc.prototype.constructor = subc;
28
- subc.superclass = superc.prototype;
29
- if (superc.prototype.constructor == Object.prototype.constructor) {
30
- superc.prototype.constructor = superc;
31
- }
32
- if (overrides) {
33
- var i;
34
- for (i in overrides) {
35
- subc.prototype[i] = overrides[i];
36
- }
37
- /*
38
- * IE will not enumerate native functions in a derived object even if the
39
- * function was overridden. This is a workaround for specific functions
40
- * we care about on the Object prototype.
41
- * @property _IEEnumFix
42
- * @param {Function} r the object to receive the augmentation
43
- * @param {Function} s the object that supplies the properties to augment
44
- * @static
45
- * @private
46
- */
47
- var _IEEnumFix = function _IEEnumFix() {},
48
- ADD = ["toString", "valueOf"];
49
- try {
50
- if (/MSIE/.test(navigator.userAgent)) {
51
- _IEEnumFix = function _IEEnumFix(r, s) {
52
- for (i = 0; i < ADD.length; i = i + 1) {
53
- var fname = ADD[i],
54
- f = s[fname];
55
- if (typeof f === 'function' && f != Object.prototype[fname]) {
56
- r[fname] = f;
57
- }
58
- }
59
- };
60
- }
61
- } catch (ex) {}
62
- ;
63
- _IEEnumFix(subc.prototype, overrides);
64
- }
65
- }
6
+ /**
7
+ * Utility to set up the prototype, constructor and superclass properties to
8
+ * support an inheritance strategy that can chain constructors and methods.
9
+ * Static members will not be inherited.
10
+ *
11
+ * @method extend
12
+ * @static
13
+ * @param {Function} subc the object to modify
14
+ * @param {Function} superc the object to inherit
15
+ * @param {Object} overrides additional properties/methods to add to the
16
+ * subclass prototype. These will override the
17
+ * matching items obtained from the superclass
18
+ * if present.
19
+ */
20
+ extend: function extend(subc, superc, overrides) {
21
+ if (!superc || !subc) {
22
+ throw new Error("YAHOO.lang.extend failed, please check that " + "all dependencies are included.");
23
+ }
24
+ var F = function F() {};
25
+ F.prototype = superc.prototype;
26
+ subc.prototype = new F();
27
+ subc.prototype.constructor = subc;
28
+ subc.superclass = superc.prototype;
29
+ if (superc.prototype.constructor == Object.prototype.constructor) {
30
+ superc.prototype.constructor = superc;
31
+ }
32
+ if (overrides) {
33
+ var i;
34
+ for (i in overrides) {
35
+ subc.prototype[i] = overrides[i];
36
+ }
37
+ /*
38
+ * IE will not enumerate native functions in a derived object even if the
39
+ * function was overridden. This is a workaround for specific functions
40
+ * we care about on the Object prototype.
41
+ * @property _IEEnumFix
42
+ * @param {Function} r the object to receive the augmentation
43
+ * @param {Function} s the object that supplies the properties to augment
44
+ * @static
45
+ * @private
46
+ */
47
+ var _IEEnumFix = function _IEEnumFix() {},
48
+ ADD = ["toString", "valueOf"];
49
+ try {
50
+ if (/MSIE/.test(navigator.userAgent)) {
51
+ _IEEnumFix = function _IEEnumFix(r, s) {
52
+ for (i = 0; i < ADD.length; i = i + 1) {
53
+ var fname = ADD[i],
54
+ f = s[fname];
55
+ if (typeof f === 'function' && f != Object.prototype[fname]) {
56
+ r[fname] = f;
57
+ }
58
+ }
59
+ };
60
+ }
61
+ } catch (ex) {}
62
+ ;
63
+ _IEEnumFix(subc.prototype, overrides);
64
+ }
65
+ }
66
66
  };
@@ -318,7 +318,11 @@ var validate = function validate(dom) {
318
318
  } else {
319
319
  reg = new RegExp(rule);
320
320
  if (!reg.test(value)) {
321
- formVue.errorTip = (0, _locale.t)('to.validate.tip.custom', desc, formVue.validateTip ? '\uFF0C' + formVue.validateTip : '');
321
+ if (desc.indexOf('-label') > -1) {
322
+ formVue.errorTip = (0, _locale.t)('to.validate.tip.custom', desc, formVue.validateTip ? '\uFF0C' + formVue.validateTip : '');
323
+ } else {
324
+ formVue.errorTip = (0, _locale.t)('to.validate.tip.customRemark', desc, formVue.validateTip ? '\uFF0C' + formVue.validateTip : '');
325
+ }
322
326
  allPass = false;
323
327
  setHiddenErrorNodes(formEl);
324
328
  return 'continue';
@@ -331,7 +335,12 @@ var validate = function validate(dom) {
331
335
  }
332
336
  } else if (required) {
333
337
  formVue.errorType = 'required';
334
- formVue.errorTip = (0, _locale.t)('to.validate.tip.required', desc);
338
+ if (desc.indexOf('-label') > -1) {
339
+ var desc_label = desc.replace('-label', '');
340
+ formVue.errorTip = (0, _locale.t)('to.validate.tip.required', desc_label);
341
+ } else {
342
+ formVue.errorTip = (0, _locale.t)('to.validate.tip.requiredRemark', desc);
343
+ }
335
344
  allPass = false;
336
345
  setHiddenErrorNodes(formEl);
337
346
  return 'continue';
@@ -357,7 +366,11 @@ var validate = function validate(dom) {
357
366
  } else {
358
367
  _reg = new RegExp(rule);
359
368
  if (!_reg.test(value)) {
360
- showTip(formEl, (0, _locale.t)('to.validate.tip.custom', desc, formVue.validateTip ? '\uFF0C' + formVue.validateTip : ''));
369
+ if (desc.indexOf('-label') > -1) {
370
+ showTip(formEl, (0, _locale.t)('to.validate.tip.custom', desc, formVue.validateTip ? '\uFF0C' + formVue.validateTip : ''));
371
+ } else {
372
+ showTip(formEl, (0, _locale.t)('to.validate.tip.customRemark', desc, formVue.validateTip ? '\uFF0C' + formVue.validateTip : ''));
373
+ }
361
374
  return {
362
375
  v: false
363
376
  };
@@ -369,7 +382,12 @@ var validate = function validate(dom) {
369
382
  return 'continue';
370
383
  }
371
384
  } else if (required) {
372
- showTip(formEl, (0, _locale.t)('to.validate.tip.required', desc));
385
+ if (desc.indexOf('-label') > -1) {
386
+ var _desc_label = desc.replace('-label', '');
387
+ showTip(formEl, (0, _locale.t)('to.validate.tip.required', _desc_label));
388
+ } else {
389
+ showTip(formEl, (0, _locale.t)('to.validate.tip.requiredRemark', desc));
390
+ }
373
391
  return {
374
392
  v: false
375
393
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai.touchui-vue",
3
- "version": "1.34.1",
3
+ "version": "1.35.0",
4
4
  "description": "TouchUI Component Library for Vue.js.",
5
5
  "main": "lib/ai.touchui-vue.common.js",
6
6
  "files": [
@@ -12,7 +12,7 @@
12
12
  <span v-if="multiple && selected.length > 0" class="to-selectTag">
13
13
  <template v-if="selected.length > 0">
14
14
  <template v-for="(item, index) in selected">
15
- <to-tag :key="index" color="fg" mode="plain" :deletable="!disabled" @delete="removeCheck(item.value); setSelected()">{{ item.labelPath }}</to-tag>
15
+ <to-tag v-if="true" :key="index" color="fg" mode="plain" :deletable="!disabled" @delete="removeCheck(item.value); setSelected()">{{ item.labelPath }}</to-tag>
16
16
  </template>
17
17
  </template>
18
18
  </span>
@@ -481,7 +481,7 @@ export default {
481
481
  }
482
482
  } else {
483
483
  this.label = this.getLabelPath(val.value)
484
- this.$emit('change', val.value)
484
+ this.$emit('change', val.value, val)
485
485
  }
486
486
  }
487
487
  }
@@ -589,7 +589,7 @@ export default {
589
589
  let that = this
590
590
  function set(node, level = 0, path = '', labelPath = '', parent = '__root__') {
591
591
  for (let i = 0; i < node.length; i++) {
592
- arr.push({
592
+ arr.push(Object.assign(node[i], {
593
593
  label: node[i][that.labelText] || '',
594
594
  value: node[i][that.valueText] || '',
595
595
  level: level,
@@ -597,7 +597,7 @@ export default {
597
597
  labelPath: (labelPath + ' / ' + node[i][that.labelText]).substr(3),
598
598
  parent: parent,
599
599
  isLeaf: !(node[i][that.childrenText] && node[i][that.childrenText].length > 0)
600
- })
600
+ }))
601
601
  if (node[i][that.childrenText]) {
602
602
  set(
603
603
  node[i][that.childrenText],
@@ -21,7 +21,7 @@
21
21
  :clearable="clearable && !disabled"
22
22
  :width="width"
23
23
  :comparable="comparable"
24
- @focus="errorTip = ''"
24
+ @focus="errorTip = '';$emit('focus',datedisplay)"
25
25
  @click="handleClick"
26
26
  @clear="clear()"
27
27
  @input="handleDisplayChange"
@@ -123,7 +123,8 @@ export default {
123
123
  this.x1 = from.getBoundingClientRect().left + from.offsetWidth
124
124
  this.y1 = from.getBoundingClientRect().top + from.offsetHeight / 2;
125
125
  this.x2 = to.getBoundingClientRect().left
126
- this.y2 = to.getBoundingClientRect().top + from.offsetHeight / 2;
126
+ // this.y2 = to.getBoundingClientRect().top + from.offsetHeight / 2;
127
+ this.y2 = to.getBoundingClientRect().top + to.offsetHeight / 2;
127
128
  if (this.y2 === this.y1) {
128
129
  this.xStart = 0
129
130
  this.yStart = 3 * this.px()
@@ -2,7 +2,7 @@
2
2
  <li :class="setClass" :style="setStyle" @click="$emit('click')">
3
3
  <div class="content">
4
4
  <div v-if="label || $slots.label" ref="label" class="label" :class="setLabelClass">
5
- <div ref="labelText" class="text"><slot name="label">{{ label }}</slot></div>
5
+ <div ref="labelText" class="text">{{ label }}<slot name="label"></slot></div>
6
6
  <div v-if="$slots.tip && ToForm.type === 'list'" class="tip"><slot name="tip"></slot></div>
7
7
  </div>
8
8
  <div class="value">
@@ -1,6 +1,16 @@
1
1
  <template>
2
2
  <span :id="id" v-tip="changed ? t('to.common.originalValue', valueStore[0]) : ''" class="to-input" :class="setClass" :style="setStyle" @click.stop="$emit('click')">
3
- <span v-if="verifiable && (rule || required || ToFormItem.required)" v-show="false" :trim="trim" :req="validateRequired" class="to-validate" :desc="validateDesc" :rule="rule" :value="data"></span>
3
+ <span
4
+ v-if="verifiable && ((typeof rule === 'string' ? rule : !rule) || required || ToFormItem.required)"
5
+ v-show="false"
6
+ :trim="trim"
7
+ :req="validateRequired"
8
+ class="to-validate"
9
+ :desc="validateDesc"
10
+ :rule="(typeof rule === 'string' ? rule : !rule)"
11
+ :value="data"
12
+ >
13
+ </span>
4
14
  <span v-if="prefix || $slots.prefix || step" class="to-inputPrefix">
5
15
  <slot name="prefix"></slot>
6
16
  <span v-if="prefix" class="to-inputText">{{ prefix }}</span>
@@ -92,7 +102,7 @@ export default {
92
102
  default: ''
93
103
  },
94
104
  rule: {
95
- type: String,
105
+ type: [String, Boolean],
96
106
  default: ''
97
107
  },
98
108
  id: {
@@ -374,9 +384,13 @@ export default {
374
384
  },
375
385
  validateDesc() {
376
386
  if (this.desc) {
377
- return this.desc
387
+ return this.desc;
378
388
  } else if (this.ToFormItem && this.ToFormItem.label) {
379
- return this.ToFormItem.label
389
+ if (typeof this.rule === 'string') {
390
+ return this.ToFormItem.label + '-label';
391
+ } else {
392
+ return this.ToFormItem.label;
393
+ }
380
394
  } else {
381
395
  return ''
382
396
  }
@@ -31,6 +31,14 @@
31
31
  <slot>
32
32
  <to-button v-if="cancelButtonText" icon="close" fillet="normal" @click="cancel">{{ cancelButtonText }}</to-button>
33
33
  <to-button v-if="confirmButtonText" icon="ok" color="primary" fillet="normal" @click="confirm">{{ confirmButtonText }}</to-button>
34
+ <to-button
35
+ v-for="(btn, index) in buttons"
36
+ :key="index"
37
+ v-bind="btn.attrs"
38
+ @click="handleButtonClick(btn)"
39
+ >
40
+ {{ btn.label }}
41
+ </to-button>
34
42
  </slot>
35
43
  </div>
36
44
  </div>
@@ -112,7 +120,13 @@ export default {
112
120
  default: 0
113
121
  },
114
122
  global: Boolean,
115
- show: Boolean
123
+ show: Boolean,
124
+ buttons: {
125
+ type: Array,
126
+ default: () => {
127
+ return []
128
+ }
129
+ }
116
130
  },
117
131
  data() {
118
132
  return {
@@ -221,6 +235,11 @@ export default {
221
235
  cancel() {
222
236
  this.visible = false
223
237
  this.$emit('close')
238
+ },
239
+ handleButtonClick(btn) {
240
+ if (typeof btn.fn === 'function') {
241
+ btn.fn()
242
+ }
224
243
  }
225
244
  }
226
245
  };
@@ -1,6 +1,16 @@
1
1
  <template>
2
2
  <span :id="id" ref="link" v-tip="changed ? t('to.common.originalValue', getLabel(valueStore[0])) : ''" class="to-select" :class="setClass" :style="setStyle" :tabindex="inputable || filterable ? '-1' : tabindex" @mousedown="layerMousedown" @focus="focus" @blur="blur" @keyup.enter="enter" @keyup.esc="closeLayer">
3
- <span v-if="verifiable && (rule || required || ToFormItem.required)" v-show="false" :trim="trim" :req="validateRequired" class="to-validate" :desc="validateDesc" :rule="rule" :value="validateValue"></span>
3
+ <span
4
+ v-if="verifiable && ((typeof rule === 'string' ? rule : !rule) || required || ToFormItem.required)"
5
+ v-show="false"
6
+ :trim="trim"
7
+ :req="validateRequired"
8
+ class="to-validate"
9
+ :desc="validateDesc"
10
+ :rule="(typeof rule === 'string' ? rule : !rule)"
11
+ :value="validateValue"
12
+ >
13
+ </span>
4
14
  <span v-if="$slots.prefix" class="to-selectPrefix"><slot name="prefix"></slot></span>
5
15
  <span class="to-selectContent" :class="setContentClass" @click="click">
6
16
 
@@ -87,7 +97,7 @@
87
97
  <slot :data="options">
88
98
  <to-grid v-if="(optionDisplay === 'popup' || ((inputable || filterable) && $phone))" height="full" type="v">
89
99
  <to-grid-item side>
90
- <to-header level="0" :title="validateDesc ? t('to.select.float.title', validateDesc) : t('to.select.float.titlePlaceholder', validateDesc)" @back="closeLayer()">
100
+ <to-header level="0" :title="validateDescTitle ? t('to.select.float.title', validateDescTitle) : t('to.select.float.titlePlaceholder', validateDescTitle)" @back="closeLayer()">
91
101
  <to-button fillet="normal" icon="close" mode="none" color="primary" @click="clear(); closeLayer();">{{ t('to.common.clear') }}</to-button>
92
102
  </to-header>
93
103
  <to-padding v-if="filterable || inputable" position="side">
@@ -271,7 +281,7 @@ export default {
271
281
  default: ''
272
282
  },
273
283
  rule: {
274
- type: String,
284
+ type: [String, Boolean],
275
285
  default: ''
276
286
  },
277
287
  id: {
@@ -656,6 +666,19 @@ export default {
656
666
  }
657
667
  },
658
668
  validateDesc() {
669
+ if (this.desc) {
670
+ return this.desc
671
+ } else if (this.ToFormItem && this.ToFormItem.label) {
672
+ if (typeof this.rule === 'string') {
673
+ return this.ToFormItem.label + '-label';
674
+ } else {
675
+ return this.ToFormItem.label;
676
+ }
677
+ } else {
678
+ return ''
679
+ }
680
+ },
681
+ validateDescTitle() {
659
682
  if (this.desc) {
660
683
  return this.desc
661
684
  } else if (this.ToFormItem && this.ToFormItem.label) {
@@ -119,10 +119,10 @@ export default {
119
119
  return
120
120
  }
121
121
  this.animate = true
122
- if (this.dis > 0) {
122
+ if (this.dis > 10) {
123
123
  this.prev()
124
124
  this.dis = 0
125
- } else {
125
+ } else if (this.dis < -10) {
126
126
  this.next()
127
127
  this.dis = 0
128
128
  }