@kyfe/fms-vue2-components 0.0.3 → 0.0.4
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/assets/css/fms-ks-clamp-text.css +1 -0
- package/dist/assets/css/fms-ks-components.css +1 -0
- package/dist/assets/css/fms-ks-popover.css +1 -0
- package/dist/assets/css/fms-ks-search-tips-new.css +1 -0
- package/dist/assets/css/fms-ks-search-tips.css +1 -0
- package/dist/assets/css/fms-ks-select-box.css +1 -0
- package/dist/assets/css/fms-ks-select.css +1 -0
- package/dist/date-picker-bottom.17e75dc0.js +45 -0
- package/dist/date-picker-dropdown.1d8e9f00.js +34 -0
- package/dist/date-picker-right.b939e886.js +23 -0
- package/dist/date-picker-top.c38046f7.js +23 -0
- package/dist/date-range-select.647edaf6.js +69 -0
- package/dist/date-select.96eb3a9d.js +60 -0
- package/dist/date-week-month.169b98bc.js +57 -0
- package/dist/datetime-popup/index.js +411 -0
- package/dist/filter.c93f4ddb.js +45 -0
- package/dist/fms-copy-box/index.js +1 -1
- package/dist/fms-ks-block-title/index.js +38 -0
- package/dist/fms-ks-block-title/style.css +1 -0
- package/dist/fms-ks-clamp-text/index.js +9 -0
- package/dist/fms-ks-clamp-text.24eb5e8d.js +53 -0
- package/dist/fms-ks-components/index.js +9 -0
- package/dist/fms-ks-components.a5d9329b.js +4392 -0
- package/dist/fms-ks-decrypt/index.js +2 -2
- package/dist/fms-ks-decrypt.2f88e659.js +312 -0
- package/dist/fms-ks-file-upload/index.js +32 -31
- package/dist/fms-ks-file-upload/style.css +1 -1
- package/dist/fms-ks-form-grid/index.js +101 -0
- package/dist/fms-ks-form-grid/style.css +1 -0
- package/dist/fms-ks-more-lines/index.js +31 -0
- package/dist/fms-ks-more-lines/style.css +1 -0
- package/dist/fms-ks-page-popup/index.js +68 -0
- package/dist/fms-ks-page-popup/style.css +1 -0
- package/dist/fms-ks-picker/index.js +9 -0
- package/dist/fms-ks-picker.766b55f9.js +61 -0
- package/dist/fms-ks-popover/index.js +9 -0
- package/dist/fms-ks-popover.55ab4b82.js +95 -0
- package/dist/fms-ks-search-tips/index.js +9 -0
- package/dist/fms-ks-search-tips-new/index.js +9 -0
- package/dist/fms-ks-search-tips-new.7d08f710.js +125 -0
- package/dist/fms-ks-search-tips.d36859c3.js +142 -0
- package/dist/fms-ks-select/index.js +9 -0
- package/dist/fms-ks-select-box/index.js +9 -0
- package/dist/fms-ks-select-box.a00f0f08.js +43 -0
- package/dist/fms-ks-select.59416fd8.js +157 -0
- package/dist/fms-ks-warn-drawer/index.js +37 -0
- package/dist/fms-ks-warn-drawer/style.css +1 -0
- package/dist/fms-scroll-list/index.js +3 -1
- package/dist/index.js +30 -30
- package/dist/mixin.f4bc60f0.js +59 -0
- package/dist/month-range-select.374653da.js +97 -0
- package/dist/month-select.30ae7335.js +71 -0
- package/dist/oa-datetime-picker-new/style.css +1 -0
- package/dist/quarter-select.b6256880.js +73 -0
- package/dist/utils.159fba19.js +64 -0
- package/dist/week-select.27efca5c.js +70 -0
- package/package.json +31 -31
- package/src/assets/images/attachment/icon_default.svg +23 -0
- package/src/assets/images/attachment/icon_default_new.png +0 -0
- package/src/assets/images/attachment/icon_excel.svg +20 -0
- package/src/assets/images/attachment/icon_excel_new.png +0 -0
- package/src/assets/images/attachment/icon_file.png +0 -0
- package/src/assets/images/attachment/icon_pdf_new.png +0 -0
- package/src/assets/images/attachment/icon_ppt.svg +20 -0
- package/src/assets/images/attachment/icon_ppt_new.png +0 -0
- package/src/assets/images/attachment/icon_preview_file.png +0 -0
- package/src/assets/images/attachment/icon_txt.png +0 -0
- package/src/assets/images/attachment/icon_word.svg +19 -0
- package/src/assets/images/attachment/icon_word_new.png +0 -0
- package/src/assets/images/attachment/icon_xmind.png +0 -0
- package/src/assets/images/icon-arrow.png +0 -0
- package/src/assets/images/icon-forewarning.svg +1 -0
- package/src/components/date-picker/index.vue +205 -0
- package/src/components/datetime-picker-general/index.vue +161 -0
- package/src/components/datetime-popup/date-picker.js +217 -0
- package/src/components/datetime-popup/index.js +37 -0
- package/src/components/datetime-popup/index.vue +111 -0
- package/src/components/datetime-popup/mixin.js +125 -0
- package/src/components/datetime-popup/time-picker.js +102 -0
- package/src/components/datetime-popup/utils.js +124 -0
- package/src/components/datetime-popup//347/244/272/344/276/213/345/233/276.png +0 -0
- package/src/components/decrypt/README.md +0 -0
- package/src/components/decrypt/index.vue +73 -0
- package/src/components/fms-ks-block-title/fms-ks-block-title.vue +75 -0
- package/src/components/fms-ks-block-title/index.js +7 -0
- package/src/components/fms-ks-block-title//346/240/207/351/242/230.md +0 -0
- package/src/components/fms-ks-clamp-text/fms-ks-clamp-text.vue +66 -0
- package/src/components/fms-ks-clamp-text/images/icon-clamp.png +0 -0
- package/src/components/fms-ks-clamp-text/index.js +7 -0
- package/src/components/fms-ks-clamp-text//346/226/207/346/234/254/346/224/266/350/265/267/345/261/225/345/274/200.md +0 -0
- package/src/components/fms-ks-components/fms-ks-components.vue +699 -0
- package/src/components/fms-ks-components/index.js +7 -0
- package/src/components/fms-ks-components/money-directive.js +73 -0
- package/src/components/fms-ks-components//350/241/250/345/215/225/351/205/215/347/275/256/347/273/204/344/273/266/350/257/264/346/230/216.md +10 -0
- package/src/components/fms-ks-file-upload/fms-ks-file-upload.vue +8 -1
- package/src/components/fms-ks-form-grid/fields-conversion.js +107 -0
- package/src/components/fms-ks-form-grid/fms-ks-form-grid.vue +127 -0
- package/src/components/fms-ks-form-grid/index.js +7 -0
- package/src/components/fms-ks-more-lines/fms-ks-more-lines.vue +108 -0
- package/src/components/fms-ks-more-lines/index.js +7 -0
- package/src/components/fms-ks-more-lines//346/233/264/345/244/232.md +0 -0
- package/src/components/fms-ks-page-popup/fms-ks-page-popup.vue +153 -0
- package/src/components/fms-ks-page-popup/index.js +7 -0
- package/src/components/fms-ks-page-popup//345/274/271/345/207/272/345/261/202.md +0 -0
- package/src/components/fms-ks-picker/fms-ks-picker.vue +67 -0
- package/src/components/fms-ks-picker/index.js +7 -0
- package/src/components/fms-ks-picker//351/200/211/346/213/251/345/274/271/345/207/272/345/261/202.md +0 -0
- package/src/components/fms-ks-popover/click-outside.js +68 -0
- package/src/components/fms-ks-popover/fms-ks-popover.vue +89 -0
- package/src/components/fms-ks-popover/index.js +7 -0
- package/src/components/fms-ks-popover//345/274/271/345/207/272/345/261/202.md +0 -0
- package/src/components/fms-ks-search-tips/fms-ks-search-tips.vue +296 -0
- package/src/components/fms-ks-search-tips/index.js +7 -0
- package/src/components/fms-ks-search-tips//350/277/234/347/250/213/346/220/234/347/264/242.md +118 -0
- package/src/components/fms-ks-search-tips-new/fms-ks-search-tips-new.vue +242 -0
- package/src/components/fms-ks-search-tips-new/index.js +7 -0
- package/src/components/fms-ks-search-tips-new/style.less +137 -0
- package/src/components/fms-ks-search-tips-new//350/277/234/347/250/213/346/220/234/347/264/242-/346/226/260.md +118 -0
- package/src/components/fms-ks-select/fms-ks-select.vue +421 -0
- package/src/components/fms-ks-select/index.js +7 -0
- package/src/components/fms-ks-select//351/200/211/346/213/251/346/241/206.md +0 -0
- package/src/components/fms-ks-select-box/fms-ks-select-box.vue +84 -0
- package/src/components/fms-ks-select-box/index.js +7 -0
- package/src/components/fms-ks-select-box//344/270/215/351/234/200/350/246/201popup/347/232/204select.md +0 -0
- package/src/components/fms-ks-warn-drawer/fms-ks-warn-drawer.vue +111 -0
- package/src/components/fms-ks-warn-drawer/index.js +7 -0
- package/src/components/fms-ks-warn-drawer//351/242/204/350/255/246/346/217/220/347/244/272.md +0 -0
- package/src/components/ks-decrypt/README.md +140 -0
- package/src/components/ks-decrypt/index.vue +155 -0
- package/src/components/ks-popover/index.vue +483 -0
- package/src/components/ks-popover/mixin.js +28 -0
- package/src/components/ks-popover/utils.js +60 -0
- package/src/components/oa-datetime-picker/index.vue +169 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/README.md +21 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/date-picker-bottom.vue +121 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/date-picker-dropdown.vue +78 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/date-picker-right.vue +86 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/date-picker-top.vue +82 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/date-picker.js +12 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/date-range-select.vue +106 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/date-select.vue +66 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/date-week-month.vue +131 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/index.js +39 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/mixin.js +85 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/month-range-select.vue +127 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/month-select.vue +87 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/quarter-select.vue +95 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/style.less +117 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/utils.js +109 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/week-select.vue +100 -0
- package/src/components/oa-datetime-picker-new/index.vue +212 -0
- package/src/index.js +8 -2
- package/vite.config.js +12 -1
- package/dist/fms-ks-decrypt.bcc12f44.js +0 -335
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="fms-search-tips-new">
|
|
3
|
+
<van-field @click="showPopup"
|
|
4
|
+
:required="required"
|
|
5
|
+
:inputAlign="inputAlign"
|
|
6
|
+
:placeholder="placeholder"
|
|
7
|
+
:value="value"
|
|
8
|
+
:rules="rules"
|
|
9
|
+
:label="label"
|
|
10
|
+
:maxlength="maxlength"
|
|
11
|
+
:is-link="isLink"
|
|
12
|
+
readonly>
|
|
13
|
+
<template slot="label"
|
|
14
|
+
v-if="$slots.label">
|
|
15
|
+
<slot name="label"></slot>
|
|
16
|
+
</template>
|
|
17
|
+
<template slot="right-icon"
|
|
18
|
+
v-if="$slots.rightIcon">
|
|
19
|
+
<slot name="rightIcon"></slot>
|
|
20
|
+
</template>
|
|
21
|
+
</van-field>
|
|
22
|
+
<van-popup v-model="show"
|
|
23
|
+
position="bottom"
|
|
24
|
+
:style="{ height: isFullPopup ? '100%' : popupHeight, ...popupStyle }"
|
|
25
|
+
:get-container="getContainer"
|
|
26
|
+
class="fms-search-tips-new__content"
|
|
27
|
+
:class="{'is-full-popup': isFullPopup}"
|
|
28
|
+
@opened="onOpened"
|
|
29
|
+
@close="onClose">
|
|
30
|
+
<div class="fms-search-tips-new__content-title close-left"
|
|
31
|
+
v-if="isFullPopup">
|
|
32
|
+
<van-icon name="arrow-left"
|
|
33
|
+
color="#333"
|
|
34
|
+
size="20"
|
|
35
|
+
@click="hidePopup" />
|
|
36
|
+
{{label}}
|
|
37
|
+
</div>
|
|
38
|
+
<div class="fms-search-tips-new__content-title"
|
|
39
|
+
v-else>
|
|
40
|
+
{{label}}
|
|
41
|
+
<van-icon name="cross"
|
|
42
|
+
color="#A2A2AD"
|
|
43
|
+
@click="hidePopup" />
|
|
44
|
+
</div>
|
|
45
|
+
<form action="/">
|
|
46
|
+
<ks-input-search class="fms-search-tips-new__content-search"
|
|
47
|
+
:class="{'has-action': $scopedSlots.action}"
|
|
48
|
+
:placeholder="placeholder"
|
|
49
|
+
:show-action="$scopedSlots.action ? true : false"
|
|
50
|
+
ref="search"
|
|
51
|
+
:maxlength="maxlength"
|
|
52
|
+
v-model="searchStr"
|
|
53
|
+
@change="onChange">
|
|
54
|
+
<slot name="action"
|
|
55
|
+
:input="searchStr"
|
|
56
|
+
:close="hidePopup"
|
|
57
|
+
slot="action" />
|
|
58
|
+
</ks-input-search>
|
|
59
|
+
</form>
|
|
60
|
+
<slot :list="searchList"
|
|
61
|
+
:input="searchStr"
|
|
62
|
+
:loading="loading"></slot>
|
|
63
|
+
<template v-if="!$scopedSlots.default">
|
|
64
|
+
<div class="fms-search-tips-new__content-current"
|
|
65
|
+
v-if="value">
|
|
66
|
+
<div class="current-title">当前选择</div>
|
|
67
|
+
<div class="current-value">
|
|
68
|
+
<span class="current-value__text">{{value}}</span>
|
|
69
|
+
<i class="current-value__line" />
|
|
70
|
+
<van-icon name="cross"
|
|
71
|
+
color="#A2A2AD"
|
|
72
|
+
@click="onClear"
|
|
73
|
+
class="currnet-value__icon" />
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
<div class="fms-search-tips-new__content-list">
|
|
77
|
+
<div v-if="loading"
|
|
78
|
+
class="fms-search-tips-new__content-loading">
|
|
79
|
+
<van-loading size="36px"></van-loading>
|
|
80
|
+
</div>
|
|
81
|
+
<div v-for="item in searchList"
|
|
82
|
+
:key="item[valueKey]"
|
|
83
|
+
class="list-item"
|
|
84
|
+
@click="onSelect(item)"
|
|
85
|
+
v-else>
|
|
86
|
+
{{getValue(item)}}
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
</template>
|
|
90
|
+
</van-popup>
|
|
91
|
+
</div>
|
|
92
|
+
</template>
|
|
93
|
+
<script>
|
|
94
|
+
const Toast = window.vant && window.vant.Toast
|
|
95
|
+
export default {
|
|
96
|
+
name: 'FmsKsSearchTipsNew',
|
|
97
|
+
props: {
|
|
98
|
+
label: String, // 输入框的label值
|
|
99
|
+
disabled: Boolean, // 是否禁用
|
|
100
|
+
formatData: Function, // 模糊搜索入参格式化方法
|
|
101
|
+
formatResult: Function, // 搜索结果格式化方法
|
|
102
|
+
inputAlign: String, // 输入框内容对齐
|
|
103
|
+
inputLength: { // 触发查询的最小长度
|
|
104
|
+
type: Number,
|
|
105
|
+
default: 2
|
|
106
|
+
},
|
|
107
|
+
keys: Array, // 搜索结果显示的字段集合
|
|
108
|
+
message: String, // 搜索结果为空时的提示
|
|
109
|
+
placeholder: String, // placeholder
|
|
110
|
+
required: Boolean, // 是否必填
|
|
111
|
+
url: String, // 搜索请求的url
|
|
112
|
+
value: String, // 当前字段的值
|
|
113
|
+
valueKey: String, // 显示在输入框的字段key
|
|
114
|
+
appkey: String, // appkey
|
|
115
|
+
getDefault: Function, // 打开搜索框的默认数据方法,异步方法,
|
|
116
|
+
popupHeight: { // 当前popup内容的高度,默认60%
|
|
117
|
+
type: String,
|
|
118
|
+
default: () => '60%'
|
|
119
|
+
},
|
|
120
|
+
popupStyle: {
|
|
121
|
+
type: Object,
|
|
122
|
+
default: () => ({})
|
|
123
|
+
},
|
|
124
|
+
rules: Object, // 校验规则
|
|
125
|
+
isLink: {
|
|
126
|
+
type: Boolean,
|
|
127
|
+
default: () => true,
|
|
128
|
+
},
|
|
129
|
+
noEmptyMessage: Boolean,
|
|
130
|
+
isFullPopup: Boolean, // 是否是全屏
|
|
131
|
+
maxlength: -1
|
|
132
|
+
},
|
|
133
|
+
data () {
|
|
134
|
+
return {
|
|
135
|
+
show: false,
|
|
136
|
+
searchStr: '',
|
|
137
|
+
searchList: [],
|
|
138
|
+
loading: false,
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
methods: {
|
|
142
|
+
showPopup () {
|
|
143
|
+
if (this.disabled) return
|
|
144
|
+
this.show = true
|
|
145
|
+
},
|
|
146
|
+
hidePopup () {
|
|
147
|
+
this.show = false
|
|
148
|
+
},
|
|
149
|
+
async onOpened () {
|
|
150
|
+
// 输入框获得焦点
|
|
151
|
+
let $el = this.$refs.search.$el
|
|
152
|
+
if ($el) {
|
|
153
|
+
let $input = $el.querySelector("input")
|
|
154
|
+
$input.focus()
|
|
155
|
+
}
|
|
156
|
+
if (this.getDefault) {
|
|
157
|
+
try {
|
|
158
|
+
this.loading = true
|
|
159
|
+
this.searchList = await this.getDefault()
|
|
160
|
+
} catch (e) {
|
|
161
|
+
console.error(e)
|
|
162
|
+
} finally {
|
|
163
|
+
this.loading = false
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
// 清空搜索结果及搜索条件
|
|
168
|
+
onClose () {
|
|
169
|
+
this.searchList = []
|
|
170
|
+
let $search = this.$refs.search
|
|
171
|
+
let $el = $search.$el
|
|
172
|
+
let $input = $el.querySelector('input')
|
|
173
|
+
$input.value = ''
|
|
174
|
+
this.searchStr = ''
|
|
175
|
+
$search.inputValue = ''
|
|
176
|
+
},
|
|
177
|
+
async onChange (val) {
|
|
178
|
+
let len = val.length
|
|
179
|
+
this.searchStr = val
|
|
180
|
+
if (len === 0) return
|
|
181
|
+
if (len >= this.inputLength && this.url && this.appkey) {
|
|
182
|
+
try {
|
|
183
|
+
this.loading = true
|
|
184
|
+
let params = this.formatData(val)
|
|
185
|
+
let res = await this.$http(this.url, this.appkey, params) || []
|
|
186
|
+
res = this.formatResult ? this.formatResult(res, val) : res
|
|
187
|
+
if (res.length === 0 && !this.noEmptyMessage) {
|
|
188
|
+
Toast(this.message || '搜索结果为空')
|
|
189
|
+
}
|
|
190
|
+
this.searchList = res
|
|
191
|
+
} catch (e) {
|
|
192
|
+
this.onClose()
|
|
193
|
+
} finally {
|
|
194
|
+
this.loading = false
|
|
195
|
+
}
|
|
196
|
+
} else {
|
|
197
|
+
Toast(`字数不少于${this.inputLength}`)
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
// 获取显示行的值
|
|
201
|
+
getValue (row) {
|
|
202
|
+
let values = this.keys.reduce((acc, item) => {
|
|
203
|
+
acc.push(row[item])
|
|
204
|
+
return acc
|
|
205
|
+
}, [])
|
|
206
|
+
return values.join(', ')
|
|
207
|
+
},
|
|
208
|
+
onSelect (row) {
|
|
209
|
+
this.$emit('select', row)
|
|
210
|
+
this.$emit('selectItem', row)
|
|
211
|
+
this.hidePopup()
|
|
212
|
+
this.onClose()
|
|
213
|
+
},
|
|
214
|
+
onClear () {
|
|
215
|
+
this.$emit('selectItem', null)
|
|
216
|
+
this.$emit('select', null)
|
|
217
|
+
this.hidePopup()
|
|
218
|
+
},
|
|
219
|
+
getContainer () {
|
|
220
|
+
return document.body
|
|
221
|
+
},
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
</script>
|
|
225
|
+
<style lang="less" scoped src="./style.less"></style>
|
|
226
|
+
<style lang="less">
|
|
227
|
+
.ios {
|
|
228
|
+
.fms-search-tips-new__content {
|
|
229
|
+
&.is-full-popup {
|
|
230
|
+
padding-top: 20px !important;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.ipx {
|
|
236
|
+
.fms-search-tips-new__content {
|
|
237
|
+
&.is-full-popup {
|
|
238
|
+
padding-top: 46px !important;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
</style>
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
.fms-search-tips-new {
|
|
2
|
+
/deep/ .van-cell__value {
|
|
3
|
+
overflow: initial;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
&__content {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
border-radius: 12px 12px 0 0;
|
|
10
|
+
font-size: 14px;
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
|
|
13
|
+
&-title {
|
|
14
|
+
height: 48px;
|
|
15
|
+
color: #333;
|
|
16
|
+
font-weight: bold;
|
|
17
|
+
padding: 0 16px;
|
|
18
|
+
border-bottom: 1px solid #ebedf5;
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
flex-shrink: 0;
|
|
23
|
+
flex-grow: 0;
|
|
24
|
+
font-size: 16px;
|
|
25
|
+
|
|
26
|
+
.van-icon {
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&.close-left {
|
|
31
|
+
justify-content: flex-start;
|
|
32
|
+
|
|
33
|
+
.van-icon {
|
|
34
|
+
margin-right: 8px;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&-search {
|
|
40
|
+
flex-shrink: 0;
|
|
41
|
+
flex-grow: 0;
|
|
42
|
+
padding: 8px 16px !important;
|
|
43
|
+
|
|
44
|
+
/deep/ .van-cell {
|
|
45
|
+
background-color: transparent !important;
|
|
46
|
+
|
|
47
|
+
.van-field__body {
|
|
48
|
+
padding-left: 0;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&.has-action {
|
|
53
|
+
/deep/ .van-search__content {
|
|
54
|
+
border-radius: 8px 0 0 8px !important;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/deep/ .van-search__action {
|
|
58
|
+
padding: 0;
|
|
59
|
+
height: 100%;
|
|
60
|
+
|
|
61
|
+
.van-button {
|
|
62
|
+
border-radius: 0 8px 8px 0 !important;
|
|
63
|
+
height: 36px;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&-loading {
|
|
70
|
+
display: flex;
|
|
71
|
+
justify-content: center;
|
|
72
|
+
padding: 12px 0;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&-current {
|
|
76
|
+
flex-shrink: 0;
|
|
77
|
+
flex-grow: 0;
|
|
78
|
+
margin: 0 16px;
|
|
79
|
+
border-bottom: 1px solid #ebedf5;
|
|
80
|
+
|
|
81
|
+
.current-title {
|
|
82
|
+
color: #1a1a1a;
|
|
83
|
+
font-weight: bold;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.current-value {
|
|
87
|
+
height: 36px;
|
|
88
|
+
line-height: 36px;
|
|
89
|
+
border-radius: 18px;
|
|
90
|
+
background: #f7f8fa;
|
|
91
|
+
display: inline-flex;
|
|
92
|
+
padding: 0 12px;
|
|
93
|
+
align-items: center;
|
|
94
|
+
margin: 8px 0;
|
|
95
|
+
max-width: 100%;
|
|
96
|
+
overflow: hidden;
|
|
97
|
+
|
|
98
|
+
&__text {
|
|
99
|
+
flex: 1;
|
|
100
|
+
overflow: hidden;
|
|
101
|
+
text-overflow: ellipsis;
|
|
102
|
+
white-space: nowrap;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&__line {
|
|
106
|
+
width: 1px;
|
|
107
|
+
height: 12px;
|
|
108
|
+
opacity: 1;
|
|
109
|
+
flex-grow: 0;
|
|
110
|
+
flex-shrink: 0;
|
|
111
|
+
background: #d7d7db;
|
|
112
|
+
margin: 0 8px;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&__icon {
|
|
116
|
+
flex-grow: 0;
|
|
117
|
+
flex-shrink: 0;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&-list {
|
|
123
|
+
padding: 0 16px;
|
|
124
|
+
overflow: auto;
|
|
125
|
+
height: 0;
|
|
126
|
+
flex: 1;
|
|
127
|
+
-webkit-overflow-scrolling: touch;
|
|
128
|
+
|
|
129
|
+
.list-item {
|
|
130
|
+
line-height: 1.2;
|
|
131
|
+
padding: 12px 0;
|
|
132
|
+
color: #333;
|
|
133
|
+
word-break: break-all;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# 模糊搜索组件
|
|
2
|
+
这是一个 Vue 组件,用于实现搜索提示功能。
|
|
3
|
+
选择搜索结果后,会派发select及selectItem方法;
|
|
4
|
+
再次打开时,会展示当前选中的值,并可以做清空操作.
|
|
5
|
+
可以通过getDefault设置打开时默认展示的搜索选项.
|
|
6
|
+
|
|
7
|
+
## 属性props
|
|
8
|
+
类似与pc端的kye-search-tips的入参
|
|
9
|
+
| 参数 | 类型 | 默认值 | 说明 |
|
|
10
|
+
| ------------ | -------- | ------ | ---------------------------------- |
|
|
11
|
+
| label | String | - | 输入框的标签名称 |
|
|
12
|
+
| disabled | Boolean | | 是否禁用输入框 |
|
|
13
|
+
| formatData | Function | | 模糊搜索入参格式化方法 |
|
|
14
|
+
| formatResult | Function | | 搜索结果格式化方法 |
|
|
15
|
+
| inputLength | Number | 2 | 触发查询的最小长度 |
|
|
16
|
+
| keys | Array | | 搜索结果显示的字段集合 |
|
|
17
|
+
| message | String | | 搜索结果为空时的提示信息 |
|
|
18
|
+
| placeholder | String | | 输入框的占位符 |
|
|
19
|
+
| url | String | | 搜索请求的 URL |
|
|
20
|
+
| value | String | | 当前字段的值 |
|
|
21
|
+
| valueKey | String | | 显示在输入框的字段 key |
|
|
22
|
+
| appkey | String | | 接口请求的appkey |
|
|
23
|
+
| required | Boolean | | 是否必填 |
|
|
24
|
+
| inputAlign | String | | 输入框内容对齐方式 |
|
|
25
|
+
| getDefault | Function | | 打开搜索框的默认数据方法,异步方法 |
|
|
26
|
+
| popupHeight | String | 60% | 当前弹出层内容的高度,默认为 '60%' |
|
|
27
|
+
| popupStyle | Object | {} | 当前弹出层内容的样式,默认为 {} |
|
|
28
|
+
| rules | Object | | 校验规则 |
|
|
29
|
+
| isLink | Boolean | true | 是否为链接类型 |
|
|
30
|
+
| isFullPopup | Boolean | false | 是否为全屏显示popup,全屏显示关闭按钮在左侧,显示为箭头 |
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## 示例代码:
|
|
34
|
+
```
|
|
35
|
+
<template>
|
|
36
|
+
<fms-search-tips-new label="车牌号"
|
|
37
|
+
ref="carNumber"
|
|
38
|
+
v-model="model"
|
|
39
|
+
input-align="right"
|
|
40
|
+
url="vms.vehicle.listByPlateNumber"
|
|
41
|
+
appkey="10184"
|
|
42
|
+
class="search-tips-carNumber search-tips-carNumber-none"
|
|
43
|
+
required
|
|
44
|
+
:formatData="(data)=>{return {'plateNumber':data}}"
|
|
45
|
+
:keys="['plateNumber']"
|
|
46
|
+
:isLink="false"
|
|
47
|
+
valueKey="plateNumber"
|
|
48
|
+
placeholder="请扫描车牌号或查询历史车牌号"
|
|
49
|
+
error-message-align="right"
|
|
50
|
+
:getDefault="() => searchHistory(i)"
|
|
51
|
+
@selectItem="(e) => carNumberSelect(e, i)">
|
|
52
|
+
<van-icon name="scan"
|
|
53
|
+
class="icon-color"
|
|
54
|
+
slot="rightIcon"
|
|
55
|
+
style="display: inline-block;"
|
|
56
|
+
@click="e => scanClick(formModel.expenseDetailCommonList[i], 'carNumber', i, e)" />
|
|
57
|
+
</fms-search-tips-new>
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
<script>
|
|
61
|
+
import { Toast } from 'vant';
|
|
62
|
+
|
|
63
|
+
export default {
|
|
64
|
+
// ...属性和方法定义...
|
|
65
|
+
};
|
|
66
|
+
</script>
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## fms-form-grid中添加了支持,配置示例如下
|
|
71
|
+
```
|
|
72
|
+
{
|
|
73
|
+
label: '原报销编码',
|
|
74
|
+
key: 'oldExpenseNumber',
|
|
75
|
+
component: 'search-tips-new',
|
|
76
|
+
show: () => vm.oldExpenseNumberShow,
|
|
77
|
+
componentProps: {
|
|
78
|
+
url: 'ers.customerExpense.overdueExemptionQuery',
|
|
79
|
+
inputLength: 16,
|
|
80
|
+
// 显示在输入框中的字段
|
|
81
|
+
valueKey: 'expenseNumber',
|
|
82
|
+
// keys 显示在下拉框中的字段
|
|
83
|
+
keys: ['expenseNumber', 'expenseRecordName', 'expenseAmount'],
|
|
84
|
+
message: '报销单据录入有误,请核实',
|
|
85
|
+
// 根据输入的值设置请求参数
|
|
86
|
+
formatData: val => {
|
|
87
|
+
let { guestDate } = vm.model || {}
|
|
88
|
+
return {
|
|
89
|
+
type: 3,
|
|
90
|
+
guestDate,
|
|
91
|
+
expenseNumber: val
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
appkey: '10214',
|
|
95
|
+
placeholder: '请选择原报销编码',
|
|
96
|
+
getDefault: async () => {
|
|
97
|
+
let { guestDate, consumptionAmount, customerNumber } = vm.model || {}
|
|
98
|
+
let params = {
|
|
99
|
+
type: 2,
|
|
100
|
+
guestDate,
|
|
101
|
+
consumptionAmount,
|
|
102
|
+
customerNumber,
|
|
103
|
+
}
|
|
104
|
+
const list = await vm.$http('ers.customerExpense.overdueExemptionQuery', 10214, params)
|
|
105
|
+
return list
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
componentListeners: {
|
|
109
|
+
select: (row) => {
|
|
110
|
+
let { expenseNumber, detailId } = row || {}
|
|
111
|
+
vm.model.oldId = detailId
|
|
112
|
+
vm.model.oldExpenseNumber = expenseNumber
|
|
113
|
+
vm.model.overdueExemptionType = expenseNumber ? '2' : ''
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
required: true,
|
|
117
|
+
}
|
|
118
|
+
```
|