Authored by 王涛

Merge branch 'master' of http://192.168.1.136:82/monitor_v3/hg-monitor-web

 Conflicts:
	hg-monitor-web-zj/src/main/resources/static/vue3/src/views/pieDetailLine/index.js
@@ -1262,9 +1262,26 @@ layui.define(['xmSelect', 'md5'], function (exports) { @@ -1262,9 +1262,26 @@ layui.define(['xmSelect', 'md5'], function (exports) {
1262 param = "=" + encodeURIComponent(layHref.split('=')[1]); 1262 param = "=" + encodeURIComponent(layHref.split('=')[1]);
1263 } 1263 }
1264 alink.setAttribute("lay-href",layHref.split('=')[0] + param); 1264 alink.setAttribute("lay-href",layHref.split('=')[0] + param);
1265 - document.body.appendChild(alink);  
1266 - alink.click();  
1267 - document.body.removeChild(alink); 1265 + admin.req({
  1266 + url: obj.domainName + '/api-web/mxgraph/getJtopoInfoById/'+layHref.split('=')[2],
  1267 + success(response) {
  1268 + //LH 修改 弹框展示子拓扑
  1269 + layer.open({
  1270 + title:response.object.topoName,
  1271 + type: 2,
  1272 + area:['80%','80%'],
  1273 + content: obj.graphEditorOrigin + "/jgraph/grapheditor/viewer.html?access_token=" + localStorage.getItem('access_token') + '&id='+layHref.split('=')[2] + "&layout=organic",
  1274 + })
  1275 + },
  1276 + error() {
  1277 + layer.closeAll('loading');
  1278 + layer.msg('生成资源拓扑失败...', {icon: 2});
  1279 + }
  1280 + });
  1281 +
  1282 + // document.body.appendChild(alink);
  1283 + // alink.click();
  1284 + // document.body.removeChild(alink);
1268 }, 1285 },
1269 1286
1270 /** 1287 /**
@@ -9,8 +9,8 @@ @@ -9,8 +9,8 @@
9 range-separator="--" 9 range-separator="--"
10 start-placeholder="开始时间" 10 start-placeholder="开始时间"
11 end-placeholder="结束时间" 11 end-placeholder="结束时间"
12 - format="YYYY-MM-DD hh:mm:ss"  
13 - value-format="YYYY-MM-DD hh:mm:ss" 12 + format="YYYY-MM-DD HH:mm:ss"
  13 + value-format="YYYY-MM-DD HH:mm:ss"
14 :shortcuts="shortcuts" 14 :shortcuts="shortcuts"
15 @change="changeDate" 15 @change="changeDate"
16 size="small" 16 size="small"
@@ -61,7 +61,7 @@ export default { @@ -61,7 +61,7 @@ export default {
61 //自定义选择时间 61 //自定义选择时间
62 let dateValue=Vue.ref([]); 62 let dateValue=Vue.ref([]);
63 //选中的聚合频率 63 //选中的聚合频率
64 - let checkedId=Vue.ref(); 64 + let checkedId=Vue.ref(0);
65 let commandVal=Vue.ref('聚合频率') 65 let commandVal=Vue.ref('聚合频率')
66 //聚合频率选择 66 //聚合频率选择
67 // const changeItem=(val,name)=>{ 67 // const changeItem=(val,name)=>{
@@ -160,15 +160,7 @@ export default { @@ -160,15 +160,7 @@ export default {
160 const start = formatDate(12,'M'); 160 const start = formatDate(12,'M');
161 return [start, end] 161 return [start, end]
162 }, 162 },
163 - },  
164 - {  
165 - text: '全部',  
166 - value: () => {  
167 - const end = new Date();  
168 - const start = ''  
169 - return [start, end]  
170 - },  
171 - }, 163 + }
172 ]) 164 ])
173 //开始时间 165 //开始时间
174 let startTime=Vue.ref(); 166 let startTime=Vue.ref();
@@ -192,18 +184,16 @@ export default { @@ -192,18 +184,16 @@ export default {
192 //计算需要传参的code值 184 //计算需要传参的code值
193 const calcCode=(val)=>{ 185 const calcCode=(val)=>{
194 let code=''; 186 let code='';
195 - if(val>0 && val<7){ 187 + if(val>0 && val<3){
196 code='time_scope_DAY'; 188 code='time_scope_DAY';
197 - }else if(val>=7 && val<30){ 189 + }else if(val>=3 && val<7){
198 code='time_scope_WEEK'; 190 code='time_scope_WEEK';
199 - }else if(val>=30 && val<90){ 191 + }else if(val>=7 && val<30){
200 code='time_scope_MONTH'; 192 code='time_scope_MONTH';
201 - }else if(val>=90 && val<180){ 193 + }else if(val>=30){
202 code='time_scope_QUARTER'; 194 code='time_scope_QUARTER';
203 - }else if(val>=180 && val<365){  
204 - code='time_scope_SEMESTER';  
205 - }else if(val>=365){  
206 - code='time_scope_YEAR'; 195 + }else{
  196 + code='time_scope_MIN';
207 } 197 }
208 return code; 198 return code;
209 } 199 }
@@ -285,12 +275,96 @@ export default { @@ -285,12 +275,96 @@ export default {
285 }else{ 275 }else{
286 oneDay(); 276 oneDay();
287 } 277 }
  278 + if(props.intervalGroup){
288 checkedId.value=props.intervalGroup; 279 checkedId.value=props.intervalGroup;
289 } 280 }
  281 + }
290 282
291 //获取聚合频率数据 283 //获取聚合频率数据
292 const getRate=(defCode)=>{ 284 const getRate=(defCode)=>{
293 - let param = { 285 +
  286 + let resData=[
  287 + {
  288 + ddicId:'001',
  289 + ddicDesc:'0',
  290 + ddicName:'不聚合',
  291 + code:'time_scope_MIN'
  292 + },
  293 + {
  294 + ddicId:'002',
  295 + ddicDesc:'5',
  296 + ddicName:'5分钟',
  297 + code:'time_scope_MIN'
  298 + },
  299 + {
  300 + ddicId:'003',
  301 + ddicDesc:'10',
  302 + ddicName:'10分钟',
  303 + code:'time_scope_MIN'
  304 + },
  305 + {
  306 + ddicId:'004',
  307 + ddicDesc:'15',
  308 + ddicName:'15分钟',
  309 + code:'time_scope_MIN'
  310 + },
  311 + {
  312 + ddicId:'005',
  313 + ddicDesc:'30',
  314 + ddicName:'30分钟',
  315 + code:'time_scope_DAY'
  316 + },
  317 + {
  318 + ddicId:'006',
  319 + ddicDesc:'60',
  320 + ddicName:'1小时',
  321 + code:'time_scope_DAY'
  322 + },
  323 + {
  324 + ddicId:'007',
  325 + ddicDesc:'180',
  326 + ddicName:'3小时',
  327 + code:'time_scope_WEEK'
  328 + },
  329 + {
  330 + ddicId:'008',
  331 + ddicDesc:'360',
  332 + ddicName:'6小时',
  333 + code:'time_scope_WEEK'
  334 + },
  335 + {
  336 + ddicId:'009',
  337 + ddicDesc:'720',
  338 + ddicName:'12小时',
  339 + code:'time_scope_MONTH'
  340 + },
  341 + {
  342 + ddicId:'010',
  343 + ddicDesc:'1440',
  344 + ddicName:'1天',
  345 + code:'time_scope_MONTH'
  346 + },
  347 + {
  348 + ddicId:'011',
  349 + ddicDesc:'1440',
  350 + ddicName:'1天',
  351 + code:'time_scope_QUARTER'
  352 + }
  353 + ]
  354 + let resDataArr=[];
  355 + resData.map(item=>{
  356 + if(defCode==item.code){
  357 + resDataArr.push(item)
  358 + }
  359 + })
  360 + frequencyData.value = resDataArr;
  361 + if(frequencyData.value.length>0){
  362 + if(!props.intervalGroup){
  363 + checkedId.value=frequencyData.value[0].ddicDesc
  364 + }
  365 + }
  366 + sureBtn();
  367 + /*let param = {
294 ddicName: defCode 368 ddicName: defCode
295 } 369 }
296 proxy.$http.get(`/api-web/ContrastAnalysis/selectTogetherRate`, param, function (res) { 370 proxy.$http.get(`/api-web/ContrastAnalysis/selectTogetherRate`, param, function (res) {
@@ -304,7 +378,7 @@ export default { @@ -304,7 +378,7 @@ export default {
304 378
305 } 379 }
306 sureBtn(); 380 sureBtn();
307 - }); 381 + });*/
308 } 382 }
309 383
310 const oneDay=()=>{ 384 const oneDay=()=>{
@@ -12,7 +12,7 @@ export default { @@ -12,7 +12,7 @@ export default {
12 setup(props, {attrs, slots, emit}) { 12 setup(props, {attrs, slots, emit}) {
13 const {proxy} = Vue.getCurrentInstance(); 13 const {proxy} = Vue.getCurrentInstance();
14 let interval=Vue.ref('DAY'); 14 let interval=Vue.ref('DAY');
15 - let optionData=Vue.ref({}); 15 + let optionData=Vue.ref('');
16 let names = Vue.ref(['00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00']); 16 let names = Vue.ref(['00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00']);
17 let series = Vue.ref([]); 17 let series = Vue.ref([]);
18 let rateData = Vue.ref([]); 18 let rateData = Vue.ref([]);
@@ -104,7 +104,6 @@ export default { @@ -104,7 +104,6 @@ export default {
104 ]) 104 ])
105 let keys=Vue.ref(''); 105 let keys=Vue.ref('');
106 let getOptionData=(res)=>{ 106 let getOptionData=(res)=>{
107 - debugger  
108 let nameArr=[]; 107 let nameArr=[];
109 let dataArr=[]; 108 let dataArr=[];
110 if(res && res.success){ 109 if(res && res.success){
@@ -115,8 +114,8 @@ export default { @@ -115,8 +114,8 @@ export default {
115 Object.keys(resData[key]).sort(function (a, b) { 114 Object.keys(resData[key]).sort(function (a, b) {
116 return a<b?1:-1; 115 return a<b?1:-1;
117 }).forEach(function(time){ 116 }).forEach(function(time){
118 - nameArr.push(time);  
119 - dataArr.push(resData[key][time]) 117 + nameArr.unshift(time);
  118 + dataArr.unshift(resData[key][time])
120 }) 119 })
121 }) 120 })
122 rateData.value = { 121 rateData.value = {
@@ -373,7 +372,6 @@ export default { @@ -373,7 +372,6 @@ export default {
373 keys, 372 keys,
374 optionDataInit, 373 optionDataInit,
375 getOptionData, 374 getOptionData,
376 - getInfluxOption,  
377 getLineChart, 375 getLineChart,
378 changeInterval 376 changeInterval
379 } 377 }
@@ -95,7 +95,7 @@ export default { @@ -95,7 +95,7 @@ export default {
95 } 95 }
96 };*/ 96 };*/
97 97
98 - option && myChart.setOption(option); 98 + option && myChart.setOption(option,true);
99 } 99 }
100 100
101 101
@@ -111,7 +111,7 @@ export default { @@ -111,7 +111,7 @@ export default {
111 } 111 }
112 } 112 }
113 } 113 }
114 - proxy.myChart.setOption(adapterOption) 114 + proxy.myChart.setOption(adapterOption,true)
115 proxy.myChart.resize() 115 proxy.myChart.resize()
116 } 116 }
117 117