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
ca847332
Commit
ca847332
authored
Sep 21, 2019
by
WuFeiyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
还差nivigation和样式
parent
32825d74
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
125 additions
and
95 deletions
+125
-95
src/components/Common/Navigation.vue
src/components/Common/Navigation.vue
+15
-8
src/components/Common/WidgetParams.vue
src/components/Common/WidgetParams.vue
+3
-3
src/components/Config/Config.vue
src/components/Config/Config.vue
+4
-4
src/components/Method/Method.vue
src/components/Method/Method.vue
+2
-2
src/components/State/State.vue
src/components/State/State.vue
+5
-6
src/components/Status/Status.vue
src/components/Status/Status.vue
+10
-10
src/components/Thing/Thing.vue
src/components/Thing/Thing.vue
+4
-0
src/components/WaveView/WaveView.vue
src/components/WaveView/WaveView.vue
+31
-29
src/components/WaveView/setBasicParams.vue
src/components/WaveView/setBasicParams.vue
+32
-20
src/components/WaveView/showViewInfo.vue
src/components/WaveView/showViewInfo.vue
+19
-13
No files found.
src/components/Common/Navigation.vue
View file @
ca847332
<
template
id=
"setBasicParams"
>
<div>
<b-dropdown
id=
"dropdown-1"
text=
"Navigation"
variant=
"primary"
>
<b-dropdown-item
v-show=
"isShowParentPath"
>
<br>
<b-button
variant=
"primary"
class=
"smallFont"
@
click=
"showNavigation"
style=
"float:right"
>
Navigation
</b-button>
<br>
<div
v-show=
"isShowNavigation&&isShowParentPath"
>
<a
class=
"smallFont"
:href=
"parentPath"
style=
"float:left"
>
parentPath:
{{
parentPath
}}
</a>
</b-dropdown-item
>
<b-dropdown-item
v-for=
"path in childrenPath"
:key=
"path
"
>
</div
>
<div
v-show=
"isShowNavigation"
v-for=
"(path, index) in childrenPath"
:key=
"index
"
>
<a
class=
"smallFont"
:href=
"path"
style=
"float:left"
>
childrenPath:
{{
path
}}
</a><br>
</b-dropdown-item>
</b-dropdown>
</div>
</div>
</
template
>
...
...
@@ -34,6 +35,7 @@ export default class Navigation extends Vue {
parentPath
!
:
string
;
childrenPath
!
:
string
[];
isShowParentPath
:
boolean
=
false
;
isShowNavigation
:
boolean
=
false
;
@
Watch
(
"
url
"
)
onUrlChanged
(){
...
...
@@ -53,6 +55,11 @@ export default class Navigation extends Vue {
this
.
$forceUpdate
();
}
showNavigation
()
{
this
.
isShowNavigation
=
!
this
.
isShowNavigation
;
}
}
</
script
>
<
style
scoped
>
...
...
src/components/Common/WidgetParams.vue
View file @
ca847332
<
template
>
<div
style=
"width:100%"
>
<div
v-for=
"(label, index) in userInputData.keys()"
:key=
"index"
>
<b-input-group
style=
"margin:5px"
>
<b-input-group-text
class=
"smallFont"
>
{{
label
}}
</b-input-group-text>
<b-form-input
class=
"smallFont"
v-model=
"tempUserInputData[label]"
></b-form-input>
<b-input-group
s
ize=
"lg"
s
tyle=
"margin:5px"
>
<b-input-group-text>
{{
label
}}
</b-input-group-text>
<b-form-input
v-model=
"tempUserInputData[label]"
></b-form-input>
</b-input-group>
</div>
<div
style=
"width:100%;margin:5px"
>
...
...
src/components/Config/Config.vue
View file @
ca847332
...
...
@@ -23,10 +23,10 @@
<div
v-show=
"isShowGetPath"
>
<hr
/>
</div>
<b-input-group
class=
"smallFont
"
prepend=
"getPath"
v-show=
"isShowGetPath"
>
<b-input-group
size=
"lg
"
prepend=
"getPath"
v-show=
"isShowGetPath"
>
<b-form-input
v-model=
"config.data.get.url"
></b-form-input>
<b-input-group-append>
<b-button
@
click=
"updateGetUI"
size=
"sm"
text=
"Button"
variant=
"primary"
>
OK
</b-button>
<b-button
@
click=
"updateGetUI"
text=
"Button"
variant=
"primary"
>
OK
</b-button>
<b-button
variant=
"info"
@
click=
"getPathPoke"
>
poke
</b-button>
</b-input-group-append>
</b-input-group>
...
...
@@ -43,10 +43,10 @@
<div>
<hr
v-show=
"isShowSetPath"
/>
</div>
<b-input-group
class=
"smallFont
"
prepend=
"setPath"
v-show=
"isShowSetPath"
>
<b-input-group
size=
"lg
"
prepend=
"setPath"
v-show=
"isShowSetPath"
>
<b-form-input
v-model=
"config.data.set.url"
></b-form-input>
<b-input-group-append>
<b-button
@
click=
"updateSetUI"
size=
"sm"
text=
"Button"
variant=
"primary"
>
OK
</b-button>
<b-button
@
click=
"updateSetUI"
text=
"Button"
variant=
"primary"
>
OK
</b-button>
<b-button
variant=
"info"
@
click=
"setPathPoke"
>
poke
</b-button>
</b-input-group-append>
</b-input-group>
...
...
src/components/Method/Method.vue
View file @
ca847332
...
...
@@ -13,10 +13,10 @@
<span
style=
"float:left;"
class=
"largeFont"
>
{{
StatusValue
}}
</span>
<div
v-show=
"isShowPath"
><hr
/></div>
</div>
<b-input-group
class=
"smallFont"
prepend=
"path"
v-show=
"isShowPath"
>
<b-input-group
size=
"lg"
prepend=
"path"
v-show=
"isShowPath"
>
<b-form-input
v-model=
"config.data.url"
></b-form-input>
<b-input-group-append>
<b-button
@
click=
"updateUI"
size=
"sm"
text=
"Button"
variant=
"primary"
>
OK
</b-button>
<b-button
@
click=
"updateUI"
text=
"Button"
variant=
"primary"
>
OK
</b-button>
<b-button
variant=
"info"
@
click=
"pathPoke"
>
poke
</b-button>
</b-input-group-append>
</b-input-group>
...
...
src/components/State/State.vue
View file @
ca847332
...
...
@@ -7,16 +7,15 @@
<b-col>
<b-button
@
click=
"showPathConfig"
variant=
"primary"
style=
"float:right"
><span
class=
"glyphicon glyphicon-cog"
></span></b-button>
</b-col>
<div
v-show=
"isShowPath"
><
hr
/><
/div>
<div
v-show=
"isShowPath"
></div>
</b-row>
<div
style=
"width:100%"
>
<span
style=
"float:left;"
class=
"largeFont"
>
{{
StatusValue
}}
</span>
<div
v-show=
"isShowPath"
><hr
/></div>
<div
style=
"width:100%;border-style: solid; border-width: 1px;"
>
<p
style=
"float:left;"
class=
"largeFont"
>
{{
StatusValue
}}
</p>
</div>
<b-input-group
class=
"smallFont
"
prepend=
"path"
v-show=
"isShowPath"
>
<b-input-group
size=
"lg
"
prepend=
"path"
v-show=
"isShowPath"
>
<b-form-input
v-model=
"config.data.url"
></b-form-input>
<b-input-group-append>
<b-button
@
click=
"updateUI"
size=
"sm"
text=
"Button"
variant=
"primary"
>
OK
</b-button>
<b-button
@
click=
"updateUI"
text=
"Button"
variant=
"primary"
>
OK
</b-button>
<b-button
variant=
"info"
@
click=
"pathPoke"
>
poke
</b-button>
</b-input-group-append>
</b-input-group>
...
...
src/components/Status/Status.vue
View file @
ca847332
...
...
@@ -13,10 +13,10 @@
<span
style=
"float:left;"
class=
"largeFont"
>
{{
StatusValue
}}
</span>
<div
v-show=
"isShowPath"
><hr
/></div>
</div>
<b-input-group
class=
"smallFont
"
prepend=
"path"
v-show=
"isShowPath"
>
<b-input-group
size=
"lg
"
prepend=
"path"
v-show=
"isShowPath"
>
<b-form-input
v-model=
"config.data.url"
></b-form-input>
<b-input-group-append>
<b-button
@
click=
"updateUI"
size=
"sm"
text=
"Button"
variant=
"primary"
>
OK
</b-button>
<b-button
@
click=
"updateUI"
text=
"Button"
variant=
"primary"
>
OK
</b-button>
<b-button
variant=
"info"
@
click=
"pathPoke"
>
poke
</b-button>
</b-input-group-append>
</b-input-group>
...
...
@@ -74,15 +74,15 @@ export default class Status extends Widget {
this
.
config
.
data
.
userInputData
=
this
.
strMapObjChange
.
strMapToObj
(
this
.
userInputData
);
}
mounted
()
{
this
.
timer
=
setInterval
(
this
.
refresh
,
1000
);
}
//
mounted()
//
{
//
this.timer = setInterval(this.refresh,1000);
//
}
destroyed
()
{
clearInterval
(
this
.
timer
);
}
//
destroyed()
//
{
//
clearInterval(this.timer);
//
}
updateUI
()
{
this
.
isShowPath
=
false
;
...
...
src/components/Thing/Thing.vue
View file @
ca847332
...
...
@@ -39,6 +39,10 @@ export default class Thing extends Widget {
this
.
config
.
data
.
url
.
replace
(
'
$startPath$
'
,
startPath
);
}
samplePoke
(
sample
:
any
){}
pathPoke
(){}
parentUpdate
(
payload
:
UpdatePayload
):
void
{
}
...
...
src/components/WaveView/WaveView.vue
View file @
ca847332
<
template
>
<div
class=
"waveView"
>
<showViewInfo
:pathId=
"pathId
"
></showViewInfo>
<showViewInfo
ref=
"showViewInfo"
:pathId=
"pathId"
@
showPathIdConfig=
"showPathIdConfig
"
></showViewInfo>
<div
ref=
"wave"
>
</div>
<setBasicParams
ref=
"setBasicParams"
@
getPathId=
"getPathId"
@
updateConfig=
"updateConfig"
:wave=
"wave"
:setConfig=
'config'
></setBasicParams>
<Navigation
ref=
"FamilyLink"
:url=
"config.data.url"
></Navigation>
<setBasicParams
ref=
"setBasicParams"
@
getPathId=
"getPathId"
@
updateConfig=
"updateConfig"
:wave=
"wave"
:setConfig=
'config'
@
pathPoke=
"pathPoke"
></setBasicParams>
<Navigation
ref=
"FamilyLink"
:url=
"config.data.url"
style=
"margin-top:30px"
></Navigation>
</div>
</
template
>
...
...
@@ -71,6 +71,9 @@ export default class waveView extends Widget {
}
parentUpdate
(
payload
:
UpdatePayload
):
void
{
}
showPathIdConfig
(){
(
this
.
$refs
.
setBasicParams
as
setBasicParams
).
showPathIdConfig
();
}
refresh
()
{
(
this
.
$refs
.
setBasicParams
as
setBasicParams
).
refresh
();
...
...
@@ -96,7 +99,9 @@ export default class waveView extends Widget {
var
temp
=
sample
.
Actions
.
get
.
Parameters
;
temp
=
JSON
.
parse
(
JSON
.
stringify
(
temp
));
console
.
log
(
temp
);
temp
=
this
.
strMapObjChange
.
objToStrMap
(
temp
);
console
.
log
(
temp
);
var
Parameters
:
Map
<
string
,
string
>
;
Parameters
=
temp
;
...
...
@@ -108,22 +113,19 @@ export default class waveView extends Widget {
}
pokedPath
=
pokedPath
+
key
+
"
=$
"
+
key
+
"
$&
"
;
});
if
(
count
!=
0
)
{
pokedPath
=
pokedPath
.
substring
(
0
,
pokedPath
.
length
-
1
);
}
this
.
config
.
data
.
url
=
pokedPath
;
}
pathPoke
()
{
var
f
=
this
.
config
.
data
.
url
;
var
pokepath
=
"
a
"
;
pokepath
=
f
;
axios
.
get
(
pokepath
).
then
(
response
=>
{
axios
.
get
(
this
.
config
.
data
.
url
).
then
(
response
=>
{
this
.
samplePoke
(
response
.
data
);
this
.
updateUI
();
})
}
}
...
...
src/components/WaveView/setBasicParams.vue
View file @
ca847332
<
template
id=
"setBasicParams"
>
<div
class=
"panel-body row"
>
<
template
>
<div>
<div
v-show=
"isShowCog"
style=
"width:100%"
>
<b-input-group
prepend=
"Channel Path"
>
<b-input-group
size=
"lg"
prepend=
"Channel Path"
>
<b-input
v-model=
"config.data.url"
></b-input>
<b-input-group-addon>
<b-button
variant=
"primary"
@
click=
"getPathIdParams"
>
OK
<span
class=
"glyphicon glyphicon-save"
></span></b-button>
<
!--
<b-button
variant=
"info"
@
click=
""
>
poke
</b-button>
--
>
<
b-button
variant=
"info"
@
click=
"pathPoke"
>
poke
</b-button
>
</b-input-group-addon>
</b-input-group>
</div>
<WidgetParams
ref=
"WidgetParams"
v-show=
"isShowLoad"
action=
"get"
@
updataVariables=
"viewLoad"
></WidgetParams>
<b-button
variant=
"primary"
@
click=
"showPathIdConfig"
style=
"width:100%"
>
<span
class=
"glyphicon glyphicon-cog"
></span>
</b-button>
</div>
</
template
>
...
...
@@ -24,7 +21,7 @@ import global_ from '@/components/Common/global.vue';
import
{
WidgetConfig
}
from
"
@/models/WidgetConfig
"
;
import
{
UpdatePayload
}
from
"
@/models/UpdatePayload
"
;
import
PathProcessor
from
"
@/models/PathProcessor
"
;
import
{
forEach
}
from
"
typescript-collections/dist/lib/arrays
"
;
import
{
forEach
,
indexOf
}
from
"
typescript-collections/dist/lib/arrays
"
;
import
{
map
}
from
"
d3
"
;
import
WidgetParams
from
"
@/components/Common/WidgetParams.vue
"
;
import
StrMapObjChange
from
"
@/models/StrMapObjChange
"
;
...
...
@@ -72,6 +69,9 @@ export default class setBasicParams extends Vue {
};
this
.
viewLoad
(
Args
);
}
pathPoke
(){
this
.
$emit
(
"
pathPoke
"
);
}
setConfig
(
config
:
WidgetConfig
)
{
(
this
.
$refs
.
WidgetParams
as
WidgetParams
).
setVariableInput
(
config
.
data
.
userInputData
);
this
.
config
=
config
;
...
...
@@ -93,7 +93,6 @@ export default class setBasicParams extends Vue {
}
this
.
updateConfig
();
var
url
=
this
.
config
.
data
.
url
;
this
.
pathId
=
url
.
slice
(
0
,
url
.
indexOf
(
"
/
"
));
(
this
.
$refs
.
WidgetParams
as
WidgetParams
).
setVariableList
(
this
.
pathProcessor
.
extractVarFromPath
(
url
)
);
...
...
@@ -118,11 +117,23 @@ export default class setBasicParams extends Vue {
this
.
config
.
data
.
userInputData
,
this
.
config
.
data
.
url
);
console
.
log
(
this
.
config
);
var
first
=
url
.
indexOf
(
"
/
"
);
var
second
=
url
.
indexOf
(
"
/
"
,
first
+
1
);
var
third
=
url
.
indexOf
(
"
/
"
,
second
+
1
)
this
.
pathId
=
url
.
slice
(
second
+
1
,
third
);
var
thingPath
=
url
.
slice
(
0
,
url
.
indexOf
(
'
/
'
,
2
))
var
path
=
this
.
pathId
;
this
.
$emit
(
"
getPathId
"
,
path
);
await
this
.
getData
(
url
);
await
this
.
getDataTimeAxis
(
url
);
var
dealPath
=
{
thingPath
:
thingPath
,
path
:
path
}
var
dealFillPath
=
{
url
:
url
.
slice
(
url
.
indexOf
(
'
/
'
,
1
)
+
1
),
thingPath
:
thingPath
}
this
.
$emit
(
"
getPathId
"
,
dealPath
);
await
this
.
getData
(
dealFillPath
);
await
this
.
getDataTimeAxis
(
dealFillPath
);
var
myPlot
=
this
.
wave
;
var
data_initial
=
[
{
...
...
@@ -223,18 +234,19 @@ export default class setBasicParams extends Vue {
displaylogo
:
false
};
//
Plotly.newPlot(myPlot, data_update, data_layout, config);
Plotly
.
newPlot
(
myPlot
,
data_update
,
data_layout
,
config
);
}
async
getData
(
url
:
string
)
{
var
apiLoad
=
"
/dataserver
"
+
"
/DataByTimeFuzzy/
"
+
url
;
//改
async
getData
(
url
:
any
)
{
var
apiLoad
=
url
.
thingPath
+
"
/DataByTimeFuzzy/
"
+
url
.
url
;
console
.
log
(
apiLoad
);
//改
await
axios
.
get
(
apiLoad
).
then
(
response
=>
{
this
.
temp
.
data
=
response
.
data
.
ObjectVal
;
this
.
temp
.
data
=
response
.
data
.
CFET2CORE_SAMPLE_VAL
;
});
}
async
getDataTimeAxis
(
url
:
string
)
{
var
apiLoad
=
"
/dataerver
"
+
"
/DataByTimeFuzzyTimeAxis/
"
+
url
;
async
getDataTimeAxis
(
url
:
any
)
{
var
apiLoad
=
url
.
thingPath
+
"
/DataByTimeFuzzyTimeAxis/
"
+
url
.
url
;
await
axios
.
get
(
apiLoad
).
then
(
response
=>
{
this
.
temp
.
dataTimeAxis
=
response
.
data
.
ObjectVal
;
this
.
temp
.
dataTimeAxis
=
response
.
data
.
CFET2CORE_SAMPLE_VAL
;
});
}
}
...
...
src/components/WaveView/showViewInfo.vue
View file @
ca847332
...
...
@@ -2,7 +2,10 @@
<div
class=
"largeFont"
style=
"float:left width:100%"
>
<span>
Basic Path :
{{
basePathId
}}
</span><br>
<span>
Rate:
{{
sampleId
}}
</span><br>
<span>
length:
{{
lengthId
}}
</span><br>
<span>
length:
{{
lengthId
}}
</span>
<b-button
variant=
"primary"
style=
"float:right"
>
<span
class=
"glyphicon glyphicon-cog"
@
click=
"showPathIdConfig"
></span>
</b-button>
<hr
/>
</div>
</
template
>
...
...
@@ -18,34 +21,37 @@ export default class showViewInfo extends Vue {
sampleId
:
string
=
''
;
lengthId
:
string
=
''
;
@
Watch
(
'
pathId
'
)
onPathIdChanged
(
val
:
string
,
oldVal
:
string
)
{
onPathIdChanged
(
val
:
any
,
oldVal
:
any
)
{
this
.
show
(
val
);
}
showPathIdConfig
(){
this
.
$emit
(
"
showPathIdConfig
"
);
}
async
show
(
pathId
:
string
)
{
this
.
getBasePath
();
this
.
getBasePath
(
pathId
);
this
.
getSamplerate
(
pathId
);
this
.
getLength
(
pathId
);
}
async
getBasePath
()
{
var
apiLoad
=
"
/dataserver
"
+
'
/basepath
'
;
async
getBasePath
(
pathId
:
any
)
{
var
apiLoad
=
pathId
.
thingPath
+
'
/basepath
'
;
await
axios
.
get
(
apiLoad
)
.
then
((
response
)
=>
{
this
.
basePathId
=
response
.
data
.
ObjectVal
;
this
.
basePathId
=
response
.
data
.
CFET2CORE_SAMPLE_VAL
;
})
}
async
getSamplerate
(
pathId
:
string
)
{
var
apiLoad
=
"
/dataserver
"
+
'
/samplerate/
'
+
pathId
;
async
getSamplerate
(
pathId
:
any
)
{
var
apiLoad
=
pathId
.
thingPath
+
'
/samplerate/
'
+
pathId
.
path
;
await
axios
.
get
(
apiLoad
)
.
then
((
response
)
=>
{
this
.
sampleId
=
response
.
data
.
ObjectVal
;
this
.
sampleId
=
response
.
data
.
CFET2CORE_SAMPLE_VAL
;
})
}
async
getLength
(
pathId
:
string
)
{
var
apiLoad
=
"
/dataserver
"
+
'
/length/
'
+
pathId
;
console
.
log
(
apiLoad
);
async
getLength
(
pathId
:
any
)
{
var
apiLoad
=
pathId
.
thingPath
+
'
/length/
'
+
pathId
.
path
;
await
axios
.
get
(
apiLoad
)
.
then
((
response
)
=>
{
this
.
lengthId
=
response
.
data
.
ObjectVal
;
this
.
lengthId
=
response
.
data
.
CFET2CORE_SAMPLE_VAL
;
})
}
}
...
...
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