@kyfe/hroa-ui 1.0.6 → 1.0.7

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 (244) hide show
  1. package/dist/hroa-ui.common.js +133 -2576
  2. package/dist/hroa-ui.css +1 -1
  3. package/dist/hroa-ui.umd.js +133 -2576
  4. package/dist/hroa-ui.umd.min.js +2 -2
  5. package/lib/hr-add-list/index.js +1 -1
  6. package/lib/hr-bottom-button/index.js +1 -1
  7. package/lib/hr-breadcrumb/index.js +1 -1
  8. package/lib/hr-button/index.js +1 -1
  9. package/lib/hr-checkbox/index.js +1 -1
  10. package/lib/hr-checkbox-group/index.js +1 -1
  11. package/lib/hr-clipboard/index.js +1 -1
  12. package/lib/hr-collapse-card/index.js +1 -1
  13. package/lib/hr-condition-filtrate/index.js +1 -1
  14. package/lib/hr-condition-filtrate-popup/index.js +1 -1
  15. package/lib/hr-date-filter/index.css +1 -1
  16. package/lib/hr-date-filter/index.js +1 -1
  17. package/lib/hr-dropdown-date/index.css +1 -1
  18. package/lib/hr-dropdown-date/index.js +1 -1
  19. package/lib/hr-elasticity-box/index.js +1 -1
  20. package/lib/hr-elasticity-box-item/index.js +1 -1
  21. package/lib/hr-emotional-picture/index.js +1 -1
  22. package/lib/hr-employee-choose/index.js +1 -1
  23. package/lib/hr-file-list/index.js +1 -1
  24. package/lib/hr-full-screen/index.js +1 -1
  25. package/lib/hr-img-list/index.css +1 -1
  26. package/lib/hr-img-list/index.js +1 -1
  27. package/lib/hr-info-card/index.js +1 -1
  28. package/lib/hr-information/index.js +1 -1
  29. package/lib/hr-license-plate-number/index.js +1 -1
  30. package/lib/hr-module-card/index.js +1 -1
  31. package/lib/hr-multiterm-choose/index.css +1 -1
  32. package/lib/hr-multiterm-choose/index.js +1 -1
  33. package/lib/hr-no-data/index.js +1 -1
  34. package/lib/hr-notice-bar/index.js +1 -1
  35. package/lib/hr-notification-dialog/index.js +1 -1
  36. package/lib/hr-open-ks/index.js +1 -1
  37. package/lib/hr-pager/index.js +1 -1
  38. package/lib/hr-popup/index.js +1 -1
  39. package/lib/hr-preview-file/index.js +1 -1
  40. package/lib/hr-radiobox/index.js +1 -1
  41. package/lib/hr-radiobox-group/index.js +1 -1
  42. package/lib/hr-rate/index.js +1 -1
  43. package/lib/hr-reason-textarea/index.js +1 -1
  44. package/lib/hr-search-input/index.js +1 -1
  45. package/lib/hr-search-tips/index.js +1 -1
  46. package/lib/hr-select/index.js +1 -1
  47. package/lib/hr-select-list/index.js +1 -1
  48. package/lib/hr-single-choose/index.css +1 -1
  49. package/lib/hr-single-choose/index.js +1 -1
  50. package/lib/hr-slide-pager/index.js +1 -1
  51. package/lib/hr-sort/index.js +1 -1
  52. package/lib/hr-stack-image/index.js +1 -1
  53. package/lib/hr-tab-nav/index.js +1 -1
  54. package/lib/hr-time-picker/index.js +1 -1
  55. package/lib/hr-view-item/index.js +1 -1
  56. package/lib/hr-virtual-list/index.js +1 -1
  57. package/lib/index/index.css +1 -1
  58. package/lib/index/index.js +2 -2
  59. package/lib/utils/index.js +1 -1
  60. package/package.json +12 -9
  61. package/lib/getJsModule/index.css +0 -1
  62. package/lib/getJsModule/index.js +0 -9
  63. package/packages/getJsModule.js +0 -11
  64. package/packages/hr-add-list/image/add.svg +0 -1
  65. package/packages/hr-add-list/image/close.svg +0 -1
  66. package/packages/hr-add-list/index.js +0 -7
  67. package/packages/hr-add-list/src/index.vue +0 -125
  68. package/packages/hr-add-list//346/226/260/345/242/236/345/244/232/347/254/224/346/225/260/346/215/256.md +0 -0
  69. package/packages/hr-bottom-button/index.js +0 -7
  70. package/packages/hr-bottom-button/src/index.vue +0 -128
  71. package/packages/hr-breadcrumb/index.js +0 -3
  72. package/packages/hr-breadcrumb/src/index.vue +0 -87
  73. package/packages/hr-breadcrumb//351/235/242/345/214/205/345/261/221.md +0 -0
  74. package/packages/hr-button/index.js +0 -13
  75. package/packages/hr-button/src/hr-button.vue +0 -39
  76. package/packages/hr-checkbox/index.js +0 -8
  77. package/packages/hr-checkbox/src/active-icon.png +0 -0
  78. package/packages/hr-checkbox/src/checkbox-group.vue +0 -74
  79. package/packages/hr-checkbox/src/checkbox.vue +0 -226
  80. package/packages/hr-checkbox/src/data.js +0 -46
  81. 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
  82. package/packages/hr-checkbox-group/index.js +0 -8
  83. package/packages/hr-clipboard/index.js +0 -8
  84. package/packages/hr-clipboard/src/index.vue +0 -46
  85. package/packages/hr-clipboard/src/util.js +0 -9
  86. package/packages/hr-collapse-card/index.js +0 -3
  87. package/packages/hr-collapse-card/src/images/icon_up.png +0 -0
  88. package/packages/hr-collapse-card/src/index.vue +0 -151
  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-condition-filtrate/enum/index.js +0 -11
  91. package/packages/hr-condition-filtrate/image/arrow-right.png +0 -0
  92. package/packages/hr-condition-filtrate/index.js +0 -7
  93. package/packages/hr-condition-filtrate/src/employee-choose/index.vue +0 -101
  94. package/packages/hr-condition-filtrate/src/index.vue +0 -246
  95. package/packages/hr-condition-filtrate/src/multiterm-choose/index.vue +0 -167
  96. package/packages/hr-condition-filtrate/src/org-tree-choose/index.vue +0 -102
  97. package/packages/hr-condition-filtrate/src/single-choose/index.vue +0 -144
  98. package/packages/hr-condition-filtrate/src/text-input/index.vue +0 -60
  99. package/packages/hr-condition-filtrate/src/time-selector/date-range-select.vue +0 -154
  100. package/packages/hr-condition-filtrate/src/time-selector/images/date-icon.png +0 -0
  101. package/packages/hr-condition-filtrate/src/time-selector/index.vue +0 -380
  102. package/packages/hr-condition-filtrate/src/time-selector/utils/constant.js +0 -30
  103. package/packages/hr-condition-filtrate/src/time-selector/utils/tools.js +0 -213
  104. package/packages/hr-condition-filtrate-popup/index.js +0 -7
  105. package/packages/hr-condition-filtrate-popup/src/index.vue +0 -236
  106. package/packages/hr-date-filter/index.js +0 -7
  107. package/packages/hr-date-filter/src/date-select.vue +0 -153
  108. package/packages/hr-date-filter/src/index.vue +0 -243
  109. package/packages/hr-date-filter/src/style.less +0 -130
  110. package/packages/hr-date-filter/src/utils.js +0 -109
  111. package/packages/hr-dropdown-date/index.js +0 -7
  112. package/packages/hr-dropdown-date/src/calendar/calendar.js +0 -128
  113. package/packages/hr-dropdown-date/src/calendar/calendar.vue +0 -485
  114. package/packages/hr-dropdown-date/src/calendar/images/arrow@3x.png +0 -0
  115. package/packages/hr-dropdown-date/src/calendar/index.js +0 -5
  116. package/packages/hr-dropdown-date/src/date-picker/date-range-select.vue +0 -92
  117. package/packages/hr-dropdown-date/src/date-picker/month-range-select.vue +0 -128
  118. package/packages/hr-dropdown-date/src/date-picker/month-select.vue +0 -98
  119. package/packages/hr-dropdown-date/src/date-picker/style.less +0 -120
  120. package/packages/hr-dropdown-date/src/date-picker/utils.js +0 -109
  121. package/packages/hr-dropdown-date/src/index.vue +0 -482
  122. package/packages/hr-dropdown-date/src/week.js +0 -194
  123. package/packages/hr-elasticity-box/index.js +0 -7
  124. package/packages/hr-elasticity-box/src/elasticity-box-item.vue +0 -61
  125. package/packages/hr-elasticity-box/src/index.vue +0 -52
  126. package/packages/hr-elasticity-box-item/index.js +0 -7
  127. package/packages/hr-emotional-picture/index.js +0 -7
  128. package/packages/hr-emotional-picture/src/index.vue +0 -66
  129. package/packages/hr-emotional-picture//346/203/205/346/204/237/345/233/276/347/273/204/344/273/266.md +0 -0
  130. package/packages/hr-employee-choose/index.js +0 -7
  131. package/packages/hr-employee-choose/src/image/arrow-right.png +0 -0
  132. package/packages/hr-employee-choose/src/index.vue +0 -119
  133. package/packages/hr-file-list/index.js +0 -3
  134. package/packages/hr-file-list/src/file-type/other.vue +0 -45
  135. package/packages/hr-file-list/src/file-type/picture.vue +0 -38
  136. package/packages/hr-file-list/src/file-type/video.vue +0 -60
  137. package/packages/hr-file-list/src/index.vue +0 -246
  138. package/packages/hr-file-list/src/utils/enum.js +0 -95
  139. package/packages/hr-file-list/src/utils/fun.js +0 -16
  140. package/packages/hr-file-list//346/226/207/344/273/266/345/210/227/350/241/250.md +0 -0
  141. package/packages/hr-full-screen/index.js +0 -7
  142. package/packages/hr-full-screen/src/index.vue +0 -117
  143. package/packages/hr-img-list/index.js +0 -3
  144. package/packages/hr-img-list/src/index.vue +0 -144
  145. package/packages/hr-img-list//345/244/232/345/233/276/345/210/227/350/241/250.md +0 -0
  146. package/packages/hr-info-card/index.js +0 -7
  147. package/packages/hr-info-card/src/index.vue +0 -67
  148. package/packages/hr-information/index.js +0 -7
  149. package/packages/hr-information/src/index.vue +0 -72
  150. package/packages/hr-license-plate-number/index.js +0 -8
  151. package/packages/hr-license-plate-number/src/enum.js +0 -44
  152. package/packages/hr-license-plate-number/src/index.vue +0 -164
  153. package/packages/hr-license-plate-number/src/vnp-keyboard.vue +0 -182
  154. package/packages/hr-license-plate-number//350/275/246/347/211/214/345/217/267/345/274/271/347/252/227.md +0 -0
  155. package/packages/hr-module-card/index.js +0 -13
  156. package/packages/hr-module-card/src/index.vue +0 -132
  157. package/packages/hr-module-card//346/250/241/345/235/227/345/215/241/347/211/207/347/273/204/344/273/266.md +0 -29
  158. package/packages/hr-multiterm-choose/index.js +0 -8
  159. package/packages/hr-multiterm-choose/src/active-icon.png +0 -0
  160. package/packages/hr-multiterm-choose/src/index.vue +0 -224
  161. package/packages/hr-multiterm-choose//345/244/232/351/200/211/346/241/206.md +0 -0
  162. package/packages/hr-no-data/index.js +0 -7
  163. package/packages/hr-no-data/src/index.vue +0 -48
  164. package/packages/hr-notice-bar/index.js +0 -7
  165. package/packages/hr-notice-bar/src/bem.js +0 -38
  166. package/packages/hr-notice-bar/src/index.js +0 -52
  167. package/packages/hr-notice-bar//351/200/232/347/237/245/346/240/217/347/273/204/344/273/266.md +0 -3
  168. package/packages/hr-notification-dialog/images/header.png +0 -0
  169. package/packages/hr-notification-dialog/index.js +0 -7
  170. package/packages/hr-notification-dialog/src/index.vue +0 -293
  171. 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
  172. package/packages/hr-open-ks/index.js +0 -7
  173. package/packages/hr-open-ks/src/icon.png +0 -0
  174. package/packages/hr-open-ks/src/index.vue +0 -97
  175. package/packages/hr-open-ks/src/util.js +0 -31
  176. package/packages/hr-pager/images/next-page.png +0 -0
  177. package/packages/hr-pager/images/prev-page.png +0 -0
  178. package/packages/hr-pager/index.js +0 -7
  179. package/packages/hr-pager/src/index.vue +0 -120
  180. package/packages/hr-pager//346/214/211/351/222/256/347/277/273/351/241/265/347/273/204/344/273/266.md +0 -0
  181. package/packages/hr-popup/index.js +0 -3
  182. package/packages/hr-popup/src/index.vue +0 -64
  183. package/packages/hr-popup//345/274/271/345/207/272/345/261/202.md +0 -0
  184. package/packages/hr-preview-file/index.js +0 -7
  185. package/packages/hr-preview-file/src/index.vue +0 -58
  186. package/packages/hr-preview-file/src/util.js +0 -50
  187. package/packages/hr-radiobox/index.js +0 -8
  188. package/packages/hr-radiobox/src/data.js +0 -46
  189. package/packages/hr-radiobox/src/radiobox-group.vue +0 -64
  190. package/packages/hr-radiobox/src/radiobox.vue +0 -191
  191. package/packages/hr-radiobox-group/index.js +0 -8
  192. package/packages/hr-rate/index.js +0 -7
  193. package/packages/hr-rate/src/index.vue +0 -42
  194. package/packages/hr-rate//350/257/204/345/210/206/347/273/204/344/273/266/357/274/210/345/270/246/346/226/207/346/241/210/357/274/211.md +0 -0
  195. package/packages/hr-reason-textarea/index.js +0 -7
  196. package/packages/hr-reason-textarea/src/index.vue +0 -128
  197. package/packages/hr-search-input/image/input-close-icon.png +0 -0
  198. package/packages/hr-search-input/image/search-icon.png +0 -0
  199. package/packages/hr-search-input/index.js +0 -8
  200. package/packages/hr-search-input/src/index.vue +0 -144
  201. package/packages/hr-search-tips/index.js +0 -3
  202. package/packages/hr-search-tips/src/index.vue +0 -213
  203. 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
  204. package/packages/hr-select/index.js +0 -7
  205. package/packages/hr-select/src/index.vue +0 -41
  206. package/packages/hr-select-list/index.js +0 -3
  207. package/packages/hr-select-list/src/index.vue +0 -214
  208. package/packages/hr-select-list//344/270/213/346/213/211/351/200/211/346/213/251(/351/273/230/350/256/244/345/244/232/351/200/211).md +0 -0
  209. package/packages/hr-single-choose/index.js +0 -8
  210. package/packages/hr-single-choose/src/index.vue +0 -195
  211. package/packages/hr-single-choose//345/215/225/351/200/211/346/241/206.md +0 -0
  212. package/packages/hr-slide-pager/guide/image/turn-left.png +0 -0
  213. package/packages/hr-slide-pager/guide/image/turn-right.png +0 -0
  214. package/packages/hr-slide-pager/guide/index.vue +0 -59
  215. package/packages/hr-slide-pager/guide//346/226/260/346/211/213/346/214/207/345/274/225.md +0 -0
  216. package/packages/hr-slide-pager/index.js +0 -7
  217. package/packages/hr-slide-pager/src/index.vue +0 -374
  218. package/packages/hr-slide-pager//346/273/221/345/212/250/347/277/273/351/241/265/347/273/204/344/273/266.md +0 -0
  219. package/packages/hr-sort/index.js +0 -3
  220. package/packages/hr-sort/src/main.vue +0 -133
  221. package/packages/hr-sort//346/216/222/345/272/217.md +0 -0
  222. package/packages/hr-stack-image/index.js +0 -3
  223. package/packages/hr-stack-image/src/main.vue +0 -77
  224. package/packages/hr-stack-image//345/261/202/345/217/240/345/233/276/347/211/207/347/273/204/344/273/266.md +0 -0
  225. package/packages/hr-tab-nav/index.js +0 -8
  226. package/packages/hr-tab-nav/src/index.vue +0 -190
  227. package/packages/hr-time-picker/index.js +0 -3
  228. package/packages/hr-time-picker/src/index.vue +0 -85
  229. package/packages/hr-time-picker//346/227/266/351/227/264/351/200/211/346/213/251/345/231/250.md +0 -0
  230. package/packages/hr-view-item/index.js +0 -13
  231. package/packages/hr-view-item/src/index.vue +0 -89
  232. package/packages/hr-view-item//350/241/250/345/215/225/351/241/271item/345/261/225/347/244/272.md +0 -0
  233. package/packages/hr-virtual-list/index.js +0 -7
  234. package/packages/hr-virtual-list/src/cc-item.vue +0 -105
  235. package/packages/hr-virtual-list/src/index.vue +0 -227
  236. package/packages/hr-virtual-list//350/231/232/346/213/237/345/210/227/350/241/250.md +0 -0
  237. package/packages/index.js +0 -23
  238. package/packages/utils/directive/common.js +0 -0
  239. package/packages/utils/directive/index.js +0 -2
  240. package/packages/utils/directive/specific.js +0 -54
  241. package/packages/utils/index.js +0 -7
  242. package/packages/utils/tool/common.js +0 -65
  243. package/packages/utils/tool/index.js +0 -2
  244. package/packages/utils/tool/specific.js +0 -0
