Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MindSpore
mindinsight
提交
02a3e1e4
M
mindinsight
项目概览
MindSpore
/
mindinsight
通知
8
Star
4
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindinsight
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
02a3e1e4
编写于
6月 18, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
6月 18, 2020
浏览文件
操作
浏览文件
下载
差异文件
!284 Threshold new space check and 0 value check
Merge pull request !284 from 王卫宁/wwn
上级
5266b191
c85576b3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
119 addition
and
165 deletion
+119
-165
mindinsight/ui/src/locales/zh-cn.json
mindinsight/ui/src/locales/zh-cn.json
+1
-0
mindinsight/ui/src/views/train-manage/scalar.vue
mindinsight/ui/src/views/train-manage/scalar.vue
+118
-165
未找到文件。
mindinsight/ui/src/locales/zh-cn.json
浏览文件 @
02a3e1e4
...
...
@@ -135,6 +135,7 @@
"lessThan"
:
"小于"
,
"applyAllSelectTag"
:
"应用到当前所选标签"
,
"placeHolderNumber"
:
"请输入数值"
,
"noSpace"
:
"请勿输入空格"
,
"sameCompare"
:
"不能有相同的比较运算符"
,
"unreasonable"
:
"逻辑不合理"
,
"info"
:
"提示"
,
...
...
mindinsight/ui/src/views/train-manage/scalar.vue
浏览文件 @
02a3e1e4
...
...
@@ -493,6 +493,7 @@ export default {
zoomData
:
[
null
,
null
],
zoomDataTimer
:
null
,
charObj
:
null
,
invalidData
:
false
,
});
propsList
.
push
({
...
...
@@ -633,6 +634,7 @@ export default {
if
(
hasInvalidData
)
{
this
.
$set
(
sampleObject
,
'
invalidData
'
,
true
);
}
sampleObject
.
charData
.
charOption
=
this
.
formateCharOption
(
sampleIndex
,
);
...
...
@@ -738,44 +740,52 @@ export default {
let
pieceStr
=
''
;
if
(
tempStorgeArr
.
length
===
1
)
{
if
(
tempStorgeArr
[
0
].
gt
&&
tempStorgeArr
[
0
].
lt
)
{
if
(
!
isNaN
(
tempStorgeArr
[
0
].
gt
)
&&
!
isNaN
(
tempStorgeArr
[
0
].
lt
)
)
{
pieceStr
=
`(
${
tempStorgeArr
[
0
].
gt
}
,
${
tempStorgeArr
[
0
].
lt
}
)`
;
}
if
(
tempStorgeArr
[
0
].
gt
&&
!
tempStorgeArr
[
0
].
lt
)
{
}
else
if
(
!
isNaN
(
tempStorgeArr
[
0
].
gt
)
&&
isNaN
(
tempStorgeArr
[
0
].
lt
)
)
{
pieceStr
=
`(
${
tempStorgeArr
[
0
].
gt
}
,Infinity)`
;
}
if
(
tempStorgeArr
[
0
].
lt
&&
!
tempStorgeArr
[
0
].
gt
)
{
}
else
if
(
!
isNaN
(
tempStorgeArr
[
0
].
lt
)
&&
isNaN
(
tempStorgeArr
[
0
].
gt
)
)
{
pieceStr
=
`(-Infinity,
${
tempStorgeArr
[
0
].
lt
}
)`
;
}
}
if
(
tempStorgeArr
.
length
===
2
)
{
if
(
tempStorgeArr
[
0
].
lt
&&
tempStorgeArr
[
1
].
gt
)
{
if
(
!
isNaN
(
tempStorgeArr
[
0
].
lt
)
&&
!
isNaN
(
tempStorgeArr
[
1
].
gt
)
)
{
pieceStr
=
`(-Infinity,
${
tempStorgeArr
[
0
].
lt
}
),(
${
tempStorgeArr
[
1
].
gt
}
,Infinity)`
;
}
if
(
tempStorgeArr
[
0
].
gt
&&
tempStorgeArr
[
1
].
lt
)
{
}
else
if
(
!
isNaN
(
tempStorgeArr
[
0
].
gt
)
&&
!
isNaN
(
tempStorgeArr
[
1
].
lt
))
{
pieceStr
=
`(-Infinity,
${
tempStorgeArr
[
1
].
lt
}
),(
${
tempStorgeArr
[
0
].
gt
}
,Infinity)`
;
}
}
sampleObject
.
pieceStr
=
pieceStr
;
if
(
(
tempStorgeArr
[
0
].
lt
&&
!
tempStorgeArr
[
0
].
gt
)
||
(
!
tempStorgeArr
[
0
].
lt
&&
tempStorgeArr
[
0
].
gt
)
)
{
const
itemValue
=
tempStorgeArr
[
0
][
'
lt
'
]
||
tempStorgeArr
[
0
][
'
gt
'
];
if
(
tempStorgeArr
.
length
===
1
)
{
let
itemValue
;
if
(
tempStorgeArr
[
0
][
'
lt
'
]
||
tempStorgeArr
[
0
][
'
lt
'
]
===
0
)
{
itemValue
=
tempStorgeArr
[
0
][
'
lt
'
];
}
else
{
itemValue
=
tempStorgeArr
[
0
][
'
gt
'
];
}
tempStorgeArr
.
push
({
value
:
tempStorgeArr
[
0
][
'
lt
'
]
?
itemValue
+
1
:
itemValue
-
1
,
value
:
tempStorgeArr
[
0
][
'
lt
'
]
||
tempStorgeArr
[
0
][
'
lt
'
]
===
0
?
itemValue
+
1
:
itemValue
-
1
,
});
}
tempStorgeArr
.
forEach
((
item
)
=>
{
if
(
item
.
lt
)
{
if
(
item
.
lt
||
item
.
lt
===
0
)
{
const
markLineDataItem
=
{};
markLineDataItem
.
yAxis
=
item
.
lt
;
markLineData
.
push
(
markLineDataItem
);
}
if
(
item
.
gt
)
{
if
(
item
.
gt
||
item
.
gt
===
0
)
{
const
markLineDataItem
=
{};
markLineDataItem
.
yAxis
=
item
.
gt
;
markLineData
.
push
(
markLineDataItem
);
...
...
@@ -1849,6 +1859,9 @@ export default {
if
(
!
valueFirst
)
{
this
.
thresholdErrorMsg
=
this
.
$t
(
'
scalar.placeHolderThreshold
'
);
isValidate
=
false
;
}
else
if
(
valueFirst
.
indexOf
(
'
'
)
>
-
1
)
{
this
.
thresholdErrorMsg
=
this
.
$t
(
'
scalar.noSpace
'
);
isValidate
=
false
;
}
else
if
(
isNaN
(
valueFirst
))
{
this
.
thresholdErrorMsg
=
this
.
$t
(
'
scalar.placeHolderNumber
'
);
isValidate
=
false
;
...
...
@@ -1860,6 +1873,9 @@ export default {
}
else
if
(
!
valueFirst
||
!
valueSec
)
{
this
.
thresholdErrorMsg
=
this
.
$t
(
'
scalar.placeHolderThreshold
'
);
isValidate
=
false
;
}
else
if
(
valueFirst
.
indexOf
(
'
'
)
>
-
1
||
valueSec
.
indexOf
(
'
'
)
>
-
1
)
{
this
.
thresholdErrorMsg
=
this
.
$t
(
'
scalar.noSpace
'
);
isValidate
=
false
;
}
else
if
(
valueFirst
===
valueSec
)
{
this
.
thresholdErrorMsg
=
this
.
$t
(
'
scalar.unreasonable
'
);
isValidate
=
false
;
...
...
@@ -1908,6 +1924,7 @@ export default {
thresholdCommit
()
{
const
isValidate
=
this
.
thresholdValidate
();
if
(
isValidate
)
{
const
chartPieces
=
[];
if
(
this
.
thresholdValue
[
0
].
value
&&
this
.
thresholdValue
[
1
].
value
)
{
...
...
@@ -1963,87 +1980,85 @@ export default {
}
});
if
(
this
.
thresholdSwitch
)
{
this
.
originDataArr
.
forEach
((
sampleObject
)
=>
{
if
(
this
.
multiSelectedTagNames
[
sampleObject
.
tagName
])
{
if
(
!
this
.
thresholdLocal
)
{
this
.
thresholdLocal
=
{};
this
.
thresholdLocal
[
this
.
decodeTrainingJobId
]
=
{};
this
.
thresholdLocal
[
this
.
decodeTrainingJobId
][
sampleObject
.
tagName
]
=
chartPieces
;
}
else
{
if
(
!
this
.
thresholdLocal
[
this
.
decodeTrainingJobId
])
{
this
.
thresholdLocal
[
this
.
decodeTrainingJobId
]
=
{};
this
.
thresholdLocal
[
this
.
decodeTrainingJobId
][
sampleObject
.
tagName
]
=
chartPieces
;
}
else
{
this
.
thresholdLocal
[
this
.
decodeTrainingJobId
][
sampleObject
.
tagName
]
=
chartPieces
;
}
}
localStorage
.
setItem
(
'
thresholdCache
'
,
JSON
.
stringify
(
this
.
thresholdLocal
),
);
let
pieceStr
=
''
;
if
(
chartPieces
.
length
===
1
)
{
if
(
!
isNaN
(
chartPieces
[
0
].
gt
)
&&
!
isNaN
(
chartPieces
[
0
].
lt
))
{
pieceStr
=
`(
${
chartPieces
[
0
].
gt
}
,
${
chartPieces
[
0
].
lt
}
)`
;
}
else
if
(
!
isNaN
(
chartPieces
[
0
].
gt
)
&&
isNaN
(
chartPieces
[
0
].
lt
)
)
{
pieceStr
=
`(
${
chartPieces
[
0
].
gt
}
,Infinity)`
;
}
else
if
(
!
isNaN
(
chartPieces
[
0
].
lt
)
&&
isNaN
(
chartPieces
[
0
].
gt
)
)
{
pieceStr
=
`(-Infinity,
${
chartPieces
[
0
].
lt
}
)`
;
}
}
if
(
chartPieces
.
length
===
2
)
{
if
(
!
isNaN
(
chartPieces
[
0
].
lt
)
&&
!
isNaN
(
chartPieces
[
1
].
gt
))
{
pieceStr
=
`(-Infinity,
${
chartPieces
[
0
].
lt
}
),(
${
chartPieces
[
1
].
gt
}
,Infinity)`
;
}
else
if
(
!
isNaN
(
chartPieces
[
0
].
gt
)
&&
!
isNaN
(
chartPieces
[
1
].
lt
))
{
pieceStr
=
`(-Infinity,
${
chartPieces
[
1
].
lt
}
),(
${
chartPieces
[
0
].
gt
}
,Infinity)`
;
}
}
let
pieceStr
=
''
;
if
(
chartPieces
.
length
===
1
)
{
if
(
chartPieces
[
0
].
gt
&&
chartPieces
[
0
].
lt
)
{
pieceStr
=
`(
${
chartPieces
[
0
].
gt
}
,
${
chartPieces
[
0
].
lt
}
)`
;
}
else
if
(
chartPieces
[
0
].
gt
&&
!
chartPieces
[
0
].
lt
)
{
pieceStr
=
`(
${
chartPieces
[
0
].
gt
}
,Infinity)`
;
}
else
if
(
chartPieces
[
0
].
lt
&&
!
chartPieces
[
0
].
gt
)
{
pieceStr
=
`(-Infinity,
${
chartPieces
[
0
].
lt
}
)`
;
}
}
if
(
chartPieces
.
length
===
2
)
{
if
(
chartPieces
[
0
].
lt
&&
chartPieces
[
1
].
gt
)
{
pieceStr
=
`(-Infinity,
${
chartPieces
[
0
].
lt
}
),(
${
chartPieces
[
1
].
gt
}
,Infinity)`
;
}
else
if
(
chartPieces
[
0
].
gt
&&
chartPieces
[
1
].
lt
)
{
pieceStr
=
`(-Infinity,
${
chartPieces
[
1
].
lt
}
),(
${
chartPieces
[
0
].
gt
}
,Infinity)`
;
}
}
if
(
!
this
.
thresholdLocal
)
{
this
.
thresholdLocal
=
{};
}
if
(
!
this
.
thresholdLocal
[
this
.
decodeTrainingJobId
])
{
this
.
thresholdLocal
[
this
.
decodeTrainingJobId
]
=
{};
}
sampleObject
.
pieceStr
=
pieceStr
;
const
markLineData
=
[]
;
const
tempCharOption
=
sampleObject
.
charData
.
charOption
;
chartPieces
.
forEach
((
item
)
=>
{
if
(
item
.
lt
||
item
.
lt
===
0
)
{
const
markLineDataItem
=
{};
markLineDataItem
.
yAxis
=
item
.
lt
;
markLineData
.
push
(
markLineDataItem
);
}
if
(
item
.
gt
||
item
.
gt
===
0
)
{
const
markLineDataItem
=
{};
markLineDataItem
.
yAxis
=
item
.
gt
;
markLineData
.
push
(
markLineDataItem
);
}
});
const
chartPiecesTemp
=
JSON
.
parse
(
JSON
.
stringify
(
chartPieces
));
const
chartPiecesTemp
=
JSON
.
parse
(
JSON
.
stringify
(
chartPieces
));
if
(
chartPiecesTemp
.
length
===
1
)
{
const
itemValue
=
chartPieces
[
0
][
'
lt
'
]
||
chartPieces
[
0
][
'
gt
'
];
chartPiecesTemp
.
push
({
value
:
chartPieces
[
0
][
'
lt
'
]
?
itemValue
+
1
:
itemValue
-
1
,
});
}
if
(
chartPiecesTemp
.
length
===
1
)
{
let
itemValue
;
if
(
chartPiecesTemp
[
0
][
'
lt
'
]
||
chartPiecesTemp
[
0
][
'
lt
'
]
===
0
)
{
itemValue
=
chartPiecesTemp
[
0
][
'
lt
'
];
}
else
{
itemValue
=
chartPiecesTemp
[
0
][
'
gt
'
];
}
chartPiecesTemp
.
push
({
value
:
chartPiecesTemp
[
0
][
'
lt
'
]
||
chartPiecesTemp
[
0
][
'
lt
'
]
===
0
?
itemValue
+
1
:
itemValue
-
1
,
});
}
chartPiecesTemp
.
forEach
((
item
)
=>
{
item
.
color
=
this
.
thresholdColor
;
});
tempCharOption
.
visualMap
.
pieces
=
chartPiecesTemp
;
chartPiecesTemp
.
forEach
((
item
)
=>
{
item
.
color
=
this
.
thresholdColor
;
});
if
(
this
.
thresholdSwitch
)
{
this
.
originDataArr
.
forEach
((
sampleObject
)
=>
{
if
(
this
.
multiSelectedTagNames
[
sampleObject
.
tagName
])
{
this
.
thresholdLocal
[
this
.
decodeTrainingJobId
][
sampleObject
.
tagName
]
=
chartPieces
;
sampleObject
.
pieceStr
=
pieceStr
;
const
tempCharOption
=
sampleObject
.
charData
.
charOption
;
tempCharOption
.
visualMap
.
pieces
=
chartPiecesTemp
;
tempCharOption
.
visualMap
.
outOfRange
=
{
color
:
sampleObject
.
colors
,
};
const
markLineData
=
[];
chartPieces
.
forEach
((
item
)
=>
{
if
(
item
.
lt
)
{
const
markLineDataItem
=
{};
markLineDataItem
.
yAxis
=
item
.
lt
;
markLineData
.
push
(
markLineDataItem
);
}
if
(
item
.
gt
)
{
const
markLineDataItem
=
{};
markLineDataItem
.
yAxis
=
item
.
gt
;
markLineData
.
push
(
markLineDataItem
);
}
});
tempCharOption
.
series
[
0
].
lineStyle
.
color
=
null
;
tempCharOption
.
series
[
0
].
markLine
=
{
silent
:
true
,
...
...
@@ -2052,91 +2067,29 @@ export default {
sampleObject
.
charObj
.
setOption
(
tempCharOption
,
true
);
}
});
this
.
thresholdDialogVisible
=
false
;
}
else
{
if
(
!
this
.
thresholdLocal
)
{
this
.
thresholdLocal
=
{};
this
.
thresholdLocal
[
this
.
decodeTrainingJobId
]
=
{};
this
.
thresholdLocal
[
this
.
decodeTrainingJobId
][
this
.
currentTagName
]
=
chartPieces
;
}
else
{
if
(
!
this
.
thresholdLocal
[
this
.
decodeTrainingJobId
])
{
this
.
thresholdLocal
[
this
.
decodeTrainingJobId
]
=
{};
this
.
thresholdLocal
[
this
.
decodeTrainingJobId
][
this
.
currentTagName
]
=
chartPieces
;
}
else
{
this
.
thresholdLocal
[
this
.
decodeTrainingJobId
][
this
.
currentTagName
]
=
chartPieces
;
}
}
localStorage
.
setItem
(
'
thresholdCache
'
,
JSON
.
stringify
(
this
.
thresholdLocal
),
);
let
pieceStr
=
''
;
if
(
chartPieces
.
length
===
1
)
{
if
(
chartPieces
[
0
].
gt
&&
chartPieces
[
0
].
lt
)
{
pieceStr
=
`(
${
chartPieces
[
0
].
gt
}
,
${
chartPieces
[
0
].
lt
}
)`
;
}
else
if
(
chartPieces
[
0
].
gt
&&
!
chartPieces
[
0
].
lt
)
{
pieceStr
=
`(
${
chartPieces
[
0
].
gt
}
,Infinity)`
;
}
else
if
(
chartPieces
[
0
].
lt
&&
!
chartPieces
[
0
].
gt
)
{
pieceStr
=
`(-Infinity,
${
chartPieces
[
0
].
lt
}
)`
;
}
}
if
(
chartPieces
.
length
===
2
)
{
if
(
chartPieces
[
0
].
lt
&&
chartPieces
[
1
].
gt
)
{
pieceStr
=
`(-Infinity,
${
chartPieces
[
0
].
lt
}
),(
${
chartPieces
[
1
].
gt
}
,Infinity)`
;
}
else
if
(
chartPieces
[
0
].
gt
&&
chartPieces
[
1
].
lt
)
{
pieceStr
=
`(-Infinity,
${
chartPieces
[
1
].
lt
}
),(
${
chartPieces
[
0
].
gt
}
,Infinity)`
;
}
}
this
.
originDataArr
.
forEach
((
sampleItem
)
=>
{
if
(
sampleItem
.
tagName
===
this
.
currentTagName
)
{
sampleItem
.
pieceStr
=
pieceStr
;
}
});
this
.
thresholdLocal
[
this
.
decodeTrainingJobId
][
this
.
currentTagName
]
=
chartPieces
;
this
.
currentSample
.
pieceStr
=
pieceStr
;
const
tempCharOption
=
this
.
currentSample
.
charData
.
charOption
;
if
(
chartPieces
.
length
===
1
)
{
const
itemValue
=
chartPieces
[
0
][
'
lt
'
]
||
chartPieces
[
0
][
'
gt
'
];
chartPieces
.
push
({
value
:
chartPieces
[
0
][
'
lt
'
]
?
itemValue
+
1
:
itemValue
-
1
,
});
}
chartPieces
.
forEach
((
item
)
=>
{
item
.
color
=
this
.
thresholdColor
;
});
tempCharOption
.
visualMap
.
pieces
=
chartPieces
;
tempCharOption
.
visualMap
.
pieces
=
chartPiecesTemp
;
tempCharOption
.
visualMap
.
outOfRange
=
{
color
:
this
.
currentSample
.
colors
,
};
const
markLineData
=
[];
chartPieces
.
forEach
((
item
)
=>
{
if
(
item
.
lt
)
{
const
markLineDataItem
=
{};
markLineDataItem
.
yAxis
=
item
.
lt
;
markLineData
.
push
(
markLineDataItem
);
}
if
(
item
.
gt
)
{
const
markLineDataItem
=
{};
markLineDataItem
.
yAxis
=
item
.
gt
;
markLineData
.
push
(
markLineDataItem
);
}
});
tempCharOption
.
series
[
0
].
lineStyle
.
color
=
null
;
tempCharOption
.
series
[
0
].
markLine
=
{
silent
:
true
,
data
:
markLineData
,
};
this
.
currentSample
.
charObj
.
setOption
(
tempCharOption
,
true
);
this
.
thresholdDialogVisible
=
false
;
}
localStorage
.
setItem
(
'
thresholdCache
'
,
JSON
.
stringify
(
this
.
thresholdLocal
),
);
this
.
thresholdDialogVisible
=
false
;
}
},
...
...
@@ -2186,15 +2139,15 @@ export default {
font-weight
:
bold
;
}
.w261
{
width
:
261px
;
}
.w60
{
width
:
60px
;
margin-left
:
20px
;
}
.w261
{
width
:
261px
;
}
.smallSelect
{
width
:
80px
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录