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
4755e8ea
Commit
4755e8ea
authored
Sep 18, 2019
by
WuFeiyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加了一个 thing widget
parent
1e9ad804
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
11 deletions
+76
-11
src/App.vue
src/App.vue
+7
-4
src/components/Thing/Thing.vue
src/components/Thing/Thing.vue
+62
-0
src/models/customview.ts
src/models/customview.ts
+7
-7
No files found.
src/App.vue
View file @
4755e8ea
...
@@ -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处理
...
...
src/components/Thing/Thing.vue
0 → 100644
View file @
4755e8ea
<
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
src/models/customview.ts
View file @
4755e8ea
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
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