eoss-mobiles 0.2.69 → 0.2.70

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 (45) hide show
  1. package/lib/checkbox.js +0 -2
  2. package/lib/eoss-mobile.common.js +603 -320
  3. package/lib/esign.js +3 -3
  4. package/lib/field.js +7 -3
  5. package/lib/flow-btn.js +3 -7
  6. package/lib/flow-list.js +0 -2
  7. package/lib/flow.js +8 -12
  8. package/lib/form.js +2 -5
  9. package/lib/index.js +1 -1
  10. package/lib/picker.js +127 -41
  11. package/lib/radio.js +0 -2
  12. package/lib/retrial-auth.js +0 -2
  13. package/lib/selector.js +422 -224
  14. package/lib/table-column.js +0 -2
  15. package/lib/table.js +0 -2
  16. package/lib/theme-chalk/flow.css +1 -1
  17. package/lib/theme-chalk/index.css +1 -1
  18. package/lib/theme-chalk/picker.css +1 -1
  19. package/lib/theme-chalk/selector.css +1 -1
  20. package/lib/theme-chalk/tree.css +1 -1
  21. package/lib/utils/http.js +0 -1
  22. package/lib/utils/util.js +0 -1
  23. package/package.json +1 -1
  24. package/packages/esign/src/main.vue +1 -1
  25. package/packages/field/src/main.vue +2 -1
  26. package/packages/flow/src/components/Opinion.vue +1 -2
  27. package/packages/flow/src/flowMix.js +0 -1
  28. package/packages/flow-btn/src/main.vue +0 -1
  29. package/packages/form/src/main.vue +163 -166
  30. package/packages/picker/src/main.vue +48 -2
  31. package/packages/selector/src/main.vue +64 -25
  32. package/packages/selector/src/selector-field.vue +6 -2
  33. package/packages/selector/src/selector-tree.vue +48 -3
  34. package/packages/selector/src/tree.vue +120 -41
  35. package/packages/theme-chalk/lib/flow.css +1 -1
  36. package/packages/theme-chalk/lib/index.css +1 -1
  37. package/packages/theme-chalk/lib/picker.css +1 -1
  38. package/packages/theme-chalk/lib/selector.css +1 -1
  39. package/packages/theme-chalk/lib/tree.css +1 -1
  40. package/packages/theme-chalk/src/picker.scss +15 -11
  41. package/packages/theme-chalk/src/selector.scss +11 -1
  42. package/packages/theme-chalk/src/tree.scss +14 -2
  43. package/src/index.js +1 -1
  44. package/src/utils/http.js +0 -1
  45. package/src/utils/util.js +0 -1
@@ -3,13 +3,14 @@
3
3
  <selector-field
4
4
  v-if="!this.$scopedSlots.input && !this.$slots.input && !showTree"
5
5
  v-bind="$attrs"
6
+ :input-value="inputValue"
6
7
  :data="selectList"
7
8
  @change="handleChangeSel"
8
9
  @click="handleSelector"
9
10
  />
10
11
  <slot v-else name="input" :click="handleSelector" />
11
12
  <em-selector-tree
12
- v-if="(showSelectorTree || showTree) && (typeof value !== 'string')"
13
+ v-if="(showSelectorTree || showTree) && typeof value !== 'string'"
13
14
  v-bind="$attrs"
14
15
  v-on="$listeners"
15
16
  :showTree="showTree"
@@ -19,26 +20,42 @@
19
20
  @dispose="handleDispose"
20
21
  @close="handleDispose()"
21
22
  >
22
- <template v-if="$scopedSlots['tree-icon']" slot="tree-icon" slot-scope="{value}">
23
- <slot v-if="$scopedSlots['tree-icon']" name="tree-icon" :value="value"></slot>
24
- </template>
23
+ <template
24
+ v-if="$scopedSlots['tree-icon']"
25
+ slot="tree-icon"
26
+ slot-scope="{ value }"
27
+ >
28
+ <slot
29
+ v-if="$scopedSlots['tree-icon']"
30
+ name="tree-icon"
31
+ :value="value"
32
+ ></slot>
33
+ </template>
25
34
  </em-selector-tree>
