diff options
| author | tanghao <default@DESKTOP-7FEGRP2> | 2019-11-07 13:37:03 +0800 |
|---|---|---|
| committer | tanghao <default@DESKTOP-7FEGRP2> | 2019-11-07 13:37:03 +0800 |
| commit | d264df4b252dcf332bfe5b7fdc3f02066eab0e6c (patch) | |
| tree | 68794a8c29fe1a93bc86f35894dce145d56d24b5 | |
| parent | e9f1a907f39d81ff5e974c1b65674ea9a69099cb (diff) | |
update
| -rw-r--r-- | nezha-admin/src/main/resources/templates/js/modules/dashboard/dashboard.js | 18 | ||||
| -rw-r--r-- | nezha-admin/src/main/resources/templates/modules/dashboard/index.html | 20 |
2 files changed, 28 insertions, 10 deletions
diff --git a/nezha-admin/src/main/resources/templates/js/modules/dashboard/dashboard.js b/nezha-admin/src/main/resources/templates/js/modules/dashboard/dashboard.js index 6818df8c..b67a3671 100644 --- a/nezha-admin/src/main/resources/templates/js/modules/dashboard/dashboard.js +++ b/nezha-admin/src/main/resources/templates/js/modules/dashboard/dashboard.js @@ -418,13 +418,14 @@ //分页是否使用
$("#isPaging").bootstrapSwitch("onSwitchChange",function(event,state){
- if(!state){
+ $("#isPaging").bootstrapSwitch('state', false);
+ /* if(!state){
$("#tablePageSize").attr("disabled",true);
vm.chartTable.scroll=0;
}else{
$("#tablePageSize").attr("disabled",false);
vm.chartTable.scroll=1;
- }
+ }*/
})
//是否启用仪表盘
@@ -1061,13 +1062,11 @@ success: function(r){
vm.dashboards=r.data;
vm.$nextTick(function () {
-
var statisticals=new Array();
for(var i=0;i<vm.dashboards.length;i++){
vm.dashboards[i].idName='chart'+vm.dashboards[i].id;
var datas=new Array();
var obj=JSON.parse(vm.dashboards[i].data);
- console.log(obj)
// 折线图等 生成echarts
if(vm.dashboards[i].chartType==1){
var a=JSON.parse(obj.series);
@@ -1248,7 +1247,10 @@ },
detail: {
formatter: function(v) {
- return '{a| '+obj.prefix+'} '+v+' {b| '+obj.suffix+'}';
+ console.log(obj)
+ var prefix=obj.prefix;
+ var suffix=obj.suffix;
+ return '{a| '+prefix+'} '+v+' {b| '+suffix+'}';
},
offsetCenter:obj.isGauge==1?[0, "50%"]:[0, "10%"],
textStyle: {
@@ -1327,8 +1329,6 @@ handle: 'header' //模块内定义拖动的元素<header>,这里也支持jquery选择器,如"span.drag_handle"
},
serialize_params: function($w, wgd) {
- console.log($w)
- console.log(wgd)
return { id: $w[0].id, x: wgd.row, y: wgd.col, width: wgd.size_x*150, height: wgd.size_y*150 }
},
helper: 'clone',
@@ -1366,10 +1366,10 @@ contentType: 'application/json; charset=UTF-8',
data: JSON.stringify(allChartInfos),//JSON.stringify(allChartInfos)
success: function (result) {
-
+ layer.msg("<@spring.message 'common.success'/>")
},
error : function(result) {
-
+ layer.msg(result.msg)
}
})
diff --git a/nezha-admin/src/main/resources/templates/modules/dashboard/index.html b/nezha-admin/src/main/resources/templates/modules/dashboard/index.html index 4db8ca40..3767865f 100644 --- a/nezha-admin/src/main/resources/templates/modules/dashboard/index.html +++ b/nezha-admin/src/main/resources/templates/modules/dashboard/index.html @@ -41,7 +41,25 @@ <li><a href='#' @click='removeDashboard(dashboard.id)'><@spring.message 'common.delete'/></a></li>
</ul>
</header>
- <div :id="dashboard.name" style='width: 200px;height:200px;overflow-y:auto;' class='right-bottom'></div>
+ <div :id="dashboard.name" :style="{width: dashboard.width+'px',height:dashboard.height+'px',overflowY:'auto'}" class='right-bottom'>
+ <template v-if="dashboard.chartType === 3">
+ <table id='tablePanel' :style="{fontSize: (JSON.parse(dashboard.data)).fontSize + 'px' }" class='table table-striped table-bordered table-condensed'>
+ <thead>
+ <tr><th class='' id='tableColumnTime'>time</th>
+ <th class='' id='tableColumnValue'>value</th></tr>
+ </thead>
+ <tbody>
+ <template v-for="data,index in JSON.parse((JSON.parse(dashboard.data)).series)">
+ <tr>
+ <td style='width:50%'>{{data.time}}</td>
+ <!-- <td>{{(data.value).toFixed((JSON.parse(dashboard.data)).decimal)}}</td> -->
+ <td>{{data.value}}</td>
+ </tr>
+ </template>
+ </tbody>
+ </table>
+ </template>
+ </div>
</li>
</template>
</ul>
|
