Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
enterprise-serevice-platform-web
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
张伯涛
enterprise-serevice-platform-web
Commits
32a623fb
Commit
32a623fb
authored
Oct 25, 2022
by
YangAo
🇨🇳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
千分位 组件 初步完成
parent
cd5b9eeb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
1 deletion
+28
-1
common.js
src/utils/common.js
+4
-0
YaInputDigit.vue
src/views/PolicyDirect/components/YaInputDigit.vue
+24
-1
No files found.
src/utils/common.js
View file @
32a623fb
...
...
@@ -195,3 +195,7 @@ export function includePermission(accessName) {
if
(
!
store
.
getters
.
permissions
)
{
return
false
}
return
(
store
.
getters
.
permissions
.
includes
(
accessName
)
||
store
.
getters
.
permissions
.
includes
(
'*:*:*'
))
}
export
function
stringIsEmpty
(
str
)
{
return
str
===
undefined
||
str
===
null
||
str
===
''
||
str
===
'undefined'
||
str
===
'null'
}
src/views/PolicyDirect/components/YaInputDigit.vue
View file @
32a623fb
...
...
@@ -8,6 +8,8 @@
</template>
<
script
>
import
{
stringIsEmpty
}
from
'@/utils/common'
export
default
{
name
:
'YaInputDigit'
,
// inheritAttrs: false,
...
...
@@ -46,6 +48,22 @@ export default {
valueFloat
:
0.00
}
},
watch
:
{
digit
(
newDigit
)
{
// 新数据与旧数据 相同 不进行处理
if
(
newDigit
===
this
.
valueFloat
)
return
// 数据不同 进行额外处理 并更新输入框值
console
.
log
(
`newDigit ->`
,
newDigit
)
const
{
value
,
valueFloat
}
=
this
.
input
({
target
:
{
value
:
newDigit
.
toString
()
}})
this
.
valueFloat
=
valueFloat
this
.
value
=
value
}
},
created
()
{
const
{
value
,
valueFloat
}
=
this
.
input
({
target
:
{
value
:
this
.
digit
.
toString
()
}})
this
.
valueFloat
=
valueFloat
this
.
value
=
value
},
methods
:
{
// 输入时 数字保证操作, 长度操作
digitOption
(
str
)
{
...
...
@@ -106,10 +124,15 @@ export default {
// 重置对应值
this
.
value
=
target
.
value
// 数字反值
this
.
valueFloat
=
Number
.
parseFloat
(
option
)
this
.
valueFloat
=
stringIsEmpty
(
this
.
value
)
||
Number
.
isNaN
(
option
)
?
0
:
Number
.
parseFloat
(
option
)
this
.
$emit
(
'input'
,
this
.
valueFloat
)
return
{
value
:
this
.
value
,
valueFloat
:
this
.
valueFloat
}
}
}
}
</
script
>
...
...
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