Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show Scalar Data and add ExpandPanel #272

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions frontend/src/common/component/ExpandPanel.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<template>
<div class="visual-dl-expand-panel">
<h3
class="visual-dl-expand-head"
@click="handleHeadClick()"
>
<span>{{title}}</span>
<span class="visual-dl-expand-head-info">
<v-icon class="visual-dl-expand-head-arrow" size="20">{{iconName}}</v-icon>
<span class="visual-dl-expand-head-num">({{info}})</span>
</span>
</h3>
<div
v-if="isShow"
class="visual-dl-expand-panel-content"
>
<slot></slot>
</div>
</div>
</template>
<script>
export default {
props: {
title: String,
info: Number
},
computed: {
iconName() {
return this.isShow ? 'expand_less' : 'expand_more';
}
},
data() {
return {
isShow: true
};
},
methods: {
handleHeadClick() {
this.toogleShow();
},
toogleShow() {
this.isShow = !this.isShow;
}
}
};
</script>
<style lang="stylus">
.visual-dl-expand-panel
text-align left
.visual-dl-expand-head
border solid 1px #ccc
line-height 50px
height 50px
padding 0 20px
cursor pointer
position relative
.visual-dl-expand-head-info
position absolute
left 90%
.visual-dl-expand-head-arrow
vertical-align middle
.visual-dl-expand-head-num
line-height 20px
font-size 12px
font-weight normal
.visual-dl-expand-panel-content
padding 0 20px
.visual-dl-expand-panel-content:after
content: "";
clear: both;
display: block;
</style>


8 changes: 4 additions & 4 deletions frontend/src/images/ui/ChartPage.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="visual-dl-chart-page">
<!--<ui-expand-panel isShow="{{expand}}" info="{{total}}" title="{{title}}">-->
<ui-expand-panel :info="total" :title="title">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, we always default the isShow to true at first.

<ui-image
class="visual-dl-chart-image"
v-for="tagInfo in filteredPageList"
Expand All @@ -16,11 +16,11 @@
:length="total"
:total-visible="pageSize"
></v-pagination>
<!--</ui-expand-panel>-->
</ui-expand-panel>
</div>
</template>
<script>
//import ExpandPanel from '../../common/component/ExpandPanel';
import ExpandPanel from '../../common/component/ExpandPanel';
import Image from './Image';
//import Pagination from 'san-mui/Pagination';

Expand All @@ -30,7 +30,7 @@ export default {
props: ['config', 'runsItems', 'tagList', 'title'],
components: {
'ui-image': Image,
//'ui-expand-panel': ExpandPanel,
'ui-expand-panel': ExpandPanel,
//'ui-pagination': Pagination
},
computed: {
Expand Down
1 change: 0 additions & 1 deletion frontend/src/scalars/Scalars.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<div class="visual-dl-page-container">
<div class="visual-dl-page-left">
<ui-chart-page
:expand="true"
:config="filteredConfig"
:runsItems="runsItems"
:tagList="filteredTagsList"
Expand Down
9 changes: 7 additions & 2 deletions frontend/src/scalars/ui/Chart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ export default {
horizontal: function(val) {
this.setChartHorizon();
},
tagInfo: function(val) {
this.setChartsOptions(val);
this.getOriginChartData(val);
}
// runs: function(val) {
// this.setChartsRuns();
// }
Expand Down Expand Up @@ -168,6 +172,7 @@ export default {
);
seriesOption = flatten(seriesOption);
let legendOptions = tagList.map(item => item.run);
let instance = this;
let option = {
color: [
'#c23531',
Expand All @@ -194,8 +199,8 @@ export default {
},
position: ['10%', '90%'],
formatter(params, ticket, callback) {
let data = this.getFormatterPoints(params[0].data);
return this.transformFormatterData(data);
let data = instance.getFormatterPoints(params[0].data);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good use of that

return instance.transformFormatterData(data);
}
},
toolbox: {
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/scalars/ui/ChartPage.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="visual-dl-chart-page">
<!--<ui-expand-panel isShow="{{expand}}" info="{{tagList.length}}" title="{{title}}">-->
<ui-expand-panel :info="tagList.length" :title="title">
<div ref="chartPageBox" class="visual-dl-chart-page-box">
<ui-chart
v-for="tag in filteredTagList"
Expand All @@ -22,11 +22,11 @@
:length="total"
:total-visible="pageSize"
/>
<!--</ui-expand-panel>-->
</ui-expand-panel>
</div>
</template>
<script>
// import ExpandPanel from '../../common/component/ExpandPanel';
import ExpandPanel from '../../common/component/ExpandPanel';
import Chart from './Chart';
// import Pagination from 'san-mui/Pagination';

Expand All @@ -35,10 +35,10 @@ import {cloneDeep} from 'lodash';
export default {
components: {
'ui-chart': Chart,
// 'ui-expand-panel': ExpandPanel,
'ui-expand-panel': ExpandPanel,
// 'ui-pagination': Pagination
},
props: ['expand', 'config', 'runsItems', 'tagList', 'title'],
props: ['config', 'runsItems', 'tagList', 'title'],
computed: {
filteredRunsList() {
let tagList = this.tagList || [];
Expand Down