26
35
  <div v-if="typeof value === 'string'">
27
36
  <em-selector-tree
28
- v-show="showSelectorTree || showTree"
29
- v-bind="$attrs"
30
- v-on="$listeners"
31
- :showTree="showTree"
32
- :showMore="$listeners['left-icon'] == undefined"
33
- :isTreeIcon=" $scopedSlots['tree-icon'] != undefined"
34
- :selectList.sync="selectList"
35
- @dispose="handleDispose"
36
- @close="handleDispose()"
37
- >
38
- <template v-if="$scopedSlots['tree-icon']" slot="tree-icon" slot-scope="{value}">
39
- <slot v-if="$scopedSlots['tree-icon']" name="tree-icon" :value="value"></slot>
40
- </template>
41
- </em-selector-tree>
37
+ v-show="showSelectorTree || showTree"
38
+ v-bind="$attrs"
39
+ v-on="$listeners"
40
+ :showTree="showTree"
41
+ :showMore="$listeners['left-icon'] == undefined"
42
+ :isTreeIcon="$scopedSlots['tree-icon'] != undefined"
43
+ :selectList.sync="selectList"
44
+ @dispose="handleDispose"
45
+ @close="handleDispose()"
46
+ >
47
+ <template
48
+ v-if="$scopedSlots['tree-icon']"
49
+ slot="tree-icon"
50
+ slot-scope="{ value }"
51
+ >
52
+ <slot
53
+ v-if="$scopedSlots['tree-icon']"
54
+ name="tree-icon"
55
+ :value="value"
56
+ ></slot>
57
+ </template>
58
+ </em-selector-tree>
42
59
  </div>
43
60
  </div>
44
61
  </template>
@@ -51,25 +68,26 @@ export default {
51
68
  name: 'EmSelector',
52
69
  inheritAttrs: false,
53
70
  props: {
54
- value: { type: [Array,String], default: () => [] },
71
+ value: { type: [Array, String], default: () => [] },
55
72
  showTree: {
56
73
  type: Boolean,
57
74
  default: false
58
- },
75
+ }
59
76
  },
60
77
  data() {
61
78
  return {
62
79
  showSelectorTree: false,
80
+ inputValue: ''
63
81
  // newSelectList:[]
64
82
  };
65
83
  },
