Commit 4755e8ea authored by WuFeiyang's avatar WuFeiyang

加了一个 thing widget

parent 1e9ad804
...@@ -58,12 +58,14 @@ import { WidgetRef } from "./models/WidgetRef"; ...@@ -58,12 +58,14 @@ import { WidgetRef } from "./models/WidgetRef";
import { WidgetConfig, AllWidgetConfig } from "./models/WidgetConfig"; import { WidgetConfig, AllWidgetConfig } from "./models/WidgetConfig";
import { Action, UpdatePayload } from "./models/UpdatePayload"; import { Action, UpdatePayload } from "./models/UpdatePayload";
import { Widget } from "./models/wiget"; import { Widget } from "./models/wiget";
import { Actions } from "./models/customview";
//when add more available widgets add ref to the widgets //when add more available widgets add ref to the widgets
import Status from "./components/Status/Status.vue"; import Status from "./components/Status/Status.vue";
import WaveView from "./components/WaveView/WaveView.vue"; import WaveView from "./components/WaveView/WaveView.vue";
import Method from "./components/Method/Method.vue"; import Method from "./components/Method/Method.vue";
import Config from "./components/Config/Config.vue"; import Config from "./components/Config/Config.vue";
import Thing from "./components/Thing/Thing.vue";
//this is the view selecotr class //this is the view selecotr class
@Component({ @Component({
...@@ -73,6 +75,7 @@ import Config from "./components/Config/Config.vue"; ...@@ -73,6 +75,7 @@ import Config from "./components/Config/Config.vue";
WaveView, WaveView,
Method, Method,
Config, Config,
Thing,
GridLayout, GridLayout,
GridItem GridItem
} }
...@@ -85,7 +88,7 @@ export default class App extends Vue { ...@@ -85,7 +88,7 @@ export default class App extends Vue {
text: string = ""; text: string = "";
//when add more available widgets add its name here //when add more available widgets add its name here
availableWidgets = ["Status", "Config", "WaveView", "Method"]; availableWidgets = ["Status", "Config", "WaveView", "Method","Thing"];
toggleShowAddWidget(): void { toggleShowAddWidget(): void {
this.isShowAddWidget = !this.isShowAddWidget; this.isShowAddWidget = !this.isShowAddWidget;
...@@ -94,7 +97,7 @@ export default class App extends Vue { ...@@ -94,7 +97,7 @@ export default class App extends Vue {
UIGenerateAutomatic() { UIGenerateAutomatic() {
// var fragment = window.location.hash; // var fragment = window.location.hash;
var fragment = "#/card"; var fragment = "#/dataserver/DataByTimeFuzzy";
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;
...@@ -104,8 +107,8 @@ export default class App extends Vue { ...@@ -104,8 +107,8 @@ export default class App extends Vue {
//直接访问对应的值 //直接访问对应的值
var dataURL = fragment; var dataURL = fragment;
axios.get(fragment).then(response => { axios.get(fragment).then(response => {
console.log(response.data.Actions);
} })
} }
else{ else{
//返回有值的customview template,进行load处理 //返回有值的customview template,进行load处理
......
<template>
<b-container class="bv-example-row">
<b-row style="margin-top:10px">
<b-col>
<span style="float:left;font-size:20px">path: {{ config.data.url }}</span>
</b-col>
</b-row>
</b-container>
</template>
<script lang="ts">
import Vue from "vue";
import Component from "vue-class-component";
import { Prop, Watch } from "vue-property-decorator";
import { WidgetConfig } from "@/models/WidgetConfig";
import { UpdatePayload } from "@/models/UpdatePayload";
import { Widget } from "@/models/wiget";
export default class Thing extends Widget {
WidgetComponentName: string = "Thing";
config: WidgetConfig = {
WidgetComponentName: "Thing",
data: {
url: ""
}
};
getConfig(): WidgetConfig {
return this.config;
}
setConfig(widgetConfig: WidgetConfig): void {
this.config = widgetConfig;
}
replaceStartPath(startPath:string):void
{
this.config.data.url.replace('$startPath$', startPath);
}
parentUpdate(payload: UpdatePayload): void {
}
refresh() {
}
updateUI(){
}
}
</script>
<style scoped>
.waveView {
width: 100%;
height: auto;
}
</style>
\ No newline at end of file
export class CustomViewConfig { export interface ResourceInfo {
public CFET2CORE_SAMPLE_RESOURCETYPE: any; Parameters: any;
public CFET2CORE_SAMPLE_VAL: any; OutputType: any;
public CFET2CORE_SAMPLE_PATH: any; }
public CFET2CORE_SAMPLE_ISREMOTE: any;
public CFET2CORE_SAMPLE_ISVALID: any; export class Actions {
public CFET2CORE_SAMPLE_ERRORMESSAGE: any; public action?:{[key: string]: ResourceInfo};
} }
\ 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