@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.
Files changed (135) hide show
  1. package/dist/hroa-ui.common.js +5345 -271
  2. package/dist/hroa-ui.css +1 -1
  3. package/dist/hroa-ui.umd.js +5345 -271
  4. package/dist/hroa-ui.umd.min.js +2 -2
  5. package/dist/img/header.7e31b1d5.png +0 -0
  6. package/lib/getJsModule/index.css +1 -1
  7. package/lib/getJsModule/index.js +2 -2
  8. package/lib/hr-add-list/index.js +1 -1
  9. package/lib/hr-bottom-button/index.js +1 -1
  10. package/lib/hr-breadcrumb/index.js +1 -1
  11. package/lib/hr-button/index.js +1 -1
  12. package/lib/hr-checkbox/index.css +1 -0
  13. package/lib/hr-checkbox/index.js +1 -0
  14. package/lib/hr-checkbox-group/index.css +1 -0
  15. package/lib/hr-checkbox-group/index.js +1 -0
  16. package/lib/hr-clipboard/index.js +1 -1
  17. package/lib/hr-collapse-card/index.css +1 -0
  18. package/lib/hr-collapse-card/index.js +1 -0
  19. package/lib/hr-condition-filtrate/index.js +1 -1
  20. package/lib/hr-condition-filtrate-popup/index.js +1 -1
  21. package/lib/hr-date-filter/index.css +1 -0
  22. package/lib/hr-date-filter/index.js +1 -0
  23. package/lib/hr-dropdown-date/index.css +1 -0
  24. package/lib/hr-dropdown-date/index.js +1 -0
  25. package/lib/hr-elasticity-box/index.js +1 -1
  26. package/lib/hr-elasticity-box-item/index.js +1 -1
  27. package/lib/hr-emotional-picture/index.js +1 -1
  28. package/lib/hr-employee-choose/index.js +1 -1
  29. package/lib/hr-file-list/index.css +1 -1
  30. package/lib/hr-file-list/index.js +1 -1
  31. package/lib/hr-full-screen/index.css +1 -0
  32. package/lib/hr-full-screen/index.js +1 -0
  33. package/lib/hr-img-list/index.js +1 -1
  34. package/lib/hr-info-card/index.js +1 -1
  35. package/lib/hr-information/index.css +1 -1
  36. package/lib/hr-information/index.js +1 -1
  37. package/lib/hr-license-plate-number/index.js +1 -1
  38. package/lib/hr-module-card/index.js +1 -1
  39. package/lib/hr-multiterm-choose/index.css +1 -1
  40. package/lib/hr-multiterm-choose/index.js +1 -1
  41. package/lib/hr-no-data/index.js +1 -1
  42. package/lib/hr-notice-bar/index.js +1 -1
  43. package/lib/hr-notification-dialog/index.css +1 -0
  44. package/lib/hr-notification-dialog/index.js +1 -0
  45. package/lib/hr-open-ks/index.js +1 -1
  46. package/lib/hr-pager/index.css +1 -1
  47. package/lib/hr-pager/index.js +1 -1
  48. package/lib/hr-popup/index.js +1 -1
  49. package/lib/hr-preview-file/index.js +1 -1
  50. package/lib/hr-radiobox/index.css +1 -0
  51. package/lib/hr-radiobox/index.js +1 -0
  52. package/lib/hr-radiobox-group/index.css +1 -0
  53. package/lib/hr-radiobox-group/index.js +1 -0
  54. package/lib/hr-rate/index.js +1 -1
  55. package/lib/hr-reason-textarea/index.js +1 -1
  56. package/lib/hr-search-input/index.js +1 -1
  57. package/lib/hr-search-tips/index.css +1 -0
  58. package/lib/hr-search-tips/index.js +9 -0
  59. package/lib/hr-select/index.js +1 -1
  60. package/lib/hr-select-list/index.js +1 -1
  61. package/lib/hr-single-choose/index.css +1 -1
  62. package/lib/hr-single-choose/index.js +1 -1
  63. package/lib/hr-slide-pager/index.css +1 -1
  64. package/lib/hr-slide-pager/index.js +1 -1
  65. package/lib/hr-sort/index.js +1 -1
  66. package/lib/hr-stack-image/index.js +1 -1
  67. package/lib/hr-tab-nav/index.css +1 -1
  68. package/lib/hr-tab-nav/index.js +1 -1
  69. package/lib/hr-time-picker/index.css +1 -0
  70. package/lib/hr-time-picker/index.js +1 -0
  71. package/lib/hr-view-item/index.js +1 -1
  72. package/lib/hr-virtual-list/index.css +1 -0
  73. package/lib/hr-virtual-list/index.js +1 -0
  74. package/lib/img/header.7e31b1d5.png +0 -0
  75. package/lib/index/index.css +1 -1
  76. package/lib/index/index.js +2 -2
  77. package/lib/utils/index.js +1 -1
  78. package/package.json +7 -3
  79. package/packages/hr-checkbox/index.js +8 -0
  80. package/packages/hr-checkbox/src/active-icon.png +0 -0
  81. package/packages/hr-checkbox/src/checkbox-group.vue +74 -0
  82. package/packages/hr-checkbox/src/checkbox.vue +226 -0
  83. package/packages/hr-checkbox/src/data.js +46 -0
  84. 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
  85. package/packages/hr-checkbox-group/index.js +8 -0
  86. package/packages/hr-collapse-card/index.js +3 -0
  87. package/packages/hr-collapse-card/src/images/icon_up.png +0 -0
  88. package/packages/hr-collapse-card/src/index.vue +151 -0
  89. package/packages/hr-collapse-card//346/212/230/345/217/240/345/215/241/347/211/207.md +0 -0
  90. package/packages/hr-date-filter/index.js +7 -0
  91. package/packages/hr-date-filter/src/date-select.vue +153 -0
  92. package/packages/hr-date-filter/src/index.vue +243 -0
  93. package/packages/hr-date-filter/src/style.less +130 -0
  94. package/packages/hr-date-filter/src/utils.js +109 -0
  95. package/packages/hr-dropdown-date/index.js +7 -0
  96. package/packages/hr-dropdown-date/src/calendar/calendar.js +128 -0
  97. package/packages/hr-dropdown-date/src/calendar/calendar.vue +485 -0
  98. package/packages/hr-dropdown-date/src/calendar/images/arrow@3x.png +0 -0
  99. package/packages/hr-dropdown-date/src/calendar/index.js +5 -0
  100. package/packages/hr-dropdown-date/src/date-picker/date-range-select.vue +92 -0
  101. package/packages/hr-dropdown-date/src/date-picker/month-range-select.vue +128 -0
  102. package/packages/hr-dropdown-date/src/date-picker/month-select.vue +98 -0
  103. package/packages/hr-dropdown-date/src/date-picker/style.less +120 -0
  104. package/packages/hr-dropdown-date/src/date-picker/utils.js +109 -0
  105. package/packages/hr-dropdown-date/src/index.vue +482 -0
  106. package/packages/hr-dropdown-date/src/week.js +194 -0
  107. package/packages/hr-file-list/src/index.vue +2 -2
  108. package/packages/hr-full-screen/index.js +7 -0
  109. package/packages/hr-full-screen/src/index.vue +117 -0
  110. package/packages/hr-information/src/index.vue +1 -0
  111. package/packages/hr-multiterm-choose/src/index.vue +4 -5
  112. package/packages/hr-notification-dialog/images/header.png +0 -0
  113. package/packages/hr-notification-dialog/index.js +7 -0
  114. package/packages/hr-notification-dialog/src/index.vue +293 -0
  115. 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
  116. package/packages/hr-pager/index.js +1 -1
  117. package/packages/hr-pager/src/index.vue +34 -9
  118. package/packages/hr-radiobox/index.js +8 -0
  119. package/packages/hr-radiobox/src/data.js +46 -0
  120. package/packages/hr-radiobox/src/radiobox-group.vue +64 -0
  121. package/packages/hr-radiobox/src/radiobox.vue +191 -0
  122. package/packages/hr-radiobox-group/index.js +8 -0
  123. package/packages/hr-search-tips/index.js +3 -0
  124. package/packages/hr-search-tips/src/index.vue +213 -0
  125. 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
  126. package/packages/hr-single-choose/src/index.vue +4 -5
  127. package/packages/hr-slide-pager/src/index.vue +3 -10
  128. package/packages/hr-tab-nav/src/index.vue +79 -4
  129. package/packages/hr-time-picker/index.js +3 -0
  130. package/packages/hr-time-picker/src/index.vue +85 -0
  131. package/packages/hr-time-picker//346/227/266/351/227/264/351/200/211/346/213/251/345/231/250.md +0 -0
  132. package/packages/hr-virtual-list/index.js +7 -0
  133. package/packages/hr-virtual-list/src/cc-item.vue +105 -0
  134. package/packages/hr-virtual-list/src/index.vue +227 -0
  135. package/packages/hr-virtual-list//350/231/232/346/213/237/345/210/227/350/241/250.md +0 -0
