Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hls-easy-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
easyUI
hls-easy-ui
Commits
86d74ef0
Commit
86d74ef0
authored
Sep 09, 2019
by
JingChao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加金额输入组件
parent
c953c652
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
118 additions
and
1 deletion
+118
-1
README.md
README.md
+2
-0
filter.js
packages/common/scripts/filter.js
+4
-0
README.md
packages/components/CurrencyInput/README.md
+25
-0
index.vue
packages/components/CurrencyInput/index.vue
+70
-0
component.js
packages/components/component.js
+2
-0
index.js
packages/index.js
+3
-1
fileTest.vue
src/pages/fileTest.vue
+8
-0
filter.js
src/scripts/filter.js
+4
-0
No files found.
README.md
View file @
86d74ef0
...
@@ -533,6 +533,8 @@ showActionSheetButton() {
...
@@ -533,6 +533,8 @@ showActionSheetButton() {
### Note
### Note
hls-easy-ui#0.0.5
hls-easy-ui#0.0.5
[
添加金额输入框 currency-input
](
/packages/components/CurrencyInput/README.md
)
[
添加动态配置组件 h-layout
](
/packages/components/HLayout/README.md
)
[
添加动态配置组件 h-layout
](
/packages/components/HLayout/README.md
)
...
...
packages/common/scripts/filter.js
View file @
86d74ef0
...
@@ -21,6 +21,10 @@ export default (Vue) => {
...
@@ -21,6 +21,10 @@ export default (Vue) => {
return
intPartFormat
+
floatPart
return
intPartFormat
+
floatPart
}
}
})
})
Vue
.
filter
(
'uncurrency'
,
function
(
val
)
{
if
(
!
val
)
return
null
return
Number
((
val
).
replace
(
/,/gi
,
''
))
})
Vue
.
filter
(
'datetime'
,
timestamp
=>
{
Vue
.
filter
(
'datetime'
,
timestamp
=>
{
function
format
(
number
)
{
function
format
(
number
)
{
return
number
.
toString
().
padStart
(
2
,
'0'
)
return
number
.
toString
().
padStart
(
2
,
'0'
)
...
...
packages/components/CurrencyInput/README.md
0 → 100755
View file @
86d74ef0
curreny-input 金额输入框
```
html
<list-item>
<item>
<div
slot=
"name"
>
融资额
</div>
<curreny-input
slot=
"content"
v-model=
"money"
/>
<div
slot=
"right-icon"
>
¥
</div>
</item>
</list-item>
export default {
data() {
return {
money: null,
}
}
}
```
v-model 绑定value值 number值
disable 是否只读 true/false
packages/components/CurrencyInput/index.vue
0 → 100644
View file @
86d74ef0
/**
* @Author think
* @Date 2019-09-09 14:29
*/
<
template
>
<input
:value=
"formatValue"
:readonly=
"disable"
type=
"text"
@
input=
"onInput($event.target.value)"
@
focus=
"onFocus"
@
blur=
"onBlur"
>
</
template
>
<
script
>
export
default
{
name
:
'CurrencyInput'
,
props
:
{
value
:
{
type
:
Number
,
default
:
0
,
},
disable
:
{
type
:
Boolean
,
default
:
false
,
},
},
data
()
{
return
{
focused
:
false
,
}
},
filter
:
{
uncurrency
(
val
)
{
if
(
!
val
)
return
null
return
(
Number
((
val
).
replace
(
/,/gi
,
''
)))
===
0
?
null
:
Number
((
val
).
replace
(
/,/gi
,
''
))
},
},
computed
:
{
formatValue
()
{
let
currency
=
this
.
$options
.
filters
[
'currency'
]
if
(
!
this
.
focused
)
{
return
currency
(
this
.
value
)
}
else
{
return
this
.
value
}
},
},
methods
:
{
onInput
:
function
(
value
)
{
let
uncurrency
=
this
.
$options
.
filter
[
'uncurrency'
]
this
.
currencyValue
=
uncurrency
(
value
)
this
.
$emit
(
'input'
,
this
.
currencyValue
)
},
onFocus
(
event
)
{
this
.
focused
=
true
setTimeout
(
function
()
{
event
.
target
.
type
=
'number'
event
.
target
.
focus
()
},
0
)
},
onBlur
(
event
)
{
event
.
target
.
type
=
'text'
this
.
focused
=
false
},
},
}
</
script
>
<
style
scoped
lang=
"less"
>
</
style
>
packages/components/component.js
View file @
86d74ef0
...
@@ -27,6 +27,7 @@ import BottomTab from './BottomTab/index'
...
@@ -27,6 +27,7 @@ import BottomTab from './BottomTab/index'
import
TabButton
from
'./BottomTab/tab-button'
import
TabButton
from
'./BottomTab/tab-button'
import
Modal
from
'./Modal/Modal'
import
Modal
from
'./Modal/Modal'
import
HLayout
from
'./HLayout/index'
import
HLayout
from
'./HLayout/index'
import
CurrencyInput
from
'./CurrencyInput/index'
import
errLoadingPic
from
'../common/picture/errloading.jpg'
import
errLoadingPic
from
'../common/picture/errloading.jpg'
...
@@ -61,4 +62,5 @@ export default (Vue) => {
...
@@ -61,4 +62,5 @@ export default (Vue) => {
Vue
.
component
(
'h-radio'
,
Radio
)
Vue
.
component
(
'h-radio'
,
Radio
)
Vue
.
component
(
'h-file'
,
HFile
)
Vue
.
component
(
'h-file'
,
HFile
)
Vue
.
component
(
'h-layout'
,
HLayout
)
Vue
.
component
(
'h-layout'
,
HLayout
)
Vue
.
component
(
'currency-input'
,
CurrencyInput
)
}
}
packages/index.js
View file @
86d74ef0
...
@@ -24,6 +24,7 @@ import TabItem from './components/STab/tab-item'
...
@@ -24,6 +24,7 @@ import TabItem from './components/STab/tab-item'
import
TabButton
from
'./components/BottomTab/tab-button'
import
TabButton
from
'./components/BottomTab/tab-button'
import
HFile
from
'./components/HFile/index'
import
HFile
from
'./components/HFile/index'
import
HLayout
from
'./components/HLayout/index'
import
HLayout
from
'./components/HLayout/index'
import
CurrencyInput
from
'./components/CurrencyInput/index'
import
componentInstall
from
'./components/component'
import
componentInstall
from
'./components/component'
// compontenPlugins
// compontenPlugins
...
@@ -36,7 +37,7 @@ import NumberKeyboardPlugin from './components/NumberKeyboard/index'
...
@@ -36,7 +37,7 @@ import NumberKeyboardPlugin from './components/NumberKeyboard/index'
// styles
// styles
import
appStyle
from
'../packages/common/styles/app.core.less'
import
appStyle
from
'../packages/common/styles/app.core.less'
const
version
=
'0.0.
2
'
const
version
=
'0.0.
4
'
export
{
export
{
appStyle
,
appStyle
,
...
@@ -65,6 +66,7 @@ export {
...
@@ -65,6 +66,7 @@ export {
TabButton
,
TabButton
,
HFile
,
HFile
,
HLayout
,
HLayout
,
CurrencyInput
,
ActionSheetPlugin
,
ActionSheetPlugin
,
ShowPicturePlugin
,
ShowPicturePlugin
,
SelectPlugin
,
SelectPlugin
,
...
...
src/pages/fileTest.vue
View file @
86d74ef0
...
@@ -25,6 +25,13 @@
...
@@ -25,6 +25,13 @@
文件上传
<i
class=
"icon ion-ios-cloud-upload"
/>
文件上传
<i
class=
"icon ion-ios-cloud-upload"
/>
</div>
</div>
</h-file>
</h-file>
<list-item>
<item>
<div
slot=
"name"
>
融资额
</div>
<currency-input
slot=
"content"
v-model=
"money"
/>
<div
slot=
"right-icon"
>
¥
</div>
</item>
</list-item>
</h-content>
</h-content>
</h-view>
</h-view>
</
template
>
</
template
>
...
@@ -53,6 +60,7 @@ export default {
...
@@ -53,6 +60,7 @@ export default {
},
},
uploadSuccess
:
this
.
fileSuccess
,
// 上传成功后的回调函数 用于给文件添加服务端唯一标示或其他
uploadSuccess
:
this
.
fileSuccess
,
// 上传成功后的回调函数 用于给文件添加服务端唯一标示或其他
},
},
money
:
null
,
}
}
},
},
methods
:
{
methods
:
{
...
...
src/scripts/filter.js
View file @
86d74ef0
...
@@ -21,6 +21,10 @@ export default (Vue) => {
...
@@ -21,6 +21,10 @@ export default (Vue) => {
return
intPartFormat
+
floatPart
return
intPartFormat
+
floatPart
}
}
})
})
Vue
.
filter
(
'uncurrency'
,
function
(
val
)
{
if
(
!
val
)
return
null
return
Number
((
val
).
replace
(
/,/gi
,
''
))
})
Vue
.
filter
(
'datetime'
,
timestamp
=>
{
Vue
.
filter
(
'datetime'
,
timestamp
=>
{
function
format
(
number
)
{
function
format
(
number
)
{
return
number
.
toString
().
padStart
(
2
,
'0'
)
return
number
.
toString
().
padStart
(
2
,
'0'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment