Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
W
WidgetUI
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
WuFeiyang
WidgetUI
Commits
ff152bde
Commit
ff152bde
authored
Oct 24, 2019
by
WuFeiyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
varBroadcast
parent
8202bda1
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
27 deletions
+42
-27
src/App.vue
src/App.vue
+13
-2
src/components/AutoBroadcast/AutoBroadcast.vue
src/components/AutoBroadcast/AutoBroadcast.vue
+1
-1
src/components/Status/Status.vue
src/components/Status/Status.vue
+24
-1
src/components/VarBroadcast/VarBroadcast.vue
src/components/VarBroadcast/VarBroadcast.vue
+3
-22
src/models/widget.ts
src/models/widget.ts
+1
-1
No files found.
src/App.vue
View file @
ff152bde
...
@@ -82,6 +82,7 @@ import Method from "./components/Method/Method.vue";
...
@@ -82,6 +82,7 @@ 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
"
;
import
Thing
from
"
./components/Thing/Thing.vue
"
;
import
State
from
"
./components/State/State.vue
"
;
import
State
from
"
./components/State/State.vue
"
;
import
VarBroadcast
from
"
./components/VarBroadcast/VarBroadcast.vue
"
;
// import Gauge from "./components/Gauge/Gauge.vue";
// import Gauge from "./components/Gauge/Gauge.vue";
//this is the view selecotr class
//this is the view selecotr class
...
@@ -95,7 +96,8 @@ import State from "./components/State/State.vue";
...
@@ -95,7 +96,8 @@ import State from "./components/State/State.vue";
Thing
,
Thing
,
GridLayout
,
GridLayout
,
GridItem
,
GridItem
,
State
State
,
VarBroadcast
}
}
})
})
export
default
class
App
extends
Vue
{
export
default
class
App
extends
Vue
{
...
@@ -112,7 +114,8 @@ export default class App extends Vue {
...
@@ -112,7 +114,8 @@ export default class App extends Vue {
"
WaveView
"
,
"
WaveView
"
,
"
Method
"
,
"
Method
"
,
"
Thing
"
,
"
Thing
"
,
"
State
"
"
State
"
,
"
VarBroadcast
"
];
];
toggleShowAddWidget
():
void
{
toggleShowAddWidget
():
void
{
...
@@ -206,6 +209,14 @@ export default class App extends Vue {
...
@@ -206,6 +209,14 @@ export default class App extends Vue {
this
.
dataAccess
(
dataURL
);
this
.
dataAccess
(
dataURL
);
});
});
}
}
PubSub
.
subscribe
(
"
VarBroadcast
"
,(
messageName
,
Args
)
=>
{
console
.
log
(
Args
);
//接收到消息调用全部widget的parentUpdate函数
for
(
var
widget
of
this
.
widgetList
)
{
((
this
.
$refs
[
widget
.
ref
]
as
Array
<
Widget
>
)[
0
]
as
Widget
).
parentUpdate
(
Args
);}
console
.
log
(
this
.
$refs
[
widget
.
ref
]);
});
}
}
exportActiveWidgetList
():
AllWidgetConfig
{
exportActiveWidgetList
():
AllWidgetConfig
{
...
...
src/components/AutoBroadcast/AutoBroadcast.vue
View file @
ff152bde
...
@@ -80,7 +80,7 @@ import Navigation from "@/components/Common/Navigation.vue";
...
@@ -80,7 +80,7 @@ import Navigation from "@/components/Common/Navigation.vue";
Navigation
Navigation
}
}
})
})
export
default
class
VarBroadcast
extends
Widget
{
export
default
class
Status
extends
Widget
{
pathProcessor
=
new
PathProcessor
();
pathProcessor
=
new
PathProcessor
();
strMapObjChange
=
new
StrMapObjChange
();
strMapObjChange
=
new
StrMapObjChange
();
WidgetComponentName
:
string
=
"
Status
"
;
WidgetComponentName
:
string
=
"
Status
"
;
...
...
src/components/Status/Status.vue
View file @
ff152bde
...
@@ -192,7 +192,30 @@ export default class Status extends Widget {
...
@@ -192,7 +192,30 @@ export default class Status extends Widget {
this
.
config
.
data
.
url
.
replace
(
"
$startPath$
"
,
startPath
);
this
.
config
.
data
.
url
.
replace
(
"
$startPath$
"
,
startPath
);
}
}
parentUpdate
(
payload
:
UpdatePayload
):
void
{}
parentUpdate
(
payload
:
UpdatePayload
):
void
{
this
.
userInputData
=
this
.
strMapObjChange
.
strMapToObj
(
(
this
.
$refs
.
WidgetParams
as
WidgetParams
).
getVariableValues
());
var
temp
=
this
.
userInputData
;
temp
=
JSON
.
parse
(
JSON
.
stringify
(
temp
));
temp
=
this
.
strMapObjChange
.
objToStrMap
(
temp
);
this
.
userInputData
=
temp
;
console
.
log
(
this
.
userInputData
);
console
.
log
(
payload
.
variables
);
this
.
userInputData
.
forEach
((
value
,
key
)
=>
{
console
.
log
(
"
进来了
"
);
console
.
log
(
key
);
payload
.
variables
.
forEach
((
valueofpayload
,
keyofpayload
)
=>
{
console
.
log
(
key
);
console
.
log
(
keyofpayload
);
if
(
key
==
keyofpayload
)
{
this
.
userInputData
.
set
(
key
,
payload
.
variables
.
get
(
keyofpayload
)
as
string
);
}
});
});
(
this
.
$refs
.
WidgetParams
as
WidgetParams
).
setVariableInput
(
this
.
userInputData
);
this
.
updateUI
();
}
refresh
()
{
refresh
()
{
var
Args
:
UpdatePayload
=
{
var
Args
:
UpdatePayload
=
{
...
...
src/components/VarBroadcast/VarBroadcast.vue
View file @
ff152bde
...
@@ -13,18 +13,6 @@
...
@@ -13,18 +13,6 @@
<br
/>
<br
/>
<b-row>
<b-col>
<div
style=
"width:100%;overflow:auto;border-style: solid; border-width: 1px;"
>
<p
style=
"float:left;margin:0px"
class=
"largeFont"
>
{{
StatusValue
}}
</p>
</div>
</b-col>
</b-row>
<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"
>
...
@@ -78,7 +66,7 @@ import Navigation from "@/components/Common/Navigation.vue";
...
@@ -78,7 +66,7 @@ import Navigation from "@/components/Common/Navigation.vue";
export
default
class
VarBroadcast
extends
Widget
{
export
default
class
VarBroadcast
extends
Widget
{
pathProcessor
=
new
PathProcessor
();
pathProcessor
=
new
PathProcessor
();
strMapObjChange
=
new
StrMapObjChange
();
strMapObjChange
=
new
StrMapObjChange
();
WidgetComponentName
:
string
=
"
Status
"
;
WidgetComponentName
:
string
=
"
VarBroadcast
"
;
StatusValue
:
string
=
""
;
StatusValue
:
string
=
""
;
pathId
:
string
=
""
;
pathId
:
string
=
""
;
userInputData
=
new
Map
<
string
,
string
>
();
userInputData
=
new
Map
<
string
,
string
>
();
...
@@ -88,7 +76,7 @@ export default class VarBroadcast extends Widget {
...
@@ -88,7 +76,7 @@ export default class VarBroadcast extends Widget {
isShowParams
:
boolean
=
false
;
isShowParams
:
boolean
=
false
;
config
:
WidgetConfig
=
{
config
:
WidgetConfig
=
{
WidgetComponentName
:
"
Status
"
,
WidgetComponentName
:
"
VarBroadcast
"
,
data
:
{
data
:
{
url
:
""
,
url
:
""
,
userInputData
:
""
userInputData
:
""
...
@@ -101,14 +89,6 @@ export default class VarBroadcast extends Widget {
...
@@ -101,14 +89,6 @@ export default class VarBroadcast extends Widget {
);
);
}
}
mounted
()
{
this
.
timer
=
setInterval
(
this
.
refresh
,
1000
);
}
destroyed
()
{
clearInterval
(
this
.
timer
);
}
updateUI
()
{
updateUI
()
{
this
.
isShowPath
=
false
;
this
.
isShowPath
=
false
;
this
.
isShowParams
=
true
;
this
.
isShowParams
=
true
;
...
@@ -220,6 +200,7 @@ export default class VarBroadcast extends Widget {
...
@@ -220,6 +200,7 @@ export default class VarBroadcast extends Widget {
viewLoad
(
Args
:
UpdatePayload
)
{
viewLoad
(
Args
:
UpdatePayload
)
{
// this.config.data.userInputData = Args.variables;
// this.config.data.userInputData = Args.variables;
PubSub
.
publish
(
'
VarBroadcast
'
,
Args
);
PubSub
.
publish
(
'
VarBroadcast
'
,
Args
);
console
.
log
(
Args
);
}
}
}
}
</
script
>
</
script
>
...
...
src/models/widget.ts
View file @
ff152bde
...
@@ -13,7 +13,7 @@ export abstract class Widget extends Vue {
...
@@ -13,7 +13,7 @@ export abstract class Widget extends Vue {
public
WidgetComponentName
?:
string
;
public
WidgetComponentName
?:
string
;
public
abstract
setConfig
(
wid
:
WidgetConfig
):
void
;
public
abstract
setConfig
(
wid
:
WidgetConfig
):
void
;
public
abstract
getConfig
():
WidgetConfig
;
public
abstract
getConfig
():
WidgetConfig
;
public
abstract
parentUpdate
(
paylo
s
d
:
UpdatePayload
):
void
;
public
abstract
parentUpdate
(
paylo
a
d
:
UpdatePayload
):
void
;
public
abstract
refresh
():
void
;
public
abstract
refresh
():
void
;
public
abstract
updateUI
():
void
;
public
abstract
updateUI
():
void
;
public
abstract
replaceStartPath
(
startPath
:
string
):
void
;
public
abstract
replaceStartPath
(
startPath
:
string
):
void
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment