Commit 4755e8ea authored by WuFeiyang's avatar WuFeiyang

加了一个 thing widget

parent 1e9ad804
......@@ -58,12 +58,14 @@ import { WidgetRef } from "./models/WidgetRef";
import { WidgetConfig, AllWidgetConfig } from "./models/WidgetConfig";
import { Action, UpdatePayload } from "./models/UpdatePayload";
import { Widget } from "./models/wiget";
import { Actions } from "./models/customview";
//when add more available widgets add ref to the widgets
import Status from "./components/Status/Status.vue";
import WaveView from "./components/WaveView/WaveView.vue";
import Method from "./components/Method/Method.vue";
import Config from "./components/Config/Config.vue";
import Thing from "./components/Thing/Thing.vue";
//this is the view selecotr class
@Component({
......@@ -73,6 +75,7 @@ import Config from "./components/Config/Config.vue";
WaveView,
Method,
Config,
Thing,
GridLayout,
GridItem
}
......@@ -85,7 +88,7 @@ export default class App extends Vue {
text: string = "";
//when add more available widgets add its name here
availableWidgets = ["Status", "Config", "WaveView", "Method"];
availableWidgets = ["Status", "Config", "WaveView", "Method","Thing"];
toggleShowAddWidget(): void {
this.isShowAddWidget = !this.isShowAddWidget;
......@@ -94,7 +97,7 @@ export default class App extends Vue {
UIGenerateAutomatic() {
// var fragment = window.location.hash;
var fragment = "#/card";
var fragment = "#/dataserver/DataByTimeFuzzy";
if (fragment != "#") {
fragment = fragment.substring(1,fragment.length);
var customViewURL = "customView/template" + fragment;
......@@ -104,8 +107,8 @@ export default class App extends Vue {
//直接访问对应的值
var dataURL = fragment;
axios.get(fragment).then(response => {
}
console.log(response.data.Actions);
})
}
else{
//返回有值的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 {
public CFET2CORE_SAMPLE_RESOURCETYPE: any;
public CFET2CORE_SAMPLE_VAL: any;
public CFET2CORE_SAMPLE_PATH: any;
public CFET2CORE_SAMPLE_ISREMOTE: any;
public CFET2CORE_SAMPLE_ISVALID: any;
public CFET2CORE_SAMPLE_ERRORMESSAGE: any;
export interface ResourceInfo {
Parameters: any;
OutputType: any;
}
export class Actions {
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