@10yun/cv-mobile-ui 0.5.20 → 0.5.22

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/package.json +1 -1
  2. package/plugins/jumps.js +57 -12
  3. package/plugins/lbs.js +17 -8
  4. package/ui-cv/components/cv-grid-item/cv-grid-item.vue +1 -1
  5. package/uni-ui/lib/uni-badge/uni-badge.vue +150 -1
  6. package/uni-ui/lib/uni-breadcrumb/uni-breadcrumb.vue +37 -1
  7. package/uni-ui/lib/uni-breadcrumb-item/uni-breadcrumb-item.vue +83 -1
  8. package/uni-ui/lib/uni-calendar/uni-calendar-item.vue +122 -1
  9. package/uni-ui/lib/uni-calendar/uni-calendar.vue +366 -1
  10. package/uni-ui/lib/uni-card/uni-card.vue +124 -1
  11. package/uni-ui/lib/uni-col/uni-col.vue +1 -1
  12. package/uni-ui/lib/uni-collapse/uni-collapse.vue +135 -1
  13. package/uni-ui/lib/uni-collapse-item/uni-collapse-item.vue +266 -1
  14. package/uni-ui/lib/uni-combox/uni-combox.vue +1 -1
  15. package/uni-ui/lib/uni-countdown/uni-countdown.vue +239 -1
  16. package/uni-ui/lib/uni-data-checkbox/uni-data-checkbox.vue +487 -1
  17. package/uni-ui/lib/uni-data-picker/uni-data-picker.vue +530 -1
  18. package/uni-ui/lib/uni-data-pickerview/uni-data-picker.js +157 -150
  19. package/uni-ui/lib/uni-data-pickerview/uni-data-pickerview.vue +166 -1
  20. package/uni-ui/lib/uni-data-select/uni-data-select.vue +289 -1
  21. package/uni-ui/lib/uni-datetime-picker/calendar-item.vue +70 -1
  22. package/uni-ui/lib/uni-datetime-picker/calendar.vue +629 -1
  23. package/uni-ui/lib/uni-datetime-picker/time-picker.vue +741 -1
  24. package/uni-ui/lib/uni-datetime-picker/uni-datetime-picker.vue +847 -1
  25. package/uni-ui/lib/uni-drawer/uni-drawer.vue +115 -1
  26. package/uni-ui/lib/uni-easyinput/uni-easyinput.vue +515 -1
  27. package/uni-ui/lib/uni-fab/uni-fab.vue +257 -1
  28. package/uni-ui/lib/uni-fav/uni-fav.vue +123 -1
  29. package/uni-ui/lib/uni-file-picker/uni-file-picker.vue +642 -1
  30. package/uni-ui/lib/uni-file-picker/upload-file.vue +177 -1
  31. package/uni-ui/lib/uni-file-picker/upload-image.vue +176 -1
  32. package/uni-ui/lib/uni-forms/uni-forms.vue +375 -1
  33. package/uni-ui/lib/uni-forms-item/uni-forms-item.vue +429 -1
  34. package/uni-ui/lib/uni-goods-nav/uni-goods-nav.vue +129 -1
  35. package/uni-ui/lib/uni-grid/uni-grid.vue +115 -1
  36. package/uni-ui/lib/uni-grid-item/uni-grid-item.vue +78 -1
  37. package/uni-ui/lib/uni-group/uni-group.vue +85 -1
  38. package/uni-ui/lib/uni-icons/uni-icons.vue +85 -1
  39. package/uni-ui/lib/uni-indexed-list/uni-indexed-list-item.vue +68 -1
  40. package/uni-ui/lib/uni-indexed-list/uni-indexed-list.vue +294 -1
  41. package/uni-ui/lib/uni-list/uni-list.vue +81 -1
  42. package/uni-ui/lib/uni-list-ad/uni-list-ad.vue +77 -1
  43. package/uni-ui/lib/uni-list-chat/uni-list-chat.vue +294 -1
  44. package/uni-ui/lib/uni-list-item/uni-list-item.vue +346 -1
  45. package/uni-ui/lib/uni-load-more/uni-load-more.vue +172 -1
  46. package/uni-ui/lib/uni-nav-bar/uni-nav-bar.vue +205 -1
  47. package/uni-ui/lib/uni-nav-bar/uni-status-bar.vue +18 -1
  48. package/uni-ui/lib/uni-notice-bar/uni-notice-bar.vue +331 -1
  49. package/uni-ui/lib/uni-number-box/uni-number-box.vue +166 -1
  50. package/uni-ui/lib/uni-pagination/uni-pagination.vue +323 -1
  51. package/uni-ui/lib/uni-popup/uni-popup.vue +1 -1
  52. package/uni-ui/lib/uni-popup-dialog/uni-popup-dialog.vue +173 -1
  53. package/uni-ui/lib/uni-popup-message/uni-popup-message.vue +74 -1
  54. package/uni-ui/lib/uni-popup-share/uni-popup-share.vue +106 -1
  55. package/uni-ui/lib/uni-rate/uni-rate.vue +322 -1
  56. package/uni-ui/lib/uni-row/uni-row.vue +1 -1
  57. package/uni-ui/lib/uni-search-bar/uni-search-bar.vue +236 -1
  58. package/uni-ui/lib/uni-section/uni-section.vue +109 -1
  59. package/uni-ui/lib/uni-segmented-control/uni-segmented-control.vue +103 -1
  60. package/uni-ui/lib/uni-status-bar/uni-status-bar.vue +1 -1
  61. package/uni-ui/lib/uni-steps/uni-steps.vue +120 -1
  62. package/uni-ui/lib/uni-swipe-action-item/uni-swipe-action-item.vue +226 -3
  63. package/uni-ui/lib/uni-swiper-dot/uni-swiper-dot.vue +167 -1
  64. package/uni-ui/lib/uni-table/uni-table.vue +297 -1
  65. package/uni-ui/lib/uni-tag/uni-tag.vue +100 -1
  66. package/uni-ui/lib/uni-td/uni-td.vue +78 -1
  67. package/uni-ui/lib/uni-th/filter-dropdown.vue +1 -1
  68. package/uni-ui/lib/uni-th/uni-th.vue +224 -1
  69. package/uni-ui/lib/uni-thead/uni-thead.vue +77 -1
  70. package/uni-ui/lib/uni-tr/table-checkbox.vue +79 -1
  71. package/uni-ui/lib/uni-tr/uni-tr.vue +135 -1
