Merge branch 'master' of http://113.200.75.45:82/monitor_v3/hg-monitor-web into master-v32-xwx
Showing
12 changed files
with
186 additions
and
544 deletions
@@ -3006,12 +3006,12 @@ layui.define(['soulTable', 'commonDetail', 'common', 'laytpl', 'view', 'admin', | @@ -3006,12 +3006,12 @@ layui.define(['soulTable', 'commonDetail', 'common', 'laytpl', 'view', 'admin', | ||
3006 | contextmenuEvent: function (){ | 3006 | contextmenuEvent: function (){ |
3007 | var contextmenuTips; | 3007 | var contextmenuTips; |
3008 | let text=''; | 3008 | let text=''; |
3009 | + let urlHash=window.location.hash; | ||
3009 | $('[type=button]').contextmenu(function (e) { | 3010 | $('[type=button]').contextmenu(function (e) { |
3010 | e.preventDefault(); | 3011 | e.preventDefault(); |
3011 | //按钮 | 3012 | //按钮 |
3012 | - text='按钮->'+$(this).text(); | ||
3013 | - var contextmenuEl='<ul class="contextmenu-style" style="color:#fff;">'; | ||
3014 | - contextmenuEl+='<li>name--'+text+'</li>'; | 3013 | + let elementName=$(this).text(); |
3014 | + var contextmenuEl='<ul id="tipContextmenu" class="contextmenu-style" style="color:#fff;">'; | ||
3015 | contextmenuEl+='</ul>'; | 3015 | contextmenuEl+='</ul>'; |
3016 | contextmenuTips = layer.tips(contextmenuEl, $(this), { | 3016 | contextmenuTips = layer.tips(contextmenuEl, $(this), { |
3017 | time: 0, | 3017 | time: 0, |
@@ -3019,34 +3019,106 @@ layui.define(['soulTable', 'commonDetail', 'common', 'laytpl', 'view', 'admin', | @@ -3019,34 +3019,106 @@ layui.define(['soulTable', 'commonDetail', 'common', 'laytpl', 'view', 'admin', | ||
3019 | success() { | 3019 | success() { |
3020 | } | 3020 | } |
3021 | }) | 3021 | }) |
3022 | + admin.req({ | ||
3023 | + url: common.domainName + '/api-web/bHalt' | ||
3024 | + ,data:{ | ||
3025 | + urlHash:urlHash, | ||
3026 | + elementName:elementName | ||
3027 | + } | ||
3028 | + , async: false | ||
3029 | + , done: function (res) { | ||
3030 | + let liEle='' | ||
3031 | + if(res.data && res.data.length>0){ | ||
3032 | + let tipData=res.data; | ||
3033 | + tipData.map(item=>{ | ||
3034 | + liEle+='<li>'+item.elementExplain+'</li>'; | ||
3035 | + }) | ||
3036 | + | ||
3037 | + }else{ | ||
3038 | + liEle+='<li>暂无</li>'; | ||
3039 | + } | ||
3040 | + setTimeout(function(){ | ||
3041 | + $('#tipContextmenu').append(liEle) | ||
3042 | + },100) | ||
3043 | + } | ||
3044 | + }) | ||
3045 | + | ||
3022 | }) | 3046 | }) |
3023 | - $('.layui-table-link').parents('td').contextmenu(function (e) { | 3047 | + // $('.layui-table-link').parents('td').contextmenu(function (e) { |
3048 | + $('td .layui-table-link').contextmenu(function (e) { | ||
3024 | e.preventDefault(); | 3049 | e.preventDefault(); |
3025 | //超链接 | 3050 | //超链接 |
3026 | - text='超链接->'+$(this).text(); | ||
3027 | - var contextmenuEl='<ul class="contextmenu-style" style="color:#fff;">'; | ||
3028 | - contextmenuEl+='<li>name--'+text+'</li>'; | 3051 | + let elementName=$(this).text(); |
3052 | + var contextmenuEl='<ul id="tipContextmenu" class="contextmenu-style" style="color:#fff;">'; | ||
3029 | contextmenuEl+='</ul>'; | 3053 | contextmenuEl+='</ul>'; |
3030 | contextmenuTips = layer.tips(contextmenuEl, $(this), { | 3054 | contextmenuTips = layer.tips(contextmenuEl, $(this), { |
3031 | time: 0, | 3055 | time: 0, |
3032 | - tips: [2, '#1e9fff'], | 3056 | + tips: [3, '#1e9fff'], |
3033 | success() { | 3057 | success() { |
3034 | } | 3058 | } |
3035 | }) | 3059 | }) |
3060 | + admin.req({ | ||
3061 | + url: common.domainName + '/api-web/bHalt' | ||
3062 | + ,data:{ | ||
3063 | + urlHash:urlHash, | ||
3064 | + elementName:elementName | ||
3065 | + } | ||
3066 | + , async: false | ||
3067 | + , done: function (res) { | ||
3068 | + let liEle='' | ||
3069 | + if(res.data && res.data.length>0){ | ||
3070 | + let tipData=res.data; | ||
3071 | + tipData.map(item=>{ | ||
3072 | + liEle+='<li>'+item.elementExplain+'</li>'; | ||
3073 | + }) | ||
3074 | + | ||
3075 | + }else{ | ||
3076 | + liEle+='<li>暂无</li>'; | ||
3077 | + } | ||
3078 | + setTimeout(function(){ | ||
3079 | + $('#tipContextmenu').append(liEle) | ||
3080 | + },100) | ||
3081 | + | ||
3082 | + } | ||
3083 | + }) | ||
3036 | }) | 3084 | }) |
3037 | - $('table thead tr th').contextmenu(function (e) { | 3085 | + // $('table thead tr th').contextmenu(function (e) { |
3086 | + $('table thead tr th span').contextmenu(function (e) { | ||
3038 | e.preventDefault(); | 3087 | e.preventDefault(); |
3039 | - //超链接 | ||
3040 | - text='表头->'+$(this).text(); | ||
3041 | - var contextmenuEl='<ul class="contextmenu-style" style="color:#fff;">'; | ||
3042 | - contextmenuEl+='<li>name--'+text+'</li>'; | 3088 | + //表头 |
3089 | + let elementName=$(this).text(); | ||
3090 | + var contextmenuEl='<ul id="tipContextmenu" class="contextmenu-style" style="color:#fff;">'; | ||
3043 | contextmenuEl+='</ul>'; | 3091 | contextmenuEl+='</ul>'; |
3044 | contextmenuTips = layer.tips(contextmenuEl, $(this), { | 3092 | contextmenuTips = layer.tips(contextmenuEl, $(this), { |
3045 | time: 0, | 3093 | time: 0, |
3046 | - tips: [2, '#1e9fff'], | 3094 | + tips: [3, '#1e9fff'], |
3047 | success() { | 3095 | success() { |
3048 | } | 3096 | } |
3049 | }) | 3097 | }) |
3098 | + admin.req({ | ||
3099 | + url: common.domainName + '/api-web/bHalt' | ||
3100 | + ,data:{ | ||
3101 | + urlHash:urlHash, | ||
3102 | + elementName:elementName | ||
3103 | + } | ||
3104 | + , async: false | ||
3105 | + , done: function (res) { | ||
3106 | + let liEle='' | ||
3107 | + if(res.data && res.data.length>0){ | ||
3108 | + let tipData=res.data; | ||
3109 | + tipData.map(item=>{ | ||
3110 | + liEle+='<li>'+item.elementExplain+'</li>'; | ||
3111 | + }) | ||
3112 | + | ||
3113 | + }else{ | ||
3114 | + liEle+='<li>暂无</li>'; | ||
3115 | + } | ||
3116 | + setTimeout(function(){ | ||
3117 | + $('#tipContextmenu').append(liEle) | ||
3118 | + },100) | ||
3119 | + | ||
3120 | + } | ||
3121 | + }) | ||
3050 | }) | 3122 | }) |
3051 | 3123 | ||
3052 | /*$('[data-contextmenu]').contextmenu(function (e) { | 3124 | /*$('[data-contextmenu]').contextmenu(function (e) { |
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | @Name:通用资源详细信息 | 2 | @Name:通用资源详细信息 |
3 | @Author:王凤 | 3 | @Author:王凤 |
4 | */ | 4 | */ |
5 | -layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSelect', 'md5'], function (exports) { | 5 | +layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSelect', 'md5','carousel'], function (exports) { |
6 | var $ = layui.$ | 6 | var $ = layui.$ |
7 | , table = layui.table | 7 | , table = layui.table |
8 | , common = layui.common | 8 | , common = layui.common |
@@ -13,7 +13,8 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | @@ -13,7 +13,8 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | ||
13 | , form = layui.form | 13 | , form = layui.form |
14 | , xmSelect = layui.xmSelect | 14 | , xmSelect = layui.xmSelect |
15 | , admin = layui.admin | 15 | , admin = layui.admin |
16 | - , md5 = layui.md5; | 16 | + , md5 = layui.md5 |
17 | + , carousel = layui.carousel; | ||
17 | //编辑状态时,选中的指标信息集合 | 18 | //编辑状态时,选中的指标信息集合 |
18 | var checkedKpiObj = []; | 19 | var checkedKpiObj = []; |
19 | //详情页悬浮提示的index | 20 | //详情页悬浮提示的index |
@@ -152,7 +153,7 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | @@ -152,7 +153,7 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | ||
152 | rowMenu.attr('data-nature', 'true');//性能趋势 | 153 | rowMenu.attr('data-nature', 'true');//性能趋势 |
153 | // rowMenu.attr('data-canca', data.canCA); | 154 | // rowMenu.attr('data-canca', data.canCA); |
154 | // rowMenu.attr('data-incaing', data.inCAing); | 155 | // rowMenu.attr('data-incaing', data.inCAing); |
155 | - // rowMenu.attr('data-restype', data.resType); | 156 | + rowMenu.attr('data-restype', (data && data[0])?data[0].resType:''); |
156 | //监听告警压制等操作配置 | 157 | //监听告警压制等操作配置 |
157 | $('#' + targetId + "_detail_row_menu").hover(function () { | 158 | $('#' + targetId + "_detail_row_menu").hover(function () { |
158 | var $that = $(this); | 159 | var $that = $(this); |
@@ -253,6 +254,8 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | @@ -253,6 +254,8 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | ||
253 | rowMenu.attr("data-unit", ""); | 254 | rowMenu.attr("data-unit", ""); |
254 | rowMenu.attr('data-hidem', 'true'); | 255 | rowMenu.attr('data-hidem', 'true'); |
255 | rowMenu.attr('data-nature', 'true');//性能趋势 | 256 | rowMenu.attr('data-nature', 'true');//性能趋势 |
257 | + rowMenu.attr('data-restype', data[0]?data[0].resType:''); | ||
258 | + | ||
256 | //监听告警压制等操作配置 | 259 | //监听告警压制等操作配置 |
257 | $('#' + targetId + "_detail_row_menu").hover(function () { | 260 | $('#' + targetId + "_detail_row_menu").hover(function () { |
258 | var $that = $(this); | 261 | var $that = $(this); |
@@ -3075,6 +3078,8 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | @@ -3075,6 +3078,8 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | ||
3075 | layer.alert('该资源只对接TRAP告警信息!',{icon:0}); | 3078 | layer.alert('该资源只对接TRAP告警信息!',{icon:0}); |
3076 | return; | 3079 | return; |
3077 | } | 3080 | } |
3081 | + //url(/src/style/img/shutdown.png) | ||
3082 | + title +=`<span id="title-shutdown" data-id=${resId} style="padding:0 5px;display: inline-block;position: relative;top: 8px;left:20px;"></span>` | ||
3078 | obj.openNewWin(url, title, params, editFlag, fn, cancelfn, type,sign_); | 3083 | obj.openNewWin(url, title, params, editFlag, fn, cancelfn, type,sign_); |
3079 | }, | 3084 | }, |
3080 | error: function () { | 3085 | error: function () { |
@@ -3344,6 +3349,49 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | @@ -3344,6 +3349,49 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele | ||
3344 | // layer.close(detailTips); | 3349 | // layer.close(detailTips); |
3345 | // } | 3350 | // } |
3346 | // }) | 3351 | // }) |
3352 | + //start lsq 增加停机状态跑马灯效果 2022-05-24 | ||
3353 | + let resId= $('#title-shutdown').data("id"); | ||
3354 | + admin.req({ | ||
3355 | + url: common.domainName + '/api-web/manage/cutover/findByResId?access_token=' + layui.sessions.getToken().access_token + '&resId=' + resId | ||
3356 | + , async: false | ||
3357 | + , done: function (res) { | ||
3358 | + if(res.data && res.data.length>0){ | ||
3359 | + let listData=res.data; | ||
3360 | + // | ||
3361 | + let carouselStr=` | ||
3362 | + <img src="/src/style/img/shutdown.png" style="position: absolute;top: 0; left: -3px;" alt=""> | ||
3363 | + <div class="layui-carousel shutdown-carousel " id="shutdown-carousel" style="background: transparent;"> | ||
3364 | + <div carousel-item>`; | ||
3365 | + let boxShadow='0 0 10px'; | ||
3366 | + listData.map((item,index)=>{ | ||
3367 | + carouselStr+=` <div class="layui-row layui-col-space10" style="background: transparent;position: relative;" > | ||
3368 | + <span style="font-size: 14px;color:#ff0000;padding:0 5px; height:30px;width:100%;position: absolute;top:0;left:0;right:0;">`+item+`</span> | ||
3369 | + </div>`; | ||
3370 | + }) | ||
3371 | + carouselStr+=` </div></div>`; | ||
3372 | + $('.layui-layer-title #title-shutdown').append(carouselStr); | ||
3373 | + //轮播切换 | ||
3374 | + let options={ | ||
3375 | + width: '630px' | ||
3376 | + , height:'30px' | ||
3377 | + , arrow: 'none' | ||
3378 | + , autoplay: true//自动切换 | ||
3379 | + , interval:5000//自动切换的时间间隔 | ||
3380 | + // , trigger: (layui.device().ios || layui.device().android) ? 'click' : 'hover' | ||
3381 | + , anim: 'default' //切换动画的方式 fade,default,updown | ||
3382 | + , index: 0 | ||
3383 | + , indicator:'none'//指示器的位置 outside,inside,none | ||
3384 | + } | ||
3385 | + var ins=carousel.render({ | ||
3386 | + elem: '#shutdown-carousel' | ||
3387 | + }); | ||
3388 | + //重置轮播 | ||
3389 | + ins.reload(options); | ||
3390 | + //end lsq 2022-05-24 | ||
3391 | + } | ||
3392 | + } | ||
3393 | + }) | ||
3394 | + | ||
3347 | }, | 3395 | }, |
3348 | yes:function (index) { | 3396 | yes:function (index) { |
3349 | layer.close(index); | 3397 | layer.close(index); |
@@ -498,6 +498,25 @@ layui.define(['table', 'form', 'laydate', 'admin', 'layer', 'laytpl', 'common', | @@ -498,6 +498,25 @@ layui.define(['table', 'form', 'laydate', 'admin', 'layer', 'laytpl', 'common', | ||
498 | resize: false, | 498 | resize: false, |
499 | area: ['80%', '90%'], | 499 | area: ['80%', '90%'], |
500 | success: function (indexm, layero) { | 500 | success: function (indexm, layero) { |
501 | + //start 停机模式从数据字典中获取 2022-05-24 | ||
502 | + admin.req({ | ||
503 | + url: common.domainName + '/api-web/manage/ddic/findSucDdics/shutdown_plan_mode' | ||
504 | + , method: 'POST' | ||
505 | + , async: false | ||
506 | + }).done(function (res) { | ||
507 | + let radioData=res.data; | ||
508 | + let htmlRadio=''; | ||
509 | + if(radioData && radioData.length>0){ | ||
510 | + radioData.map(item=>{ | ||
511 | + htmlRadio+=`<input type="radio" data-sort="`+item.ddicSort+`" name="cutoverMode" lay-filter="shutdownplanMode" value="`+item.ddicSort+`" title="`+item.ddicName+`">` | ||
512 | + }) | ||
513 | + } | ||
514 | + $('#shutdownDdic').html(htmlRadio); | ||
515 | + $('#shutdownDdic [data-sort]:first-child').attr("checked",true) | ||
516 | + }).error(function (error) { | ||
517 | + console.error(error); | ||
518 | + }); | ||
519 | + //end lsq 2022-05-24 | ||
501 | }, | 520 | }, |
502 | yes: function (index, layero) { | 521 | yes: function (index, layero) { |
503 | $("#saveshutdownplanBtn").trigger("click"); | 522 | $("#saveshutdownplanBtn").trigger("click"); |

3.74 KB
@@ -31,10 +31,11 @@ | @@ -31,10 +31,11 @@ | ||
31 | </div> | 31 | </div> |
32 | <div class="layui-form-item"> | 32 | <div class="layui-form-item"> |
33 | <label class="layui-form-label" style="min-width: 120px!important;max-width: 120px!important;">停机模式<span style="color: red">*</span>:</label> | 33 | <label class="layui-form-label" style="min-width: 120px!important;max-width: 120px!important;">停机模式<span style="color: red">*</span>:</label> |
34 | - <div class="layui-input-block"> | ||
35 | - <input type="radio" name="cutoverMode" lay-filter="shutdownplanMode" value="1" title="暂停告警" checked> | 34 | + <div class="layui-input-block" id="shutdownDdic"> |
35 | + <!--//lsq 停机模式从数据字典中获取 2022-05-24--> | ||
36 | + <!--<input type="radio" name="cutoverMode" lay-filter="shutdownplanMode" value="1" title="暂停告警" checked> | ||
36 | <input type="radio" name="cutoverMode" lay-filter="shutdownplanMode" value="2" title="暂停采集"> | 37 | <input type="radio" name="cutoverMode" lay-filter="shutdownplanMode" value="2" title="暂停采集"> |
37 | - <input type="radio" name="cutoverMode" lay-filter="shutdownplanMode" value="3" title="暂停通知"> | 38 | + <input type="radio" name="cutoverMode" lay-filter="shutdownplanMode" value="3" title="暂停通知">--> |
38 | </div> | 39 | </div> |
39 | </div> | 40 | </div> |
40 | <div class="layui-form-item"> | 41 | <div class="layui-form-item"> |
@@ -13,7 +13,16 @@ export default { | @@ -13,7 +13,16 @@ export default { | ||
13 | const {proxy} = Vue.getCurrentInstance(); | 13 | const {proxy} = Vue.getCurrentInstance(); |
14 | let dateType=Vue.ref('oneDay'); | 14 | let dateType=Vue.ref('oneDay'); |
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 | + //series接口无数据时默认数据 |
17 | + let seriesData = Vue.ref([{ | ||
18 | + "data": [['2022-05-13','02:00'],['2022-05-15','03:00'],['2022-05-17','04:00']], | ||
19 | + // "name": kpiName.value | ||
20 | + "name": '成功' | ||
21 | + },{ | ||
22 | + "data": [['2022-05-14','08:00'],['2022-05-16','09:00'],['2022-05-17','10:00']], | ||
23 | + // "name": kpiName.value | ||
24 | + "name": '失败' | ||
25 | + }]); | ||
17 | let series = Vue.ref([]); | 26 | let series = Vue.ref([]); |
18 | let rateData = Vue.ref([]); | 27 | let rateData = Vue.ref([]); |
19 | let kpiUnit = Vue.ref(''); | 28 | let kpiUnit = Vue.ref(''); |
@@ -105,6 +114,7 @@ export default { | @@ -105,6 +114,7 @@ export default { | ||
105 | dateType.value=val; | 114 | dateType.value=val; |
106 | if(val=='custom'){ | 115 | if(val=='custom'){ |
107 | }else{ | 116 | }else{ |
117 | + getMonthDay(); | ||
108 | getLineChart(); | 118 | getLineChart(); |
109 | 119 | ||
110 | } | 120 | } |
@@ -131,18 +141,10 @@ export default { | @@ -131,18 +141,10 @@ export default { | ||
131 | let url = '/api-web/scatter/getByResId?dateType=' + dateType.value + | 141 | let url = '/api-web/scatter/getByResId?dateType=' + dateType.value + |
132 | '&resId=' + resourceId + '&kpiId=' + idStr + '&resType=' + resType; | 142 | '&resId=' + resourceId + '&kpiId=' + idStr + '&resType=' + resType; |
133 | proxy.$http.get(url, {},function (res){ | 143 | proxy.$http.get(url, {},function (res){ |
134 | - kpiUnit.value = res.data.kpiUnit == null ? "" : res.data.kpiUnit; | 144 | + kpiUnit.value = (!res.data || res.data.kpiUnit == null) ? "" : res.data.kpiUnit; |
135 | if (res.data && res.data.length == 0) { | 145 | if (res.data && res.data.length == 0) { |
136 | rateData.value = { | 146 | rateData.value = { |
137 | - series: [{ | ||
138 | - "data": [['2022-05-03','02:00'],['2022-05-05','03:00'],['2022-05-07','04:00']], | ||
139 | - // "name": kpiName.value | ||
140 | - "name": '成功' | ||
141 | - },{ | ||
142 | - "data": [['2022-05-04','08:00'],['2022-05-06','09:00'],['2022-05-07','10:00']], | ||
143 | - // "name": kpiName.value | ||
144 | - "name": '失败' | ||
145 | - }], | 147 | + series: seriesData.value, |
146 | kpiUnit: kpiUnit.value | 148 | kpiUnit: kpiUnit.value |
147 | } | 149 | } |
148 | } else { | 150 | } else { |
@@ -151,15 +153,7 @@ export default { | @@ -151,15 +153,7 @@ export default { | ||
151 | setSeries(); | 153 | setSeries(); |
152 | },function (error){ | 154 | },function (error){ |
153 | rateData.value = { | 155 | rateData.value = { |
154 | - series: [{ | ||
155 | - "data": [['2022-05-03','02:00'],['2022-05-05','03:00'],['2022-05-07','04:00']], | ||
156 | - // "name": kpiName.value | ||
157 | - "name": '成功' | ||
158 | - },{ | ||
159 | - "data": [['2022-05-04','08:00'],['2022-05-06','09:00'],['2022-05-07','10:00']], | ||
160 | - // "name": kpiName.value | ||
161 | - "name": '失败' | ||
162 | - }], | 156 | + series: seriesData.value, |
163 | kpiUnit: kpiUnit.value | 157 | kpiUnit: kpiUnit.value |
164 | } | 158 | } |
165 | setSeries(); | 159 | setSeries(); |
@@ -227,7 +221,6 @@ export default { | @@ -227,7 +221,6 @@ export default { | ||
227 | }, | 221 | }, |
228 | xAxis: { | 222 | xAxis: { |
229 | type: 'category', | 223 | type: 'category', |
230 | - // data: rateData.value.names, | ||
231 | data: xAxisData.value, | 224 | data: xAxisData.value, |
232 | axisLine: { | 225 | axisLine: { |
233 | lineStyle: { | 226 | lineStyle: { |
@@ -289,19 +282,19 @@ export default { | @@ -289,19 +282,19 @@ export default { | ||
289 | let xAxisData=Vue.ref([]); | 282 | let xAxisData=Vue.ref([]); |
290 | const getMonthDay=()=>{ | 283 | const getMonthDay=()=>{ |
291 | let m=24; | 284 | let m=24; |
292 | - if(dateType=='oneDay'){ | 285 | + if(dateType.value=='oneDay'){ |
293 | m=24; | 286 | m=24; |
294 | - }else if(dateType=='week'){ | 287 | + }else if(dateType.value=='week'){ |
295 | m=7; | 288 | m=7; |
296 | - }else if(dateType=='month'){ | 289 | + }else if(dateType.value=='month'){ |
297 | m=30; | 290 | m=30; |
298 | } | 291 | } |
299 | let dateArr=[]; | 292 | let dateArr=[]; |
300 | for(let i=0;i<=m;i++){ | 293 | for(let i=0;i<=m;i++){ |
301 | let myDate=new Date(); | 294 | let myDate=new Date(); |
302 | - if(dateType=='oneDay'){ | ||
303 | - myDate.setHours(myDate.getHours()-m) | ||
304 | - }else if(dateType=='week' || dateType=='month'){ | 295 | + if(dateType.value=='oneDay'){ |
296 | + myDate.setHours(myDate.getHours()-i) | ||
297 | + }else if(dateType.value=='week' || dateType.value=='month'){ | ||
305 | myDate.setDate(myDate.getDate() - i); | 298 | myDate.setDate(myDate.getDate() - i); |
306 | } | 299 | } |
307 | let lowData =getDateTime(myDate); //用了上面转年月日的方法 | 300 | let lowData =getDateTime(myDate); //用了上面转年月日的方法 |
@@ -322,7 +315,11 @@ export default { | @@ -322,7 +315,11 @@ export default { | ||
322 | if(day < 10){ | 315 | if(day < 10){ |
323 | day = '0'+day; | 316 | day = '0'+day; |
324 | } | 317 | } |
325 | - dateTime= year+'-'+month+'-'+day;//+' '+hours+':'+minutes+':'+seconds; | 318 | + if(dateType.value=='oneDay'){ |
319 | + dateTime= year+'-'+month+'-'+day+' '+hours+':00';//+minutes;//+':'+seconds; | ||
320 | + }else{ | ||
321 | + dateTime= year+'-'+month+'-'+day;//+' '+hours+':'+minutes+':'+seconds; | ||
322 | + } | ||
326 | return dateTime; | 323 | return dateTime; |
327 | } | 324 | } |
328 | //转换个位数为 00 | 325 | //转换个位数为 00 |
@@ -367,7 +364,7 @@ export default { | @@ -367,7 +364,7 @@ export default { | ||
367 | timeFormat, | 364 | timeFormat, |
368 | dateType, | 365 | dateType, |
369 | optionData, | 366 | optionData, |
370 | - names, | 367 | + seriesData, |
371 | series, | 368 | series, |
372 | rateData, | 369 | rateData, |
373 | kpiUnit, | 370 | kpiUnit, |
1 | -<title>设计器预览</title> | ||
2 | -<script type="text/html" template> | ||
3 | - {{# | ||
4 | - var viewURL = window.location.origin + '/vue3/index.html#/ajConfig/view'; | ||
5 | - layui.use(['sessions','common','admin'], function () { | ||
6 | - var $ = layui.$; | ||
7 | - var common = layui.common; | ||
8 | - var admin = layui.admin; | ||
9 | - var arr = []; | ||
10 | - window.location.hash.split('/').forEach(function (v, i) { | ||
11 | - if (v.indexOf('=') != -1) { | ||
12 | - arr.push(v); | ||
13 | - } | ||
14 | - }); | ||
15 | - | ||
16 | - if (arr.length > 0) { | ||
17 | - viewURL += "?" + arr.join("&"); | ||
18 | - } | ||
19 | - $('#actionListIframe').attr('src',viewURL); | ||
20 | - }); | ||
21 | - }} | ||
22 | - <iframe id="actionListIframe" src="{{viewURL}}" frameborder="0" class="layadmin-iframe" style="height: 99.5%!important;"></iframe> | ||
23 | -</script> |
1 | -<div class="container" :style="{'height':height+'px','max-height':height+'px'}"> | ||
2 | - <div class="cm-card" :style="{'min-height':height+'px','max-height':height+'px','height':'100%'}"> | ||
3 | - <div class="search"> | ||
4 | - <div class="btns" style="justify-content: left;padding-left: 0px"> | ||
5 | - <el-form-item> | ||
6 | - <el-button type="primary" @click="addAj()" style="margin-left: 10px">新增</el-button> | ||
7 | - </el-form-item> | ||
8 | - </div> | ||
9 | - <div class="design" style="float:right;padding-left: 1410px"> | ||
10 | - <el-form-item> | ||
11 | - <el-button type="primary" @click="handleView()" style="margin-left: 10px">设计</el-button> | ||
12 | - </el-form-item> | ||
13 | - </div> | ||
14 | - </div> | ||
15 | - | ||
16 | - <div class="search-table"> | ||
17 | - <cm-table-page :columns="columns" :dataList="tableDataList" @loaddata="loadTableDataList" | ||
18 | - :showIndex="true" :total="count" :showSelection="true" | ||
19 | - :showBorder="true" :loading="false" :pageSize="pageSize" | ||
20 | - :showPage="true" :showTools="true" :height="(height - 130)" > | ||
21 | - <template #default="{row,prop,column}"> | ||
22 | - <div v-if="prop == 'type'"> | ||
23 | - <div v-if="row.type == 0"> | ||
24 | - <el-tag>菜单</el-tag> | ||
25 | - </div> | ||
26 | - | ||
27 | - <div v-if="row.type == 1"> | ||
28 | - <el-tag>按钮</el-tag> | ||
29 | - </div> | ||
30 | - | ||
31 | - <div v-if="row.type == 2"> | ||
32 | - <el-tag>详情页</el-tag> | ||
33 | - </div> | ||
34 | - </div> | ||
35 | - </template> | ||
36 | - <template #tools="{scope}"> | ||
37 | - <div class="list-handle"> | ||
38 | - <span class="icon-bg"> | ||
39 | - <i class="el-icon-delete" title="删除" @click="handleDelete(scope.row)"></i> | ||
40 | - </span> | ||
41 | - <span class="icon-bg"> | ||
42 | - <i class="el-icon-edit-outline" title="修改" @click="handleUpdate(scope.row)"></i> | ||
43 | - </span> | ||
44 | - <span class="icon-bg"> | ||
45 | - <i class="el-icon-view" title="预览" @click="handleView(scope.row)"></i> | ||
46 | - </span> | ||
47 | - </div> | ||
48 | - </template> | ||
49 | - </cm-table-page> | ||
50 | - </div> | ||
51 | - </div> | ||
52 | -</div> | ||
53 | - | ||
54 | -<!--新增编辑弹框--> | ||
55 | -<cm-dialog :title="titleName" width="40%" :showDialogVisible="cacheVisible" @hidedialog="cancelBtn" :showFooter="false"> | ||
56 | - <template v-slot> | ||
57 | - <el-form | ||
58 | - label-width="120px" | ||
59 | - ref="ruleForm" | ||
60 | - :model="ajConfigFrom" | ||
61 | - :rules="docRulesForm" | ||
62 | - label-position="right" | ||
63 | - label-width="120px"> | ||
64 | - | ||
65 | - <el-form-item label="编号" prop="id"> | ||
66 | - <el-input :size="$global.elementSize" v-model="ajConfigFrom.id" clearable></el-input> | ||
67 | - </el-form-item> | ||
68 | - | ||
69 | - | ||
70 | - <el-form-item label="类型" prop="type"> | ||
71 | - <el-radio v-model="ajConfigFrom.type" label="0" size="large">菜单</el-radio> | ||
72 | - <el-radio v-model="ajConfigFrom.type" label="1" size="large">按钮</el-radio> | ||
73 | - <el-radio v-model="ajConfigFrom.type" label="2" size="large">详情页</el-radio> | ||
74 | - <div> | ||
75 | - <span>示例:12345646 说明:12132123</span> | ||
76 | - </div> | ||
77 | - </el-form-item> | ||
78 | - | ||
79 | - | ||
80 | - <el-form-item label="父菜单" prop="menuPid" v-if="ajConfigFrom.type==0"> | ||
81 | - <el-select v-model="ajConfigFrom.menuPid" placeholder="请选择" style="width: 555px;"> | ||
82 | - <el-option | ||
83 | - v-for="item in menuOptions" | ||
84 | - :key="item.value" | ||
85 | - :label="item.label" | ||
86 | - :value="item.value" | ||
87 | - :disabled="item.disabled"> | ||
88 | - </el-option> | ||
89 | - </el-select> | ||
90 | - </el-form-item> | ||
91 | - | ||
92 | - <el-form-item label="菜单名称" prop="menuName" v-if="ajConfigFrom.type==0"> | ||
93 | - <el-input :size="$global.elementSize" v-model="ajConfigFrom.menuName" clearable></el-input> | ||
94 | - </el-form-item> | ||
95 | - | ||
96 | - <el-form-item label="设计页面" prop="designPage"> | ||
97 | - <el-select v-model="ajConfigFrom.designPage" placeholder="请选择" style="width: 510px;"> | ||
98 | - <el-option | ||
99 | - v-for="item in options" | ||
100 | - :key="item.value" | ||
101 | - :label="item.label" | ||
102 | - :value="item.value" | ||
103 | - :disabled="item.disabled"> | ||
104 | - </el-option> | ||
105 | - </el-select> | ||
106 | - <el-tag @click="preview(ajConfigFrom.designPage)" :size="large">预览</el-tag> | ||
107 | - </el-form-item> | ||
108 | - | ||
109 | - <el-form-item label="传递参数" prop="param"> | ||
110 | - <el-input :size="$global.elementSize" v-model="ajConfigFrom.param" clearable></el-input> | ||
111 | - <span>示例:12345646 说明:12132123</span> | ||
112 | - </el-form-item> | ||
113 | - | ||
114 | - <el-form-item label="资源类型" prop="resType" v-if="ajConfigFrom.type==2"> | ||
115 | - <el-input :size="$global.elementSize" v-model="ajConfigFrom.resType" clearable></el-input> | ||
116 | - </el-form-item> | ||
117 | - | ||
118 | - <el-form-item label="厂商" prop="firm" v-if="ajConfigFrom.type==2"> | ||
119 | - <el-input :size="$global.elementSize" v-model="ajConfigFrom.firm" clearable></el-input> | ||
120 | - </el-form-item> | ||
121 | - | ||
122 | - <el-form-item label="绑定资源" prop="resource" v-if="ajConfigFrom.type==2"> | ||
123 | - <el-input :size="$global.elementSize" v-model="ajConfigFrom.resource" clearable></el-input> | ||
124 | - </el-form-item> | ||
125 | - | ||
126 | - <el-form-item label="备注" prop="remark"> | ||
127 | - <el-input :size="$global.elementSize" v-model="ajConfigFrom.remark" clearable></el-input> | ||
128 | - </el-form-item> | ||
129 | - | ||
130 | - <el-form-item> | ||
131 | - <el-button :size="$global.elementSize" type="primary" @click="addAjConfig('ruleForm')">保存</el-button> | ||
132 | - <el-button :size="$global.elementSize" @click="cancelBtn">取消</el-button> | ||
133 | - </el-form-item> | ||
134 | - </el-form> | ||
135 | - </template> | ||
136 | -</cm-dialog> | ||
137 | - |
1 | -export default { | ||
2 | - name: 'ajConfig', | ||
3 | - template: '', | ||
4 | - components: {}, | ||
5 | - props:[], | ||
6 | - data () { | ||
7 | - return { | ||
8 | - radio:'0', | ||
9 | - docRulesForm: { | ||
10 | - id: [ | ||
11 | - { | ||
12 | - required: true, | ||
13 | - message: '请填写文档编号!', | ||
14 | - trigger: 'blur', | ||
15 | - } | ||
16 | - ], | ||
17 | - type:[{ | ||
18 | - required: true, | ||
19 | - message: '请选择类型!', | ||
20 | - trigger: 'blur', | ||
21 | - }], | ||
22 | - designPage:[{ | ||
23 | - required: true, | ||
24 | - message: '请选择设计页面!', | ||
25 | - trigger: 'blur', | ||
26 | - }], | ||
27 | - resource:[{ | ||
28 | - required: true, | ||
29 | - message: '请填写绑定资源!', | ||
30 | - trigger: 'blur', | ||
31 | - }], | ||
32 | - } | ||
33 | - } | ||
34 | - | ||
35 | - }, | ||
36 | - setup(props, {attrs, slots, emit}){ | ||
37 | - const {proxy} = Vue.getCurrentInstance(); | ||
38 | - let height = Vue.ref(window.innerHeight - 10); | ||
39 | - //表格字段 | ||
40 | - let columns=Vue.ref([ | ||
41 | - { | ||
42 | - prop: 'id', | ||
43 | - label: '编号', | ||
44 | - sortable: true, | ||
45 | - align: 'center', | ||
46 | - width:'250' | ||
47 | - }, | ||
48 | - { | ||
49 | - prop: 'type', | ||
50 | - label: '类型', | ||
51 | - sortable: true, | ||
52 | - align: 'center', | ||
53 | - width:'250', | ||
54 | - }, | ||
55 | - { | ||
56 | - prop: 'resType', | ||
57 | - label: '资源类型', | ||
58 | - sortable: true, | ||
59 | - align: 'center', | ||
60 | - width:'250' | ||
61 | - },{ | ||
62 | - prop: 'firm', | ||
63 | - label: '品牌', | ||
64 | - sortable: true, | ||
65 | - align: 'center', | ||
66 | - width:'250' | ||
67 | - },{ | ||
68 | - prop: 'designPage', | ||
69 | - label: '设计器名称', | ||
70 | - sortable: true, | ||
71 | - align: 'center', | ||
72 | - width:'250' | ||
73 | - },{ | ||
74 | - prop: 'param', | ||
75 | - label: '参数', | ||
76 | - sortable: true, | ||
77 | - align: 'left' | ||
78 | - } | ||
79 | - ]) | ||
80 | - let currentPage=Vue.ref(1); | ||
81 | - let pageSize=Vue.ref(10); | ||
82 | - let keyword=Vue.ref(); | ||
83 | - let count=Vue.ref(0); | ||
84 | - let tableDataList=Vue.ref([]); | ||
85 | - let checkedId = Vue.ref(0); | ||
86 | - let titleName=Vue.ref('新增配置信息') | ||
87 | - let cacheVisible=Vue.ref(false); | ||
88 | - let viewData=Vue.ref(); | ||
89 | - let addOrUpdate=Vue.ref(false) | ||
90 | - let radio=Vue.ref(0); | ||
91 | - //下拉框 | ||
92 | - let options=Vue.ref([]); | ||
93 | - //菜单下拉框 | ||
94 | - let menuOptions=Vue.ref([]); | ||
95 | - let ajConfigFrom = Vue.ref({ | ||
96 | - id:'', | ||
97 | - type: 0, | ||
98 | - designPage: '', | ||
99 | - param: '', | ||
100 | - resType: '', | ||
101 | - firm:'', | ||
102 | - resource:'', | ||
103 | - remark:'', | ||
104 | - creatTime:'', | ||
105 | - createName:'', | ||
106 | - state:'', | ||
107 | - title:'', | ||
108 | - menuPid:'', | ||
109 | - menuName:'' | ||
110 | - }); | ||
111 | - //新增弹框 | ||
112 | - const addAj=()=>{ | ||
113 | - clearForm(); | ||
114 | - cacheVisible.value=true; | ||
115 | - pageList(); | ||
116 | - menuList(); | ||
117 | - | ||
118 | - } | ||
119 | - //新增或修改aj配置信息 | ||
120 | - let addAjConfig=(ruleForm)=>{ | ||
121 | - let params={}; | ||
122 | - params= ajConfigFrom.value; | ||
123 | - let msg = ''; | ||
124 | - if (addOrUpdate.value){ | ||
125 | - proxy.$http.post(`/api-web/ajConfig/updateAj`, params, function (res) { | ||
126 | - if (res && res.success == true) { | ||
127 | - msg = res.msg; | ||
128 | - cacheVisible.value=false; | ||
129 | - proxy.$global.showMsg(msg); | ||
130 | - clearForm(); | ||
131 | - getDataList(); | ||
132 | - } | ||
133 | - }) | ||
134 | - }else{ | ||
135 | - proxy.$http.post(`/api-web/ajConfig/addAj`, params, function (res) { | ||
136 | - if (res && res.success == true) { | ||
137 | - msg = res.msg; | ||
138 | - cacheVisible.value=false; | ||
139 | - proxy.$global.showMsg(msg); | ||
140 | - if (params.type==0){ | ||
141 | - window.history.go(0); | ||
142 | - } | ||
143 | - clearForm(); | ||
144 | - getDataList(); | ||
145 | - | ||
146 | - } | ||
147 | - }) | ||
148 | - } | ||
149 | - } | ||
150 | - //清理表单 | ||
151 | - let clearForm=()=>{ | ||
152 | - ajConfigFrom.value={ | ||
153 | - id:'', | ||
154 | - type: '0', | ||
155 | - designPage: '', | ||
156 | - param: '', | ||
157 | - resType: '', | ||
158 | - firm:'', | ||
159 | - resource:'', | ||
160 | - remark:'', | ||
161 | - creatTime:'', | ||
162 | - createName:'', | ||
163 | - state:'', | ||
164 | - title:'', | ||
165 | - menuPid:'', | ||
166 | - menuName:'' | ||
167 | - } | ||
168 | - addOrUpdate.value=false; | ||
169 | - } | ||
170 | - | ||
171 | - //删除 | ||
172 | - let handleDelete=(row)=>{ | ||
173 | - let param={ | ||
174 | - id:row.id | ||
175 | - } | ||
176 | - proxy.$http.get(`/api-web/ajConfig/deleteById`, param, function (res) { | ||
177 | - | ||
178 | - if (res && res.success == true) { | ||
179 | - let msg = res.msg; | ||
180 | - if (!msg) { | ||
181 | - msg = "删除失败"; | ||
182 | - } | ||
183 | - if (row.type==0){ | ||
184 | - history.go(0); | ||
185 | - } | ||
186 | - proxy.$global.showMsg(msg); | ||
187 | - getDataList(); | ||
188 | - } | ||
189 | - }) | ||
190 | - } | ||
191 | - let handleUpdate=(row)=>{ | ||
192 | - addOrUpdate.value =true; | ||
193 | - ajConfigFrom.value=row; | ||
194 | - cacheVisible.value=true; | ||
195 | - pageList(); | ||
196 | - menuList(); | ||
197 | - } | ||
198 | - | ||
199 | - //预览 | ||
200 | - let preview=(row)=>{ | ||
201 | - proxy.$global.viewAjView(row,'80%','80%',''); | ||
202 | - } | ||
203 | - | ||
204 | - //aj报表管理信息 | ||
205 | - let pageList=()=>{ | ||
206 | - proxy.$http.get(`/api-web/ajConfig/pageList`, null, function (res) { | ||
207 | - if (res && res.success == true) { | ||
208 | - let params=res.object.data.records; | ||
209 | - params.forEach(function(e){ | ||
210 | - let report={} | ||
211 | - report.label=e.reportName; | ||
212 | - report.value=e.reportCode; | ||
213 | - options.value.push(report) | ||
214 | - }); | ||
215 | - } | ||
216 | - }) | ||
217 | - } | ||
218 | - | ||
219 | - //菜单 | ||
220 | - let menuList=()=>{ | ||
221 | - proxy.$http.get(`/api-user/menus/findAlls`, null, function (res) { | ||
222 | - if (res && res.count>0) { | ||
223 | - let params=res.data; | ||
224 | - params.forEach(function(e){ | ||
225 | - let menu={} | ||
226 | - menu.label=e.name; | ||
227 | - menu.value=e.id; | ||
228 | - menuOptions.value.push(menu) | ||
229 | - }); | ||
230 | - } | ||
231 | - }) | ||
232 | - | ||
233 | - } | ||
234 | - //AJ设计登录 | ||
235 | - let handleView=()=>{ | ||
236 | - window.open(sessionStorage.getItem("ajWeb") + '/#/login?access_token=' + localStorage.getItem("access_token")); | ||
237 | - } | ||
238 | - | ||
239 | - | ||
240 | - //重新加载表格数据 | ||
241 | - let loadTableDataList = ({page, limit}) => { | ||
242 | - currentPage.value=page; | ||
243 | - pageSize.value=limit; | ||
244 | - getDataList() | ||
245 | - } | ||
246 | - | ||
247 | - //获取aj配置信息 | ||
248 | - let getDataList=()=>{ | ||
249 | - proxy.$http.get(`/api-web/ajConfig/ajConfigList`,null, function (res) { | ||
250 | - if (res && res.data) { | ||
251 | - count.value = res.data.length; | ||
252 | - tableDataList.value = res.data; | ||
253 | - }else{ | ||
254 | - tableDataList.value='暂无数据'; | ||
255 | - } | ||
256 | - }); | ||
257 | - | ||
258 | - } | ||
259 | - | ||
260 | - //关闭弹框 | ||
261 | - let cancelBtn=()=>{ | ||
262 | - cacheVisible.value=false; | ||
263 | - } | ||
264 | - // 挂载完 | ||
265 | - Vue.onMounted(() => { | ||
266 | - getDataList(); | ||
267 | - | ||
268 | - }) | ||
269 | - | ||
270 | - return { | ||
271 | - height, | ||
272 | - columns, | ||
273 | - currentPage, | ||
274 | - count, | ||
275 | - pageSize, | ||
276 | - keyword, | ||
277 | - tableDataList, | ||
278 | - checkedId, | ||
279 | - addAj, | ||
280 | - addAjConfig, | ||
281 | - loadTableDataList, | ||
282 | - getDataList, | ||
283 | - cacheVisible, | ||
284 | - titleName, | ||
285 | - viewData, | ||
286 | - cancelBtn, | ||
287 | - ajConfigFrom, | ||
288 | - handleDelete, | ||
289 | - handleUpdate, | ||
290 | - preview, | ||
291 | - handleView, | ||
292 | - pageList, | ||
293 | - radio, | ||
294 | - options, | ||
295 | - menuList, | ||
296 | - menuOptions | ||
297 | - } | ||
298 | - } | ||
299 | - | ||
300 | -} |
hg-monitor-web-zj/src/main/resources/static/vue3/src/views/ajConfig/view/index.js
deleted
100644 → 0
1 | -export default { | ||
2 | - name: 'ajConfigViewIndex', | ||
3 | - template: '', | ||
4 | - components: {}, | ||
5 | - | ||
6 | - data() { | ||
7 | - return { | ||
8 | - } | ||
9 | - }, | ||
10 | - setup() { | ||
11 | - const {proxy} = Vue.getCurrentInstance(); | ||
12 | - let src = Vue.ref(''); | ||
13 | - let height = Vue.ref(window.innerHeight - 10); | ||
14 | - var reportCode = proxy.$global.getQueryVariable('reportCode'); | ||
15 | - | ||
16 | - let url=()=>{ | ||
17 | - src.value=sessionStorage.getItem("ajWeb")+'/#/bigscreen/viewer?reportCode='+reportCode+'&access_token=' + localStorage.getItem("access_token"); | ||
18 | - } | ||
19 | - // 挂载完 | ||
20 | - Vue.onMounted(() => { | ||
21 | - url(); | ||
22 | - }) | ||
23 | - | ||
24 | - return { | ||
25 | - url, | ||
26 | - src, | ||
27 | - height | ||
28 | - } | ||
29 | - } | ||
30 | -} |
-
Please register or login to post a comment