@10yun/cv-mobile-ui 0.4.1 → 0.4.2

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 (112) hide show
  1. package/package.json +1 -1
  2. package/ui-cv/cv-badge/{uni-badge.vue → cv-badge.vue} +2 -2
  3. package/ui-cv/cv-calendar/calendar.js +762 -345
  4. package/ui-cv/cv-calendar/cv-calendar-item.vue +198 -0
  5. package/ui-cv/cv-calendar/cv-calendar.vue +508 -0
  6. package/ui-cv/cv-card/cv-card.vue +427 -0
  7. package/ui-cv/cv-col/cv-col.vue +2965 -0
  8. package/ui-cv/cv-collapse/cv-collapse.vue +146 -0
  9. package/ui-cv/cv-collapse-item/cv-collapse-item.vue +395 -0
  10. package/ui-cv/cv-combox/cv-combox.vue +250 -0
  11. package/ui-cv/cv-countdown/cv-countdown.vue +245 -0
  12. package/ui-cv/cv-data-checkbox/cv-data-checkbox.vue +841 -0
  13. package/ui-cv/cv-data-indexed-list/cv-data-indexed-list-item.vue +154 -0
  14. package/ui-cv/cv-data-indexed-list/cv-data-indexed-list.vue +376 -0
  15. package/ui-cv/cv-data-picker/cv-data-picker.vue +486 -0
  16. package/ui-cv/cv-data-pickerview/{uni-data-picker.js → cv-data-picker.js} +0 -0
  17. package/ui-cv/cv-data-pickerview/cv-data-pickerview.vue +304 -0
  18. package/ui-cv/cv-dateformat/cv-dateformat.vue +86 -0
  19. package/ui-cv/cv-datetime-picker/calendar.vue +752 -738
  20. package/ui-cv/cv-datetime-picker/cv-datetime-picker.vue +958 -0
  21. package/ui-cv/cv-datetime-picker/time-picker.vue +900 -892
  22. package/ui-cv/cv-easyinput/cv-easyinput.vue +514 -0
  23. package/ui-cv/cv-fab/cv-fab.vue +465 -0
  24. package/ui-cv/cv-fab/{uni-fab.vue.bak → cv-fab.vue.bak} +2 -2
  25. package/ui-cv/cv-fav/cv-fav.vue +150 -0
  26. package/ui-cv/cv-file-picker/cv-file-picker.vue +619 -0
  27. package/ui-cv/cv-form-item/cv-form-item.vue +1 -1
  28. package/ui-cv/cv-goods-nav/{uni-goods-nav.vue → cv-goods-nav.vue} +1 -1
  29. package/ui-cv/{cv-icons2/cv-icons2.vue → cv-icon2/cv-icon2.vue} +3 -3
  30. package/ui-cv/{cv-icons2 → cv-icon2}/icons.js +0 -0
  31. package/ui-cv/{cv-icons2 → cv-icon2}/uni.ttf +0 -0
  32. package/ui-cv/cv-indexed-list/cv-indexed-list-item.vue +154 -0
  33. package/ui-cv/cv-indexed-list/cv-indexed-list.vue +371 -0
  34. package/ui-cv/cv-input-password/cv-input-password.vue +2 -2
  35. package/ui-cv/{cv-link/uni-link.vue → cv-link2/cv-link2.vue} +1 -1
  36. package/ui-cv/cv-list/cv-list.vue +107 -0
  37. package/ui-cv/cv-list/cv-refresh.vue +65 -0
  38. package/ui-cv/cv-list-ad/cv-list-ad.vue +113 -0
  39. package/ui-cv/cv-list-chat/{uni-list-chat.scss → cv-list-chat.scss} +0 -0
  40. package/ui-cv/cv-list-chat/{uni-list-chat.vue → cv-list-chat.vue} +0 -0
  41. package/ui-cv/cv-list-item/cv-list-item.vue +449 -0
  42. package/ui-cv/cv-nav-bar/cv-nav-bar.vue +256 -0
  43. package/ui-cv/cv-nav-bar/{uni-status-bar.vue → cv-status-bar.vue} +0 -0
  44. package/ui-cv/cv-notice-bar/cv-notice-bar.vue +453 -0
  45. package/ui-cv/cv-number-box/cv-number-box.vue +223 -0
  46. package/ui-cv/cv-pagination/cv-pagination.vue +397 -0
  47. package/ui-cv/cv-popup/cv-popup.vue +429 -0
  48. package/ui-cv/cv-popup-dialog/{uni-popup-dialog.vue → cv-popup-dialog.vue} +0 -0
  49. package/ui-cv/cv-popup-message/cv-popup-message.vue +143 -0
  50. package/ui-cv/cv-popup-share/{uni-popup-share.vue → cv-popup-share.vue} +0 -0
  51. package/ui-cv/cv-row/{uni-row.vue → cv-row.vue} +1 -1
  52. package/ui-cv/cv-search-bar/cv-search-bar.vue +280 -0
  53. package/ui-cv/cv-section/{uni-section.vue → cv-section.vue} +0 -0
  54. package/ui-cv/cv-segmented-control/{uni-segmented-control.vue → cv-segmented-control.vue} +0 -0
  55. package/ui-cv/cv-status-bar/{uni-status-bar.vue → cv-status-bar.vue} +0 -0
  56. package/ui-cv/cv-steps/cv-steps.vue +293 -0
  57. package/ui-cv/cv-swipe-action/{uni-swipe-action.vue → cv-swipe-action.vue} +0 -0
  58. package/ui-cv/cv-swipe-action-item/{uni-swipe-action-item.vue → cv-swipe-action-item.vue} +0 -0
  59. package/ui-cv/cv-swiper-dot/cv-swiper-dot.vue +255 -0
  60. package/ui-cv/cv-table/cv-table.vue +460 -0
  61. package/ui-cv/cv-tag/cv-tag.vue +276 -0
  62. package/ui-cv/cv-tbody/cv-tbody.vue +28 -0
  63. package/ui-cv/cv-td/cv-td.vue +93 -0
  64. package/ui-cv/cv-test/{uni-test.vue → cv-test.vue} +0 -0
  65. package/ui-cv/cv-th/cv-th.vue +270 -0
  66. package/ui-cv/cv-thead/cv-thead.vue +114 -0
  67. package/ui-cv/cv-title/cv-title.vue +168 -0
  68. package/ui-cv/cv-tr/cv-tr.vue +166 -0
  69. package/ui-cv/cv-transition/cv-transition.vue +279 -0
  70. package/ui-cv/cv-calendar/uni-calendar-item.vue +0 -171
  71. package/ui-cv/cv-calendar/uni-calendar.vue +0 -504
  72. package/ui-cv/cv-card/uni-card.vue +0 -420
  73. package/ui-cv/cv-col/uni-col.vue +0 -2968
  74. package/ui-cv/cv-collapse/uni-collapse.vue +0 -146
  75. package/ui-cv/cv-collapse-item/uni-collapse-item.vue +0 -378
  76. package/ui-cv/cv-combox/uni-combox.vue +0 -237
  77. package/ui-cv/cv-countdown/uni-countdown.vue +0 -234
  78. package/ui-cv/cv-data-checkbox/uni-data-checkbox.vue +0 -792
  79. package/ui-cv/cv-data-indexed-list/uni-data-indexed-list-item.vue +0 -142
  80. package/ui-cv/cv-data-indexed-list/uni-data-indexed-list.vue +0 -364
  81. package/ui-cv/cv-data-picker/uni-data-picker.vue +0 -468
  82. package/ui-cv/cv-data-pickerview/uni-data-pickerview.vue +0 -298
  83. package/ui-cv/cv-dateformat/uni-dateformat.vue +0 -88
  84. package/ui-cv/cv-datetime-picker/uni-datetime-picker.vue +0 -874
  85. package/ui-cv/cv-easyinput/uni-easyinput.vue +0 -438
  86. package/ui-cv/cv-fab/uni-fab.vue +0 -443
  87. package/ui-cv/cv-fav/uni-fav.vue +0 -136
  88. package/ui-cv/cv-file-picker/uni-file-picker.vue +0 -614
  89. package/ui-cv/cv-indexed-list/uni-indexed-list-item.vue +0 -142
  90. package/ui-cv/cv-indexed-list/uni-indexed-list.vue +0 -357
  91. package/ui-cv/cv-list/uni-list.vue +0 -107
  92. package/ui-cv/cv-list/uni-refresh.vue +0 -65
  93. package/ui-cv/cv-list-ad/uni-list-ad.vue +0 -106
  94. package/ui-cv/cv-list-item/uni-list-item.vue +0 -428
  95. package/ui-cv/cv-nav-bar/uni-nav-bar.vue +0 -244
  96. package/ui-cv/cv-notice-bar/uni-notice-bar.vue +0 -394
  97. package/ui-cv/cv-number-box/uni-number-box.vue +0 -224
  98. package/ui-cv/cv-pagination/uni-pagination.vue +0 -376
  99. package/ui-cv/cv-popup/uni-popup.vue +0 -412
  100. package/ui-cv/cv-popup-message/uni-popup-message.vue +0 -143
  101. package/ui-cv/cv-search-bar/uni-search-bar.vue +0 -262
  102. package/ui-cv/cv-steps/uni-steps.vue +0 -250
  103. package/ui-cv/cv-swiper-dot/uni-swiper-dot.vue +0 -205
  104. package/ui-cv/cv-table/uni-table.vue +0 -455
  105. package/ui-cv/cv-tag/uni-tag.vue +0 -283
  106. package/ui-cv/cv-tbody/uni-tbody.vue +0 -30
  107. package/ui-cv/cv-td/uni-td.vue +0 -88
  108. package/ui-cv/cv-th/uni-th.vue +0 -259
  109. package/ui-cv/cv-thead/uni-thead.vue +0 -114
  110. package/ui-cv/cv-title/uni-title.vue +0 -171
  111. package/ui-cv/cv-tr/uni-tr.vue +0 -156
  112. package/ui-cv/cv-transition/uni-transition.vue +0 -287