@@ -0,0 +1,191 @@
1
+ <script>
2
+ import RadioboxItem from './data'
3
+
4
+ export default {
5
+ name: 'HrRadiobox',
6
+ inject: {
7
+ selfAdaption: {
8
+ from: 'selfAdaption',
9
+ default () {
10
+ return false
11
+ }
12
+ },
13
+ divideeQually: {
14
+ from: 'divideeQually',
15
+ default () {
16
+ return 3
17
+ }
18
+ },
19
+ margin: {
20
+ from: 'margin',
21
+ default () {
22
+ return 12
23
+ }
24
+ },
25
+ marginBottom: {
26
+ from: 'marginBottom',
27
+ default () {
28
+ return this.margin
29
+ }
30
+ },
31
+ },
32
+ props: {
33
+ index: {
34
+ type: Number,
35
+ default () {
36
+ return 0
37
+ }
38
+ },
39
+ value: {
40
+ type: Boolean,
41
+ default () {
42
+ return false
43
+ }
44
+ },
45
+ label: {
46
+ type: String,
47
+ default () {
48
+ return '暂无'
49
+ }
50
+ },
51
+ disabled: { // 禁用
52
+ type: Boolean,
53
+ default () {
54
+ return false
55
+ }
56
+ },
57
+ },
58
+ data () {
59
+ return {
60
+ radioboxItem: new RadioboxItem(),
61
+ selfModel: false
62
+ }
63
+ },
64
+ computed: {
65
+ // 中间层
66
+ model: {
67
+ get () {
68
+ return this.isGroup ? this._radioboxGroup.value : this.value
69
+ },
70
+ set (val) {
71
+ if (this.isGroup) {
72
+ this.dispatch('HrRadioboxGroup', 'input', [val])
73
+ } else {
74
+ this.$emit('input', val)
75
+ this.selfModel = val
76
+ }
77
+ },
78
+ },
79
+ //是否有group
80
+ isGroup () {
81
+ let parent = this.$parent
82
+ while (parent) {
83
+ if (parent.$options.name !== 'HrRadioboxGroup') {
84
+ parent = parent.$parent
85
+ } else {
86
+ this._radioboxGroup = parent
87
+ return true
88
+ }
89
+ }
90
+ return false
91
+ },
92
+ isChecked () {
93
+ return this.model === this.label
94
+ }
95
+ },
96
+ methods: {
97
+ // 修改父组件数组
98
+ dispatch (componentName, eventName, params) {
99
+ let parent = this.$parent || this.$root
100
+ let name = parent.$options.name
101
+
102
+ while (parent && (!name || name !== componentName)) {
103
+ (parent = parent.$parent) && (name = parent.$options.name)
104
+ }
105
+
106
+ parent && parent.$emit.apply(parent, [eventName].concat(params))
107
+ },
108
+ handleChange () {
109
+ this.setModel()
110
+ this.$emit('change', this.model)
111
+ this.$nextTick(() => {
112
+ this.dispatch('HrRadioboxGroup', 'change', this._radioboxGroup.value)
113
+ })
114
+ },
115
+ setModel () {
116
+ this.model = this.isChecked ? null : this.label
117
+ },
118
+ getIndex () {
119
+ return this.$parent.$children.indexOf(this)
120
+ }
121
+ },
122
+ render () {
123
+ const { value, label, selfAdaption, divideeQually, margin, marginBottom } = this
124
+ const index = this.getIndex()
125
+ this.radioboxItem.init({
126
+ value,
127
+ label,
128
+ selfAdaption,
129
+ divideeQually,
130
+ margin,
131
+ marginBottom,
132
+ index,
133
+ vm: this,
134
+ })
135
+ return <div
136
+ onClick={this.handleChange}
137
+ index={index}
138
+ style={{
139
+ width: this.radioboxItem.width,
140
+ marginRight: this.radioboxItem.marginRight,
141
+ marginBottom: this.radioboxItem.marginBottom,
142
+ }}
143
+ class={[
144
+ 'hr-radiobox',
145
+ 'ellipsis',
146
+ this.isChecked && 'checked',
147
+ ]}>
148
+ {label}
149
+ </div>
150
+ }
151
+ }
152
+ </script>
153
+
154
+ <style scoped lang="less">
155
+ .ellipsis {
156
+ overflow: hidden;
157
+ white-space: nowrap;
158
+ text-overflow: ellipsis;
159
+ }
160
+ .hr-radiobox {
161
+ height: 28px;
162
+ border-radius: 8px;
163
+ box-sizing: border-box;
164
+ background: #f7f8fa;
165
+ text-align: center;
166
+ line-height: 27px;
167
+ color: #03050d;
168
+ font-size: 12px;
169
+ padding: 0 8px;
170
+ position: relative;
171
+ &.checked {
172
+ background: rgba(121, 114, 254, 0.08);
173
+ color: #7972fe;
174
+ &::after {
175
+ content: " ";
176
+ position: absolute;
177
+ left: 0;
178
+ top: 0;
179
+ width: calc(200% - 2px);
180
+ height: calc(200% - 2px);
181
+ border: 1px solid #7972fe;
182
+ border-radius: 16px;
183
+ box-sizing: border-box;
184
+ -webkit-transform-origin: 0 0;
185
+ transform-origin: 0 0;
186
+ -webkit-transform: scale(0.5);
187
+ transform: scale(0.5);
188
+ }
189
+ }
190
+ }
191
+ </style>
@@ -0,0 +1,8 @@
1
+
2
+ import HrRadioboxGroup from '../hr-radiobox/src/radiobox-group.vue'
3
+
4
+ HrRadioboxGroup.install = function (Vue) {
5
+ Vue.component(HrRadioboxGroup.name, HrRadioboxGroup)
6
+ }
7
+
8
+ export default HrRadioboxGroup
@@ -0,0 +1,3 @@
1
+ import HrSearchTips from './src/index.vue'
2
+
3
+ export default HrSearchTips
@@ -0,0 +1,213 @@
1
+ <script>
2
+ import { debounce } from 'lodash'
3
+
4
+ export default {
5
+ name: 'HrSearchTips',
6
+ props: {
7
+ value: {
8
+ type: [Number, String],
9
+ required: true
10
+ },
11
+ url: {
12
+ type: String,
13
+ required: true
14
+ },
15
+ appKey: {
16
+ type: [String, Number],
17
+ required: true
18
+ },
19
+ searchParams: {
20
+ type: Function,
21
+ required: true
22
+ },
23
+ searchResult: {
24
+ type: Function
25
+ },
26
+ keys: {
27
+ type: Array,
28
+ default: () => ([])
29
+ },
30
+ label: String,
31
+ labelWidth: {
32
+ type: [String, Number],
33
+ default: '80px'
34
+ },
35
+ labelAlign: {
36
+ type: String,
37
+ default: 'left'
38
+ },
39
+ inputAlign: {
40
+ type: String,
41
+ default: 'left'
42
+ },
43
+ required: Boolean,
44
+ rules: {
45
+ type: Array,
46
+ default: () => ([])
47
+ },
48
+ placeholder: String,
49
+ inputLength: {
50
+ type: Number,
51
+ default: 2
52
+ }
53
+ },
54
+ data () {
55
+ return {
56
+ loading: false,
57
+ showTips: false,
58
+ // 真实值
59
+ searchVal: '',
60
+ // 临时值
61
+ curInputVal: '',
62
+ tipListData: []
63
+ }
64
+ },
65
+ computed: {
66
+ debounceGetListFn () {
67
+ return debounce(this.getList, 200)
68
+ }
69
+ },
70
+ watch: {
71
+ value (val) {
72
+ this.searchVal = val
73
+ this.curInputVal = val
74
+ }
75
+ },
76
+ render () {
77
+ const { label, labelWidth, labelAlign, inputAlign, required, rules, placeholder } = this.$props
78
+
79
+ const inputDom = () => {
80
+ return <van-field
81
+ value={this.curInputVal}
82
+ label={label}
83
+ label-width={labelWidth}
84
+ label-align={labelAlign}
85
+ input-align={inputAlign}
86
+ error-message-align={inputAlign}
87
+ required={required}
88
+ rules={rules}
89
+ placeholder={placeholder}
90
+ onInput={val => {
91
+ this.curInputVal = val
92
+ // this.$emit('input', val)
93
+ this.debounceGetListFn(val)
94
+ }}
95
+ onBlur={this.searchBlur}></van-field>
96
+ }
97
+
98
+ const tipsDom = () => {
99
+ return (
100
+ <div class="tips-list">
101
+ {this.loading ? <van-loading size="24px" class="loading-cls" /> : ''}
102
+ {
103
+ this.tipListData.map(item => {
104
+ return <div class="tips-item"
105
+ onClick={() => this.itemClick(item)}>
106
+ {
107
+ this.keys.map((key, keyIndex) => {
108
+ return <span>{item[key]}{keyIndex !== (this.keys.length - 1) ? ',' : ''}</span>
109
+ })
110
+ }
111
+ </div>
112
+ })
113
+ }
114
+ </div >
115
+ )
116
+ }
117
+
118
+ return (
119
+ <div class="hr-fe-together-build-hr-search-tips">
120
+ {inputDom()}
121
+ {this.showTips ? tipsDom() : ''}
122
+ </div >
123
+ )
124
+ },
125
+ methods: {
126
+ // 获取列表(临时值输入后触发)
127
+ async getList (value) {
128
+ try {
129
+ // 获取前先清空真实值,真实值需要选择后重新赋值,如不选,则清空
130
+ this.searchVal = ''
131
+ this.tipListData = []
132
+ if (value.length < this.inputLength) {
133
+ this.showTips = false
134
+ return
135
+ }
136
+ this.showTips = true
137
+ this.loading = true
138
+ let res = await ksui.http(this.url, this.appKey, this.searchParams(value))
139
+ if (this.formatResult) {
140
+ res = this.formatResult(res)
141
+ }
142
+ this.tipListData = res || []
143
+ if (!this.tipListData.length) {
144
+ this.showTips = false
145
+ this.searchVal = ''
146
+ this.$toast('搜索结果为空')
147
+ }
148
+ } catch (error) {
149
+ this.showTips = false
150
+ } finally {
151
+ this.loading = false
152
+ }
153
+ },
154
+ // 选项点击事件
155
+ itemClick (item) {
156
+ this.showTips = false
157
+ this.$emit('select', item)
158
+ },
159
+ searchBlur () {
160
+ // 失焦后,临时值更新成最新的值,搜索结果清空并隐藏
161
+ setTimeout(() => {
162
+ this.curInputVal = this.searchVal
163
+ this.tipListData = []
164
+ this.showTips = false
165
+ }, 200)
166
+ }
167
+ }
168
+ }
169
+ </script>
170
+
171
+ <style lang="less" scoped>
172
+ .hr-fe-together-build-hr-search-tips {
173
+ position: relative;
174
+ .van-cell:after {
175
+ display: none;
176
+ }
177
+ .tips-list {
178
+ position: absolute;
179
+ top: 54px;
180
+ right: 10px;
181
+ width: 90%;
182
+ max-height: 220px;
183
+ font-size: 14px;
184
+ color: #999;
185
+ background-color: #fff;
186
+ box-shadow: 1px 1px 8px #dfdede;
187
+ border: 1px solid #ededed;
188
+ overflow: auto;
189
+ z-index: 999;
190
+ .loading-cls {
191
+ width: 100%;
192
+ height: 40px;
193
+ display: flex;
194
+ justify-content: center;
195
+ align-items: center;
196
+ }
197
+ .tips-item {
198
+ padding-right: 15px;
199
+ box-sizing: border-box;
200
+ width: 100%;
201
+ height: 40px;
202
+ border-bottom: 0.5px solid #ededed;
203
+ font-size: 15px;
204
+ line-height: 40px;
205
+ overflow: hidden;
206
+ span {
207
+ display: inline-flex;
208
+ padding-left: 8px;
209
+ }
210
+ }
211
+ }
212
+ }
213
+ </style>
@@ -62,7 +62,7 @@
62
62
  }