@@ -1 +1,166 @@
1
- <template>
2
1
  <view class="uni-data-pickerview">
3
2
  <scroll-view v-if="!isCloudDataList" class="selected-area" scroll-x="true">
4
3
  <view class="selected-list">
5
4
  <view
6
5
  class="selected-item"
7
6
  v-for="(item, index) in selected"
8
7
  :key="index"
9
8
  :class="{
10
9
  'selected-item-active': index == selectedIndex
11
10
  }"
12
11
  @click="handleSelect(index)"
13
12
  >
14
13
  <text>{{ item.text || '' }}</text>
15
14
  </view>
16
15
  </view>
17
16
  </scroll-view>
18
17
  <view class="tab-c">
19
18
  <scroll-view class="list" :scroll-y="true">
20
19
  <view
21
20
  class="item"
22
21
  :class="{ 'is-disabled': !!item.disable }"
23
22
  v-for="(item, j) in dataList[selectedIndex]"
24
23
  :key="j"
25
24
  @click="handleNodeClick(item, selectedIndex, j)"
26
25
  >
27
26
  <text class="item-text">{{ item[map.text] }}</text>
28
27
  <view class="check" v-if="selected.length > selectedIndex && item[map.value] == selected[selectedIndex].value"></view>
29
28
  </view>
30
29
  </scroll-view>
31
30
  <view class="loading-cover" v-if="loading">
32
31
  <uni-load-more class="load-more" :contentText="loadMore" status="loading"></uni-load-more>
33
32
  </view>
34
33
  <view class="error-message" v-if="errorMessage">
35
34
  <text class="error-text">{{ errorMessage }}</text>
36
35
  </view>
37
36
  </view>
38
37
  </view>
39
38
  * DataPickerview
40
39
  * @description uni-data-pickerview
41
40
  * @tutorial https://ext.dcloud.net.cn/plugin?id=3796
42
41
  * @property {Array} localdata 本地数据,参考
43
42
  * @property {Boolean} step-searh = [true|false] 是否分布查询
44
43
  * @value true 启用分布查询,仅查询当前选中节点
45
44
  * @value false 关闭分布查询,一次查询出所有数据
46
45
  * @property {String|DBFieldString} self-field 分布查询当前字段名称
47
46
  * @property {String|DBFieldString} parent-field 分布查询父字段名称
48
47
  * @property {String|DBCollectionString} collection 表名
49
48
  * @property {String|DBFieldString} field 查询字段,多个字段用 `,` 分割
50
49
  * @property {String} orderby 排序字段及正序倒叙设置
51
50
  * @property {String|JQLString} where 查询条件
52
51
  */
53
52
  name: 'UniDataPickerView',
54
53
  emits: ['nodeclick', 'change', 'datachange', 'update:modelValue'],
55
54
  mixins: [dataPicker],
