Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
soss
Overview
Overview
Details
Activity
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
hooloo
web
soss
Commits
fadc8bb2
Commit
fadc8bb2
authored
Aug 30, 2022
by
lixiaomin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改经验值
parent
df3d3d82
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
4 deletions
+23
-4
src/views/machine/machineDetails/machineDetailsAttribute.vue
+23
-4
No files found.
src/views/machine/machineDetails/machineDetailsAttribute.vue
View file @
fadc8bb2
...
@@ -129,8 +129,11 @@ export default {
...
@@ -129,8 +129,11 @@ export default {
experienceSubmit
(){
experienceSubmit
(){
var
regular
=
/
(
^
[
+
]{0,1}([
0-9
]
+
)
$
)
/
;
var
regular
=
/
(
^
[
+
]{0,1}([
0-9
]
+
)
$
)
/
;
let
hang
=
0
;
let
hang
=
0
;
let
list
=
[];
let
milliSecond
=
0
;
let
quantity
=
0
for
(
let
i
=
0
;
i
<
this
.
experienceList
.
length
;
i
++
){
for
(
let
i
=
0
;
i
<
this
.
experienceList
.
length
;
i
++
){
//
hang=i+1;
hang
=
i
+
1
;
// if(!regular.test(this.experienceList[i].milli_second)){
// if(!regular.test(this.experienceList[i].milli_second)){
// this.$message.error('第'+hang+'行,秒,请输入大于0的正数');
// this.$message.error('第'+hang+'行,秒,请输入大于0的正数');
// return;
// return;
...
@@ -144,16 +147,32 @@ export default {
...
@@ -144,16 +147,32 @@ export default {
// this.experienceList[i].quantity=parseFloat(this.experienceList[i].quantity);
// this.experienceList[i].quantity=parseFloat(this.experienceList[i].quantity);
// }
// }
if
(
this
.
experienceList
[
i
].
milli_second
){
if
(
this
.
experienceList
[
i
].
milli_second
){
this
.
experienceList
[
i
].
milli_second
=
parseFloat
(
this
.
experienceList
[
i
].
milli_second
);
if
(
!
regular
.
test
(
this
.
experienceList
[
i
].
milli_second
)){
this
.
$message
.
error
(
'第'
+
hang
+
'行,秒,请输入正数!'
);
return
;
}
milliSecond
=
parseFloat
(
this
.
experienceList
[
i
].
milli_second
);
}
else
{
milliSecond
=
0
;
}
}
if
(
this
.
experienceList
[
i
].
quantity
){
if
(
this
.
experienceList
[
i
].
quantity
){
this
.
experienceList
[
i
].
quantity
=
parseFloat
(
this
.
experienceList
[
i
].
quantity
);
if
(
!
regular
.
test
(
this
.
experienceList
[
i
].
quantity
)){
this
.
$message
.
error
(
'第'
+
hang
+
'行,克,请输入正数!'
);
return
;
}
quantity
=
parseFloat
(
this
.
experienceList
[
i
].
quantity
);
}
else
{
quantity
=
0
;
}
if
((
milliSecond
==
0
&&
quantity
!=
0
)
||
(
quantity
==
0
&&
milliSecond
!=
0
)){
return
this
.
$message
.
error
(
"秒和克属性值只能同时为空或者同时不为空!"
);
}
}
list
.
push
({
"milli_second"
:
milliSecond
,
"quantity"
:
quantity
})
}
}
let
obj
=
{
let
obj
=
{
"machine_id"
:
this
.
machine_id
,
"machine_id"
:
this
.
machine_id
,
"property_id"
:
this
.
property_id
,
"property_id"
:
this
.
property_id
,
"data"
:
this
.
experienceL
ist
"data"
:
l
ist
}
}
addProperty
(
obj
).
then
((
response
)
=>
{
addProperty
(
obj
).
then
((
response
)
=>
{
if
(
response
.
code
==
0
){
if
(
response
.
code
==
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