@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,117 @@
1
+ <script>
2
+ export default {
3
+ name: 'HrFullScreen',
4
+ props: {
5
+ show: {
6
+ type: Boolean,
7
+ default: false
8
+ },
9
+ title: {
10
+ type: String,
11
+ default: '标题'
12
+ }
13
+ },
14
+ computed: {
15
+ showPop: {
16
+ get () {
17
+ return this.show
18
+ },
19
+ set (val) {
20
+ this.$emit('update:show', val)
21
+ }
22
+ },
23
+ },
24
+ methods: {
25
+ changePopup (val) {
26
+ this.showPop = val
27
+ }
28
+ },
29
+ render () {
30
+ const myHeader = () => {
31
+ return (
32
+ <div class="screen-title">
33
+ <div onClick={() => this.showPop = false} class="title-left">
34
+ <div class="title-back">
35
+ <ks-icon name="arrow-left" />
36
+ </div>
37
+ <div class="title-text">{this.title}</div>
38
+ </div>
39
+ </div>
40
+ )
41
+ }
42
+ const popupAttrs = {
43
+ props: {
44
+ value: this.showPop,
45
+ overlay: false,
46
+ duration: 0,
47
+ getContainer: 'body'
48
+ },
49
+ style: {
50
+ width: '100%',
51
+ height: '100%'
52
+ },
53
+ on: {
54
+ input: this.changePopup,
55
+ },
56
+ }
57
+ return (
58
+ <van-popup {...popupAttrs}>
59
+ <div class="hr-full-screen">
60
+ {myHeader()}
61
+ <div class="page">{this.$slots.default}</div>
62
+ </div>
63
+ </van-popup>
64
+ )
65
+ }
66
+ }
67
+ </script>
68
+ <style lang="less" scoped>
69
+ .hr-full-screen {
70
+ width: 100%;
71
+ height: 100%;
72
+ overflow: hidden;
73
+ display: flex;
74
+ flex-direction: column;
75
+ background: #7972fe;
76
+ .screen-title {
77
+ padding-left: 16px;
78
+ padding-bottom: 8px;
79
+ box-sizing: content-box;
80
+ display: flex;
81
+ background: #7972fe;
82
+ height: 44px;
83
+ line-height: 44px;
84
+ color: #fff;
85
+ .title-left {
86
+ display: flex;
87
+ .title-back {
88
+ font-size: 22px;
89
+ font-weight: 500;
90
+ display: flex;
91
+ align-items: center;
92
+ }
93
+ .title-text {
94
+ margin-left: 4px;
95
+ font-size: 16px;
96
+ font-weight: 500;
97
+ }
98
+ }
99
+ }
100
+ .page {
101
+ flex: 1;
102
+ display: flex;
103
+ flex-direction: column;
104
+ background-color: #ffffff;
105
+ color: #03050d;
106
+ min-height: calc(100% - 52px);
107
+ }
108
+ }
109
+ .ios .hr-full-screen .screen-title,
110
+ .ipx .hr-full-screen .screen-title {
111
+ padding-top: 44px !important;
112
+ }
113
+ .ios .hr-full-screen .page,
114
+ .ipx .hr-full-screen .page {
115
+ min-height: calc(100% - 96px) !important;
116
+ }
117
+ </style>
@@ -66,6 +66,7 @@
66
66
  }
67
67
  .information-value {
68
68
  flex: 1;
69
+ word-break: break-all;
69
70
  }
70
71
  }
71
72
  </style>
@@ -55,7 +55,7 @@
55
55
  return this.margin
56
56
  }
57
57
  },
