wangzhe hace 2 años
padre
commit
cf246d87fb

+ 3 - 0
mybusiness/src/main/java/com/sooka/system/domain/TUInterfaceinfo.java

@@ -59,6 +59,9 @@ public class TUInterfaceinfo extends BaseEntity
     @Excel(name = "共享方式")
     private String shareType;
 
+    /** 共享方式 */
+    private String shareTypeDict;//eg:share_type_1
+
     /** 请求方式 */
     @Excel(name = "请求方式")
     private String interfaceType;

+ 3 - 0
mybusiness/src/main/resources/mapper/system/TUInterfaceinfoMapper.xml

@@ -18,6 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="infoItem"    column="info_item"    />
         <result property="usageScenarios"    column="usage_scenarios"    />
         <result property="shareType"    column="share_type"    />
+        <result property="shareTypeDict"    column="shareTypeDict"    />
         <result property="interfaceType"    column="interface_type"    />
         <result property="env"    column="env"    />
         <result property="signServeraddress"    column="sign_serveraddress"    />
@@ -308,6 +309,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 DECIMAL (10, 0)
             ) percent,
             COUNT(id) count,
+            a.share_type shareTypeDict,
             b.dict_label share_type
         FROM
             t_u_interfaceinfo a
@@ -334,6 +336,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 DECIMAL (10, 0)
             ) percent,
             COUNT(id) count,
+            a.share_type shareTypeDict,
             b.dict_label share_type
         FROM
             t_u_interfaceinfo a

+ 6 - 5
mybusiness/src/main/resources/static/visualization/js/echarts_div.js

@@ -83,13 +83,14 @@ function getFaultInterfaceCount() {
 // 接口占比
 function jkzb(data) {
 	let percent = new Array();
-    percent.push({'shareType': '市共享', 'count': 0, 'percent': 0});
-    percent.push({'shareType': '市归集', 'count': 0, 'percent': 0});
-    percent.push({'shareType': '省上报', 'count': 0, 'percent': 0});
-    percent.push({'shareType': '省共享', 'count': 0, 'percent': 0});
+    percent.push({'shareTypeDict': 'share_type_1', 'shareType': '市共享接口', 'count': 0, 'percent': 0});
+    percent.push({'shareTypeDict': 'share_type_2', 'shareType': '市归集接口', 'count': 0, 'percent': 0});
+    percent.push({'shareTypeDict': 'share_type_3', 'shareType': '省上报接口', 'count': 0, 'percent': 0});
+    percent.push({'shareTypeDict': 'share_type_4', 'shareType': '省共享接口', 'count': 0, 'percent': 0});
     for(let i = 0; i < percent.length; i++){
         for(let j = 0; j < data.length; j++){
-            if(percent[i].shareType == data[j].shareType){
+            if(percent[i].shareTypeDict == data[j].shareTypeDict){
+                percent[i].shareType = data[j].shareType;
                 percent[i].count = parseInt(data[j].count);
                 percent[i].percent = parseInt(data[j].percent);
 			}

+ 6 - 5
mybusiness/src/main/resources/templates/visualization/tk_iframe.html

@@ -214,13 +214,14 @@
     /**接口占比-实例化方法**/
     function sub_jkzb(data) {
         let percent = new Array();
-        percent.push({'shareType': '市共享', 'count': 0, 'percent': 0});
-        percent.push({'shareType': '市归集', 'count': 0, 'percent': 0});
-        percent.push({'shareType': '省上报', 'count': 0, 'percent': 0});
-        percent.push({'shareType': '省共享', 'count': 0, 'percent': 0});
+        percent.push({'shareTypeDict': 'share_type_1', 'shareType': '市共享接口', 'count': 0, 'percent': 0});
+        percent.push({'shareTypeDict': 'share_type_2', 'shareType': '市归集接口', 'count': 0, 'percent': 0});
+        percent.push({'shareTypeDict': 'share_type_3', 'shareType': '省上报接口', 'count': 0, 'percent': 0});
+        percent.push({'shareTypeDict': 'share_type_4', 'shareType': '省共享接口', 'count': 0, 'percent': 0});
         for(let i = 0; i < percent.length; i++){
             for(let j = 0; j < data.length; j++){
-                if(percent[i].shareType == data[j].shareType){
+                if(percent[i].shareTypeDict == data[j].shareTypeDict){
+                    percent[i].shareType = data[j].shareType;
                     percent[i].count = parseInt(data[j].count);
                     percent[i].percent = parseInt(data[j].percent);
                 }