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
a7febd20
Commit
a7febd20
authored
Sep 21, 2019
by
WuFeiyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
初步完整版本
parent
976daf5c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
205 additions
and
144 deletions
+205
-144
src/App.vue
src/App.vue
+1
-1
src/components/Config/Config.vue
src/components/Config/Config.vue
+157
-106
src/components/Method/Method.vue
src/components/Method/Method.vue
+37
-27
src/components/Status/Status.vue
src/components/Status/Status.vue
+10
-10
No files found.
src/App.vue
View file @
a7febd20
...
@@ -116,7 +116,7 @@ export default class App extends Vue {
...
@@ -116,7 +116,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
.
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
);
...
...
src/components/Config/Config.vue
View file @
a7febd20
...
@@ -2,40 +2,65 @@
...
@@ -2,40 +2,65 @@
<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"
>
getPath:
{{
config
.
data
.
get
.
url
}}
</span>
<span
style=
"float:left;
"
class=
"largeFont"
>
getPath:
{{
getPathwithVar
}}
</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>
</b-row>
</b-row>
<b-row
style=
"margin-top:10px"
>
<b-row
style=
"margin-top:10px"
>
<b-col>
<b-col>
<span
style=
"float:left
;font-size:20px"
>
setPath:
{{
config
.
data
.
set
.
url
}}
</span>
<span
style=
"float:left
"
class=
"largeFont"
>
setPath:
{{
getSetwithVar
}}
</span>
</b-col>
</b-col>
</b-row>
</b-row>
<div
style=
"width:100%"
>
<div
style=
"width:100%"
>
<span
style=
"float:left;font-size:20px"
>
getConfigValue:
{{
getConfigValue
}}
</span>
<span
style=
"float:left;"
class=
"largeFont"
>
{{
getConfigValue
}}
</span>
<!--
<span
style=
"float:left;font-size:20px"
>
setConfigValue:
{{
setConfigValue
}}
</span>
<hr
/>
-->
</div>
</div>
<br>
<b-input-group
prepend=
"getPath"
v-show=
"isShowPath"
>
<br>
<div
v-show=
"isShowGetPath"
>
<hr
/>
</div>
<b-input-group
class=
"smallFont"
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>
<b-button
@
click=
"updateGetUI"
size=
"sm"
text=
"Button"
variant=
"primary"
>
OK
</b-button>
<b-button
@
click=
"updateGetUI"
size=
"sm"
text=
"Button"
variant=
"primary"
>
OK
</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><hr
v-show=
"isShowGetParams&&isShowPath"
/></div>
<div>
<WidgetParams
ref=
"WidgetGetParams"
v-show=
"isShowGetParams&&isShowPath"
action=
"get"
@
updataVariables=
"viewGetLoad"
></WidgetParams>
<hr
v-show=
"isShowGetParams"
/>
<div><hr
v-show=
"isShowPath"
/></div>
</div>
<b-input-group
prepend=
"setPath"
v-show=
"isShowPath"
>
<WidgetParams
ref=
"WidgetGetParams"
v-show=
"isShowGetParams"
action=
"get"
@
updataVariables=
"viewGetLoad"
></WidgetParams>
<br>
<div>
<hr
v-show=
"isShowSetPath"
/>
</div>
<b-input-group
class=
"smallFont"
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>
<b-button
@
click=
"updateSetUI"
size=
"sm"
text=
"Button"
variant=
"primary"
>
OK
</b-button>
<b-button
@
click=
"updateSetUI"
size=
"sm"
text=
"Button"
variant=
"primary"
>
OK
</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><hr
v-show=
"isShowSetParams&&isShowPath"
/></div>
<div>
<WidgetParams
ref=
"WidgetSetParams"
v-show=
"isShowSetParams&&isShowPath"
action=
"set"
@
updataVariables=
"viewSetLoad"
></WidgetParams>
<hr
v-show=
"isShowSetParams"
/>
</div>
<WidgetParams
ref=
"WidgetSetParams"
v-show=
"isShowSetParams"
action=
"set"
@
updataVariables=
"viewSetLoad"
></WidgetParams>
<br>
<Navigation
ref=
"FamilyLink"
:url=
"config.data.get.url"
></Navigation>
</b-container>
</b-container>
</
template
>
</
template
>
...
@@ -54,10 +79,12 @@ import PathProcessor from "@/models/PathProcessor";
...
@@ -54,10 +79,12 @@ 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
'
;
@
Component
({
@
Component
({
components
:
{
components
:
{
WidgetParams
WidgetParams
,
Navigation
}
}
})
})
export
default
class
Config
extends
Widget
{
export
default
class
Config
extends
Widget
{
...
@@ -69,20 +96,20 @@ export default class Config extends Widget {
...
@@ -69,20 +96,20 @@ export default class Config extends Widget {
pathId
:
string
=
""
;
pathId
:
string
=
""
;
userGetInputData
=
new
Map
<
string
,
string
>
();
userGetInputData
=
new
Map
<
string
,
string
>
();
userSetInputData
=
new
Map
<
string
,
string
>
();
userSetInputData
=
new
Map
<
string
,
string
>
();
getPathwithVar
:
string
=
""
;
getPathwithVar
:
string
=
""
;
setPathwithVar
:
string
=
""
;
setPathwithVar
:
string
=
""
;
timer
?:
number
;
isShowGetPath
:
boolean
=
false
;
isShowPath
:
boolean
=
false
;
isShow
Set
Path
:
boolean
=
false
;
isShowGetParams
:
boolean
=
false
;
isShowGetParams
:
boolean
=
false
;
isShowSetParams
:
boolean
=
false
;
isShowSetParams
:
boolean
=
false
;
isSetPoke
:
boolean
=
false
;
config
:
WidgetConfig
=
{
config
:
WidgetConfig
=
{
WidgetComponentName
:
"
Status
"
,
WidgetComponentName
:
"
Status
"
,
data
:
{
data
:
{
get
:{
url
:
""
,
get
:
{
url
:
""
,
userInputData
:
""
},
userInputData
:
""
},
set
:
{
url
:
""
,
userInputData
:
""
}
set
:{
url
:
""
,
userInputData
:
""
}
}
}
};
};
...
@@ -92,24 +119,15 @@ export default class Config extends Widget {
...
@@ -92,24 +119,15 @@ export default class Config extends Widget {
this
.
config
.
data
.
set
.
userInputData
=
this
.
strMapObjChange
.
strMapToObj
(
this
.
userSetInputData
);
this
.
config
.
data
.
set
.
userInputData
=
this
.
strMapObjChange
.
strMapToObj
(
this
.
userSetInputData
);
}
}
// mounted()
// {
// this.timer = setInterval(this.refresh,1000);
// }
// destroyed()
updateUI
()
{
// {
// clearInterval(this.timer);
// }
updateUI
()
{
this
.
updateGetUI
();
this
.
updateGetUI
();
this
.
updateSetUI
();
this
.
updateSetUI
();
}
}
updateGetUI
()
{
updateGetUI
()
{
this
.
isShowGetParams
=
true
;
this
.
isShowGetParams
=
true
;
this
.
isShowGetPath
=
false
;
var
url
=
this
.
config
.
data
.
get
.
url
;
var
url
=
this
.
config
.
data
.
get
.
url
;
this
.
pathId
=
url
.
slice
(
0
,
url
.
indexOf
(
"
/
"
));
this
.
pathId
=
url
.
slice
(
0
,
url
.
indexOf
(
"
/
"
));
(
this
.
$refs
.
WidgetGetParams
as
WidgetParams
).
setVariableList
(
(
this
.
$refs
.
WidgetGetParams
as
WidgetParams
).
setVariableList
(
...
@@ -119,6 +137,7 @@ export default class Config extends Widget {
...
@@ -119,6 +137,7 @@ export default class Config extends Widget {
updateSetUI
()
{
updateSetUI
()
{
this
.
isShowSetParams
=
true
;
this
.
isShowSetParams
=
true
;
this
.
isShowSetPath
=
false
;
var
url
=
this
.
config
.
data
.
set
.
url
;
var
url
=
this
.
config
.
data
.
set
.
url
;
this
.
pathId
=
url
.
slice
(
0
,
url
.
indexOf
(
"
/
"
));
this
.
pathId
=
url
.
slice
(
0
,
url
.
indexOf
(
"
/
"
));
(
this
.
$refs
.
WidgetSetParams
as
WidgetParams
).
setVariableList
(
(
this
.
$refs
.
WidgetSetParams
as
WidgetParams
).
setVariableList
(
...
@@ -127,13 +146,27 @@ export default class Config extends Widget {
...
@@ -127,13 +146,27 @@ export default class Config extends Widget {
}
}
showPathConfig
()
{
showPathConfig
()
{
this
.
isShowPath
=
!
this
.
isShowPath
;
if
(
this
.
isShowGetPath
==
this
.
isShowSetPath
)
{
this
.
isShowGetPath
=
!
this
.
isShowGetPath
;
this
.
isShowSetPath
=
!
this
.
isShowSetPath
;
}
else
{
this
.
isShowGetPath
=
true
;
this
.
isShowSetPath
=
true
;
}
}
}
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
.
get
.
userInputData
=
this
.
strMapObjChange
.
strMapToObj
((
this
.
$refs
.
WidgetGetParams
as
WidgetParams
).
getVariableValues
());
this
.
config
.
data
.
get
.
userInputData
=
this
.
strMapObjChange
.
strMapToObj
(
this
.
config
.
data
.
set
.
userInputData
=
this
.
strMapObjChange
.
strMapToObj
((
this
.
$refs
.
WidgetSetParams
as
WidgetParams
).
getVariableValues
());
(
this
.
$refs
.
WidgetGetParams
as
WidgetParams
).
getVariableValues
()
);
this
.
config
.
data
.
set
.
userInputData
=
this
.
strMapObjChange
.
strMapToObj
(
(
this
.
$refs
.
WidgetSetParams
as
WidgetParams
).
getVariableValues
()
);
return
this
.
config
;
return
this
.
config
;
}
}
...
@@ -148,8 +181,10 @@ export default class Config extends Widget {
...
@@ -148,8 +181,10 @@ export default class Config extends Widget {
temp
=
this
.
strMapObjChange
.
objToStrMap
(
temp
);
temp
=
this
.
strMapObjChange
.
objToStrMap
(
temp
);
console
.
log
(
temp
);
console
.
log
(
temp
);
this
.
userGetInputData
=
temp
;
this
.
userGetInputData
=
temp
;
console
.
log
(
this
.
userGetInputData
);
/* */
console
.
log
(
this
.
userGetInputData
);
/* */
(
this
.
$refs
.
WidgetGetParams
as
WidgetParams
).
setVariableInput
(
this
.
userGetInputData
);
(
this
.
$refs
.
WidgetGetParams
as
WidgetParams
).
setVariableInput
(
this
.
userGetInputData
);
//布置set输入参数
//布置set输入参数
temp
=
this
.
config
.
data
.
set
.
userInputData
;
temp
=
this
.
config
.
data
.
set
.
userInputData
;
temp
=
JSON
.
parse
(
JSON
.
stringify
(
temp
));
temp
=
JSON
.
parse
(
JSON
.
stringify
(
temp
));
...
@@ -157,100 +192,117 @@ export default class Config extends Widget {
...
@@ -157,100 +192,117 @@ export default class Config extends Widget {
temp
=
this
.
strMapObjChange
.
objToStrMap
(
temp
);
temp
=
this
.
strMapObjChange
.
objToStrMap
(
temp
);
console
.
log
(
temp
);
console
.
log
(
temp
);
this
.
userSetInputData
=
temp
;
this
.
userSetInputData
=
temp
;
console
.
log
(
this
.
userSetInputData
);
/* */
console
.
log
(
this
.
userSetInputData
);
/* */
(
this
.
$refs
.
WidgetSetParams
as
WidgetParams
).
setVariableInput
(
this
.
userSetInputData
);
(
this
.
$refs
.
WidgetSetParams
as
WidgetParams
).
setVariableInput
(
this
.
userSetInputData
);
}
}
samplePoke
(
sample
:
ResourceInfo
[],
samplePath
:
string
)
samplePoke
(
sample
:
ResourceInfo
[],
samplePath
:
string
)
{
{
var
pokedPath
:
string
;
var
pokedPath
:
string
;
pokedPath
=
samplePath
;
pokedPath
=
samplePath
;
var
count
:
number
=
0
;
var
count
:
number
=
0
;
console
.
log
(
this
.
isSetPoke
);
if
(
this
.
isSetPoke
==
false
)
{
var
getTemp
=
sample
[
0
].
Parameters
;
var
getTemp
=
sample
[
0
].
Parameters
;
getTemp
=
JSON
.
parse
(
JSON
.
stringify
(
getTemp
));
getTemp
=
JSON
.
parse
(
JSON
.
stringify
(
getTemp
));
console
.
log
(
getTemp
);
getTemp
=
this
.
strMapObjChange
.
objToStrMap
(
getTemp
);
getTemp
=
this
.
strMapObjChange
.
objToStrMap
(
getTemp
);
console
.
log
(
getTemp
);
sample
[
0
].
Parameters
=
getTemp
;
sample
[
0
].
Parameters
=
getTemp
;
console
.
log
(
sample
[
0
].
Parameters
);
var
setTemp
=
sample
[
1
].
Parameters
;
setTemp
=
JSON
.
parse
(
JSON
.
stringify
(
setTemp
));
console
.
log
(
setTemp
);
setTemp
=
this
.
strMapObjChange
.
objToStrMap
(
setTemp
);
console
.
log
(
setTemp
);
sample
[
1
].
Parameters
=
setTemp
;
console
.
log
(
sample
[
1
].
Parameters
);
sample
[
0
].
Parameters
.
forEach
((
value
,
key
)
=>
{
sample
[
0
].
Parameters
.
forEach
((
value
,
key
)
=>
{
count
++
;
count
++
;
if
(
count
==
1
)
if
(
count
==
1
)
{
{
pokedPath
=
pokedPath
+
"
?
"
;
pokedPath
=
pokedPath
+
"
?
"
;
}
}
pokedPath
=
pokedPath
+
key
+
"
=$
"
+
key
+
"
$&
"
;
pokedPath
=
pokedPath
+
key
+
"
=$
"
+
key
+
"
$&
"
;
});
});
console
.
log
(
pokedPath
);
pokedPath
=
pokedPath
.
substring
(
0
,
pokedPath
.
length
-
1
);
pokedPath
=
pokedPath
.
substring
(
0
,
pokedPath
.
length
-
1
);
console
.
log
(
pokedPath
);
this
.
config
.
data
.
get
.
url
=
pokedPath
;
this
.
config
.
data
.
get
.
url
=
pokedPath
;
}
if
(
sample
.
length
==
2
)
{
pokedPath
=
samplePath
;
pokedPath
=
samplePath
;
count
=
0
;
count
=
0
;
sample
[
1
].
Parameters
.
forEach
((
value
,
key
)
=>
{
var
setTemp
=
sample
[
1
].
Parameters
;
setTemp
=
JSON
.
parse
(
JSON
.
stringify
(
setTemp
));
setTemp
=
this
.
strMapObjChange
.
objToStrMap
(
setTemp
);
sample
[
1
].
Parameters
=
setTemp
;
sample
[
1
].
Parameters
.
forEach
((
value
,
key
)
=>
{
count
++
;
count
++
;
if
(
count
==
1
)
if
(
count
==
1
)
{
{
pokedPath
=
pokedPath
+
"
?
"
;
pokedPath
=
pokedPath
+
"
?
"
;
}
}
pokedPath
=
pokedPath
+
key
+
"
=$
"
+
key
+
"
$&
"
;
pokedPath
=
pokedPath
+
key
+
"
=$
"
+
key
+
"
$&
"
;
});
});
console
.
log
(
pokedPath
);
pokedPath
=
pokedPath
.
substring
(
0
,
pokedPath
.
length
-
1
);
pokedPath
=
pokedPath
.
substring
(
0
,
pokedPath
.
length
-
1
);
console
.
log
(
pokedPath
);
this
.
config
.
data
.
set
.
url
=
pokedPath
;
this
.
config
.
data
.
set
.
url
=
pokedPath
;
}
}
this
.
isSetPoke
=
false
;
}
pathPoke
()
getPathPoke
()
{
{
var
f
=
this
.
config
.
data
.
get
.
url
;
axios
.
get
(
this
.
config
.
data
.
url
).
then
(
response
=>
{
var
pokepath
=
"
a
"
;
pokepath
=
f
;
axios
.
get
(
pokepath
).
then
(
response
=>
{
var
resourcetype
=
response
.
data
.
ResourceType
;
var
resourcetype
=
response
.
data
.
ResourceType
;
var
samplePath
=
response
.
data
.
CFET2CORE_SAMPLE_PATH
;
var
samplePath
=
response
.
data
.
CFET2CORE_SAMPLE_PATH
;
var
sample
:
ResourceInfo
[]
=
[];
var
sample
:
ResourceInfo
[]
=
[];
sample
[
0
]
=
response
.
data
.
Actions
.
get
as
ResourceInfo
;
sample
[
0
]
=
response
.
data
.
Actions
.
get
as
ResourceInfo
;
this
.
samplePoke
(
sample
,
samplePath
);
this
.
samplePoke
(
sample
,
samplePath
);
})
this
.
updateUI
();
});
}
}
replaceStartPath
(
startPath
:
string
):
void
setPathPoke
()
{
{
var
f
=
this
.
config
.
data
.
set
.
url
;
this
.
config
.
data
.
get
.
url
.
replace
(
'
$startPath$
'
,
startPath
);
var
pokepath
=
"
a
"
;
this
.
config
.
data
.
set
.
url
.
replace
(
'
$startPath$
'
,
startPath
);
pokepath
=
f
;
axios
.
get
(
pokepath
).
then
(
response
=>
{
console
.
log
(
response
.
data
);
var
resourcetype
=
response
.
data
.
ResourceType
;
var
samplePath
=
response
.
data
.
CFET2CORE_SAMPLE_PATH
;
var
sample
:
ResourceInfo
[]
=
[];
sample
[
0
]
=
response
.
data
.
Actions
.
get
as
ResourceInfo
;
sample
[
1
]
=
response
.
data
.
Actions
.
set
as
ResourceInfo
;
this
.
isSetPoke
=
true
;
this
.
samplePoke
(
sample
,
samplePath
);
this
.
updateUI
();
});
}
}
parentUpdate
(
payload
:
UpdatePayload
):
void
{
pathPoke
()
{
this
.
getPathPoke
();
this
.
setPathPoke
();
}
replaceStartPath
(
startPath
:
string
):
void
{
this
.
config
.
data
.
get
.
url
.
replace
(
"
$startPath$
"
,
startPath
);
this
.
config
.
data
.
set
.
url
.
replace
(
"
$startPath$
"
,
startPath
);
}
}
parentUpdate
(
payload
:
UpdatePayload
):
void
{}
refresh
()
{
refresh
()
{
var
GetArgs
:
UpdatePayload
=
{
var
GetArgs
:
UpdatePayload
=
{
action
:
"
get
"
,
action
:
"
get
"
,
variables
:
(
this
.
$refs
.
WidgetGetParams
as
WidgetParams
).
getVariableValues
(),
variables
:
(
this
.
$refs
.
WidgetGetParams
as
WidgetParams
).
getVariableValues
(),
target
:
[
"
self
"
]
target
:
[
"
self
"
]
};
};
this
.
viewGetLoad
(
GetArgs
);
this
.
viewGetLoad
(
GetArgs
);
var
SetArgs
:
UpdatePayload
=
{
var
SetArgs
:
UpdatePayload
=
{
action
:
"
set
"
,
action
:
"
set
"
,
variables
:
(
this
.
$refs
.
WidgetSetParams
as
WidgetParams
).
getVariableValues
(),
variables
:
(
this
.
$refs
.
WidgetSetParams
as
WidgetParams
).
getVariableValues
(),
target
:
[
"
self
"
]
target
:
[
"
self
"
]
};
};
this
.
viewSetLoad
(
SetArgs
);
this
.
viewSetLoad
(
SetArgs
);
}
}
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
=>
{
...
@@ -303,5 +355,4 @@ export default class Config extends Widget {
...
@@ -303,5 +355,4 @@ export default class Config extends Widget {
width
:
100%
;
width
:
100%
;
height
:
auto
;
height
:
auto
;
}
}
</
style
>
</
style
>
\ No newline at end of file
src/components/Method/Method.vue
View file @
a7febd20
...
@@ -2,30 +2,33 @@
...
@@ -2,30 +2,33 @@
<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=
"largeFont"
>
path:
{{
pathwithVar
}}
</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>
<
hr
/
>
<
div
v-show=
"isShowPath"
><hr
/></div
>
</b-row>
</b-row>
<div
style=
"width:100%"
>
<div
style=
"width:100%"
>
<span
style=
"float:left;
font-size:20px"
>
{{
MethodReturn
}}
</span>
<span
style=
"float:left;
"
class=
"largeFont"
>
{{
StatusValue
}}
</span>
<
hr
/
>
<
div
v-show=
"isShowPath"
><hr
/></div
>
</div>
</div>
<b-input-group
prepend=
"path"
v-show=
"isShowPath"
>
<b-input-group
class=
"smallFont"
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>
<b-button
@
click=
"updateUI"
size=
"sm"
text=
"Button"
variant=
"primary"
>
OK
</b-button>
<b-button
@
click=
"updateUI"
size=
"sm"
text=
"Button"
variant=
"primary"
>
OK
</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/>
<hr/>
<WidgetParams
ref=
"WidgetParams"
v-show=
"isShowParams&&isShowPath"
action=
"invoke"
@
updataVariables=
"viewLoad"
></WidgetParams>
<WidgetParams
ref=
"WidgetParams"
v-show=
"isShowParams"
action=
"invoke"
@
updataVariables=
"viewLoad"
></WidgetParams><br>
<Navigation
ref=
"FamilyLink"
:url=
"config.data.url"
></Navigation>
</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
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
"
;
...
@@ -34,26 +37,26 @@ import { Widget } from "@/models/wiget";
...
@@ -34,26 +37,26 @@ import { Widget } from "@/models/wiget";
import
{
ResourceInfo
}
from
"
@/models/Customview
"
;
import
{
ResourceInfo
}
from
"
@/models/Customview
"
;
import
WidgetParams
from
"
@/components/Common/WidgetParams.vue
"
;
import
WidgetParams
from
"
@/components/Common/WidgetParams.vue
"
;
import
axios
from
"
axios
"
;
import
axios
from
"
axios
"
;
import
Plotly
from
"
plotly.js
"
;
import
PathProcessor
from
"
@/models/PathProcessor
"
;
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
'
;
@
Component
({
@
Component
({
components
:
{
components
:
{
WidgetParams
WidgetParams
,
Navigation
}
}
})
})
export
default
class
Method
extends
Widget
{
export
default
class
Method
extends
Widget
{
pathProcessor
=
new
PathProcessor
();
pathProcessor
=
new
PathProcessor
();
strMapObjChange
=
new
StrMapObjChange
();
strMapObjChange
=
new
StrMapObjChange
();
WidgetComponentName
:
string
=
"
Method
"
;
WidgetComponentName
:
string
=
"
Method
"
;
MethodReturn
:
string
=
""
;
StatusValue
:
string
=
""
;
pathId
:
string
=
""
;
pathId
:
string
=
""
;
userInputData
=
new
Map
<
string
,
string
>
();
userInputData
=
new
Map
<
string
,
string
>
();
pathwithVar
:
string
=
""
;
pathwithVar
:
string
=
""
;
timer
?:
number
;
isShowPath
:
boolean
=
false
;
isShowPath
:
boolean
=
false
;
isShowParams
:
boolean
=
false
;
isShowParams
:
boolean
=
false
;
...
@@ -65,21 +68,14 @@ export default class Method extends Widget {
...
@@ -65,21 +68,14 @@ 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
);
// }
// mounted()
// {
// this.timer = setInterval(this.refresh,1000);
// }
destroyed
()
{
clearInterval
(
this
.
timer
);
}
}
updateUI
()
{
updateUI
()
{
this
.
isShowPath
=
false
;
this
.
isShowParams
=
true
;
this
.
isShowParams
=
true
;
var
url
=
this
.
config
.
data
.
url
;
var
url
=
this
.
config
.
data
.
url
;
this
.
pathId
=
url
.
slice
(
0
,
url
.
indexOf
(
"
/
"
));
this
.
pathId
=
url
.
slice
(
0
,
url
.
indexOf
(
"
/
"
));
...
@@ -135,19 +131,30 @@ export default class Method extends Widget {
...
@@ -135,19 +131,30 @@ export default class Method extends Widget {
pokedPath
=
pokedPath
+
key
+
"
=$
"
+
key
+
"
$&
"
;
pokedPath
=
pokedPath
+
key
+
"
=$
"
+
key
+
"
$&
"
;
});
});
console
.
log
(
pokedPath
);
console
.
log
(
pokedPath
);
if
(
count
!=
0
)
{
pokedPath
=
pokedPath
.
substring
(
0
,
pokedPath
.
length
-
1
);
pokedPath
=
pokedPath
.
substring
(
0
,
pokedPath
.
length
-
1
);
}
console
.
log
(
pokedPath
);
console
.
log
(
pokedPath
);
this
.
config
.
data
.
url
=
pokedPath
;
this
.
config
.
data
.
url
=
pokedPath
;
}
}
pathPoke
()
pathPoke
()
{
{
axios
.
put
(
this
.
config
.
data
.
url
).
then
(
response
=>
{
var
f
=
this
.
config
.
data
.
url
;
var
pokepath
=
"
a
"
;
pokepath
=
f
;
axios
.
get
(
pokepath
).
then
(
response
=>
{
console
.
log
(
pokepath
);
console
.
log
(
response
);
console
.
log
(
response
.
data
);
var
resourcetype
=
response
.
data
.
ResourceType
;
var
resourcetype
=
response
.
data
.
ResourceType
;
console
.
log
(
resourcetype
);
var
samplePath
=
response
.
data
.
CFET2CORE_SAMPLE_PATH
;
var
samplePath
=
response
.
data
.
CFET2CORE_SAMPLE_PATH
;
var
sample
:
ResourceInfo
[]
=
[];
var
sample
:
ResourceInfo
[]
=
[];
sample
[
0
]
=
response
.
data
.
Actions
.
get
as
ResourceInfo
;
sample
[
0
]
=
response
.
data
.
Actions
.
get
as
ResourceInfo
;
this
.
samplePoke
(
sample
,
samplePath
);
this
.
samplePoke
(
sample
,
samplePath
);
this
.
updateUI
();
})
})
}
}
...
@@ -172,8 +179,10 @@ export default class Method extends Widget {
...
@@ -172,8 +179,10 @@ export default class Method extends Widget {
async
getData
(
url
:
string
)
{
async
getData
(
url
:
string
)
{
var
apiLoad
=
url
;
var
apiLoad
=
url
;
await
axios
.
get
(
apiLoad
).
then
(
response
=>
{
await
axios
.
put
(
apiLoad
).
then
(
response
=>
{
this
.
MethodReturn
=
response
.
data
.
CFET2CORE_SAMPLE_VAL
;
console
.
log
(
response
);
this
.
StatusValue
=
response
.
data
.
CFET2CORE_SAMPLE_VAL
;
console
.
log
(
this
.
StatusValue
);
});
});
}
}
...
@@ -186,7 +195,8 @@ export default class Method extends Widget {
...
@@ -186,7 +195,8 @@ export default class Method extends Widget {
this
.
userInputData
,
this
.
userInputData
,
this
.
config
.
data
.
url
this
.
config
.
data
.
url
);
);
console
.
log
(
this
.
StatusValue
);
console
.
log
(
this
.
pathwithVar
);
await
this
.
getData
(
this
.
pathwithVar
);
await
this
.
getData
(
this
.
pathwithVar
);
}
}
}
}
...
...
src/components/Status/Status.vue
View file @
a7febd20
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
</b-input-group-append>
</b-input-group-append>
</b-input-group>
</b-input-group>
<hr/>
<hr/>
<WidgetParams
ref=
"WidgetParams"
v-show=
"isShowParams
&&isShowPath
"
action=
"get"
@
updataVariables=
"viewLoad"
></WidgetParams><br>
<WidgetParams
ref=
"WidgetParams"
v-show=
"isShowParams"
action=
"get"
@
updataVariables=
"viewLoad"
></WidgetParams><br>
<Navigation
ref=
"FamilyLink"
:url=
"config.data.url"
></Navigation>
<Navigation
ref=
"FamilyLink"
:url=
"config.data.url"
></Navigation>
</b-container>
</b-container>
</
template
>
</
template
>
...
@@ -37,7 +37,6 @@ import { Widget } from "@/models/wiget";
...
@@ -37,7 +37,6 @@ import { Widget } from "@/models/wiget";
import
{
ResourceInfo
}
from
"
@/models/Customview
"
;
import
{
ResourceInfo
}
from
"
@/models/Customview
"
;
import
WidgetParams
from
"
@/components/Common/WidgetParams.vue
"
;
import
WidgetParams
from
"
@/components/Common/WidgetParams.vue
"
;
import
axios
from
"
axios
"
;
import
axios
from
"
axios
"
;
import
Plotly
from
"
plotly.js
"
;
import
PathProcessor
from
"
@/models/PathProcessor
"
;
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
"
;
...
@@ -70,15 +69,15 @@ export default class Status extends Widget {
...
@@ -70,15 +69,15 @@ 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
()
{
{
...
@@ -86,6 +85,7 @@ export default class Status extends Widget {
...
@@ -86,6 +85,7 @@ export default class Status extends Widget {
}
}
updateUI
()
{
updateUI
()
{
this
.
isShowPath
=
false
;
this
.
isShowParams
=
true
;
this
.
isShowParams
=
true
;
var
url
=
this
.
config
.
data
.
url
;
var
url
=
this
.
config
.
data
.
url
;
this
.
pathId
=
url
.
slice
(
0
,
url
.
indexOf
(
"
/
"
));
this
.
pathId
=
url
.
slice
(
0
,
url
.
indexOf
(
"
/
"
));
...
...
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