Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
W
WidgetUI
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
WuFeiyang
WidgetUI
Commits
98b74648
Commit
98b74648
authored
Sep 23, 2019
by
WuFeiyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
版本1.1 修改了样式显示 添加了thing内部的逻辑
parent
c2c31e1f
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
615 additions
and
376 deletions
+615
-376
src/App.vue
src/App.vue
+4
-7
src/assets/css/fontSize.css
src/assets/css/fontSize.css
+1
-1
src/components/Common/Navigation.vue
src/components/Common/Navigation.vue
+42
-40
src/components/Config/Config.vue
src/components/Config/Config.vue
+119
-108
src/components/Method/Method.vue
src/components/Method/Method.vue
+88
-61
src/components/State/State.vue
src/components/State/State.vue
+107
-81
src/components/Status/Status.vue
src/components/Status/Status.vue
+90
-63
src/components/Thing/Thing.vue
src/components/Thing/Thing.vue
+163
-14
src/components/WaveView/showViewInfo.vue
src/components/WaveView/showViewInfo.vue
+1
-1
No files found.
src/App.vue
View file @
98b74648
...
@@ -118,7 +118,7 @@ export default class App extends Vue {
...
@@ -118,7 +118,7 @@ export default class App extends Vue {
var
fragment
=
"
a
"
;
var
fragment
=
"
a
"
;
fragment
=
f
;
fragment
=
f
;
console
.
log
(
fragment
);
console
.
log
(
fragment
);
if
(
fragment
!=
"
#/
"
)
{
if
(
fragment
!=
"
#/
"
&&
fragment
!=
"
#
"
)
{
fragment
=
fragment
.
substring
(
1
,
fragment
.
length
);
fragment
=
fragment
.
substring
(
1
,
fragment
.
length
);
var
customViewURL
=
"
/customView/template
"
+
fragment
;
var
customViewURL
=
"
/customView/template
"
+
fragment
;
console
.
log
(
customViewURL
);
console
.
log
(
customViewURL
);
...
@@ -135,13 +135,10 @@ export default class App extends Vue {
...
@@ -135,13 +135,10 @@ export default class App extends Vue {
}}).
then
(
dataresponse
=>
{
}}).
then
(
dataresponse
=>
{
console
.
log
(
dataresponse
.
data
);
console
.
log
(
dataresponse
.
data
);
var
resourcetype
=
dataresponse
.
data
.
ResourceType
;
var
resourcetype
=
dataresponse
.
data
.
ResourceType
;
var
samplePath
=
dataresponse
.
data
.
CFET2CORE_SAMPLE_PATH
;
this
.
addWidget
(
resourcetype
);
this
.
addWidget
(
resourcetype
);
if
(
resourcetype
!=
"
Thing
"
)
console
.
log
(
resourcetype
);
{
var
tempRef
=
(
this
.
lastWidgetIndex
-
1
).
toString
();
var
tempRef
=
(
this
.
lastWidgetIndex
-
1
).
toString
();
this
.
pokeAndUpdateUI
(
tempRef
,
dataresponse
.
data
);
this
.
pokeAndUpdateUI
(
tempRef
,
dataresponse
.
data
);
}
});
});
}
else
{
}
else
{
//返回有值的customview template,进行load处理
//返回有值的customview template,进行load处理
...
...
src/assets/css/fontSize.css
View file @
98b74648
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
font-size
:
15px
;
font-size
:
15px
;
}
}
.largeFont
{
.largeFont
{
font-size
:
2
0
px
;
font-size
:
2
5
px
;
}
}
.largeFont
span
{
.largeFont
span
{
float
:
left
;
float
:
left
;
...
...
src/components/Common/Navigation.vue
View file @
98b74648
<
template
id=
"Navigation"
>
<
template
id=
"Navigation"
>
<div>
<div>
<
br
>
<
div
style=
"width:100%;margin:5px"
>
<b-button
variant=
"primary"
class=
"smallFont
"
@
click=
"showNavigation"
style=
"float:right"
>
Navigation
</b-button>
<b-button
size=
"lg
"
@
click=
"showNavigation"
style=
"float:right"
>
Navigation
</b-button>
<
br
>
<
/div
>
<div
v-show=
"isShowNavigation&&isShowParentPath"
style=
"width:100%;height:25px"
>
<div
v-show=
"isShowNavigation&&isShowParentPath"
style=
"width:100%;height:25px"
>
<b-link
:href=
"parentPath"
class=
"smallFont"
style=
"float:left"
>
parentPath:
{{
parentPath
}}
</b-link>
<b-link
:href=
"parentPath"
class=
"smallFont"
style=
"float:left"
>
parentPath:
{{
parentPath
}}
</b-link>
<!--
<a
class=
"smallFont"
:href=
"parentPath"
style=
"float:left"
>
parentPath:
{{
parentPath
}}
</a>
-->
<!--
<a
class=
"smallFont"
:href=
"parentPath"
style=
"float:left"
>
parentPath:
{{
parentPath
}}
</a>
-->
</div>
</div>
<div
v-show=
"isShowNavigation"
v-for=
"(path, index) in childrenPath"
:key=
"index"
style=
"width:100%;height:25px"
>
<div
v-show=
"isShowNavigation"
v-for=
"(path, index) in childrenPath"
:key=
"index"
style=
"width:100%;height:25px"
>
<b-link
:href=
"path"
class=
"smallFont"
style=
"float:left"
>
childrenPath:
{{
path
}}
</b-link>
<b-link
:href=
"path"
class=
"smallFont"
style=
"float:left"
>
childrenPath:
{{
path
}}
</b-link>
<!--
<a
class=
"smallFont"
:href=
"path"
style=
"float:left"
>
childrenPath:
{{
path
}}
</a>
-->
<!--
<a
class=
"smallFont"
:href=
"path"
style=
"float:left"
>
childrenPath:
{{
path
}}
</a>
-->
</div>
</div>
</div>
</div>
</
template
>
</
template
>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
Component
,
Prop
,
Vue
,
Watch
}
from
"
vue-property-decorator
"
;
import
{
Component
,
Prop
,
Vue
,
Watch
}
from
"
vue-property-decorator
"
;
import
axios
from
"
axios
"
;
import
axios
from
"
axios
"
;
import
Plotly
from
"
plotly.js
"
;
import
Plotly
from
"
plotly.js
"
;
import
global_
from
'
@/components/Common/global.vue
'
;
import
global_
from
"
@/components/Common/global.vue
"
;
import
{
WidgetConfig
}
from
"
@/models/WidgetConfig
"
;
import
{
WidgetConfig
}
from
"
@/models/WidgetConfig
"
;
import
{
UpdatePayload
}
from
"
@/models/UpdatePayload
"
;
import
{
UpdatePayload
}
from
"
@/models/UpdatePayload
"
;
import
PathProcessor
from
"
@/models/PathProcessor
"
;
import
PathProcessor
from
"
@/models/PathProcessor
"
;
...
@@ -27,40 +32,37 @@ import { map } from "d3";
...
@@ -27,40 +32,37 @@ import { map } from "d3";
import
WidgetParams
from
"
@/components/Common/WidgetParams.vue
"
;
import
WidgetParams
from
"
@/components/Common/WidgetParams.vue
"
;
@
Component
({
@
Component
({
components
:
{
components
:
{
WidgetParams
WidgetParams
}
}
})
})
export
default
class
Navigation
extends
Vue
{
export
default
class
Navigation
extends
Vue
{
@
Prop
()
url
!
:
string
;
@
Prop
()
url
!
:
string
;
parentPath
!
:
string
;
parentPath
!
:
string
;
childrenPath
!
:
string
[];
childrenPath
!
:
string
[];
isShowParentPath
:
boolean
=
false
;
isShowParentPath
:
boolean
=
false
;
isShowNavigation
:
boolean
=
false
;
isShowNavigation
:
boolean
=
false
;
@
Watch
(
"
url
"
)
@
Watch
(
"
url
"
)
onUrlChanged
()
{
onUrlChanged
()
{
this
.
getPath
();
this
.
getPath
();
}
}
async
getPath
()
{
async
getPath
()
{
this
.
isShowParentPath
=
false
;
this
.
isShowParentPath
=
false
;
var
apiLoad
=
this
.
url
;
var
apiLoad
=
this
.
url
;
await
axios
.
get
(
apiLoad
)
await
axios
.
get
(
apiLoad
).
then
(
response
=>
{
.
then
(
response
=>
{
this
.
parentPath
=
response
.
data
.
ParentPath
as
string
;
this
.
parentPath
=
response
.
data
.
ParentPath
as
string
;
this
.
childrenPath
=
response
.
data
.
ChildrenPath
as
string
[];
this
.
childrenPath
=
response
.
data
.
ChildrenPath
as
string
[];
})
});
if
(
this
.
parentPath
!=
''
)
{
if
(
this
.
parentPath
!=
""
)
{
this
.
isShowParentPath
=
true
;
this
.
isShowParentPath
=
true
;
}
}
this
.
$forceUpdate
();
this
.
$forceUpdate
();
}
}
showNavigation
()
showNavigation
()
{
{
this
.
isShowNavigation
=
!
this
.
isShowNavigation
;
this
.
isShowNavigation
=
!
this
.
isShowNavigation
;
}
}
}
}
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
...
...
src/components/Config/Config.vue
View file @
98b74648
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<b-container
class=
"bv-example-row"
>
<b-container
class=
"bv-example-row"
>
<b-row
style=
"margin-top:10px"
>
<b-row
style=
"margin-top:10px"
>
<b-col>
<b-col>
<span
style=
"float:left;"
class=
"
largeFont"
>
getPath:
{{
getPathwithVar
}}
</span>
<span
style=
"float:left;"
class=
"
smallFont"
>
Path:
{{
config
.
data
.
get
.
url
}}
</span>
</b-col>
</b-col>
<b-col>
<b-col>
<b-button
@
click=
"showPathConfig"
variant=
"primary"
style=
"float:right"
>
<b-button
@
click=
"showPathConfig"
variant=
"primary"
style=
"float:right"
>
...
@@ -10,19 +10,24 @@
...
@@ -10,19 +10,24 @@
</b-button>
</b-button>
</b-col>
</b-col>
</b-row>
</b-row>
<b-row
style=
"margin-top:10px"
>
<br
/>
<b-row>
<b-col>
<b-col>
<span
style=
"float:left"
class=
"largeFont"
>
setPath:
{{
getSetwithVar
}}
</span>
<div
v-if=
"getConfigValue!=''&&getConfigValue!=undefined"
style=
"width:100%;overflow:auto;border-style: solid; border-width: 1px;"
>
<p
style=
"float:left;margin:0px"
class=
"largeFont"
>
{{
getConfigValue
}}
</p>
</div>
</b-col>
</b-col>
</b-row>
</b-row>
<div
style=
"width:100%"
>
<span
style=
"float:left;"
class=
"largeFont"
>
{{
getConfigValue
}}
</span>
<br
/>
</div>
<br>
<b-row>
<br>
<b-col>
<div
v-show=
"isShowGetPath"
>
<hr
/>
</div>
<b-input-group
size=
"lg"
prepend=
"getPath"
v-show=
"isShowGetPath"
>
<b-input-group
size=
"lg"
prepend=
"getPath"
v-show=
"isShowGetPath"
>
<b-form-input
v-model=
"config.data.get.url"
></b-form-input>
<b-form-input
v-model=
"config.data.get.url"
></b-form-input>
<b-input-group-append>
<b-input-group-append>
...
@@ -30,19 +35,24 @@
...
@@ -30,19 +35,24 @@
<b-button
variant=
"info"
@
click=
"getPathPoke"
>
poke
</b-button>
<b-button
variant=
"info"
@
click=
"getPathPoke"
>
poke
</b-button>
</b-input-group-append>
</b-input-group-append>
</b-input-group>
</b-input-group>
<div>
</b-col>
<hr
v-show=
"isShowGetParams"
/>
</b-row>
</div>
<b-row>
<b-col>
<WidgetParams
<WidgetParams
ref=
"WidgetGetParams"
ref=
"WidgetGetParams"
v-show=
"isShowGetParams"
v-show=
"isShowGetParams"
action=
"get"
action=
"get"
@
updataVariables=
"viewGetLoad"
@
updataVariables=
"viewGetLoad"
></WidgetParams>
></WidgetParams>
<br>
</b-col>
<div>
</b-row>
<hr
v-show=
"isShowSetPath"
/>
</div>
<br
/>
<b-row>
<b-col>
<b-input-group
size=
"lg"
prepend=
"setPath"
v-show=
"isShowSetPath"
>
<b-input-group
size=
"lg"
prepend=
"setPath"
v-show=
"isShowSetPath"
>
<b-form-input
v-model=
"config.data.set.url"
></b-form-input>
<b-form-input
v-model=
"config.data.set.url"
></b-form-input>
<b-input-group-append>
<b-input-group-append>
...
@@ -50,17 +60,26 @@
...
@@ -50,17 +60,26 @@
<b-button
variant=
"info"
@
click=
"setPathPoke"
>
poke
</b-button>
<b-button
variant=
"info"
@
click=
"setPathPoke"
>
poke
</b-button>
</b-input-group-append>
</b-input-group-append>
</b-input-group>
</b-input-group>
<div>
</b-col>
<hr
v-show=
"isShowSetParams"
/>
</b-row>
</div>
<b-row>
<b-col>
<WidgetParams
<WidgetParams
ref=
"WidgetSetParams"
ref=
"WidgetSetParams"
v-show=
"isShowSetParams"
v-show=
"isShowSetParams"
action=
"set"
action=
"set"
@
updataVariables=
"viewSetLoad"
@
updataVariables=
"viewSetLoad"
></WidgetParams>
></WidgetParams>
<br>
</b-col>
</b-row>
<br
/>
<b-row>
<b-col>
<Navigation
ref=
"FamilyLink"
:url=
"config.data.get.url"
></Navigation>
<Navigation
ref=
"FamilyLink"
:url=
"config.data.get.url"
></Navigation>
</b-col>
</b-row>
</b-container>
</b-container>
</
template
>
</
template
>
...
@@ -79,7 +98,7 @@ import PathProcessor from "@/models/PathProcessor";
...
@@ -79,7 +98,7 @@ import PathProcessor from "@/models/PathProcessor";
import
StrMapObjChange
from
"
@/models/StrMapObjChange
"
;
import
StrMapObjChange
from
"
@/models/StrMapObjChange
"
;
import
{
forEach
}
from
"
typescript-collections/dist/lib/arrays
"
;
import
{
forEach
}
from
"
typescript-collections/dist/lib/arrays
"
;
import
{
map
}
from
"
d3
"
;
import
{
map
}
from
"
d3
"
;
import
Navigation
from
'
@/components/Common/Navigation.vue
'
;
import
Navigation
from
"
@/components/Common/Navigation.vue
"
;
@
Component
({
@
Component
({
components
:
{
components
:
{
...
@@ -116,11 +135,14 @@ export default class Config extends Widget {
...
@@ -116,11 +135,14 @@ export default class Config extends Widget {
created
()
{
created
()
{
// this.config.data.userInputData = this.userInputData;
// this.config.data.userInputData = this.userInputData;
this
.
config
.
data
.
get
.
userInputData
=
this
.
strMapObjChange
.
strMapToObj
(
this
.
userGetInputData
);
this
.
config
.
data
.
get
.
userInputData
=
this
.
strMapObjChange
.
strMapToObj
(
this
.
config
.
data
.
set
.
userInputData
=
this
.
strMapObjChange
.
strMapToObj
(
this
.
userSetInputData
);
this
.
userGetInputData
);
this
.
config
.
data
.
set
.
userInputData
=
this
.
strMapObjChange
.
strMapToObj
(
this
.
userSetInputData
);
}
}
updateUI
()
{
updateUI
()
{
this
.
updateGetUI
();
this
.
updateGetUI
();
this
.
updateSetUI
();
this
.
updateSetUI
();
...
@@ -147,17 +169,13 @@ export default class Config extends Widget {
...
@@ -147,17 +169,13 @@ export default class Config extends Widget {
}
}
showPathConfig
()
{
showPathConfig
()
{
if
(
this
.
isShowGetPath
==
this
.
isShowSetPath
)
if
(
this
.
isShowGetPath
==
this
.
isShowSetPath
)
{
{
this
.
isShowGetPath
=
!
this
.
isShowGetPath
;
this
.
isShowGetPath
=
!
this
.
isShowGetPath
;
this
.
isShowSetPath
=
!
this
.
isShowSetPath
;
this
.
isShowSetPath
=
!
this
.
isShowSetPath
;
}
}
else
{
else
{
this
.
isShowGetPath
=
true
;
this
.
isShowGetPath
=
true
;
this
.
isShowSetPath
=
true
;
this
.
isShowSetPath
=
true
;
}
}
}
}
getConfig
():
WidgetConfig
{
getConfig
():
WidgetConfig
{
...
@@ -199,33 +217,30 @@ export default class Config extends Widget {
...
@@ -199,33 +217,30 @@ export default class Config extends Widget {
);
);
}
}
samplePoke
(
sample
:
any
)
{
samplePoke
(
sample
:
any
)
{
var
samplePath
=
sample
.
CFET2CORE_SAMPLE_PATH
;
var
samplePath
=
sample
.
CFET2CORE_SAMPLE_PATH
;
var
pokedPath
:
string
;
var
pokedPath
:
string
;
pokedPath
=
samplePath
;
pokedPath
=
samplePath
;
var
count
:
number
=
0
;
var
count
:
number
=
0
;
if
(
this
.
isSetPoke
==
false
||
this
.
isGetPoke
==
true
)
{
if
(
this
.
isSetPoke
==
false
||
this
.
isGetPoke
==
true
)
{
var
temp
=
sample
.
Actions
.
get
.
Parameters
;
var
temp
=
sample
.
Actions
.
get
.
Parameters
;
temp
=
JSON
.
parse
(
JSON
.
stringify
(
temp
));
temp
=
JSON
.
parse
(
JSON
.
stringify
(
temp
));
temp
=
this
.
strMapObjChange
.
objToStrMap
(
temp
);
temp
=
this
.
strMapObjChange
.
objToStrMap
(
temp
);
var
Parameters
:
Map
<
string
,
string
>
;
var
Parameters
:
Map
<
string
,
string
>
;
Parameters
=
temp
;
Parameters
=
temp
;
console
.
log
(
Parameters
);
console
.
log
(
Parameters
);
Parameters
.
forEach
((
value
,
key
)
=>
{
Parameters
.
forEach
((
value
,
key
)
=>
{
count
++
;
count
++
;
if
(
count
==
1
)
if
(
count
==
1
)
{
{
pokedPath
=
pokedPath
+
"
?
"
;
pokedPath
=
pokedPath
+
"
?
"
;
}
}
pokedPath
=
pokedPath
+
key
+
"
=$
"
+
key
+
"
$&
"
;
pokedPath
=
pokedPath
+
key
+
"
=$
"
+
key
+
"
$&
"
;
});
});
if
(
count
!=
0
)
if
(
count
!=
0
)
{
{
pokedPath
=
pokedPath
.
substring
(
0
,
pokedPath
.
length
-
1
);
pokedPath
=
pokedPath
.
substring
(
0
,
pokedPath
.
length
-
1
);
}
}
this
.
config
.
data
.
get
.
url
=
pokedPath
;
this
.
config
.
data
.
get
.
url
=
pokedPath
;
}
}
...
@@ -238,22 +253,20 @@ export default class Config extends Widget {
...
@@ -238,22 +253,20 @@ export default class Config extends Widget {
console
.
log
(
settemp
);
console
.
log
(
settemp
);
settemp
=
JSON
.
parse
(
JSON
.
stringify
(
settemp
));
settemp
=
JSON
.
parse
(
JSON
.
stringify
(
settemp
));
settemp
=
this
.
strMapObjChange
.
objToStrMap
(
settemp
);
settemp
=
this
.
strMapObjChange
.
objToStrMap
(
settemp
);
var
SetParameters
:
Map
<
string
,
string
>
;
var
SetParameters
:
Map
<
string
,
string
>
;
SetParameters
=
settemp
;
SetParameters
=
settemp
;
console
.
log
(
SetParameters
);
console
.
log
(
SetParameters
);
SetParameters
.
forEach
((
value
,
key
)
=>
{
SetParameters
.
forEach
((
value
,
key
)
=>
{
count
++
;
count
++
;
if
(
count
==
1
)
if
(
count
==
1
)
{
{
pokedPath
=
pokedPath
+
"
?
"
;
pokedPath
=
pokedPath
+
"
?
"
;
}
}
pokedPath
=
pokedPath
+
key
+
"
=$
"
+
key
+
"
$&
"
;
pokedPath
=
pokedPath
+
key
+
"
=$
"
+
key
+
"
$&
"
;
});
});
if
(
count
!=
0
)
if
(
count
!=
0
)
{
{
pokedPath
=
pokedPath
.
substring
(
0
,
pokedPath
.
length
-
1
);
pokedPath
=
pokedPath
.
substring
(
0
,
pokedPath
.
length
-
1
);
}
}
this
.
config
.
data
.
set
.
url
=
pokedPath
;
this
.
config
.
data
.
set
.
url
=
pokedPath
;
}
}
...
@@ -261,8 +274,7 @@ export default class Config extends Widget {
...
@@ -261,8 +274,7 @@ export default class Config extends Widget {
this
.
isGetPoke
=
false
;
this
.
isGetPoke
=
false
;
}
}
getPathPoke
()
getPathPoke
()
{
{
var
f
=
this
.
config
.
data
.
get
.
url
;
var
f
=
this
.
config
.
data
.
get
.
url
;
var
pokepath
=
"
a
"
;
var
pokepath
=
"
a
"
;
pokepath
=
f
;
pokepath
=
f
;
...
@@ -270,12 +282,10 @@ export default class Config extends Widget {
...
@@ -270,12 +282,10 @@ export default class Config extends Widget {
this
.
isGetPoke
=
true
;
this
.
isGetPoke
=
true
;
this
.
samplePoke
(
response
.
data
);
this
.
samplePoke
(
response
.
data
);
this
.
updateUI
();
this
.
updateUI
();
})
});
}
}
setPathPoke
()
{
setPathPoke
()
{
var
f
=
this
.
config
.
data
.
set
.
url
;
var
f
=
this
.
config
.
data
.
set
.
url
;
var
pokepath
=
"
a
"
;
var
pokepath
=
"
a
"
;
pokepath
=
f
;
pokepath
=
f
;
...
@@ -283,7 +293,7 @@ export default class Config extends Widget {
...
@@ -283,7 +293,7 @@ export default class Config extends Widget {
this
.
isSetPoke
=
true
;
this
.
isSetPoke
=
true
;
this
.
samplePoke
(
response
.
data
);
this
.
samplePoke
(
response
.
data
);
this
.
updateUI
();
this
.
updateUI
();
})
});
}
}
pathPoke
()
{
pathPoke
()
{
...
@@ -359,6 +369,7 @@ export default class Config extends Widget {
...
@@ -359,6 +369,7 @@ export default class Config extends Widget {
console
.
log
(
this
.
setConfigValue
);
console
.
log
(
this
.
setConfigValue
);
console
.
log
(
this
.
setPathwithVar
);
console
.
log
(
this
.
setPathwithVar
);
await
this
.
setData
(
this
.
setPathwithVar
);
await
this
.
setData
(
this
.
setPathwithVar
);
this
.
refresh
();
}
}
}
}
</
script
>
</
script
>
...
...
src/components/Method/Method.vue
View file @
98b74648
...
@@ -2,17 +2,32 @@
...
@@ -2,17 +2,32 @@
<b-container
class=
"bv-example-row"
>
<b-container
class=
"bv-example-row"
>
<b-row
style=
"margin-top:10px"
>
<b-row
style=
"margin-top:10px"
>
<b-col>
<b-col>
<span
style=
"float:left;"
class=
"
largeFont"
>
path:
{{
pathwithVar
}}
</span>
<span
style=
"float:left;"
class=
"
smallFont"
>
path:
{{
config
.
data
.
url
}}
</span>
</b-col>
</b-col>
<b-col>
<b-col>
<b-button
@
click=
"showPathConfig"
variant=
"primary"
style=
"float:right"
><span
class=
"glyphicon glyphicon-cog"
></span></b-button>
<b-button
@
click=
"showPathConfig"
variant=
"primary"
style=
"float:right"
>
<span
class=
"glyphicon glyphicon-cog"
></span>
</b-button>
</b-col>
</b-col>
<div
v-show=
"isShowPath"
><hr
/></div>
</b-row>
</b-row>
<div
style=
"width:100%"
>
<span
style=
"float:left;"
class=
"largeFont"
>
{{
StatusValue
}}
</span>
<br
/>
<div
v-show=
"isShowPath"
><hr
/></div>
<b-row>
<b-col>
<div
v-if=
"StatusValue!=''&&StatusValue!=undefined"
style=
"width:100%;overflow:auto;border-style: solid; border-width: 1px;"
>
<p
style=
"float:left;margin:0px"
class=
"largeFont"
>
{{
StatusValue
}}
</p>
</div>
</div>
</b-col>
</b-row>
<br
/>
<b-row>
<b-col>
<b-input-group
size=
"lg"
prepend=
"path"
v-show=
"isShowPath"
>
<b-input-group
size=
"lg"
prepend=
"path"
v-show=
"isShowPath"
>
<b-form-input
v-model=
"config.data.url"
></b-form-input>
<b-form-input
v-model=
"config.data.url"
></b-form-input>
<b-input-group-append>
<b-input-group-append>
...
@@ -20,15 +35,32 @@
...
@@ -20,15 +35,32 @@
<b-button
variant=
"info"
@
click=
"pathPoke"
>
poke
</b-button>
<b-button
variant=
"info"
@
click=
"pathPoke"
>
poke
</b-button>
</b-input-group-append>
</b-input-group-append>
</b-input-group>
</b-input-group>
<hr/>
</b-col>
<WidgetParams
ref=
"WidgetParams"
v-show=
"isShowParams"
action=
"invoke"
@
updataVariables=
"viewLoad"
></WidgetParams><br>
</b-row>
<b-row>
<b-col>
<WidgetParams
ref=
"WidgetParams"
v-show=
"isShowParams"
action=
"invoke"
@
updataVariables=
"viewLoad"
></WidgetParams>
</b-col>
</b-row>
<br
/>
<b-row>
<b-col>
<Navigation
ref=
"FamilyLink"
:url=
"config.data.url"
></Navigation>
<Navigation
ref=
"FamilyLink"
:url=
"config.data.url"
></Navigation>
</b-col>
</b-row>
</b-container>
</b-container>
</
template
>
</
template
>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
Vue
from
"
vue
"
;
import
Vue
from
"
vue
"
;
import
{
VueSvgGauge
}
from
'
vue-svg-gauge
'
import
{
VueSvgGauge
}
from
"
vue-svg-gauge
"
;
import
Component
from
"
vue-class-component
"
;
import
Component
from
"
vue-class-component
"
;
import
{
Prop
,
Watch
}
from
"
vue-property-decorator
"
;
import
{
Prop
,
Watch
}
from
"
vue-property-decorator
"
;
import
{
WidgetConfig
}
from
"
@/models/WidgetConfig
"
;
import
{
WidgetConfig
}
from
"
@/models/WidgetConfig
"
;
...
@@ -41,7 +73,7 @@ import PathProcessor from "@/models/PathProcessor";
...
@@ -41,7 +73,7 @@ import PathProcessor from "@/models/PathProcessor";
import
StrMapObjChange
from
"
@/models/StrMapObjChange
"
;
import
StrMapObjChange
from
"
@/models/StrMapObjChange
"
;
import
{
forEach
}
from
"
typescript-collections/dist/lib/arrays
"
;
import
{
forEach
}
from
"
typescript-collections/dist/lib/arrays
"
;
import
{
map
}
from
"
d3
"
;
import
{
map
}
from
"
d3
"
;
import
Navigation
from
'
@/components/Common/Navigation.vue
'
;
import
Navigation
from
"
@/components/Common/Navigation.vue
"
;
@
Component
({
@
Component
({
components
:
{
components
:
{
...
@@ -56,7 +88,7 @@ export default class Method extends Widget {
...
@@ -56,7 +88,7 @@ export default class Method extends Widget {
StatusValue
:
string
=
""
;
StatusValue
:
string
=
""
;
pathId
:
string
=
""
;
pathId
:
string
=
""
;
userInputData
=
new
Map
<
string
,
string
>
();
userInputData
=
new
Map
<
string
,
string
>
();
pathwithVar
:
string
=
""
;
pathwithVar
:
string
=
""
;
isShowPath
:
boolean
=
false
;
isShowPath
:
boolean
=
false
;
isShowParams
:
boolean
=
false
;
isShowParams
:
boolean
=
false
;
...
@@ -70,10 +102,11 @@ export default class Method extends Widget {
...
@@ -70,10 +102,11 @@ export default class Method extends Widget {
created
()
{
created
()
{
// this.config.data.userInputData = this.userInputData;
// this.config.data.userInputData = this.userInputData;
this
.
config
.
data
.
userInputData
=
this
.
strMapObjChange
.
strMapToObj
(
this
.
userInputData
);
this
.
config
.
data
.
userInputData
=
this
.
strMapObjChange
.
strMapToObj
(
this
.
userInputData
);
}
}
updateUI
()
{
updateUI
()
{
this
.
isShowPath
=
false
;
this
.
isShowPath
=
false
;
this
.
isShowParams
=
true
;
this
.
isShowParams
=
true
;
...
@@ -90,7 +123,9 @@ export default class Method extends Widget {
...
@@ -90,7 +123,9 @@ export default class Method extends Widget {
getConfig
():
WidgetConfig
{
getConfig
():
WidgetConfig
{
// this.config.data.userInputData =(this.$refs.WidgetParams as WidgetParams).getVariableValues();
// this.config.data.userInputData =(this.$refs.WidgetParams as WidgetParams).getVariableValues();
this
.
config
.
data
.
userInputData
=
this
.
strMapObjChange
.
strMapToObj
((
this
.
$refs
.
WidgetParams
as
WidgetParams
).
getVariableValues
());
this
.
config
.
data
.
userInputData
=
this
.
strMapObjChange
.
strMapToObj
(
(
this
.
$refs
.
WidgetParams
as
WidgetParams
).
getVariableValues
()
);
return
this
.
config
;
return
this
.
config
;
}
}
...
@@ -104,41 +139,39 @@ export default class Method extends Widget {
...
@@ -104,41 +139,39 @@ export default class Method extends Widget {
temp
=
this
.
strMapObjChange
.
objToStrMap
(
temp
);
temp
=
this
.
strMapObjChange
.
objToStrMap
(
temp
);
console
.
log
(
temp
);
console
.
log
(
temp
);
this
.
userInputData
=
temp
;
this
.
userInputData
=
temp
;
console
.
log
(
this
.
userInputData
);
/* */
console
.
log
(
this
.
userInputData
);
/* */
(
this
.
$refs
.
WidgetParams
as
WidgetParams
).
setVariableInput
(
this
.
userInputData
);
(
this
.
$refs
.
WidgetParams
as
WidgetParams
).
setVariableInput
(
this
.
userInputData
);
}
}
samplePoke
(
sample
:
any
)
samplePoke
(
sample
:
any
)
{
{
var
samplePath
=
sample
.
CFET2CORE_SAMPLE_PATH
;
var
samplePath
=
sample
.
CFET2CORE_SAMPLE_PATH
;
var
pokedPath
:
string
;
var
pokedPath
:
string
;
pokedPath
=
samplePath
;
pokedPath
=
samplePath
;
var
count
:
number
=
0
;
var
count
:
number
=
0
;
var
temp
=
sample
.
Actions
.
invoke
.
Parameters
;
var
temp
=
sample
.
Actions
.
invoke
.
Parameters
;
temp
=
JSON
.
parse
(
JSON
.
stringify
(
temp
));
temp
=
JSON
.
parse
(
JSON
.
stringify
(
temp
));
temp
=
this
.
strMapObjChange
.
objToStrMap
(
temp
);
temp
=
this
.
strMapObjChange
.
objToStrMap
(
temp
);
var
Parameters
:
Map
<
string
,
string
>
;
var
Parameters
:
Map
<
string
,
string
>
;
Parameters
=
temp
;
Parameters
=
temp
;
Parameters
.
forEach
((
value
,
key
)
=>
{
Parameters
.
forEach
((
value
,
key
)
=>
{
count
++
;
count
++
;
if
(
count
==
1
)
if
(
count
==
1
)
{
{
pokedPath
=
pokedPath
+
"
?
"
;
pokedPath
=
pokedPath
+
"
?
"
;
}
}
pokedPath
=
pokedPath
+
key
+
"
=$
"
+
key
+
"
$&
"
;
pokedPath
=
pokedPath
+
key
+
"
=$
"
+
key
+
"
$&
"
;
});
});
if
(
count
!=
0
)
if
(
count
!=
0
)
{
{
pokedPath
=
pokedPath
.
substring
(
0
,
pokedPath
.
length
-
1
);
pokedPath
=
pokedPath
.
substring
(
0
,
pokedPath
.
length
-
1
);
}
}
this
.
config
.
data
.
url
=
pokedPath
;
this
.
config
.
data
.
url
=
pokedPath
;
}
}
pathPoke
()
pathPoke
()
{
{
var
f
=
this
.
config
.
data
.
url
;
var
f
=
this
.
config
.
data
.
url
;
var
pokepath
=
"
a
"
;
var
pokepath
=
"
a
"
;
pokepath
=
f
;
pokepath
=
f
;
...
@@ -147,18 +180,14 @@ export default class Method extends Widget {
...
@@ -147,18 +180,14 @@ export default class Method extends Widget {
console
.
log
(
resourcetype
);
console
.
log
(
resourcetype
);
this
.
samplePoke
(
response
.
data
);
this
.
samplePoke
(
response
.
data
);
this
.
updateUI
();
this
.
updateUI
();
})
});
}
}
replaceStartPath
(
startPath
:
string
):
void
{
replaceStartPath
(
startPath
:
string
):
void
this
.
config
.
data
.
url
.
replace
(
"
$startPath$
"
,
startPath
);
{
this
.
config
.
data
.
url
.
replace
(
'
$startPath$
'
,
startPath
);
}
}
parentUpdate
(
payload
:
UpdatePayload
):
void
{
parentUpdate
(
payload
:
UpdatePayload
):
void
{}
}
refresh
()
{
refresh
()
{
var
Args
:
UpdatePayload
=
{
var
Args
:
UpdatePayload
=
{
...
@@ -169,7 +198,6 @@ export default class Method extends Widget {
...
@@ -169,7 +198,6 @@ export default class Method extends Widget {
this
.
viewLoad
(
Args
);
this
.
viewLoad
(
Args
);
}
}
async
getData
(
url
:
string
)
{
async
getData
(
url
:
string
)
{
var
apiLoad
=
url
;
var
apiLoad
=
url
;
await
axios
.
put
(
apiLoad
).
then
(
response
=>
{
await
axios
.
put
(
apiLoad
).
then
(
response
=>
{
...
@@ -200,5 +228,4 @@ export default class Method extends Widget {
...
@@ -200,5 +228,4 @@ export default class Method extends Widget {
width
:
100%
;
width
:
100%
;
height
:
auto
;
height
:
auto
;
}
}
</
style
>
</
style
>
\ No newline at end of file
src/components/State/State.vue
View file @
98b74648
...
@@ -2,17 +2,32 @@
...
@@ -2,17 +2,32 @@
<b-container
class=
"bv-example-row"
>
<b-container
class=
"bv-example-row"
>
<b-row
style=
"margin-top:10px"
>
<b-row
style=
"margin-top:10px"
>
<b-col>
<b-col>
<span
style=
"float:left;"
class=
"
largeFont"
>
path:
{{
pathwithVar
}}
</span>
<span
style=
"float:left;"
class=
"
smallFont"
>
path:
{{
config
.
data
.
url
}}
</span>
</b-col>
</b-col>
<b-col>
<b-col>
<b-button
@
click=
"showPathConfig"
variant=
"primary"
style=
"float:right"
><span
class=
"glyphicon glyphicon-cog"
></span></b-button>
<b-button
@
click=
"showPathConfig"
variant=
"primary"
style=
"float:right"
>
<span
class=
"glyphicon glyphicon-cog"
></span>
</b-button>
</b-col>
</b-col>
<div
v-show=
"isShowPath"
><hr
/></div>
</b-row>
</b-row>
<div
style=
"width:100%;overflow:auto"
>
<span
style=
"float:left;"
class=
"largeFont"
>
{{
StatusValue
}}
</span>
<br
/>
<b-row>
<b-col>
<div
v-if=
"StatusValue!=''&&StatusValue!=undefined"
style=
"width:100%;overflow:auto;border-style: solid; border-width: 1px;"
>
<p
style=
"float:left;margin:0px"
class=
"largeFont"
>
{{
StatusValue
}}
</p>
</div>
</div>
<div
v-show=
"isShowPath"
><hr
/></div>
</b-col>
</b-row>
<br
/>
<b-row>
<b-col>
<b-input-group
size=
"lg"
prepend=
"path"
v-show=
"isShowPath"
>
<b-input-group
size=
"lg"
prepend=
"path"
v-show=
"isShowPath"
>
<b-form-input
v-model=
"config.data.url"
></b-form-input>
<b-form-input
v-model=
"config.data.url"
></b-form-input>
<b-input-group-append>
<b-input-group-append>
...
@@ -20,16 +35,33 @@
...
@@ -20,16 +35,33 @@
<b-button
variant=
"info"
@
click=
"pathPoke"
>
poke
</b-button>
<b-button
variant=
"info"
@
click=
"pathPoke"
>
poke
</b-button>
</b-input-group-append>
</b-input-group-append>
</b-input-group>
</b-input-group>
<hr/>
</b-col>
<WidgetParams
ref=
"WidgetParams"
v-show=
"isShowParams"
action=
"get"
@
updataVariables=
"viewLoad"
></WidgetParams><br>
</b-row>
<b-row>
<b-col>
<WidgetParams
ref=
"WidgetParams"
v-show=
"isShowParams"
action=
"get"
@
updataVariables=
"viewLoad"
></WidgetParams>
</b-col>
</b-row>
<br
/>
<b-row>
<b-col>
<Navigation
ref=
"FamilyLink"
:url=
"config.data.url"
></Navigation>
<Navigation
ref=
"FamilyLink"
:url=
"config.data.url"
></Navigation>
</b-col>
</b-row>
</b-container>
</b-container>
</
template
>
</
template
>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
Vue
from
"
vue
"
;
import
Vue
from
"
vue
"
;
import
{
VueSvgGauge
}
from
'
vue-svg-gauge
'
import
{
VueSvgGauge
}
from
"
vue-svg-gauge
"
;
import
Component
from
"
vue-class-component
"
;
import
Component
from
"
vue-class-component
"
;
import
{
Prop
,
Watch
}
from
"
vue-property-decorator
"
;
import
{
Prop
,
Watch
}
from
"
vue-property-decorator
"
;
import
{
WidgetConfig
}
from
"
@/models/WidgetConfig
"
;
import
{
WidgetConfig
}
from
"
@/models/WidgetConfig
"
;
...
@@ -42,7 +74,7 @@ import PathProcessor from "@/models/PathProcessor";
...
@@ -42,7 +74,7 @@ import PathProcessor from "@/models/PathProcessor";
import
StrMapObjChange
from
"
@/models/StrMapObjChange
"
;
import
StrMapObjChange
from
"
@/models/StrMapObjChange
"
;
import
{
forEach
}
from
"
typescript-collections/dist/lib/arrays
"
;
import
{
forEach
}
from
"
typescript-collections/dist/lib/arrays
"
;
import
{
map
}
from
"
d3
"
;
import
{
map
}
from
"
d3
"
;
import
Navigation
from
'
@/components/Common/Navigation.vue
'
;
import
Navigation
from
"
@/components/Common/Navigation.vue
"
;
@
Component
({
@
Component
({
components
:
{
components
:
{
...
@@ -57,8 +89,8 @@ export default class State extends Widget {
...
@@ -57,8 +89,8 @@ export default class State extends Widget {
StatusValue
:
string
=
""
;
StatusValue
:
string
=
""
;
pathId
:
string
=
""
;
pathId
:
string
=
""
;
userInputData
=
new
Map
<
string
,
string
>
();
userInputData
=
new
Map
<
string
,
string
>
();
pathwithVar
:
string
=
""
;
pathwithVar
:
string
=
""
;
timer
?:
number
;
timer
?:
number
;
isShowPath
:
boolean
=
false
;
isShowPath
:
boolean
=
false
;
isShowParams
:
boolean
=
false
;
isShowParams
:
boolean
=
false
;
...
@@ -72,16 +104,16 @@ export default class State extends Widget {
...
@@ -72,16 +104,16 @@ export default class State extends Widget {
created
()
{
created
()
{
// this.config.data.userInputData = this.userInputData;
// this.config.data.userInputData = this.userInputData;
this
.
config
.
data
.
userInputData
=
this
.
strMapObjChange
.
strMapToObj
(
this
.
userInputData
);
this
.
config
.
data
.
userInputData
=
this
.
strMapObjChange
.
strMapToObj
(
this
.
userInputData
);
}
}
mounted
()
mounted
()
{
{
this
.
timer
=
setInterval
(
this
.
refresh
,
1000
);
this
.
timer
=
setInterval
(
this
.
refresh
,
1000
);
}
}
destroyed
()
destroyed
()
{
{
clearInterval
(
this
.
timer
);
clearInterval
(
this
.
timer
);
}
}
...
@@ -101,7 +133,9 @@ export default class State extends Widget {
...
@@ -101,7 +133,9 @@ export default class State extends Widget {
getConfig
():
WidgetConfig
{
getConfig
():
WidgetConfig
{
// this.config.data.userInputData =(this.$refs.WidgetParams as WidgetParams).getVariableValues();
// this.config.data.userInputData =(this.$refs.WidgetParams as WidgetParams).getVariableValues();
this
.
config
.
data
.
userInputData
=
this
.
strMapObjChange
.
strMapToObj
((
this
.
$refs
.
WidgetParams
as
WidgetParams
).
getVariableValues
());
this
.
config
.
data
.
userInputData
=
this
.
strMapObjChange
.
strMapToObj
(
(
this
.
$refs
.
WidgetParams
as
WidgetParams
).
getVariableValues
()
);
return
this
.
config
;
return
this
.
config
;
}
}
...
@@ -115,58 +149,53 @@ export default class State extends Widget {
...
@@ -115,58 +149,53 @@ export default class State extends Widget {
temp
=
this
.
strMapObjChange
.
objToStrMap
(
temp
);
temp
=
this
.
strMapObjChange
.
objToStrMap
(
temp
);
console
.
log
(
temp
);
console
.
log
(
temp
);
this
.
userInputData
=
temp
;
this
.
userInputData
=
temp
;
console
.
log
(
this
.
userInputData
);
/* */
console
.
log
(
this
.
userInputData
);
/* */
(
this
.
$refs
.
WidgetParams
as
WidgetParams
).
setVariableInput
(
this
.
userInputData
);
(
this
.
$refs
.
WidgetParams
as
WidgetParams
).
setVariableInput
(
this
.
userInputData
);
}
}
samplePoke
(
sample
:
any
)
samplePoke
(
sample
:
any
)
{
{
var
samplePath
=
sample
.
CFET2CORE_SAMPLE_PATH
;
var
samplePath
=
sample
.
CFET2CORE_SAMPLE_PATH
;
var
pokedPath
:
string
;
var
pokedPath
:
string
;
pokedPath
=
samplePath
;
pokedPath
=
samplePath
;
var
count
:
number
=
0
;
var
count
:
number
=
0
;
var
temp
=
sample
.
Actions
.
get
.
Parameters
;
var
temp
=
sample
.
Actions
.
get
.
Parameters
;
temp
=
JSON
.
parse
(
JSON
.
stringify
(
temp
));
temp
=
JSON
.
parse
(
JSON
.
stringify
(
temp
));
temp
=
this
.
strMapObjChange
.
objToStrMap
(
temp
);
temp
=
this
.
strMapObjChange
.
objToStrMap
(
temp
);
var
Parameters
:
Map
<
string
,
string
>
;
var
Parameters
:
Map
<
string
,
string
>
;
Parameters
=
temp
;
Parameters
=
temp
;
Parameters
.
forEach
((
value
,
key
)
=>
{
Parameters
.
forEach
((
value
,
key
)
=>
{
count
++
;
count
++
;
if
(
count
==
1
)
if
(
count
==
1
)
{
{
pokedPath
=
pokedPath
+
"
?
"
;
pokedPath
=
pokedPath
+
"
?
"
;
}
}
pokedPath
=
pokedPath
+
key
+
"
=$
"
+
key
+
"
$&
"
;
pokedPath
=
pokedPath
+
key
+
"
=$
"
+
key
+
"
$&
"
;
});
});
if
(
count
!=
0
)
if
(
count
!=
0
)
{
{
pokedPath
=
pokedPath
.
substring
(
0
,
pokedPath
.
length
-
1
);
pokedPath
=
pokedPath
.
substring
(
0
,
pokedPath
.
length
-
1
);
}
}
this
.
config
.
data
.
url
=
pokedPath
;
this
.
config
.
data
.
url
=
pokedPath
;
}
}
pathPoke
()
pathPoke
()
{
{
var
f
=
this
.
config
.
data
.
url
;
var
f
=
this
.
config
.
data
.
url
;
var
pokepath
=
"
a
"
;
var
pokepath
=
"
a
"
;
pokepath
=
f
;
pokepath
=
f
;
axios
.
get
(
pokepath
).
then
(
response
=>
{
axios
.
get
(
pokepath
).
then
(
response
=>
{
this
.
samplePoke
(
response
.
data
);
this
.
samplePoke
(
response
.
data
);
this
.
updateUI
();
this
.
updateUI
();
})
});
}
}
replaceStartPath
(
startPath
:
string
):
void
replaceStartPath
(
startPath
:
string
):
void
{
{
this
.
config
.
data
.
url
.
replace
(
"
$startPath$
"
,
startPath
);
this
.
config
.
data
.
url
.
replace
(
'
$startPath$
'
,
startPath
);
}
}
parentUpdate
(
payload
:
UpdatePayload
):
void
{
parentUpdate
(
payload
:
UpdatePayload
):
void
{}
}
refresh
()
{
refresh
()
{
var
Args
:
UpdatePayload
=
{
var
Args
:
UpdatePayload
=
{
...
@@ -177,28 +206,26 @@ export default class State extends Widget {
...
@@ -177,28 +206,26 @@ export default class State extends Widget {
this
.
viewLoad
(
Args
);
this
.
viewLoad
(
Args
);
}
}
async
getData
(
url
:
string
)
{
async
getData
(
url
:
string
)
{
var
apiLoad
=
url
;
var
apiLoad
=
url
;
await
axios
.
get
(
apiLoad
).
then
(
response
=>
{
await
axios
.
get
(
apiLoad
).
then
(
response
=>
{
console
.
log
(
response
);
console
.
log
(
response
);
this
.
StatusValue
=
response
.
data
.
CFET2CORE_SAMPLE_VAL
;
this
.
StatusValue
=
response
.
data
.
CFET2CORE_SAMPLE_VAL
;
switch
(
this
.
StatusValue
.
toString
())
switch
(
this
.
StatusValue
.
toString
())
{
{
case
"
0
"
:
{
case
"
0
"
:{
this
.
StatusValue
=
"
Idle
"
;
this
.
StatusValue
=
"
Idle
"
break
;
break
;
}
}
case
"
1
"
:
{
case
"
1
"
:
{
this
.
StatusValue
=
"
Ready
"
this
.
StatusValue
=
"
Ready
"
;
break
;
break
;
}
}
case
"
2
"
:
{
case
"
2
"
:
{
this
.
StatusValue
=
"
Running
"
this
.
StatusValue
=
"
Running
"
;
break
;
break
;
}
}
case
"
255
"
:
{
case
"
255
"
:
{
this
.
StatusValue
=
"
Error
"
this
.
StatusValue
=
"
Error
"
;
break
;
break
;
}
}
}
}
...
@@ -227,5 +254,4 @@ export default class State extends Widget {
...
@@ -227,5 +254,4 @@ export default class State extends Widget {
width
:
100%
;
width
:
100%
;
height
:
auto
;
height
:
auto
;
}
}
</
style
>
</
style
>
\ No newline at end of file
src/components/Status/Status.vue
View file @
98b74648
...
@@ -2,17 +2,32 @@
...
@@ -2,17 +2,32 @@
<b-container
class=
"bv-example-row"
>
<b-container
class=
"bv-example-row"
>
<b-row
style=
"margin-top:10px"
>
<b-row
style=
"margin-top:10px"
>
<b-col>
<b-col>
<span
style=
"float:left;"
class=
"
largeFont"
>
path:
{{
pathwithVar
}}
</span>
<span
style=
"float:left;"
class=
"
smallFont"
>
path:
{{
config
.
data
.
url
}}
</span>
</b-col>
</b-col>
<b-col>
<b-col>
<b-button
@
click=
"showPathConfig"
variant=
"primary"
style=
"float:right"
><span
class=
"glyphicon glyphicon-cog"
></span></b-button>
<b-button
@
click=
"showPathConfig"
variant=
"primary"
style=
"float:right"
>
<span
class=
"glyphicon glyphicon-cog"
></span>
</b-button>
</b-col>
</b-col>
<div
v-show=
"isShowPath"
><hr
/></div>
</b-row>
</b-row>
<div
style=
"width:100%;overflow:auto"
>
<span
style=
"float:left;"
class=
"largeFont"
>
{{
StatusValue
}}
</span>
<br
/>
<b-row>
<b-col>
<div
v-if=
"StatusValue!=''&&StatusValue!=undefined"
style=
"width:100%;overflow:auto;border-style: solid; border-width: 1px;"
>
<p
style=
"float:left;margin:0px"
class=
"largeFont"
>
{{
StatusValue
}}
</p>
</div>
</div>
<div
v-show=
"isShowPath"
><hr
/></div>
</b-col>
</b-row>
<br
/>
<b-row>
<b-col>
<b-input-group
size=
"lg"
prepend=
"path"
v-show=
"isShowPath"
>
<b-input-group
size=
"lg"
prepend=
"path"
v-show=
"isShowPath"
>
<b-form-input
v-model=
"config.data.url"
></b-form-input>
<b-form-input
v-model=
"config.data.url"
></b-form-input>
<b-input-group-append>
<b-input-group-append>
...
@@ -20,15 +35,32 @@
...
@@ -20,15 +35,32 @@
<b-button
variant=
"info"
@
click=
"pathPoke"
>
poke
</b-button>
<b-button
variant=
"info"
@
click=
"pathPoke"
>
poke
</b-button>
</b-input-group-append>
</b-input-group-append>
</b-input-group>
</b-input-group>
<hr/>
</b-col>
<WidgetParams
ref=
"WidgetParams"
v-show=
"isShowParams"
action=
"get"
@
updataVariables=
"viewLoad"
></WidgetParams><br>
</b-row>
<b-row>
<b-col>
<WidgetParams
ref=
"WidgetParams"
v-show=
"isShowParams"
action=
"get"
@
updataVariables=
"viewLoad"
></WidgetParams>
</b-col>
</b-row>
<br
/>
<b-row>
<b-col>
<Navigation
ref=
"FamilyLink"
:url=
"config.data.url"
></Navigation>
<Navigation
ref=
"FamilyLink"
:url=
"config.data.url"
></Navigation>
</b-col>
</b-row>
</b-container>
</b-container>
</
template
>
</
template
>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
Vue
from
"
vue
"
;
import
Vue
from
"
vue
"
;
import
{
VueSvgGauge
}
from
'
vue-svg-gauge
'
import
{
VueSvgGauge
}
from
"
vue-svg-gauge
"
;
import
Component
from
"
vue-class-component
"
;
import
Component
from
"
vue-class-component
"
;
import
{
Prop
,
Watch
}
from
"
vue-property-decorator
"
;
import
{
Prop
,
Watch
}
from
"
vue-property-decorator
"
;
import
{
WidgetConfig
}
from
"
@/models/WidgetConfig
"
;
import
{
WidgetConfig
}
from
"
@/models/WidgetConfig
"
;
...
@@ -41,7 +73,7 @@ import PathProcessor from "@/models/PathProcessor";
...
@@ -41,7 +73,7 @@ import PathProcessor from "@/models/PathProcessor";
import
StrMapObjChange
from
"
@/models/StrMapObjChange
"
;
import
StrMapObjChange
from
"
@/models/StrMapObjChange
"
;
import
{
forEach
}
from
"
typescript-collections/dist/lib/arrays
"
;
import
{
forEach
}
from
"
typescript-collections/dist/lib/arrays
"
;
import
{
map
}
from
"
d3
"
;
import
{
map
}
from
"
d3
"
;
import
Navigation
from
'
@/components/Common/Navigation.vue
'
;
import
Navigation
from
"
@/components/Common/Navigation.vue
"
;
@
Component
({
@
Component
({
components
:
{
components
:
{
...
@@ -56,8 +88,8 @@ export default class Status extends Widget {
...
@@ -56,8 +88,8 @@ export default class Status extends Widget {
StatusValue
:
string
=
""
;
StatusValue
:
string
=
""
;
pathId
:
string
=
""
;
pathId
:
string
=
""
;
userInputData
=
new
Map
<
string
,
string
>
();
userInputData
=
new
Map
<
string
,
string
>
();
pathwithVar
:
string
=
""
;
pathwithVar
:
string
=
""
;
timer
?:
number
;
timer
?:
number
;
isShowPath
:
boolean
=
false
;
isShowPath
:
boolean
=
false
;
isShowParams
:
boolean
=
false
;
isShowParams
:
boolean
=
false
;
...
@@ -71,16 +103,16 @@ export default class Status extends Widget {
...
@@ -71,16 +103,16 @@ export default class Status extends Widget {
created
()
{
created
()
{
// this.config.data.userInputData = this.userInputData;
// this.config.data.userInputData = this.userInputData;
this
.
config
.
data
.
userInputData
=
this
.
strMapObjChange
.
strMapToObj
(
this
.
userInputData
);
this
.
config
.
data
.
userInputData
=
this
.
strMapObjChange
.
strMapToObj
(
this
.
userInputData
);
}
}
mounted
()
mounted
()
{
{
this
.
timer
=
setInterval
(
this
.
refresh
,
1000
);
this
.
timer
=
setInterval
(
this
.
refresh
,
1000
);
}
}
destroyed
()
destroyed
()
{
{
clearInterval
(
this
.
timer
);
clearInterval
(
this
.
timer
);
}
}
...
@@ -100,7 +132,9 @@ export default class Status extends Widget {
...
@@ -100,7 +132,9 @@ export default class Status extends Widget {
getConfig
():
WidgetConfig
{
getConfig
():
WidgetConfig
{
// this.config.data.userInputData =(this.$refs.WidgetParams as WidgetParams).getVariableValues();
// this.config.data.userInputData =(this.$refs.WidgetParams as WidgetParams).getVariableValues();
this
.
config
.
data
.
userInputData
=
this
.
strMapObjChange
.
strMapToObj
((
this
.
$refs
.
WidgetParams
as
WidgetParams
).
getVariableValues
());
this
.
config
.
data
.
userInputData
=
this
.
strMapObjChange
.
strMapToObj
(
(
this
.
$refs
.
WidgetParams
as
WidgetParams
).
getVariableValues
()
);
return
this
.
config
;
return
this
.
config
;
}
}
...
@@ -114,58 +148,53 @@ export default class Status extends Widget {
...
@@ -114,58 +148,53 @@ export default class Status extends Widget {
temp
=
this
.
strMapObjChange
.
objToStrMap
(
temp
);
temp
=
this
.
strMapObjChange
.
objToStrMap
(
temp
);
console
.
log
(
temp
);
console
.
log
(
temp
);
this
.
userInputData
=
temp
;
this
.
userInputData
=
temp
;
console
.
log
(
this
.
userInputData
);
/* */
console
.
log
(
this
.
userInputData
);
/* */
(
this
.
$refs
.
WidgetParams
as
WidgetParams
).
setVariableInput
(
this
.
userInputData
);
(
this
.
$refs
.
WidgetParams
as
WidgetParams
).
setVariableInput
(
this
.
userInputData
);
}
}
samplePoke
(
sample
:
any
)
samplePoke
(
sample
:
any
)
{
{
var
samplePath
=
sample
.
CFET2CORE_SAMPLE_PATH
;
var
samplePath
=
sample
.
CFET2CORE_SAMPLE_PATH
;
var
pokedPath
:
string
;
var
pokedPath
:
string
;
pokedPath
=
samplePath
;
pokedPath
=
samplePath
;
var
count
:
number
=
0
;
var
count
:
number
=
0
;
var
temp
=
sample
.
Actions
.
get
.
Parameters
;
var
temp
=
sample
.
Actions
.
get
.
Parameters
;
temp
=
JSON
.
parse
(
JSON
.
stringify
(
temp
));
temp
=
JSON
.
parse
(
JSON
.
stringify
(
temp
));
temp
=
this
.
strMapObjChange
.
objToStrMap
(
temp
);
temp
=
this
.
strMapObjChange
.
objToStrMap
(
temp
);
var
Parameters
:
Map
<
string
,
string
>
;
var
Parameters
:
Map
<
string
,
string
>
;
Parameters
=
temp
;
Parameters
=
temp
;
Parameters
.
forEach
((
value
,
key
)
=>
{
Parameters
.
forEach
((
value
,
key
)
=>
{
count
++
;
count
++
;
if
(
count
==
1
)
if
(
count
==
1
)
{
{
pokedPath
=
pokedPath
+
"
?
"
;
pokedPath
=
pokedPath
+
"
?
"
;
}
}
pokedPath
=
pokedPath
+
key
+
"
=$
"
+
key
+
"
$&
"
;
pokedPath
=
pokedPath
+
key
+
"
=$
"
+
key
+
"
$&
"
;
});
});
if
(
count
!=
0
)
if
(
count
!=
0
)
{
{
pokedPath
=
pokedPath
.
substring
(
0
,
pokedPath
.
length
-
1
);
pokedPath
=
pokedPath
.
substring
(
0
,
pokedPath
.
length
-
1
);
}
}
this
.
config
.
data
.
url
=
pokedPath
;
this
.
config
.
data
.
url
=
pokedPath
;
}
}
pathPoke
()
pathPoke
()
{
{
var
f
=
this
.
config
.
data
.
url
;
var
f
=
this
.
config
.
data
.
url
;
var
pokepath
=
"
a
"
;
var
pokepath
=
"
a
"
;
pokepath
=
f
;
pokepath
=
f
;
axios
.
get
(
pokepath
).
then
(
response
=>
{
axios
.
get
(
pokepath
).
then
(
response
=>
{
this
.
samplePoke
(
response
.
data
);
this
.
samplePoke
(
response
.
data
);
this
.
updateUI
();
this
.
updateUI
();
})
});
}
}
replaceStartPath
(
startPath
:
string
):
void
replaceStartPath
(
startPath
:
string
):
void
{
{
this
.
config
.
data
.
url
.
replace
(
"
$startPath$
"
,
startPath
);
this
.
config
.
data
.
url
.
replace
(
'
$startPath$
'
,
startPath
);
}
}
parentUpdate
(
payload
:
UpdatePayload
):
void
{
parentUpdate
(
payload
:
UpdatePayload
):
void
{}
}
refresh
()
{
refresh
()
{
var
Args
:
UpdatePayload
=
{
var
Args
:
UpdatePayload
=
{
...
@@ -176,7 +205,6 @@ export default class Status extends Widget {
...
@@ -176,7 +205,6 @@ export default class Status extends Widget {
this
.
viewLoad
(
Args
);
this
.
viewLoad
(
Args
);
}
}
async
getData
(
url
:
string
)
{
async
getData
(
url
:
string
)
{
var
apiLoad
=
url
;
var
apiLoad
=
url
;
await
axios
.
get
(
apiLoad
).
then
(
response
=>
{
await
axios
.
get
(
apiLoad
).
then
(
response
=>
{
...
@@ -207,5 +235,4 @@ export default class Status extends Widget {
...
@@ -207,5 +235,4 @@ export default class Status extends Widget {
width
:
100%
;
width
:
100%
;
height
:
auto
;
height
:
auto
;
}
}
</
style
>
</
style
>
\ No newline at end of file
src/components/Thing/Thing.vue
View file @
98b74648
...
@@ -2,7 +2,52 @@
...
@@ -2,7 +2,52 @@
<b-container
class=
"bv-example-row"
>
<b-container
class=
"bv-example-row"
>
<b-row
style=
"margin-top:10px"
>
<b-row
style=
"margin-top:10px"
>
<b-col>
<b-col>
<span
style=
"float:left;font-size:20px"
>
path:
{{
config
.
data
.
url
}}
</span>
<span
style=
"float:left;"
class=
"smallFont"
>
path:
{{
config
.
data
.
url
}}
</span>
</b-col>
<b-col>
<b-button
@
click=
"showPathConfig"
variant=
"primary"
style=
"float:right"
>
<span
class=
"glyphicon glyphicon-cog"
></span>
</b-button>
</b-col>
</b-row>
<b-row>
<b-col>
<div
v-if=
"StatusValue!=''&&StatusValue!=undefined"
style=
"width:100%;overflow:auto"
>
<button
style=
"float:left;"
class=
"largeFont"
>
{{
StatusValue
}}
</button>
</div>
</b-col>
</b-row>
<br
/>
<b-row>
<b-col>
<b-input-group
size=
"lg"
prepend=
"path"
v-show=
"isShowPath"
>
<b-form-input
v-model=
"config.data.url"
></b-form-input>
<b-input-group-append>
<b-button
@
click=
"updateUI"
text=
"Button"
variant=
"primary"
>
OK
</b-button>
<b-button
variant=
"info"
@
click=
"pathPoke"
>
poke
</b-button>
</b-input-group-append>
</b-input-group>
</b-col>
</b-row>
<b-row>
<b-col>
<WidgetParams
ref=
"WidgetParams"
v-show=
"isShowParams"
action=
"get"
@
updataVariables=
"viewLoad"
></WidgetParams>
</b-col>
</b-row>
<br
/>
<b-row>
<b-col>
<Navigation
ref=
"FamilyLink"
:url=
"config.data.url"
></Navigation>
</b-col>
</b-col>
</b-row>
</b-row>
</b-container>
</b-container>
...
@@ -10,50 +55,155 @@
...
@@ -10,50 +55,155 @@
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
Vue
from
"
vue
"
;
import
Vue
from
"
vue
"
;
import
{
VueSvgGauge
}
from
"
vue-svg-gauge
"
;
import
Component
from
"
vue-class-component
"
;
import
Component
from
"
vue-class-component
"
;
import
{
Prop
,
Watch
}
from
"
vue-property-decorator
"
;
import
{
Prop
,
Watch
}
from
"
vue-property-decorator
"
;
import
{
WidgetConfig
}
from
"
@/models/WidgetConfig
"
;
import
{
WidgetConfig
}
from
"
@/models/WidgetConfig
"
;
import
{
UpdatePayload
}
from
"
@/models/UpdatePayload
"
;
import
{
UpdatePayload
}
from
"
@/models/UpdatePayload
"
;
import
{
Widget
}
from
"
@/models/wiget
"
;
import
{
Widget
}
from
"
@/models/wiget
"
;
import
{
ResourceInfo
}
from
"
@/models/Customview
"
;
import
WidgetParams
from
"
@/components/Common/WidgetParams.vue
"
;
import
axios
from
"
axios
"
;
import
PathProcessor
from
"
@/models/PathProcessor
"
;
import
StrMapObjChange
from
"
@/models/StrMapObjChange
"
;
import
{
forEach
}
from
"
typescript-collections/dist/lib/arrays
"
;
import
{
map
}
from
"
d3
"
;
import
Navigation
from
"
@/components/Common/Navigation.vue
"
;
@
Component
({
components
:
{
WidgetParams
,
Navigation
}
})
export
default
class
Thing
extends
Widget
{
export
default
class
Thing
extends
Widget
{
pathProcessor
=
new
PathProcessor
();
strMapObjChange
=
new
StrMapObjChange
();
WidgetComponentName
:
string
=
"
Thing
"
;
WidgetComponentName
:
string
=
"
Thing
"
;
StatusValue
:
string
=
""
;
pathId
:
string
=
""
;
userInputData
=
new
Map
<
string
,
string
>
();
pathwithVar
:
string
=
""
;
timer
?:
number
;
isShowPath
:
boolean
=
false
;
isShowParams
:
boolean
=
false
;
config
:
WidgetConfig
=
{
config
:
WidgetConfig
=
{
WidgetComponentName
:
"
Thing
"
,
WidgetComponentName
:
"
Thing
"
,
data
:
{
data
:
{
url
:
""
url
:
""
,
userInputData
:
""
}
}
};
};
created
()
{
// this.config.data.userInputData = this.userInputData;
this
.
config
.
data
.
userInputData
=
this
.
strMapObjChange
.
strMapToObj
(
this
.
userInputData
);
}
// mounted() {
// this.timer = setInterval(this.refresh, 1000);
// }
// destroyed() {
// clearInterval(this.timer);
// }
updateUI
()
{
this
.
isShowPath
=
false
;
this
.
isShowParams
=
true
;
var
url
=
this
.
config
.
data
.
url
;
this
.
pathId
=
url
.
slice
(
0
,
url
.
indexOf
(
"
/
"
));
(
this
.
$refs
.
WidgetParams
as
WidgetParams
).
setVariableList
(
this
.
pathProcessor
.
extractVarFromPath
(
url
)
);
}
showPathConfig
()
{
this
.
isShowPath
=
!
this
.
isShowPath
;
}
getConfig
():
WidgetConfig
{
getConfig
():
WidgetConfig
{
// this.config.data.userInputData =(this.$refs.WidgetParams as WidgetParams).getVariableValues();
this
.
config
.
data
.
userInputData
=
this
.
strMapObjChange
.
strMapToObj
(
(
this
.
$refs
.
WidgetParams
as
WidgetParams
).
getVariableValues
()
);
return
this
.
config
;
return
this
.
config
;
}
}
setConfig
(
widgetConfig
:
WidgetConfig
):
void
{
setConfig
(
widgetConfig
:
WidgetConfig
):
void
{
this
.
config
=
widgetConfig
;
this
.
config
=
widgetConfig
;
this
.
updateUI
();
//map不能序列化,必须要单独处理,这里的处理方法仅限map
<
string
,
string
>
类型
var
temp
=
this
.
config
.
data
.
userInputData
;
temp
=
JSON
.
parse
(
JSON
.
stringify
(
temp
));
console
.
log
(
temp
);
temp
=
this
.
strMapObjChange
.
objToStrMap
(
temp
);
console
.
log
(
temp
);
this
.
userInputData
=
temp
;
console
.
log
(
this
.
userInputData
);
/* */
(
this
.
$refs
.
WidgetParams
as
WidgetParams
).
setVariableInput
(
this
.
userInputData
);
}
}
replaceStartPath
(
startPath
:
string
):
void
samplePoke
(
sample
:
any
)
{
{
var
samplePath
=
sample
.
CFET2CORE_SAMPLE_PATH
;
this
.
config
.
data
.
url
.
replace
(
'
$startPath$
'
,
startPath
);
console
.
log
(
samplePath
);
var
pokedPath
:
string
;
pokedPath
=
samplePath
;
this
.
config
.
data
.
url
=
pokedPath
;
}
}
samplePoke
(
sample
:
any
){}
pathPoke
()
{
var
f
=
this
.
config
.
data
.
url
;
pathPoke
(){}
var
pokepath
=
"
a
"
;
pokepath
=
f
;
parentUpdate
(
payload
:
UpdatePayload
):
void
{
axios
.
get
(
pokepath
).
then
(
response
=>
{
this
.
samplePoke
(
response
.
data
);
this
.
updateUI
();
});
}
replaceStartPath
(
startPath
:
string
):
void
{
this
.
config
.
data
.
url
.
replace
(
"
$startPath$
"
,
startPath
);
}
}
parentUpdate
(
payload
:
UpdatePayload
):
void
{}
refresh
()
{
refresh
()
{
var
Args
:
UpdatePayload
=
{
action
:
"
get
"
,
variables
:
(
this
.
$refs
.
WidgetParams
as
WidgetParams
).
getVariableValues
(),
target
:
[
"
self
"
]
};
this
.
viewLoad
(
Args
);
}
}
updateUI
(){
async
getData
(
url
:
string
)
{
var
apiLoad
=
url
;
await
axios
.
get
(
apiLoad
).
then
(
response
=>
{
console
.
log
(
response
);
this
.
StatusValue
=
response
.
data
.
CFET2CORE_SAMPLE_VAL
;
console
.
log
(
this
.
StatusValue
);
});
}
}
//called when widgetParams action clicked
async
viewLoad
(
Args
:
UpdatePayload
)
{
// this.config.data.userInputData = Args.variables;
this
.
userInputData
=
Args
.
variables
;
this
.
pathwithVar
=
this
.
pathProcessor
.
FillPathWithVar
(
// this.config.data.userInputData,
this
.
userInputData
,
this
.
config
.
data
.
url
);
console
.
log
(
this
.
StatusValue
);
console
.
log
(
this
.
pathwithVar
);
await
this
.
getData
(
this
.
pathwithVar
);
}
}
}
</
script
>
</
script
>
...
@@ -62,5 +212,4 @@ export default class Thing extends Widget {
...
@@ -62,5 +212,4 @@ export default class Thing extends Widget {
width
:
100%
;
width
:
100%
;
height
:
auto
;
height
:
auto
;
}
}
</
style
>
</
style
>
\ No newline at end of file
src/components/WaveView/showViewInfo.vue
View file @
98b74648
<
template
>
<
template
>
<div
class=
"
large
Font"
style=
"float:left width:100%"
>
<div
class=
"
small
Font"
style=
"float:left width:100%"
>
<span>
Basic Path :
{{
basePathId
}}
</span><br>
<span>
Basic Path :
{{
basePathId
}}
</span><br>
<span>
Rate:
{{
sampleId
}}
</span><br>
<span>
Rate:
{{
sampleId
}}
</span><br>
<span>
length:
{{
lengthId
}}
</span>
<span>
length:
{{
lengthId
}}
</span>
...
...
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