58
- selfAdaption: {
58
+ selfAdaption: { // 是否自适应
59
59
  type: Boolean,
60
60
  default () {
61
61
  return false
@@ -127,16 +127,15 @@
127
127
  },
128
128
  render () {
129
129
  const width = this.selfAdaption ? null : `calc((100% - ${this.margin * (this.divideeQually - 1)}px) / ${this.divideeQually})`
130
- const marginBottom = this.selfAdaption ? null : `${this.marginBottom}px`
131
- const gap = this.selfAdaption ? `${this.margin}px` : null
130
+ const marginBottom = `${this.marginBottom}px`
132
131
  return <div class="multiterm-choose">
133
132
  {
134
133
  this.title && <div class="choose-title">{this.title}</div>
135
134
  }
136
- <div class="choose-condition" style={{ gap }}>
135
+ <div class="choose-condition">
137
136
  {
138
137
  this.concatList.map((item, index) => {
139
- const marginRight = this.selfAdaption ? null : `${(index + 1) % this.divideeQually === 0 ? 0 : this.margin}px`
138
+ const marginRight = this.selfAdaption ? `${this.margin}px` : `${(this.index + 1) % this.divideeQually === 0 ? 0 : this.margin}px`
140
139
  return <div
141
140
  onClick={this.select.bind(this, index)}
142
141
  style={{ width, marginRight, marginBottom }}
@@ -0,0 +1,7 @@
1
+ import HrNotificationDialog from './src/index.vue'
2
+
3
+ HrNotificationDialog.install = function (Vue) {
4
+ Vue.component(HrNotificationDialog.name, HrNotificationDialog)
5
+ }
6
+
7
+ export default HrNotificationDialog
@@ -0,0 +1,293 @@
1
+ <template>
2
+ <ks-popup v-model="popupShow"
3
+ @click-overlay="onMaskClose"
4
+ :close-on-click-overlay="this.confirmCountDown > 0 ? false : closeOnClickOverlay"
5
+ :get-container="getContainer"
6
+ :overlay="overlay"
7
+ class="popup">
8
+ <transition name="van-fade">
9
+ <div v-show="show"
10
+ class="notification-popup"
11
+ @click.stop>
12
+ <!-- 顶部图片 -->
13
+ <div class="notification-popup-header"
14
+ v-if="showHeader">
15
+ <!-- 插槽内容 -->
16
+ <template v-if="$slots.top">
17
+ <slot name="top"></slot>
18
+ </template>
19
+ <img v-else
20
+ :src="headerImg"
21
+ alt="img">
22
+ </div>
23
+ <!-- 中间内容 -->
24
+ <div :class="['notification-popup-content', {'showRadio': !showConfirmBtn && !showCancelBtn && !$slots.btn && showHeader, 'showRadio-t': !showHeader, 'showBorder': !$slots.default}]">
25
+ <!-- 插槽内容 -->
26
+ <template v-if="$slots.default">
27
+ <slot></slot>
28
+ </template>
29
+ <!-- 默认样式内容 -->
30
+ <template v-else>
31
+ <div v-if="contentHeader"
32
+ class="notification-popup-content-header">{{contentHeader}}</div>
33
+ <div v-if="contentText"
34
+ class="notification-popup-content-content"
35
+ :style="{textIndent: textIndent}">{{contentText}}</div>
36
+ </template>
37
+ </div>
38
+ <div class="notification-popup-bottom"
39
+ v-if="showConfirmBtn || showCancelBtn || $slots.btn">
40
+ <!-- 按钮插槽内容 -->
41
+ <template v-if="$slots.btn">
42
+ <slot name="btn"></slot>
43
+ </template>
44
+ <!-- 按钮默认样式 -->
45
+ <template v-else>
46
+ <ks-button v-if="showCancelBtn"
47
+ type="default"
48
+ size="large"
49
+ @click="onCancel"
50
+ :disabled="cancelCountDown > 0"
51
+ block>{{cancelText}}</ks-button>
52
+ <ks-button v-if="showConfirmBtn"
53
+ :class="{'margin-left': showCancelBtn}"
54
+ type="primary"
55
+ size="large"
56
+ @click="onConfirm"
57
+ :disabled="confirmCountDown > 0"
58
+ block>{{confirmText}}</ks-button>
59
+ </template>
60
+ </div>
61
+ </div>
62
+ </transition>
63
+ </ks-popup>
64
+ </template>
65
+
66
+ <script>
67
+ export default {
68
+ name: 'HrNotificationDialog',
69
+ model: {
70
+ prop: 'show',
71
+ event: 'onUpdate'
72
+ },
73
+ props: {
74
+ // 判断是否显示
75
+ show: {
76
+ type: Boolean,
77
+ default: false
78
+ },
79
+ // 判断是否显示顶部区域
80
+ showHeader: {
81
+ type: Boolean,
82
+ default: true
83
+ },
84
+ // 顶部图片
85
+ headerImg: {
86
+ type: String,
87
+ default: require('../images/header.png')
88
+ },
89
+ // 内容标题
90
+ contentHeader: {
91
+ type: String
92
+ },
93
+ // 内容
94
+ contentText: {
95
+ type: String
96
+ },
97
+ // 判断是否显示确认弹窗
98
+ showConfirmBtn: {
99
+ type: Boolean,
100
+ default: true
101
+ },
102
+ // 判断是否显示取消弹窗
103
+ showCancelBtn: {
104
+ type: Boolean,
105
+ default: true
106
+ },
107
+ // 确定按钮默认文案
108
+ confirmBtnText: {
109
+ type: String,
110
+ default: '确认'
111
+ },
112
+ // 取消按钮默认文案
113
+ cancelBtnText: {
114
+ type: String,
115
+ default: '取消'
116
+ },
117
+ // 判断是否显示确认按钮的倒计时
118
+ showConfirmCountDown: {
119
+ type: Number,
120
+ default: 0
121
+ },
122
+ // 判断是否显示取消按钮的倒计时
123
+ showCancelCountDown: {
124
+ type: Number,
125
+ default: 0
126
+ },
127
+ // 内容首行缩进
128
+ textIndent: {
129
+ type: String,
130
+ default: '1em'
131
+ },
132
+ // 点击遮罩层关闭
133
+ closeOnClickOverlay: {
134
+ type: Boolean,
135
+ default: true
136
+ },
137
+ // 挂载元素位置
138
+ getContainer: {
139
+ type: [String, Function],
140
+ },
141
+ // 判断是否显示遮罩层
142
+ overlay: {
143
+ type: Boolean,
144
+ default: true
145
+ }
146
+ },
147
+ data () {
148
+ return {
149
+ popupShow: false, // 弹窗是否显示
150
+ confirmCountDown: 0, // 确认按钮倒计时
151
+ cancelCountDown: 0, // 取消按钮倒计时
152
+ timer: null, // 定时器
153
+ boxWidth: '' // 容器宽度
154
+ }
155
+ },
156
+ computed: {
157
+ // 确认按钮
158
+ confirmText () {
159
+ return this.confirmCountDown > 0 ? `${this.confirmBtnText}(${this.confirmCountDown})` : this.confirmBtnText
160
+ },
161
+ // 取消按钮
162
+ cancelText () {
163
+ return this.cancelCountDown > 0 ? `${this.cancelBtnText}(${this.cancelCountDown})` : this.cancelBtnText
164
+ }
165
+ },
166
+ watch: {
167
+ show: {
168
+ handler (val) {
169
+ if (val) {
170
+ if (this.showCancelCountDown && this.showCancelCountDown > 0) {
171
+ this.cancelCountDown = this.showCancelCountDown
172
+ // 启动定时器
173
+ this.startCountDown('cancelCountDown')
174
+ }
175
+ if (this.showConfirmCountDown && this.showConfirmCountDown > 0) {
176
+ this.confirmCountDown = this.showConfirmCountDown
177
+ // 启动定时器
178
+ this.startCountDown('confirmCountDown')
179
+ }
180
+ } else {
181
+ if (this.timer) {
182
+ this.clearTimer()
183
+ }
184
+ }
185
+ this.popupShow = val;
186
+ },
187
+ immediate: true
188
+ }
189
+ },
190
+ methods: {
191
+ /**
192
+ * 清除定时器
193
+ */
194
+ clearTimer () {
195
+ clearInterval(this.timer)
196
+ this.timer = null
197
+ },
198
+ /**
199
+ * 启动定时器
200
+ */
201
+ startCountDown (name) {
202
+ this.timer = setInterval(() => {
203
+ this[name]--
204
+ if (this[name] <= 0) {
205
+ this.clearTimer()
206
+ }
207
+ }, 1000)
208
+ },
209
+ /**
210
+ * 确认
211
+ */
212
+ onConfirm () {
213
+ this.$emit('onConfirm')
214
+ },
215
+ /**
216
+ * 取消
217
+ */
218
+ onCancel () {
219
+ this.$emit('onCancel')
220
+ },
221
+ /**
222
+ * 点击幕布取消
223
+ */
224
+ onMaskClose () {
225
+ // 如果还在倒计时 则不关闭
226
+ if (this.confirmCountDown > 0) return
227
+ this.$emit('onMask')
228
+ if (this.closeOnClickOverlay) {
229
+ this.$emit('onUpdate', false)
230
+ }
231
+ }
232
+ }
233
+ }
234
+ </script>
235
+
236
+ <style lang="less" scoped>
237
+ @radiusSize: 12px;
238
+ @radius: 0 0 @radiusSize @radiusSize;
239
+ .popup {
240
+ background-color: transparent;
241
+ top: 45%;
242
+ width: calc(100% - 80px);
243
+ }
244
+ .notification-popup {
245
+ box-sizing: border-box;
246
+ &-header {
247
+ height: 88px;
248
+ img {
249
+ width: 100%;
250
+ height: 100%;
251
+ // vertical-align: middle;
252
+ }
253
+ }
254
+ &-content {
255
+ padding: 20px;
256
+ background: #ffffff;
257
+ line-height: 22px;
258
+ &.showRadio {
259
+ border-radius: @radius;
260
+ }
261
+ &.showRadio-t {
262
+ border-radius: @radiusSize @radiusSize 0 0;
263
+ }
264
+ // 不加这个内容content区域上下会有未知的横线
265
+ &.showBorder {
266
+ border-top: 1px solid transparent;
267
+ }
268
+ &-header {
269
+ text-align: center;
270
+ font-size: 18px;
271
+ color: #1b2240;
272
+ margin-bottom: 12px;
273
+ font-weight: 500;
274
+ }
275
+ &-content {
276
+ font-size: 16px;
277
+ color: #1a2242;
278
+ font-size: 16px;
279
+ }
280
+ }
281
+ &-bottom {
282
+ // 不加这个内容content区域上下会有未知的横线
283
+ border-top: 1px solid transparent;
284
+ padding: 0 20px 20px;
285
+ border-radius: @radius;
286
+ background: #ffffff;
287
+ display: flex;
288
+ .margin-left {
289
+ margin-left: 15px;
290
+ }
291
+ }
292
+ }
293
+ </style>
@@ -4,4 +4,4 @@ hrPager.install = function (Vue) {
4
4
  Vue.component(hrPager.name, hrPager);
5
5
  };
6
6
 
7
- export default hrPager;
7
+ export default hrPager
@@ -28,6 +28,13 @@
28
28
  isFreeze: {
29
29
  default: false
30
30
  },
31
+ // 是否可以切换分页的钩子,为true可切换,为false不可切换
32
+ canTurnPageFn: {
33
+ type: Function,
34
+ default () {
35
+ return () => true
36
+ }
37
+ },
31
38
  },
32
39
  data () {
33
40
  return {
@@ -54,15 +61,32 @@
54
61
  }
55
62
  },
56
63
  methods: {
57
- nextPage () {
58
- if (this.nextDisabled) {
64
+ /**
65
+ * @description 校验是否可切换分页钩子
66
+ * @returns {Boolean} true-禁止切换 false-可切换
67
+ */
68
+ async isLimitSwitchPage () {
69
+ // 钩子存在,并且不可切换分页
70
+ if (this.canTurnPageFn && typeof this.canTurnPageFn === 'function') {
71
+ let canSwitchPage = await this.canTurnPageFn()
72
+ if (!canSwitchPage) {
73
+ return true
74
+ }
75
+ }
76
+ },
77
+ async nextPage () {
78
+ // 校验切分页钩子,判断是否可切换分页
79
+ let isLimitSwitch = await this.isLimitSwitchPage()
80
+ if (isLimitSwitch || this.nextDisabled) {
59
81
  return
60
82
  }
61
83
  this.currentIndex++
62
84
  this.$emit('turnPage', this.ids[this.currentIndex])
63
85
  },
64
- prevPage () {
65
- if (this.prevDisabled) {
86
+ async prevPage () {
87
+ // 校验切分页钩子,判断是否可切换分页
88
+ let isLimitSwitch = await this.isLimitSwitchPage()
89
+ if (isLimitSwitch || this.prevDisabled) {
66
90
  return
67
91
  }
68
92
  this.currentIndex--
@@ -77,19 +101,20 @@
77
101
  user-select: none;
78
102
  position: fixed;
79
103
  top: 45%;
104
+ left: 0;
80
105
  width: 100%;
81
106
  box-sizing: border-box;
82
- padding: 0 29px;
107
+ padding: 0 30px;
83
108
  > img {
84
109
  position: absolute;
85
- width: 97px;
86
- height: 97px;
110
+ width: 48px;
111
+ height: 48px;
87
112
  }
88
113
  .prev {
89
- left: 29px;
114
+ left: 14px;
90
115
  }
91
116
  .next {
92
- right: 29px;
117
+ right: 14px;
93
118
  }
94
119
  }
95
120
  </style>
@@ -0,0 +1,8 @@
1
+
2
+ import HrRadiobox from './src/radiobox.vue'
3
+
4
+ HrRadiobox.install = function (Vue) {
5
+ Vue.component(HrRadiobox.name, HrRadiobox)
6
+ }
7
+
8
+ export default HrRadiobox
@@ -0,0 +1,46 @@
1
+ export default class RadioboxItem {
2
+ constructor() {
3
+ this.value = ''
4
+ this.label = ''
5
+ this.selfAdaption = ''
6
+ this.divideeQually = ''
7
+ this.margin = ''
8
+ this.bottom = ''
9
+ this.index = ''
10
+ }
11
+
12
+ init (params = {}) {
13
+ this.initState(params)
14
+ }
15
+
16
+ initState (params) {
17
+ const { value, label, selfAdaption, divideeQually, margin, marginBottom, index } = params
18
+ this.value = value
19
+ this.label = label
20
+ this.selfAdaption = selfAdaption
21
+ this.divideeQually = divideeQually
22
+ this.margin = margin
23
+ this.bottom = marginBottom
24
+ this.index = index
25
+ }
26
+
27
+ getIndex () { }
28
+
29
+ get width () {
30
+ return this.selfAdaption ? null : `calc((100% - ${this.margin * (this.divideeQually - 1)}px) / ${this.divideeQually})`
31
+ }
32
+
33
+ get marginRight () {
34
+ return this.selfAdaption ? `${this.margin}px` : `${(this.index + 1) % this.divideeQually === 0 ? 0 : this.margin}px`
35
+ }
36
+
37
+ get marginBottom () {
38
+ return `${this.bottom}px`
39
+ }
40
+
41
+ }
42
+
43
+ export const CHOOSE_TYPE = {
44
+ SINGLE: 'single', // 单选
45
+ MULTIPLE: 'multiple' // 多选
46
+ }
@@ -0,0 +1,64 @@
1
+ <script>
2
+ export default {
3
+ name: 'HrRadioboxGroup',
4
+ provide () {
5
+ return {
6
+ divideeQually: this.divideeQually,
7
+ margin: this.margin,
8
+ marginBottom: this.marginBottom,
9
+ selfAdaption: this.selfAdaption,
10
+ }
11
+ },
12
+ props: {
13
+ divideeQually: {
14
+ type: Number,
15
+ default () {
16
+ return 3
17
+ }
18
+ },
19
+ margin: {
20
+ type: Number,
21
+ default () {
22
+ return 12
23
+ }
24
+ },
25
+ selfAdaption: {
26
+ type: Boolean,
27
+ default () {
28
+ return false
29
+ }
30
+ },
31
+ value: {
32
+ type: String || Number,
33
+ default () {
34
+ return []
35
+ }
36
+ },
37
+ marginBottom: {
38
+ type: Number,
39
+ default () {
40
+ return this.margin
41
+ }
42
+ },
43
+ },
44
+ data () {
45
+ return {}
46
+ },
47
+ methods: {},
48
+ render () {
49
+ return <div class="hr-radiobox-group">
50
+ {
51
+ this.$slots.default
52
+ }
53
+ </div>
54
+ }
55
+ }
56
+ </script>
57
+
58
+ <style scoped lang="less">
59
+ .hr-radiobox-group {
60
+ display: flex;
61
+ flex-wrap: wrap;
62
+ justify-content: flex-start;
63
+ }
64
+ </style>