Commit c3b1ae69 authored by WuFeiyang's avatar WuFeiyang

add delete function

parent 08ec76d7
...@@ -39,9 +39,10 @@ ...@@ -39,9 +39,10 @@
:vertical-compact="true" :vertical-compact="true"
:margin="[10, 10]" :margin="[10, 10]"
:use-css-transforms="true" :use-css-transforms="true"
:responsive="true"
> >
<grid-item <grid-item
v-for="(widget) in widgetList" v-for="(widget,index) in widgetList"
:x="widget.x" :x="widget.x"
:y="widget.y" :y="widget.y"
:w="widget.w" :w="widget.w"
...@@ -53,7 +54,7 @@ ...@@ -53,7 +54,7 @@
> >
<div style="border-color: rgb(206, 212, 218);"> <div style="border-color: rgb(206, 212, 218);">
<div class="vue-draggable-handle" style="height:20px;background-color:rgb(0, 123, 255)"></div> <div class="vue-draggable-handle" style="height:20px;background-color:rgb(0, 123, 255)"></div>
<component class="no-drag" :is="widget.widgetComponentName" :ref="widget.ref"></component> <component class="no-drag" :is="widget.widgetComponentName" :ref="widget.ref" :index="index" :widgetList="widgetList" @del="deleteWidget"></component>
</div> </div>
</grid-item> </grid-item>
</grid-layout> </grid-layout>
...@@ -126,6 +127,12 @@ export default class App extends Vue { ...@@ -126,6 +127,12 @@ export default class App extends Vue {
"SlideShow", "SlideShow",
"CardReader" "CardReader"
]; ];
deleteWidget(index:number):void{
console.log("deleteWidget"+index);
this.widgetList.splice(index, 1);
console.log(this.widgetList);
}
toggleShowAddWidget(): void { toggleShowAddWidget(): void {
...@@ -225,7 +232,7 @@ export default class App extends Vue { ...@@ -225,7 +232,7 @@ export default class App extends Vue {
for (var widget of this.widgetList) { for (var widget of this.widgetList) {
((this.$refs[widget.ref] as Array<Widget>)[0] as Widget).parentUpdate(Args);} ((this.$refs[widget.ref] as Array<Widget>)[0] as Widget).parentUpdate(Args);}
}); });
} }
exportActiveWidgetList(): AllWidgetConfig { exportActiveWidgetList(): AllWidgetConfig {
for (var widget of this.widgetList) { for (var widget of this.widgetList) {
......
<template> <template>
<b-container class="bv-example-row"> <b-container class="bv-example-row">
<b-row style="margin-top:10px"> <b-row style="margin-top:10px">
<b-col> <b-col>
<span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname != ''">{{ config.data.displayname }}</span> <span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname != ''">{{ config.data.displayname }}</span>
<span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname == ''">{{ config.data.url }}</span> <span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname == ''">{{ config.data.url }}</span>
<b-form-input v-show="isShowPath" v-model="config.data.displayname"></b-form-input> <b-form-input v-show="isShowPath" v-model="config.data.displayname"></b-form-input>
</b-col> </b-col>
<b-col>
<b-button style="float:right" @click="del" text="Button" variant="outline-primary"><span class="glyphicon glyphicon-remove"></span></b-button>
</b-col>
</b-row>
<b-row style="margin-top:10px">
<b-col> <b-col>
<b-button @click="showPathConfig" variant="primary" style="float:right"> <b-button @click="showPathConfig" variant="primary" style="float:right">
<span class="glyphicon glyphicon-cog"></span> <span class="glyphicon glyphicon-cog"></span>
...@@ -96,6 +105,7 @@ ...@@ -96,6 +105,7 @@
import Vue from "vue"; import Vue from "vue";
import PubSub from 'pubsub-js'; import PubSub from 'pubsub-js';
import { VueSvgGauge } from "vue-svg-gauge"; import { VueSvgGauge } from "vue-svg-gauge";
import { WidgetRef } from "@/models/WidgetRef";
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";
...@@ -117,6 +127,8 @@ import Navigation from "@/components/Common/Navigation.vue"; ...@@ -117,6 +127,8 @@ import Navigation from "@/components/Common/Navigation.vue";
} }
}) })
export default class AutoBroadcast extends Widget { export default class AutoBroadcast extends Widget {
@Prop() index!:number;
@Prop() widgetList:WidgetRef[] = [];
pathProcessor = new PathProcessor(); pathProcessor = new PathProcessor();
strMapObjChange = new StrMapObjChange(); strMapObjChange = new StrMapObjChange();
WidgetComponentName: string = "AutoBroadcast"; WidgetComponentName: string = "AutoBroadcast";
...@@ -155,6 +167,13 @@ export default class AutoBroadcast extends Widget { ...@@ -155,6 +167,13 @@ export default class AutoBroadcast extends Widget {
clearInterval(this.timer); clearInterval(this.timer);
} }
del()
{
this.$emit('del', this.index);
console.log("del"+this.index);
this.destroyed();
}
updateUI() { updateUI() {
this.isShowPath = false; this.isShowPath = false;
this.isShowParams = true; this.isShowParams = true;
......
<template> <template>
<b-container class="bv-example-row"> <b-container class="bv-example-row">
<b-row style="margin-top:10px"> <b-row style="margin-top:10px">
<b-col> <b-col>
<span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname != ''">{{ config.data.displayname }}</span> <span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname != ''">{{ config.data.displayname }}</span>
<span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname == ''">{{ config.data.url }}</span> <span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname == ''">{{ config.data.url }}</span>
<b-form-input v-show="isShowPath" v-model="config.data.displayname"></b-form-input> <b-form-input v-show="isShowPath" v-model="config.data.displayname"></b-form-input>
</b-col> </b-col>
<b-col>
<b-button style="float:right" @click="del" text="Button" variant="outline-primary"><span class="glyphicon glyphicon-remove"></span></b-button>
</b-col>
</b-row>
<b-row style="margin-top:10px">
<b-col> <b-col>
<b-button @click="showPathConfig" variant="primary" style="float:right"> <b-button @click="showPathConfig" variant="primary" style="float:right">
<span class="glyphicon glyphicon-cog"></span> <span class="glyphicon glyphicon-cog"></span>
...@@ -61,6 +68,7 @@ ...@@ -61,6 +68,7 @@
import Vue from "vue"; import Vue from "vue";
import { VueSvgGauge } from "vue-svg-gauge"; import { VueSvgGauge } from "vue-svg-gauge";
import Component from "vue-class-component"; import Component from "vue-class-component";
import { WidgetRef } from "@/models/WidgetRef";
import { Prop, Watch } from "vue-property-decorator"; import { Prop, Watch } from "vue-property-decorator";
import { WidgetConfig } from "@/models/WidgetConfig"; import { WidgetConfig } from "@/models/WidgetConfig";
import { UpdatePayload } from "@/models/UpdatePayload"; import { UpdatePayload } from "@/models/UpdatePayload";
...@@ -81,6 +89,8 @@ import Navigation from "@/components/Common/Navigation.vue"; ...@@ -81,6 +89,8 @@ import Navigation from "@/components/Common/Navigation.vue";
} }
}) })
export default class CardReader extends Widget { export default class CardReader extends Widget {
@Prop() index!:number;
@Prop() widgetList:WidgetRef[] = [];
pathProcessor = new PathProcessor(); pathProcessor = new PathProcessor();
strMapObjChange = new StrMapObjChange(); strMapObjChange = new StrMapObjChange();
WidgetComponentName: string = "CardReader"; WidgetComponentName: string = "CardReader";
...@@ -116,6 +126,12 @@ export default class CardReader extends Widget { ...@@ -116,6 +126,12 @@ export default class CardReader extends Widget {
clearInterval(this.timer); clearInterval(this.timer);
} }
del()
{
this.$emit('del', this.index);
console.log("del"+this.index);
}
updateUI() { updateUI() {
this.isShowPath = false; this.isShowPath = false;
this.isShowParams = true; this.isShowParams = true;
......
<template> <template>
<b-container class="bv-example-row"> <b-container class="bv-example-row">
<b-row style="margin-top:10px">
<b-row style="margin-top:10px">
<b-col> <b-col>
<span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname != ''">{{ config.data.displayname }}</span> <span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname != ''">{{ config.data.displayname }}</span>
<span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname == ''">{{ config.data.get.url }}</span> <span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname == ''">{{ config.data.get.url }}</span>
<b-form-input v-show="isShowPath" v-model="config.data.displayname"></b-form-input> <b-form-input v-show="isShowPath" v-model="config.data.displayname"></b-form-input>
</b-col> </b-col>
<b-col> <b-col>
<b-button style="float:right" @click="del" text="Button" variant="outline-primary"><span class="glyphicon glyphicon-remove"></span></b-button>
</b-col>
</b-row>
<b-row style="margin-top:10px">
<b-col>
<b-button @click="showPathConfig" variant="primary" style="float:right"> <b-button @click="showPathConfig" variant="primary" style="float:right">
<span class="glyphicon glyphicon-cog"></span> <span class="glyphicon glyphicon-cog"></span>
</b-button> </b-button>
...@@ -87,6 +94,7 @@ ...@@ -87,6 +94,7 @@
<script lang="ts"> <script lang="ts">
import Vue from "vue"; import Vue from "vue";
import Component from "vue-class-component"; import Component from "vue-class-component";
import { WidgetRef } from "@/models/WidgetRef";
import { Prop, Watch } from "vue-property-decorator"; import { Prop, Watch } from "vue-property-decorator";
import { WidgetConfig } from "@/models/WidgetConfig"; import { WidgetConfig } from "@/models/WidgetConfig";
import { UpdatePayload } from "@/models/UpdatePayload"; import { UpdatePayload } from "@/models/UpdatePayload";
...@@ -108,6 +116,8 @@ import Navigation from "@/components/Common/Navigation.vue"; ...@@ -108,6 +116,8 @@ import Navigation from "@/components/Common/Navigation.vue";
} }
}) })
export default class Config extends Widget { export default class Config extends Widget {
@Prop() index!:number;
@Prop() widgetList:WidgetRef[] = [];
pathProcessor = new PathProcessor(); pathProcessor = new PathProcessor();
strMapObjChange = new StrMapObjChange(); strMapObjChange = new StrMapObjChange();
WidgetComponentName: string = "Config"; WidgetComponentName: string = "Config";
...@@ -145,6 +155,12 @@ export default class Config extends Widget { ...@@ -145,6 +155,12 @@ export default class Config extends Widget {
); );
} }
del()
{
this.$emit('del', this.index);
console.log("del"+this.index);
}
updateUI() { updateUI() {
this.updateGetUI(); this.updateGetUI();
this.updateSetUI(); this.updateSetUI();
......
<template> <template>
<b-container class="bv-example-row"> <b-container class="bv-example-row">
<b-row style="margin-top:10px"> <b-row style="margin-top:10px">
<b-col> <b-col>
<span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname != ''">{{ config.data.displayname }}</span> <span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname != ''">{{ config.data.displayname }}</span>
<span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname == ''">{{ config.data.url }}</span> <span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname == ''">{{ config.data.url }}</span>
<b-form-input v-show="isShowPath" v-model="config.data.displayname"></b-form-input> <b-form-input v-show="isShowPath" v-model="config.data.displayname"></b-form-input>
</b-col> </b-col>
<b-col>
<b-button style="float:right" @click="del" text="Button" variant="outline-primary"><span class="glyphicon glyphicon-remove"></span></b-button>
</b-col>
</b-row>
<b-row style="margin-top:10px">
<b-col> <b-col>
<b-button @click="showPathConfig" variant="primary" style="float:right"> <b-button @click="showPathConfig" variant="primary" style="float:right">
<span class="glyphicon glyphicon-cog"></span> <span class="glyphicon glyphicon-cog"></span>
...@@ -15,8 +22,6 @@ ...@@ -15,8 +22,6 @@
<br /> <br />
<br />
<b-row> <b-row>
<b-col> <b-col>
<b-input-group size="lg" prepend="path" v-show="isShowPath"> <b-input-group size="lg" prepend="path" v-show="isShowPath">
...@@ -53,6 +58,7 @@ ...@@ -53,6 +58,7 @@
import Vue from "vue"; import Vue from "vue";
import { VueSvgGauge } from "vue-svg-gauge"; import { VueSvgGauge } from "vue-svg-gauge";
import Component from "vue-class-component"; import Component from "vue-class-component";
import { WidgetRef } from "@/models/WidgetRef";
import { Prop, Watch } from "vue-property-decorator"; import { Prop, Watch } from "vue-property-decorator";
import { WidgetConfig } from "@/models/WidgetConfig"; import { WidgetConfig } from "@/models/WidgetConfig";
import { UpdatePayload } from "@/models/UpdatePayload"; import { UpdatePayload } from "@/models/UpdatePayload";
...@@ -73,6 +79,8 @@ import Navigation from "@/components/Common/Navigation.vue"; ...@@ -73,6 +79,8 @@ import Navigation from "@/components/Common/Navigation.vue";
} }
}) })
export default class Method extends Widget { export default class Method extends Widget {
@Prop() index!:number;
@Prop() widgetList:WidgetRef[] = [];
pathProcessor = new PathProcessor(); pathProcessor = new PathProcessor();
strMapObjChange = new StrMapObjChange(); strMapObjChange = new StrMapObjChange();
WidgetComponentName: string = "Method"; WidgetComponentName: string = "Method";
...@@ -109,6 +117,12 @@ export default class Method extends Widget { ...@@ -109,6 +117,12 @@ export default class Method extends Widget {
); );
} }
del()
{
this.$emit('del', this.index);
console.log("del"+this.index);
}
showPathConfig() { showPathConfig() {
this.isShowPath = !this.isShowPath; this.isShowPath = !this.isShowPath;
} }
......
<template> <template>
<b-container class="bv-example-row"> <b-container class="bv-example-row">
<b-row style="margin-top:10px"> <b-row style="margin-top:10px">
<b-col> <b-col>
<span style="float:left;" size="lg" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname != ''">{{ config.data.displayname }}</span> <span style="float:left;" size="lg" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname != ''">{{ config.data.displayname }}</span>
<span style="float:left;" size="lg" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname == ''">{{ config.data.url }}</span> <span style="float:left;" size="lg" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname == ''">{{ config.data.url }}</span>
<b-form-input v-show="isShowPath" v-model="config.data.displayname"></b-form-input> <b-form-input v-show="isShowPath" v-model="config.data.displayname"></b-form-input>
</b-col> </b-col>
<b-col>
<b-button style="float:right" @click="del" text="Button" variant="outline-primary"><span class="glyphicon glyphicon-remove"></span></b-button>
</b-col>
</b-row>
<b-row style="margin-top:10px">
<b-col> <b-col>
<b-button @click="showPathConfig" variant="primary" style="float:right"> <b-button @click="showPathConfig" variant="primary" style="float:right">
<span class="glyphicon glyphicon-cog"></span> <span class="glyphicon glyphicon-cog"></span>
...@@ -76,12 +83,14 @@ ...@@ -76,12 +83,14 @@
<script lang="ts"> <script lang="ts">
import Vue from "vue"; import Vue from "vue";
import PubSub from 'pubsub-js';
import { VueSvgGauge } from "vue-svg-gauge"; 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";
import { UpdatePayload } from "@/models/UpdatePayload"; import { UpdatePayload } from "@/models/UpdatePayload";
import { Widget } from "@/models/widget"; import { Widget } from "@/models/widget";
import { WidgetRef } from "@/models/WidgetRef";
import { ResourceInfo } from "@/models/Customview"; import { ResourceInfo } from "@/models/Customview";
import WidgetParams from "@/components/Common/WidgetParams.vue"; import WidgetParams from "@/components/Common/WidgetParams.vue";
import axios from "axios"; import axios from "axios";
...@@ -98,6 +107,8 @@ import Navigation from "@/components/Common/Navigation.vue"; ...@@ -98,6 +107,8 @@ import Navigation from "@/components/Common/Navigation.vue";
} }
}) })
export default class SlideShow extends Widget { export default class SlideShow extends Widget {
@Prop() index!:number;
@Prop() widgetList:WidgetRef[] = [];
pathProcessor = new PathProcessor(); pathProcessor = new PathProcessor();
strMapObjChange = new StrMapObjChange(); strMapObjChange = new StrMapObjChange();
WidgetComponentName: string = "SlideShow"; WidgetComponentName: string = "SlideShow";
...@@ -138,6 +149,12 @@ export default class SlideShow extends Widget { ...@@ -138,6 +149,12 @@ export default class SlideShow extends Widget {
console.log(this.timer); console.log(this.timer);
} }
del()
{
this.$emit('del', this.index);
console.log("del"+this.index);
}
turnLastImg() turnLastImg()
{ {
if(this.isPause == true && this.currentImgIndex >= 0) if(this.isPause == true && this.currentImgIndex >= 0)
......
<template> <template>
<b-container class="bv-example-row"> <b-container class="bv-example-row">
<b-row style="margin-top:10px"> <b-row style="margin-top:10px">
<b-col> <b-col>
<span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname != ''">{{ config.data.displayname }}</span> <span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname != ''">{{ config.data.displayname }}</span>
<span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname == ''">{{ config.data.url }}</span> <span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname == ''">{{ config.data.url }}</span>
<b-form-input v-show="isShowPath" v-model="config.data.displayname"></b-form-input> <b-form-input v-show="isShowPath" v-model="config.data.displayname"></b-form-input>
</b-col> </b-col>
<b-col>
<b-button style="float:right" @click="del" text="Button" variant="outline-primary"><span class="glyphicon glyphicon-remove"></span></b-button>
</b-col>
</b-row>
<b-row style="margin-top:10px">
<b-col> <b-col>
<b-button @click="showPathConfig" variant="primary" style="float:right"> <b-button @click="showPathConfig" variant="primary" style="float:right">
<span class="glyphicon glyphicon-cog"></span> <span class="glyphicon glyphicon-cog"></span>
...@@ -69,6 +76,7 @@ import { WidgetConfig } from "@/models/WidgetConfig"; ...@@ -69,6 +76,7 @@ import { WidgetConfig } from "@/models/WidgetConfig";
import { UpdatePayload } from "@/models/UpdatePayload"; import { UpdatePayload } from "@/models/UpdatePayload";
import { Widget } from "@/models/widget"; import { Widget } from "@/models/widget";
import { ResourceInfo } from "@/models/Customview"; import { ResourceInfo } from "@/models/Customview";
import { WidgetRef } from "@/models/WidgetRef";
import WidgetParams from "@/components/Common/WidgetParams.vue"; import WidgetParams from "@/components/Common/WidgetParams.vue";
import axios from "axios"; import axios from "axios";
import PathProcessor from "@/models/PathProcessor"; import PathProcessor from "@/models/PathProcessor";
...@@ -84,6 +92,8 @@ import Navigation from "@/components/Common/Navigation.vue"; ...@@ -84,6 +92,8 @@ import Navigation from "@/components/Common/Navigation.vue";
} }
}) })
export default class State extends Widget { export default class State extends Widget {
@Prop() index!:number;
@Prop() widgetList:WidgetRef[] = [];
pathProcessor = new PathProcessor(); pathProcessor = new PathProcessor();
strMapObjChange = new StrMapObjChange(); strMapObjChange = new StrMapObjChange();
WidgetComponentName: string = "State"; WidgetComponentName: string = "State";
...@@ -120,6 +130,12 @@ export default class State extends Widget { ...@@ -120,6 +130,12 @@ export default class State extends Widget {
clearInterval(this.timer); clearInterval(this.timer);
} }
del()
{
this.$emit('del', this.index);
console.log("del"+this.index);
}
updateUI() { updateUI() {
this.isShowPath = false; this.isShowPath = false;
this.isShowParams = true; this.isShowParams = true;
......
...@@ -6,6 +6,12 @@ ...@@ -6,6 +6,12 @@
<span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname == ''">{{ config.data.url }}</span> <span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname == ''">{{ config.data.url }}</span>
<b-form-input v-show="isShowPath" v-model="config.data.displayname"></b-form-input> <b-form-input v-show="isShowPath" v-model="config.data.displayname"></b-form-input>
</b-col> </b-col>
<b-col>
<b-button style="float:right" @click="del" text="Button" variant="outline-primary"><span class="glyphicon glyphicon-remove"></span></b-button>
</b-col>
</b-row>
<b-row style="margin-top:10px">
<b-col> <b-col>
<b-button @click="showPathConfig" variant="primary" style="float:right"> <b-button @click="showPathConfig" variant="primary" style="float:right">
<span class="glyphicon glyphicon-cog"></span> <span class="glyphicon glyphicon-cog"></span>
...@@ -69,6 +75,7 @@ import { UpdatePayload } from "@/models/UpdatePayload"; ...@@ -69,6 +75,7 @@ import { UpdatePayload } from "@/models/UpdatePayload";
import { Widget } from "@/models/widget"; import { Widget } from "@/models/widget";
import { ResourceInfo } from "@/models/Customview"; import { ResourceInfo } from "@/models/Customview";
import WidgetParams from "@/components/Common/WidgetParams.vue"; import WidgetParams from "@/components/Common/WidgetParams.vue";
import { WidgetRef } from "@/models/WidgetRef";
import axios from "axios"; import axios from "axios";
import PathProcessor from "@/models/PathProcessor"; import PathProcessor from "@/models/PathProcessor";
import StrMapObjChange from "@/models/StrMapObjChange"; import StrMapObjChange from "@/models/StrMapObjChange";
...@@ -83,6 +90,8 @@ import Navigation from "@/components/Common/Navigation.vue"; ...@@ -83,6 +90,8 @@ import Navigation from "@/components/Common/Navigation.vue";
} }
}) })
export default class Status extends Widget { export default class Status extends Widget {
@Prop() index!:number;
@Prop() widgetList:WidgetRef[] = [];
pathProcessor = new PathProcessor(); pathProcessor = new PathProcessor();
strMapObjChange = new StrMapObjChange(); strMapObjChange = new StrMapObjChange();
WidgetComponentName: string = "Status"; WidgetComponentName: string = "Status";
...@@ -118,6 +127,12 @@ export default class Status extends Widget { ...@@ -118,6 +127,12 @@ export default class Status extends Widget {
clearInterval(this.timer); clearInterval(this.timer);
} }
del()
{
this.$emit('del', this.index);
console.log("del"+this.index);
}
updateUI() { updateUI() {
this.isShowPath = false; this.isShowPath = false;
this.isShowParams = true; this.isShowParams = true;
......
<template> <template>
<b-container class="bv-example-row"> <b-container class="bv-example-row">
<b-row style="margin-top:10px"> <b-row style="margin-top:10px">
<b-col> <b-col>
<span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname != ''">{{ config.data.displayname }}</span> <span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname != ''">{{ config.data.displayname }}</span>
...@@ -7,23 +8,17 @@ ...@@ -7,23 +8,17 @@
<b-form-input v-show="isShowPath" v-model="config.data.displayname"></b-form-input> <b-form-input v-show="isShowPath" v-model="config.data.displayname"></b-form-input>
</b-col> </b-col>
<b-col> <b-col>
<b-button @click="showPathConfig" variant="primary" style="float:right"> <b-button style="float:right" @click="del" text="Button" variant="outline-primary"><span class="glyphicon glyphicon-remove"></span></b-button>
<span class="glyphicon glyphicon-cog"></span>
</b-button>
</b-col> </b-col>
</b-row> </b-row>
<br /> <b-row style="margin-top:10px">
<!-- <b-row>
<b-col> <b-col>
<div <b-button @click="showPathConfig" variant="primary" style="float:right">
style="width:100%;overflow:auto;border-style: solid; border-width: 1px;" <span class="glyphicon glyphicon-cog"></span>
> </b-button>
<p style="float:left;margin:0px" class="largeFont">{{ StatusValue }}</p>
</div>
</b-col> </b-col>
</b-row> --> </b-row>
<br /> <br />
...@@ -68,6 +63,7 @@ import { WidgetConfig } from "@/models/WidgetConfig"; ...@@ -68,6 +63,7 @@ import { WidgetConfig } from "@/models/WidgetConfig";
import { UpdatePayload } from "@/models/UpdatePayload"; import { UpdatePayload } from "@/models/UpdatePayload";
import { Widget } from "@/models/widget"; import { Widget } from "@/models/widget";
import { ResourceInfo } from "@/models/Customview"; import { ResourceInfo } from "@/models/Customview";
import { WidgetRef } from "@/models/WidgetRef";
import WidgetParams from "@/components/Common/WidgetParams.vue"; import WidgetParams from "@/components/Common/WidgetParams.vue";
import axios from "axios"; import axios from "axios";
import PathProcessor from "@/models/PathProcessor"; import PathProcessor from "@/models/PathProcessor";
...@@ -83,6 +79,8 @@ import Navigation from "@/components/Common/Navigation.vue"; ...@@ -83,6 +79,8 @@ import Navigation from "@/components/Common/Navigation.vue";
} }
}) })
export default class Thing extends Widget { export default class Thing extends Widget {
@Prop() index!:number;
@Prop() widgetList:WidgetRef[] = [];
pathProcessor = new PathProcessor(); pathProcessor = new PathProcessor();
strMapObjChange = new StrMapObjChange(); strMapObjChange = new StrMapObjChange();
WidgetComponentName: string = "Thing"; WidgetComponentName: string = "Thing";
...@@ -110,13 +108,11 @@ export default class Thing extends Widget { ...@@ -110,13 +108,11 @@ export default class Thing extends Widget {
); );
} }
// mounted() { del()
// this.timer = setInterval(this.refresh, 1000); {
// } this.$emit('del', this.index);
console.log("del"+this.index);
// destroyed() { }
// clearInterval(this.timer);
// }
updateUI() { updateUI() {
this.isShowPath = false; this.isShowPath = false;
......
<template> <template>
<b-container class="bv-example-row"> <b-container class="bv-example-row">
<b-row style="margin-top:10px"> <b-row style="margin-top:10px">
<b-col> <b-col>
<span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname != ''">{{ config.data.displayname }}</span> <span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname != ''">{{ config.data.displayname }}</span>
<span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname == ''">{{ config.data.url }}</span> <span style="float:left;" v-show = "!isShowPath" class="largeFont" v-if = "config.data.displayname == ''">{{ config.data.url }}</span>
<b-form-input v-show="isShowPath" v-model="config.data.displayname"></b-form-input> <b-form-input v-show="isShowPath" v-model="config.data.displayname"></b-form-input>
</b-col> </b-col>
<b-col>
<b-button style="float:right" @click="del" text="Button" variant="outline-primary"><span class="glyphicon glyphicon-remove"></span></b-button>
</b-col>
</b-row>
<b-row style="margin-top:10px">
<b-col> <b-col>
<b-button @click="showPathConfig" variant="primary" style="float:right"> <b-button @click="showPathConfig" variant="primary" style="float:right">
<span class="glyphicon glyphicon-cog"></span> <span class="glyphicon glyphicon-cog"></span>
...@@ -50,6 +57,7 @@ import { Prop, Watch } from "vue-property-decorator"; ...@@ -50,6 +57,7 @@ import { Prop, Watch } from "vue-property-decorator";
import { WidgetConfig } from "@/models/WidgetConfig"; import { WidgetConfig } from "@/models/WidgetConfig";
import { UpdatePayload } from "@/models/UpdatePayload"; import { UpdatePayload } from "@/models/UpdatePayload";
import { Widget } from "@/models/widget"; import { Widget } from "@/models/widget";
import { WidgetRef } from "@/models/WidgetRef";
import { ResourceInfo } from "@/models/Customview"; import { ResourceInfo } from "@/models/Customview";
import WidgetParams from "@/components/Common/WidgetParams.vue"; import WidgetParams from "@/components/Common/WidgetParams.vue";
import axios from "axios"; import axios from "axios";
...@@ -66,6 +74,8 @@ import Navigation from "@/components/Common/Navigation.vue"; ...@@ -66,6 +74,8 @@ import Navigation from "@/components/Common/Navigation.vue";
} }
}) })
export default class VarBroadcast extends Widget { export default class VarBroadcast extends Widget {
@Prop() index!:number;
@Prop() widgetList:WidgetRef[] = [];
pathProcessor = new PathProcessor(); pathProcessor = new PathProcessor();
strMapObjChange = new StrMapObjChange(); strMapObjChange = new StrMapObjChange();
WidgetComponentName: string = "VarBroadcast"; WidgetComponentName: string = "VarBroadcast";
...@@ -92,6 +102,12 @@ export default class VarBroadcast extends Widget { ...@@ -92,6 +102,12 @@ export default class VarBroadcast extends Widget {
); );
} }
del()
{
this.$emit('del', this.index);
console.log("del"+this.index);
}
updateUI() { updateUI() {
this.isShowPath = false; this.isShowPath = false;
this.isShowParams = true; this.isShowParams = true;
......
<template> <template>
<div class="waveView"> <div class="waveView">
<div style="margin-top:10px">
<b-button style="float:right" @click="del" text="Button" variant="outline-primary"><span class="glyphicon glyphicon-remove"></span></b-button>
</div>
<br/>
<showViewInfo ref="showViewInfo" :pathId="pathId" @showPathIdConfig="showPathIdConfig"></showViewInfo> <showViewInfo ref="showViewInfo" :pathId="pathId" @showPathIdConfig="showPathIdConfig"></showViewInfo>
<div ref="wave"> <div ref="wave">
...@@ -19,6 +23,7 @@ import { Prop, Watch } from 'vue-property-decorator'; ...@@ -19,6 +23,7 @@ import { Prop, Watch } from 'vue-property-decorator';
import { WidgetConfig } from '@/models/WidgetConfig'; import { WidgetConfig } from '@/models/WidgetConfig';
import { UpdatePayload } from '@/models/UpdatePayload'; import { UpdatePayload } from '@/models/UpdatePayload';
import { Widget } from '@/models/widget'; import { Widget } from '@/models/widget';
import { WidgetRef } from "@/models/WidgetRef";
import StrMapObjChange from "@/models/StrMapObjChange"; import StrMapObjChange from "@/models/StrMapObjChange";
import { ResourceInfo } from "@/models/Customview"; import { ResourceInfo } from "@/models/Customview";
import axios from "axios"; import axios from "axios";
...@@ -32,6 +37,8 @@ import axios from "axios"; ...@@ -32,6 +37,8 @@ import axios from "axios";
} }
}) })
export default class waveView extends Widget { export default class waveView extends Widget {
@Prop() index!:number;
@Prop() widgetList:WidgetRef[] = [];
WidgetComponentName: string = 'waveView'; WidgetComponentName: string = 'waveView';
wave: any = ''; wave: any = '';
pathId: string = ''; pathId: string = '';
...@@ -55,6 +62,12 @@ export default class waveView extends Widget { ...@@ -55,6 +62,12 @@ export default class waveView extends Widget {
} }
}; };
del()
{
this.$emit('del', this.index);
console.log("del"+this.index);
}
getConfig(): WidgetConfig { getConfig(): WidgetConfig {
(this.$refs.setBasicParams as setBasicParams).updateUserInputData(); (this.$refs.setBasicParams as setBasicParams).updateUserInputData();
return this.config; return this.config;
......
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