Commit eeb8985f authored by XieXiaohan's avatar XieXiaohan

fixed Status

parent cb77b02b
...@@ -34,8 +34,9 @@ ...@@ -34,8 +34,9 @@
<tr> <tr>
<th>url:</th> <th>url:</th>
<td> <input class="input has-text-primary" v-model="EditData.edit.url" type="text"></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></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> </tr>
...@@ -84,10 +85,10 @@ ...@@ -84,10 +85,10 @@
</tr> </tr>
<tr> <tr v-show="isShowParams">
<th>Params</th> <th>Params</th>
<td> <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 is-horizontal" style="margin:5px">
<div class="field-label is-normal"> <div class="field-label is-normal">
...@@ -105,6 +106,38 @@ ...@@ -105,6 +106,38 @@
</div> </div>
</td> </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>
<tr > <tr >
<th>Finish</th> <th>Finish</th>
...@@ -149,10 +182,13 @@ export default class WindowsApp extends Vue { ...@@ -149,10 +182,13 @@ export default class WindowsApp extends Vue {
pathProcessor = new PathProcessor(); pathProcessor = new PathProcessor();
strMapObjChange = new StrMapObjChange(); strMapObjChange = new StrMapObjChange();
//EditPathPoke : string = ''; //EditPathPoke : string = '';
isShowParams: boolean = true; isShowParams: boolean = false;
isShowParseUrl : boolean = false;
userInputData = new Map<string, string>(); userInputData = new Map<string, string>();
tempUserInputData:{[key: string]: string} = {}; tempUserInputData:{[key: string]: string} = {};
pathwithVar: string = ""; pathwithVar: string = "";
InputUrl:string = "";
isShowConfig:boolean = false;
//fontSize:number = null; //fontSize:number = null;
//StateFile:any = {}; //StateFile:any = {};
//StateIndicatorFile:any = {}; //StateIndicatorFile:any = {};
...@@ -208,16 +244,25 @@ export default class WindowsApp extends Vue { ...@@ -208,16 +244,25 @@ export default class WindowsApp extends Vue {
updateView(){ 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; this.isShowParams = true;
console.log("2");
this.setVariableList( this.setVariableList(
this.pathProcessor.extractVarFromPath(this.EditData.params.PokedPath) this.pathProcessor.extractVarFromPath(this.EditData.params.PokedPath)
); );
}
console.log(this.EditData.params.shouldUpdate); console.log(this.EditData.params.shouldUpdate);
if(this.EditData.params.shouldUpdate == true){ 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.setVariableInput(this.strMapObjChange.objToStrMap(this.EditData.params.userInputData));
this.EditData.params.shouldUpdate = false; this.EditData.params.shouldUpdate = false;
//this.apply(); //this.apply();
...@@ -279,11 +324,40 @@ export default class WindowsApp extends Vue { ...@@ -279,11 +324,40 @@ export default class WindowsApp extends Vue {
pathPoke() { pathPoke() {
this.EditData.edit.parseUrl = '';
this.EditData.edit.url = this.InputUrl;
this.isShowParams = true; this.isShowParams = true;
window.opener.UpdateWidget(this.EditData); 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>) setVariableInput(parentUserInputData:Map<string, string>)
{ {
...@@ -301,6 +375,7 @@ export default class WindowsApp extends Vue { ...@@ -301,6 +375,7 @@ export default class WindowsApp extends Vue {
path.forEach(element => { path.forEach(element => {
this.userInputData.set(element, ''); this.userInputData.set(element, '');
}); });
console.log(this.userInputData);
//this.EditData.params.userInputData = this.userInputData; //this.EditData.params.userInputData = this.userInputData;
this.$forceUpdate(); this.$forceUpdate();
......
...@@ -122,6 +122,9 @@ ...@@ -122,6 +122,9 @@
EditData = { EditData = {
edit:{ edit:{
url:this.config.data.url, url:this.config.data.url,
parseUrl:'',
setConfigUrl:'',
setLabel:'',
type:'Boolconfig', type:'Boolconfig',
index:this.refIndex, index:this.refIndex,
}, },
...@@ -218,14 +221,22 @@ ...@@ -218,14 +221,22 @@
} }
updateSwitchValue(){ updateSwitchValue(){
console.log("switch"); if(Object.prototype.toString.call(this.getConfigValue) == '[object Boolean]'|| this.getConfigValue == true|| this.getConfigValue == false || this.getConfigValue == 0 || this.getConfigValue == 1){
console.log(this.getConfigValue);
if(this.getConfigValue == true|| this.getConfigValue == false || this.getConfigValue == 0 || this.getConfigValue == 1){
this.checkActiveSample = false; 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); this.switchValue = Boolean(this.getConfigValue);
console.log("this"); }
console.log(this.switchValue);
} }
} }
...@@ -257,6 +268,7 @@ ...@@ -257,6 +268,7 @@
this.EditData = setConfigData[1]; this.EditData = setConfigData[1];
if(this.EditData.edit.url.search("startpath") != -1 ){this.replaceStartPath(fragment)} 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; var temp = this.EditData.params.tempUserInputData;
...@@ -385,6 +397,7 @@ ...@@ -385,6 +397,7 @@
this.config.data.set.url = this.config.data.set.url.replace("$startpath$", startPath); 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.config.data.url = this.config.data.url.replace("$startpath$", startPath);
this.EditData.edit.url = this.EditData.edit.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 { parentUpdate(payload: UpdatePayload): void {
...@@ -424,6 +437,7 @@ ...@@ -424,6 +437,7 @@
async getData(url: string) { async getData(url: string) {
var apiLoad = url; var apiLoad = url;
console.log(url);
await axios.get(apiLoad, { await axios.get(apiLoad, {
headers: { headers: {
'Pragma': 'no-cache', 'Pragma': 'no-cache',
...@@ -461,6 +475,14 @@ ...@@ -461,6 +475,14 @@
async viewGetLoad(Args: UpdatePayload) { async viewGetLoad(Args: UpdatePayload) {
// this.config.data.userInputData = Args.variables; // this.config.data.userInputData = Args.variables;
this.userGetInputData = 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.getPathwithVar = this.pathProcessor.FillPathWithVar(
// this.config.data.userInputData, // this.config.data.userInputData,
this.userGetInputData, this.userGetInputData,
...@@ -470,23 +492,32 @@ ...@@ -470,23 +492,32 @@
} }
async viewSetLoad(Args: UpdatePayload,checkParent:boolean) { async viewSetLoad(Args: UpdatePayload,checkParent:boolean) {
console.log("arm"); console.log("set");
console.log("arm");
console.log("arm");
if(checkParent == false){ 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; // this.config.data.userInputData = Args.variables;
if(Object.prototype.toString.call( Args.variables) == '[object Undefined]' ){ 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); var switchTempValue = Number(this.switchValue);
console.log(switchTempValue);
this.userSetInputData.set(this.setLabel,switchTempValue); this.userSetInputData.set(this.setLabel,switchTempValue);
}else{ }else{
this.userSetInputData.set(this.setLabel,this.switchValue); this.userSetInputData.set(this.setLabel,this.switchValue);
} }
}else{ }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); var switchTempValue = Number(this.switchValue);
console.log(switchTempValue);
this.userSetInputData = Args.variables; this.userSetInputData = Args.variables;
this.userSetInputData.set(this.setLabel,switchTempValue); this.userSetInputData.set(this.setLabel,switchTempValue);
}else{ }else{
...@@ -494,8 +525,10 @@ ...@@ -494,8 +525,10 @@
this.userSetInputData.set(this.setLabel,this.switchValue); this.userSetInputData.set(this.setLabel,this.switchValue);
} }
} }
console.log(this.setPathwithVar);
this.setPathwithVar = this.pathProcessor.FillPathWithVar(this.userSetInputData, this.config.data.set.url); this.setPathwithVar = this.pathProcessor.FillPathWithVar(this.userSetInputData, this.config.data.set.url);
console.log(this.setPathwithVar);
await this.setData(this.setPathwithVar); await this.setData(this.setPathwithVar);
this.getrefresh(); this.getrefresh();
}else if(checkParent == true){ }else if(checkParent == true){
......
...@@ -133,6 +133,9 @@ export default class Config extends Widget { ...@@ -133,6 +133,9 @@ export default class Config extends Widget {
EditData = { EditData = {
edit:{ edit:{
url:this.config.data.url, url:this.config.data.url,
parseUrl:'',
setConfigUrl:'',
setLabel:'',
type:'config', type:'config',
index:this.refIndex, index:this.refIndex,
}, },
...@@ -272,6 +275,7 @@ export default class Config extends Widget { ...@@ -272,6 +275,7 @@ export default class Config extends Widget {
} }
samplePoke(sample: any) { samplePoke(sample: any) {
console.log(sample);
var samplePath = sample.CFET2CORE_SAMPLE_PATH; var samplePath = sample.CFET2CORE_SAMPLE_PATH;
var setpokedPath: string; var setpokedPath: string;
var getpokedPath: string; var getpokedPath: string;
...@@ -347,6 +351,7 @@ export default class Config extends Widget { ...@@ -347,6 +351,7 @@ export default class Config extends Widget {
if (count != 0) { if (count != 0) {
setpokedPath = setpokedPath.substring(0, setpokedPath.length - 1); setpokedPath = setpokedPath.substring(0, setpokedPath.length - 1);
} }
console.log(this.config.data.url);
this.config.data.url = setpokedPath; this.config.data.url = setpokedPath;
} }
...@@ -357,6 +362,7 @@ export default class Config extends Widget { ...@@ -357,6 +362,7 @@ export default class Config extends Widget {
this.EditPathPoke = this.EditData.edit.url; this.EditPathPoke = this.EditData.edit.url;
var pokepath = this.config.data.url; var pokepath = this.config.data.url;
axios.defaults.timeout = 1000; axios.defaults.timeout = 1000;
//this.samplePoke(this.EditData.params.Sample);
axios.get(pokepath).then(response => { axios.get(pokepath).then(response => {
this.isGetPoke = true; this.isGetPoke = true;
this.samplePoke(response.data); this.samplePoke(response.data);
...@@ -412,6 +418,7 @@ export default class Config extends Widget { ...@@ -412,6 +418,7 @@ export default class Config extends Widget {
async getData(url: string) { async getData(url: string) {
console.log("in"); console.log("in");
var apiLoad = url; var apiLoad = url;
console.log(url);
await axios.get(apiLoad, { await axios.get(apiLoad, {
headers: { headers: {
'Pragma': 'no-cache', 'Pragma': 'no-cache',
...@@ -431,8 +438,8 @@ export default class Config extends Widget { ...@@ -431,8 +438,8 @@ export default class Config extends Widget {
async setData(url: string) { async setData(url: string) {
console.log("in"); console.log("in");
var apiLoad = url;
console.log(url); console.log(url);
var apiLoad = url;
await axios.post(apiLoad, { await axios.post(apiLoad, {
headers: { headers: {
'Pragma': 'no-cache', 'Pragma': 'no-cache',
...@@ -456,9 +463,15 @@ export default class Config extends Widget { ...@@ -456,9 +463,15 @@ export default class Config extends Widget {
async viewGetLoad(Args: UpdatePayload) { async viewGetLoad(Args: UpdatePayload) {
// this.config.data.userInputData = Args.variables; // this.config.data.userInputData = Args.variables;
this.userGetInputData = 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; this.config.data.get.url = this.EditData.edit.url;
} }
}
console.log(this.config.data.get.url);
this.getPathwithVar = this.pathProcessor.FillPathWithVar( this.getPathwithVar = this.pathProcessor.FillPathWithVar(
// this.config.data.userInputData, // this.config.data.userInputData,
this.userGetInputData, this.userGetInputData,
...@@ -470,6 +483,14 @@ export default class Config extends Widget { ...@@ -470,6 +483,14 @@ export default class Config extends Widget {
async viewSetLoad(Args: UpdatePayload) { async viewSetLoad(Args: UpdatePayload) {
// this.config.data.userInputData = Args.variables; // 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]' ){ if(Object.prototype.toString.call( Args.variables) == '[object Undefined]' ){
this.userSetInputData.set(this.setLabel,this.setUserData); this.userSetInputData.set(this.setLabel,this.setUserData);
}else{ }else{
......
...@@ -4,13 +4,15 @@ ...@@ -4,13 +4,15 @@
<div class="container" style="margin-top: 30px;margin-left: 0px;margin-right: 0px;"> <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%" />--> <!--<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=" 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="width:auto;">www</div>
<div class="column" style=" text-decoration:line-through; width: 100%;height: 2px;background: #02378d;overflow: hidden;"></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> </div>
......
...@@ -79,6 +79,7 @@ export default class Method extends Widget { ...@@ -79,6 +79,7 @@ export default class Method extends Widget {
EditData = { EditData = {
edit:{ edit:{
type:'method', type:'method',
parseUrl:'',
url:this.config.data.url, url:this.config.data.url,
index:this.refIndex, index:this.refIndex,
}, },
...@@ -185,6 +186,7 @@ export default class Method extends Widget { ...@@ -185,6 +186,7 @@ export default class Method extends Widget {
this.EditData = setConfigData[1]; this.EditData = setConfigData[1];
if(this.EditData.edit.url.search("startpath") != -1 ){this.replaceStartPath(fragment)} 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; var temp = this.EditData.params.tempUserInputData;
...@@ -257,6 +259,7 @@ export default class Method extends Widget { ...@@ -257,6 +259,7 @@ export default class Method extends Widget {
replaceStartPath(startPath: string): void { replaceStartPath(startPath: string): void {
this.config.data.url = this.config.data.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.url = this.EditData.edit.url.replace("$startpath$", startPath);
this.EditData.edit.parseUrl = this.EditData.edit.parseUrl.replace("$startpath$", startPath);
} }
parentUpdate(payload: UpdatePayload): void { parentUpdate(payload: UpdatePayload): void {
...@@ -320,6 +323,11 @@ export default class Method extends Widget { ...@@ -320,6 +323,11 @@ export default class Method extends Widget {
async viewInvokeLoad(Args: UpdatePayload) { async viewInvokeLoad(Args: UpdatePayload) {
// this.config.data.userInputData = Args.variables; // 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.pathwithVar = this.pathProcessor.FillPathWithVar(
// this.config.data.userInputData, // this.config.data.userInputData,
this.userInputData, this.userInputData,
......
...@@ -90,6 +90,7 @@ ...@@ -90,6 +90,7 @@
EditData = { EditData = {
edit:{ edit:{
type:'Boolstate', type:'Boolstate',
parseUrl:'',
url:this.config.data.url, url:this.config.data.url,
index:this.refIndex, index:this.refIndex,
isShowStateVlaue:false, isShowStateVlaue:false,
...@@ -209,6 +210,7 @@ ...@@ -209,6 +210,7 @@
this.EditData = setConfigData[1]; this.EditData = setConfigData[1];
if(this.EditData.edit.url.search("startpath") != -1 ){this.replaceStartPath(fragment)} 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; var temp = this.EditData.params.tempUserInputData;
temp = JSON.parse(JSON.stringify(temp)); temp = JSON.parse(JSON.stringify(temp));
...@@ -283,6 +285,7 @@ ...@@ -283,6 +285,7 @@
replaceStartPath(startPath: string): void { replaceStartPath(startPath: string): void {
this.config.data.url = this.config.data.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.url = this.EditData.edit.url.replace("$startpath$", startPath);
this.EditData.edit.parseUrl = this.EditData.edit.parseUrl.replace("$startpath$", startPath);
} }
parentUpdate(payload: UpdatePayload): void { parentUpdate(payload: UpdatePayload): void {
...@@ -341,6 +344,11 @@ ...@@ -341,6 +344,11 @@
async viewLoad(Args: UpdatePayload) { async viewLoad(Args: UpdatePayload) {
// this.config.data.userInputData = Args.variables; // 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.pathwithVar = this.pathProcessor.FillPathWithVar(
// this.config.data.userInputData, // this.config.data.userInputData,
this.userInputData, this.userInputData,
......
...@@ -86,6 +86,7 @@ export default class State extends Widget { ...@@ -86,6 +86,7 @@ export default class State extends Widget {
EditData = { EditData = {
edit:{ edit:{
type:'state', type:'state',
parseUrl:'',
url:this.config.data.url, url:this.config.data.url,
index:this.refIndex, index:this.refIndex,
isShowStateVlaue:false, isShowStateVlaue:false,
...@@ -206,6 +207,7 @@ export default class State extends Widget { ...@@ -206,6 +207,7 @@ export default class State extends Widget {
this.EditData = setConfigData[1]; this.EditData = setConfigData[1];
if(this.EditData.edit.url.search("startpath") != -1 ){this.replaceStartPath(fragment)} 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; var temp = this.EditData.params.tempUserInputData;
...@@ -282,6 +284,7 @@ export default class State extends Widget { ...@@ -282,6 +284,7 @@ export default class State extends Widget {
replaceStartPath(startPath: string): void { replaceStartPath(startPath: string): void {
this.config.data.url = this.config.data.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.url = this.EditData.edit.url.replace("$startpath$", startPath);
this.EditData.edit.parseUrl = this.EditData.edit.parseUrl.replace("$startpath$", startPath);
} }
parentUpdate(payload: UpdatePayload): void { parentUpdate(payload: UpdatePayload): void {
...@@ -348,6 +351,11 @@ export default class State extends Widget { ...@@ -348,6 +351,11 @@ export default class State extends Widget {
async viewLoad(Args: UpdatePayload) { async viewLoad(Args: UpdatePayload) {
// this.config.data.userInputData = Args.variables; // 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.pathwithVar = this.pathProcessor.FillPathWithVar(
// this.config.data.userInputData, // this.config.data.userInputData,
this.userInputData, this.userInputData,
......
...@@ -119,6 +119,7 @@ ...@@ -119,6 +119,7 @@
EditData = { EditData = {
edit:{ edit:{
type:'LabelStatus', type:'LabelStatus',
parseUrl:'',
url:this.config.data.url, url:this.config.data.url,
index:this.refIndex, index:this.refIndex,
isShowStateVlaue:false, isShowStateVlaue:false,
...@@ -295,6 +296,7 @@ ...@@ -295,6 +296,7 @@
this.EditData = setConfigData[1]; this.EditData = setConfigData[1];
if(this.EditData.edit.url.search("startpath") != -1 ){this.replaceStartPath(fragment)} 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; var temp = this.EditData.params.tempUserInputData;
...@@ -429,6 +431,7 @@ ...@@ -429,6 +431,7 @@
replaceStartPath(startPath: string): void { replaceStartPath(startPath: string): void {
this.config.data.url = this.config.data.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.url = this.EditData.edit.url.replace("$startpath$", startPath);
this.EditData.edit.parseUrl = this.EditData.edit.parseUrl.replace("$startpath$", startPath);
} }
async getData(url: string) { async getData(url: string) {
...@@ -451,6 +454,12 @@ ...@@ -451,6 +454,12 @@
// this.config.data.userInputData = Args.variables; // this.config.data.userInputData = Args.variables;
//this.userInputData = Args.variables; //this.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.pathwithVar = this.pathProcessor.FillPathWithVar(
// this.config.data.userInputData, // this.config.data.userInputData,
this.userInputData, this.userInputData,
......
...@@ -110,6 +110,7 @@ export default class Status extends Widget { ...@@ -110,6 +110,7 @@ export default class Status extends Widget {
EditData = { EditData = {
edit:{ edit:{
type:'status', type:'status',
parseUrl:'',
url:this.config.data.url, url:this.config.data.url,
index:this.refIndex, index:this.refIndex,
isShowStateVlaue:false, isShowStateVlaue:false,
...@@ -317,6 +318,7 @@ export default class Status extends Widget { ...@@ -317,6 +318,7 @@ export default class Status extends Widget {
this.EditData = setConfigData[1]; this.EditData = setConfigData[1];
if(this.EditData.edit.url.search("startpath") != -1 ){this.replaceStartPath(fragment)} 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; var temp = this.EditData.params.tempUserInputData;
...@@ -474,6 +476,7 @@ export default class Status extends Widget { ...@@ -474,6 +476,7 @@ export default class Status extends Widget {
replaceStartPath(startPath: string): void { replaceStartPath(startPath: string): void {
this.config.data.url = this.config.data.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.url = this.EditData.edit.url.replace("$startpath$", startPath);
this.EditData.edit.parseUrl = this.EditData.edit.parseUrl.replace("$startpath$", startPath);
} }
async getData(url: string) { async getData(url: string) {
...@@ -510,6 +513,11 @@ export default class Status extends Widget { ...@@ -510,6 +513,11 @@ export default class Status extends Widget {
// this.config.data.userInputData = Args.variables; // this.config.data.userInputData = Args.variables;
//this.userInputData = Args.variables; //this.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.pathwithVar = this.pathProcessor.FillPathWithVar(
// this.config.data.userInputData, // this.config.data.userInputData,
this.userInputData, this.userInputData,
......
...@@ -5,6 +5,7 @@ export default class PathProcessor { ...@@ -5,6 +5,7 @@ export default class PathProcessor {
let str = ''; let str = '';
//取出path中的$ $,数组 //取出path中的$ $,数组
const result = path.match(urlRegExp); const result = path.match(urlRegExp);
console.log(result);
if (result != null) { if (result != null) {
//遍历map和数组 //遍历map和数组
variables.forEach((value: string, key: string) => { variables.forEach((value: string, key: string) => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment