Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
CFET_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
0
Merge Requests
0
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
XieXiaohan
CFET_WidgetUI
Commits
eeb8985f
Commit
eeb8985f
authored
Mar 06, 2021
by
XieXiaohan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed Status
parent
cb77b02b
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
204 additions
and
31 deletions
+204
-31
src/Windows/WindowsApp.vue
src/Windows/WindowsApp.vue
+88
-13
src/components/Config/BoolConfig.vue
src/components/Config/BoolConfig.vue
+45
-12
src/components/Config/Config.vue
src/components/Config/Config.vue
+25
-4
src/components/Layout/Grid.vue
src/components/Layout/Grid.vue
+4
-2
src/components/Method/Method.vue
src/components/Method/Method.vue
+8
-0
src/components/State/BoolState.vue
src/components/State/BoolState.vue
+8
-0
src/components/State/State.vue
src/components/State/State.vue
+8
-0
src/components/Status/LabelStatus.vue
src/components/Status/LabelStatus.vue
+9
-0
src/components/Status/Status.vue
src/components/Status/Status.vue
+8
-0
src/models/PathProcessor.ts
src/models/PathProcessor.ts
+1
-0
No files found.
src/Windows/WindowsApp.vue
View file @
eeb8985f
...
...
@@ -34,8 +34,9 @@
<tr>
<th>
url:
</th>
<td>
<input
class=
"input has-text-primary"
v-model=
"EditData.edit.url"
type=
"text"
></td>
<td><button
class=
"button has-text-primary"
style=
"margin-left: 15px;"
@
click=
"pathPoke"
>
POKE
</button></td>
<td>
<input
class=
"input has-text-primary"
v-model=
"InputUrl"
type=
"text"
></td>
<td><button
class=
"button has-text-primary"
style=
"margin-left: 15px;"
@
click=
"pathPoke"
>
POKE
</button>
<button
class=
"button has-text-primary"
style=
"margin-left: 15px;"
@
click=
"ParseUrl"
>
ParseUrl
</button></td>
</tr>
...
...
@@ -84,10 +85,10 @@
</tr>
<tr>
<tr
v-show=
"isShowParams"
>
<th>
Params
</th>
<td>
<div
v-for=
"(label, index) in userInputData.keys()"
:key=
"index"
class=
"column"
v-show=
"isShowParams"
>
<div
v-for=
"(label, index) in userInputData.keys()"
:key=
"index"
class=
"column"
>
<div
class=
"field is-horizontal"
style=
"margin:5px"
>
<div
class=
"field-label is-normal"
>
...
...
@@ -105,6 +106,38 @@
</div>
</td>
</tr>
<tr
v-show=
"isShowParseUrl"
>
<th>
Params
</th>
<td>
<div
v-for=
"(label, index) in userInputData.keys()"
:key=
"index"
class=
"column"
>
<div
class=
"field is-horizontal"
style=
"margin:5px"
>
<div
class=
"field-label is-normal"
>
<label
class=
"label"
>
{{
label
}}
</label>
</div>
<div
class=
"field-body"
>
<div
class=
"field"
>
<div
class=
"control"
>
<input
class=
"input"
type=
"text"
v-model=
"EditData.params.tempUserInputData[label]"
>
</div>
</div>
</div>
<toggle-button
v-model=
"isShowConfig"
@
change=
"SetLoad(label)"
width=
"80"
height=
"30"
style=
"margin-left: 15px;"
switch-color=
"
{checked: '#25EF02', unchecked: 'linear-gradient(red, yellow)'}"
:labels="{checked: 'config', unchecked: 'hide'}"/>
</div>
</div>
</td>
</tr>
<tr
>
<th>
Finish
</th>
...
...
@@ -149,10 +182,13 @@ export default class WindowsApp extends Vue {
pathProcessor
=
new
PathProcessor
();
strMapObjChange
=
new
StrMapObjChange
();
//EditPathPoke : string = '';
isShowParams
:
boolean
=
true
;
isShowParams
:
boolean
=
false
;
isShowParseUrl
:
boolean
=
false
;
userInputData
=
new
Map
<
string
,
string
>
();
tempUserInputData
:{[
key
:
string
]:
string
}
=
{};
pathwithVar
:
string
=
""
;
InputUrl
:
string
=
""
;
isShowConfig
:
boolean
=
false
;
//fontSize:number = null;
//StateFile:any = {};
//StateIndicatorFile:any = {};
...
...
@@ -208,16 +244,25 @@ export default class WindowsApp extends Vue {
updateView
(){
//this.isShowParams = true;
if
(
this
.
EditData
.
edit
.
parseUrl
!=
''
){
this
.
InputUrl
=
this
.
EditData
.
edit
.
parseUrl
;
this
.
isShowParseUrl
=
true
;
console
.
log
(
"
1
"
);
this
.
setVariableList
(
this
.
pathProcessor
.
extractVarFromPath
(
this
.
EditData
.
edit
.
parseUrl
)
);
}
else
if
(
this
.
EditData
.
edit
.
url
!=
''
){
this
.
InputUrl
=
this
.
EditData
.
edit
.
url
;
this
.
isShowParams
=
true
;
console
.
log
(
"
2
"
);
this
.
setVariableList
(
this
.
pathProcessor
.
extractVarFromPath
(
this
.
EditData
.
params
.
PokedPath
)
);
}
console
.
log
(
this
.
EditData
.
params
.
shouldUpdate
);
if
(
this
.
EditData
.
params
.
shouldUpdate
==
true
){
console
.
log
(
"
wind in
"
);
console
.
log
(
this
.
EditData
.
params
.
userInputData
);
//this.EditData.params.userInputData = this.strMapObjChange.objToStrMap(this.EditData.params.userInputData);
//console.log(this.EditData.params.userInputData);
this
.
setVariableInput
(
this
.
strMapObjChange
.
objToStrMap
(
this
.
EditData
.
params
.
userInputData
));
this
.
EditData
.
params
.
shouldUpdate
=
false
;
//this.apply();
...
...
@@ -279,11 +324,40 @@ export default class WindowsApp extends Vue {
pathPoke
()
{
this
.
EditData
.
edit
.
parseUrl
=
''
;
this
.
EditData
.
edit
.
url
=
this
.
InputUrl
;
this
.
isShowParams
=
true
;
window
.
opener
.
UpdateWidget
(
this
.
EditData
);
}
ParseUrl
(){
this
.
EditData
.
edit
.
url
=
''
;
this
.
isShowParams
=
false
;
this
.
EditData
.
edit
.
parseUrl
=
this
.
InputUrl
;
this
.
isShowParseUrl
=
true
;
this
.
setVariableList
(
this
.
pathProcessor
.
extractVarFromPath
(
this
.
InputUrl
)
);
if
(
this
.
EditData
.
params
.
shouldUpdate
==
true
){
this
.
setVariableInput
(
this
.
strMapObjChange
.
objToStrMap
(
this
.
EditData
.
params
.
userInputData
));
this
.
EditData
.
params
.
shouldUpdate
=
false
;
//this.apply();
}
}
SetLoad
(
label
:
string
){
if
(
this
.
isShowConfig
==
true
){
this
.
EditData
.
edit
.
setConfigUrl
=
this
.
EditData
.
edit
.
parseUrl
;
if
(
this
.
EditData
.
edit
.
parseUrl
.
search
(
label
)
!=
-
1
){
var
exp
=
"
/$
"
+
label
+
"
$
"
;
this
.
EditData
.
edit
.
parseUrl
=
this
.
EditData
.
edit
.
parseUrl
.
replace
(
exp
,
''
);
this
.
EditData
.
edit
.
setLabel
=
label
;
}
}
}
setVariableInput
(
parentUserInputData
:
Map
<
string
,
string
>
)
{
...
...
@@ -301,6 +375,7 @@ export default class WindowsApp extends Vue {
path
.
forEach
(
element
=>
{
this
.
userInputData
.
set
(
element
,
''
);
});
console
.
log
(
this
.
userInputData
);
//this.EditData.params.userInputData = this.userInputData;
this
.
$forceUpdate
();
...
...
src/components/Config/BoolConfig.vue
View file @
eeb8985f
...
...
@@ -122,6 +122,9 @@
EditData
=
{
edit
:{
url
:
this
.
config
.
data
.
url
,
parseUrl
:
''
,
setConfigUrl
:
''
,
setLabel
:
''
,
type
:
'
Boolconfig
'
,
index
:
this
.
refIndex
,
},
...
...
@@ -218,14 +221,22 @@
}
updateSwitchValue
(){
console
.
log
(
"
switch
"
);
console
.
log
(
this
.
getConfigValue
);
if
(
this
.
getConfigValue
==
true
||
this
.
getConfigValue
==
false
||
this
.
getConfigValue
==
0
||
this
.
getConfigValue
==
1
){
if
(
Object
.
prototype
.
toString
.
call
(
this
.
getConfigValue
)
==
'
[object Boolean]
'
||
this
.
getConfigValue
==
true
||
this
.
getConfigValue
==
false
||
this
.
getConfigValue
==
0
||
this
.
getConfigValue
==
1
){
this
.
checkActiveSample
=
false
;
if
(
Object
.
prototype
.
toString
.
call
(
this
.
getConfigValue
)
==
'
[object String]
'
){
if
(
this
.
getConfigValue
==
'
1
'
){
this
.
switchValue
=
true
;
}
else
if
(
this
.
getConfigValue
==
'
0
'
){
this
.
switchValue
=
false
;
}
console
.
log
(
this
.
getConfigValue
);
console
.
log
(
this
.
switchValue
);
}
else
{
this
.
switchValue
=
Boolean
(
this
.
getConfigValue
);
console
.
log
(
"
this
"
);
console
.
log
(
this
.
switchValue
);
}
}
}
...
...
@@ -257,6 +268,7 @@
this
.
EditData
=
setConfigData
[
1
];
if
(
this
.
EditData
.
edit
.
url
.
search
(
"
startpath
"
)
!=
-
1
){
this
.
replaceStartPath
(
fragment
)}
if
(
this
.
EditData
.
edit
.
parseUrl
.
search
(
"
startpath
"
)
!=
-
1
){
this
.
replaceStartPath
(
fragment
)}
var
temp
=
this
.
EditData
.
params
.
tempUserInputData
;
...
...
@@ -385,6 +397,7 @@
this
.
config
.
data
.
set
.
url
=
this
.
config
.
data
.
set
.
url
.
replace
(
"
$startpath$
"
,
startPath
);
this
.
config
.
data
.
url
=
this
.
config
.
data
.
url
.
replace
(
"
$startpath$
"
,
startPath
);
this
.
EditData
.
edit
.
url
=
this
.
EditData
.
edit
.
url
.
replace
(
"
$startpath$
"
,
startPath
);
this
.
EditData
.
edit
.
parseUrl
=
this
.
EditData
.
edit
.
parseUrl
.
replace
(
"
$startpath$
"
,
startPath
);
}
parentUpdate
(
payload
:
UpdatePayload
):
void
{
...
...
@@ -424,6 +437,7 @@
async
getData
(
url
:
string
)
{
var
apiLoad
=
url
;
console
.
log
(
url
);
await
axios
.
get
(
apiLoad
,
{
headers
:
{
'
Pragma
'
:
'
no-cache
'
,
...
...
@@ -461,6 +475,14 @@
async
viewGetLoad
(
Args
:
UpdatePayload
)
{
// this.config.data.userInputData = Args.variables;
this
.
userGetInputData
=
Args
.
variables
;
if
(
this
.
EditData
.
edit
.
parseUrl
!=
''
){
if
(
this
.
EditData
.
edit
.
url
==
''
){
console
.
log
(
"
1
"
+
this
.
EditData
.
edit
.
parseUrl
);
this
.
config
.
data
.
get
.
url
=
this
.
EditData
.
edit
.
parseUrl
;
}
else
{
this
.
config
.
data
.
get
.
url
=
this
.
EditData
.
edit
.
url
;
}
}
this
.
getPathwithVar
=
this
.
pathProcessor
.
FillPathWithVar
(
// this.config.data.userInputData,
this
.
userGetInputData
,
...
...
@@ -470,23 +492,32 @@
}
async
viewSetLoad
(
Args
:
UpdatePayload
,
checkParent
:
boolean
)
{
console
.
log
(
"
arm
"
);
console
.
log
(
"
arm
"
);
console
.
log
(
"
arm
"
);
console
.
log
(
"
set
"
);
if
(
checkParent
==
false
){
console
.
log
(
"
iii
"
);
if
(
this
.
EditData
.
edit
.
parseUrl
!=
''
){
this
.
config
.
data
.
set
.
url
=
this
.
EditData
.
edit
.
setConfigUrl
;
console
.
log
(
this
.
config
.
data
.
set
.
url
);
this
.
setLabel
=
this
.
EditData
.
edit
.
setLabel
;
//console.log(this.setLabel);
//this.setUserData = Args.variables.setLabel;
}
// this.config.data.userInputData = Args.variables;
if
(
Object
.
prototype
.
toString
.
call
(
Args
.
variables
)
==
'
[object Undefined]
'
){
if
(
Object
.
prototype
.
toString
.
call
(
this
.
getConfigValue
)
==
'
[object Number]
'
){
if
(
Object
.
prototype
.
toString
.
call
(
this
.
getConfigValue
)
==
'
[object Number]
'
||
this
.
getConfigValue
==
0
||
this
.
getConfigValue
==
1
){
console
.
log
(
"
1010101
"
);
var
switchTempValue
=
Number
(
this
.
switchValue
);
console
.
log
(
switchTempValue
);
this
.
userSetInputData
.
set
(
this
.
setLabel
,
switchTempValue
);
}
else
{
this
.
userSetInputData
.
set
(
this
.
setLabel
,
this
.
switchValue
);
}
}
else
{
if
(
Object
.
prototype
.
toString
.
call
(
this
.
getConfigValue
)
==
'
[object Number]
'
){
if
(
Object
.
prototype
.
toString
.
call
(
this
.
getConfigValue
)
==
'
[object Number]
'
||
this
.
getConfigValue
==
0
||
this
.
getConfigValue
==
1
){
console
.
log
(
"
1010101
"
);
var
switchTempValue
=
Number
(
this
.
switchValue
);
console
.
log
(
switchTempValue
);
this
.
userSetInputData
=
Args
.
variables
;
this
.
userSetInputData
.
set
(
this
.
setLabel
,
switchTempValue
);
}
else
{
...
...
@@ -494,8 +525,10 @@
this
.
userSetInputData
.
set
(
this
.
setLabel
,
this
.
switchValue
);
}
}
console
.
log
(
this
.
setPathwithVar
);
this
.
setPathwithVar
=
this
.
pathProcessor
.
FillPathWithVar
(
this
.
userSetInputData
,
this
.
config
.
data
.
set
.
url
);
console
.
log
(
this
.
setPathwithVar
);
await
this
.
setData
(
this
.
setPathwithVar
);
this
.
getrefresh
();
}
else
if
(
checkParent
==
true
){
...
...
src/components/Config/Config.vue
View file @
eeb8985f
...
...
@@ -133,6 +133,9 @@ export default class Config extends Widget {
EditData
=
{
edit
:{
url
:
this
.
config
.
data
.
url
,
parseUrl
:
''
,
setConfigUrl
:
''
,
setLabel
:
''
,
type
:
'
config
'
,
index
:
this
.
refIndex
,
},
...
...
@@ -272,6 +275,7 @@ export default class Config extends Widget {
}
samplePoke
(
sample
:
any
)
{
console
.
log
(
sample
);
var
samplePath
=
sample
.
CFET2CORE_SAMPLE_PATH
;
var
setpokedPath
:
string
;
var
getpokedPath
:
string
;
...
...
@@ -347,6 +351,7 @@ export default class Config extends Widget {
if
(
count
!=
0
)
{
setpokedPath
=
setpokedPath
.
substring
(
0
,
setpokedPath
.
length
-
1
);
}
console
.
log
(
this
.
config
.
data
.
url
);
this
.
config
.
data
.
url
=
setpokedPath
;
}
...
...
@@ -357,6 +362,7 @@ export default class Config extends Widget {
this
.
EditPathPoke
=
this
.
EditData
.
edit
.
url
;
var
pokepath
=
this
.
config
.
data
.
url
;
axios
.
defaults
.
timeout
=
1000
;
//this.samplePoke(this.EditData.params.Sample);
axios
.
get
(
pokepath
).
then
(
response
=>
{
this
.
isGetPoke
=
true
;
this
.
samplePoke
(
response
.
data
);
...
...
@@ -412,6 +418,7 @@ export default class Config extends Widget {
async
getData
(
url
:
string
)
{
console
.
log
(
"
in
"
);
var
apiLoad
=
url
;
console
.
log
(
url
);
await
axios
.
get
(
apiLoad
,
{
headers
:
{
'
Pragma
'
:
'
no-cache
'
,
...
...
@@ -431,8 +438,8 @@ export default class Config extends Widget {
async
setData
(
url
:
string
)
{
console
.
log
(
"
in
"
);
var
apiLoad
=
url
;
console
.
log
(
url
);
var
apiLoad
=
url
;
await
axios
.
post
(
apiLoad
,
{
headers
:
{
'
Pragma
'
:
'
no-cache
'
,
...
...
@@ -456,9 +463,15 @@ export default class Config extends Widget {
async
viewGetLoad
(
Args
:
UpdatePayload
)
{
// this.config.data.userInputData = Args.variables;
this
.
userGetInputData
=
Args
.
variables
;
if
(
this
.
config
.
data
.
get
.
url
==
''
){
console
.
log
(
this
.
EditData
.
edit
.
parseUrl
);
if
(
this
.
EditData
.
edit
.
parseUrl
!=
''
){
if
(
this
.
EditData
.
edit
.
url
==
''
){
this
.
config
.
data
.
get
.
url
=
this
.
EditData
.
edit
.
parseUrl
;
}
else
{
this
.
config
.
data
.
get
.
url
=
this
.
EditData
.
edit
.
url
;
}
}
console
.
log
(
this
.
config
.
data
.
get
.
url
);
this
.
getPathwithVar
=
this
.
pathProcessor
.
FillPathWithVar
(
// this.config.data.userInputData,
this
.
userGetInputData
,
...
...
@@ -470,6 +483,14 @@ export default class Config extends Widget {
async
viewSetLoad
(
Args
:
UpdatePayload
)
{
// this.config.data.userInputData = Args.variables;
console
.
log
(
this
.
config
.
data
.
set
.
url
);
if
(
this
.
EditData
.
edit
.
parseUrl
!=
''
){
this
.
config
.
data
.
set
.
url
=
this
.
EditData
.
edit
.
setConfigUrl
;
console
.
log
(
this
.
config
.
data
.
set
.
url
);
this
.
setLabel
=
this
.
EditData
.
edit
.
setLabel
;
//console.log(this.setLabel);
//this.setUserData = Args.variables.setLabel;
}
if
(
Object
.
prototype
.
toString
.
call
(
Args
.
variables
)
==
'
[object Undefined]
'
){
this
.
userSetInputData
.
set
(
this
.
setLabel
,
this
.
setUserData
);
}
else
{
...
...
src/components/Layout/Grid.vue
View file @
eeb8985f
...
...
@@ -4,13 +4,15 @@
<div
class=
"container"
style=
"margin-top: 30px;margin-left: 0px;margin-right: 0px;"
>
<!--
<hr
style=
"height:5px;border:none;border-top:3px double #606366;width: 105%"
/>
-->
<div
class=
"columns"
>
<!--
<div
class=
"columns"
>
<hr
style=
"height:5px;border:none;border-top:5px ridge #425685;"
/>
<div
class=
"column"
style=
" text-decoration:line-through; width: 100%;height: 2px;background: #02378d;overflow: hidden;"
></div>
<div
class=
"column"
style=
"width:auto;"
>
www
</div>
<div
class=
"column"
style=
" text-decoration:line-through; width: 100%;height: 2px;background: #02378d;overflow: hidden;"
></div>
</div>
</div>
-->
<hr
style=
"height:3px;border:none;border-top:3px double #aca6a1;"
/>
</div>
...
...
src/components/Method/Method.vue
View file @
eeb8985f
...
...
@@ -79,6 +79,7 @@ export default class Method extends Widget {
EditData
=
{
edit
:{
type
:
'
method
'
,
parseUrl
:
''
,
url
:
this
.
config
.
data
.
url
,
index
:
this
.
refIndex
,
},
...
...
@@ -185,6 +186,7 @@ export default class Method extends Widget {
this
.
EditData
=
setConfigData
[
1
];
if
(
this
.
EditData
.
edit
.
url
.
search
(
"
startpath
"
)
!=
-
1
){
this
.
replaceStartPath
(
fragment
)}
if
(
this
.
EditData
.
edit
.
parseUrl
.
search
(
"
startpath
"
)
!=
-
1
){
this
.
replaceStartPath
(
fragment
)}
var
temp
=
this
.
EditData
.
params
.
tempUserInputData
;
...
...
@@ -257,6 +259,7 @@ export default class Method extends Widget {
replaceStartPath
(
startPath
:
string
):
void
{
this
.
config
.
data
.
url
=
this
.
config
.
data
.
url
.
replace
(
"
$startpath$
"
,
startPath
);
this
.
EditData
.
edit
.
url
=
this
.
EditData
.
edit
.
url
.
replace
(
"
$startpath$
"
,
startPath
);
this
.
EditData
.
edit
.
parseUrl
=
this
.
EditData
.
edit
.
parseUrl
.
replace
(
"
$startpath$
"
,
startPath
);
}
parentUpdate
(
payload
:
UpdatePayload
):
void
{
...
...
@@ -320,6 +323,11 @@ export default class Method extends Widget {
async
viewInvokeLoad
(
Args
:
UpdatePayload
)
{
// this.config.data.userInputData = Args.variables;
this
.
userInputData
=
Args
.
variables
;
if
(
this
.
EditData
.
edit
.
url
==
''
){
this
.
config
.
data
.
url
=
this
.
EditData
.
edit
.
parseUrl
;
}
else
{
this
.
config
.
data
.
url
=
this
.
EditData
.
edit
.
url
;
}
this
.
pathwithVar
=
this
.
pathProcessor
.
FillPathWithVar
(
// this.config.data.userInputData,
this
.
userInputData
,
...
...
src/components/State/BoolState.vue
View file @
eeb8985f
...
...
@@ -90,6 +90,7 @@
EditData
=
{
edit
:{
type
:
'
Boolstate
'
,
parseUrl
:
''
,
url
:
this
.
config
.
data
.
url
,
index
:
this
.
refIndex
,
isShowStateVlaue
:
false
,
...
...
@@ -209,6 +210,7 @@
this
.
EditData
=
setConfigData
[
1
];
if
(
this
.
EditData
.
edit
.
url
.
search
(
"
startpath
"
)
!=
-
1
){
this
.
replaceStartPath
(
fragment
)}
if
(
this
.
EditData
.
edit
.
parseUrl
.
search
(
"
startpath
"
)
!=
-
1
){
this
.
replaceStartPath
(
fragment
)}
var
temp
=
this
.
EditData
.
params
.
tempUserInputData
;
temp
=
JSON
.
parse
(
JSON
.
stringify
(
temp
));
...
...
@@ -283,6 +285,7 @@
replaceStartPath
(
startPath
:
string
):
void
{
this
.
config
.
data
.
url
=
this
.
config
.
data
.
url
.
replace
(
"
$startpath$
"
,
startPath
);
this
.
EditData
.
edit
.
url
=
this
.
EditData
.
edit
.
url
.
replace
(
"
$startpath$
"
,
startPath
);
this
.
EditData
.
edit
.
parseUrl
=
this
.
EditData
.
edit
.
parseUrl
.
replace
(
"
$startpath$
"
,
startPath
);
}
parentUpdate
(
payload
:
UpdatePayload
):
void
{
...
...
@@ -341,6 +344,11 @@
async
viewLoad
(
Args
:
UpdatePayload
)
{
// this.config.data.userInputData = Args.variables;
this
.
userInputData
=
Args
.
variables
;
if
(
this
.
EditData
.
edit
.
url
==
''
){
this
.
config
.
data
.
url
=
this
.
EditData
.
edit
.
parseUrl
;
}
else
{
this
.
config
.
data
.
url
=
this
.
EditData
.
edit
.
url
;
}
this
.
pathwithVar
=
this
.
pathProcessor
.
FillPathWithVar
(
// this.config.data.userInputData,
this
.
userInputData
,
...
...
src/components/State/State.vue
View file @
eeb8985f
...
...
@@ -86,6 +86,7 @@ export default class State extends Widget {
EditData
=
{
edit
:{
type
:
'
state
'
,
parseUrl
:
''
,
url
:
this
.
config
.
data
.
url
,
index
:
this
.
refIndex
,
isShowStateVlaue
:
false
,
...
...
@@ -206,6 +207,7 @@ export default class State extends Widget {
this
.
EditData
=
setConfigData
[
1
];
if
(
this
.
EditData
.
edit
.
url
.
search
(
"
startpath
"
)
!=
-
1
){
this
.
replaceStartPath
(
fragment
)}
if
(
this
.
EditData
.
edit
.
parseUrl
.
search
(
"
startpath
"
)
!=
-
1
){
this
.
replaceStartPath
(
fragment
)}
var
temp
=
this
.
EditData
.
params
.
tempUserInputData
;
...
...
@@ -282,6 +284,7 @@ export default class State extends Widget {
replaceStartPath
(
startPath
:
string
):
void
{
this
.
config
.
data
.
url
=
this
.
config
.
data
.
url
.
replace
(
"
$startpath$
"
,
startPath
);
this
.
EditData
.
edit
.
url
=
this
.
EditData
.
edit
.
url
.
replace
(
"
$startpath$
"
,
startPath
);
this
.
EditData
.
edit
.
parseUrl
=
this
.
EditData
.
edit
.
parseUrl
.
replace
(
"
$startpath$
"
,
startPath
);
}
parentUpdate
(
payload
:
UpdatePayload
):
void
{
...
...
@@ -348,6 +351,11 @@ export default class State extends Widget {
async
viewLoad
(
Args
:
UpdatePayload
)
{
// this.config.data.userInputData = Args.variables;
this
.
userInputData
=
Args
.
variables
;
if
(
this
.
EditData
.
edit
.
url
==
''
){
this
.
config
.
data
.
url
=
this
.
EditData
.
edit
.
parseUrl
;
}
else
{
this
.
config
.
data
.
url
=
this
.
EditData
.
edit
.
url
;
}
this
.
pathwithVar
=
this
.
pathProcessor
.
FillPathWithVar
(
// this.config.data.userInputData,
this
.
userInputData
,
...
...
src/components/Status/LabelStatus.vue
View file @
eeb8985f
...
...
@@ -119,6 +119,7 @@
EditData
=
{
edit
:{
type
:
'
LabelStatus
'
,
parseUrl
:
''
,
url
:
this
.
config
.
data
.
url
,
index
:
this
.
refIndex
,
isShowStateVlaue
:
false
,
...
...
@@ -295,6 +296,7 @@
this
.
EditData
=
setConfigData
[
1
];
if
(
this
.
EditData
.
edit
.
url
.
search
(
"
startpath
"
)
!=
-
1
){
this
.
replaceStartPath
(
fragment
)}
if
(
this
.
EditData
.
edit
.
parseUrl
.
search
(
"
startpath
"
)
!=
-
1
){
this
.
replaceStartPath
(
fragment
)}
var
temp
=
this
.
EditData
.
params
.
tempUserInputData
;
...
...
@@ -429,6 +431,7 @@
replaceStartPath
(
startPath
:
string
):
void
{
this
.
config
.
data
.
url
=
this
.
config
.
data
.
url
.
replace
(
"
$startpath$
"
,
startPath
);
this
.
EditData
.
edit
.
url
=
this
.
EditData
.
edit
.
url
.
replace
(
"
$startpath$
"
,
startPath
);
this
.
EditData
.
edit
.
parseUrl
=
this
.
EditData
.
edit
.
parseUrl
.
replace
(
"
$startpath$
"
,
startPath
);
}
async
getData
(
url
:
string
)
{
...
...
@@ -451,6 +454,12 @@
// this.config.data.userInputData = Args.variables;
//this.userInputData = Args.variables;
this
.
userInputData
=
Args
.
variables
;
if
(
this
.
EditData
.
edit
.
url
==
''
){
console
.
log
(
"
1
"
+
this
.
EditData
.
edit
.
parseUrl
);
this
.
config
.
data
.
url
=
this
.
EditData
.
edit
.
parseUrl
;
}
else
{
this
.
config
.
data
.
url
=
this
.
EditData
.
edit
.
url
;
}
this
.
pathwithVar
=
this
.
pathProcessor
.
FillPathWithVar
(
// this.config.data.userInputData,
this
.
userInputData
,
...
...
src/components/Status/Status.vue
View file @
eeb8985f
...
...
@@ -110,6 +110,7 @@ export default class Status extends Widget {
EditData
=
{
edit
:{
type
:
'
status
'
,
parseUrl
:
''
,
url
:
this
.
config
.
data
.
url
,
index
:
this
.
refIndex
,
isShowStateVlaue
:
false
,
...
...
@@ -317,6 +318,7 @@ export default class Status extends Widget {
this
.
EditData
=
setConfigData
[
1
];
if
(
this
.
EditData
.
edit
.
url
.
search
(
"
startpath
"
)
!=
-
1
){
this
.
replaceStartPath
(
fragment
)}
if
(
this
.
EditData
.
edit
.
parseUrl
.
search
(
"
startpath
"
)
!=
-
1
){
this
.
replaceStartPath
(
fragment
)}
var
temp
=
this
.
EditData
.
params
.
tempUserInputData
;
...
...
@@ -474,6 +476,7 @@ export default class Status extends Widget {
replaceStartPath
(
startPath
:
string
):
void
{
this
.
config
.
data
.
url
=
this
.
config
.
data
.
url
.
replace
(
"
$startpath$
"
,
startPath
);
this
.
EditData
.
edit
.
url
=
this
.
EditData
.
edit
.
url
.
replace
(
"
$startpath$
"
,
startPath
);
this
.
EditData
.
edit
.
parseUrl
=
this
.
EditData
.
edit
.
parseUrl
.
replace
(
"
$startpath$
"
,
startPath
);
}
async
getData
(
url
:
string
)
{
...
...
@@ -510,6 +513,11 @@ export default class Status extends Widget {
// this.config.data.userInputData = Args.variables;
//this.userInputData = Args.variables;
this
.
userInputData
=
Args
.
variables
;
if
(
this
.
EditData
.
edit
.
url
==
''
){
this
.
config
.
data
.
url
=
this
.
EditData
.
edit
.
parseUrl
;
}
else
{
this
.
config
.
data
.
url
=
this
.
EditData
.
edit
.
url
;
}
this
.
pathwithVar
=
this
.
pathProcessor
.
FillPathWithVar
(
// this.config.data.userInputData,
this
.
userInputData
,
...
...
src/models/PathProcessor.ts
View file @
eeb8985f
...
...
@@ -5,6 +5,7 @@ export default class PathProcessor {
let
str
=
''
;
//取出path中的$ $,数组
const
result
=
path
.
match
(
urlRegExp
);
console
.
log
(
result
);
if
(
result
!=
null
)
{
//遍历map和数组
variables
.
forEach
((
value
:
string
,
key
:
string
)
=>
{
...
...
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