@vtj/materials 0.13.15 → 0.13.17
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/dist/assets/antdv/index.umd.js +2 -2
- package/dist/assets/charts/index.umd.js +2 -2
- package/dist/assets/element/index.umd.js +3 -3
- package/dist/assets/icons/index.umd.js +2 -2
- package/dist/assets/ui/index.umd.js +2 -2
- package/dist/assets/uni-h5/index.umd.js +2 -2
- package/dist/assets/uni-ui/index.umd.js +2 -2
- package/dist/assets/vant/index.umd.js +2 -2
- package/dist/deps/@vtj/charts/index.umd.js +2 -2
- package/dist/deps/@vtj/icons/index.umd.js +2 -2
- package/dist/deps/@vtj/ui/index.umd.js +4 -4
- package/dist/deps/@vtj/ui/style.css +1 -1
- package/dist/deps/@vtj/utils/index.umd.js +28 -33
- package/dist/deps/@vueuse/core/index.iife.min.js +1 -1
- package/dist/deps/element-plus/index.css +1 -1
- package/dist/deps/element-plus/index.full.min.js +14 -14
- package/dist/deps/element-plus/zh-cn.js +1 -1
- package/dist/deps/uni-app/index.umd.js +1 -1
- package/dist/deps/uni-h5/index.umd.js +8 -8
- package/dist/deps/uni-h5/style.css +1 -1
- package/dist/deps/uni-h5-vue/index.umd.js +1 -1
- package/dist/deps/uni-ui/index.umd.js +6 -1
- package/dist/deps/uni-ui/style.css +1 -1
- package/dist/deps/vue/vue.global.js +88 -53
- package/dist/deps/vue/vue.global.prod.js +9 -9
- package/package.json +12 -12
- package/src/antdv/image.ts +1 -1
- package/src/element/image.ts +1 -1
- package/src/element/virtualizedTable.ts +6 -6
- package/src/manifest.json +69 -0
- package/src/pages/index.vue +2 -0
- package/src/pages.json +19 -0
- package/src/uni-ui/index.ts +88 -58
- package/src/{uni-ui/lib/uni.scss → uni.scss} +4 -0
- package/src/version.ts +2 -2
- package/src/uni-ui/lib/uni-col/uni-col.vue +0 -324
- package/src/uni-ui/lib/uni-collapse/uni-collapse.vue +0 -153
- package/src/uni-ui/lib/uni-collapse-item/uni-collapse-item.vue +0 -425
- package/src/uni-ui/lib/uni-data-picker/keypress.js +0 -45
- package/src/uni-ui/lib/uni-data-picker/uni-data-picker.vue +0 -604
- package/src/uni-ui/lib/uni-data-pickerview/uni-data-picker.js +0 -622
- package/src/uni-ui/lib/uni-data-pickerview/uni-data-pickerview.css +0 -76
- package/src/uni-ui/lib/uni-data-pickerview/uni-data-pickerview.vue +0 -335
- package/src/uni-ui/lib/uni-data-select/uni-data-select.vue +0 -590
- package/src/uni-ui/lib/uni-datetime-picker/calendar-item.vue +0 -188
- package/src/uni-ui/lib/uni-datetime-picker/calendar.vue +0 -985
- package/src/uni-ui/lib/uni-datetime-picker/i18n/en.json +0 -22
- package/src/uni-ui/lib/uni-datetime-picker/i18n/index.js +0 -8
- package/src/uni-ui/lib/uni-datetime-picker/i18n/zh-Hans.json +0 -22
- package/src/uni-ui/lib/uni-datetime-picker/i18n/zh-Hant.json +0 -22
- package/src/uni-ui/lib/uni-datetime-picker/time-picker.vue +0 -1032
- package/src/uni-ui/lib/uni-datetime-picker/uni-datetime-picker.vue +0 -1230
- package/src/uni-ui/lib/uni-datetime-picker/util.js +0 -448
- package/src/uni-ui/lib/uni-easyinput/common.js +0 -54
- package/src/uni-ui/lib/uni-easyinput/uni-easyinput.vue +0 -790
- package/src/uni-ui/lib/uni-fav/i18n/en.json +0 -4
- package/src/uni-ui/lib/uni-fav/i18n/index.js +0 -8
- package/src/uni-ui/lib/uni-fav/i18n/zh-Hans.json +0 -4
- package/src/uni-ui/lib/uni-fav/i18n/zh-Hant.json +0 -4
- package/src/uni-ui/lib/uni-fav/uni-fav.vue +0 -170
- package/src/uni-ui/lib/uni-file-picker/choose-and-upload-file.js +0 -280
- package/src/uni-ui/lib/uni-file-picker/uni-file-picker.vue +0 -668
- package/src/uni-ui/lib/uni-file-picker/upload-file.vue +0 -325
- package/src/uni-ui/lib/uni-file-picker/upload-image.vue +0 -292
- package/src/uni-ui/lib/uni-file-picker/utils.js +0 -110
- package/src/uni-ui/lib/uni-forms/uni-forms.vue +0 -416
- package/src/uni-ui/lib/uni-forms/utils.js +0 -293
- package/src/uni-ui/lib/uni-forms/validate.js +0 -486
- package/src/uni-ui/lib/uni-forms-item/uni-forms-item.vue +0 -630
- package/src/uni-ui/lib/uni-goods-nav/i18n/en.json +0 -6
- package/src/uni-ui/lib/uni-goods-nav/i18n/index.js +0 -8
- package/src/uni-ui/lib/uni-goods-nav/i18n/zh-Hans.json +0 -6
- package/src/uni-ui/lib/uni-goods-nav/i18n/zh-Hant.json +0 -6
- package/src/uni-ui/lib/uni-goods-nav/uni-goods-nav.vue +0 -231
- package/src/uni-ui/lib/uni-grid/uni-grid.vue +0 -148
- package/src/uni-ui/lib/uni-icons/uni-icons.uvue +0 -91
- package/src/uni-ui/lib/uni-icons/uni-icons.vue +0 -114
- package/src/uni-ui/lib/uni-icons/uniicons.css +0 -664
- package/src/uni-ui/lib/uni-icons/uniicons.ttf +0 -0
- package/src/uni-ui/lib/uni-icons/uniicons_file.ts +0 -664
- package/src/uni-ui/lib/uni-icons/uniicons_file_vue.js +0 -649
- package/src/uni-ui/lib/uni-indexed-list/uni-indexed-list-item.vue +0 -168
- package/src/uni-ui/lib/uni-indexed-list/uni-indexed-list.vue +0 -404
- package/src/uni-ui/lib/uni-list/uni-list.vue +0 -123
- package/src/uni-ui/lib/uni-list/uni-refresh.vue +0 -65
- package/src/uni-ui/lib/uni-list/uni-refresh.wxs +0 -87
- package/src/uni-ui/lib/uni-load-more/i18n/en.json +0 -5
- package/src/uni-ui/lib/uni-load-more/i18n/index.js +0 -8
- package/src/uni-ui/lib/uni-load-more/i18n/zh-Hans.json +0 -5
- package/src/uni-ui/lib/uni-load-more/i18n/zh-Hant.json +0 -5
- package/src/uni-ui/lib/uni-load-more/uni-load-more.vue +0 -456
- package/src/uni-ui/lib/uni-notice-bar/uni-notice-bar.vue +0 -484
- package/src/uni-ui/lib/uni-popup/i18n/en.json +0 -7
- package/src/uni-ui/lib/uni-popup/i18n/index.js +0 -8
- package/src/uni-ui/lib/uni-popup/i18n/zh-Hans.json +0 -7
- package/src/uni-ui/lib/uni-popup/i18n/zh-Hant.json +0 -7
- package/src/uni-ui/lib/uni-popup/keypress.js +0 -45
- package/src/uni-ui/lib/uni-popup/popup.js +0 -26
- package/src/uni-ui/lib/uni-popup/uni-popup.uvue +0 -90
- package/src/uni-ui/lib/uni-popup/uni-popup.vue +0 -552
- package/src/uni-ui/lib/uni-popup-dialog/keypress.js +0 -45
- package/src/uni-ui/lib/uni-popup-dialog/uni-popup-dialog.vue +0 -324
- package/src/uni-ui/lib/uni-popup-message/uni-popup-message.vue +0 -149
- package/src/uni-ui/lib/uni-rate/uni-rate.vue +0 -380
- package/src/uni-ui/lib/uni-row/uni-row.vue +0 -193
- package/src/uni-ui/lib/uni-search-bar/i18n/en.json +0 -4
- package/src/uni-ui/lib/uni-search-bar/i18n/index.js +0 -8
- package/src/uni-ui/lib/uni-search-bar/i18n/zh-Hans.json +0 -4
- package/src/uni-ui/lib/uni-search-bar/i18n/zh-Hant.json +0 -4
- package/src/uni-ui/lib/uni-search-bar/uni-search-bar.vue +0 -339
- package/src/uni-ui/lib/uni-swipe-action-item/bindingx.js +0 -311
- package/src/uni-ui/lib/uni-swipe-action-item/isPC.js +0 -12
- package/src/uni-ui/lib/uni-swipe-action-item/mpalipay.js +0 -195
- package/src/uni-ui/lib/uni-swipe-action-item/mpother.js +0 -260
- package/src/uni-ui/lib/uni-swipe-action-item/mpwxs.js +0 -84
- package/src/uni-ui/lib/uni-swipe-action-item/render.js +0 -270
- package/src/uni-ui/lib/uni-swipe-action-item/uni-swipe-action-item.vue +0 -493
- package/src/uni-ui/lib/uni-swipe-action-item/wx.wxs +0 -341
- package/src/uni-ui/lib/uni-table/uni-table.vue +0 -496
- package/src/uni-ui/lib/uni-td/uni-td.vue +0 -99
- package/src/uni-ui/lib/uni-th/filter-dropdown.vue +0 -559
- package/src/uni-ui/lib/uni-th/uni-th.vue +0 -322
- package/src/uni-ui/lib/uni-tr/table-checkbox.vue +0 -181
- package/src/uni-ui/lib/uni-tr/uni-tr.vue +0 -208
- package/src/uni-ui/lib/uni-transition/createAnimation.js +0 -131
- package/src/uni-ui/lib/uni-transition/uni-transition.vue +0 -310
- package/src/uni-ui/polyfill.ts +0 -41
@@ -1,496 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<view
|
3
|
-
class="uni-table-scroll"
|
4
|
-
:class="{ 'table--border': border, 'border-none': !noData }">
|
5
|
-
<!-- #ifdef H5 -->
|
6
|
-
<table
|
7
|
-
class="uni-table"
|
8
|
-
border="0"
|
9
|
-
cellpadding="0"
|
10
|
-
cellspacing="0"
|
11
|
-
:class="{ 'table--stripe': stripe }"
|
12
|
-
:style="{ 'min-width': minWidth + 'px' }">
|
13
|
-
<slot></slot>
|
14
|
-
<tr v-if="noData" class="uni-table-loading">
|
15
|
-
<td class="uni-table-text" :class="{ 'empty-border': border }">
|
16
|
-
{{ emptyText }}
|
17
|
-
</td>
|
18
|
-
</tr>
|
19
|
-
<view
|
20
|
-
v-if="loading"
|
21
|
-
class="uni-table-mask"
|
22
|
-
:class="{ 'empty-border': border }"
|
23
|
-
><div class="uni-table--loader"></div
|
24
|
-
></view>
|
25
|
-
</table>
|
26
|
-
<!-- #endif -->
|
27
|
-
<!-- #ifndef H5 -->
|
28
|
-
<!-- <view class="uni-table" :style="{ 'min-width': minWidth + 'px' }" :class="{ 'table--stripe': stripe }">
|
29
|
-
<slot></slot>
|
30
|
-
<view v-if="noData" class="uni-table-loading">
|
31
|
-
<view class="uni-table-text" :class="{ 'empty-border': border }">{{ emptyText }}</view>
|
32
|
-
</view>
|
33
|
-
<view v-if="loading" class="uni-table-mask" :class="{ 'empty-border': border }"><div class="uni-table--loader"></div></view>
|
34
|
-
</view> -->
|
35
|
-
<!-- #endif -->
|
36
|
-
</view>
|
37
|
-
</template>
|
38
|
-
|
39
|
-
<script>
|
40
|
-
/**
|
41
|
-
* Table 表格
|
42
|
-
* @description 用于展示多条结构类似的数据
|
43
|
-
* @tutorial https://ext.dcloud.net.cn/plugin?id=3270
|
44
|
-
* @property {Boolean} border 是否带有纵向边框
|
45
|
-
* @property {Boolean} stripe 是否显示斑马线
|
46
|
-
* @property {Boolean} type 是否开启多选
|
47
|
-
* @property {String} emptyText 空数据时显示的文本内容
|
48
|
-
* @property {Boolean} loading 显示加载中
|
49
|
-
* @event {Function} selection-change 开启多选时,当选择项发生变化时会触发该事件
|
50
|
-
*/
|
51
|
-
export default {
|
52
|
-
name: 'uniTable',
|
53
|
-
options: {
|
54
|
-
// #ifdef MP-TOUTIAO
|
55
|
-
virtualHost: false,
|
56
|
-
// #endif
|
57
|
-
// #ifndef MP-TOUTIAO
|
58
|
-
virtualHost: true
|
59
|
-
// #endif
|
60
|
-
},
|
61
|
-
emits: ['selection-change'],
|
62
|
-
props: {
|
63
|
-
data: {
|
64
|
-
type: Array,
|
65
|
-
default() {
|
66
|
-
return [];
|
67
|
-
}
|
68
|
-
},
|
69
|
-
// 是否有竖线
|
70
|
-
border: {
|
71
|
-
type: Boolean,
|
72
|
-
default: false
|
73
|
-
},
|
74
|
-
// 是否显示斑马线
|
75
|
-
stripe: {
|
76
|
-
type: Boolean,
|
77
|
-
default: false
|
78
|
-
},
|
79
|
-
// 多选
|
80
|
-
type: {
|
81
|
-
type: String,
|
82
|
-
default: ''
|
83
|
-
},
|
84
|
-
// 没有更多数据
|
85
|
-
emptyText: {
|
86
|
-
type: String,
|
87
|
-
default: '没有更多数据'
|
88
|
-
},
|
89
|
-
loading: {
|
90
|
-
type: Boolean,
|
91
|
-
default: false
|
92
|
-
},
|
93
|
-
rowKey: {
|
94
|
-
type: String,
|
95
|
-
default: ''
|
96
|
-
}
|
97
|
-
},
|
98
|
-
data() {
|
99
|
-
return {
|
100
|
-
noData: true,
|
101
|
-
minWidth: 0,
|
102
|
-
multiTableHeads: []
|
103
|
-
};
|
104
|
-
},
|
105
|
-
watch: {
|
106
|
-
loading(val) {},
|
107
|
-
data(newVal) {
|
108
|
-
let theadChildren = this.theadChildren;
|
109
|
-
let rowspan = 1;
|
110
|
-
if (this.theadChildren) {
|
111
|
-
rowspan = this.theadChildren.rowspan;
|
112
|
-
}
|
113
|
-
|
114
|
-
// this.trChildren.length - rowspan
|
115
|
-
this.noData = false;
|
116
|
-
// this.noData = newVal.length === 0
|
117
|
-
}
|
118
|
-
},
|
119
|
-
created() {
|
120
|
-
// 定义tr的实例数组
|
121
|
-
this.trChildren = [];
|
122
|
-
this.thChildren = [];
|
123
|
-
this.theadChildren = null;
|
124
|
-
this.backData = [];
|
125
|
-
this.backIndexData = [];
|
126
|
-
},
|
127
|
-
|
128
|
-
methods: {
|
129
|
-
isNodata() {
|
130
|
-
let theadChildren = this.theadChildren;
|
131
|
-
let rowspan = 1;
|
132
|
-
if (this.theadChildren) {
|
133
|
-
rowspan = this.theadChildren.rowspan;
|
134
|
-
}
|
135
|
-
this.noData = this.trChildren.length - rowspan <= 0;
|
136
|
-
},
|
137
|
-
/**
|
138
|
-
* 选中所有
|
139
|
-
*/
|
140
|
-
selectionAll() {
|
141
|
-
let startIndex = 1;
|
142
|
-
let theadChildren = this.theadChildren;
|
143
|
-
if (!this.theadChildren) {
|
144
|
-
theadChildren = this.trChildren[0];
|
145
|
-
} else {
|
146
|
-
startIndex = theadChildren.rowspan - 1;
|
147
|
-
}
|
148
|
-
let isHaveData = this.data && this.data.length > 0;
|
149
|
-
theadChildren.checked = true;
|
150
|
-
theadChildren.indeterminate = false;
|
151
|
-
this.trChildren.forEach((item, index) => {
|
152
|
-
if (!item.disabled) {
|
153
|
-
item.checked = true;
|
154
|
-
if (isHaveData && item.keyValue) {
|
155
|
-
const row = this.data.find(
|
156
|
-
(v) => v[this.rowKey] === item.keyValue
|
157
|
-
);
|
158
|
-
if (
|
159
|
-
!this.backData.find((v) => v[this.rowKey] === row[this.rowKey])
|
160
|
-
) {
|
161
|
-
this.backData.push(row);
|
162
|
-
}
|
163
|
-
}
|
164
|
-
if (
|
165
|
-
index > startIndex - 1 &&
|
166
|
-
this.backIndexData.indexOf(index - startIndex) === -1
|
167
|
-
) {
|
168
|
-
this.backIndexData.push(index - startIndex);
|
169
|
-
}
|
170
|
-
}
|
171
|
-
});
|
172
|
-
// this.backData = JSON.parse(JSON.stringify(this.data))
|
173
|
-
this.$emit('selection-change', {
|
174
|
-
detail: {
|
175
|
-
value: this.backData,
|
176
|
-
index: this.backIndexData
|
177
|
-
}
|
178
|
-
});
|
179
|
-
},
|
180
|
-
/**
|
181
|
-
* 用于多选表格,切换某一行的选中状态,如果使用了第二个参数,则是设置这一行选中与否(selected 为 true 则选中)
|
182
|
-
*/
|
183
|
-
toggleRowSelection(row, selected) {
|
184
|
-
// if (!this.theadChildren) return
|
185
|
-
row = [].concat(row);
|
186
|
-
|
187
|
-
this.trChildren.forEach((item, index) => {
|
188
|
-
// if (item.keyValue) {
|
189
|
-
|
190
|
-
const select = row.findIndex((v) => {
|
191
|
-
//
|
192
|
-
if (typeof v === 'number') {
|
193
|
-
return v === index - 1;
|
194
|
-
} else {
|
195
|
-
return v[this.rowKey] === item.keyValue;
|
196
|
-
}
|
197
|
-
});
|
198
|
-
let ischeck = item.checked;
|
199
|
-
if (select !== -1) {
|
200
|
-
if (typeof selected === 'boolean') {
|
201
|
-
item.checked = selected;
|
202
|
-
} else {
|
203
|
-
item.checked = !item.checked;
|
204
|
-
}
|
205
|
-
if (ischeck !== item.checked) {
|
206
|
-
this.check(
|
207
|
-
item.rowData || item,
|
208
|
-
item.checked,
|
209
|
-
item.rowData ? item.keyValue : null,
|
210
|
-
true
|
211
|
-
);
|
212
|
-
}
|
213
|
-
}
|
214
|
-
// }
|
215
|
-
});
|
216
|
-
this.$emit('selection-change', {
|
217
|
-
detail: {
|
218
|
-
value: this.backData,
|
219
|
-
index: this.backIndexData
|
220
|
-
}
|
221
|
-
});
|
222
|
-
},
|
223
|
-
|
224
|
-
/**
|
225
|
-
* 用于多选表格,清空用户的选择
|
226
|
-
*/
|
227
|
-
clearSelection() {
|
228
|
-
let theadChildren = this.theadChildren;
|
229
|
-
if (!this.theadChildren) {
|
230
|
-
theadChildren = this.trChildren[0];
|
231
|
-
}
|
232
|
-
// if (!this.theadChildren) return
|
233
|
-
theadChildren.checked = false;
|
234
|
-
theadChildren.indeterminate = false;
|
235
|
-
this.trChildren.forEach((item) => {
|
236
|
-
// if (item.keyValue) {
|
237
|
-
item.checked = false;
|
238
|
-
// }
|
239
|
-
});
|
240
|
-
this.backData = [];
|
241
|
-
this.backIndexData = [];
|
242
|
-
this.$emit('selection-change', {
|
243
|
-
detail: {
|
244
|
-
value: [],
|
245
|
-
index: []
|
246
|
-
}
|
247
|
-
});
|
248
|
-
},
|
249
|
-
/**
|
250
|
-
* 用于多选表格,切换所有行的选中状态
|
251
|
-
*/
|
252
|
-
toggleAllSelection() {
|
253
|
-
let list = [];
|
254
|
-
let startIndex = 1;
|
255
|
-
let theadChildren = this.theadChildren;
|
256
|
-
if (!this.theadChildren) {
|
257
|
-
theadChildren = this.trChildren[0];
|
258
|
-
} else {
|
259
|
-
startIndex = theadChildren.rowspan - 1;
|
260
|
-
}
|
261
|
-
this.trChildren.forEach((item, index) => {
|
262
|
-
if (!item.disabled) {
|
263
|
-
if (index > startIndex - 1) {
|
264
|
-
list.push(index - startIndex);
|
265
|
-
}
|
266
|
-
}
|
267
|
-
});
|
268
|
-
this.toggleRowSelection(list);
|
269
|
-
},
|
270
|
-
|
271
|
-
/**
|
272
|
-
* 选中\取消选中
|
273
|
-
* @param {Object} child
|
274
|
-
* @param {Object} check
|
275
|
-
* @param {Object} rowValue
|
276
|
-
*/
|
277
|
-
check(child, check, keyValue, emit) {
|
278
|
-
let theadChildren = this.theadChildren;
|
279
|
-
if (!this.theadChildren) {
|
280
|
-
theadChildren = this.trChildren[0];
|
281
|
-
}
|
282
|
-
|
283
|
-
let childDomIndex = this.trChildren.findIndex(
|
284
|
-
(item, index) => child === item
|
285
|
-
);
|
286
|
-
if (childDomIndex < 0) {
|
287
|
-
childDomIndex =
|
288
|
-
this.data.findIndex((v) => v[this.rowKey] === keyValue) + 1;
|
289
|
-
}
|
290
|
-
const dataLen = this.trChildren.filter(
|
291
|
-
(v) => !v.disabled && v.keyValue
|
292
|
-
).length;
|
293
|
-
if (childDomIndex === 0) {
|
294
|
-
check ? this.selectionAll() : this.clearSelection();
|
295
|
-
return;
|
296
|
-
}
|
297
|
-
|
298
|
-
if (check) {
|
299
|
-
if (keyValue) {
|
300
|
-
this.backData.push(child);
|
301
|
-
}
|
302
|
-
this.backIndexData.push(childDomIndex - 1);
|
303
|
-
} else {
|
304
|
-
const index = this.backData.findIndex(
|
305
|
-
(v) => v[this.rowKey] === keyValue
|
306
|
-
);
|
307
|
-
const idx = this.backIndexData.findIndex(
|
308
|
-
(item) => item === childDomIndex - 1
|
309
|
-
);
|
310
|
-
if (keyValue) {
|
311
|
-
this.backData.splice(index, 1);
|
312
|
-
}
|
313
|
-
this.backIndexData.splice(idx, 1);
|
314
|
-
}
|
315
|
-
|
316
|
-
const domCheckAll = this.trChildren.find(
|
317
|
-
(item, index) => index > 0 && !item.checked && !item.disabled
|
318
|
-
);
|
319
|
-
if (!domCheckAll) {
|
320
|
-
theadChildren.indeterminate = false;
|
321
|
-
theadChildren.checked = true;
|
322
|
-
} else {
|
323
|
-
theadChildren.indeterminate = true;
|
324
|
-
theadChildren.checked = false;
|
325
|
-
}
|
326
|
-
|
327
|
-
if (this.backIndexData.length === 0) {
|
328
|
-
theadChildren.indeterminate = false;
|
329
|
-
}
|
330
|
-
|
331
|
-
if (!emit) {
|
332
|
-
this.$emit('selection-change', {
|
333
|
-
detail: {
|
334
|
-
value: this.backData,
|
335
|
-
index: this.backIndexData
|
336
|
-
}
|
337
|
-
});
|
338
|
-
}
|
339
|
-
}
|
340
|
-
}
|
341
|
-
};
|
342
|
-
</script>
|
343
|
-
|
344
|
-
<style lang="scss">
|
345
|
-
$border-color: #ebeef5;
|
346
|
-
|
347
|
-
.uni-table-scroll {
|
348
|
-
width: 100%;
|
349
|
-
/* #ifndef APP-NVUE */
|
350
|
-
overflow-x: auto;
|
351
|
-
/* #endif */
|
352
|
-
}
|
353
|
-
|
354
|
-
.uni-table {
|
355
|
-
position: relative;
|
356
|
-
width: 100%;
|
357
|
-
border-radius: 5px;
|
358
|
-
// box-shadow: 0px 0px 3px 1px rgba(0, 0, 0, 0.1);
|
359
|
-
background-color: #fff;
|
360
|
-
/* #ifndef APP-NVUE */
|
361
|
-
box-sizing: border-box;
|
362
|
-
display: table;
|
363
|
-
overflow-x: auto;
|
364
|
-
::v-deep .uni-table-tr:nth-child(n + 2) {
|
365
|
-
&:hover {
|
366
|
-
background-color: #f5f7fa;
|
367
|
-
}
|
368
|
-
}
|
369
|
-
::v-deep .uni-table-thead {
|
370
|
-
.uni-table-tr {
|
371
|
-
// background-color: #f5f7fa;
|
372
|
-
&:hover {
|
373
|
-
background-color: #fafafa;
|
374
|
-
}
|
375
|
-
}
|
376
|
-
}
|
377
|
-
/* #endif */
|
378
|
-
}
|
379
|
-
|
380
|
-
.table--border {
|
381
|
-
border: 1px $border-color solid;
|
382
|
-
border-right: none;
|
383
|
-
}
|
384
|
-
|
385
|
-
.border-none {
|
386
|
-
/* #ifndef APP-NVUE */
|
387
|
-
border-bottom: none;
|
388
|
-
/* #endif */
|
389
|
-
}
|
390
|
-
|
391
|
-
.table--stripe {
|
392
|
-
/* #ifndef APP-NVUE */
|
393
|
-
::v-deep .uni-table-tr:nth-child(2n + 3) {
|
394
|
-
background-color: #fafafa;
|
395
|
-
}
|
396
|
-
/* #endif */
|
397
|
-
}
|
398
|
-
|
399
|
-
/* 表格加载、无数据样式 */
|
400
|
-
.uni-table-loading {
|
401
|
-
position: relative;
|
402
|
-
/* #ifndef APP-NVUE */
|
403
|
-
display: table-row;
|
404
|
-
/* #endif */
|
405
|
-
height: 50px;
|
406
|
-
line-height: 50px;
|
407
|
-
overflow: hidden;
|
408
|
-
box-sizing: border-box;
|
409
|
-
}
|
410
|
-
.empty-border {
|
411
|
-
border-right: 1px $border-color solid;
|
412
|
-
}
|
413
|
-
.uni-table-text {
|
414
|
-
position: absolute;
|
415
|
-
right: 0;
|
416
|
-
left: 0;
|
417
|
-
text-align: center;
|
418
|
-
font-size: 14px;
|
419
|
-
color: #999;
|
420
|
-
}
|
421
|
-
|
422
|
-
.uni-table-mask {
|
423
|
-
position: absolute;
|
424
|
-
top: 0;
|
425
|
-
bottom: 0;
|
426
|
-
left: 0;
|
427
|
-
right: 0;
|
428
|
-
background-color: rgba(255, 255, 255, 0.8);
|
429
|
-
z-index: 99;
|
430
|
-
/* #ifndef APP-NVUE */
|
431
|
-
display: flex;
|
432
|
-
margin: auto;
|
433
|
-
transition: all 0.5s;
|
434
|
-
/* #endif */
|
435
|
-
justify-content: center;
|
436
|
-
align-items: center;
|
437
|
-
}
|
438
|
-
|
439
|
-
.uni-table--loader {
|
440
|
-
width: 30px;
|
441
|
-
height: 30px;
|
442
|
-
border: 2px solid #aaa;
|
443
|
-
// border-bottom-color: transparent;
|
444
|
-
border-radius: 50%;
|
445
|
-
/* #ifndef APP-NVUE */
|
446
|
-
animation: 2s uni-table--loader linear infinite;
|
447
|
-
/* #endif */
|
448
|
-
position: relative;
|
449
|
-
}
|
450
|
-
|
451
|
-
@keyframes uni-table--loader {
|
452
|
-
0% {
|
453
|
-
transform: rotate(360deg);
|
454
|
-
}
|
455
|
-
|
456
|
-
10% {
|
457
|
-
border-left-color: transparent;
|
458
|
-
}
|
459
|
-
|
460
|
-
20% {
|
461
|
-
border-bottom-color: transparent;
|
462
|
-
}
|
463
|
-
|
464
|
-
30% {
|
465
|
-
border-right-color: transparent;
|
466
|
-
}
|
467
|
-
|
468
|
-
40% {
|
469
|
-
border-top-color: transparent;
|
470
|
-
}
|
471
|
-
|
472
|
-
50% {
|
473
|
-
transform: rotate(0deg);
|
474
|
-
}
|
475
|
-
|
476
|
-
60% {
|
477
|
-
border-top-color: transparent;
|
478
|
-
}
|
479
|
-
|
480
|
-
70% {
|
481
|
-
border-left-color: transparent;
|
482
|
-
}
|
483
|
-
|
484
|
-
80% {
|
485
|
-
border-bottom-color: transparent;
|
486
|
-
}
|
487
|
-
|
488
|
-
90% {
|
489
|
-
border-right-color: transparent;
|
490
|
-
}
|
491
|
-
|
492
|
-
100% {
|
493
|
-
transform: rotate(-360deg);
|
494
|
-
}
|
495
|
-
}
|
496
|
-
</style>
|
@@ -1,99 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<!-- #ifdef H5 -->
|
3
|
-
<td
|
4
|
-
class="uni-table-td"
|
5
|
-
:rowspan="rowspan"
|
6
|
-
:colspan="colspan"
|
7
|
-
:class="{ 'table--border': border }"
|
8
|
-
:style="{ width: width + 'px', 'text-align': align }">
|
9
|
-
<slot></slot>
|
10
|
-
</td>
|
11
|
-
<!-- #endif -->
|
12
|
-
<!-- #ifndef H5 -->
|
13
|
-
<!-- :class="{'table--border':border}" -->
|
14
|
-
<!-- <view class="uni-table-td" :class="{'table--border':border}" :style="{width:width + 'px','text-align':align}">
|
15
|
-
<slot></slot>
|
16
|
-
</view> -->
|
17
|
-
<!-- #endif -->
|
18
|
-
</template>
|
19
|
-
|
20
|
-
<script>
|
21
|
-
/**
|
22
|
-
* Td 单元格
|
23
|
-
* @description 表格中的标准单元格组件
|
24
|
-
* @tutorial https://ext.dcloud.net.cn/plugin?id=3270
|
25
|
-
* @property {Number} align = [left|center|right] 单元格对齐方式
|
26
|
-
*/
|
27
|
-
export default {
|
28
|
-
name: 'uniTd',
|
29
|
-
options: {
|
30
|
-
// #ifdef MP-TOUTIAO
|
31
|
-
virtualHost: false,
|
32
|
-
// #endif
|
33
|
-
// #ifndef MP-TOUTIAO
|
34
|
-
virtualHost: true
|
35
|
-
// #endif
|
36
|
-
},
|
37
|
-
props: {
|
38
|
-
width: {
|
39
|
-
type: [String, Number],
|
40
|
-
default: ''
|
41
|
-
},
|
42
|
-
align: {
|
43
|
-
type: String,
|
44
|
-
default: 'left'
|
45
|
-
},
|
46
|
-
rowspan: {
|
47
|
-
type: [Number, String],
|
48
|
-
default: 1
|
49
|
-
},
|
50
|
-
colspan: {
|
51
|
-
type: [Number, String],
|
52
|
-
default: 1
|
53
|
-
}
|
54
|
-
},
|
55
|
-
data() {
|
56
|
-
return {
|
57
|
-
border: false
|
58
|
-
};
|
59
|
-
},
|
60
|
-
created() {
|
61
|
-
this.root = this.getTable();
|
62
|
-
this.border = this.root.border;
|
63
|
-
},
|
64
|
-
methods: {
|
65
|
-
/**
|
66
|
-
* 获取父元素实例
|
67
|
-
*/
|
68
|
-
getTable() {
|
69
|
-
let parent = this.$parent;
|
70
|
-
let parentName = parent.$options.name;
|
71
|
-
while (parentName !== 'uniTable') {
|
72
|
-
parent = parent.$parent;
|
73
|
-
if (!parent) return false;
|
74
|
-
parentName = parent.$options.name;
|
75
|
-
}
|
76
|
-
return parent;
|
77
|
-
}
|
78
|
-
}
|
79
|
-
};
|
80
|
-
</script>
|
81
|
-
|
82
|
-
<style lang="scss">
|
83
|
-
$border-color: #ebeef5;
|
84
|
-
|
85
|
-
.uni-table-td {
|
86
|
-
display: table-cell;
|
87
|
-
padding: 8px 10px;
|
88
|
-
font-size: 14px;
|
89
|
-
border-bottom: 1px $border-color solid;
|
90
|
-
font-weight: 400;
|
91
|
-
color: #606266;
|
92
|
-
line-height: 23px;
|
93
|
-
box-sizing: border-box;
|
94
|
-
}
|
95
|
-
|
96
|
-
.table--border {
|
97
|
-
border-right: 1px $border-color solid;
|
98
|
-
}
|
99
|
-
</style>
|