63
63
  },
64
64
  checkValue: {
65
- type: String || Number,
65
+ type: [String, Number],
66
66
  default () {
67
67
  return -1
68
68
  }
@@ -105,16 +105,15 @@
105
105
  },
106
106
  render () {
107
107
  const width = this.selfAdaption ? null : `calc((100% - ${this.margin * (this.divideeQually - 1)}px) / ${this.divideeQually})`
108
- const marginBottom = this.selfAdaption ? null : `${this.marginBottom}px`
109
- const gap = this.selfAdaption ? `${this.margin}px` : null
108
+ const marginBottom = `${this.marginBottom}px`
110
109
  return <div class="single-choose">
111
110
  {
112
111
  this.title && <div class="choose-title">{this.title}</div>
113
112
  }
114
- <div class="choose-condition" style={{ gap }}>
113
+ <div class="choose-condition">
115
114
  {
116
115
  this.filterList.map((item, index) => {
117
- const marginRight = this.selfAdaption ? null : `${(index + 1) % this.divideeQually === 0 ? 0 : this.margin}px`
116
+ const marginRight = this.selfAdaption ? `${this.margin}px` : `${(this.index + 1) % this.divideeQually === 0 ? 0 : this.margin}px`
118
117
  const { value, label } = item
119
118
  return <div
120
119
  onClick={this.select.bind(this, value, index)}
@@ -68,7 +68,7 @@
68
68
  // 监听触摸的容器
69
69
  container: {
70
70
  type: String,
71
- default: 'hr-slide-pager'
71
+ default: '.hr-slide-pager'
72
72
  },
73
73
  // 分页器单位名称 【页|篇...】
74
74
  unitName: {
@@ -136,7 +136,7 @@
136
136
  */
137
137
  addEventForContainer () {
138
138
  this.$nextTick(() => {
139
- let containerDom = document.querySelector(`.${this.container}`)
139
+ let containerDom = document.querySelector(`${this.container}`)
140
140
  containerDom.addEventListener('touchstart', this.handleTouchStart)
141
141
  containerDom.addEventListener('touchmove', this.handleTouchMove)
142
142
  containerDom.addEventListener('touchend', this.handleTouchEnd)
@@ -318,20 +318,13 @@
318
318
  <style lang="less">
319
319
  .hr-slide-pager {
320
320
  transform: translate3d(0, 0, 1);
321
- position: fixed;
322
- top: 0;
323
- left: 0;
324
- width: 100%;
325
- height: 100%;
326
- z-index: 9;
321
+ z-index: 999;
327
322
  overflow: hidden;
328
- pointer-events: none;
329
323
 
330
324
  .shadow {
331
325
  position: absolute;
332
326
  top: 44px;
333
327
  height: 100%;
334
- pointer-events: none;
335
328
  z-index: 9;
336
329
  display: flex;
337
330
  align-items: center;
@@ -22,8 +22,73 @@
22
22
  count: 0,
23
23
  type: 20
24
24
  },
25
+ {
26
+ text: 'tab3',
27
+ count: 10,
28
+ type: 30
29
+ },
30
+ {
31
+ text: 'tab4',
32
+ count: 1000,
33
+ type: 40
34
+ },
35
+ {
36
+ text: 'tab5',
37
+ count: 0,
38
+ type: 50
39
+ },
40
+ {
41
+ text: 'tab6',
42
+ count: 0,
43
+ type: 60
44
+ },
45
+ {
46
+ text: 'tab7',
47
+ count: 0,
48
+ type: 70
49
+ },
50
+ {
51
+ text: 'tab8',
52
+ count: 0,
53
+ type: 80
54
+ },
55
+ {
56
+ text: 'tab9',
57
+ count: 0,
58
+ type: 90
59
+ },
25
60
  ]
26
61
  }
62
+ },
63
+ marginRight: {
64
+ type: Number || String,
65
+ default () {
66
+ return 37
67
+ },
68
+ },
69
+ defaultColor: {
70
+ type: String,
71
+ default () {
72
+ return '#858793'
73
+ },
74
+ },
75
+ activeColor: {
76
+ type: String,
77
+ default () {
78
+ return '#03050d'
79
+ },
80
+ },
81
+ defaultFontSize: {
82
+ type: Number || String,
83
+ default () {
84
+ return 14
85
+ },
86
+ },
87
+ activeFontSize: {
88
+ type: Number || String,
89
+ default () {
90
+ return 14
91
+ },
27
92
  }
28
93
  },
29
94
  data () {
@@ -47,12 +112,19 @@
47
112
  },
48
113
  render () {
49
114
  // render tab
50
- const renderHeaderTab = (params = {}) => {
115
+ const renderHeaderTab = (params = {}, index) => {
51
116
  const { text, type, count } = params
52
117
  const active = this.currentType === type
53
118
  const isUndefined = typeof count === 'undefined'
119
+ const marginRight = index === this.tabList.length - 1 ? null : this.marginRight
120
+ const color = active ? this.activeColor : this.defaultColor
121
+ const fontSize = active ? this.activeFontSize : this.defaultFontSize
54
122
 
55
- return <div class={['nav-item', active && 'active']} onClick={this.switchTab.bind(this, type)}>
123
+ return <div class={['nav-item', active && 'active']} style={{
124
+ marginRight: `${marginRight}px`,
125
+ color,
126
+ fontSize: `${fontSize}px`,
127
+ }} onClick={this.switchTab.bind(this, type)}>
56
128
  {text} {isUndefined ? '' : count}
57
129
  {active && <i class="item-border"></i>}
58
130
  </div>
@@ -60,8 +132,8 @@
60
132
 
61
133
  return <div class="hr-tab-nav">
62
134
  {
63
- this.tabList.map((item) => {
64
- return renderHeaderTab(item)
135
+ this.tabList.map((item, index) => {
136
+ return renderHeaderTab(item, index)
65
137
  })
66
138
  }
67
139
  {
@@ -103,6 +175,9 @@
103
175
  background: #a68cff;
104
176
  border-radius: 1.5px;
105
177
  }
178
+ &:last-child {
179
+ margin: 0;
180
+ }
106
181
  }
107
182
  .nav-slot {
108
183
  margin-left: auto;
@@ -0,0 +1,3 @@
1
+ import HrTimePicker from './src/index.vue'
2
+
3
+ export default HrTimePicker
@@ -0,0 +1,85 @@
1
+ <script>
2
+ import HrPopup from '../../hr-popup'
3
+
4
+ export default {
5
+ name: 'HrTimePicker',
6
+ components: {
7
+ HrPopup
8
+ },
9
+ props: {
10
+ show: {
11
+ type: Boolean,
12
+ default: false
13
+ },
14
+ // 挂载位置
15
+ getContainer: {
16
+ type: String,
17
+ default: 'body'
18
+ },
19
+ value: {
20
+ type: String | Date
21
+ },
22
+ // 标题
23
+ title: String,
24
+ // 时间类型,可选值为 datetime date time year-month
25
+ type: {
26
+ type: String,
27
+ default: 'datetime'
28
+ },
29
+ minDate: {
30
+ type: Date
31
+ },
32
+ maxDate: {
33
+ type: Date
34
+ },
35
+ formatter: {
36
+ type: Function
37
+ },
38
+ filter: {
39
+ type: Function
40
+ }
41
+ },
42
+ data () {
43
+ return {
44
+ isShowPopup: false,
45
+ timeValue: ''
46
+ }
47
+ },
48
+ watch: {
49
+ show: {
50
+ handler (val) {
51
+ this.isShowPopup = val
52
+ if (val) {
53
+ this.timeValue = this.value || ''
54
+ }
55
+ },
56
+ immediate: true
57
+ }
58
+ },
59
+ render () {
60
+ const { type, title, minDate, maxDate, formatter, filter } = this.$props
61
+
62
+ return (
63
+ <HrPopup show={this.isShowPopup}
64
+ get-container={this.getContainer}
65
+ position="bottom"
66
+ safe-area-inset-bottom
67
+ onClose={() => this.$emit('cancel')}>
68
+ <div class="hr-fe-together-build-hr-time-picker">
69
+ <van-datetime-picker
70
+ value={this.timeValue}
71
+ type={type}
72
+ title={title}
73
+ min-date={minDate}
74
+ max-date={maxDate}
75
+ formatter={formatter}
76
+ filter={filter}
77
+ onChange={(instance) => this.$emit('change', instance)}
78
+ onConfirm={(val) => this.$emit('confirm', val)}
79
+ onCancel={() => this.$emit('cancel')}></van-datetime-picker>
80
+ </div>
81
+ </HrPopup>
82
+ )
83
+ }
84
+ }
85
+ </script>
@@ -0,0 +1,7 @@
1
+ import hrVirtualList from './src/index.vue'
2
+
3
+ hrVirtualList.install = function (Vue) {
4
+ Vue.component(hrVirtualList.name, hrVirtualList);
5
+ };
6
+
7
+ export default hrVirtualList;