@@ -1,144 +0,0 @@
1
- <script>
2
- export default {
3
- name: 'HrSearchInput',
4
- props: {
5
- menuConfig: {
6
- type: Object,
7
- default () {
8
- return {
9
- id: '151596034994370809',
10
- code: '41f7a32add1745c99c7fecd5ee83f41c'
11
- }
12
- }
13
- },
14
- placeholder: {
15
- type: String,
16
- default () {
17
- return '搜索'
18
- }
19
- }
20
- },
21
- data () {
22
- return {
23
- searchParam: '',
24
- isShowinputBox: false
25
- }
26
- },
27
- methods: {
28
- search (searchParam) {
29
- this.searchParam = searchParam
30
- this.isShowinputBox = false
31
- this.$emit('search', this.searchParam)
32
- }
33
- },
34
- render () {
35
- const { id, code } = this.menuConfig
36
- {/* render ipnput bar */ }
37
- const renderInputBar = () => {
38
- return <div class="input-bar">
39
- <van-search
40
- left-icon={require('../image/search-icon.png')}
41
- readonly
42
- value={this.searchParam}
43
- onClick={() => {
44
- this.isShowinputBox = true
45
- }}
46
- placeholder={this.placeholder} />
47
- {
48
- this.searchParam && <img
49
- class="bar-close"
50
- onClick={(event) => {
51
- event.stopPropagation()
52
- this.search('')
53
- }}
54
- src={require('../image/input-close-icon.png')} />
55
- }
56
- </div>
57
- }
58
-
59
- {/* render input box */ }
60
- const renderInputBox = () => {
61
- return <div class="input-box">
62
- <header class="box-header ksui-header">
63
- <div class="ksui-nav">
64
- <ks-nav-bar
65
- title="搜索"
66
- left-arrow={true}
67
- onClick-left={() => {
68
- this.isShowinputBox = false
69
- }}>
70
- </ks-nav-bar>
71
- </div>
72
- </header>
73
- <div class="box-content ksui-body">
74
- <div class="content-bar">
75
- <ks-history-search
76
- placeholder={this.placeholder}
77
- onSearch={this.search}
78
- value={this.searchParam}
79
- onSelect={this.search}
80
- onCancel={this.search}
81
- left-icon={require('../image/search-icon.png')}
82
- menuId={id}
83
- code={code}>
84
- </ks-history-search>
85
- </div>
86
- </div>
87
- </div>
88
- }
89
-
90
- return <div class="hr-search-input">
91
- {renderInputBar()}
92
- {this.isShowinputBox && renderInputBox()}
93
- </div>
94
- }
95
- }
96
- </script>
97
-
98
- <style scoped lang="less">
99
- .hr-search-input {
100
- display: flex;
101
- padding-bottom: 10px;
102
- .input-bar {
103
- overflow: hidden;
104
- border-radius: 8px;
105
- flex: 1;
106
- position: relative;
107
- background: #ffffff;
108
- .van-search {
109
- padding: 0 !important;
110
- .van-search__content {
111
- background: #ffffff;
112
- }
113
- }
114
- .bar-close {
115
- width: 16px;
116
- height: 16px;
117
- position: absolute;
118
- right: 14px;
119
- top: 50%;
120
- transform: translate(0, -50%);
121
- }
122
- }
123
- .input-box {
124
- position: fixed;
125
- left: 0;
126
- top: 0;
127
- width: 100%;
128
- height: 100%;
129
- background: #fff;
130
- .box-content {
131
- .content-bar {
132
- /deep/.van-search {
133
- .van-search__content {
134
- background: #f7f8fa;
135
- }
136
- }
137
- }
138
- }
139
- }
140
- }
141
- .van-search .van-cell {
142
- padding: 6px 8px 6px 0;
143
- }
144
- </style>
@@ -1,3 +0,0 @@
1
- import HrSearchTips from './src/index.vue'
2
-
3
- export default HrSearchTips
@@ -1,213 +0,0 @@
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>
@@ -1,7 +0,0 @@
1
- import HrSelect from './src/index.vue'
2
-
3
- HrSelect.install = function (Vue) {
4
- Vue.component(HrSelect.name, HrSelect)
5
- }
6
-
7
- export default HrSelect
@@ -1,41 +0,0 @@
1
- <template>
2
- <div>
3
- <ks-field readonly
4
- clickable
5
- v-bind="$attrs"
6
- :placeholder="placeholder"
7
- @click="show = true" />
8
- <ks-popup v-model="show"
9
- v-bind="$attrs"
10
- position="bottom"
11
- :round="true">
12
- <ks-picker show-toolbar
13
- v-bind="$attrs"
14
- @cancel="show = false"
15
- @confirm="confirm" />
16
- </ks-popup>
17
- </div>
18
- </template>
19
-
20
- <script>
21
- export default {
22
- name: 'HrSelect',
23
- props: {
24
- placeholder: {
25
- type: String,
26
- default: '请选择'
27
- },
28
- },
29
- data () {
30
- return {
31
- show: false
32
- }
33
- },
34
- methods: {
35
- confirm (val) {
36
- this.$emit('select', val)
37
- this.show = false
38
- }
39
- }
40
- }
41
- </script>
@@ -1,3 +0,0 @@
1
- import HrSelectList from './src/index.vue'
2
-
3
- export default HrSelectList
@@ -1,214 +0,0 @@
1
- <script>
2
- import { cloneDeep } from 'lodash'
3
- import HrPopup from '../../hr-popup'
4
-
5
- export default {
6
- name: 'HrSelectList',
7
- components: {
8
- HrPopup
9
- },
10
- props: {
11
- show: {
12
- type: Boolean,
13
- default: false
14
- },
15
- // 标题
16
- title: String,
17
- // 默认值
18
- defaultValue: {
19
- type: [String, Array, Number],
20
- default: ''
21
- },
22
- // 选项value用到的字段
23
- valKey: {
24
- type: String,
25
- default: 'code'
26
- },
27
- // 选项显示值用到的字段
28
- labelKey: {
29
- type: String,
30
- default: 'text'
31
- },
32
- // 是否多选
33
- multiple: {
34
- type: Boolean,
35
- default: false
36
- },
37
- // 选项列
38
- columns: {
39
- type: Array,
40
- default: () => ([])
41
- },
42
- // 挂载位置
43
- getContainer: {
44
- type: String,
45
- default: 'body'
46
- },
47
- closeable: {
48
- type: Boolean
49
- },
50
- // 弹出位置,可选值为 top bottom right left
51
- position: {
52
- type: String,
53
- default: 'bottom'
54
- },
55
- // 展示确认按钮
56
- showSubmitBtn: {
57
- type: Boolean,
58
- default: true
59
- },
60
- // 确定按钮文本
61
- submitBtnTxt: {
62
- type: String,
63
- default: '确定'
64
- }
65
- },
66
- data () {
67
- return {
68
- isShowPopup: false,
69
- selectValue: [],
70
- popupStyle: ''
71
- }
72
- },
73
- watch: {
74
- position: {
75
- handler (val) {
76
- const positionCls = {
77
- top: 'border-radius: 0 0 10px 10px',
78
- bottom: 'border-radius: 10px 10px 0 0',
79
- left: 'border-radius: 0 10px 10px 0',
80
- right: 'border-radius: 10px 0 0 10px '
81
- }
82
- this.popupStyle = positionCls[val] || 'border-radius: 0'
83
- },
84
- immediate: true
85
- },
86
- show: {
87
- handler (val) {
88
- this.isShowPopup = val
89
- if (val) {
90
- this.loadValue()
91
- }
92
- },
93
- immediate: true
94
- }
95
- },
96
- render () {
97
- return (
98
- // get-container挂载在body的原因:防止被外部组件内容遮挡
99
- <HrPopup show={this.isShowPopup}
100
- get-container={this.getContainer}
101
- closeable={this.closeable}
102
- position={this.position}
103
- popupStyle={this.popupStyle}
104
- safe-area-inset-bottom={this.position === 'bottom'}
105
- title={this.title}
106
- onClose={this.close}>
107
- <div class="hr-select-list">
108
- <div class="list-box">
109
- {
110
- this.columns.map((item) => {
111
- return <div class={['option-item', this.isSelectedOption(item[this.valKey]) ? 'active' : '']}
112
- onClick={() => this.optionClick(item[this.valKey])}>
113
- {item[this.labelKey]}
114
- <div class="check-box">
115
- {
116
- this.isSelectedOption(item[this.valKey]) && <ks-icon name="success" class="icon-cls" />
117
- }
118
- </div>
119
- </div>
120
- })
121
- }
122
- </div>
123
- {this.showSubmitBtn && <div class="submit-btn" onClick={this.submit}>{this.submitBtnTxt}</div>}
124
- </div>
125
- </HrPopup>
126
- )
127
- },
128
- methods: {
129
- loadValue () {
130
- const val = cloneDeep(this.defaultValue)
131
- if (Object.prototype.toString.call(val) === '[object String]') {
132
- this.selectValue = val ? [val] : []
133
- } else if (Object.prototype.toString.call(val) === '[object Number]') {
134
- this.selectValue = String(val) ? [String(val)] : []
135
- } else {
136
- this.selectValue = val || []
137
- }
138
- },
139
- isSelectedOption (key) {
140
- return this.selectValue.some(i => String(i) === String(key))
141
- },
142
- // 当前值
143
- optionClick (key) {
144
- const selectedOptions = this.selectValue || []
145
- if (this.multiple) {
146
- const hasSelected = selectedOptions.some(i => String(i) === String(key))
147
- if (hasSelected) {
148
- this.selectValue = selectedOptions.filter(i => String(i) !== String(key))
149
- } else {
150
- this.selectValue.push(key)
151
- }
152
- } else {
153
- this.selectValue = [key]
154
- }
155
- this.optionClickAfter(key)
156
- },
157
- // 选项点击后执行回调
158
- optionClickAfter (key) {
159
- const selectOptions = this.columns.filter(i => this.selectValue.includes(i[this.valKey]))
160
- this.$emit('optionClick', key, this.selectValue, selectOptions)
161
- },
162
- close () {
163
- const selectOptions = this.columns.filter(i => this.selectValue.includes(i[this.valKey]))
164
- this.isShowPopup = false
165
- this.$emit('close', this.selectValue, selectOptions)
166
- },
167
- submit () {
168
- const selectOptions = this.columns.filter(i => this.selectValue.includes(i[this.valKey]))
169
- this.$emit('change', this.selectValue, selectOptions)
170
- }
171
- }
172
- }
173
- </script>
174
-
175
-
176
- <style lang="less" scoped>
177
- .hr-select-list {
178
- // min-height: 30vh;
179
- max-height: 70vh;
180
- display: flex;
181
- flex-direction: column;
182
- .list-box {
183
- flex: 1;
184
- padding: 4px 0;
185
- overflow: auto;
186
- .option-item {
187
- padding: 12px 16px;
188
- font-size: 14px;
189
- color: #03050d;
190
- display: flex;
191
- justify-content: space-between;
192
- align-items: center;
193
- &.active {
194
- color: #7972fe;
195
- }
196
- .check-box {
197
- width: 14px;
198
- }
199
- }
200
- }
201
- .submit-btn {
202
- min-height: 40px;
203
- max-height: 40px;
204
- margin: 24px 16px 8px 16px;
205
- font-size: 16px;
206
- color: #ffffff;
207
- border-radius: 8px;
208
- background: #7972fe;
209
- display: flex;
210
- justify-content: center;
211
- align-items: center;
212
- }
213
- }
214
- </style>
@@ -1,8 +0,0 @@
1
-
2
- import HrSingleChoose from './src/index.vue'
3
-
4
- HrSingleChoose.install = function (Vue) {
5
- Vue.component(HrSingleChoose.name, HrSingleChoose)
6
- }
7
-
8
- export default HrSingleChoose