56
55
  props: {
57
56
  managedMode: {
58
57
  type: Boolean,
59
58
  default: false
60
59
  },
61
60
  ellipsis: {
62
61
  type: Boolean,
63
62
  default: true
64
63
  }
65
64
  },
66
65
  created() {
67
66
  if (!this.managedMode) {
68
67
  this.$nextTick(() => {
69
68
  this.loadData();
70
69
  });
71
70
  }
72
71
  },
73
72
  methods: {
74
73
  onPropsChange() {
75
74
  this._treeData = [];
76
75
  this.selectedIndex = 0;
77
76
  this.$nextTick(() => {
78
77
  this.loadData();
79
78
  });
80
79
  },
81
80
  handleSelect(index) {
82
81
  this.selectedIndex = index;
83
82
  },
84
83
  handleNodeClick(item, i, j) {
85
84
  if (item.disable) {
86
85
  return;
87
86
  }
88
87
  const node = this.dataList[i][j];
89
88
  const text = node[this.map.text];
90
89
  const value = node[this.map.value];
91
90
  if (i < this.selected.length - 1) {
92
91
  this.selected.splice(i, this.selected.length - i);
93
92
  this.selected.push({
94
93
  text,
95
94
  value
96
95
  });
97
96
  } else if (i === this.selected.length - 1) {
98
97
  this.selected.splice(i, 1, {
99
98
  text,
100
99
  value
101
100
  });
102
101
  }
103
102
  if (node.isleaf) {
104
103
  this.onSelectedChange(node, node.isleaf);
105
104
  return;
106
105
  }
107
106
  const { isleaf, hasNodes } = this._updateBindData();
108
107
  // 本地数据
109
108
  if (this.isLocalData) {
110
109
  this.onSelectedChange(node, !hasNodes || isleaf);
111
110
  } else if (this.isCloudDataList) {
112
111
  // Cloud 数据 (单列)
113
112
  this.onSelectedChange(node, true);
114
113
  } else if (this.isCloudDataTree) {
115
114
  // Cloud 数据 (树形)
116
115
  if (isleaf) {
117
116
  this.onSelectedChange(node, node.isleaf);
118
117
  } else if (!hasNodes) {
119
118
  // 请求一次服务器以确定是否为叶子节点
120
119
  this.loadCloudDataNode((data) => {
121
120
  if (!data.length) {
122
121
  node.isleaf = true;
123
122
  } else {
124
123
  this._treeData.push(...data);
125
124
  this._updateBindData(node);
126
125
  }
127
126
  this.onSelectedChange(node, node.isleaf);
128
127
  });
129
128
  }
130
129
  }
131
130
  },
132
131
  updateData(data) {
133
132
  this._treeData = data.treeData;
134
133
  this.selected = data.selected;
135
134
  if (!this._treeData.length) {
136
135
  this.loadData();
137
136
  } else {
138
137
  //this.selected = data.selected
139
138
  this._updateBindData();
140
139
  }
141
140
  },
142
141
  onDataChange() {
143
142
  this.$emit('datachange');
144
143
  },
145
144
  onSelectedChange(node, isleaf) {
146
145
  if (isleaf) {
147
146
  this._dispatchEvent();
148
147
  }
149
148
  if (node) {
150
149
  this.$emit('nodeclick', node);
151
150
  }
152
151
  },
153
152
  _dispatchEvent() {
154
153
  this.$emit('change', this.selected.slice(0));
155
154
  }
156
155
  }
156
+ <template>
157
+ <view class="uni-data-pickerview">
158
+ <scroll-view v-if="!isCloudDataList" class="selected-area" scroll-x="true">
159
+ <view class="selected-list">
160
+ <view
161
+ class="selected-item"
162
+ v-for="(item, index) in selected"
163
+ :key="index"
164
+ :class="{
165
+ 'selected-item-active': index == selectedIndex
166
+ }"
167
+ @click="handleSelect(index)"
168
+ >
169
+ <text>{{ item.text || '' }}</text>
170
+ </view>
171
+ </view>
172
+ </scroll-view>
173
+ <view class="tab-c">
174
+ <scroll-view class="list" :scroll-y="true">
175
+ <view
176
+ class="item"
177
+ :class="{ 'is-disabled': !!item.disable }"
178
+ v-for="(item, j) in dataList[selectedIndex]"
179
+ :key="j"
180
+ @click="handleNodeClick(item, selectedIndex, j)"
181
+ >
182
+ <text class="item-text">{{ item[map.text] }}</text>
183
+ <view class="check" v-if="selected.length > selectedIndex && item[map.value] == selected[selectedIndex].value"></view>
184
+ </view>
185
+ </scroll-view>
186
+ <view class="loading-cover" v-if="loading">
187
+ <uni-load-more class="load-more" :contentText="loadMore" status="loading"></uni-load-more>
188
+ </view>
189
+ <view class="error-message" v-if="errorMessage">
190
+ <text class="error-text">{{ errorMessage }}</text>
191
+ </view>
192
+ </view>
193
+ </view>
194
+ </template>
195
+ <script>
196
+ import dataPicker from './uni-data-picker.js';
197
+ /**
198
+ * DataPickerview
199
+ * @description uni-data-pickerview
200
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=3796
201
+ * @property {Array} localdata 本地数据,参考
202
+ * @property {Boolean} step-searh = [true|false] 是否分布查询
203
+ * @value true 启用分布查询,仅查询当前选中节点
204
+ * @value false 关闭分布查询,一次查询出所有数据
205
+ * @property {String|DBFieldString} self-field 分布查询当前字段名称
206
+ * @property {String|DBFieldString} parent-field 分布查询父字段名称
207
+ * @property {String|DBCollectionString} collection 表名
208
+ * @property {String|DBFieldString} field 查询字段,多个字段用 `,` 分割
209
+ * @property {String} orderby 排序字段及正序倒叙设置
210
+ * @property {String|JQLString} where 查询条件
211
+ */
212
+ export default {
213
+ name: 'UniDataPickerView',
214
+ emits: ['nodeclick', 'change', 'datachange', 'update:modelValue'],
215
+ mixins: [dataPicker],
216
+ props: {
217
+ managedMode: {
218
+ type: Boolean,
219
+ default: false
220
+ },
221
+ ellipsis: {
222
+ type: Boolean,
223
+ default: true
224
+ }
225
+ },
226
+ created() {
227
+ if (!this.managedMode) {
228
+ this.$nextTick(() => {
229
+ this.loadData();
230
+ });
231
+ }
232
+ },
233
+ methods: {
234
+ onPropsChange() {
235
+ this._treeData = [];
236
+ this.selectedIndex = 0;
237
+ this.$nextTick(() => {
238
+ this.loadData();
239
+ });
240
+ },
241
+ handleSelect(index) {
242
+ this.selectedIndex = index;
243
+ },
244
+ handleNodeClick(item, i, j) {
245
+ if (item.disable) {
246
+ return;
247
+ }
248
+ const node = this.dataList[i][j];
249
+ const text = node[this.map.text];
250
+ const value = node[this.map.value];
251
+ if (i < this.selected.length - 1) {
252
+ this.selected.splice(i, this.selected.length - i);
253
+ this.selected.push({
254
+ text,
255
+ value
256
+ });
257
+ } else if (i === this.selected.length - 1) {
258
+ this.selected.splice(i, 1, {
259
+ text,
260
+ value
261
+ });
262
+ }
263
+ if (node.isleaf) {
264
+ this.onSelectedChange(node, node.isleaf);
265
+ return;
266
+ }
267
+ const { isleaf, hasNodes } = this._updateBindData();
268
+ // 本地数据
269
+ if (this.isLocalData) {
270
+ this.onSelectedChange(node, !hasNodes || isleaf);
271
+ } else if (this.isCloudDataList) {
272
+ // Cloud 数据 (单列)
273
+ this.onSelectedChange(node, true);
274
+ } else if (this.isCloudDataTree) {
275
+ // Cloud 数据 (树形)
276
+ if (isleaf) {
277
+ this.onSelectedChange(node, node.isleaf);
278
+ } else if (!hasNodes) {
279
+ // 请求一次服务器以确定是否为叶子节点
280
+ this.loadCloudDataNode((data) => {
281
+ if (!data.length) {
282
+ node.isleaf = true;
283
+ } else {
284
+ this._treeData.push(...data);
285
+ this._updateBindData(node);
286
+ }
287
+ this.onSelectedChange(node, node.isleaf);
288
+ });
289
+ }
290
+ }
291
+ },
292
+ updateData(data) {
293
+ this._treeData = data.treeData;
294
+ this.selected = data.selected;
295
+ if (!this._treeData.length) {
296
+ this.loadData();
297
+ } else {
298
+ //this.selected = data.selected
299
+ this._updateBindData();
300
+ }
301
+ },
302
+ onDataChange() {
303
+ this.$emit('datachange');
304
+ },
305
+ onSelectedChange(node, isleaf) {
306
+ if (isleaf) {
307
+ this._dispatchEvent();
308
+ }
309
+ if (node) {
310
+ this.$emit('nodeclick', node);
311
+ }
312
+ },
313
+ _dispatchEvent() {
314
+ this.$emit('change', this.selected.slice(0));
315
+ }
316
+ }
317
+ };
318
+ </script>
319
+ <style>
320
+ @import 'style.css';
321
+ </style>