@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.
- package/dist/hroa-ui.common.js +133 -2576
- package/dist/hroa-ui.css +1 -1
- package/dist/hroa-ui.umd.js +133 -2576
- package/dist/hroa-ui.umd.min.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.js +1 -1
- package/lib/hr-checkbox-group/index.js +1 -1
- package/lib/hr-clipboard/index.js +1 -1
- package/lib/hr-collapse-card/index.js +1 -1
- 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 -1
- package/lib/hr-date-filter/index.js +1 -1
- package/lib/hr-dropdown-date/index.css +1 -1
- package/lib/hr-dropdown-date/index.js +1 -1
- 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.js +1 -1
- package/lib/hr-full-screen/index.js +1 -1
- package/lib/hr-img-list/index.css +1 -1
- package/lib/hr-img-list/index.js +1 -1
- package/lib/hr-info-card/index.js +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.js +1 -1
- package/lib/hr-open-ks/index.js +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.js +1 -1
- package/lib/hr-radiobox-group/index.js +1 -1
- 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.js +1 -1
- 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.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.js +1 -1
- package/lib/hr-time-picker/index.js +1 -1
- package/lib/hr-view-item/index.js +1 -1
- package/lib/hr-virtual-list/index.js +1 -1
- package/lib/index/index.css +1 -1
- package/lib/index/index.js +2 -2
- package/lib/utils/index.js +1 -1
- package/package.json +12 -9
- package/lib/getJsModule/index.css +0 -1
- package/lib/getJsModule/index.js +0 -9
- package/packages/getJsModule.js +0 -11
- package/packages/hr-add-list/image/add.svg +0 -1
- package/packages/hr-add-list/image/close.svg +0 -1
- package/packages/hr-add-list/index.js +0 -7
- package/packages/hr-add-list/src/index.vue +0 -125
- 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
- package/packages/hr-bottom-button/index.js +0 -7
- package/packages/hr-bottom-button/src/index.vue +0 -128
- package/packages/hr-breadcrumb/index.js +0 -3
- package/packages/hr-breadcrumb/src/index.vue +0 -87
- package/packages/hr-breadcrumb//351/235/242/345/214/205/345/261/221.md +0 -0
- package/packages/hr-button/index.js +0 -13
- package/packages/hr-button/src/hr-button.vue +0 -39
- package/packages/hr-checkbox/index.js +0 -8
- package/packages/hr-checkbox/src/active-icon.png +0 -0
- package/packages/hr-checkbox/src/checkbox-group.vue +0 -74
- package/packages/hr-checkbox/src/checkbox.vue +0 -226
- package/packages/hr-checkbox/src/data.js +0 -46
- 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 +0 -8
- package/packages/hr-clipboard/index.js +0 -8
- package/packages/hr-clipboard/src/index.vue +0 -46
- package/packages/hr-clipboard/src/util.js +0 -9
- package/packages/hr-collapse-card/index.js +0 -3
- package/packages/hr-collapse-card/src/images/icon_up.png +0 -0
- package/packages/hr-collapse-card/src/index.vue +0 -151
- package/packages/hr-collapse-card//346/212/230/345/217/240/345/215/241/347/211/207.md +0 -0
- package/packages/hr-condition-filtrate/enum/index.js +0 -11
- package/packages/hr-condition-filtrate/image/arrow-right.png +0 -0
- package/packages/hr-condition-filtrate/index.js +0 -7
- package/packages/hr-condition-filtrate/src/employee-choose/index.vue +0 -101
- package/packages/hr-condition-filtrate/src/index.vue +0 -246
- package/packages/hr-condition-filtrate/src/multiterm-choose/index.vue +0 -167
- package/packages/hr-condition-filtrate/src/org-tree-choose/index.vue +0 -102
- package/packages/hr-condition-filtrate/src/single-choose/index.vue +0 -144
- package/packages/hr-condition-filtrate/src/text-input/index.vue +0 -60
- package/packages/hr-condition-filtrate/src/time-selector/date-range-select.vue +0 -154
- package/packages/hr-condition-filtrate/src/time-selector/images/date-icon.png +0 -0
- package/packages/hr-condition-filtrate/src/time-selector/index.vue +0 -380
- package/packages/hr-condition-filtrate/src/time-selector/utils/constant.js +0 -30
- package/packages/hr-condition-filtrate/src/time-selector/utils/tools.js +0 -213
- package/packages/hr-condition-filtrate-popup/index.js +0 -7
- package/packages/hr-condition-filtrate-popup/src/index.vue +0 -236
- package/packages/hr-date-filter/index.js +0 -7
- package/packages/hr-date-filter/src/date-select.vue +0 -153
- package/packages/hr-date-filter/src/index.vue +0 -243
- package/packages/hr-date-filter/src/style.less +0 -130
- package/packages/hr-date-filter/src/utils.js +0 -109
- package/packages/hr-dropdown-date/index.js +0 -7
- package/packages/hr-dropdown-date/src/calendar/calendar.js +0 -128
- package/packages/hr-dropdown-date/src/calendar/calendar.vue +0 -485
- package/packages/hr-dropdown-date/src/calendar/images/arrow@3x.png +0 -0
- package/packages/hr-dropdown-date/src/calendar/index.js +0 -5
- package/packages/hr-dropdown-date/src/date-picker/date-range-select.vue +0 -92
- package/packages/hr-dropdown-date/src/date-picker/month-range-select.vue +0 -128
- package/packages/hr-dropdown-date/src/date-picker/month-select.vue +0 -98
- package/packages/hr-dropdown-date/src/date-picker/style.less +0 -120
- package/packages/hr-dropdown-date/src/date-picker/utils.js +0 -109
- package/packages/hr-dropdown-date/src/index.vue +0 -482
- package/packages/hr-dropdown-date/src/week.js +0 -194
- package/packages/hr-elasticity-box/index.js +0 -7
- package/packages/hr-elasticity-box/src/elasticity-box-item.vue +0 -61
- package/packages/hr-elasticity-box/src/index.vue +0 -52
- package/packages/hr-elasticity-box-item/index.js +0 -7
- package/packages/hr-emotional-picture/index.js +0 -7
- package/packages/hr-emotional-picture/src/index.vue +0 -66
- package/packages/hr-emotional-picture//346/203/205/346/204/237/345/233/276/347/273/204/344/273/266.md +0 -0
- package/packages/hr-employee-choose/index.js +0 -7
- package/packages/hr-employee-choose/src/image/arrow-right.png +0 -0
- package/packages/hr-employee-choose/src/index.vue +0 -119
- package/packages/hr-file-list/index.js +0 -3
- package/packages/hr-file-list/src/file-type/other.vue +0 -45
- package/packages/hr-file-list/src/file-type/picture.vue +0 -38
- package/packages/hr-file-list/src/file-type/video.vue +0 -60
- package/packages/hr-file-list/src/index.vue +0 -246
- package/packages/hr-file-list/src/utils/enum.js +0 -95
- package/packages/hr-file-list/src/utils/fun.js +0 -16
- package/packages/hr-file-list//346/226/207/344/273/266/345/210/227/350/241/250.md +0 -0
- package/packages/hr-full-screen/index.js +0 -7
- package/packages/hr-full-screen/src/index.vue +0 -117
- package/packages/hr-img-list/index.js +0 -3
- package/packages/hr-img-list/src/index.vue +0 -144
- package/packages/hr-img-list//345/244/232/345/233/276/345/210/227/350/241/250.md +0 -0
- package/packages/hr-info-card/index.js +0 -7
- package/packages/hr-info-card/src/index.vue +0 -67
- package/packages/hr-information/index.js +0 -7
- package/packages/hr-information/src/index.vue +0 -72
- package/packages/hr-license-plate-number/index.js +0 -8
- package/packages/hr-license-plate-number/src/enum.js +0 -44
- package/packages/hr-license-plate-number/src/index.vue +0 -164
- package/packages/hr-license-plate-number/src/vnp-keyboard.vue +0 -182
- package/packages/hr-license-plate-number//350/275/246/347/211/214/345/217/267/345/274/271/347/252/227.md +0 -0
- package/packages/hr-module-card/index.js +0 -13
- package/packages/hr-module-card/src/index.vue +0 -132
- 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
- package/packages/hr-multiterm-choose/index.js +0 -8
- package/packages/hr-multiterm-choose/src/active-icon.png +0 -0
- package/packages/hr-multiterm-choose/src/index.vue +0 -224
- package/packages/hr-multiterm-choose//345/244/232/351/200/211/346/241/206.md +0 -0
- package/packages/hr-no-data/index.js +0 -7
- package/packages/hr-no-data/src/index.vue +0 -48
- package/packages/hr-notice-bar/index.js +0 -7
- package/packages/hr-notice-bar/src/bem.js +0 -38
- package/packages/hr-notice-bar/src/index.js +0 -52
- package/packages/hr-notice-bar//351/200/232/347/237/245/346/240/217/347/273/204/344/273/266.md +0 -3
- package/packages/hr-notification-dialog/images/header.png +0 -0
- package/packages/hr-notification-dialog/index.js +0 -7
- package/packages/hr-notification-dialog/src/index.vue +0 -293
- 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-open-ks/index.js +0 -7
- package/packages/hr-open-ks/src/icon.png +0 -0
- package/packages/hr-open-ks/src/index.vue +0 -97
- package/packages/hr-open-ks/src/util.js +0 -31
- package/packages/hr-pager/images/next-page.png +0 -0
- package/packages/hr-pager/images/prev-page.png +0 -0
- package/packages/hr-pager/index.js +0 -7
- package/packages/hr-pager/src/index.vue +0 -120
- 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
- package/packages/hr-popup/index.js +0 -3
- package/packages/hr-popup/src/index.vue +0 -64
- package/packages/hr-popup//345/274/271/345/207/272/345/261/202.md +0 -0
- package/packages/hr-preview-file/index.js +0 -7
- package/packages/hr-preview-file/src/index.vue +0 -58
- package/packages/hr-preview-file/src/util.js +0 -50
- package/packages/hr-radiobox/index.js +0 -8
- package/packages/hr-radiobox/src/data.js +0 -46
- package/packages/hr-radiobox/src/radiobox-group.vue +0 -64
- package/packages/hr-radiobox/src/radiobox.vue +0 -191
- package/packages/hr-radiobox-group/index.js +0 -8
- package/packages/hr-rate/index.js +0 -7
- package/packages/hr-rate/src/index.vue +0 -42
- 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
- package/packages/hr-reason-textarea/index.js +0 -7
- package/packages/hr-reason-textarea/src/index.vue +0 -128
- package/packages/hr-search-input/image/input-close-icon.png +0 -0
- package/packages/hr-search-input/image/search-icon.png +0 -0
- package/packages/hr-search-input/index.js +0 -8
- package/packages/hr-search-input/src/index.vue +0 -144
- package/packages/hr-search-tips/index.js +0 -3
- package/packages/hr-search-tips/src/index.vue +0 -213
- 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-select/index.js +0 -7
- package/packages/hr-select/src/index.vue +0 -41
- package/packages/hr-select-list/index.js +0 -3
- package/packages/hr-select-list/src/index.vue +0 -214
- 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
- package/packages/hr-single-choose/index.js +0 -8
- package/packages/hr-single-choose/src/index.vue +0 -195
- package/packages/hr-single-choose//345/215/225/351/200/211/346/241/206.md +0 -0
- package/packages/hr-slide-pager/guide/image/turn-left.png +0 -0
- package/packages/hr-slide-pager/guide/image/turn-right.png +0 -0
- package/packages/hr-slide-pager/guide/index.vue +0 -59
- package/packages/hr-slide-pager/guide//346/226/260/346/211/213/346/214/207/345/274/225.md +0 -0
- package/packages/hr-slide-pager/index.js +0 -7
- package/packages/hr-slide-pager/src/index.vue +0 -374
- 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
- package/packages/hr-sort/index.js +0 -3
- package/packages/hr-sort/src/main.vue +0 -133
- package/packages/hr-sort//346/216/222/345/272/217.md +0 -0
- package/packages/hr-stack-image/index.js +0 -3
- package/packages/hr-stack-image/src/main.vue +0 -77
- 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
- package/packages/hr-tab-nav/index.js +0 -8
- package/packages/hr-tab-nav/src/index.vue +0 -190
- package/packages/hr-time-picker/index.js +0 -3
- package/packages/hr-time-picker/src/index.vue +0 -85
- 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-view-item/index.js +0 -13
- package/packages/hr-view-item/src/index.vue +0 -89
- package/packages/hr-view-item//350/241/250/345/215/225/351/241/271item/345/261/225/347/244/272.md +0 -0
- package/packages/hr-virtual-list/index.js +0 -7
- package/packages/hr-virtual-list/src/cc-item.vue +0 -105
- package/packages/hr-virtual-list/src/index.vue +0 -227
- package/packages/hr-virtual-list//350/231/232/346/213/237/345/210/227/350/241/250.md +0 -0
- package/packages/index.js +0 -23
- package/packages/utils/directive/common.js +0 -0
- package/packages/utils/directive/index.js +0 -2
- package/packages/utils/directive/specific.js +0 -54
- package/packages/utils/index.js +0 -7
- package/packages/utils/tool/common.js +0 -65
- package/packages/utils/tool/index.js +0 -2
- 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,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>
|
|
File without changes
|
|
@@ -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,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>
|
|
File without changes
|