@10yun/cv-mobile-ui 0.3.26 → 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.
- package/build/parse-pages.js +2 -2
- package/package.json +1 -1
- package/ui-cv/README.md +3 -0
- package/ui-cv/cv-badge/cv-badge.vue +249 -0
- package/ui-cv/cv-banner/cv-banner.vue +1 -1
- package/ui-cv/cv-banner-card/cv-banner-card.vue +1 -1
- package/ui-cv/cv-block/cv-block.vue +1 -1
- package/ui-cv/cv-box/cv-box.vue +1 -1
- package/ui-cv/cv-calendar/calendar.js +963 -0
- package/ui-cv/cv-calendar/cv-calendar-item.vue +198 -0
- package/ui-cv/cv-calendar/cv-calendar.vue +508 -0
- package/{ui-uni/uni-calendar → ui-cv/cv-calendar}/util.js +0 -0
- package/ui-cv/cv-card/cv-card.vue +427 -0
- package/ui-cv/cv-cell/cv-cell.vue +1 -1
- package/ui-cv/cv-checkbox-group/cv-checkbox-group.vue +227 -0
- package/ui-cv/cv-checkbox-opt-base/cv-checkbox-opt-base.vue +57 -0
- package/ui-cv/cv-checkbox-opt-tag/cv-checkbox-opt-tag.vue +107 -0
- package/ui-cv/cv-code-sms/cv-code-sms.vue +23 -42
- package/ui-cv/cv-col/cv-col.vue +2965 -0
- package/ui-cv/cv-collapse/cv-collapse.vue +146 -0
- package/ui-cv/cv-collapse-item/cv-collapse-item.vue +395 -0
- package/ui-cv/cv-combox/cv-combox.vue +250 -0
- package/ui-cv/cv-countdown/cv-countdown.vue +245 -0
- package/ui-cv/cv-data-checkbox/cv-data-checkbox.vue +841 -0
- package/{ui-uni/uni-data-indexed-list → ui-cv/cv-data-indexed-list}/clientdb.js +0 -0
- package/ui-cv/cv-data-indexed-list/cv-data-indexed-list-item.vue +154 -0
- package/ui-cv/cv-data-indexed-list/cv-data-indexed-list.vue +376 -0
- package/ui-cv/cv-data-picker/cv-data-picker.vue +486 -0
- package/{ui-uni/uni-data-picker → ui-cv/cv-data-picker}/keypress.js +0 -0
- package/{ui-uni/uni-data-pickerview/uni-data-picker.js → ui-cv/cv-data-pickerview/cv-data-picker.js} +0 -0
- package/ui-cv/cv-data-pickerview/cv-data-pickerview.vue +304 -0
- package/ui-cv/cv-dateformat/cv-dateformat.vue +86 -0
- package/{ui-uni/uni-dateformat → ui-cv/cv-dateformat}/date-format.js +0 -0
- package/{ui-uni/uni-datetime-picker → ui-cv/cv-datetime-picker}/calendar-item.vue +0 -0
- package/{ui-uni/uni-datetime-picker → ui-cv/cv-datetime-picker}/calendar.js +0 -0
- package/ui-cv/cv-datetime-picker/calendar.vue +761 -0
- package/ui-cv/cv-datetime-picker/cv-datetime-picker.vue +958 -0
- package/{ui-uni/uni-datetime-picker → ui-cv/cv-datetime-picker}/keypress.js +0 -0
- package/ui-cv/cv-datetime-picker/time-picker.vue +907 -0
- package/{ui-uni/uni-datetime-picker → ui-cv/cv-datetime-picker}/util.js +0 -0
- package/ui-cv/cv-dialog-bottom/cv-dialog-bottom.vue +1 -1
- package/ui-cv/cv-dialog-full/cv-dialog-full.vue +1 -1
- package/ui-cv/cv-dialog-loading/cv-dialog-loading.vue +3 -3
- package/ui-cv/cv-drawer/cv-drawer.vue +185 -0
- package/{ui-uni/uni-drawer → ui-cv/cv-drawer}/keypress.js +14 -14
- package/{ui-uni/uni-easyinput → ui-cv/cv-easyinput}/common.js +0 -0
- package/ui-cv/cv-easyinput/cv-easyinput.vue +514 -0
- package/ui-cv/cv-editor-parse/readme.md +2 -3
- package/ui-cv/{cv-editor → cv-editor-quill}/compressImage.vue +0 -0
- package/ui-cv/{cv-editor/cv-editor.vue → cv-editor-quill/cv-editor-quill.vue} +3 -23
- package/ui-cv/{cv-editor → cv-editor-quill}/editor-icon.css +0 -0
- package/ui-cv/{cv-editor → cv-editor-quill}/editor-icon.ttf +0 -0
- package/ui-cv/{cv-editor → cv-editor-quill}/index.js +0 -0
- package/ui-cv/cv-fab/cv-fab.vue +465 -0
- package/{ui-uni/uni-fab/uni-fab.vue.bak → ui-cv/cv-fab/cv-fab.vue.bak} +2 -2
- package/ui-cv/cv-fav/cv-fav.vue +150 -0
- package/{ui-uni/uni-file-picker → ui-cv/cv-file-picker}/choose-and-upload-file.js +0 -0
- package/ui-cv/cv-file-picker/cv-file-picker.vue +619 -0
- package/{ui-uni/uni-file-picker → ui-cv/cv-file-picker}/upload-file.vue +0 -0
- package/{ui-uni/uni-file-picker → ui-cv/cv-file-picker}/upload-image.vue +0 -0
- package/{ui-uni/uni-file-picker → ui-cv/cv-file-picker}/utils.js +0 -0
- package/ui-cv/cv-form-base/cv-form-base.vue +470 -0
- package/ui-cv/cv-form-base/validate.js +477 -0
- package/ui-cv/cv-form-group/cv-form-group.vue +123 -80
- package/ui-cv/cv-form-group/cv-form-group2.vue +80 -0
- package/ui-cv/cv-form-item/cv-form-item.vue +482 -174
- package/ui-cv/cv-form-item/cv-form-item2.vue +215 -0
- package/ui-cv/cv-form-merge/cv-form-merge.vue +1 -1
- package/ui-cv/cv-geo-local/cv-geo-local.vue +14 -26
- package/{ui-uni/uni-goods-nav/uni-goods-nav.vue → ui-cv/cv-goods-nav/cv-goods-nav.vue} +1 -1
- package/ui-cv/cv-grid-group/cv-grid-group.vue +148 -0
- package/ui-cv/cv-grid-item/cv-grid-item.vue +132 -0
- package/ui-cv/cv-icon2/cv-icon2.vue +78 -0
- package/ui-cv/cv-icon2/icons.js +132 -0
- package/{ui-uni/uni-icons → ui-cv/cv-icon2}/uni.ttf +0 -0
- package/ui-cv/cv-icons/cv-icons.vue +1 -1
- package/ui-cv/cv-indexed-list/cv-indexed-list-item.vue +154 -0
- package/ui-cv/cv-indexed-list/cv-indexed-list.vue +371 -0
- package/ui-cv/cv-info/cv-info.vue +5 -20
- package/ui-cv/cv-input-btn/cv-input-btn.vue +25 -43
- package/ui-cv/cv-input-digit/cv-input-digit.vue +61 -28
- package/ui-cv/cv-input-idcard/cv-input-idcard.vue +47 -29
- package/ui-cv/cv-input-number/cv-input-number.vue +60 -28
- package/ui-cv/cv-input-password/cv-input-password.vue +80 -30
- package/ui-cv/cv-input-text/cv-input-text.vue +55 -37
- package/ui-cv/cv-link2/cv-link2.vue +130 -0
- package/ui-cv/cv-list/cv-list.vue +107 -0
- package/ui-cv/cv-list/cv-refresh.vue +65 -0
- package/{ui-uni/uni-list → ui-cv/cv-list}/uni-refresh.wxs +0 -0
- package/ui-cv/cv-list-ad/cv-list-ad.vue +113 -0
- package/{ui-uni/uni-list-chat/uni-list-chat.scss → ui-cv/cv-list-chat/cv-list-chat.scss} +0 -0
- package/{ui-uni/uni-list-chat/uni-list-chat.vue → ui-cv/cv-list-chat/cv-list-chat.vue} +0 -0
- package/ui-cv/cv-list-item/cv-list-item.vue +449 -0
- package/ui-cv/cv-load-more/config.json +9 -9
- package/ui-cv/cv-load-more/cv-load-more.vue +34 -5
- package/ui-cv/cv-message/cv-message.vue +1 -1
- package/ui-cv/cv-nav-bar/cv-nav-bar.vue +256 -0
- package/{ui-uni/uni-nav-bar/uni-status-bar.vue → ui-cv/cv-nav-bar/cv-status-bar.vue} +0 -0
- package/ui-cv/cv-nav-col/cv-nav-col.vue +1 -1
- package/ui-cv/cv-nav-row/cv-nav-row.vue +1 -1
- package/ui-cv/cv-notice-bar/cv-notice-bar.vue +453 -0
- package/ui-cv/cv-number-box/cv-number-box.vue +223 -0
- package/ui-cv/cv-pagination/cv-pagination.vue +397 -0
- package/ui-cv/cv-picker-date/cv-picker-date.vue +17 -27
- package/ui-cv/cv-picker-datetime/cv-picker-datetime.vue +31 -41
- package/ui-cv/cv-picker-datetime5/cv-picker-datetime5.vue +19 -29
- package/ui-cv/cv-picker-region/cv-picker-region.vue +23 -33
- package/ui-cv/cv-picker-time/cv-picker-time.vue +16 -26
- package/ui-cv/cv-picker1/cv-picker1.vue +16 -28
- package/ui-cv/cv-picker2/cv-picker2.vue +22 -32
- package/ui-cv/cv-picker3/cv-picker3.vue +34 -44
- package/ui-cv/cv-popup/cv-popup.vue +429 -0
- package/{ui-uni/uni-popup → ui-cv/cv-popup}/keypress.js +0 -0
- package/{ui-uni/uni-popup → ui-cv/cv-popup}/popup.js +0 -0
- package/{ui-uni/uni-popup-dialog/uni-popup-dialog.vue → ui-cv/cv-popup-dialog/cv-popup-dialog.vue} +0 -0
- package/{ui-uni/uni-popup-dialog → ui-cv/cv-popup-dialog}/keypress.js +0 -0
- package/ui-cv/cv-popup-message/cv-popup-message.vue +143 -0
- package/{ui-uni/uni-popup-share/uni-popup-share.vue → ui-cv/cv-popup-share/cv-popup-share.vue} +0 -0
- package/ui-cv/cv-radio-group/cv-radio-group.vue +185 -0
- package/ui-cv/cv-radio-opt-base/cv-radio-opt-base.vue +57 -0
- package/ui-cv/cv-radio-opt-tag/cv-radio-opt-tag.vue +107 -0
- package/ui-cv/cv-rate/cv-rate.vue +13 -17
- package/ui-cv/cv-rate/uni-rate.vue +358 -0
- package/ui-cv/cv-row/cv-row.vue +157 -0
- package/ui-cv/cv-search/cv-search.vue +4 -4
- package/ui-cv/cv-search-bar/cv-search-bar.vue +280 -0
- package/{ui-uni/uni-section/uni-section.vue → ui-cv/cv-section/cv-section.vue} +0 -0
- package/{ui-uni/uni-segmented-control/uni-segmented-control.vue → ui-cv/cv-segmented-control/cv-segmented-control.vue} +0 -0
- package/ui-cv/cv-skeleton/cv-skeleton2.vue +5 -5
- package/ui-cv/cv-specs/cv-specs.vue +1 -1
- package/{ui-uni/uni-status-bar/uni-status-bar.vue → ui-cv/cv-status-bar/cv-status-bar.vue} +0 -0
- package/ui-cv/cv-steps/cv-steps.vue +293 -0
- package/{ui-uni/uni-swipe-action/uni-swipe-action.vue → ui-cv/cv-swipe-action/cv-swipe-action.vue} +0 -0
- package/{ui-uni/uni-swipe-action-item → ui-cv/cv-swipe-action-item}/bindingx.js +0 -0
- package/{ui-uni/uni-swipe-action-item/uni-swipe-action-item.vue → ui-cv/cv-swipe-action-item/cv-swipe-action-item.vue} +0 -0
- package/{ui-uni/uni-swipe-action-item → ui-cv/cv-swipe-action-item}/index.wxs +0 -0
- package/{ui-uni/uni-swipe-action-item → ui-cv/cv-swipe-action-item}/isPC.js +0 -0
- package/{ui-uni/uni-swipe-action-item → ui-cv/cv-swipe-action-item}/mpalipay.js +0 -0
- package/{ui-uni/uni-swipe-action-item → ui-cv/cv-swipe-action-item}/mpother.js +0 -0
- package/{ui-uni/uni-swipe-action-item → ui-cv/cv-swipe-action-item}/mpwxs.js +0 -0
- package/ui-cv/cv-swiper-dot/cv-swiper-dot.vue +255 -0
- package/ui-cv/cv-switch/cv-switch.vue +5 -9
- package/ui-cv/cv-table/cv-table.vue +460 -0
- package/ui-cv/cv-tag/cv-tag.vue +276 -0
- package/ui-cv/cv-tbody/cv-tbody.vue +28 -0
- package/ui-cv/cv-td/cv-td.vue +93 -0
- package/{ui-uni/uni-test/uni-test.vue → ui-cv/cv-test/cv-test.vue} +0 -0
- package/ui-cv/cv-textarea/cv-textarea.vue +56 -41
- package/ui-cv/cv-th/cv-th.vue +270 -0
- package/{ui-uni/uni-th → ui-cv/cv-th}/filter-dropdown.vue +0 -0
- package/ui-cv/cv-thead/cv-thead.vue +114 -0
- package/ui-cv/cv-title/cv-title.vue +168 -0
- package/ui-cv/cv-tr/cv-tr.vue +166 -0
- package/{ui-uni/uni-tr → ui-cv/cv-tr}/table-checkbox.vue +0 -0
- package/{ui-uni/uni-transition → ui-cv/cv-transition}/createAnimation.js +0 -0
- package/ui-cv/cv-transition/cv-transition.vue +279 -0
- package/ui-cv/cv-upload-avatar/cv-upload-avatar.vue +24 -22
- package/ui-cv/cv-upload-img/cv-upload-img.vue +1 -1
- package/ui-cv/mixins/mixins-input.js +20 -29
- package/ui-cv/mixins/mixins-picker.js +1 -13
- package/ui-uni/amap-wx/js/util.js +158 -166
- package/ui-uni/product.vue +52 -52
- package/ui-uni/u-charts/u-charts.js +1092 -743
- package/ui-cv/cv-checkbox/cv-checkbox.vue +0 -140
- package/ui-cv/cv-checkbox-tag/cv-checkbox-tag.vue +0 -164
- package/ui-cv/cv-nav-group/cv-nav-group.vue +0 -33
- package/ui-cv/cv-radio/cv-radio.vue +0 -111
- package/ui-cv/cv-radio-sex/cv-radio-sex.vue +0 -80
- package/ui-cv/cv-radio-tag/cv-radio-tag.vue +0 -133
- package/ui-cv/mixins/mixins-checkbox.js +0 -71
- package/ui-cv/mixins/mixins-common.js +0 -53
- package/ui-cv/mixins/mixins-radio.js +0 -84
- package/ui-uni/page-foot/page-foot.vue +0 -38
- package/ui-uni/page-head/page-head.vue +0 -16
- package/ui-uni/u-link/u-link.vue +0 -59
- package/ui-uni/uni-badge/uni-badge.vue +0 -250
- package/ui-uni/uni-calendar/calendar.js +0 -546
- package/ui-uni/uni-calendar/uni-calendar-item.vue +0 -171
- package/ui-uni/uni-calendar/uni-calendar.vue +0 -504
- package/ui-uni/uni-card/uni-card.vue +0 -420
- package/ui-uni/uni-col/uni-col.vue +0 -2968
- package/ui-uni/uni-collapse/uni-collapse.vue +0 -146
- package/ui-uni/uni-collapse-item/uni-collapse-item.vue +0 -378
- package/ui-uni/uni-combox/uni-combox.vue +0 -237
- package/ui-uni/uni-countdown/uni-countdown.vue +0 -234
- package/ui-uni/uni-data-checkbox/uni-data-checkbox.vue +0 -792
- package/ui-uni/uni-data-indexed-list/uni-data-indexed-list-item.vue +0 -142
- package/ui-uni/uni-data-indexed-list/uni-data-indexed-list.vue +0 -364
- package/ui-uni/uni-data-picker/uni-data-picker.vue +0 -468
- package/ui-uni/uni-data-pickerview/uni-data-pickerview.vue +0 -298
- package/ui-uni/uni-dateformat/uni-dateformat.vue +0 -88
- package/ui-uni/uni-datetime-picker/calendar.vue +0 -747
- package/ui-uni/uni-datetime-picker/time-picker.vue +0 -899
- package/ui-uni/uni-datetime-picker/uni-datetime-picker.vue +0 -874
- package/ui-uni/uni-drawer/uni-drawer.vue +0 -178
- package/ui-uni/uni-easyinput/uni-easyinput.vue +0 -438
- package/ui-uni/uni-fab/uni-fab.vue +0 -443
- package/ui-uni/uni-fav/uni-fav.vue +0 -136
- package/ui-uni/uni-file-picker/uni-file-picker.vue +0 -614
- package/ui-uni/uni-forms/uni-forms.vue +0 -467
- package/ui-uni/uni-forms/validate.js +0 -486
- package/ui-uni/uni-forms-item/uni-forms-item.vue +0 -500
- package/ui-uni/uni-grid/uni-grid.vue +0 -141
- package/ui-uni/uni-grid-item/uni-grid-item.vue +0 -123
- package/ui-uni/uni-group/uni-group.vue +0 -123
- package/ui-uni/uni-icons/icons.js +0 -132
- package/ui-uni/uni-icons/uni-icons.vue +0 -72
- package/ui-uni/uni-indexed-list/uni-indexed-list-item.vue +0 -142
- package/ui-uni/uni-indexed-list/uni-indexed-list.vue +0 -357
- package/ui-uni/uni-link/uni-link.vue +0 -117
- package/ui-uni/uni-list/uni-list.vue +0 -107
- package/ui-uni/uni-list/uni-refresh.vue +0 -65
- package/ui-uni/uni-list-ad/uni-list-ad.vue +0 -106
- package/ui-uni/uni-list-item/uni-list-item.vue +0 -428
- package/ui-uni/uni-load-more/uni-load-more.vue +0 -366
- package/ui-uni/uni-nav-bar/uni-nav-bar.vue +0 -244
- package/ui-uni/uni-notice-bar/uni-notice-bar.vue +0 -394
- package/ui-uni/uni-number-box/uni-number-box.vue +0 -224
- package/ui-uni/uni-pagination/uni-pagination.vue +0 -376
- package/ui-uni/uni-popup/uni-popup.vue +0 -412
- package/ui-uni/uni-popup-message/uni-popup-message.vue +0 -143
- package/ui-uni/uni-rate/uni-rate.vue +0 -357
- package/ui-uni/uni-row/uni-row.vue +0 -155
- package/ui-uni/uni-search-bar/uni-search-bar.vue +0 -262
- package/ui-uni/uni-steps/uni-steps.vue +0 -250
- package/ui-uni/uni-swiper-dot/uni-swiper-dot.vue +0 -205
- package/ui-uni/uni-table/uni-table.vue +0 -455
- package/ui-uni/uni-tag/uni-tag.vue +0 -283
- package/ui-uni/uni-tbody/uni-tbody.vue +0 -30
- package/ui-uni/uni-td/uni-td.vue +0 -88
- package/ui-uni/uni-th/uni-th.vue +0 -259
- package/ui-uni/uni-thead/uni-thead.vue +0 -114
- package/ui-uni/uni-title/uni-title.vue +0 -171
- package/ui-uni/uni-tr/uni-tr.vue +0 -156
- package/ui-uni/uni-transition/uni-transition.vue +0 -287
package/ui-uni/uni-tr/uni-tr.vue
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<!-- #ifdef H5 -->
|
|
3
|
-
<tr class="uni-table-tr">
|
|
4
|
-
<th v-if="selection === 'selection' && ishead" class="checkbox" :class="{ 'tr-table--border': border }">
|
|
5
|
-
<table-checkbox :checked="checked" :indeterminate="indeterminate" :disabled="disabled" @checkboxSelected="checkboxSelected"></table-checkbox>
|
|
6
|
-
</th>
|
|
7
|
-
<slot></slot>
|
|
8
|
-
<!-- <uni-th class="th-fixed">123</uni-th> -->
|
|
9
|
-
</tr>
|
|
10
|
-
<!-- #endif -->
|
|
11
|
-
<!-- #ifndef H5 -->
|
|
12
|
-
<view class="uni-table-tr">
|
|
13
|
-
<view v-if="selection === 'selection' " class="checkbox" :class="{ 'tr-table--border': border }">
|
|
14
|
-
<table-checkbox :checked="checked" :indeterminate="indeterminate" :disabled="disabled" @checkboxSelected="checkboxSelected"></table-checkbox>
|
|
15
|
-
</view>
|
|
16
|
-
<slot></slot>
|
|
17
|
-
</view>
|
|
18
|
-
<!-- #endif -->
|
|
19
|
-
</template>
|
|
20
|
-
|
|
21
|
-
<script>
|
|
22
|
-
import tableCheckbox from './table-checkbox.vue'
|
|
23
|
-
/**
|
|
24
|
-
* Tr 表格行组件
|
|
25
|
-
* @description 表格行组件 仅包含 th,td 组件
|
|
26
|
-
* @tutorial https://ext.dcloud.net.cn/plugin?id=
|
|
27
|
-
*/
|
|
28
|
-
export default {
|
|
29
|
-
name: 'uniTr',
|
|
30
|
-
components: {
|
|
31
|
-
tableCheckbox
|
|
32
|
-
},
|
|
33
|
-
props: {
|
|
34
|
-
disabled: {
|
|
35
|
-
type: Boolean,
|
|
36
|
-
default: false
|
|
37
|
-
},
|
|
38
|
-
keyValue: {
|
|
39
|
-
type: [String, Number],
|
|
40
|
-
default: ''
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
options: {
|
|
44
|
-
virtualHost: true
|
|
45
|
-
},
|
|
46
|
-
data() {
|
|
47
|
-
return {
|
|
48
|
-
value: false,
|
|
49
|
-
border: false,
|
|
50
|
-
selection: false,
|
|
51
|
-
widthThArr: [],
|
|
52
|
-
ishead: true,
|
|
53
|
-
checked: false,
|
|
54
|
-
indeterminate: false
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
created() {
|
|
58
|
-
this.root = this.getTable()
|
|
59
|
-
this.head = this.getTable('uniThead')
|
|
60
|
-
if (this.head) {
|
|
61
|
-
this.ishead = false
|
|
62
|
-
this.head.init(this)
|
|
63
|
-
}
|
|
64
|
-
this.border = this.root.border
|
|
65
|
-
this.selection = this.root.type
|
|
66
|
-
this.root.trChildren.push(this)
|
|
67
|
-
const rowData = this.root.data.find(v => v[this.root.rowKey] === this.keyValue)
|
|
68
|
-
if (rowData) {
|
|
69
|
-
this.rowData = rowData
|
|
70
|
-
}
|
|
71
|
-
this.root.isNodata()
|
|
72
|
-
},
|
|
73
|
-
mounted() {
|
|
74
|
-
if (this.widthThArr.length > 0) {
|
|
75
|
-
const selectionWidth = this.selection === 'selection' ? 50 : 0
|
|
76
|
-
this.root.minWidth = this.widthThArr.reduce((a, b) => Number(a) + Number(b)) + selectionWidth
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
// #ifndef VUE3
|
|
80
|
-
destroyed() {
|
|
81
|
-
const index = this.root.trChildren.findIndex(i => i === this)
|
|
82
|
-
this.root.trChildren.splice(index, 1)
|
|
83
|
-
this.root.isNodata()
|
|
84
|
-
},
|
|
85
|
-
// #endif
|
|
86
|
-
// #ifdef VUE3
|
|
87
|
-
unmounted() {
|
|
88
|
-
const index = this.root.trChildren.findIndex(i => i === this)
|
|
89
|
-
this.root.trChildren.splice(index, 1)
|
|
90
|
-
this.root.isNodata()
|
|
91
|
-
},
|
|
92
|
-
// #endif
|
|
93
|
-
methods: {
|
|
94
|
-
minWidthUpdate(width) {
|
|
95
|
-
this.widthThArr.push(width)
|
|
96
|
-
},
|
|
97
|
-
// 选中
|
|
98
|
-
checkboxSelected(e) {
|
|
99
|
-
let rootData = this.root.data.find(v => v[this.root.rowKey] === this.keyValue)
|
|
100
|
-
this.checked = e.checked
|
|
101
|
-
this.root.check(rootData || this, e.checked, rootData ? this.keyValue : null)
|
|
102
|
-
},
|
|
103
|
-
change(e) {
|
|
104
|
-
this.root.trChildren.forEach(item => {
|
|
105
|
-
if (item === this) {
|
|
106
|
-
this.root.check(this, e.detail.value.length > 0 ? true : false)
|
|
107
|
-
}
|
|
108
|
-
})
|
|
109
|
-
},
|
|
110
|
-
/**
|
|
111
|
-
* 获取父元素实例
|
|
112
|
-
*/
|
|
113
|
-
getTable(name = 'uniTable') {
|
|
114
|
-
let parent = this.$parent
|
|
115
|
-
let parentName = parent.$options.name
|
|
116
|
-
while (parentName !== name) {
|
|
117
|
-
parent = parent.$parent
|
|
118
|
-
if (!parent) return false
|
|
119
|
-
parentName = parent.$options.name
|
|
120
|
-
}
|
|
121
|
-
return parent
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
</script>
|
|
126
|
-
|
|
127
|
-
<style scoped>
|
|
128
|
-
.uni-table-tr {
|
|
129
|
-
/* #ifndef APP-NVUE */
|
|
130
|
-
display: table-row;
|
|
131
|
-
transition: all 0.3s;
|
|
132
|
-
box-sizing: border-box;
|
|
133
|
-
/* #endif */
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.checkbox {
|
|
137
|
-
padding: 0 8px;
|
|
138
|
-
width: 26px;
|
|
139
|
-
padding-left: 12px;
|
|
140
|
-
/* #ifndef APP-NVUE */
|
|
141
|
-
display: table-cell;
|
|
142
|
-
vertical-align: middle;
|
|
143
|
-
/* #endif */
|
|
144
|
-
color: #333;
|
|
145
|
-
font-weight: 500;
|
|
146
|
-
border-bottom: 1px #ebeef5 solid;
|
|
147
|
-
font-size: 14px;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.tr-table--border {
|
|
151
|
-
border-right: 1px #ebeef5 solid;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
/* #ifndef APP-NVUE */
|
|
155
|
-
/* #endif */
|
|
156
|
-
</style>
|
|
@@ -1,287 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<view v-if="isShow" ref="ani" :animation="animationData" :class="customClass" :style="transformStyles" @click="onClick">
|
|
3
|
-
<slot></slot>
|
|
4
|
-
</view>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
import {
|
|
9
|
-
createAnimation
|
|
10
|
-
} from './createAnimation'
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Transition 过渡动画
|
|
14
|
-
* @description 简单过渡动画组件
|
|
15
|
-
* @tutorial https://ext.dcloud.net.cn/plugin?id=985
|
|
16
|
-
* @property {Boolean} show = [false|true] 控制组件显示或隐藏
|
|
17
|
-
* @property {Array|String} modeClass = [fade|slide-top|slide-right|slide-bottom|slide-left|zoom-in|zoom-out] 过渡动画类型
|
|
18
|
-
* @value fade 渐隐渐出过渡
|
|
19
|
-
* @value slide-top 由上至下过渡
|
|
20
|
-
* @value slide-right 由右至左过渡
|
|
21
|
-
* @value slide-bottom 由下至上过渡
|
|
22
|
-
* @value slide-left 由左至右过渡
|
|
23
|
-
* @value zoom-in 由小到大过渡
|
|
24
|
-
* @value zoom-out 由大到小过渡
|
|
25
|
-
* @property {Number} duration 过渡动画持续时间
|
|
26
|
-
* @property {Object} styles 组件样式,同 css 样式,注意带’-‘连接符的属性需要使用小驼峰写法如:`backgroundColor:red`
|
|
27
|
-
*/
|
|
28
|
-
export default {
|
|
29
|
-
name: 'uniTransition',
|
|
30
|
-
emits: ['click', 'change'],
|
|
31
|
-
props: {
|
|
32
|
-
show: {
|
|
33
|
-
type: Boolean,
|
|
34
|
-
default: false
|
|
35
|
-
},
|
|
36
|
-
modeClass: {
|
|
37
|
-
type: [Array, String],
|
|
38
|
-
default () {
|
|
39
|
-
return 'fade'
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
duration: {
|
|
43
|
-
type: Number,
|
|
44
|
-
default: 300
|
|
45
|
-
},
|
|
46
|
-
styles: {
|
|
47
|
-
type: Object,
|
|
48
|
-
default () {
|
|
49
|
-
return {}
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
customClass: {
|
|
53
|
-
type: String,
|
|
54
|
-
default: ''
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
data() {
|
|
58
|
-
return {
|
|
59
|
-
isShow: false,
|
|
60
|
-
transform: '',
|
|
61
|
-
opacity: 1,
|
|
62
|
-
animationData: {},
|
|
63
|
-
durationTime: 300,
|
|
64
|
-
config: {}
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
watch: {
|
|
68
|
-
show: {
|
|
69
|
-
handler(newVal) {
|
|
70
|
-
if (newVal) {
|
|
71
|
-
this.open()
|
|
72
|
-
} else {
|
|
73
|
-
// 避免上来就执行 close,导致动画错乱
|
|
74
|
-
if (this.isShow) {
|
|
75
|
-
this.close()
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
immediate: true
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
computed: {
|
|
83
|
-
// 生成样式数据
|
|
84
|
-
stylesObject() {
|
|
85
|
-
let styles = {
|
|
86
|
-
...this.styles,
|
|
87
|
-
'transition-duration': this.duration / 1000 + 's'
|
|
88
|
-
}
|
|
89
|
-
let transform = ''
|
|
90
|
-
for (let i in styles) {
|
|
91
|
-
let line = this.toLine(i)
|
|
92
|
-
transform += line + ':' + styles[i] + ';'
|
|
93
|
-
}
|
|
94
|
-
return transform
|
|
95
|
-
},
|
|
96
|
-
// 初始化动画条件
|
|
97
|
-
transformStyles() {
|
|
98
|
-
return 'transform:' + this.transform + ';' + 'opacity:' + this.opacity + ';' + this.stylesObject
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
created() {
|
|
102
|
-
// 动画默认配置
|
|
103
|
-
this.config = {
|
|
104
|
-
duration: this.duration,
|
|
105
|
-
timingFunction: 'ease',
|
|
106
|
-
transformOrigin: '50% 50%',
|
|
107
|
-
delay: 0
|
|
108
|
-
}
|
|
109
|
-
this.durationTime = this.duration
|
|
110
|
-
},
|
|
111
|
-
methods: {
|
|
112
|
-
/**
|
|
113
|
-
* ref 触发 初始化动画
|
|
114
|
-
*/
|
|
115
|
-
init(obj = {}) {
|
|
116
|
-
if (obj.duration) {
|
|
117
|
-
this.durationTime = obj.duration
|
|
118
|
-
}
|
|
119
|
-
this.animation = createAnimation(Object.assign(this.config, obj))
|
|
120
|
-
},
|
|
121
|
-
/**
|
|
122
|
-
* 点击组件触发回调
|
|
123
|
-
*/
|
|
124
|
-
onClick() {
|
|
125
|
-
this.$emit('click', {
|
|
126
|
-
detail: this.isShow
|
|
127
|
-
})
|
|
128
|
-
},
|
|
129
|
-
/**
|
|
130
|
-
* ref 触发 动画分组
|
|
131
|
-
* @param {Object} obj
|
|
132
|
-
*/
|
|
133
|
-
step(obj, config = {}) {
|
|
134
|
-
if (!this.animation) return
|
|
135
|
-
for (let i in obj) {
|
|
136
|
-
try {
|
|
137
|
-
if (typeof obj[i] === 'object') {
|
|
138
|
-
this.animation[i](...obj[i])
|
|
139
|
-
} else {
|
|
140
|
-
this.animation[i](obj[i])
|
|
141
|
-
}
|
|
142
|
-
} catch (e) {
|
|
143
|
-
console.error(`方法 ${i} 不存在`)
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
this.animation.step(config)
|
|
147
|
-
return this
|
|
148
|
-
},
|
|
149
|
-
/**
|
|
150
|
-
* ref 触发 执行动画
|
|
151
|
-
*/
|
|
152
|
-
run(fn) {
|
|
153
|
-
if (!this.animation) return
|
|
154
|
-
this.animation.run(fn)
|
|
155
|
-
},
|
|
156
|
-
// 开始过度动画
|
|
157
|
-
open() {
|
|
158
|
-
clearTimeout(this.timer)
|
|
159
|
-
this.transform = ''
|
|
160
|
-
this.isShow = true
|
|
161
|
-
let {
|
|
162
|
-
opacity,
|
|
163
|
-
transform
|
|
164
|
-
} = this.styleInit(false)
|
|
165
|
-
if (typeof opacity !== 'undefined') {
|
|
166
|
-
this.opacity = opacity
|
|
167
|
-
}
|
|
168
|
-
this.transform = transform
|
|
169
|
-
// 确保动态样式已经生效后,执行动画,如果不加 nextTick ,会导致 wx 动画执行异常
|
|
170
|
-
this.$nextTick(() => {
|
|
171
|
-
// TODO 定时器保证动画完全执行,目前有些问题,后面会取消定时器
|
|
172
|
-
this.timer = setTimeout(() => {
|
|
173
|
-
this.animation = createAnimation(this.config, this)
|
|
174
|
-
this.tranfromInit(false).step()
|
|
175
|
-
this.animation.run()
|
|
176
|
-
this.$emit('change', {
|
|
177
|
-
detail: this.isShow
|
|
178
|
-
})
|
|
179
|
-
}, 20)
|
|
180
|
-
})
|
|
181
|
-
},
|
|
182
|
-
// 关闭过度动画
|
|
183
|
-
close(type) {
|
|
184
|
-
if (!this.animation) return
|
|
185
|
-
this.tranfromInit(true)
|
|
186
|
-
.step()
|
|
187
|
-
.run(() => {
|
|
188
|
-
this.isShow = false
|
|
189
|
-
this.animationData = null
|
|
190
|
-
this.animation = null
|
|
191
|
-
let {
|
|
192
|
-
opacity,
|
|
193
|
-
transform
|
|
194
|
-
} = this.styleInit(false)
|
|
195
|
-
this.opacity = opacity || 1
|
|
196
|
-
this.transform = transform
|
|
197
|
-
this.$emit('change', {
|
|
198
|
-
detail: this.isShow
|
|
199
|
-
})
|
|
200
|
-
})
|
|
201
|
-
},
|
|
202
|
-
// 处理动画开始前的默认样式
|
|
203
|
-
styleInit(type) {
|
|
204
|
-
let styles = {
|
|
205
|
-
transform: ''
|
|
206
|
-
}
|
|
207
|
-
let buildStyle = (type, mode) => {
|
|
208
|
-
if (mode === 'fade') {
|
|
209
|
-
styles.opacity = this.animationType(type)[mode]
|
|
210
|
-
} else {
|
|
211
|
-
styles.transform += this.animationType(type)[mode] + ' '
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
if (typeof this.modeClass === 'string') {
|
|
215
|
-
buildStyle(type, this.modeClass)
|
|
216
|
-
} else {
|
|
217
|
-
this.modeClass.forEach(mode => {
|
|
218
|
-
buildStyle(type, mode)
|
|
219
|
-
})
|
|
220
|
-
}
|
|
221
|
-
return styles
|
|
222
|
-
},
|
|
223
|
-
// 处理内置组合动画
|
|
224
|
-
tranfromInit(type) {
|
|
225
|
-
let buildTranfrom = (type, mode) => {
|
|
226
|
-
let aniNum = null
|
|
227
|
-
if (mode === 'fade') {
|
|
228
|
-
aniNum = type ? 0 : 1
|
|
229
|
-
} else {
|
|
230
|
-
aniNum = type ? '-100%' : '0'
|
|
231
|
-
if (mode === 'zoom-in') {
|
|
232
|
-
aniNum = type ? 0.8 : 1
|
|
233
|
-
}
|
|
234
|
-
if (mode === 'zoom-out') {
|
|
235
|
-
aniNum = type ? 1.2 : 1
|
|
236
|
-
}
|
|
237
|
-
if (mode === 'slide-right') {
|
|
238
|
-
aniNum = type ? '100%' : '0'
|
|
239
|
-
}
|
|
240
|
-
if (mode === 'slide-bottom') {
|
|
241
|
-
aniNum = type ? '100%' : '0'
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
this.animation[this.animationMode()[mode]](aniNum)
|
|
245
|
-
}
|
|
246
|
-
if (typeof this.modeClass === 'string') {
|
|
247
|
-
buildTranfrom(type, this.modeClass)
|
|
248
|
-
} else {
|
|
249
|
-
this.modeClass.forEach(mode => {
|
|
250
|
-
buildTranfrom(type, mode)
|
|
251
|
-
})
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
return this.animation
|
|
255
|
-
},
|
|
256
|
-
animationType(type) {
|
|
257
|
-
return {
|
|
258
|
-
fade: type ? 1 : 0,
|
|
259
|
-
'slide-top': `translateY(${type ? '0' : '-100%'})`,
|
|
260
|
-
'slide-right': `translateX(${type ? '0' : '100%'})`,
|
|
261
|
-
'slide-bottom': `translateY(${type ? '0' : '100%'})`,
|
|
262
|
-
'slide-left': `translateX(${type ? '0' : '-100%'})`,
|
|
263
|
-
'zoom-in': `scaleX(${type ? 1 : 0.8}) scaleY(${type ? 1 : 0.8})`,
|
|
264
|
-
'zoom-out': `scaleX(${type ? 1 : 1.2}) scaleY(${type ? 1 : 1.2})`
|
|
265
|
-
}
|
|
266
|
-
},
|
|
267
|
-
// 内置动画类型与实际动画对应字典
|
|
268
|
-
animationMode() {
|
|
269
|
-
return {
|
|
270
|
-
fade: 'opacity',
|
|
271
|
-
'slide-top': 'translateY',
|
|
272
|
-
'slide-right': 'translateX',
|
|
273
|
-
'slide-bottom': 'translateY',
|
|
274
|
-
'slide-left': 'translateX',
|
|
275
|
-
'zoom-in': 'scale',
|
|
276
|
-
'zoom-out': 'scale'
|
|
277
|
-
}
|
|
278
|
-
},
|
|
279
|
-
// 驼峰转中横线
|
|
280
|
-
toLine(name) {
|
|
281
|
-
return name.replace(/([A-Z])/g, '-$1').toLowerCase()
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
</script>
|
|
286
|
-
|
|
287
|
-
<style scoped></style>
|