rabin 7 years ago
parent
commit
b97ec23639

+ 1 - 1
front/templates/pc/device/chart/ajax.html

@@ -3,7 +3,7 @@
 $("#chart .name").html('{{data['deviceInfo']['name']}}');
 var date = {% for key,value in enumerate(data['statList']) %}{% if key == 0 %}{% raw value['data']['time'] %}{% end %}{% end %};
 if (date == "") {
-    $("#chart").hide();
+    //$("#chart").hide();
     //$(".crumbs .statMenu").hide();
 } else {
     myChart.setOption({

+ 1 - 1
front/templates/pc/device/chart/page.html

@@ -4,7 +4,7 @@
 var myChart = echarts.init(document.getElementById('main'));
 var date = {% for key,value in enumerate(data['statList']) %}{% if key == 0 %}{% raw value['data']['time'] %}{% end %}{% end %};
 if (date == "") {
-    $("#main").hide();
+    //$("#main").hide();
 } else {
     var series = [
             {% for key,value in enumerate(data['statList']) %}

+ 1 - 1
front/templates/pc/device/chart/simple.html

@@ -5,7 +5,7 @@
 var myChart = echarts.init(document.getElementById('main'));
 var date = {% for key,value in enumerate(data['statList']) %}{% if key == 0 %}{% raw value['data']['time'] %}{% end %}{% end %};
 if (date == "") {
-    $("#chart").hide();
+    //$("#chart").hide();
     //$(".crumbs .statMenu").hide();
 } else {
     var series = [

+ 2 - 2
model/device_info.py

@@ -19,8 +19,8 @@ class Device_info(Model):
 	type_id = Fields(type='int', comment='设备类型')
 	value = Fields(type='varchar(1000)', comment='设备传过来的值')
 	exp = Fields(type='varchar(500)', comment='表达式')
-	max = Fields(type='float', comment='最大上限', match='number|最大上限必须是数字')
-	min = Fields(type='float', comment='最小下限', match='number|最小下限必须是数字')
+	max = Fields(type='float', comment='最大上限', match='numberFloat|最大上限必须是数字')
+	min = Fields(type='float', comment='最小下限', match='numberFloat|最小下限必须是数字')
 	cxnum = Fields(type='int', comment='超限次数')
 	cxtype = Fields(type='int', comment='超限类型,1为超过上限,2为超过下限')
 	cxdate = Fields(type='int', comment='首次超限时间')