@kyfe/hroa-ui 1.0.4 → 1.0.6
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/hroa-ui.common.js +5345 -271
- package/dist/hroa-ui.css +1 -1
- package/dist/hroa-ui.umd.js +5345 -271
- package/dist/hroa-ui.umd.min.js +2 -2
- package/dist/img/header.7e31b1d5.png +0 -0
- package/lib/getJsModule/index.css +1 -1
- package/lib/getJsModule/index.js +2 -2
- package/lib/hr-add-list/index.js +1 -1
- package/lib/hr-bottom-button/index.js +1 -1
- package/lib/hr-breadcrumb/index.js +1 -1
- package/lib/hr-button/index.js +1 -1
- package/lib/hr-checkbox/index.css +1 -0
- package/lib/hr-checkbox/index.js +1 -0
- package/lib/hr-checkbox-group/index.css +1 -0
- package/lib/hr-checkbox-group/index.js +1 -0
- package/lib/hr-clipboard/index.js +1 -1
- package/lib/hr-collapse-card/index.css +1 -0
- package/lib/hr-collapse-card/index.js +1 -0
- package/lib/hr-condition-filtrate/index.js +1 -1
- package/lib/hr-condition-filtrate-popup/index.js +1 -1
- package/lib/hr-date-filter/index.css +1 -0
- package/lib/hr-date-filter/index.js +1 -0
- package/lib/hr-dropdown-date/index.css +1 -0
- package/lib/hr-dropdown-date/index.js +1 -0
- package/lib/hr-elasticity-box/index.js +1 -1
- package/lib/hr-elasticity-box-item/index.js +1 -1
- package/lib/hr-emotional-picture/index.js +1 -1
- package/lib/hr-employee-choose/index.js +1 -1
- package/lib/hr-file-list/index.css +1 -1
- package/lib/hr-file-list/index.js +1 -1
- package/lib/hr-full-screen/index.css +1 -0
- package/lib/hr-full-screen/index.js +1 -0
- package/lib/hr-img-list/index.js +1 -1
- package/lib/hr-info-card/index.js +1 -1
- package/lib/hr-information/index.css +1 -1
- package/lib/hr-information/index.js +1 -1
- package/lib/hr-license-plate-number/index.js +1 -1
- package/lib/hr-module-card/index.js +1 -1
- package/lib/hr-multiterm-choose/index.css +1 -1
- package/lib/hr-multiterm-choose/index.js +1 -1
- package/lib/hr-no-data/index.js +1 -1
- package/lib/hr-notice-bar/index.js +1 -1
- package/lib/hr-notification-dialog/index.css +1 -0
- package/lib/hr-notification-dialog/index.js +1 -0
- package/lib/hr-open-ks/index.js +1 -1
- package/lib/hr-pager/index.css +1 -1
- package/lib/hr-pager/index.js +1 -1
- package/lib/hr-popup/index.js +1 -1
- package/lib/hr-preview-file/index.js +1 -1
- package/lib/hr-radiobox/index.css +1 -0
- package/lib/hr-radiobox/index.js +1 -0
- package/lib/hr-radiobox-group/index.css +1 -0
- package/lib/hr-radiobox-group/index.js +1 -0
- package/lib/hr-rate/index.js +1 -1
- package/lib/hr-reason-textarea/index.js +1 -1
- package/lib/hr-search-input/index.js +1 -1
- package/lib/hr-search-tips/index.css +1 -0
- package/lib/hr-search-tips/index.js +9 -0
- package/lib/hr-select/index.js +1 -1
- package/lib/hr-select-list/index.js +1 -1
- package/lib/hr-single-choose/index.css +1 -1
- package/lib/hr-single-choose/index.js +1 -1
- package/lib/hr-slide-pager/index.css +1 -1
- package/lib/hr-slide-pager/index.js +1 -1
- package/lib/hr-sort/index.js +1 -1
- package/lib/hr-stack-image/index.js +1 -1
- package/lib/hr-tab-nav/index.css +1 -1
- package/lib/hr-tab-nav/index.js +1 -1
- package/lib/hr-time-picker/index.css +1 -0
- package/lib/hr-time-picker/index.js +1 -0
- package/lib/hr-view-item/index.js +1 -1
- package/lib/hr-virtual-list/index.css +1 -0
- package/lib/hr-virtual-list/index.js +1 -0
- package/lib/img/header.7e31b1d5.png +0 -0
- package/lib/index/index.css +1 -1
- package/lib/index/index.js +2 -2
- package/lib/utils/index.js +1 -1
- package/package.json +7 -3
- package/packages/hr-checkbox/index.js +8 -0
- package/packages/hr-checkbox/src/active-icon.png +0 -0
- package/packages/hr-checkbox/src/checkbox-group.vue +74 -0
- package/packages/hr-checkbox/src/checkbox.vue +226 -0
- package/packages/hr-checkbox/src/data.js +46 -0
- package/packages/hr-checkbox//345/244/215/351/200/211/346/241/206-/345/215/225/351/200/211/346/241/206.md +0 -0
- package/packages/hr-checkbox-group/index.js +8 -0
- package/packages/hr-collapse-card/index.js +3 -0
- package/packages/hr-collapse-card/src/images/icon_up.png +0 -0
- package/packages/hr-collapse-card/src/index.vue +151 -0
- package/packages/hr-collapse-card//346/212/230/345/217/240/345/215/241/347/211/207.md +0 -0
- package/packages/hr-date-filter/index.js +7 -0
- package/packages/hr-date-filter/src/date-select.vue +153 -0
- package/packages/hr-date-filter/src/index.vue +243 -0
- package/packages/hr-date-filter/src/style.less +130 -0
- package/packages/hr-date-filter/src/utils.js +109 -0
- package/packages/hr-dropdown-date/index.js +7 -0
- package/packages/hr-dropdown-date/src/calendar/calendar.js +128 -0
- package/packages/hr-dropdown-date/src/calendar/calendar.vue +485 -0
- package/packages/hr-dropdown-date/src/calendar/images/arrow@3x.png +0 -0
- package/packages/hr-dropdown-date/src/calendar/index.js +5 -0
- package/packages/hr-dropdown-date/src/date-picker/date-range-select.vue +92 -0
- package/packages/hr-dropdown-date/src/date-picker/month-range-select.vue +128 -0
- package/packages/hr-dropdown-date/src/date-picker/month-select.vue +98 -0
- package/packages/hr-dropdown-date/src/date-picker/style.less +120 -0
- package/packages/hr-dropdown-date/src/date-picker/utils.js +109 -0
- package/packages/hr-dropdown-date/src/index.vue +482 -0
- package/packages/hr-dropdown-date/src/week.js +194 -0
- package/packages/hr-file-list/src/index.vue +2 -2
- package/packages/hr-full-screen/index.js +7 -0
- package/packages/hr-full-screen/src/index.vue +117 -0
- package/packages/hr-information/src/index.vue +1 -0
- package/packages/hr-multiterm-choose/src/index.vue +4 -5
- package/packages/hr-notification-dialog/images/header.png +0 -0
- package/packages/hr-notification-dialog/index.js +7 -0
- package/packages/hr-notification-dialog/src/index.vue +293 -0
- package/packages/hr-notification-dialog//345/274/271/347/252/227/346/217/220/347/244/272/347/273/204/344/273/266.md +0 -0
- package/packages/hr-pager/index.js +1 -1
- package/packages/hr-pager/src/index.vue +34 -9
- package/packages/hr-radiobox/index.js +8 -0
- package/packages/hr-radiobox/src/data.js +46 -0
- package/packages/hr-radiobox/src/radiobox-group.vue +64 -0
- package/packages/hr-radiobox/src/radiobox.vue +191 -0
- package/packages/hr-radiobox-group/index.js +8 -0
- package/packages/hr-search-tips/index.js +3 -0
- package/packages/hr-search-tips/src/index.vue +213 -0
- package/packages/hr-search-tips//350/277/234/347/250/213/346/250/241/347/263/212/346/220/234/347/264/242.md +0 -0
- package/packages/hr-single-choose/src/index.vue +4 -5
- package/packages/hr-slide-pager/src/index.vue +3 -10
- package/packages/hr-tab-nav/src/index.vue +79 -4
- package/packages/hr-time-picker/index.js +3 -0
- package/packages/hr-time-picker/src/index.vue +85 -0
- package/packages/hr-time-picker//346/227/266/351/227/264/351/200/211/346/213/251/345/231/250.md +0 -0
- package/packages/hr-virtual-list/index.js +7 -0
- package/packages/hr-virtual-list/src/cc-item.vue +105 -0
- package/packages/hr-virtual-list/src/index.vue +227 -0
- package/packages/hr-virtual-list//350/231/232/346/213/237/345/210/227/350/241/250.md +0 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="user-item-box">
|
|
3
|
+
<div class="user-item">
|
|
4
|
+
<img class="user-img"
|
|
5
|
+
:src="item.employeePhotoUrl" />
|
|
6
|
+
<div class="right-part">
|
|
7
|
+
<div class="name-box">
|
|
8
|
+
<div class="name">{{(item.name || item.employeeName) + '-' + item.duty}}</div>
|
|
9
|
+
<slot name="ccType"></slot>
|
|
10
|
+
</div>
|
|
11
|
+
<div class="dept-duty">
|
|
12
|
+
<span :class="{'department': item.haveRead}">{{item.department || item.departmentName}}</span>
|
|
13
|
+
<span v-if="item.haveRead">{{item.readTime | minute}}</span>
|
|
14
|
+
<div v-if="isShowCountBar"
|
|
15
|
+
class="count-item">
|
|
16
|
+
<span class="label">阅读时长:</span>
|
|
17
|
+
<span class="value">{{item.stayDurationConvert}}</span>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script>
|
|
27
|
+
export default {
|
|
28
|
+
name: 'cc-item', // 抄送人组件
|
|
29
|
+
props: {
|
|
30
|
+
item: {
|
|
31
|
+
type: Object,
|
|
32
|
+
default: () => ({})
|
|
33
|
+
},
|
|
34
|
+
// 是否展示统计栏
|
|
35
|
+
isShowCountBar: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: true
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
}
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<style lang="less" scoped>
|
|
44
|
+
.user-item-box {
|
|
45
|
+
padding: 12px;
|
|
46
|
+
border-bottom: 1px solid #eaebf0;
|
|
47
|
+
}
|
|
48
|
+
.user-item {
|
|
49
|
+
display: flex;
|
|
50
|
+
.user-img {
|
|
51
|
+
width: 40px;
|
|
52
|
+
height: 40px;
|
|
53
|
+
border-radius: 8px;
|
|
54
|
+
margin-right: 10px;
|
|
55
|
+
&.hide {
|
|
56
|
+
visibility: hidden;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
.right-part {
|
|
60
|
+
flex-grow: 1;
|
|
61
|
+
.name-box {
|
|
62
|
+
display: flex;
|
|
63
|
+
justify-content: flex-start;
|
|
64
|
+
align-items: center;
|
|
65
|
+
margin-top: 2px;
|
|
66
|
+
.name {
|
|
67
|
+
font-size: 14px;
|
|
68
|
+
color: #000000;
|
|
69
|
+
}
|
|
70
|
+
.visi-count {
|
|
71
|
+
font-size: 16px;
|
|
72
|
+
color: #7653d6;
|
|
73
|
+
}
|
|
74
|
+
.visi-dura {
|
|
75
|
+
font-size: 16px;
|
|
76
|
+
color: #000000;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
.dept-duty {
|
|
80
|
+
font-size: 12px;
|
|
81
|
+
color: #999999;
|
|
82
|
+
margin-top: 4px;
|
|
83
|
+
display: flex;
|
|
84
|
+
justify-content: space-between;
|
|
85
|
+
.department {
|
|
86
|
+
max-width: 140px;
|
|
87
|
+
overflow: hidden;
|
|
88
|
+
text-overflow: ellipsis;
|
|
89
|
+
white-space: nowrap;
|
|
90
|
+
}
|
|
91
|
+
.count-item {
|
|
92
|
+
font-size: 12px;
|
|
93
|
+
color: #999999;
|
|
94
|
+
margin-left: 12px;
|
|
95
|
+
.label {
|
|
96
|
+
color: #999999;
|
|
97
|
+
}
|
|
98
|
+
.value {
|
|
99
|
+
color: #03050d;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
</style>
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div ref="list"
|
|
3
|
+
:style="{height}"
|
|
4
|
+
class="infinite-list-container"
|
|
5
|
+
@scroll="scrollEvent($event)">
|
|
6
|
+
<!-- 虚拟列表滚动条----一个实际列表高度空盒子用于模拟滚动 -->
|
|
7
|
+
<div ref="phantom"
|
|
8
|
+
class="infinite-list-phantom"></div>
|
|
9
|
+
<!-- 可视区域范围的列表展示区域 -->
|
|
10
|
+
<div ref="content"
|
|
11
|
+
class="infinite-list">
|
|
12
|
+
<div class="infinite-list-item"
|
|
13
|
+
ref="items"
|
|
14
|
+
:id="item._index"
|
|
15
|
+
:key="item._index"
|
|
16
|
+
v-for="item in visibleData">
|
|
17
|
+
<slot ref="slot"
|
|
18
|
+
:item="item.item"
|
|
19
|
+
:index="item._index"></slot>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
<script>
|
|
27
|
+
|
|
28
|
+
export default {
|
|
29
|
+
name: 'HrVirtualList',
|
|
30
|
+
props: {
|
|
31
|
+
// 所有列表数据
|
|
32
|
+
listData: {
|
|
33
|
+
type: Array,
|
|
34
|
+
default: () => []
|
|
35
|
+
},
|
|
36
|
+
// 列表项预估高度
|
|
37
|
+
estimatedItemSize: {
|
|
38
|
+
type: Number,
|
|
39
|
+
required: true
|
|
40
|
+
},
|
|
41
|
+
// 缓冲区比例
|
|
42
|
+
bufferScale: {
|
|
43
|
+
type: Number,
|
|
44
|
+
default: 1
|
|
45
|
+
},
|
|
46
|
+
// 容器高度 100px or 50vh
|
|
47
|
+
height: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: '100%'
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
data () {
|
|
53
|
+
return {
|
|
54
|
+
//可视区域高度
|
|
55
|
+
screenHeight: 0,
|
|
56
|
+
//起始索引
|
|
57
|
+
start: 0,
|
|
58
|
+
//结束索引
|
|
59
|
+
end: 0,
|
|
60
|
+
};
|
|
61
|
+
},
|
|
62
|
+
created () {
|
|
63
|
+
this.initPositions()
|
|
64
|
+
},
|
|
65
|
+
mounted () {
|
|
66
|
+
this.screenHeight = this.$el.clientHeight;
|
|
67
|
+
this.start = 0;
|
|
68
|
+
this.end = this.start + this.visibleCount;
|
|
69
|
+
},
|
|
70
|
+
watch: {
|
|
71
|
+
listData: {
|
|
72
|
+
handler () {
|
|
73
|
+
console.log('listData 数据变!!!')
|
|
74
|
+
this.initPositions()
|
|
75
|
+
this.reset()
|
|
76
|
+
},
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
computed: {
|
|
80
|
+
_listData () {
|
|
81
|
+
return this.listData.map((item, index) => {
|
|
82
|
+
return {
|
|
83
|
+
_index: `_${index}`,
|
|
84
|
+
item
|
|
85
|
+
}
|
|
86
|
+
})
|
|
87
|
+
},
|
|
88
|
+
// 可展示的列表数量 (根据 可视区域高度/列表项高度 求出)
|
|
89
|
+
visibleCount () {
|
|
90
|
+
return Math.ceil(this.screenHeight / this.estimatedItemSize)
|
|
91
|
+
},
|
|
92
|
+
aboveCount () {
|
|
93
|
+
return Math.min(this.start, this.bufferScale * this.visibleCount)
|
|
94
|
+
},
|
|
95
|
+
belowCount () {
|
|
96
|
+
return Math.min(this.listData.length - this.end, this.bufferScale * this.visibleCount)
|
|
97
|
+
},
|
|
98
|
+
// 可视区域列表数据(根据start、end索引截取原数组获得)
|
|
99
|
+
visibleData () {
|
|
100
|
+
let start = this.start - this.aboveCount
|
|
101
|
+
let end = this.end + this.belowCount
|
|
102
|
+
return this._listData.slice(start, end)
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
updated () {
|
|
106
|
+
this.$nextTick(function () {
|
|
107
|
+
if (!this.$refs.items || !this.$refs.items.length) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
//获取真实元素大小,修改对应的尺寸缓存
|
|
111
|
+
this.updateItemsSize()
|
|
112
|
+
//更新列表总高度
|
|
113
|
+
let height = this.positions[this.positions.length - 1].bottom
|
|
114
|
+
this.$refs.phantom.style.height = height + 'px'
|
|
115
|
+
//更新真实偏移量
|
|
116
|
+
this.setStartOffset()
|
|
117
|
+
})
|
|
118
|
+
},
|
|
119
|
+
methods: {
|
|
120
|
+
reset () {
|
|
121
|
+
// 滚动条高度重置
|
|
122
|
+
this.$refs.phantom.style.height = 0
|
|
123
|
+
// 索引位置重置
|
|
124
|
+
this.start = 0
|
|
125
|
+
this.end = this.start + this.visibleCount
|
|
126
|
+
},
|
|
127
|
+
initPositions () {
|
|
128
|
+
this.positions = this.listData.map((d, index) => ({
|
|
129
|
+
index,
|
|
130
|
+
height: this.estimatedItemSize,
|
|
131
|
+
top: index * this.estimatedItemSize,
|
|
132
|
+
bottom: (index + 1) * this.estimatedItemSize
|
|
133
|
+
})
|
|
134
|
+
);
|
|
135
|
+
},
|
|
136
|
+
//获取列表起始索引
|
|
137
|
+
getStartIndex (scrollTop = 0) {
|
|
138
|
+
//二分法查找
|
|
139
|
+
return this.binarySearch(this.positions, scrollTop)
|
|
140
|
+
},
|
|
141
|
+
binarySearch (list, value) {
|
|
142
|
+
let start = 0;
|
|
143
|
+
let end = list.length - 1;
|
|
144
|
+
let tempIndex = null;
|
|
145
|
+
|
|
146
|
+
while (start <= end) {
|
|
147
|
+
let midIndex = parseInt((start + end) / 2);
|
|
148
|
+
let midValue = list[midIndex].bottom;
|
|
149
|
+
if (midValue === value) {
|
|
150
|
+
return midIndex + 1;
|
|
151
|
+
} else if (midValue < value) {
|
|
152
|
+
start = midIndex + 1;
|
|
153
|
+
} else if (midValue > value) {
|
|
154
|
+
if (tempIndex === null || tempIndex > midIndex) {
|
|
155
|
+
tempIndex = midIndex;
|
|
156
|
+
}
|
|
157
|
+
end = end - 1;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return tempIndex;
|
|
161
|
+
},
|
|
162
|
+
//获取列表项的当前尺寸
|
|
163
|
+
updateItemsSize () {
|
|
164
|
+
let nodes = this.$refs.items
|
|
165
|
+
nodes.forEach((node) => {
|
|
166
|
+
let rect = node.getBoundingClientRect()
|
|
167
|
+
let height = rect.height;
|
|
168
|
+
let index = +node.id.slice(1)
|
|
169
|
+
let oldHeight = this.positions[index].height
|
|
170
|
+
let dValue = oldHeight - height
|
|
171
|
+
//存在差值
|
|
172
|
+
if (dValue) {
|
|
173
|
+
this.positions[index].bottom = this.positions[index].bottom - dValue
|
|
174
|
+
this.positions[index].height = height
|
|
175
|
+
for (let k = index + 1; k < this.positions.length; k++) {
|
|
176
|
+
this.positions[k].top = this.positions[k - 1].bottom
|
|
177
|
+
this.positions[k].bottom = this.positions[k].bottom - dValue
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
})
|
|
182
|
+
},
|
|
183
|
+
//获取当前的偏移量
|
|
184
|
+
setStartOffset () {
|
|
185
|
+
let startOffset
|
|
186
|
+
if (this.start >= 1) {
|
|
187
|
+
let size = this.positions[this.start].top - (this.positions[this.start - this.aboveCount] ? this.positions[this.start - this.aboveCount].top : 0)
|
|
188
|
+
startOffset = this.positions[this.start - 1].bottom - size
|
|
189
|
+
} else {
|
|
190
|
+
startOffset = 0
|
|
191
|
+
}
|
|
192
|
+
this.$refs.content.style.transform = `translate3d(0,${startOffset}px,0)`
|
|
193
|
+
},
|
|
194
|
+
//滚动事件
|
|
195
|
+
scrollEvent () {
|
|
196
|
+
//当前滚动位置
|
|
197
|
+
let scrollTop = this.$refs.list.scrollTop
|
|
198
|
+
// let startBottom = this.positions[this.start - ]
|
|
199
|
+
//此时的开始索引
|
|
200
|
+
this.start = this.getStartIndex(scrollTop)
|
|
201
|
+
//此时的结束索引
|
|
202
|
+
this.end = this.start + this.visibleCount
|
|
203
|
+
//此时的偏移量
|
|
204
|
+
this.setStartOffset()
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
</script>
|
|
209
|
+
|
|
210
|
+
<style lang="less" scoped>
|
|
211
|
+
.infinite-list-container {
|
|
212
|
+
overflow: auto;
|
|
213
|
+
position: relative;
|
|
214
|
+
-webkit-overflow-scrolling: touch;
|
|
215
|
+
.infinite-list {
|
|
216
|
+
left: 0;
|
|
217
|
+
right: 0;
|
|
218
|
+
top: 0;
|
|
219
|
+
position: absolute;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.infinite-list-item {
|
|
223
|
+
padding: 5px;
|
|
224
|
+
box-sizing: border-box;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
</style>
|
|
File without changes
|