Commit d8d94a3d authored by WuFeiyang's avatar WuFeiyang

加了familylink

parent 96db0cef
...@@ -1157,6 +1157,11 @@ ...@@ -1157,6 +1157,11 @@
"@turf/helpers": "6.x" "@turf/helpers": "6.x"
} }
}, },
"@tweenjs/tween.js": {
"version": "17.4.0",
"resolved": "https://registry.npmjs.org/@tweenjs/tween.js/-/tween.js-17.4.0.tgz",
"integrity": "sha512-J3fzl1F6wvh8KXVVcIuHN12xi1ZDcPA/0Vix+ZcJYwZWVHUwfIqfvzYXXEw7ybeev6477KCTt9fKydU+ajUqcg=="
},
"@types/d3": { "@types/d3": {
"version": "3.5.43", "version": "3.5.43",
"resolved": "https://registry.npm.taobao.org/@types/d3/download/@types/d3-3.5.43.tgz", "resolved": "https://registry.npm.taobao.org/@types/d3/download/@types/d3-3.5.43.tgz",
...@@ -13641,6 +13646,14 @@ ...@@ -13641,6 +13646,14 @@
"loader-utils": "^1.0.2" "loader-utils": "^1.0.2"
} }
}, },
"vue-svg-gauge": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/vue-svg-gauge/-/vue-svg-gauge-1.2.1.tgz",
"integrity": "sha512-AKASvAhH4gmgSV3kZ0e3kPgA7/YijorWj26fHqTM+dy1pVzrIAjfyr7IyILyU9Bu7jYIbw76nf+AKoKFa3jwhQ==",
"requires": {
"@tweenjs/tween.js": "^17.3.0"
}
},
"vue-template-compiler": { "vue-template-compiler": {
"version": "2.6.10", "version": "2.6.10",
"resolved": "https://registry.npm.taobao.org/vue-template-compiler/download/vue-template-compiler-2.6.10.tgz", "resolved": "https://registry.npm.taobao.org/vue-template-compiler/download/vue-template-compiler-2.6.10.tgz",
......
...@@ -106,7 +106,7 @@ export default class App extends Vue { ...@@ -106,7 +106,7 @@ export default class App extends Vue {
mounted() { mounted() {
var fragment = window.location.hash; var fragment = window.location.hash;
// var fragment = "#/card0"; // var fragment = "#/dataServer/BasePath";
console.log(fragment); console.log(fragment);
if (fragment != "#") { if (fragment != "#") {
fragment = fragment.substring(1,fragment.length); fragment = fragment.substring(1,fragment.length);
......
<template id="setBasicParams">
<div>
<span>parent and children link</span>
<b-button variant="primary" @click="getPath">show</b-button>
<div>
<a :href="parentPath">{{ parentPath }}</a>
<div v-for="(path,index) in childrenPath" :key="index">
<a :href= "path" >{{path}}</a><br>
</div>
</div>
</div>
</template>
<script lang="ts">
import { Component, Prop, Vue, Watch } from "vue-property-decorator";
import axios from "axios";
import Plotly from "plotly.js";
import global_ from '@/components/Common/global.vue';
import { WidgetConfig } from "@/models/WidgetConfig";
import { UpdatePayload } from "@/models/UpdatePayload";
import PathProcessor from "@/models/PathProcessor";
import { forEach } from "typescript-collections/dist/lib/arrays";
import { map } from "d3";
import WidgetParams from "@/components/Common/WidgetParams.vue";
@Component({
components:{
WidgetParams
}
})
export default class FamilyLink extends Vue {
@Prop() url!:string;
parentPath!:string;
childrenPath!:string[];
async getPath(){
var apiLoad = this.url;
await axios.get(apiLoad)
.then(response => {
this.parentPath = response.data.ParentPath as string;
this.childrenPath = response.data.ChildrenPath as string[];
})
this.$forceUpdate();
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
...@@ -2,9 +2,7 @@ ...@@ -2,9 +2,7 @@
<div style="width:100%"> <div style="width:100%">
<div v-for="(label, index) in userInputData.keys()" :key="index"> <div v-for="(label, index) in userInputData.keys()" :key="index">
<b-input-group style="margin:5px"> <b-input-group style="margin:5px">
<template v-slot:prepend> <b-input-group-text class="smallFont">{{label}}</b-input-group-text>
<b-input-group-text class="smallFont">{{label}}</b-input-group-text>
</template>
<b-form-input class="smallFont" v-model="tempUserInputData[label]" ></b-form-input> <b-form-input class="smallFont" v-model="tempUserInputData[label]" ></b-form-input>
</b-input-group> </b-input-group>
</div> </div>
...@@ -36,6 +34,7 @@ export default class WidgetParams extends Vue{ ...@@ -36,6 +34,7 @@ export default class WidgetParams extends Vue{
path.forEach(element => { path.forEach(element => {
this.userInputData.set(element, ''); this.userInputData.set(element, '');
}); });
console.log(this.userInputData);
this.$forceUpdate(); this.$forceUpdate();
} }
......
<script>
const thingPath = "/dataserver";
export default {
thingPath
}
</script>
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
<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 />
</b-row> </b-row>
<b-row style="margin-top:10px"> <b-row style="margin-top:10px">
<b-col> <b-col>
...@@ -16,8 +15,6 @@ ...@@ -16,8 +15,6 @@
</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;font-size:20px">getConfigValue:{{ getConfigValue }}</span>
<div><hr v-show="isShowPath"/></div>
<!-- <span style="float:left;font-size:20px">setConfigValue:{{ setConfigValue }}</span> <!-- <span style="float:left;font-size:20px">setConfigValue:{{ setConfigValue }}</span>
<hr /> --> <hr /> -->
</div> </div>
......
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
<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">{{ StatusValue }}</span> <span style="float:left;font-size:20px">{{ StatusValue }}</span>
<hr /> <div v-show="isShowPath"><hr /></div>
</div> </div>
<b-input-group prepend="path" v-show="isShowPath"> <b-input-group 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>
...@@ -21,11 +21,13 @@ ...@@ -21,11 +21,13 @@
</b-input-group> </b-input-group>
<hr/> <hr/>
<WidgetParams ref="WidgetParams" v-show="isShowParams&&isShowPath" action="get" @updataVariables="viewLoad" ></WidgetParams> <WidgetParams ref="WidgetParams" v-show="isShowParams&&isShowPath" action="get" @updataVariables="viewLoad" ></WidgetParams>
<FamilyLink ref="FamilyLink" :url="config.data.url"></FamilyLink>
</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";
...@@ -39,10 +41,12 @@ import PathProcessor from "@/models/PathProcessor"; ...@@ -39,10 +41,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 FamilyLink from '@/components/Common/FamilyLink.vue';
@Component({ @Component({
components: { components: {
WidgetParams WidgetParams,
FamilyLink
} }
}) })
export default class Status extends Widget { export default class Status extends Widget {
...@@ -136,7 +140,10 @@ export default class Status extends Widget { ...@@ -136,7 +140,10 @@ export default class Status extends Widget {
pokedPath = pokedPath + key + "=$" + key + "$&"; pokedPath = pokedPath + key + "=$" + key + "$&";
}); });
console.log(pokedPath); console.log(pokedPath);
pokedPath = pokedPath.substring(0,pokedPath.length-1); if(count != 0 )
{
pokedPath = pokedPath.substring(0,pokedPath.length-1);
}
console.log(pokedPath); console.log(pokedPath);
this.config.data.url = pokedPath; this.config.data.url = pokedPath;
} }
......
...@@ -14,11 +14,12 @@ import setBasicParams from './setBasicParams.vue'; ...@@ -14,11 +14,12 @@ import setBasicParams from './setBasicParams.vue';
import showViewInfo from './showViewInfo.vue'; import showViewInfo from './showViewInfo.vue';
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 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 { Widget } from '@/models/wiget'; import { Widget } from '@/models/wiget';
import StrMapObjChange from "@/models/StrMapObjChange"; import StrMapObjChange from "@/models/StrMapObjChange";
import { ResourceInfo } from "@/models/Customview";
import axios from "axios";
@Component({ @Component({
...@@ -83,6 +84,43 @@ export default class waveView extends Widget { ...@@ -83,6 +84,43 @@ export default class waveView extends Widget {
updateConfig(data:WidgetConfig){ updateConfig(data:WidgetConfig){
this.config = data; this.config = data;
} }
samplePoke(sample:ResourceInfo[],samplePath:string)
{
var pokedPath:string;
pokedPath = samplePath;
var count:number = 0;
var temp = sample[0].Parameters;
temp = JSON.parse(JSON.stringify(temp));
console.log(temp);
temp = this.strMapObjChange.objToStrMap(temp);
console.log(temp);
sample[0].Parameters = temp;
console.log(sample[0].Parameters);
sample[0].Parameters.forEach((value , key) =>{
count++;
if(count == 1)
{
pokedPath = pokedPath + "?";
}
pokedPath = pokedPath + key + "=$" + key + "$&";
});
console.log(pokedPath);
pokedPath = pokedPath.substring(0,pokedPath.length-1);
console.log(pokedPath);
this.config.data.url = pokedPath;
}
pathPoke()
{
axios.get(this.config.data.url).then(response => {
var resourcetype = response.data.ResourceType;
var samplePath = response.data.CFET2CORE_SAMPLE_PATH;
var sample: ResourceInfo[] = [];
sample[0] = response.data.Actions.get as ResourceInfo;
this.samplePoke(sample,samplePath);
})
}
} }
</script> </script>
......
...@@ -225,13 +225,13 @@ export default class setBasicParams extends Vue { ...@@ -225,13 +225,13 @@ export default class setBasicParams extends Vue {
Plotly.newPlot(myPlot, data_update, data_layout, config); Plotly.newPlot(myPlot, data_update, data_layout, config);
} }
async getData(url: string) { async getData(url: string) {
var apiLoad = global_.thingPath + "/DataByTimeFuzzy/" + url; var apiLoad = "/dataserver" + "/DataByTimeFuzzy/" + url;//改
await axios.get(apiLoad).then(response => { await axios.get(apiLoad).then(response => {
this.temp.data = response.data.ObjectVal; this.temp.data = response.data.ObjectVal;
}); });
} }
async getDataTimeAxis(url: string) { async getDataTimeAxis(url: string) {
var apiLoad = global_.thingPath + "/DataByTimeFuzzyTimeAxis/" + url; var apiLoad = "/dataerver" + "/DataByTimeFuzzyTimeAxis/" + url;
await axios.get(apiLoad).then(response => { await axios.get(apiLoad).then(response => {
this.temp.dataTimeAxis = response.data.ObjectVal; this.temp.dataTimeAxis = response.data.ObjectVal;
}); });
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
<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 global_ from '@/components/Common/global.vue';
@Component @Component
export default class showViewInfo extends Vue { export default class showViewInfo extends Vue {
...@@ -28,21 +27,21 @@ export default class showViewInfo extends Vue { ...@@ -28,21 +27,21 @@ export default class showViewInfo extends Vue {
this.getLength(pathId); this.getLength(pathId);
} }
async getBasePath() { async getBasePath() {
var apiLoad = global_.thingPath + '/basepath'; var apiLoad = "/dataserver" + '/basepath';
await axios.get(apiLoad) await axios.get(apiLoad)
.then((response) => { .then((response) => {
this.basePathId = response.data.ObjectVal; this.basePathId = response.data.ObjectVal;
}) })
} }
async getSamplerate(pathId:string) { async getSamplerate(pathId:string) {
var apiLoad = global_.thingPath + '/samplerate/' + pathId; var apiLoad = "/dataserver" + '/samplerate/' + pathId;
await axios.get(apiLoad) await axios.get(apiLoad)
.then((response) => { .then((response) => {
this.sampleId = response.data.ObjectVal; this.sampleId = response.data.ObjectVal;
}) })
} }
async getLength(pathId:string) { async getLength(pathId:string) {
var apiLoad = global_.thingPath + '/length/' + pathId; var apiLoad = "dataserver" + '/length/' + pathId;
await axios.get(apiLoad) await axios.get(apiLoad)
.then((response) => { .then((response) => {
this.lengthId = response.data.ObjectVal; this.lengthId = response.data.ObjectVal;
......
declare module 'vue-svg-gauge' {
import Vue from 'vue';
export class VueSvgGauge extends Vue {}
}
\ No newline at end of file
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