@@ -0,0 +1,841 @@
1
+ <template>
2
+ <view class="uni-data-checklist" :style="{ 'margin-top': isTop + 'px' }">
3
+ <template v-if="!isLocal">
4
+ <view class="uni-data-loading">
5
+ <cv-load-more
6
+ v-if="!mixinDatacomErrorMessage"
7
+ status="loading"
8
+ iconType="snow"
9
+ :iconSize="18"
10
+ :content-text="contentText"
11
+ ></cv-load-more>
12
+ <text v-else>{{ mixinDatacomErrorMessage }}</text>
13
+ </view>
14
+ </template>
15
+ <template v-else>
16
+ <checkbox-group v-if="multiple" class="checklist-group" :class="{ 'is-list': mode === 'list' || wrap }" @change="chagne">
17
+ <label
18
+ class="checklist-box"
19
+ :class="[
20
+ 'is--' + mode,
21
+ item.selected ? 'is-checked' : '',
22
+ disabled || !!item.disabled ? 'is-disable' : '',
23
+ index !== 0 && mode === 'list' ? 'is-list-border' : ''
24
+ ]"
25
+ :style="item.styleBackgroud"
26
+ v-for="(item, index) in dataList"
27
+ :key="index"
28
+ >
29
+ <checkbox
30
+ class="hidden"
31
+ hidden
32
+ :disabled="disabled || !!item.disabled"
33
+ :value="item[map.value] + ''"
34
+ :checked="item.selected"
35
+ />
36
+ <view
37
+ v-if="(mode !== 'tag' && mode !== 'list') || (mode === 'list' && icon === 'left')"
38
+ class="checkbox__inner"
39
+ :style="item.styleIcon"
40
+ >
41
+ <view class="checkbox__inner-icon"></view>
42
+ </view>
43
+ <view class="checklist-content" :class="{ 'list-content': mode === 'list' && icon === 'left' }">
44
+ <text class="checklist-text" :style="item.styleIconText">{{ item[map.text] }}</text>
45
+ <view v-if="mode === 'list' && icon === 'right'" class="checkobx__list" :style="item.styleBackgroud"></view>
46
+ </view>
47
+ </label>
48
+ </checkbox-group>
49
+ <radio-group v-else class="checklist-group" :class="{ 'is-list': mode === 'list', 'is-wrap': wrap }" @change="chagne">
50
+ <!-- -->
51
+ <label
52
+ class="checklist-box"
53
+ :class="[
54
+ 'is--' + mode,
55
+ item.selected ? 'is-checked' : '',
56
+ disabled || !!item.disabled ? 'is-disable' : '',
57
+ index !== 0 && mode === 'list' ? 'is-list-border' : ''
58
+ ]"
59
+ :style="item.styleBackgroud"
60
+ v-for="(item, index) in dataList"
61
+ :key="index"
62
+ >
63
+ <radio
64
+ class="hidden"
65
+ hidden
66
+ :disabled="disabled || item.disabled"
67
+ :value="item[map.value] + ''"
68
+ :checked="item.selected"
69
+ />
70
+ <view
71
+ v-if="(mode !== 'tag' && mode !== 'list') || (mode === 'list' && icon === 'left')"
72
+ class="radio__inner"
73
+ :style="item.styleBackgroud"
74
+ >
75
+ <view class="radio__inner-icon" :style="item.styleIcon"></view>
76
+ </view>
77
+ <view class="checklist-content" :class="{ 'list-content': mode === 'list' && icon === 'left' }">
78
+ <text class="checklist-text" :style="item.styleIconText">{{ item[map.text] }}</text>
79
+ <view v-if="mode === 'list' && icon === 'right'" :style="item.styleRightIcon" class="checkobx__list"></view>
80
+ </view>
81
+ </label>
82
+ </radio-group>
83
+ </template>
84
+ </view>
85
+ </template>
86
+
87
+ <script>
88
+ /**
89
+ * DataChecklist 数据选择器
90
+ * @description 通过数据渲染 checkbox 和 radio
91
+ * @tutorial https://ext.dcloud.net.cn/plugin?id=xxx
92
+ * @property {String} mode = [default| list | button | tag] 显示模式
93
+ * @value default 默认横排模式
94
+ * @value list 列表模式
95
+ * @value button 按钮模式
96
+ * @value tag 标签模式
97
+ * @property {Boolean} multiple = [true|false] 是否多选
98
+ * @property {Array|String|Number} value 默认值
99
+ * @property {Array} localdata 本地数据 ,格式 [{text:'',value:''}]
100
+ * @property {Number|String} min 最小选择个数 ,multiple为true时生效
101
+ * @property {Number|String} max 最大选择个数 ,multiple为true时生效
102
+ * @property {Boolean} wrap 是否换行显示
103
+ * @property {String} icon = [left|right] list 列表模式下icon显示位置
104
+ * @property {Boolean} selectedColor 选中颜色
105
+ * @property {Boolean} emptyText 没有数据时显示的文字 ,本地数据无效
106
+ * @property {Boolean} selectedTextColor 选中文本颜色,如不填写则自动显示
107
+ * @property {Object} map 字段映射, 默认 map={text:'text',value:'value'}
108
+ * @value left 左侧显示
109
+ * @value right 右侧显示
110
+ * @event {Function} change 选中发生变化触发
111
+ */
112
+
113
+ // import clientdb from './clientdb.js'
114
+ export default {
115
+ name: 'cvDataChecklist',
116
+ // mixins: [clientdb],
117
+ mixins: [uniCloud.mixinDatacom || {}],
118
+ // model: {
119
+ // prop: 'modelValue',
120
+ // event: 'update:modelValue'
121
+ // },
122
+ emits: ['input', 'update:modelValue', 'change'],
123
+ props: {
124
+ mode: {
125
+ type: String,
126
+ default: 'default'
127
+ },
128
+
129
+ multiple: {
130
+ type: Boolean,
131
+ default: false
132
+ },
133
+ value: {
134
+ type: [Array, String, Number],
135
+ default() {
136
+ return '';
137
+ }
138
+ },
139
+ // TODO vue3
140
+ modelValue: {
141
+ type: [Array, String, Number],
142
+ default() {
143
+ return '';
144
+ }
145
+ },
146
+ localdata: {
147
+ type: Array,
148
+ default() {
149
+ return [];
150
+ }
151
+ },
152
+ min: {
153
+ type: [Number, String],
154
+ default: ''
155
+ },
156
+ max: {
157
+ type: [Number, String],
158
+ default: ''
159
+ },
160
+ wrap: {
161
+ type: Boolean,
162
+ default: false
163
+ },
164
+ icon: {
165
+ type: String,
166
+ default: 'left'
167
+ },
168
+ selectedColor: {
169
+ type: String,
170
+ default: ''
171
+ },
172
+ selectedTextColor: {
173
+ type: String,
174
+ default: ''
175
+ },
176
+ emptyText: {
177
+ type: String,
178
+ default: '暂无数据'
179
+ },
180
+ disabled: {
181
+ type: Boolean,
182
+ default: false
183
+ },
184
+ map: {
185
+ type: Object,
186
+ default() {
187
+ return {
188
+ text: 'text',
189
+ value: 'value'
190
+ };
191
+ }
192
+ }
193
+ },
194
+ watch: {
195
+ localdata: {
196
+ handler(newVal) {
197
+ this.range = newVal;
198
+ this.dataList = this.getDataList(this.getSelectedValue(newVal));
199
+ },
200
+ deep: true
201
+ },
202
+ mixinDatacomResData(newVal) {
203
+ this.range = newVal;
204
+ this.dataList = this.getDataList(this.getSelectedValue(newVal));
205
+ },
206
+ value(newVal) {
207
+ this.dataList = this.getDataList(newVal);
208
+ this.formItem && this.formItem.setValue(newVal);
209
+ },
210
+ modelValue(newVal) {
211
+ this.dataList = this.getDataList(newVal);
212
+ this.formItem && this.formItem.setValue(newVal);
213
+ }
214
+ },
215
+ data() {
216
+ return {
217
+ dataList: [],
218
+ range: [],
219
+ contentText: {
220
+ contentdown: '查看更多',
221
+ contentrefresh: '加载中',
222
+ contentnomore: '没有更多'
223
+ },
224
+ isLocal: true,
225
+ styles: {
226
+ selectedColor: '#007aff',
227
+ selectedTextColor: '#333'
228
+ },
229
+ isTop: 0
230
+ };
231
+ },
232
+ computed: {
233
+ dataValue() {
234
+ if (this.value === '') return this.modelValue;
235
+ if (this.modelValue === '') return this.value;
236
+ return this.value;
237
+ }
238
+ },
239
+ created() {
240
+ this.form = this.getForm('uniForms');
241
+ this.formItem = this.getForm('uniFormsItem');
242
+ // this.formItem && this.formItem.setValue(this.value)
243
+
244
+ if (this.formItem) {
245
+ this.isTop = 6;
246
+ if (this.formItem.name) {
247
+ this.rename = this.formItem.name;
248
+ this.form.inputChildrens.push(this);
249
+ }
250
+ }
251
+
252
+ if (this.localdata && this.localdata.length !== 0) {
253
+ this.isLocal = true;
254
+ this.range = this.localdata;
255
+ this.dataList = this.getDataList(this.getSelectedValue(this.range));
256
+ } else {
257
+ if (this.collection) {
258
+ this.isLocal = false;
259
+ this.loadData();
260
+ }
261
+ }
262
+ },
263
+ methods: {
264
+ loadData() {
265
+ this.mixinDatacomGet()
266
+ .then((res) => {
267
+ this.mixinDatacomResData = res.result.data;
268
+ if (this.mixinDatacomResData.length === 0) {
269
+ this.isLocal = false;
270
+ this.mixinDatacomErrorMessage = this.emptyText;
271
+ } else {
272
+ this.isLocal = true;
273
+ }
274
+ })
275
+ .catch((err) => {
276
+ this.mixinDatacomErrorMessage = err.message;
277
+ });
278
+ },
279
+ /**
280
+ * 获取父元素实例
281
+ */
282
+ getForm(name = 'uniForms') {
283
+ let parent = this.$parent;
284
+ let parentName = parent.$options.name;
285
+ while (parentName !== name) {
286
+ parent = parent.$parent;
287
+ if (!parent) return false;
288
+ parentName = parent.$options.name;
289
+ }
290
+ return parent;
291
+ },
292
+ chagne(e) {
293
+ const values = e.detail.value;
294
+
295
+ let detail = {
296
+ value: [],
297
+ data: []
298
+ };
299
+
300
+ if (this.multiple) {
301
+ this.range.forEach((item) => {
302
+ if (values.includes(item[this.map.value] + '')) {
303
+ detail.value.push(item[this.map.value]);
304
+ detail.data.push(item);
305
+ }
306
+ });
307
+ } else {
308
+ const range = this.range.find((item) => item[this.map.value] + '' === values);
309
+ if (range) {
310
+ detail = {
311
+ value: range[this.map.value],
312
+ data: range
313
+ };
314
+ }
315
+ }
316
+ this.formItem && this.formItem.setValue(detail.value);
317
+ // TODO 兼容 vue2
318
+ this.$emit('input', detail.value);
319
+ // // TOTO 兼容 vue3
320
+ this.$emit('update:modelValue', detail.value);
321
+ this.$emit('change', {
322
+ detail
323
+ });
324
+ if (this.multiple) {
325
+ // 如果 v-model 没有绑定 ,则走内部逻辑
326
+ // if (this.value.length === 0) {
327
+ this.dataList = this.getDataList(detail.value, true);
328
+ // }
329
+ } else {
330
+ this.dataList = this.getDataList(detail.value);
331
+ }
332
+ },
333
+
334
+ /**
335
+ * 获取渲染的新数组
336
+ * @param {Object} value 选中内容
337
+ */
338
+ getDataList(value) {
339
+ // 解除引用关系,破坏原引用关系,避免污染源数据
340
+ let dataList = JSON.parse(JSON.stringify(this.range));
341
+ let list = [];
342
+ if (this.multiple) {
343
+ if (!Array.isArray(value)) {
344
+ value = [];
345
+ }
346
+ }
347
+ dataList.forEach((item, index) => {
348
+ item.disabled = item.disable || item.disabled || false;
349
+ if (this.multiple) {
350
+ if (value.length > 0) {
351
+ let have = value.find((val) => val === item[this.map.value]);
352
+ item.selected = have !== undefined;
353
+ } else {
354
+ item.selected = false;
355
+ }
356
+ } else {
357
+ item.selected = value === item[this.map.value];
358
+ }
359
+
360
+ list.push(item);
361
+ });
362
+ return this.setRange(list);
363
+ },
364
+ /**
365
+ * 处理最大最小值
366
+ * @param {Object} list
367
+ */
368
+ setRange(list) {
369
+ let selectList = list.filter((item) => item.selected);
370
+ let min = Number(this.min) || 0;
371
+ let max = Number(this.max) || '';
372
+ list.forEach((item, index) => {
373
+ if (this.multiple) {
374
+ if (selectList.length <= min) {
375
+ let have = selectList.find((val) => val[this.map.value] === item[this.map.value]);
376
+ if (have !== undefined) {
377
+ item.disabled = true;
378
+ }
379
+ }
380
+
381
+ if (selectList.length >= max && max !== '') {
382
+ let have = selectList.find((val) => val[this.map.value] === item[this.map.value]);
383
+ if (have === undefined) {
384
+ item.disabled = true;
385
+ }
386
+ }
387
+ }
388
+ this.setStyles(item, index);
389
+ list[index] = item;
390
+ });
391
+ return list;
392
+ },
393
+ /**
394
+ * 设置 class
395
+ * @param {Object} item
396
+ * @param {Object} index
397
+ */
398
+ setStyles(item, index) {
399
+ // 设置自定义样式
400
+ item.styleBackgroud = this.setStyleBackgroud(item);
401
+ item.styleIcon = this.setStyleIcon(item);
402
+ item.styleIconText = this.setStyleIconText(item);
403
+ item.styleRightIcon = this.setStyleRightIcon(item);
404
+ },
405
+
406
+ /**
407
+ * 获取选中值
408
+ * @param {Object} range
409
+ */
410
+ getSelectedValue(range) {
411
+ if (!this.multiple) return this.dataValue;
412
+ let selectedArr = [];
413
+ range.forEach((item) => {
414
+ if (item.selected) {
415
+ selectedArr.push(item[this.map.value]);
416
+ }
417
+ });
418
+ return this.dataValue.length > 0 ? this.dataValue : selectedArr;
419
+ },
420
+
421
+ /**
422
+ * 设置背景样式
423
+ */
424
+ setStyleBackgroud(item) {
425
+ let styles = {};
426
+ let selectedColor = this.selectedColor ? this.selectedColor : '#007aff';
427
+ if (this.mode !== 'list') {
428
+ styles['border-color'] = item.selected ? selectedColor : '#DCDFE6';
429
+ }
430
+ if (this.mode === 'tag') {
431
+ styles['background-color'] = item.selected ? selectedColor : '#f5f5f5';
432
+ }
433
+ let classles = '';
434
+ for (let i in styles) {
435
+ classles += `${i}:${styles[i]};`;
436
+ }
437
+ return classles;
438
+ },
439
+ setStyleIcon(item) {
440
+ let styles = {};
441
+ let classles = '';
442
+ let selectedColor = this.selectedColor ? this.selectedColor : '#007aff';
443
+ styles['background-color'] = item.selected ? selectedColor : '#fff';
444
+ styles['border-color'] = item.selected ? selectedColor : '#DCDFE6';
445
+
446
+ if (!item.selected && item.disabled) {
447
+ styles['background-color'] = '#F2F6FC';
448
+ styles['border-color'] = item.selected ? selectedColor : '#DCDFE6';
449
+ }
450
+
451
+ for (let i in styles) {
452
+ classles += `${i}:${styles[i]};`;
453
+ }
454
+ return classles;
455
+ },
456
+ setStyleIconText(item) {
457
+ let styles = {};
458
+ let classles = '';
459
+ let selectedColor = this.selectedColor ? this.selectedColor : '#007aff';
460
+ if (this.mode === 'tag') {
461
+ styles.color = item.selected ? (this.selectedTextColor ? this.selectedTextColor : '#fff') : '#333';
462
+ } else {
463
+ styles.color = item.selected ? (this.selectedTextColor ? this.selectedTextColor : selectedColor) : '#333';
464
+ }
465
+ if (!item.selected && item.disabled) {
466
+ styles.color = '#999';
467
+ }
468
+
469
+ for (let i in styles) {
470
+ classles += `${i}:${styles[i]};`;
471
+ }
472
+ return classles;
473
+ },
474
+ setStyleRightIcon(item) {
475
+ let styles = {};
476
+ let classles = '';
477
+ if (this.mode === 'list') {
478
+ styles['border-color'] = item.selected ? this.styles.selectedColor : '#DCDFE6';
479
+ }
480
+ for (let i in styles) {
481
+ classles += `${i}:${styles[i]};`;
482
+ }
483
+
484
+ return classles;
485
+ }
486
+ }
487
+ };
488
+ </script>
489
+
490
+ <style scoped>
491
+ .uni-data-loading {
492
+ /* #ifndef APP-NVUE */
493
+ display: flex;
494
+ /* #endif */
495
+ flex-direction: row;
496
+ justify-content: center;
497
+ align-items: center;
498
+ height: 36px;
499
+ padding-left: 10px;
500
+ color: #999;
501
+ }
502
+
503
+ .uni-data-checklist {
504
+ position: relative;
505
+ z-index: 0;
506
+ }
507
+
508
+ .uni-data-checklist .checklist-group {
509
+ /* #ifndef APP-NVUE */
510
+ display: flex;
511
+ /* #endif */
512
+ flex-direction: row;
513
+ flex-wrap: wrap;
514
+ }
515
+
516
+ .uni-data-checklist .checklist-group.is-list {
517
+ flex-direction: column;
518
+ }
519
+
520
+ .uni-data-checklist .checklist-group .checklist-box {
521
+ /* #ifndef APP-NVUE */
522
+ display: flex;
523
+ /* #endif */
524
+ flex-direction: row;
525
+ align-items: center;
526
+ position: relative;
527
+ margin: 5px 0;
528
+ margin-right: 25px;
529
+ }
530
+
531
+ .uni-data-checklist .checklist-group .checklist-box .hidden {
532
+ position: absolute;
533
+ opacity: 0;
534
+ }
535
+
536
+ .uni-data-checklist .checklist-group .checklist-box .checklist-content {
537
+ /* #ifndef APP-NVUE */
538
+ display: flex;
539
+ /* #endif */
540
+ flex: 1;
541
+ flex-direction: row;
542
+ align-items: center;
543
+ justify-content: space-between;
544
+ }
545
+
546
+ .uni-data-checklist .checklist-group .checklist-box .checklist-content .checklist-text {
547
+ font-size: 14px;
548
+ color: #333;
549
+ margin-left: 5px;
550
+ line-height: 14px;
551
+ }
552
+
553
+ .uni-data-checklist .checklist-group .checklist-box .checklist-content .checkobx__list {
554
+ border-right-width: 1px;
555
+ border-right-color: #007aff;
556
+ border-right-style: solid;
557
+ border-bottom-width: 1px;
558
+ border-bottom-color: #007aff;
559
+ border-bottom-style: solid;
560
+ height: 12px;
561
+ width: 6px;
562
+ left: -5px;
563
+ transform-origin: center;
564
+ transform: rotate(45deg);
565
+ opacity: 0;
566
+ }
567
+
568
+ .uni-data-checklist .checklist-group .checklist-box .checkbox__inner {
569
+ /* #ifndef APP-NVUE */
570
+ flex-shrink: 0;
571
+ box-sizing: border-box;
572
+ /* #endif */
573
+ position: relative;
574
+ width: 16px;
575
+ height: 16px;
576
+ border: 1px solid #dcdfe6;
577
+ border-radius: 2px;
578
+ background-color: #fff;
579
+ z-index: 1;
580
+ }
581
+
582
+ .uni-data-checklist .checklist-group .checklist-box .checkbox__inner .checkbox__inner-icon {
583
+ position: absolute;
584
+ /* #ifdef APP-NVUE */
585
+ top: 2px;
586
+ /* #endif */
587
+ /* #ifndef APP-NVUE */
588
+ top: 1px;
589
+ /* #endif */
590
+ left: 5px;
591
+ height: 8px;
592
+ width: 4px;
593
+ border-right-width: 1px;
594
+ border-right-color: #fff;
595
+ border-right-style: solid;
596
+ border-bottom-width: 1px;
597
+ border-bottom-color: #fff;
598
+ border-bottom-style: solid;
599
+ opacity: 0;
600
+ transform-origin: center;
601
+ transform: rotate(40deg);
602
+ }
603
+
604
+ .uni-data-checklist .checklist-group .checklist-box .radio__inner {
605
+ /* #ifndef APP-NVUE */
606
+ display: flex;
607
+ /* #endif */
608
+ /* #ifndef APP-NVUE */
609
+ flex-shrink: 0;
610
+ box-sizing: border-box;
611
+ /* #endif */
612
+ justify-content: center;
613
+ align-items: center;
614
+ position: relative;
615
+ width: 16px;
616
+ height: 16px;
617
+ border: 1px solid #dcdfe6;
618
+ border-radius: 16px;
619
+ background-color: #fff;
620
+ z-index: 1;
621
+ }
622
+
623
+ .uni-data-checklist .checklist-group .checklist-box .radio__inner .radio__inner-icon {
624
+ width: 8px;
625
+ height: 8px;
626
+ border-radius: 10px;
627
+ opacity: 0;
628
+ }
629
+
630
+ .uni-data-checklist .checklist-group .checklist-box.is--default.is-disable {
631
+ /* #ifdef H5 */
632
+ cursor: not-allowed;
633
+ /* #endif */
634
+ }
635
+
636
+ .uni-data-checklist .checklist-group .checklist-box.is--default.is-disable .checkbox__inner {
637
+ background-color: #f2f6fc;
638
+ border-color: #dcdfe6;
639
+ /* #ifdef H5 */
640
+ cursor: not-allowed;
641
+ /* #endif */
642
+ }
643
+
644
+ .uni-data-checklist .checklist-group .checklist-box.is--default.is-disable .radio__inner {
645
+ background-color: #f2f6fc;
646
+ border-color: #dcdfe6;
647
+ }
648
+
649
+ .uni-data-checklist .checklist-group .checklist-box.is--default.is-disable .checklist-text {
650
+ color: #999;
651
+ }
652
+
653
+ .uni-data-checklist .checklist-group .checklist-box.is--default.is-checked .checkbox__inner {
654
+ border-color: #007aff;
655
+ background-color: #007aff;
656
+ }
657
+
658
+ .uni-data-checklist .checklist-group .checklist-box.is--default.is-checked .checkbox__inner .checkbox__inner-icon {
659
+ opacity: 1;
660
+ transform: rotate(45deg);
661
+ }
662
+
663
+ .uni-data-checklist .checklist-group .checklist-box.is--default.is-checked .radio__inner {
664
+ border-color: #007aff;
665
+ }
666
+
667
+ .uni-data-checklist .checklist-group .checklist-box.is--default.is-checked .radio__inner .radio__inner-icon {
668
+ opacity: 1;
669
+ background-color: #007aff;
670
+ }
671
+
672
+ .uni-data-checklist .checklist-group .checklist-box.is--default.is-checked .checklist-text {
673
+ color: #007aff;
674
+ }
675
+
676
+ .uni-data-checklist .checklist-group .checklist-box.is--default.is-checked.is-disable .checkbox__inner {
677
+ opacity: 0.4;
678
+ }
679
+
680
+ .uni-data-checklist .checklist-group .checklist-box.is--default.is-checked.is-disable .checklist-text {
681
+ opacity: 0.4;
682
+ }
683
+
684
+ .uni-data-checklist .checklist-group .checklist-box.is--default.is-checked.is-disable .radio__inner {
685
+ opacity: 0.4;
686
+ }
687
+
688
+ .uni-data-checklist .checklist-group .checklist-box.is--button {
689
+ margin-right: 10px;
690
+ padding: 5px 15px;
691
+ border: 1px #dcdfe6 solid;
692
+ border-radius: 3px;
693
+ transition: border-color 0.2s;
694
+ }
695
+
696
+ .uni-data-checklist .checklist-group .checklist-box.is--button.is-disable {
697
+ /* #ifdef H5 */
698
+ cursor: not-allowed;
699
+ /* #endif */
700
+ border: 1px #eee solid;
701
+ opacity: 0.4;
702
+ }
703
+
704
+ .uni-data-checklist .checklist-group .checklist-box.is--button.is-disable .checkbox__inner {
705
+ background-color: #f2f6fc;
706
+ border-color: #dcdfe6;
707
+ /* #ifdef H5 */
708
+ cursor: not-allowed;
709
+ /* #endif */
710
+ }
711
+
712
+ .uni-data-checklist .checklist-group .checklist-box.is--button.is-disable .radio__inner {
713
+ background-color: #f2f6fc;
714
+ border-color: #dcdfe6;
715
+ /* #ifdef H5 */
716
+ cursor: not-allowed;
717
+ /* #endif */
718
+ }
719
+
720
+ .uni-data-checklist .checklist-group .checklist-box.is--button.is-disable .checklist-text {
721
+ color: #999;
722
+ }
723
+
724
+ .uni-data-checklist .checklist-group .checklist-box.is--button.is-checked {
725
+ border-color: #007aff;
726
+ }
727
+
728
+ .uni-data-checklist .checklist-group .checklist-box.is--button.is-checked .checkbox__inner {
729
+ border-color: #007aff;
730
+ background-color: #007aff;
731
+ }
732
+
733
+ .uni-data-checklist .checklist-group .checklist-box.is--button.is-checked .checkbox__inner .checkbox__inner-icon {
734
+ opacity: 1;
735
+ transform: rotate(45deg);
736
+ }
737
+
738
+ .uni-data-checklist .checklist-group .checklist-box.is--button.is-checked .radio__inner {
739
+ border-color: #007aff;
740
+ }
741
+
742
+ .uni-data-checklist .checklist-group .checklist-box.is--button.is-checked .radio__inner .radio__inner-icon {
743
+ opacity: 1;
744
+ background-color: #007aff;
745
+ }
746
+
747
+ .uni-data-checklist .checklist-group .checklist-box.is--button.is-checked .checklist-text {
748
+ color: #007aff;
749
+ }
750
+
751
+ .uni-data-checklist .checklist-group .checklist-box.is--button.is-checked.is-disable {
752
+ opacity: 0.4;
753
+ }
754
+
755
+ .uni-data-checklist .checklist-group .checklist-box.is--tag {
756
+ margin-right: 10px;
757
+ padding: 5px 10px;
758
+ border: 1px #dcdfe6 solid;
759
+ border-radius: 3px;
760
+ background-color: #f5f5f5;
761
+ }
762
+
763
+ .uni-data-checklist .checklist-group .checklist-box.is--tag .checklist-text {
764
+ margin: 0;
765
+ color: #333;
766
+ }
767
+
768
+ .uni-data-checklist .checklist-group .checklist-box.is--tag.is-disable {
769
+ /* #ifdef H5 */
770
+ cursor: not-allowed;
771
+ /* #endif */
772
+ opacity: 0.4;
773
+ }
774
+
775
+ .uni-data-checklist .checklist-group .checklist-box.is--tag.is-checked {
776
+ background-color: #007aff;
777
+ border-color: #007aff;
778
+ }
779
+
780
+ .uni-data-checklist .checklist-group .checklist-box.is--tag.is-checked .checklist-text {
781
+ color: #fff;
782
+ }
783
+
784
+ .uni-data-checklist .checklist-group .checklist-box.is--list {
785
+ /* #ifndef APP-NVUE */
786
+ display: flex;
787
+ /* #endif */
788
+ padding: 10px 15px;
789
+ padding-left: 0;
790
+ margin: 0;
791
+ }
792
+
793
+ .uni-data-checklist .checklist-group .checklist-box.is--list.is-list-border {
794
+ border-top: 1px #eee solid;
795
+ }
796
+
797
+ .uni-data-checklist .checklist-group .checklist-box.is--list.is-disable {
798
+ /* #ifdef H5 */
799
+ cursor: not-allowed;
800
+ /* #endif */
801
+ }
802
+
803
+ .uni-data-checklist .checklist-group .checklist-box.is--list.is-disable .checkbox__inner {
804
+ background-color: #f2f6fc;
805
+ border-color: #dcdfe6;
806
+ /* #ifdef H5 */
807
+ cursor: not-allowed;
808
+ /* #endif */
809
+ }
810
+
811
+ .uni-data-checklist .checklist-group .checklist-box.is--list.is-disable .checklist-text {
812
+ color: #999;
813
+ }
814
+
815
+ .uni-data-checklist .checklist-group .checklist-box.is--list.is-checked .checkbox__inner {
816
+ border-color: #007aff;
817
+ background-color: #007aff;
818
+ }
819
+
820
+ .uni-data-checklist .checklist-group .checklist-box.is--list.is-checked .checkbox__inner .checkbox__inner-icon {
821
+ opacity: 1;
822
+ transform: rotate(45deg);
823
+ }
824
+
825
+ .uni-data-checklist .checklist-group .checklist-box.is--list.is-checked .checklist-text {
826
+ color: #007aff;
827
+ }
828
+
829
+ .uni-data-checklist .checklist-group .checklist-box.is--list.is-checked .checklist-content .checkobx__list {
830
+ opacity: 1;
831
+ border-color: #007aff;
832
+ }
833
+
834
+ .uni-data-checklist .checklist-group .checklist-box.is--list.is-checked.is-disable .checkbox__inner {
835
+ opacity: 0.4;
836
+ }
837
+
838
+ .uni-data-checklist .checklist-group .checklist-box.is--list.is-checked.is-disable .checklist-text {
839
+ opacity: 0.4;
840
+ }
841
+ </style>