66
- watch:{
67
- value:{
68
- handler(val){
84
+ watch: {
85
+ value: {
86
+ handler(val) {
69
87
  this.selectList = val;
70
88
  },
71
- deep:true,
72
- immediate:true
89
+ deep: true,
90
+ immediate: true
73
91
  }
74
92
  },
75
93
  computed: {
@@ -99,9 +117,18 @@ export default {
99
117
  * @param {Object} val 选中的人员/单位
100
118
  */
101
119
  handleDispose(val) {
120
+ this.inputValue = '';
102
121
  if (val) {
103
122
  const { list } = val;
104
123
  this.selectList = list;
124
+ if (val.list.length > 0) {
125
+ this.inputValue =
126
+ list[0][
127
+ this.$attrs.labelKey || this.$attrs['label-key'] || 'showname'
128
+ ];
129
+ } else {
130
+ this.inputValue = '';
131
+ }
105
132
  }
106
133
  this.showSelectorTree = false;
107
134
  },
@@ -113,6 +140,18 @@ export default {
113
140
  * @param {Array} val 变化后的选中数据
114
141
  */
115
142
  handleChangeSel(val) {
143
+ if (val) {
144
+ const { list } = val;
145
+ this.selectList = list;
146
+ if (val.list.length > 0) {
147
+ this.inputValue =
148
+ list[0][
149
+ this.$attrs.labelKey || this.$attrs['label-key'] || 'showname'
150
+ ];
151
+ } else {
152
+ this.inputValue = '';
153
+ }
154
+ }
116
155
  this.$emit('input', val.list);
117
156
  }
118
157
  }
@@ -3,6 +3,7 @@
3
3
  <em-input
4
4
  :class="{ 'hide-label': hideLabel }"
5
5
  v-bind="$attrs"
6
+ v-model="inputValue"
6
7
  readonly
7
8
  clickable
8
9
  @click="clickTree()"
@@ -79,7 +80,7 @@ export default {
79
80
  return {
80
81
  newSelectList: [],
81
82
  newNextUserList: [],
82
- selectValue: ''
83
+ selectValue: '',
83
84
  };
84
85
  },
85
86
  props: {
@@ -91,6 +92,10 @@ export default {
91
92
  type: Boolean,
92
93
  default: false
93
94
  },
95
+ inputValue:{
96
+ type:String,
97
+ default:''
98
+ },
94
99
  readonly: { type: Boolean, default: false },
95
100
  selectDisabled: {
96
101
  type: Boolean,
@@ -182,7 +187,6 @@ export default {
182
187
  }, []);
183
188
  },
184
189
  handleChange(val, info) {
185
- console.log('点击了');
186
190
  const _this = this;
187
191
  if (_this.multiple) {
188
192
  if (info.checked) {
@@ -44,6 +44,14 @@
44
44
  :departmentLabelKey="departmentLabelKey"
45
45
  :departmentValueKey="departmentValueKey"
46
46
  :nodeKey="nodeKey"
47
+ :showCount="showCount"
48
+ :countKey="countKey"
49
+ :showNameIcon="showNameIcon"
50
+ :nameColor="nameColor"
51
+ :nameBgColor="nameBgColor"
52
+ :countPosition="countPosition"
53
+ :nameSize="nameSize"
54
+ :unit="unit"
47
55
  v-on="$listeners"
48
56
  @popen="open"
49
57
  :isAllCheck="isAllCheck"
@@ -100,6 +108,42 @@ export default {
100
108
  type: Boolean,
101
109
  default: false
102
110
  },
111
+ nameSize:{
112
+ type:[String,Number],
113
+ default:38
114
+ },
115
+ nameBgColor:{
116
+ tpe:String,
117
+ default:''
118
+ },
119
+ countPosition:{
120
+ type:String,
121
+ default:'right'
122
+ },
123
+ showNameIcon:{
124
+ type: Boolean,
125
+ default: false
126
+ },
127
+ nameColor:{
128
+ type:String,
129
+ default:'#fff'
130
+ },
131
+ showNameIcon: {
132
+ type: Boolean,
133
+ default: false
134
+ },
135
+ countKey: {
136
+ type: String,
137
+ default: 'count'
138
+ },
139
+ showCount: {
140
+ type: Boolean,
141
+ default: false
142
+ },
143
+ unit: {
144
+ type: String,
145
+ default: '人'
146
+ },
103
147
  showSearch: {
104
148
  type: Boolean,
105
149
  default: true
@@ -684,7 +728,8 @@ export default {
684
728
  ].param.selecttype;
685
729
  if (this.newParam.selecttype === 'persongroup') {
686
730
  this.newParam.pid = 'root';
687
- this.newParam.myUserid = this.newParam.myUserid || $.getStorage('userId');
731
+ this.newParam.myUserid =
732
+ this.newParam.myUserid || $.getStorage('userId');
688
733
  } else {
689
734
  this.newParam.pid = this.param.pid || 'root';
690
735
  }
@@ -812,7 +857,7 @@ export default {
812
857
  }
813
858
  }
814
859
  let newData = res.obj;
815
- if (!newData.children && !isStart) {
860
+ if ((!newData.children || newData.children.length == 0) && !isStart) {
816
861
  if (this.nodeList && this.nodeList.length > 0) {
817
862
  this.$toast.loading({
818
863
  message: '加载中...',
@@ -867,7 +912,7 @@ export default {
867
912
  this.$toast.clear();
868
913
  }
869
914
  } else {
870
- if (!res.obj.children) {
915
+ if (!res.obj.children || res.obj.children.length == 0) {
871
916
  this.getData(res.obj);
872
917
  }
873
918
  }
@@ -7,13 +7,14 @@
7
7
  :class="{ active: item.open }"
8
8
  >
9
9
  <div v-if="item[nodeKey] && isShowNode(item[valueKey])">
10
- <div v-tap="{ methods: handleClickIcon, obj: item }" class="title">
10
+ <div v-tap="{ methods: handleClickIcon, obj: item }" class="title">
11
11
  <div class="text">
12
12
  <div
13
13
  class="label"
14
14
  v-if="
15
15
  (item.parentshowid === '' || item.parentshowid === 'root') &&
16
- !isTreeIcon
16
+ !isTreeIcon &&
17
+ !showNameIcon
17
18
  "
18
19
  >
19
20
  <!-- item[labelKey] && item[labelKey].length > 12
@@ -21,36 +22,74 @@
21
22
  : item[labelKey] -->
22
23
  </div>
23
24
  <div
24
- v-if="isTreeIcon"
25
+ v-if="showNameIcon"
26
+ class="label-name-icon"
27
+ :style="{
28
+ width: nameSize + 'px',
29
+ height: nameSize + 'px',
30
+ color: item.color || nameColor,
31
+ backgroundColor: item.bgColor || nameBgColor
32
+ }"
33
+ >
34
+ {{ item[labelKey].substring(0, 1) }}
35
+ </div>
36
+ <div
37
+ v-else-if="isTreeIcon"
25
38
  v-tap.stop="{ methods: handleClickIcon, obj: item }"
26
39
  >
27
40
  <slot name="tree-icon" :value="item"></slot>
28
41
  </div>
29
- <span v-tap.stop="{ methods: opened, obj: item }">{{ item[labelKey] }}</span>
42
+ <span
43
+ v-tap.stop="{ methods: opened, obj: item }"
44
+ class="label-name-text"
45
+ :style="{
46
+ display: countPosition === 'right' ? 'flex' : 'unset',
47
+ flex: countPosition === 'right' ? '1' : 'unset'
48
+ }"
49
+ >{{ item[labelKey] }}</span
50
+ >
51
+ <span
52
+ class="selector-left-count"
53
+ v-if="showCount && countPosition === 'left' && item[countKey]"
54
+ >{{ item[countKey] + unit }}</span
55
+ >
56
+ </div>
57
+ <div class="selector-right">
58
+ <span
59
+ class="selector-right-count"
60
+ v-if="showCount && countPosition === 'right' && item[countKey]"
61
+ >{{ item[countKey] + unit }}</span
62
+ >
63
+ <van-icon
64
+ name="arrow"
65
+ v-tap.stop="{ methods: handleClickIcon, obj: item }"
66
+ class="right"
67
+ :style="{ transform: item.open ? 'rotate(90deg)' : '' }"
68
+ v-if="showMore"
69
+ />
70
+ <i
71
+ class="iconfont icon-gou select-icon"
72
+ v-show="
73
+ (enterprise ||
74
+ (department &&
75
+ item[departmentLabelKey] == departmentValueKey)) &&
76
+ !showTree
77
+ "
78
+ v-tap.stop="{ methods: checke, obj: item }"
79
+ v-if="item.checked"
80
+ ></i>
81
+ <i
82
+ class="iconfont icon-quan select-icon"
83
+ v-show="
84
+ (enterprise ||
85
+ (department &&
86
+ item[departmentLabelKey] == departmentValueKey)) &&
87
+ !showTree
88
+ "
89
+ v-tap.stop="{ methods: checke, obj: item }"
90
+ v-else
91
+ ></i>
30
92
  </div>
31
- <van-icon name="arrow" v-tap.stop="{ methods: handleClickIcon, obj: item }" class="right" v-if="showMore" />
32
- <i
33
- class="iconfont icon-gou select-icon"
34
- v-show="
35
- (enterprise ||
36
- (department &&
37
- item[departmentLabelKey] == departmentValueKey)) &&
38
- !showTree
39
- "
40
- v-tap.stop="{ methods: checke, obj: item }"
41
- v-if="item.checked"
42
- ></i>
43
- <i
44
- class="iconfont icon-quan select-icon"
45
- v-show="
46
- (enterprise ||
47
- (department &&
48
- item[departmentLabelKey] == departmentValueKey)) &&
49
- !showTree
50
- "
51
- v-tap.stop="{ methods: checke, obj: item }"
52
- v-else
53
- ></i>
54
93
  </div>
55
94
  <template v-if="item.children && item.children.length > 0">
56
95
  <em-tree
@@ -65,6 +104,14 @@
65
104
  :label-key="labelKey"
66
105
  :value-key="valueKey"
67
106
  :showTree="showTree"
107
+ :showCount="showCount"
108
+ :countKey="countKey"
109
+ :showNameIcon="showNameIcon"
110
+ :nameBgColor="nameBgColor"
111
+ :countPosition="countPosition"
112
+ :nameColor="nameColor"
113
+ :nameSize="nameSize"
114
+ :unit="unit"
68
115
  :showMore="showMore"
69
116
  :enterprise="enterprise"
70
117
  :isTreeIcon="isTreeIcon"
@@ -96,7 +143,7 @@
96
143
  "
97
144
  ></div>
98
145
  <div
99
- class="head"
146
+ class="em-show-tree-head"
100
147
  v-if="
101
148
  ((item.attr && JSON.parse(item.attr).sex) ||
102
149
  item.sex ||
@@ -162,6 +209,38 @@ export default {
162
209
  inheritAttrs: false,
163
210
  props: {
164
211
  model: Array,
212
+ nameSize: {
213
+ type: [String, Number],
214
+ default: 38
215
+ },
216
+ showNameIcon: {
217
+ type: Boolean,
218
+ default: false
219
+ },
220
+ nameBgColor: {
221
+ tpe: String,
222
+ default: ''
223
+ },
224
+ countPosition: {
225
+ type: String,
226
+ default: 'right'
227
+ },
228
+ nameColor: {
229
+ type: String,
230
+ default: '#fff'
231
+ },
232
+ countKey: {
233
+ type: String,
234
+ default: 'count'
235
+ },
236
+ showCount: {
237
+ type: Boolean,
238
+ default: false
239
+ },
240
+ unit: {
241
+ type: String,
242
+ default: '人'
243
+ },
165
244
  enterprise: {
166
245
  type: Boolean,
167
246
  default: false
@@ -207,13 +286,13 @@ export default {
207
286
  type: String,
208
287
  default: 'showshortname'
209
288
  },
210
- isAllCheck:{
211
- type:Boolean,
212
- default:false
289
+ isAllCheck: {
290
+ type: Boolean,
291
+ default: false
213
292
  },
214
- showMore:{
215
- type:Boolean,
216
- default:true
293
+ showMore: {
294
+ type: Boolean,
295
+ default: true
217
296
  },
218
297
  oldIsSearch: Boolean,
219
298
  isSearch: Boolean
@@ -244,17 +323,17 @@ export default {
244
323
  });
245
324
  },
246
325
  methods: {
247
- handleClickIcon(res, isStart){
248
- if(!this.$listeners['left-icon'] && !this.showMore) return
249
- this.$emit('popen', res, res.isStart || isStart,true,'node');
326
+ handleClickIcon(res, isStart) {
327
+ if (!this.$listeners['left-icon'] && !this.showMore) return;
328
+ this.$emit('popen', res, res.isStart || isStart, true, 'node');
250
329
  },
251
330
  opened(res, isStart) {
252
- this.$emit('popen', res, res.isStart || isStart,true,'title');
331
+ this.$emit('popen', res, res.isStart || isStart, true, 'title');
253
332
  },
254
333
  checke(res) {
255
- let model = undefined
256
- if(this.isAllCheck) model = this.model
257
- this.$emit('checke', res,model);
334
+ let model = undefined;
335
+ if (this.isAllCheck) model = this.model;
336
+ this.$emit('checke', res, model);
258
337
  },
259
338
  isShowNode(id) {
260
339
  let isShow = true;