Authored by wangtao

Merge branch 'master-500-dev' of http://113.200.75.45:82/monitor_v3/hg-monitor-w…

…eb into master-500-dev
Showing 46 changed files with 3959 additions and 176 deletions

Too many changes to show.

To preserve performance only 46 of 46+ files are displayed.

@@ -30,6 +30,24 @@ layui.define(['form', 'admin', 'laydate', 'common','sessions','reskpilist'], fun @@ -30,6 +30,24 @@ layui.define(['form', 'admin', 'laydate', 'common','sessions','reskpilist'], fun
30 ,range: true 30 ,range: true
31 }); 31 });
32 var resType = localStorage.getItem("currentResType"); 32 var resType = localStorage.getItem("currentResType");
  33 +
  34 + // 获取合并通知开关是否开启
  35 + getNoticeMergeFlag();
  36 + function getNoticeMergeFlag(){
  37 + admin.req({
  38 + url: common.domainName + '/api-web/manage/ddic/findSucDdics/noticeMergeFlag'
  39 + , method: 'POST'
  40 + , async: false
  41 + , success: function (res) {
  42 + $.each(res.data, function (i, v) {
  43 + if(v.ddicCode == 'on'){
  44 + $('#noticeMergeTab').show();
  45 + }
  46 + });
  47 + }
  48 + })
  49 + }
  50 +
33 //编辑 51 //编辑
34 if(data && data.id){ 52 if(data && data.id){
35 admin.req({ 53 admin.req({
@@ -48,6 +66,14 @@ layui.define(['form', 'admin', 'laydate', 'common','sessions','reskpilist'], fun @@ -48,6 +66,14 @@ layui.define(['form', 'admin', 'laydate', 'common','sessions','reskpilist'], fun
48 $("#alarmPolicyType").val(res.object.policyType); 66 $("#alarmPolicyType").val(res.object.policyType);
49 } 67 }
50 }); 68 });
  69 + // 获取通知合并策略的表达式
  70 + admin.req({
  71 + url:domainName + '/api-web/policyMerge/get?noticeMergePolicyId='+data.id
  72 + ,done:function (res){
  73 + $("#noticeMergeFlagExpr").val(res.data[0].noticeMergeExpr);
  74 + }
  75 + });
  76 +
51 }else{ 77 }else{
52 $("#seriousTimes").val('00:00:00 - 23:59:59'); 78 $("#seriousTimes").val('00:00:00 - 23:59:59');
53 $("#importantTimes").val('00:00:00 - 23:59:59'); 79 $("#importantTimes").val('00:00:00 - 23:59:59');
@@ -179,7 +205,85 @@ layui.define(['form', 'admin', 'laydate', 'common','sessions','reskpilist'], fun @@ -179,7 +205,85 @@ layui.define(['form', 'admin', 'laydate', 'common','sessions','reskpilist'], fun
179 data.seriousTimes = $("#seriousTimes").val(); 205 data.seriousTimes = $("#seriousTimes").val();
180 data.importantTimes = $("#importantTimes").val(); 206 data.importantTimes = $("#importantTimes").val();
181 data.commonlyTimes = $("#commonlyTimes").val(); 207 data.commonlyTimes = $("#commonlyTimes").val();
  208 + var that = this;
182 209
  210 + if(!data.kpiId){
  211 + layer.msg("请先选择指标!", {
  212 + icon: 7
  213 + , time: 3000
  214 + });
  215 + return false;
  216 + }
  217 +
  218 + if(!data.kpiId || data.kpiId == ''){
  219 + layer.msg("请先选择指标!", {
  220 + icon: 7
  221 + , time: 3000
  222 + });
  223 + return false;
  224 + }
  225 +
  226 + if(!data.alarmContentExpr || data.alarmContentExpr == ''){
  227 + layer.msg("请先填写告警内容描述表达式!", {
  228 + icon: 7
  229 + , time: 3000
  230 + });
  231 + return false;
  232 + }
  233 +
  234 + if(!data.alarmContentExpr || data.alarmContentExpr == ''){
  235 + layer.msg("请先填写告警内容描述表达式!", {
  236 + icon: 7
  237 + , time: 3000
  238 + });
  239 + return false;
  240 + }
  241 +
  242 + var importantPolicy = data.seriousPolicy;
  243 + var importantExpr = data.importantPolicy;
  244 + var commonlyPolicy = data.commonlyPolicy;
  245 + if((!importantPolicy || importantPolicy == '') && (!importantExpr || importantExpr == '') && (!commonlyPolicy || commonlyPolicy == '')){
  246 + layer.msg("严重、重要和一般告警的表达式必须有一项不为空!", {
  247 + icon: 7
  248 + , time: 3000
  249 + });
  250 + return false;
  251 + }
  252 +
  253 + if(!data.noticeMergeFlagExpr || data.noticeMergeFlagExpr == ''){
  254 + layer.msg("请先填写通知合并策略描述表达式!", {
  255 + icon: 7
  256 + , time: 3000
  257 + });
  258 + return false;
  259 + }
  260 +
  261 +
  262 + /**
  263 + * 保存通知合并策略
  264 + */
  265 + var noticeMergeFlagExpr = $("#noticeMergeFlagExpr").val()
  266 + function saveNoticeMerge(id){
  267 + var noticeMergeData = {
  268 + "mergePolicyId": id,
  269 + "mergePolicyName": data.alarmPolicyName,
  270 + "mergePolicyDesc": data.alarmPolicyName,
  271 + "noticeMergeExpr": noticeMergeFlagExpr,
  272 + "policyType": data.policyType,
  273 + "kpiId": data.kpiId
  274 + }
  275 + admin.req({
  276 + url : domainName + '/api-web/policyMerge/save?access_token='+accessToken
  277 + ,data:JSON.stringify(noticeMergeData)
  278 + ,type:'post'
  279 + ,contentType: "application/json; charset=utf-8"
  280 + ,done:function (res){
  281 + if(!res.success){
  282 + layer.msg(res.msg ? res.msg : '通知合并策略保存失败', { offset: '15px' , icon: 7 , time: 1000 });
  283 + }
  284 + }
  285 + });
  286 + }
183 charToExpr(data, 'alarmContentExpr'); 287 charToExpr(data, 'alarmContentExpr');
184 charToExpr(data, 'cleanPolicy'); 288 charToExpr(data, 'cleanPolicy');
185 charToExpr(data, 'commonlyExpr'); 289 charToExpr(data, 'commonlyExpr');
@@ -187,6 +291,7 @@ layui.define(['form', 'admin', 'laydate', 'common','sessions','reskpilist'], fun @@ -187,6 +291,7 @@ layui.define(['form', 'admin', 'laydate', 'common','sessions','reskpilist'], fun
187 charToExpr(data, 'seriousExpr'); 291 charToExpr(data, 'seriousExpr');
188 292
189 form.on('submit(add-alarmpolicy-form)',function () { 293 form.on('submit(add-alarmpolicy-form)',function () {
  294 + delete data.noticeMergeFlagExpr;
190 admin.req({ 295 admin.req({
191 url : domainName + '/api-web/alarmPolicy/save?access_token='+accessToken 296 url : domainName + '/api-web/alarmPolicy/save?access_token='+accessToken
192 ,data:JSON.stringify(data) 297 ,data:JSON.stringify(data)
@@ -194,6 +299,9 @@ layui.define(['form', 'admin', 'laydate', 'common','sessions','reskpilist'], fun @@ -194,6 +299,9 @@ layui.define(['form', 'admin', 'laydate', 'common','sessions','reskpilist'], fun
194 ,contentType: "application/json; charset=utf-8" 299 ,contentType: "application/json; charset=utf-8"
195 ,done:function (res){ 300 ,done:function (res){
196 if(res.success){ 301 if(res.success){
  302 + // 保存通知合并策略
  303 + saveNoticeMerge(res.str);
  304 +
197 localStorage.setItem("detailPageOfcustomPolicyId",res.str) 305 localStorage.setItem("detailPageOfcustomPolicyId",res.str)
198 layer.msg(res.msg, { offset: '15px' , icon: 1 , time: 1000 },function (){ 306 layer.msg(res.msg, { offset: '15px' , icon: 1 , time: 1000 },function (){
199 localStorage.removeItem("currentResType"); 307 localStorage.removeItem("currentResType");
@@ -263,4 +371,4 @@ layui.define(['form', 'admin', 'laydate', 'common','sessions','reskpilist'], fun @@ -263,4 +371,4 @@ layui.define(['form', 'admin', 'laydate', 'common','sessions','reskpilist'], fun
263 $('#add-alarmpolicy-form').find('[name="policyType"]').attr("disabled","disabled"); 371 $('#add-alarmpolicy-form').find('[name="policyType"]').attr("disabled","disabled");
264 } 372 }
265 }); 373 });
266 -});  
  374 +});
@@ -443,6 +443,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions'], function @@ -443,6 +443,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions'], function
443 //查看资源订阅列表 443 //查看资源订阅列表
444 $(".view-alarmsubscribe-resource").on("click",function (){ 444 $(".view-alarmsubscribe-resource").on("click",function (){
445 if($(this).text() == '0'){ 445 if($(this).text() == '0'){
  446 + layer.msg('暂无订阅资源,请先订阅!', {icon: 7, time: 3000});
446 return false; 447 return false;
447 } 448 }
448 449
@@ -714,6 +715,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions'], function @@ -714,6 +715,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions'], function
714 //查看指标订阅列表 715 //查看指标订阅列表
715 $(".view-alarmsubscribe-kpi").on("click",function (){ 716 $(".view-alarmsubscribe-kpi").on("click",function (){
716 if($(this).text() == '0'){ 717 if($(this).text() == '0'){
  718 + layer.msg('暂无订阅指标,请先订阅!', {icon: 7, time: 3000});
717 return false; 719 return false;
718 } 720 }
719 var subId = $(this).data("id"); 721 var subId = $(this).data("id");
@@ -776,6 +778,10 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions'], function @@ -776,6 +778,10 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions'], function
776 778
777 //查看资源类型订阅列表 779 //查看资源类型订阅列表
778 $(".view-alarmsubscribe-resType").on("click", function () { 780 $(".view-alarmsubscribe-resType").on("click", function () {
  781 + if($(this).text() == '0'){
  782 + layer.msg('暂无订阅资源类型,请先订阅!', {icon: 7, time: 3000});
  783 + return false;
  784 + }
779 var subId = $(this).data("id"); 785 var subId = $(this).data("id");
780 common.openWin("template/res/typeSubscribeList", "选择资源类型", { 786 common.openWin("template/res/typeSubscribeList", "选择资源类型", {
781 subId: subId, 787 subId: subId,
@@ -788,6 +794,10 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions'], function @@ -788,6 +794,10 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions'], function
788 794
789 //查看业务类型订阅列表 795 //查看业务类型订阅列表
790 $(".view-alarmsubscribe-busId").on("click", function () { 796 $(".view-alarmsubscribe-busId").on("click", function () {
  797 + if($(this).text() == '0'){
  798 + layer.msg('暂无订阅业务系统,请先订阅!', {icon: 7, time: 3000});
  799 + return false;
  800 + }
791 var subId = $(this).data("id"); 801 var subId = $(this).data("id");
792 common.openWin("template/res/typeSubscribeList", "选择业务系统", { 802 common.openWin("template/res/typeSubscribeList", "选择业务系统", {
793 subId: subId, 803 subId: subId,
@@ -87,7 +87,9 @@ layui.define(['table', 'form', 'laydate', 'admin', 'layer', 'laytpl', 'common', @@ -87,7 +87,9 @@ layui.define(['table', 'form', 'laydate', 'admin', 'layer', 'laytpl', 'common',
87 keyword: $("#checkTemplate_keyword").val(), 87 keyword: $("#checkTemplate_keyword").val(),
88 resType:resType 88 resType:resType
89 } 89 }
90 - , height: 'full-200' 90 + //lsq 弹框中空白太多,高度调整 2022-06-07
  91 + // , height: 'full-200'
  92 + , height: 'full-445'
91 , cellMinWidth: 80 93 , cellMinWidth: 80
92 , page: { 94 , page: {
93 layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'] 95 layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
@@ -660,6 +660,7 @@ layui.define(['xmSelect', 'md5'], function (exports) { @@ -660,6 +660,7 @@ layui.define(['xmSelect', 'md5'], function (exports) {
660 layer.open(Object.assign({ 660 layer.open(Object.assign({
661 title: [name, 'font-size:18px;'], 661 title: [name, 'font-size:18px;'],
662 type: 1, 662 type: 1,
  663 + id:(new Date()).getTime(),
663 area: area, 664 area: area,
664 resize: false, 665 resize: false,
665 shadeClose: true,//开启遮罩层 666 shadeClose: true,//开启遮罩层
@@ -24,10 +24,42 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele @@ -24,10 +24,42 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele
24 //资源详细页面相关调用函数,包含各种展示类型的 24 //资源详细页面相关调用函数,包含各种展示类型的
25 25
26 let editKpiList = []; 26 let editKpiList = [];
  27 + let statusKpiList=[];//lsq 状态指标数据 2022-06-08
27 var obj = { 28 var obj = {
28 detailTimer:[], 29 detailTimer:[],
29 timerTime: 180000, 30 timerTime: 180000,
30 sessions: layui.sessions, 31 sessions: layui.sessions,
  32 + getStatusKpiList:function (){
  33 + //start lsq 根据kpiid获取是否是指标状态 2022-05-23
  34 + if(statusKpiList.length != 0){
  35 + return statusKpiList;
  36 + }
  37 + statusKpiList = [];
  38 + admin.req({
  39 + url: common.domainName + '/api-web/manage/kpi/page?' +
  40 + 'isWarning=&isTrend=&kpiLevel=&ignoreCnt=&startTime=&endTime=&kpiPower=',
  41 + data: {
  42 + page:1,limit:99999,
  43 + kpiName: '',resType: '',kpiIdent: 2,kpiCategory: '',
  44 + kpiDataType:'',kpiUnit:'',isWarning:'',isTrend:'',
  45 + kpiLevel:'',ignoreCnt:'',startTime:'',endTime:'',kpiPower:''
  46 + },
  47 + success(response) {
  48 + let arr=[];
  49 + if (response && response.success) {
  50 + arr=response.data;
  51 + arr.map(item=>{
  52 + statusKpiList.push(item.kpiId)
  53 + })
  54 + } else {
  55 + // layer.msg('状态指标获取失败!', {icon: 2});
  56 + }
  57 + },
  58 + error(){
  59 + // layer.msg('状态指标获取失败!', {icon: 2});
  60 + }
  61 + });
  62 + },
31 // 获取编辑指标 63 // 获取编辑指标
32 getEditKpiList:function (){ 64 getEditKpiList:function (){
33 var editFlag = localStorage.getItem("editFlag");//是否编辑状态 65 var editFlag = localStorage.getItem("editFlag");//是否编辑状态
@@ -74,6 +106,9 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele @@ -74,6 +106,9 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele
74 {"flag": "base","name": "最近采集时间","id": "KPIF74D9D2B","value": "2019-12-16 10:04:54","status": "0" }]} 106 {"flag": "base","name": "最近采集时间","id": "KPIF74D9D2B","value": "2019-12-16 10:04:54","status": "0" }]}
75 */ 107 */
76 renderText: function (targetId, resId, kpiId, fn, hasTotal,flag,isBasic) { 108 renderText: function (targetId, resId, kpiId, fn, hasTotal,flag,isBasic) {
  109 + //start lsq 状态信息的状态也增加下探 202-06-08
  110 + let statusF=false;//是否为状态信息
  111 + //end lsq 2022-06-08
77 var url = "/api-web/detail/block?resId=" + resId + "&kpiId=" + kpiId + "&hasTotal=" + hasTotal; 112 var url = "/api-web/detail/block?resId=" + resId + "&kpiId=" + kpiId + "&hasTotal=" + hasTotal;
78 if (flag) { 113 if (flag) {
79 url += '&flag=' + flag; 114 url += '&flag=' + flag;
@@ -97,6 +132,12 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele @@ -97,6 +132,12 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele
97 var fontColor=''; 132 var fontColor='';
98 var valueStr = ''; 133 var valueStr = '';
99 var titleStr = ''; 134 var titleStr = '';
  135 + //start lsq 判断当前kpiId是否在状态指标数据列表中 2022-06-08
  136 + let status=statusKpiList.indexOf(v.id);
  137 + if(status!=-1){
  138 + statusF=true;
  139 + }
  140 + //end lsq 2022-06-08
100 if(v.id == 'KPIE13DD9A3' || v.id == 'KPI02786E8D'){ 141 if(v.id == 'KPIE13DD9A3' || v.id == 'KPI02786E8D'){
101 valueStr = laytpl($("#linkStateDetailTpl").html()).render({linkStateList: v.value}); 142 valueStr = laytpl($("#linkStateDetailTpl").html()).render({linkStateList: v.value});
102 //获取flag 143 //获取flag
@@ -124,10 +165,17 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele @@ -124,10 +165,17 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele
124 var tips = '<a class="detail_row_menu hide">\n' + 165 var tips = '<a class="detail_row_menu hide">\n' +
125 '<img style="width: 17px;height: 17px;" src="/src/style/img/icon_row_menu.png">\n' + 166 '<img style="width: 17px;height: 17px;" src="/src/style/img/icon_row_menu.png">\n' +
126 '</a>' 167 '</a>'
  168 + var tips = '<a class="detail_row_menu hide" data-statusf='+statusF+' data-id='+v.id+' data-flag='+v.flag+
  169 + ' data-name='+v.name+' data-kpiname='+v.name+' data-iswarning=1 data-ident=1' +
  170 + ' data-trend=0 data-unit="" data-hidem="hidem" data-nature="true" ' +
  171 + // ' data-restype='+((data && data[0])?data[0].resType:"")+'>\n' +
  172 + ' data-restype='+(v.resType?v.resType:"")+'>\n' +
  173 + '<img style="width: 17px;height: 17px;" src="/src/style/img/icon_row_menu.png">\n' +
  174 + '</a>'
127 var menuId = ""; 175 var menuId = "";
128 - if (v.id == 'KPIE13DD9A3' || v.id == 'KPI02786E8D') { 176 + if (v.id == 'KPIE13DD9A3' || v.id == 'KPI02786E8D' || status!=-1) {
129 v.name = v.name + tips; 177 v.name = v.name + tips;
130 - menuId = "id=\"" + targetId + "_detail_row_menu\""; 178 + menuId = "id=\"" + targetId + "_detail_row_menu\" class='statusMenu'";
131 } 179 }
132 var $html = addIconByValue(valueStr); 180 var $html = addIconByValue(valueStr);
133 var resStyle = obj.alarmEleMatchStyle(v.flag, v.id); 181 var resStyle = obj.alarmEleMatchStyle(v.flag, v.id);
@@ -139,23 +187,27 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele @@ -139,23 +187,27 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele
139 fn && fn(); 187 fn && fn();
140 188
141 //初始化监听告警压制需要的数据 189 //初始化监听告警压制需要的数据
142 - var rowMenu = $('#' + targetId).find('.detail_row_menu').eq(0);  
143 - rowMenu.attr("data-id", kpiIdList);  
144 - rowMenu.attr("data-flag", flags);  
145 - rowMenu.attr("data-name", "监控连接状态");  
146 - rowMenu.attr("data-kpiname", "监控连接状态");  
147 - rowMenu.attr("data-iswarning", "1");  
148 - rowMenu.attr("data-ident", "1");  
149 - rowMenu.attr("data-trend", "0");  
150 - rowMenu.attr("data-unit", "");  
151 - rowMenu.attr('data-hidem', 'true');  
152 - rowMenu.attr('data-nature', 'true');//性能趋势  
153 - // rowMenu.attr('data-canca', data.canCA);  
154 - // rowMenu.attr('data-incaing', data.inCAing);  
155 - // rowMenu.attr('data-restype', data.resType);  
156 - rowMenu.attr('data-restype', (data && data[0])?data[0].resType:''); 190 + if(!statusF){
  191 + var rowMenu = $('#' + targetId).find('.detail_row_menu').eq(0);
  192 + rowMenu.attr("data-id", kpiIdList);
  193 + rowMenu.attr("data-flag", flags);
  194 + rowMenu.attr("data-name", "监控连接状态");
  195 + rowMenu.attr("data-kpiname", "监控连接状态");
  196 + rowMenu.attr("data-iswarning", "1");
  197 + rowMenu.attr("data-ident", "1");
  198 + rowMenu.attr("data-trend", "0");
  199 + rowMenu.attr("data-unit", "");
  200 + rowMenu.attr('data-hidem', 'true');
  201 + rowMenu.attr('data-nature', 'true');//性能趋势
  202 + // rowMenu.attr('data-canca', data.canCA);
  203 + // rowMenu.attr('data-incaing', data.inCAing);
  204 + // rowMenu.attr('data-restype', data.resType);
  205 + rowMenu.attr('data-restype', (data && data[0])?data[0].resType:'');
  206 + }
  207 +
157 //监听告警压制等操作配置 208 //监听告警压制等操作配置
158 - $('#' + targetId + "_detail_row_menu").hover(function () { 209 + // $('#' + targetId + "_detail_row_menu").hover(function () {
  210 + $('#' + targetId + "_detail_row_menu.statusMenu").hover(function () {
159 var $that = $(this); 211 var $that = $(this);
160 var $btn = $that.find(".detail_row_menu"); 212 var $btn = $that.find(".detail_row_menu");
161 if ($btn.length > 0) { 213 if ($btn.length > 0) {
@@ -175,6 +227,9 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele @@ -175,6 +227,9 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele
175 * @param cols 指定列(一组key value为一列) 227 * @param cols 指定列(一组key value为一列)
176 */ 228 */
177 renderTextCols: function (targetId, resId, kpiId, cols, isBasic) { 229 renderTextCols: function (targetId, resId, kpiId, cols, isBasic) {
  230 + //start lsq 状态信息的状态也增加下探 202-06-08
  231 + let statusF=false;//是否为状态信息
  232 + //end lsq 2022-06-08
178 var url = "/api-web/detail/block?resId=" + resId + "&kpiId=" + kpiId; 233 var url = "/api-web/detail/block?resId=" + resId + "&kpiId=" + kpiId;
179 if (isBasic) { 234 if (isBasic) {
180 url += '&isBasic=' + isBasic; 235 url += '&isBasic=' + isBasic;
@@ -184,6 +239,12 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele @@ -184,6 +239,12 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele
184 }).done(function (res) { 239 }).done(function (res) {
185 var flags = ""; 240 var flags = "";
186 var kpiIdList= ""; 241 var kpiIdList= "";
  242 + //start lsq 判断当前kpiId是否在状态指标数据列表中 2022-06-08
  243 + let status=statusKpiList.indexOf(v.id);
  244 + if(status!=-1){
  245 + statusF=true;
  246 + }
  247 + //end lsq 2022-06-08
187 var data = res.data; 248 var data = res.data;
188 if (data.length > 0) { 249 if (data.length > 0) {
189 var dataArr = common.splieceGroup(data, cols); 250 var dataArr = common.splieceGroup(data, cols);
@@ -215,13 +276,21 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele @@ -215,13 +276,21 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele
215 //获取kpi 276 //获取kpi
216 kpiIdList += ar.id + ","; 277 kpiIdList += ar.id + ",";
217 } 278 }
218 - var tips = '<a class="detail_row_menu hide">\n' + 279 + //start lsq 更改下探图标的属性值 2022-06-08
  280 + /* var tips = '<a class="detail_row_menu hide">\n' +
  281 + '<img style="width: 17px;height: 17px;" src="/src/style/img/icon_row_menu.png">\n' +
  282 + '</a>'*/
  283 + var tips = '<a class="detail_row_menu hide" data-statusf='+statusF+' data-id='+v.id+' data-flag='+v.flag+
  284 + ' data-name='+v.name+' data-kpiname='+v.name+' data-iswarning=1 data-ident=1' +
  285 + ' data-trend=0 data-unit="" data-hidem="hidem" data-nature="true" ' +
  286 + ' data-restype='+(v.resType?v.resType:"")+'>\n' +
219 '<img style="width: 17px;height: 17px;" src="/src/style/img/icon_row_menu.png">\n' + 287 '<img style="width: 17px;height: 17px;" src="/src/style/img/icon_row_menu.png">\n' +
220 '</a>' 288 '</a>'
  289 + //end lsq 2022-06-08
221 var menuId = ""; 290 var menuId = "";
222 - if (ar.id == 'KPIE13DD9A3' || ar.id == 'KPI02786E8D') { 291 + if (ar.id == 'KPIE13DD9A3' || ar.id == 'KPI02786E8D' || status!=-1) {
223 ar.name = ar.name + tips; 292 ar.name = ar.name + tips;
224 - menuId = "id=\"" + targetId + "_detail_row_menu\""; 293 + menuId = "id=\"" + targetId + "_detail_row_menu\" class='statusMenu'";
225 } 294 }
226 var $html = addIconByValue(valueStr); 295 var $html = addIconByValue(valueStr);
227 var resStyle = obj.alarmEleMatchStyle(ar.flag, ar.id); 296 var resStyle = obj.alarmEleMatchStyle(ar.flag, ar.id);
@@ -243,20 +312,24 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele @@ -243,20 +312,24 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele
243 $("#" + targetId).html(li); 312 $("#" + targetId).html(li);
244 } 313 }
245 //初始化监听告警压制需要的数据 314 //初始化监听告警压制需要的数据
246 - var rowMenu = $('#' + targetId).find('.detail_row_menu').eq(0);  
247 - rowMenu.attr("data-id", kpiIdList);  
248 - rowMenu.attr("data-flag", flags);  
249 - rowMenu.attr("data-name", "监控连接状态");  
250 - rowMenu.attr("data-kpiname", "监控连接状态");  
251 - rowMenu.attr("data-iswarning", "1");  
252 - rowMenu.attr("data-ident", "1");  
253 - rowMenu.attr("data-trend", "0");  
254 - rowMenu.attr("data-unit", "");  
255 - rowMenu.attr('data-hidem', 'true');  
256 - rowMenu.attr('data-nature', 'true');//性能趋势  
257 - rowMenu.attr('data-restype', (data && data[0])?data[0].resType:''); 315 + if(!statusF){
  316 + var rowMenu = $('#' + targetId).find('.detail_row_menu').eq(0);
  317 + rowMenu.attr("data-id", kpiIdList);
  318 + rowMenu.attr("data-flag", flags);
  319 + rowMenu.attr("data-name", "监控连接状态");
  320 + rowMenu.attr("data-kpiname", "监控连接状态");
  321 + rowMenu.attr("data-iswarning", "1");
  322 + rowMenu.attr("data-ident", "1");
  323 + rowMenu.attr("data-trend", "0");
  324 + rowMenu.attr("data-unit", "");
  325 + rowMenu.attr('data-hidem', 'true');
  326 + rowMenu.attr('data-nature', 'true');//性能趋势
  327 + rowMenu.attr('data-restype', (data && data[0])?data[0].resType:'');
  328 + }
  329 +
258 //监听告警压制等操作配置 330 //监听告警压制等操作配置
259 - $('#' + targetId + "_detail_row_menu").hover(function () { 331 + // $('#' + targetId + "_detail_row_menu").hover(function () {
  332 + $('#' + targetId + "_detail_row_menu.statusMenu").hover(function () {
260 var $that = $(this); 333 var $that = $(this);
261 var $btn = $that.find(".detail_row_menu"); 334 var $btn = $that.find(".detail_row_menu");
262 if ($btn.length > 0) { 335 if ($btn.length > 0) {
@@ -4138,6 +4211,8 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele @@ -4138,6 +4211,8 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele
4138 var canCA = $menu.data('canca'); 4211 var canCA = $menu.data('canca');
4139 var inCAing = $menu.data('incaing'); 4212 var inCAing = $menu.data('incaing');
4140 var nature = $menu.data('nature'); 4213 var nature = $menu.data('nature');
  4214 + //lsq 状态信息无其他下探 2022-06-08
  4215 + var statusF = $menu.data('statusf');
4141 var menubox = '<div class="detail_menubox" id="detail_menubox_id" style="color:#666;"><ul>'; 4216 var menubox = '<div class="detail_menubox" id="detail_menubox_id" style="color:#666;"><ul>';
4142 if (!nature) { 4217 if (!nature) {
4143 menubox += 4218 menubox +=
@@ -4150,8 +4225,10 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele @@ -4150,8 +4225,10 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele
4150 if (!nature) { 4225 if (!nature) {
4151 menubox += '<li type="t"><i class="layui-icon">&#xe62c;</i>性能趋势</li>'; 4226 menubox += '<li type="t"><i class="layui-icon">&#xe62c;</i>性能趋势</li>';
4152 } 4227 }
4153 - 4228 + // if(!statusF){
4154 menubox += '<li type="n"><i class="layui-icon">&#xe758;</i>压制次数</li>'; 4229 menubox += '<li type="n"><i class="layui-icon">&#xe758;</i>压制次数</li>';
  4230 + // }
  4231 +
4155 // Start Wang 2022/3/28 14:06 833:屏蔽纳入容量预测按钮 https://hgkj.zentaopm.com/task-view-833.html 4232 // Start Wang 2022/3/28 14:06 833:屏蔽纳入容量预测按钮 https://hgkj.zentaopm.com/task-view-833.html
4156 // 后面计划将功能作为配置项 4233 // 后面计划将功能作为配置项
4157 // if (canCA) { 4234 // if (canCA) {
@@ -4182,45 +4259,25 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele @@ -4182,45 +4259,25 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele
4182 flag = flag.replace(/^\s+|\s+$/g, ""); 4259 flag = flag.replace(/^\s+|\s+$/g, "");
4183 } 4260 }
4184 //start lsq 根据kpiid获取是否是指标状态 2022-05-23 4261 //start lsq 根据kpiid获取是否是指标状态 2022-05-23
4185 - admin.req({  
4186 - url: common.domainName + '/api-web/manage/kpi/page?' +  
4187 - 'isWarning=&isTrend=&kpiLevel=&ignoreCnt=&startTime=&endTime=&kpiPower=',  
4188 - data: {  
4189 - page:1,limit:99999,  
4190 - kpiName: '',resType: '',kpiIdent: 2,kpiCategory: '',  
4191 - kpiDataType:'',kpiUnit:'',isWarning:'',isTrend:'',  
4192 - kpiLevel:'',ignoreCnt:'',startTime:'',endTime:'',kpiPower:''  
4193 - },  
4194 - success(response) {  
4195 - let arr=[];  
4196 - if (response && response.success) {  
4197 - arr=response.data;  
4198 - let idArr=[];  
4199 - let idStr='';  
4200 - if(id.indexOf(',')!=-1){  
4201 - idArr=id.split(',');  
4202 - idStr=idArr[0];  
4203 - }else{  
4204 - idStr=id;  
4205 - }  
4206 - let isKpi=false;  
4207 - arr.map(item=>{  
4208 - if(idStr==item.kpiId){  
4209 - isKpi=true;  
4210 - }  
4211 - })  
4212 - if(isKpi){  
4213 - let menuboxStr = '<li type="link-status-kpi"><i class="layui-icon">&#xe758;</i>状态指标</li>';  
4214 - $("#detail_menubox_id ul").append(menuboxStr)  
4215 - }  
4216 - } else {  
4217 - // layer.msg('状态指标获取失败!', {icon: 2});  
4218 - }  
4219 - },  
4220 - error(){  
4221 - // layer.msg('状态指标获取失败!', {icon: 2}); 4262 + //start lsq 根据kpiid获取是否是指标状态 2022-05-23
  4263 + let idArr=[];
  4264 + let idStr='';
  4265 + if(id.indexOf(',')!=-1){
  4266 + idArr=id.split(',');
  4267 + idStr=idArr[0];
  4268 + }else{
  4269 + idStr=id;
  4270 + }
  4271 + let isKpi=false;
  4272 + statusKpiList.map(item=>{
  4273 + if(idStr==item){
  4274 + isKpi=true;
4222 } 4275 }
4223 - }); 4276 + })
  4277 + if(isKpi){
  4278 + let menuboxStr = '<li type="link-status-kpi"><i class="layui-icon">&#xe758;</i>状态指标</li>';
  4279 + $("#detail_menubox_id ul").append(menuboxStr)
  4280 + }
4224 setTimeout(function (){ 4281 setTimeout(function (){
4225 //end lsq 2022-05-23 4282 //end lsq 2022-05-23
4226 //菜单点击事件 4283 //菜单点击事件
@@ -4289,7 +4346,8 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele @@ -4289,7 +4346,8 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele
4289 } 4346 }
4290 }); 4347 });
4291 } 4348 }
4292 - 4349 + //lsq 页面加载完就调用一下获取状态指标列表数据 2022-06-08
  4350 + obj.getStatusKpiList();
4293 //对外暴露的接口 4351 //对外暴露的接口
4294 exports('commonDetail', obj); 4352 exports('commonDetail', obj);
4295 }); 4353 });
@@ -162,6 +162,12 @@ layui.define(['common', 'swiper', 'admin','commonDetail','mxClient','sessions',' @@ -162,6 +162,12 @@ layui.define(['common', 'swiper', 'admin','commonDetail','mxClient','sessions','
162 // currentBizId = bizlist[0].busId; 162 // currentBizId = bizlist[0].busId;
163 } 163 }
164 164
  165 + $.each(bizlist,function (i,v) {
  166 + if (bizlist[0].title == v.title) {
  167 + $("#"+v.busId).show();
  168 + }
  169 + });
  170 +
165 //点击业务区域弹出提示框 171 //点击业务区域弹出提示框
166 $('#indexbizhealth [data-index-banner-item="type"]').on("contextmenu", function (e) { 172 $('#indexbizhealth [data-index-banner-item="type"]').on("contextmenu", function (e) {
167 $('[type="t"]').show(); 173 $('[type="t"]').show();
@@ -305,6 +311,29 @@ layui.define(['common', 'swiper', 'admin','commonDetail','mxClient','sessions',' @@ -305,6 +311,29 @@ layui.define(['common', 'swiper', 'admin','commonDetail','mxClient','sessions','
305 $("#indexActiveAlarmList").html('<li style="width:390px;"><p>无告警</p></li>'); 311 $("#indexActiveAlarmList").html('<li style="width:390px;"><p>无告警</p></li>');
306 }); 312 });
307 } 313 }
  314 + var resourceHealthTips ;
  315 + $(".detail_base_info").hover(function() {
  316 + openMsg();
  317 + }, function() {
  318 + layer.close(resourceHealthTips);
  319 + });
  320 + function openMsg() {
  321 + resourceHealthTips = layer.tips("<span style='color:#585858;'>" +
  322 + "按照积分制方式计算业务系统健康状态,即图标颜色:<br>" +
  323 + "&nbsp;&nbsp;&nbsp;&nbsp;• 告警:1个严重告警计10分;1个重要告警计5分;1个一般告警计1分<br>" +
  324 + "&nbsp;&nbsp;&nbsp;&nbsp;• 所有计分累加<br>" +
  325 + "&nbsp;&nbsp;&nbsp;&nbsp;起始分为0分,最后得分为计分和;<br>" +
  326 + "<br>" +
  327 + "得分与健康状态关系:<br>" +
  328 + "&nbsp;&nbsp;&nbsp;&nbsp;• 0:状态正常,无告警,颜色为<a style='color: #00a522'>绿色</a><br>" +
  329 + "&nbsp;&nbsp;&nbsp;&nbsp;• 大于0且小于等于10:普通问题,最多1个严重告警,颜色为<a style='color: #a4910a'>深黄</a><br>" +
  330 + "&nbsp;&nbsp;&nbsp;&nbsp;• 大于10且小于等于30:一般问题,最多3个严重告警,颜色为<a style='color: #e2c705'>黄色</a><br>" +
  331 + "&nbsp;&nbsp;&nbsp;&nbsp;• 大于30且小于等于50:严重问题,最多5个严重告警,颜色为<a style='color: #ffaf00'>橙色</a><br>" +
  332 + "&nbsp;&nbsp;&nbsp;&nbsp;• 大于50且小于等于100:比较严重,最多10个严重告警,颜色为<a style='color: #f65f0b'>深橙</a><br>" +
  333 + "&nbsp;&nbsp;&nbsp;&nbsp;• 大于100:非常严重,10个严重告警以上,颜色为<a style='color: #d81e06'>红色<br>" +
  334 + "</span>",
  335 + '.detail_base_info',{tips:[2,'#F0F0F0'], time:0,area: ['auto', 'auto']});
  336 + }
308 337
309 /** 338 /**
310 * 首页右下角两个功能的时间 339 * 首页右下角两个功能的时间
@@ -338,14 +367,15 @@ layui.define(['common', 'swiper', 'admin','commonDetail','mxClient','sessions',' @@ -338,14 +367,15 @@ layui.define(['common', 'swiper', 'admin','commonDetail','mxClient','sessions','
338 setDefault('select-content-ul',warnVal,'#warn-text-view'); 367 setDefault('select-content-ul',warnVal,'#warn-text-view');
339 setDefault('select-content-ul-bus',busVal,'#bus-text-view'); 368 setDefault('select-content-ul-bus',busVal,'#bus-text-view');
340 369
  370 +
341 // Start 告警级别默认为严重告警,点击左下角选择告警级别,页面的小红点切换不同告警的数量,item根据告警数量进行排序 LSQ 2021/12/29 19:37 371 // Start 告警级别默认为严重告警,点击左下角选择告警级别,页面的小红点切换不同告警的数量,item根据告警数量进行排序 LSQ 2021/12/29 19:37
342 - $(".select-total").hide(); 372 + $(".select-serious").hide();
343 $(".select-important").hide(); 373 $(".select-important").hide();
344 $(".select-normal").hide(); 374 $(".select-normal").hide();
345 var itemArr=$(".index-banner-item"); 375 var itemArr=$(".index-banner-item");
346 itemArr.map((index,item)=>{ 376 itemArr.map((index,item)=>{
347 - if($(item).data('serious')=='0'){  
348 - $(item).find('.select-serious').hide(); 377 + if($(item).data('total')=='0'){
  378 + $(item).find('.select-total').hide();
349 } 379 }
350 $(item).css('order',$(item).data('serious')) 380 $(item).css('order',$(item).data('serious'))
351 }) 381 })
@@ -113,6 +113,8 @@ layui.define(['table', 'form', 'laydate', 'admin', 'layer', 'laytpl', 'common', @@ -113,6 +113,8 @@ layui.define(['table', 'form', 'laydate', 'admin', 'layer', 'laytpl', 'common',
113 if (configDeptPwdOpen == 1){ 113 if (configDeptPwdOpen == 1){
114 _html += ' <button data-id="'+d.orgId+'" data-password="'+d.orgPassword+'" lay-tips="设置部门默认密码" type="button" class="layui-btn layui-btn-xs layui-btn-normal pwd-org-btn"><i class="layui-icon layui-icon-set"></i></button>'; 114 _html += ' <button data-id="'+d.orgId+'" data-password="'+d.orgPassword+'" lay-tips="设置部门默认密码" type="button" class="layui-btn layui-btn-xs layui-btn-normal pwd-org-btn"><i class="layui-icon layui-icon-set"></i></button>';
115 } 115 }
  116 + _html +='<button data-orgid="'+d.orgId+'" lay-tips="业务授权" type="button" class="layui-btn layui-btn-xs layui-btn-normal org_busType_authorization_btn"><i class="layui-icon layui-icon-menu-fill"></i></button>';
  117 +
116 _html += '</div>'; 118 _html += '</div>';
117 return _html; 119 return _html;
118 } 120 }
@@ -182,6 +184,11 @@ layui.define(['table', 'form', 'laydate', 'admin', 'layer', 'laytpl', 'common', @@ -182,6 +184,11 @@ layui.define(['table', 'form', 'laydate', 'admin', 'layer', 'laytpl', 'common',
182 } 184 }
183 openEditHtml($(this).data("id")) 185 openEditHtml($(this).data("id"))
184 }) 186 })
  187 + //start lsq 业务授权
  188 + $('.org_busType_authorization_btn').unbind().on('click',function () {
  189 +
  190 + busTypeAuthorization($(this).data('orgid'))
  191 + });
185 } 192 }
186 , error(error) { 193 , error(error) {
187 layer.close(loading) 194 layer.close(loading)
@@ -189,6 +196,29 @@ layui.define(['table', 'form', 'laydate', 'admin', 'layer', 'laytpl', 'common', @@ -189,6 +196,29 @@ layui.define(['table', 'form', 'laydate', 'admin', 'layer', 'laytpl', 'common',
189 }) 196 })
190 } 197 }
191 198
  199 + //start lsq 业务类型授权2022-06-10
  200 + function busTypeAuthorization(orgId) {
  201 + var orgIds = [];
  202 + if (orgId){ //增加操作栏中业务类型授权
  203 + orgIds.push(orgId);
  204 + }else{
  205 + }
  206 + if(orgIds.length < 1){
  207 + layer.msg("请勾选需要赋权的部门!", { offset: '15px' , icon: 7 , time: 2000 });
  208 + }else{
  209 + layer.open({
  210 + title: ['业务授权', 'font-size:18px;'],
  211 + type: 2,
  212 + area: ['90%','80%'],
  213 + resize:false,
  214 + content: ['/vue3/index.html#/vue3/orgBustype?orgId=' + orgId, 'no'],
  215 + cancel: function () {
  216 + clearTimeout();
  217 + }
  218 + });
  219 + }
  220 + }
  221 +
192 function saveDeptPwd(conf) { 222 function saveDeptPwd(conf) {
193 loading = layer.load(2); 223 loading = layer.load(2);
194 admin.req({ 224 admin.req({
@@ -191,9 +191,12 @@ layui.define(['table', 'form', 'admin', 'layer', 'upload', 'common', 'sessions', @@ -191,9 +191,12 @@ layui.define(['table', 'form', 'admin', 'layer', 'upload', 'common', 'sessions',
191 } 191 }
192 }, 192 },
193 { 193 {
194 - title: '操作', fixed: 'right', align: 'center',minWidth: 230, 194 + title: '操作', fixed: 'right', align: 'center',minWidth: 280,
195 templet: '<div>' + 195 templet: '<div>' +
196 - '<button data-id="{{d.id}}" lay-tips="删除" type="button" class="layui-btn layui-btn-xs layui-btn-normal user_delete_btn"><i class="layui-icon layui-icon-delete"></i></button>'+ 196 + //lsq 新增变更按钮 2022-05-30
  197 + '<button data-username="{{d.username}}" data-nickname="{{d.nickname}}" lay-tips="人员相关业务变更" type="button" class="layui-btn layui-btn-xs layui-btn-normal user_batch_change_leaders_btn"><i class="layui-icon layui-icon-edit"></i></button>'+
  198 +
  199 + '<button data-id="{{d.id}}" lay-tips="删除" type="button" class="layui-btn layui-btn-xs layui-btn-normal user_delete_btn"><i class="layui-icon layui-icon-delete"></i></button>'+
197 '<button data-id="{{d.id}}" data-username="{{d.username}}" lay-tips="重置密码" type="button" class="layui-btn layui-btn-xs layui-btn-normal user_pass_btn"><i class="layui-icon layui-icon-password"></i></button>'+ 200 '<button data-id="{{d.id}}" data-username="{{d.username}}" lay-tips="重置密码" type="button" class="layui-btn layui-btn-xs layui-btn-normal user_pass_btn"><i class="layui-icon layui-icon-password"></i></button>'+
198 '<button data-username="{{d.username}}" lay-tips="资源类型授权" type="button" class="layui-btn layui-btn-xs layui-btn-normal user_resType_authorization_btn"><i class="layui-icon layui-icon-app"></i></button>'+ 201 '<button data-username="{{d.username}}" lay-tips="资源类型授权" type="button" class="layui-btn layui-btn-xs layui-btn-normal user_resType_authorization_btn"><i class="layui-icon layui-icon-app"></i></button>'+
199 '<button data-username="{{d.username}}" lay-tips="业务授权" type="button" class="layui-btn layui-btn-xs layui-btn-normal user_busType_authorization_btn"><i class="layui-icon layui-icon-menu-fill"></i></button>'+ 202 '<button data-username="{{d.username}}" lay-tips="业务授权" type="button" class="layui-btn layui-btn-xs layui-btn-normal user_busType_authorization_btn"><i class="layui-icon layui-icon-menu-fill"></i></button>'+
@@ -283,6 +286,39 @@ layui.define(['table', 'form', 'admin', 'layer', 'upload', 'common', 'sessions', @@ -283,6 +286,39 @@ layui.define(['table', 'form', 'admin', 'layer', 'upload', 'common', 'sessions',
283 } 286 }
284 }) 287 })
285 } 288 }
  289 + //start lsq 人员相关业务批量变更 2022-05-30
  290 + $('.user_batch_change_leaders_btn').unbind().on('click',function () {
  291 + let param = {
  292 + username: $(this).data('username'),
  293 + resName: ''
  294 + }
  295 + let urlParams='';
  296 + for(let key in param){
  297 + if(param[key]){
  298 + urlParams+=key+'='+param[key]+'&'
  299 + }
  300 + }
  301 + urlParams=urlParams.substr(0,urlParams.length-1);
  302 + let title=`
  303 + <div style="display: flex;justify-content: space-between; align-items: center;">
  304 + <span>"`+$(this).data('nickname')+`"相关业务批量变更</span>
  305 + </div>
  306 + `;
  307 + layer.open({
  308 + title: [title, 'font-size:18px;'],
  309 + type: 2,
  310 + area: ['80%', '90%'],
  311 + shadeClose: true,//开启遮罩层
  312 + id: 'batch_change_leaders',
  313 + content: ['/vue3/index.html#/vue3/batchChangeLeaders?'+urlParams, 'no'],
  314 + success:function (layero,index){
  315 + },
  316 + cancel: function () {
  317 + // clearTimeout(obj.lineTimer);
  318 + }
  319 + });
  320 + });
  321 + //end lsq 2022-05-30
286 // 配置默认首页 322 // 配置默认首页
287 $('.user-config-default-index').unbind('click').on('click', function () { 323 $('.user-config-default-index').unbind('click').on('click', function () {
288 var username = $(this).data('username'); 324 var username = $(this).data('username');
@@ -229,12 +229,24 @@ layui.extend({ @@ -229,12 +229,24 @@ layui.extend({
229 var loginIndex = 'default'; 229 var loginIndex = 'default';
230 // let loginSkin = sessionStorage.getItem("loginSkin"); 230 // let loginSkin = sessionStorage.getItem("loginSkin");
231 //lsq 从cookie中获取登录皮肤 2022-03-31 231 //lsq 从cookie中获取登录皮肤 2022-03-31
232 - let loginSkin = admin.getCookie("loginSkin");  
233 - if(loginSkin && ["default",'skin1','skin2'].indexOf(loginSkin) != -1){  
234 - loginIndex = loginSkin;  
235 - }  
236 -  
237 - path = path + '-' + loginIndex; 232 + //start lsq 从配置文件中获取登录皮肤 2022-06-07
  233 + // let loginSkin = admin.getCookie("loginSkin");
  234 + // http.get(window.location.origin + '/config/getConfig',{configName:'url'},function(res){
  235 + $.ajax({
  236 + url: '/config/getConfig',
  237 + data: {
  238 + configName: 'login'
  239 + },
  240 + async: false,
  241 + success(response) {
  242 + let loginSkin = response.skin;
  243 + if(loginSkin && ["default",'skin1','skin2'].indexOf(loginSkin) != -1){
  244 + loginIndex = loginSkin;
  245 + }
  246 + path = path + '-' + loginIndex;
  247 + }
  248 + });
  249 + //end lsq 2022-06-07
238 } 250 }
239 container.render(path).done(function(){ 251 container.render(path).done(function(){
240 admin.pageType = 'alone'; 252 admin.pageType = 'alone';
@@ -62,13 +62,13 @@ @@ -62,13 +62,13 @@
62 </fieldset> 62 </fieldset>
63 <div class="layui-tab layui-tab-card"> 63 <div class="layui-tab layui-tab-card">
64 <ul class="layui-tab-title"> 64 <ul class="layui-tab-title">
65 - <li class="layui-this">告警内容</li> 65 + <li class="layui-this"><span style="color:red">*</span>告警内容</li>
66 <li>严重</li> 66 <li>严重</li>
67 <li>重要</li> 67 <li>重要</li>
68 - <li>一般</li> 68 + <li>一般告警</li>
69 <li>过滤</li> 69 <li>过滤</li>
70 <li>消除</li> 70 <li>消除</li>
71 -<!-- <li>告警内容表达式</li>--> 71 + <li id="noticeMergeTab" style="display: none"><span style="color:red">*</span>通知合并策略</li>
72 </ul> 72 </ul>
73 <div class="layui-tab-content"> 73 <div class="layui-tab-content">
74 <div class="layui-tab-item layui-show content-tab-item"> 74 <div class="layui-tab-item layui-show content-tab-item">
@@ -355,50 +355,19 @@ @@ -355,50 +355,19 @@
355 </div> 355 </div>
356 </div> 356 </div>
357 </div> 357 </div>
358 -<!-- <div class="layui-tab-item">-->  
359 -<!-- <div class="content-box-group">-->  
360 -<!-- <div class="box-group-left">告警内容表达式</div>-->  
361 -<!-- <div class="box-group-right">-->  
362 -<!-- <div class="layui-form-item">-->  
363 -<!-- <div class="layui-input-block">-->  
364 -<!-- <input type="radio" name="alarmcotent-policy-type" data-flag="alarmcotent" value="1" title="基础" checked lay-filter="alarm-policy-rule-type">-->  
365 -<!-- <input type="radio" name="alarmcotent-policy-type" data-flag="alarmcotent" value="2" title="正则" lay-filter="alarm-policy-rule-type">-->  
366 -<!-- <input type="radio" name="alarmcotent-policy-type" data-flag="alarmcotent" value="3" title="自定义"lay-filter="alarm-policy-rule-type">-->  
367 -<!-- </div>-->  
368 -<!-- </div>-->  
369 -<!-- <div class="layui-form-item cont-base" id="alarmcotent-policy-box">-->  
370 -<!-- <div class="layui-input-inline smallwith">-->  
371 -<!-- <select class="alarmcotent_condition">-->  
372 -<!-- <option value="0">大于</option>-->  
373 -<!-- <option value="1">小于</option>-->  
374 -<!-- <option value="2">等于</option>-->  
375 -<!-- <option value="3">大于等于</option>-->  
376 -<!-- <option value="4">小于等于</option>-->  
377 -<!-- <option value="5">字符串等于</option>-->  
378 -<!-- <option value="6">字符串包含</option>-->  
379 -<!-- <option value="7">字符串前匹配</option>-->  
380 -<!-- <option value="8">字符串后匹配</option>-->  
381 -<!-- </select>-->  
382 -<!-- </div>-->  
383 -<!-- <div class="layui-input-inline smallwith">-->  
384 -<!-- <input type="tel" autocomplete="off" class="layui-input" flag="alarmcotent_value">-->  
385 -<!-- </div>-->  
386 -<!-- <div class="layui-form-mid layui-word-aux"><i data-id="alarmcotent-policy-box" class="layui-icon oper-icon policy-input-add">&#xe624;</i></div>-->  
387 -<!-- <div class="layui-form-mid layui-word-aux"><i data-id="alarmcotent-policy-box" class="layui-icon oper-icon policy-input-del hide">&#xe67e;</i></div>-->  
388 -<!-- </div>-->  
389 -<!-- <div class="layui-form-item cont-base">-->  
390 -<!-- <div class="layui-input-block">-->  
391 -<!-- <a class="layui-btn layui-btn-sm layui-btn-normal createpolicybtn" data-flag="alarmcotent">生成策略</a>-->  
392 -<!-- </div>-->  
393 -<!-- </div>-->  
394 -<!-- <div class="layui-form-item cont-other">-->  
395 -<!-- <div class="layui-input-block">-->  
396 -<!-- <textarea placeholder="请输入内容" class="layui-textarea" name="alarmContentExpr" id="alarmcotentPolicy"></textarea>-->  
397 -<!-- </div>-->  
398 -<!-- </div>-->  
399 -<!-- </div>-->  
400 -<!-- </div>-->  
401 -<!-- </div>--> 358 + <div class="layui-tab-item content-tab-item">
  359 + <!-- 通知合并策略 -->
  360 + <div class="content-box-group">
  361 + <div class="box-group-left" style="text-align: center">通知合并策略<br/>描述表达式</div>
  362 + <div class="box-group-right">
  363 + <div class="layui-form-item">
  364 + <div class="layui-input-block">
  365 + <textarea placeholder="请输入内容" class="layui-textarea" id="noticeMergeFlagExpr" name="noticeMergeFlagExpr"></textarea>
  366 + </div>
  367 + </div>
  368 + </div>
  369 + </div>
  370 + </div>
402 </div> 371 </div>
403 </div> 372 </div>
404 373
@@ -408,4 +377,4 @@ @@ -408,4 +377,4 @@
408 layui.use('alarmpolicyAdd', function (fn) { 377 layui.use('alarmpolicyAdd', function (fn) {
409 fn({{d}}); 378 fn({{d}});
410 }); 379 });
411 -</script>  
  380 +</script>
1 <article> 1 <article>
2 - <style>  
3 - label.task-choose-resname {  
4 - color: #fff;  
5 - background-color: #1e9fff;  
6 - min-height: 27px;  
7 - font-size: 12px;  
8 - display: inline-block;  
9 - margin-top: 5px;  
10 - line-height: 27px;  
11 - padding-left: 8px;  
12 - min-width: 223px;  
13 - margin-left: 15px;  
14 - }  
15 - </style>  
16 <div class="layui-card"> 2 <div class="layui-card">
17 <form class="layui-form layui-form-pane" lay-filter="form-task-bindchecktemp" 3 <form class="layui-form layui-form-pane" lay-filter="form-task-bindchecktemp"
18 onsubmit="return false;"> 4 onsubmit="return false;">
@@ -47,7 +33,7 @@ @@ -47,7 +33,7 @@
47 <button class="layui-btn layui-btn-primary hide" id="btn-task-bindchecktemp-unselectres"><i 33 <button class="layui-btn layui-btn-primary hide" id="btn-task-bindchecktemp-unselectres"><i
48 class="layui-icon">&#xe640;</i>取消选择 34 class="layui-icon">&#xe640;</i>取消选择
49 </button> 35 </button>
50 - <div id="txt-task-bindchecktemp-res"></div> 36 + <div id="txt-task-bindchecktemp-res" style="position: absolute;margin-top: -27px;margin-left: 120px"></div>
51 </div> 37 </div>
52 </div> 38 </div>
53 </div> 39 </div>
@@ -83,4 +69,4 @@ @@ -83,4 +69,4 @@
83 layui.use('taskbindchecktemp', function (fn) { 69 layui.use('taskbindchecktemp', function (fn) {
84 fn({{ d }}); 70 fn({{ d }});
85 }); 71 });
86 -</script>  
  72 +</script>
@@ -22,12 +22,16 @@ @@ -22,12 +22,16 @@
22 <textarea name="remark" placeholder="请输入备注" class="layui-textarea"></textarea> 22 <textarea name="remark" placeholder="请输入备注" class="layui-textarea"></textarea>
23 </div> 23 </div>
24 </div> 24 </div>
25 - <div class="layui-form-item"> 25 + <!--start lsq 搜索按钮位置调整 2022-06-07-->
  26 + <div class="layui-form-item" style="display: flex;align-items: center;">
26 <label class="layui-form-label">用户绑定</label> 27 <label class="layui-form-label">用户绑定</label>
27 - <div class="layui-input-block tags-input" style="height: auto"> 28 +<!-- <div class="layui-input-block tags-input" style="height: auto">-->
  29 + <div class=" tags-input" style="height: auto">
28 <div class="tags" id="selecte_usergroup_id_user"></div> 30 <div class="tags" id="selecte_usergroup_id_user"></div>
29 </div> 31 </div>
30 - <div class="layui-form-mid layui-word-aux" style="padding: 0!important;position: relative;top: -28px;left: 98%"><i class="layui-icon form-btn-icon" id="usergroup-form-select-users">&#xe615;</i></div> 32 +<!-- style="padding: 0!important;position: relative;top: -28px;left: 98%"【-->
  33 + <div class="layui-form-mid layui-word-aux" style="margin-left:6px;"><i class="layui-icon form-btn-icon" id="usergroup-form-select-users">&#xe615;</i></div>
  34 + <!--end lsq 2022-06-07-->
31 </div> 35 </div>
32 <button id="btn-usergroup-submit" class="hide" lay-submit lay-filter="btn-usergroup-submit">提交</button> 36 <button id="btn-usergroup-submit" class="hide" lay-submit lay-filter="btn-usergroup-submit">提交</button>
33 </form> 37 </form>
@@ -34,6 +34,7 @@ @@ -34,6 +34,7 @@
34 <option value="1"></option> 34 <option value="1"></option>
35 <option value="2"></option> 35 <option value="2"></option>
36 <option value="3"></option> 36 <option value="3"></option>
  37 + <option value="none">未监控</option>
37 </select> 38 </select>
38 </div> 39 </div>
39 </div> 40 </div>
@@ -54,6 +55,7 @@ @@ -54,6 +55,7 @@
54 <option value="">=连接状态=</option> 55 <option value="">=连接状态=</option>
55 <option value="normal">成功</option> 56 <option value="normal">成功</option>
56 <option value="unnormal">失败</option> 57 <option value="unnormal">失败</option>
  58 + <option value="9">未监控</option>
57 </select> 59 </select>
58 </div> 60 </div>
59 </div> 61 </div>
@@ -126,6 +128,7 @@ @@ -126,6 +128,7 @@
126 <option value="1"></option> 128 <option value="1"></option>
127 <option value="2"></option> 129 <option value="2"></option>
128 <option value="3"></option> 130 <option value="3"></option>
  131 + <option value="none">未监控</option>
129 </select> 132 </select>
130 </div> 133 </div>
131 </div> 134 </div>
@@ -226,6 +229,17 @@ @@ -226,6 +229,17 @@
226 229
227 <span><i class="layui-badge-dot layui-bg-red"></i>中</span> 230 <span><i class="layui-badge-dot layui-bg-red"></i>中</span>
228 </li> 231 </li>
  232 + <li>
  233 + {{# if(item.healthNone != null){
  234 + if(item.healthNone == '0'){
  235 + }}
  236 + <div><span class="layui-badge layui-bg-gray">{{ item.healthNone }}</span></div>
  237 + {{# } else { }}
  238 + <div><span class="layui-badge" style="background: gray">{{ item.healthNone }}</span></div>
  239 + {{# } } }}
  240 +
  241 + <span><i class="layui-badge-dot" style="background: gray"></i>未监控</span>
  242 + </li>
229 </ul> 243 </ul>
230 </div> 244 </div>
231 </div> 245 </div>
@@ -268,16 +282,18 @@ @@ -268,16 +282,18 @@
268 <div class="num"> 282 <div class="num">
269 <span class="green" lay-tips="健康状态:优" data-value="3" data-target="biz_resStatus" id="normal_biz">0</span>/ 283 <span class="green" lay-tips="健康状态:优" data-value="3" data-target="biz_resStatus" id="normal_biz">0</span>/
270 <span class="orange" lay-tips="健康状态: 良" data-value="2" data-target="biz_resStatus" id="worse_biz">0</span>/ 284 <span class="orange" lay-tips="健康状态: 良" data-value="2" data-target="biz_resStatus" id="worse_biz">0</span>/
271 - <span class="red" lay-tips="健康状态: 中" data-value="1" data-target="biz_resStatus" id="worst_biz">0</span> 285 + <span class="red" lay-tips="健康状态: 中" data-value="1" data-target="biz_resStatus" id="worst_biz">0</span>/
  286 + <span class="gray" lay-tips="健康状态: 未监控" data-value="none" data-target="biz_resStatus" id="healthNone_biz">0</span>
272 </div> 287 </div>
273 </div> 288 </div>
274 <div class="info-box-count"> 289 <div class="info-box-count">
275 <i></i> 290 <i></i>
276 <label>资源状态</label> 291 <label>资源状态</label>
277 <div class="num"> 292 <div class="num">
278 - <span class="blue" lay-tips="资源状态:未监控" data-value="new" data-target="biz_state" id="newstate_biz">0</span>/  
279 <span class="green" lay-tips="资源状态:监控中" data-value="monitor" data-target="biz_state" id="monitorstate_biz">0</span>/ 293 <span class="green" lay-tips="资源状态:监控中" data-value="monitor" data-target="biz_state" id="monitorstate_biz">0</span>/
280 - <span class="red" lay-tips="资源状态:暂停监控" data-value="stop" data-target="biz_state" id="stopstate_biz">0</span> 294 + <span class="red" lay-tips="资源状态:暂停监控" data-value="stop" data-target="biz_state" id="stopstate_biz">0</span>/
  295 + <span class="gray" lay-tips="资源状态:未监控" data-value="new" data-target="biz_state" id="newstate_biz">0</span>
  296 +
281 </div> 297 </div>
282 </div> 298 </div>
283 <div class="info-box-count"> 299 <div class="info-box-count">
@@ -285,7 +301,8 @@ @@ -285,7 +301,8 @@
285 <label>连接状态</label> 301 <label>连接状态</label>
286 <div class="num"> 302 <div class="num">
287 <span class="green" lay-tips="连接状态:成功" data-value="normal" data-target="bizlink_state" id="linksuccess_biz">0</span>/ 303 <span class="green" lay-tips="连接状态:成功" data-value="normal" data-target="bizlink_state" id="linksuccess_biz">0</span>/
288 - <span class="red" lay-tips="连接状态:失败" data-value="unnormal" data-target="bizlink_state" id="linkfail_biz">0</span> 304 + <span class="red" lay-tips="连接状态:失败" data-value="unnormal" data-target="bizlink_state" id="linkfail_biz">0</span>/
  305 + <span class="gray" lay-tips="连接状态:未监控" data-value="9" data-target="bizlink_state" id="linkNone_biz">0</span>
289 </div> 306 </div>
290 </div> 307 </div>
291 <!-- <div class="info-box-count"> 308 <!-- <div class="info-box-count">
@@ -316,6 +333,7 @@ @@ -316,6 +333,7 @@
316 <span class="green" lay-tips="健康状态:优" data-value="3" data-target="biz_treetable_resStatus" id="tree_normal_biz">0</span>/ 333 <span class="green" lay-tips="健康状态:优" data-value="3" data-target="biz_treetable_resStatus" id="tree_normal_biz">0</span>/
317 <span class="orange" lay-tips="健康状态: 良" data-value="2" data-target="biz_treetable_resStatus" id="tree_worse_biz">0</span>/ 334 <span class="orange" lay-tips="健康状态: 良" data-value="2" data-target="biz_treetable_resStatus" id="tree_worse_biz">0</span>/
318 <span class="red" lay-tips="健康状态: 中" data-value="1" data-target="biz_treetable_resStatus" id="tree_worst_biz">0</span> 335 <span class="red" lay-tips="健康状态: 中" data-value="1" data-target="biz_treetable_resStatus" id="tree_worst_biz">0</span>
  336 + <span class="red" lay-tips="健康状态: 未监控" data-value="none" data-target="biz_treetable_resStatus" id="tree_healthNone_biz">0</span>
319 </div> 337 </div>
320 </div> 338 </div>
321 <div class="info-box-count"> 339 <div class="info-box-count">
@@ -28,6 +28,7 @@ @@ -28,6 +28,7 @@
28 <option value="1"></option> 28 <option value="1"></option>
29 <option value="2"></option> 29 <option value="2"></option>
30 <option value="3"></option> 30 <option value="3"></option>
  31 + <option value="none">未监控</option>
31 </select> 32 </select>
32 </div> 33 </div>
33 </div> 34 </div>
@@ -37,6 +38,7 @@ @@ -37,6 +38,7 @@
37 <option value="">=连接状态=</option> 38 <option value="">=连接状态=</option>
38 <option value="normal">成功</option> 39 <option value="normal">成功</option>
39 <option value="unnormal">失败</option> 40 <option value="unnormal">失败</option>
  41 + <option value="9">未监控</option>
40 </select> 42 </select>
41 </div> 43 </div>
42 </div> 44 </div>
@@ -216,16 +218,17 @@ @@ -216,16 +218,17 @@
216 <div class="num"> 218 <div class="num">
217 <span class="green" lay-tips="健康状态:优" data-value="3" data-target="biz_reslist_resStatus" data-field="normal">0</span>/ 219 <span class="green" lay-tips="健康状态:优" data-value="3" data-target="biz_reslist_resStatus" data-field="normal">0</span>/
218 <span class="orange" lay-tips="健康状态: 良" data-value="2" data-target="biz_reslist_resStatus" data-field="worse">0</span>/ 220 <span class="orange" lay-tips="健康状态: 良" data-value="2" data-target="biz_reslist_resStatus" data-field="worse">0</span>/
219 - <span class="red" lay-tips="健康状态: 中" data-value="1" data-target="biz_reslist_resStatus" data-field="worst">0</span> 221 + <span class="red" lay-tips="健康状态: 中" data-value="1" data-target="biz_reslist_resStatus" data-field="worst">0</span>/
  222 + <span class="gray" lay-tips="连接状态:未监控" data-value="none" data-target="biz_reslist_resStatus" data-field="healthNone">0</span>
220 </div> 223 </div>
221 </div> 224 </div>
222 <div class="info-box-count"> 225 <div class="info-box-count">
223 <i></i> 226 <i></i>
224 <label>资源状态</label> 227 <label>资源状态</label>
225 <div class="num"> 228 <div class="num">
226 - <span class="blue" lay-tips="资源状态:未监控" data-value="new" data-target="biz_reslist_state" data-field="newstate">0</span>/  
227 <span class="green" lay-tips="资源状态:监控中" data-value="monitor" data-target="biz_reslist_state" data-field="monitorstate">0</span>/ 229 <span class="green" lay-tips="资源状态:监控中" data-value="monitor" data-target="biz_reslist_state" data-field="monitorstate">0</span>/
228 - <span class="red" lay-tips="资源状态:暂停监控" data-value="stop" data-target="biz_reslist_state" data-field="stopstate">0</span> 230 + <span class="red" lay-tips="资源状态:暂停监控" data-value="stop" data-target="biz_reslist_state" data-field="stopstate">0</span>/
  231 + <span class="gray" lay-tips="资源状态:未监控" data-value="new" data-target="biz_reslist_state" data-field="newstate">0</span>
229 </div> 232 </div>
230 </div> 233 </div>
231 <div class="info-box-count div-link-state" style="display: none"> 234 <div class="info-box-count div-link-state" style="display: none">
@@ -233,7 +236,8 @@ @@ -233,7 +236,8 @@
233 <label>连接状态</label> 236 <label>连接状态</label>
234 <div class="num"> 237 <div class="num">
235 <span class="green" lay-tips="连接状态:成功" data-value="normal" data-target="biz_reslist_link_state" data-field="linksuccess">0</span>/ 238 <span class="green" lay-tips="连接状态:成功" data-value="normal" data-target="biz_reslist_link_state" data-field="linksuccess">0</span>/
236 - <span class="red" lay-tips="连接状态:失败" data-value="unnormal" data-target="biz_reslist_link_state" data-field="linkfail">0</span> 239 + <span class="red" lay-tips="连接状态:失败" data-value="unnormal" data-target="biz_reslist_link_state" data-field="linkfail">0</span>/
  240 + <span class="gray" lay-tips="连接状态:未监控" data-value="9" data-target="biz_reslist_link_state" data-field="linkNone">0</span>
237 </div> 241 </div>
238 </div> 242 </div>
239 <!-- <div class="info-box-count"> 243 <!-- <div class="info-box-count">
@@ -52,6 +52,7 @@ @@ -52,6 +52,7 @@
52 <option value="1"></option> 52 <option value="1"></option>
53 <option value="2"></option> 53 <option value="2"></option>
54 <option value="3"></option> 54 <option value="3"></option>
  55 + <option value="none">未监控</option>
55 </select> 56 </select>
56 </div> 57 </div>
57 </div> 58 </div>
@@ -72,6 +73,7 @@ @@ -72,6 +73,7 @@
72 <option value="">=连接状态=</option> 73 <option value="">=连接状态=</option>
73 <option value="normal">成功</option> 74 <option value="normal">成功</option>
74 <option value="unnormal">失败</option> 75 <option value="unnormal">失败</option>
  76 + <option value="9">未监控</option>
75 </select> 77 </select>
76 </div> 78 </div>
77 </div> 79 </div>
@@ -230,6 +232,17 @@ @@ -230,6 +232,17 @@
230 232
231 <span><i class="layui-badge-dot layui-bg-red"></i>中</span> 233 <span><i class="layui-badge-dot layui-bg-red"></i>中</span>
232 </li> 234 </li>
  235 + <li>
  236 + {{# if(item.healthNone != null){
  237 + if(item.healthNone == '0'){
  238 + }}
  239 + <div><span class="layui-badge layui-bg-gray">{{ item.healthNone }}</span></div>
  240 + {{# } else { }}
  241 + <div><span class="layui-badge" style="background: gray">{{ item.healthNone }}</span></div>
  242 + {{# } } }}
  243 +
  244 + <span><i class="layui-badge-dot" style="background: gray"></i>未监控</span>
  245 + </li>
233 </ul> 246 </ul>
234 </div> 247 </div>
235 </div> 248 </div>
@@ -431,16 +444,18 @@ @@ -431,16 +444,18 @@
431 <div class="num"> 444 <div class="num">
432 <span class="green" lay-tips="健康状态:优" data-value="3" data-target="domain_resStatus" id="normal_domain"></span>/ 445 <span class="green" lay-tips="健康状态:优" data-value="3" data-target="domain_resStatus" id="normal_domain"></span>/
433 <span class="orange" lay-tips="健康状态: 良" data-value="2" data-target="domain_resStatus" id="worse_domain"></span>/ 446 <span class="orange" lay-tips="健康状态: 良" data-value="2" data-target="domain_resStatus" id="worse_domain"></span>/
434 - <span class="red" lay-tips="健康状态: 中" data-value="1" data-target="domain_resStatus" id="worst_domain"></span> 447 + <span class="red" lay-tips="健康状态: 中" data-value="1" data-target="domain_resStatus" id="worst_domain"></span>/
  448 + <span class="gray" lay-tips="健康状态: 未监控" data-value="none" data-target="domain_resStatus" id="healthNone_domain">0</span>
435 </div> 449 </div>
436 </div> 450 </div>
437 <div class="info-box-count"> 451 <div class="info-box-count">
438 <i></i> 452 <i></i>
439 <label>资源状态</label> 453 <label>资源状态</label>
440 <div class="num"> 454 <div class="num">
441 - <span class="blue" lay-tips="资源状态:未监控" data-value="new" data-target="domain_state" id="newstate_domain"></span>/  
442 <span class="green" lay-tips="资源状态:监控中" data-value="monitor" data-target="domain_state" id="monitorstate_domain"></span>/ 455 <span class="green" lay-tips="资源状态:监控中" data-value="monitor" data-target="domain_state" id="monitorstate_domain"></span>/
443 - <span class="red" lay-tips="资源状态:暂停监控" data-value="stop" data-target="domain_state" id="stopstate_domain"></span> 456 + <span class="red" lay-tips="资源状态:暂停监控" data-value="stop" data-target="domain_state" id="stopstate_domain"></span>/
  457 + <span class="gray" lay-tips="资源状态:未监控" data-value="new" data-target="domain_state" id="newstate_domain"></span>
  458 +
444 </div> 459 </div>
445 </div> 460 </div>
446 <div class="info-box-count"> 461 <div class="info-box-count">
@@ -448,7 +463,8 @@ @@ -448,7 +463,8 @@
448 <label>连接状态</label> 463 <label>连接状态</label>
449 <div class="num"> 464 <div class="num">
450 <span class="green" lay-tips="连接状态:成功" data-value="normal" data-target="domainlink_state" id="linksuccess_domain"></span>/ 465 <span class="green" lay-tips="连接状态:成功" data-value="normal" data-target="domainlink_state" id="linksuccess_domain"></span>/
451 - <span class="red" lay-tips="连接状态:失败" data-value="unnormal" data-target="domainlink_state" id="linkfail_domain"></span> 466 + <span class="red" lay-tips="连接状态:失败" data-value="unnormal" data-target="domainlink_state" id="linkfail_domain"></span>/
  467 + <span class="gray" lay-tips="连接状态:未监控" data-value="9" data-target="domainlink_state" id="linkNone_domain">0</span>
452 </div> 468 </div>
453 </div> 469 </div>
454 <!-- <div class="info-box-count"> 470 <!-- <div class="info-box-count">
@@ -295,6 +295,8 @@ @@ -295,6 +295,8 @@
295 <i class="{{bizClas}}"></i> 295 <i class="{{bizClas}}"></i>
296 <span>{{item.title}}<a class="layui-icon bizcard-view-topo {{isBiz ? '' : 'hide'}}" data-busid="{{item.busId}}" style="color: #FEB61E; margin-left: 10px" lay-tips="查看业务拓扑"><i class="iconfont">&#XE515;</i></a></span> 296 <span>{{item.title}}<a class="layui-icon bizcard-view-topo {{isBiz ? '' : 'hide'}}" data-busid="{{item.busId}}" style="color: #FEB61E; margin-left: 10px" lay-tips="查看业务拓扑"><i class="iconfont">&#XE515;</i></a></span>
297 <div class="index-banner-title-desc"><span>{{item.countTxt}}</span></div> 297 <div class="index-banner-title-desc"><span>{{item.countTxt}}</span></div>
  298 + <i id="{{item.busId}}" class="iconfont detail_base_info" style="color:rgb(30,159,255);display: none;">&#xe61e;</i>
  299 +
298 </div> 300 </div>
299 <div class="index-banner-group-list"> 301 <div class="index-banner-group-list">
300 {{# layui.each(item.bizList, function(index, item){ }} 302 {{# layui.each(item.bizList, function(index, item){ }}
@@ -78,6 +78,7 @@ @@ -78,6 +78,7 @@
78 <option value="1"></option> 78 <option value="1"></option>
79 <option value="2"></option> 79 <option value="2"></option>
80 <option value="3"></option> 80 <option value="3"></option>
  81 + <option value="none">未监控</option>
81 </select> 82 </select>
82 </div> 83 </div>
83 </div> 84 </div>
@@ -98,6 +99,7 @@ @@ -98,6 +99,7 @@
98 <option value="">=连接状态=</option> 99 <option value="">=连接状态=</option>
99 <option value="normal">成功</option> 100 <option value="normal">成功</option>
100 <option value="unnormal">失败</option> 101 <option value="unnormal">失败</option>
  102 + <option value="9">未监控</option>
101 </select> 103 </select>
102 </div> 104 </div>
103 </div> 105 </div>
@@ -230,7 +232,7 @@ @@ -230,7 +232,7 @@
230 <option value="1"></option> 232 <option value="1"></option>
231 <option value="2"></option> 233 <option value="2"></option>
232 <option value="3"></option> 234 <option value="3"></option>
233 - </select> 235 + <option value="none">未监控</option> </select>
234 </div> 236 </div>
235 </div> 237 </div>
236 <div class="layui-inline"> 238 <div class="layui-inline">
@@ -336,6 +338,17 @@ @@ -336,6 +338,17 @@
336 338
337 <span><i class="layui-badge-dot layui-bg-red"></i>中</span> 339 <span><i class="layui-badge-dot layui-bg-red"></i>中</span>
338 </li> 340 </li>
  341 + <li>
  342 + {{# if(item.healthNone != null){
  343 + if(item.healthNone == '0'){
  344 + }}
  345 + <div><span class="layui-badge layui-bg-gray">{{ item.healthNone }}</span></div>
  346 + {{# } else { }}
  347 + <div><span class="layui-badge" style="background: gray">{{ item.healthNone }}</span></div>
  348 + {{# } } }}
  349 +
  350 + <span><i class="layui-badge-dot" style="background: gray"></i>未监控</span>
  351 + </li>
339 </ul> 352 </ul>
340 </div> 353 </div>
341 </div> 354 </div>
@@ -365,16 +378,18 @@ @@ -365,16 +378,18 @@
365 <div class="num"> 378 <div class="num">
366 <span class="green" lay-tips="健康状态:优" data-value="3" data-target="resStatus " id="normal_res">0</span>/ 379 <span class="green" lay-tips="健康状态:优" data-value="3" data-target="resStatus " id="normal_res">0</span>/
367 <span class="orange" lay-tips="健康状态: 良" data-value="2" data-target="resStatus" id="worse_res">0</span>/ 380 <span class="orange" lay-tips="健康状态: 良" data-value="2" data-target="resStatus" id="worse_res">0</span>/
368 - <span class="red" lay-tips="健康状态: 中" data-value="1" data-target="resStatus" id="worst_res">0</span> 381 + <span class="red" lay-tips="健康状态: 中" data-value="1" data-target="resStatus" id="worst_res">0</span>/
  382 + <span class="gray" lay-tips="健康状态: 未监控" data-value="none" data-target="resStatus" id="healthNone_res">0</span>
369 </div> 383 </div>
370 </div> 384 </div>
371 <div class="info-box-count"> 385 <div class="info-box-count">
372 <i></i> 386 <i></i>
373 <label>资源状态</label> 387 <label>资源状态</label>
374 <div class="num"> 388 <div class="num">
375 - <span class="blue" lay-tips="资源状态:未监控" data-value="new" data-target="state" id="newstate_res">0</span>/ 389 +
376 <span class="green" lay-tips="资源状态:监控中" data-value="monitor" data-target="state" id="monitorstate_res">0</span>/ 390 <span class="green" lay-tips="资源状态:监控中" data-value="monitor" data-target="state" id="monitorstate_res">0</span>/
377 - <span class="red" lay-tips="资源状态:暂停监控" data-value="stop" data-target="state" id="stopstate_res">0</span> 391 + <span class="red" lay-tips="资源状态:暂停监控" data-value="stop" data-target="state" id="stopstate_res">0</span>/
  392 + <span class="gray" lay-tips="资源状态:未监控" data-value="new" data-target="state" id="newstate_res">0</span>
378 </div> 393 </div>
379 </div> 394 </div>
380 <div class="info-box-count"> 395 <div class="info-box-count">
@@ -382,7 +397,8 @@ @@ -382,7 +397,8 @@
382 <label>连接状态</label> 397 <label>连接状态</label>
383 <div class="num"> 398 <div class="num">
384 <span class="green" lay-tips="连接状态:成功" data-value="normal" data-target="link_state" id="linksuccess_res">0</span>/ 399 <span class="green" lay-tips="连接状态:成功" data-value="normal" data-target="link_state" id="linksuccess_res">0</span>/
385 - <span class="red" lay-tips="连接状态:失败" data-value="unnormal" data-target="link_state" id="linkfail_res">0</span> 400 + <span class="red" lay-tips="连接状态:失败" data-value="unnormal" data-target="link_state" id="linkfail_res">0</span>/
  401 + <span class="gray" lay-tips="连接状态:未监控" data-value="9" data-target="bizlink_state" id="linkNone_res">0</span>
386 </div> 402 </div>
387 </div> 403 </div>
388 <!-- <div class="info-box-count"> 404 <!-- <div class="info-box-count">
@@ -412,16 +428,17 @@ @@ -412,16 +428,17 @@
412 <div class="num"> 428 <div class="num">
413 <span class="green" lay-tips="健康状态:优" data-value="3" data-target="treetable_resStatus" id="tree_normal_res">0</span>/ 429 <span class="green" lay-tips="健康状态:优" data-value="3" data-target="treetable_resStatus" id="tree_normal_res">0</span>/
414 <span class="orange" lay-tips="健康状态: 良" data-value="2" data-target="treetable_resStatus" id="tree_worse_res">0</span>/ 430 <span class="orange" lay-tips="健康状态: 良" data-value="2" data-target="treetable_resStatus" id="tree_worse_res">0</span>/
415 - <span class="red" lay-tips="健康状态: 中" data-value="1" data-target="treetable_resStatus" id="tree_worst_res">0</span> 431 + <span class="red" lay-tips="健康状态: 中" data-value="1" data-target="treetable_resStatus" id="tree_worst_res">0</span>/
  432 + <span class="gray" lay-tips="健康状态: 未监控" data-value="1" data-target="treetable_resStatus" id="tree_healthNone_res">0</span>
416 </div> 433 </div>
417 </div> 434 </div>
418 <div class="info-box-count"> 435 <div class="info-box-count">
419 <i></i> 436 <i></i>
420 <label>资源状态</label> 437 <label>资源状态</label>
421 <div class="num"> 438 <div class="num">
422 - <span class="blue" lay-tips="资源状态:未监控" data-value="new" data-target="treetable_res_state" id="tree_newstate_res">0</span>/  
423 <span class="green" lay-tips="资源状态:监控中" data-value="monitor" data-target="treetable_res_state" id="tree_monitorstate_res">0</span>/ 439 <span class="green" lay-tips="资源状态:监控中" data-value="monitor" data-target="treetable_res_state" id="tree_monitorstate_res">0</span>/
424 - <span class="red" lay-tips="资源状态:暂停监控" data-value="stop" data-target="treetable_res_state" id="tree_stopstate_res">0</span> 440 + <span class="red" lay-tips="资源状态:暂停监控" data-value="stop" data-target="treetable_res_state" id="tree_stopstate_res">0</span>/
  441 + <span class="gray" lay-tips="资源状态:未监控" data-value="new" data-target="treetable_res_state" id="tree_newstate_res">0</span>
425 </div> 442 </div>
426 </div> 443 </div>
427 <!--<div class="info-box-count"> 444 <!--<div class="info-box-count">
@@ -141,3 +141,10 @@ custom-class="config-dialog" @@ -141,3 +141,10 @@ custom-class="config-dialog"
141 .margin-top-bottom-10{ 141 .margin-top-bottom-10{
142 margin:10px 0; 142 margin:10px 0;
143 } 143 }
  144 +.tree-table .el-table td.el-table__cell div{
  145 + display: flex;
  146 + align-items: center;
  147 +}
  148 +.tree-table .el-table .el-table__cell.is-center div{
  149 + justify-content: center;
  150 +}+
1 <div > 1 <div >
2 <!-- 表格--> 2 <!-- 表格-->
3 <el-table :border="showBorder" v-loading="loading" :size="size" ref="multipleTable" @selection-change="handleSelectionChange" :data="dataList" stripe header-row-class-name="tbl-header-class" :height="height" 3 <el-table :border="showBorder" v-loading="loading" :size="size" ref="multipleTable" @selection-change="handleSelectionChange" :data="dataList" stripe header-row-class-name="tbl-header-class" :height="height"
4 - style="width: 100%;margin: 0px 0px; font-size:13.5px;" :row-key="getRowKeys" :expand-row-keys="expands"> 4 + style="width: 100%;margin: 0px 0px; font-size:13.5px;" :row-key="getRowKeys" :expand-row-keys="expands" :default-expand-all="defaultExpand"
  5 + @select="handleSelect" @select-all="handleSelectAll"
  6 + >
5 7
6 <el-table-column type="expand" v-if="showExpand"> 8 <el-table-column type="expand" v-if="showExpand">
7 <template #default="scope"> 9 <template #default="scope">
@@ -98,10 +98,15 @@ export default { @@ -98,10 +98,15 @@ export default {
98 type: String, 98 type: String,
99 default: 'id' 99 default: 'id'
100 }, 100 },
101 - //是否默认展开所有 101 + //默认展开哪
102 expands:{ 102 expands:{
103 type: Array, 103 type: Array,
104 default: [] 104 default: []
  105 + },
  106 + //是否默认展开所有行
  107 + defaultExpand:{
  108 + type:Boolean,
  109 + default:false
105 } 110 }
106 }, 111 },
107 data() { 112 data() {
@@ -150,6 +155,7 @@ export default { @@ -150,6 +155,7 @@ export default {
150 let params = { 155 let params = {
151 page: currentPage.value, limit: pageSize.value 156 page: currentPage.value, limit: pageSize.value
152 } 157 }
  158 + proxy.$refs.multipleTable.clearSelection();
153 159
154 emit('loaddata', params) 160 emit('loaddata', params)
155 } 161 }
@@ -224,6 +230,44 @@ export default { @@ -224,6 +230,44 @@ export default {
224 return val; 230 return val;
225 231
226 } 232 }
  233 + //设置父节点选中后children也选中
  234 + let setChecked=(row)=>{
  235 + let arr=[];
  236 + if(row.children){
  237 + row.children.map(j=>{
  238 + arr.push(j)
  239 + setChecked(j)
  240 + })
  241 + }
  242 + toggleSelection(arr)
  243 + }
  244 + //勾选数据行的Checkbox事件
  245 + let handleSelect=(selection, row)=>{
  246 + setChecked(row);
  247 +
  248 + emit('handleSelect',selection)
  249 + }
  250 + //勾选全选checkbox事件
  251 + let handleSelectAll=(selection)=>{
  252 + const isSelect=selection.some(el=>{
  253 + const tableDataIds=props.dataList.map(j=>j[props.getRowKeys])
  254 + return tableDataIds.includes(el.id)
  255 + })
  256 + const isCancel=!props.dataList.every(el=>{
  257 + const selectIds=selection.map(j=>j[props.getRowKeys])
  258 + return selectIds.includes(el.id)
  259 + })
  260 + if(isSelect){
  261 + setChecked(selection);
  262 + }
  263 + if(isCancel){
  264 + props.dataList.map(el=>{
  265 + setChecked(el);
  266 + })
  267 + }
  268 +
  269 + emit('handleSelectAll',selection)
  270 + }
227 // 挂载完 271 // 挂载完
228 Vue.onMounted(() => { 272 Vue.onMounted(() => {
229 //callback(); 273 //callback();
@@ -240,6 +284,8 @@ export default { @@ -240,6 +284,8 @@ export default {
240 }) 284 })
241 285
242 return { 286 return {
  287 + handleSelect,
  288 + handleSelectAll,
243 toggleSelection, 289 toggleSelection,
244 handleSelectionChange, 290 handleSelectionChange,
245 // multipleSelection, 291 // multipleSelection,
@@ -126,6 +126,17 @@ const routes = [{ @@ -126,6 +126,17 @@ const routes = [{
126 name: 'connectScatter', 126 name: 'connectScatter',
127 component: () => myImport('views/connectScatter/index') 127 component: () => myImport('views/connectScatter/index')
128 }, 128 },
  129 + {
  130 + path: '/vue3/batchChangeLeaders',
  131 + name: 'batchChangeLeaders',
  132 + component: () => myImport('views/batchChangeLeaders/index')
  133 + },
  134 + //部门业务关系
  135 + {
  136 + path: '/vue3/orgBustype',
  137 + name: 'orgBustype',
  138 + component: () => myImport('views/orgBustype/index')
  139 + },
129 ]; 140 ];
130 141
131 // hash模式: createWebHashHistory 142 // hash模式: createWebHashHistory
  1 +<el-row>
  2 + <el-col :span="24" class="search">
  3 + <div class="condition" style="display: flex;">
  4 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;width: 300px">
  5 + <el-input v-model="data.searchParams.keywords" placeholder="关键字支持:名称、负责人、业务描述"></el-input>
  6 + </el-form-item>
  7 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;">
  8 + <el-button @click="getList">查询</el-button>
  9 + </el-form-item>
  10 +
  11 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;">
  12 + <el-button type="primary" @click="removeRel">取消</el-button>
  13 + </el-form-item>
  14 +
  15 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;">
  16 + <el-button type="primary" @click="changeUser">变更</el-button>
  17 + </el-form-item>
  18 +
  19 + </div>
  20 + </el-col>
  21 +</el-row>
  22 +<el-row style="font-size: 12px;color: grey;padding: 6px;">
  23 + {{item.ddicDesc}}
  24 +</el-row>
  25 +<el-row class="margin-bottom-50" style="margin-top: 3px">
  26 + <el-col :span="24" class="table-height">
  27 + <cm-table-page :columns="data.columns"
  28 + :dataList="data.tableData"
  29 + :treeProps="{ children: 'children', hasChildren: 'hasChildren' }"
  30 + :total="data.count"
  31 + :pageSize="data.searchParams.limit"
  32 + @loaddata="loadTableDataList"
  33 + @selectionChange="selectionChange"
  34 + :showIndex="true"
  35 + :showSelection="true"
  36 + :showBorder="true"
  37 + :loading="loading"
  38 + :showPage="true"
  39 + :showTools="false"
  40 + :height="(height - 200)">
  41 + <template #default="{row,prop,column}">
  42 + </template>
  43 + </cm-table-page>
  44 + </el-col>
  45 +</el-row>
  46 +
  47 +<ChangeUsersList :show="data.userDialogFlag" @hideDialog="showUserDialog" @savebtn="saveRel"></ChangeUsersList>
  1 +export default {
  2 + name: 'resourceTypePer',
  3 + template: '',
  4 + components: {
  5 + 'ChangeUsersList': Vue.defineAsyncComponent(
  6 + () => myImport('views/batchChangeLeaders/changeUsersList/index')
  7 + ),
  8 + },
  9 + data() {
  10 + },
  11 + props: {
  12 + item:{
  13 + type:Object,
  14 + default:{}
  15 + }
  16 + },
  17 + setup: function (props, {attrs, slots, emit}) {
  18 + const {proxy} = Vue.getCurrentInstance();
  19 + //列表高度
  20 + let height = Vue.ref(window.innerHeight);
  21 + let data = Vue.ref({
  22 + searchParams: {
  23 + "page": 1,
  24 + "limit": 50,
  25 + "keywords": "",
  26 + "userName": proxy.$route.query.username,
  27 + "subId": ""
  28 + },
  29 + userDialogFlag : false,
  30 + count: 0,
  31 + columns: [{
  32 + prop: "subName",
  33 + label: "订阅名称",
  34 + width: "250",
  35 + sortable: true,
  36 + align: 'center'
  37 + }, {
  38 + prop: "subType",
  39 + label: "订阅类型",
  40 + width: "120",
  41 + sortable: true,
  42 + align: 'center',
  43 + render: function (row) {
  44 + switch (row.subType) {
  45 + case '1':
  46 + return '告警订阅'
  47 + break;
  48 + case '2':
  49 + return '报表订阅'
  50 + break;
  51 + case '3':
  52 + return '系统通知订阅'
  53 + break;
  54 + case '4':
  55 + return '采集器异常订阅'
  56 + break;
  57 + }
  58 + }
  59 + }, {
  60 + prop: "subWay",
  61 + label: "通知类型",
  62 + width: "120",
  63 + sortable: true,
  64 + align: 'center',
  65 + render: function (row) {
  66 + switch (row.subWay){
  67 + case 'wechat':
  68 + return '<div class="iconfont icon-weixin" style="font-size: 22px"></div>'
  69 + break;
  70 + case 'email':
  71 + return '<div class="iconfont icon-youxiang" style="font-size: 22px"></div>'
  72 + break;
  73 + case 'message':
  74 + return '<div class="iconfont icon-duanxinqunfa" style="font-size: 22px"></div>'
  75 + break;
  76 + }
  77 + }
  78 + },{
  79 + prop: "tempType",
  80 + label: "通知说明",
  81 + width: "300",
  82 + sortable: true,
  83 + align: 'center',
  84 + render: (d) => {
  85 + var sendWay = '';
  86 + switch (d.subWay){
  87 + case 'wechat':
  88 + sendWay = '微信'
  89 + break;
  90 + case 'email':
  91 + sendWay = '邮箱';
  92 + break;
  93 + case 'message':
  94 + sendWay = '短信';
  95 + break;
  96 + }
  97 + var unit = d.sentFrequency && d.sentFrequency.indexOf("?")>0?"":"分钟一次";
  98 + return `${sendWay}通知${d.sendTotal}次;频率${d.sentFrequency}${unit}`;
  99 + }
  100 + }, {
  101 + prop: "userTotal",
  102 + label: "订阅人数",
  103 + sortable: true,
  104 + align: 'center'
  105 + }, {
  106 + prop: "times",
  107 + label: "允许通知时间段",
  108 + sortable: true,
  109 + align: 'center'
  110 + }, {
  111 + prop: "syncFlag",
  112 + label: "同步状态",
  113 + sortable: true,
  114 + align: 'center',
  115 + render: (row) => {
  116 + switch (row.syncFlag) {
  117 + case '0':
  118 + return '未同步'
  119 + case '1':
  120 + return '已同步';
  121 + }
  122 + }
  123 + }],
  124 + tableData: [],
  125 + // 表格选中
  126 + checkArr:[]
  127 + })
  128 +
  129 +
  130 + const getList = () => {
  131 + proxy.$http.post(`/api-web/personnelChange/getList/alarmSubPer`, data.value.searchParams, function (res) {
  132 + if (res && res.success) {
  133 + let dataVal = data.value;
  134 + let list = res.data;
  135 + let count = res.count;
  136 +
  137 + dataVal.tableData = list;
  138 + dataVal.count = count;
  139 + }
  140 + })
  141 + }
  142 +
  143 + // 展示用户选择
  144 + let showUserDialog = (flg) =>{
  145 + data.value.userDialogFlag = flg;
  146 + }
  147 +
  148 + let saveRel = (obj) =>{
  149 + // 获取选中
  150 + let arr = data.value.checkArr;
  151 + if(arr.length == 0){
  152 + proxy.$global.showMsg('请至少选择一项','warning');
  153 + return;
  154 + }
  155 +
  156 + let params = {
  157 + targetUserName: obj.selectModel.join(''),
  158 + "userName": proxy.$route.query.username,
  159 + "subId": arr.join(',')
  160 + }
  161 + if(params.targetUserName == params.userName){
  162 + proxy.$global.showMsg('变更用户不能与变更前用户一致,请修改!','warning');
  163 + return;
  164 + }
  165 + proxy.$http.post(`/api-web/personnelChange/update/alarmSubPer`,params, function (res) {
  166 + if (res && res.success) {
  167 + proxy.$global.showMsg('变更成功!');
  168 + showUserDialog(false);
  169 + // 刷新表格
  170 + getList();
  171 + }
  172 + })
  173 + }
  174 +
  175 + // 变更
  176 + let changeUser = () =>{
  177 + // 获取选中
  178 + let arr = data.value.checkArr;
  179 + if(arr.length == 0){
  180 + proxy.$global.showMsg('请至少选择一项','warning');
  181 + return;
  182 + }
  183 +
  184 + showUserDialog(true);
  185 + }
  186 +
  187 + /**
  188 + * 取消
  189 + */
  190 + let removeRel = () =>{
  191 + let arr = data.value.checkArr;
  192 + if(arr.length == 0){
  193 + proxy.$global.showMsg('请至少选择一项','warning');
  194 + return;
  195 + }
  196 +
  197 + data.value.searchParams.subId = arr.join(',')
  198 + proxy.$global.confirm("确定取消相关资源?", function () {
  199 +
  200 + proxy.$http.post(`/api-web/personnelChange/remove/alarmSubPer`, data.value.searchParams , function (res) {
  201 + if (res && res.success) {
  202 + proxy.$global.showMsg('取消成功!');
  203 + getList()
  204 + }
  205 + })
  206 + });
  207 + }
  208 +
  209 + //重新加载表格数据
  210 + let loadTableDataList = ({page, limit}) => {
  211 + let dataVal = data.value;
  212 + dataVal.page = page;
  213 + dataVal.limit = limit;
  214 + getList();
  215 + }
  216 +
  217 + // 表格全选事件
  218 + let selectionChange = (val) => {
  219 + let checkArr = [];
  220 + val.map(item => {
  221 + checkArr.push(item.subId)
  222 + })
  223 + data.value.checkArr = checkArr;
  224 + let isCheck = (list, checkArr) => {
  225 + list.forEach((v, i) => {
  226 + v.checked = checkArr.includes(v.subId);
  227 + if (v.children) {
  228 + isCheck(v.children, checkArr);
  229 + }
  230 + });
  231 + }
  232 + isCheck(data.value.tableData, checkArr);
  233 + }
  234 +
  235 + // 挂载完
  236 + Vue.onMounted(() => {
  237 + getList();
  238 + })
  239 +
  240 + return {
  241 + height,
  242 + data,
  243 + getList,
  244 + changeUser,
  245 + showUserDialog,
  246 + removeRel,
  247 + loadTableDataList,
  248 + selectionChange,
  249 + saveRel
  250 + }
  251 + }
  252 +}
  1 +<el-row>
  2 + <el-col :span="24" class="search">
  3 + <div class="condition" style="display: flex;">
  4 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;width: 300px">
  5 + <el-input v-model="data.searchParams.keywords" placeholder="关键字支持:名称、负责人、业务描述"></el-input>
  6 + </el-form-item>
  7 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;">
  8 + <el-button @click="getList">查询</el-button>
  9 + </el-form-item>
  10 +
  11 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;">
  12 + <el-button type="primary" @click="removeRel">取消</el-button>
  13 + </el-form-item>
  14 +
  15 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;">
  16 + <el-button type="primary" @click="changeUser">变更</el-button>
  17 + </el-form-item>
  18 +
  19 + </div>
  20 + </el-col>
  21 +</el-row>
  22 +<el-row style="font-size: 12px;color: grey;padding: 6px;">
  23 + {{item.ddicDesc}}
  24 +</el-row>
  25 +<el-row class="margin-bottom-50" style="margin-top: 3px">
  26 + <el-col :span="24" class="table-height">
  27 + <cm-table-page :columns="data.columns"
  28 + :dataList="data.tableData"
  29 + :treeProps="{ children: 'children', hasChildren: 'hasChildren' }"
  30 + :total="data.count"
  31 + :pageSize="data.searchParams.limit"
  32 + @loaddata="loadTableDataList"
  33 + @selectionChange="selectionChange"
  34 + :showIndex="true"
  35 + :showSelection="true"
  36 + :showBorder="true"
  37 + :loading="loading"
  38 + :showPage="true"
  39 + :showTools="false"
  40 + :height="(height - 200)">
  41 + <template #default="{row,prop,column}">
  42 + </template>
  43 + </cm-table-page>
  44 + </el-col>
  45 +</el-row>
  46 +
  47 +<ChangeUsersList :show="data.userDialogFlag" @hideDialog="showUserDialog" @savebtn="saveRel"></ChangeUsersList>
  1 +export default {
  2 + name: 'autoPatrolPortPer',
  3 + template: '',
  4 + components: {
  5 + 'ChangeUsersList': Vue.defineAsyncComponent(
  6 + () => myImport('views/batchChangeLeaders/changeUsersList/index')
  7 + ),
  8 + },
  9 + data() {
  10 + },
  11 + props: {
  12 + item:{
  13 + type:Object,
  14 + default:{}
  15 + }
  16 + },
  17 + setup: function (props, {attrs, slots, emit}) {
  18 + const {proxy} = Vue.getCurrentInstance();
  19 + //列表高度
  20 + let height = Vue.ref(window.innerHeight);
  21 + let data = Vue.ref({
  22 + searchParams: {
  23 + "page": 1,
  24 + "limit": 50,
  25 + "keywords": "",
  26 + "userName": proxy.$route.query.username,
  27 + "reportId": ""
  28 + },
  29 + userDialogFlag: false,
  30 + count: 0,
  31 + columns: [{
  32 + prop: "docName",
  33 + label: "文档名称",
  34 + width: "300",
  35 + sortable: true,
  36 + align: 'center'
  37 + }, {
  38 + prop: "frequencyType",
  39 + label: "调度类型",
  40 + width: "120",
  41 + sortable: true,
  42 + align: 'center',
  43 + render:(d)=>{
  44 + switch (d.frequencyType) {
  45 + case 'quarter':
  46 + return '季度'
  47 + case 'month':
  48 + return '每月'
  49 + case 'day':
  50 + return '每日'
  51 + case 'hour':
  52 + return '小时'
  53 + case 'year':
  54 + return '每年'
  55 + case 'week':
  56 + return '每周'
  57 + }
  58 + }
  59 + }, {
  60 + prop: "inspectionType",
  61 + label: "报表类型",
  62 + width: "100",
  63 + sortable: true,
  64 + align: 'center',
  65 + render: (d) => {
  66 + switch (d.reportType) {
  67 + case 'yxjk':
  68 + return '运行监控'
  69 + case 'jkjc':
  70 + return '健康检查'
  71 + case 'lxwh':
  72 + return '例行维护'
  73 + case 'gzfx':
  74 + return '故障分析'
  75 + case 'fxbg':
  76 + return '分析报告'
  77 + }
  78 + }
  79 + }, {
  80 + prop: "runningFlag",
  81 + label: "启用/禁用",
  82 + width: "120",
  83 + sortable: true,
  84 + align: 'center',
  85 + render: (d) => {
  86 + switch (d.runningFlag) {
  87 + case '1':
  88 + return '启用'
  89 + default :
  90 + return '禁用'
  91 + }
  92 + }
  93 +
  94 + },{
  95 + prop: "templatePath",
  96 + label: "模板地址",
  97 + sortable: true,
  98 + align: 'left'
  99 + }],
  100 + tableData: [],
  101 + // 表格选中
  102 + checkArr: []
  103 + })
  104 +
  105 +
  106 + const getList = () => {
  107 + proxy.$http.post(`/api-web/personnelChange/getList/autoPatrolPortPer`, data.value.searchParams, function (res) {
  108 + if (res && res.data) {
  109 + let dataVal = data.value;
  110 + let list = res.data;
  111 + let count = res.count;
  112 +
  113 + dataVal.tableData = list;
  114 + dataVal.count = count;
  115 + }
  116 + })
  117 + }
  118 +
  119 + // 展示用户选择
  120 + let showUserDialog = (flg) => {
  121 + data.value.userDialogFlag = flg;
  122 + }
  123 +
  124 + let saveRel = (obj) => {
  125 + // 获取选中
  126 + let arr = data.value.checkArr;
  127 + if (arr.length == 0) {
  128 + proxy.$global.showMsg('请至少选择一项', 'warning');
  129 + return;
  130 + }
  131 +
  132 + let params = {
  133 + targetUserName: obj.selectModel.join(''),
  134 + "userName": proxy.$route.query.username,
  135 + "reportId": arr.join(',')
  136 + }
  137 + if (params.targetUserName == params.userName) {
  138 + proxy.$global.showMsg('变更用户不能与变更前用户一致,请修改!', 'warning');
  139 + return;
  140 + }
  141 + proxy.$http.post(`/api-web/personnelChange/update/autoPatrolPortPer`, params, function (res) {
  142 + if (res && res.success) {
  143 + proxy.$global.showMsg('变更成功!');
  144 + showUserDialog(false);
  145 + // 刷新表格
  146 + getList();
  147 + }
  148 + })
  149 + }
  150 +
  151 + // 变更
  152 + let changeUser = () => {
  153 + // 获取选中
  154 + let arr = data.value.checkArr;
  155 + if (arr.length == 0) {
  156 + proxy.$global.showMsg('请至少选择一项', 'warning');
  157 + return;
  158 + }
  159 +
  160 + showUserDialog(true);
  161 + }
  162 +
  163 + /**
  164 + * 取消
  165 + */
  166 + let removeRel = () => {
  167 + let arr = data.value.checkArr;
  168 + if (arr.length == 0) {
  169 + proxy.$global.showMsg('请至少选择一项', 'warning');
  170 + return;
  171 + }
  172 +
  173 + data.value.searchParams.reportId = arr.join(',')
  174 + proxy.$global.confirm("确定取消相关资源?", function () {
  175 + proxy.$http.post(`/api-web/personnelChange/remove/autoPatrolPortPer`, data.value.searchParams, function (res) {
  176 + if (res && res.success) {
  177 + proxy.$global.showMsg('取消成功!');
  178 + getList()
  179 + }
  180 + })
  181 + });
  182 + }
  183 +
  184 + //重新加载表格数据
  185 + let loadTableDataList = ({page, limit}) => {
  186 + let dataVal = data.value;
  187 + dataVal.page = page;
  188 + dataVal.limit = limit;
  189 + getList();
  190 + }
  191 +
  192 + // 表格全选事件
  193 + let selectionChange = (val) => {
  194 + let checkArr = [];
  195 + val.map(item => {
  196 + checkArr.push(item.id)
  197 + })
  198 + data.value.checkArr = checkArr;
  199 + let isCheck = (list, checkArr) => {
  200 + list.forEach((v, i) => {
  201 + v.checked = checkArr.includes(v.id);
  202 + if (v.children) {
  203 + isCheck(v.children, checkArr);
  204 + }
  205 + });
  206 + }
  207 + isCheck(data.value.tableData, checkArr);
  208 + }
  209 +
  210 + // 挂载完
  211 + Vue.onMounted(() => {
  212 + getList();
  213 + })
  214 +
  215 + return {
  216 + height,
  217 + data,
  218 + getList,
  219 + changeUser,
  220 + showUserDialog,
  221 + removeRel,
  222 + loadTableDataList,
  223 + selectionChange,
  224 + saveRel
  225 + }
  226 + }
  227 +}
  1 +<el-row>
  2 + <el-col :span="24" class="search">
  3 + <div class="condition" >
  4 + <el-form ref=“form” style="display: flex;">
  5 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;width: 300px">
  6 + <el-input v-model="search.keyword" placeholder="关键字支持:业务名称"></el-input>
  7 + </el-form-item>
  8 + <!--<el-form-item style="margin-right: 6px;margin-bottom: 10px;">
  9 + <el-select filterable clearable v-model="search.resType" placeholder="请选择资源类型">
  10 + <el-option
  11 + v-for="item in resTypeOptions"
  12 + :key="item.resTypeCode"
  13 + :label="item.resTypeName"
  14 + :value="item.resTypeCode">
  15 + </el-option>
  16 + </el-select>
  17 + </el-form-item>-->
  18 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;">
  19 + <el-button @click="getListData" >查询</el-button>
  20 + </el-form-item>
  21 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;">
  22 + <el-button type="primary" @click="changeAdmin()" style="margin-left: 6px">变更</el-button>
  23 + </el-form-item>
  24 + </el-form>
  25 + </div>
  26 + </el-col>
  27 +</el-row>
  28 +<!--<el-row style="margin-bottom: 10px;">
  29 + <div class="flex-div-start">
  30 +&lt;!&ndash; <el-button type="primary" @click="changeCancel()" size="small">取消</el-button>&ndash;&gt;
  31 + <el-button type="primary" @click="changeAdmin()" size="small" style="margin-left: 6px">变更</el-button>
  32 + </div>
  33 +</el-row>-->
  34 +<el-row style="font-size: 12px;color: grey;padding: 6px;">
  35 + {{item.ddicDesc}}
  36 +</el-row>
  37 +<el-row class="margin-bottom-50" style="margin-top: 3px">
  38 + <el-col :span="24" class="table-height">
  39 + <cm-table-page :columns="columns"
  40 + :dataList="resourceData"
  41 + :total="count"
  42 + :pageSize="search.limit"
  43 + @loaddata="loadTableDataList"
  44 + @selectionChange="selectionChange"
  45 + :showIndex="true"
  46 + :showSelection="true"
  47 + :showBorder="true"
  48 + :loading="loading"
  49 + :showPage="true"
  50 + :showTools="false"
  51 + :height="(height - 200)">
  52 + <template #default="{row,prop,column}">
  53 + <div v-if="prop == 'showType'">
  54 + <el-select v-if="row.resType == 'HOST_X86SERVER'" v-model="row.showType" placeholder="">
  55 + <el-option
  56 + v-for="item in showTypeList"
  57 + :key="item.value"
  58 + :label="item.name"
  59 + :value="item.value"
  60 + >
  61 + </el-option>
  62 + </el-select>
  63 + </div>
  64 + </template>
  65 + </cm-table-page>
  66 + </el-col>
  67 +</el-row>
  68 +
  69 +<ChangeUsersList :show="show" :isTwoGroup="isTwoGroup" :isMulti="isMulti" @hideDialog="hideDialog" @savebtn="savebtn"></ChangeUsersList>
  1 +export default {
  2 + name: 'bizLeader',
  3 + template: '',
  4 + components: {
  5 + 'ChangeUsersList': Vue.defineAsyncComponent(
  6 + () => myImport('views/batchChangeLeaders/changeUsersList/index')
  7 + ),
  8 + },
  9 + data() {
  10 + },
  11 + props: {
  12 + item:{
  13 + type:Object,
  14 + default:{}
  15 + }
  16 + },
  17 + setup: function (props, {attrs, slots, emit}) {
  18 + const {proxy} = Vue.getCurrentInstance();
  19 + //接收从用户列表中选中的用户
  20 + let userName=Vue.ref(proxy.$route.query.username);
  21 + //变更人员弹框
  22 + let show=Vue.ref(false);
  23 + //变更人员列表是否多选
  24 + let isMulti=Vue.ref(false);
  25 + //变更人员列表是否是两组
  26 + let isTwoGroup=Vue.ref(false);
  27 + //配置列表总数
  28 + let count = Vue.ref(0);
  29 + //列表高度
  30 + let height = Vue.ref(window.innerHeight);
  31 + //加载
  32 + let loading = Vue.ref(true);
  33 + //选中数据
  34 + let pitch = Vue.ref([]);
  35 + let showTypeList=Vue.ref([]);
  36 + let search = Vue.ref({
  37 + resType: '',
  38 + keyword: '',
  39 + page: 1,
  40 + limit: 50,
  41 + });
  42 + let resTypeOptions=Vue.ref([])
  43 + const columns = [
  44 + {
  45 + prop: 'busTypeName',
  46 + label: '业务类型名称',
  47 + sortable: true,
  48 + align: 'center',
  49 + },
  50 + {
  51 + prop: 'admin',
  52 + label: '负责人',
  53 + sortable: true,
  54 + align: 'center',
  55 + },
  56 + {
  57 + prop: 'busTypeDesc',
  58 + label: '业务类型描述',
  59 + sortable: true,
  60 + align: 'center',
  61 + },
  62 + {
  63 + prop: 'isUse',
  64 + label: '是否使用',
  65 + sortable: true,
  66 + align: 'center',
  67 + render: function (row) {
  68 + switch (row.isUse) {
  69 + case 0:
  70 + return '否';
  71 + case 1:
  72 + return '是';
  73 + default:
  74 + return '';
  75 + }
  76 + }
  77 + },
  78 + {
  79 + prop: 'important',
  80 + label: '重要程度',
  81 + sortable: true,
  82 + align: 'center',
  83 + render: function (row) {
  84 + switch (row.important) {
  85 + case 1:
  86 + return '核心';
  87 + case 2:
  88 + return '重要';
  89 + case 3:
  90 + return '一般';
  91 + case 9:
  92 + return '虚拟业务';
  93 + default:
  94 + return '';
  95 + }
  96 + }
  97 + },
  98 + {
  99 + prop: 'sort',
  100 + label: '排序',
  101 + sortable: true,
  102 + align: 'center',
  103 + },
  104 + {
  105 + prop: 'showType',
  106 + label: '展示类型',
  107 + sortable: true,
  108 + align: 'center',
  109 + /* render: function (row) {
  110 +
  111 + }*/
  112 + }
  113 + ];
  114 +
  115 + //列表数据
  116 + let resourceData = Vue.ref([]);
  117 + //获取列表数据
  118 + const getListData = () => {
  119 + resourceData.value=[];
  120 + loading.value = true;
  121 + //定义列表参数
  122 + let getParams = {
  123 + resType:search.value.resType,
  124 + keywords:search.value.keyword,
  125 + userName:userName.value,
  126 + page: search.value.page,
  127 + limit: search.value.limit
  128 + };
  129 + proxy.$http.post("/api-web/personnelChange/getList/bizLeader", getParams, function (res) {
  130 + if (res && res.data) {
  131 + resourceData.value = res.data ? res.data : [];
  132 + count.value = res.count;
  133 + loading.value = false;
  134 + }
  135 + })
  136 + }
  137 + //重新加载表格数据
  138 + let loadTableDataList = ({page, limit}) => {
  139 + search.value.page=page;
  140 + search.value.limit=limit;
  141 + getListData();
  142 + }
  143 + let busIds=Vue.ref('');//选中的ids
  144 + //表格全选事件
  145 + let selectionChange = (val) => {
  146 + pitch.value = val;
  147 + let arr=[];
  148 + pitch.value.map(item=>{
  149 + arr.push(item.busId)
  150 + })
  151 + busIds.value=arr.join(",");//选中的值
  152 + }
  153 + //获取资源类型数据
  154 + let getResourceTypoe=()=>{
  155 + proxy.$http.get(`/api-web/manage/restype/list`, {}, function (res) {
  156 + if (res && res.data) {
  157 + resTypeOptions.value=res.data
  158 + }
  159 + })
  160 + }
  161 + //获取展示类型的字典数据
  162 + let initShowType=()=>{
  163 + proxy.$http.post("/api-web/manage/ddic/findSucDdics/DETAILS_POWER", {}, function (res) {
  164 + if (res && res.data) {
  165 + let arr=res.data;
  166 + if(arr && arr.length>0){
  167 + arr.map(v=>{
  168 + showTypeList.value.push({
  169 + name: v.ddicName
  170 + ,value: v.ddicCode.substring(v.ddicCode.lastIndexOf("_")+1,v.ddicCode.length)
  171 + });
  172 + })
  173 + }
  174 +
  175 + }
  176 + })
  177 + }
  178 + //批量取消相关资源
  179 + let changeCancel = () => {
  180 + if(pitch.value.length<1){
  181 + proxy.$global.showMsg('请至少选择一项','warning');
  182 + }else{
  183 + proxy.$global.confirm("确定取消相关资源?", function () {
  184 + let parmas={
  185 + userName:userName.value,
  186 + busId:busIds.value
  187 + }
  188 + proxy.$http.post(`/api-web/personnelChange/remove/bizLeader`, parmas, function (res) {
  189 + if (res && res.success) {
  190 + proxy.$global.showMsg('取消成功!');
  191 + getListData()
  192 + }
  193 + })
  194 + });
  195 + }
  196 + }
  197 + //变更负责人
  198 + let changeAdmin = () => {
  199 + if(pitch.value.length<1){
  200 + proxy.$global.showMsg('请至少选择一项','warning');
  201 +
  202 + }else{
  203 + show.value=true;
  204 + }
  205 +
  206 + }
  207 + //变更人员的弹框关闭后
  208 + let hideDialog =(flag)=>{
  209 + show.value=flag;
  210 + }
  211 + //变更人员的弹框保存后
  212 + let savebtn =(obj)=>{
  213 + show.value=false;
  214 + //obj.selectModel 选中的用户组(一个/主负责人) obj.selectModelSecond 辅负责人,都是数组
  215 + let targetUserName='';
  216 + if(obj.selectModel){
  217 + targetUserName=obj.selectModel.join(',')
  218 + }
  219 + let params={
  220 + busId:busIds.value,
  221 + targetUserName:targetUserName,
  222 + userName:userName.value,
  223 + }
  224 + proxy.$http.post(`/api-web/personnelChange/update/bizLeader`, params, function (res) {
  225 + if (res && res.success) {
  226 + proxy.$global.showMsg('变更成功!');
  227 + getListData()
  228 + }
  229 + })
  230 + }
  231 + // 挂载完
  232 + Vue.onMounted(() => {
  233 + initShowType();
  234 + getResourceTypoe();
  235 + getListData();
  236 + })
  237 + return {
  238 + isMulti,
  239 + isTwoGroup,
  240 + show,
  241 + initShowType,
  242 + showTypeList,
  243 + search,
  244 + resTypeOptions,
  245 + changeCancel,
  246 + count,
  247 + hideDialog,
  248 + savebtn,
  249 + changeAdmin,
  250 + getResourceTypoe,
  251 +
  252 + resourceData,
  253 + columns,
  254 + height,
  255 + loading,
  256 +
  257 + selectionChange,
  258 +
  259 + getListData,
  260 + loadTableDataList,
  261 + userName
  262 + }
  263 + }
  264 +}
  1 +<el-row>
  2 + <el-col :span="24" class="search">
  3 + <div class="condition" style="display: flex;">
  4 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;width: 300px">
  5 + <el-input v-model="data.searchParams.keywords" placeholder="关键字支持:名称、负责人、业务描述"></el-input>
  6 + </el-form-item>
  7 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;">
  8 + <el-button @click="getList">查询</el-button>
  9 + </el-form-item>
  10 +
  11 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;">
  12 + <el-button type="primary" @click="removeRel">取消</el-button>
  13 + </el-form-item>
  14 +
  15 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;">
  16 + <el-button type="primary" @click="changeUser">变更</el-button>
  17 + </el-form-item>
  18 +
  19 + </div>
  20 + </el-col>
  21 +</el-row>
  22 +<el-row style="font-size: 12px;color: grey;padding: 6px;">
  23 + {{item.ddicDesc}}
  24 +</el-row>
  25 +<el-row class="margin-bottom-50" style="margin-top: 3px">
  26 + <el-col :span="24" class="table-height tree-table">
  27 + <cm-table-page :columns="data.columns"
  28 + :dataList="data.tableData"
  29 + :total="data.count"
  30 + :pageSize="data.searchParams.limit"
  31 + @loaddata="loadTableDataList"
  32 + @selectionChange="selectionChange"
  33 + :showIndex="true"
  34 + :showSelection="true"
  35 + :showBorder="true"
  36 + :loading="loading"
  37 + :showPage="true"
  38 + :showTools="false"
  39 + :getRowKeys="'busId'"
  40 + :defaultExpand="true"
  41 + :height="(height - 200)">
  42 + <template #default="{row,prop,column}">
  43 + </template>
  44 + </cm-table-page>
  45 + </el-col>
  46 +</el-row>
  47 +
  48 +<ChangeUsersList :show="data.userDialogFlag" @hideDialog="showUserDialog" @savebtn="saveRel"></ChangeUsersList>
  1 +export default {
  2 + name: 'resourceTypePer',
  3 + template: '',
  4 + components: {
  5 + 'ChangeUsersList': Vue.defineAsyncComponent(
  6 + () => myImport('views/batchChangeLeaders/changeUsersList/index')
  7 + ),
  8 + },
  9 + data() {
  10 + },
  11 + props: {
  12 + item:{
  13 + type:Object,
  14 + default:{}
  15 + }
  16 + },
  17 + setup: function (props, {attrs, slots, emit}) {
  18 + const {proxy} = Vue.getCurrentInstance();
  19 + //列表高度
  20 + let height = Vue.ref(window.innerHeight);
  21 + let data = Vue.ref({
  22 + searchParams: {
  23 + "page": 1,
  24 + "limit": 50,
  25 + "keywords": "",
  26 + "userName": proxy.$route.query.username,
  27 + "busId": ""
  28 + },
  29 + userDialogFlag : false,
  30 + count: 0,
  31 + columns: [{
  32 + prop: "busTypeName",
  33 + label: "名称",
  34 + width: "250",
  35 + sortable: true,
  36 + align: 'left'
  37 + }, {
  38 + prop: "nickname",
  39 + label: "负责人",
  40 + width: "120",
  41 + sortable: true,
  42 + align: 'center'
  43 + }, {
  44 + prop: "busTypeDesc",
  45 + label: "业务描述",
  46 + width: "200",
  47 + sortable: true,
  48 + align: 'center'
  49 + }, {
  50 + prop: "isUse",
  51 + label: "是否使用",
  52 + sortable: true,
  53 + align: 'center',
  54 + render: (row) => {
  55 + switch (row.isUse) {
  56 + case 0:
  57 + return '否';
  58 + case 1:
  59 + return '是';
  60 + default:
  61 + return '';
  62 + }
  63 + }
  64 + }, {
  65 + prop: "important",
  66 + label: "重要程度",
  67 + sortable: true,
  68 + align: 'center',
  69 + render: (row) => {
  70 + switch (row.important) {
  71 + case 1:
  72 + return '核心';
  73 + case 2:
  74 + return '重要';
  75 + case 3:
  76 + return '一般';
  77 + case 9:
  78 + return '虚拟业务';
  79 + default:
  80 + return '';
  81 + }
  82 + }
  83 + }, {
  84 + prop: "sort",
  85 + label: "排序",
  86 + sortable: true,
  87 + align: 'center'
  88 + }],
  89 + tableData: [],
  90 + // 表格选中
  91 + checkArr:[]
  92 + })
  93 +
  94 +
  95 + const getList = () => {
  96 + proxy.$http.post(`/api-web/personnelChange/getList/bizPer`, data.value.searchParams, function (res) {
  97 + if (res && res.data) {
  98 + let dataVal = data.value;
  99 + let list = res.data;
  100 + let count = res.count;
  101 +
  102 + let tableData = list.filter(function (v) {
  103 + if (v.parentId == '0') {
  104 + // 获取子节点
  105 + let childs = list.filter(function (v1) {
  106 + if (v1.parentId != '0' && v1.parentId == v.busId) {
  107 + // 获取子节点
  108 + return v1;
  109 + }
  110 + }).sort(function (a, b) {
  111 + return a.sort - b.sort
  112 + })
  113 + v.children = childs;
  114 + return v;
  115 + }
  116 + }).sort(function (a, b) {
  117 + return a.sort - b.sort
  118 + })
  119 + dataVal.tableData = tableData;
  120 + dataVal.count = count;
  121 + }
  122 + })
  123 + }
  124 +
  125 + // 展示用户选择
  126 + let showUserDialog = (flg) =>{
  127 + data.value.userDialogFlag = flg;
  128 + }
  129 +
  130 + let saveRel = (obj) =>{
  131 + // 获取选中
  132 + let arr = data.value.checkArr;
  133 + if(arr.length == 0){
  134 + proxy.$global.showMsg('请至少选择一项','warning');
  135 + return;
  136 + }
  137 +
  138 + let params = {
  139 + targetUserName: obj.selectModel.join(''),
  140 + "userName": proxy.$route.query.username,
  141 + "busId": arr.join(',')
  142 + }
  143 + if(params.targetUserName == params.userName){
  144 + proxy.$global.showMsg('变更用户不能与变更前用户一致,请修改!','warning');
  145 + return;
  146 + }
  147 + proxy.$http.post(`/api-web/personnelChange/update/bizPer`,params, function (res) {
  148 + if (res && res.success) {
  149 + proxy.$global.showMsg('变更成功!');
  150 + showUserDialog(false);
  151 + // 刷新表格
  152 + getList();
  153 + }
  154 + })
  155 + }
  156 +
  157 + // 变更
  158 + let changeUser = () =>{
  159 + // 获取选中
  160 + let arr = data.value.checkArr;
  161 + if(arr.length == 0){
  162 + proxy.$global.showMsg('请至少选择一项','warning');
  163 + return;
  164 + }
  165 +
  166 + showUserDialog(true);
  167 + }
  168 +
  169 + /**
  170 + * 取消
  171 + */
  172 + let removeRel = () =>{
  173 + let arr = data.value.checkArr;
  174 + if(arr.length == 0){
  175 + proxy.$global.showMsg('请至少选择一项','warning');
  176 + return;
  177 + }
  178 +
  179 + data.value.searchParams.busId = arr.join(',')
  180 + proxy.$global.confirm("确定取消相关资源?", function () {
  181 + proxy.$http.post(`/api-web/personnelChange/remove/bizPer`, data.value.searchParams , function (res) {
  182 + if (res && res.success) {
  183 + proxy.$global.showMsg('取消成功!');
  184 + getList()
  185 + }
  186 + })
  187 + });
  188 + }
  189 +
  190 + //重新加载表格数据
  191 + let loadTableDataList = ({page, limit}) => {
  192 + let dataVal = data.value;
  193 + dataVal.page = page;
  194 + dataVal.limit = limit;
  195 + getList();
  196 + }
  197 +
  198 + // 表格全选事件
  199 + let selectionChange = (val) => {
  200 + let checkArr = [];
  201 + val.map(item => {
  202 + checkArr.push(item.busId)
  203 + })
  204 + data.value.checkArr = checkArr;
  205 + let isCheck = (list, checkArr) => {
  206 + list.forEach((v, i) => {
  207 + v.checked = checkArr.includes(v.busId);
  208 + if (v.children) {
  209 + isCheck(v.children, checkArr);
  210 + }
  211 + });
  212 + }
  213 + isCheck(data.value.tableData, checkArr);
  214 + }
  215 +
  216 + // 挂载完
  217 + Vue.onMounted(() => {
  218 + getList();
  219 + })
  220 +
  221 + return {
  222 + height,
  223 + data,
  224 + getList,
  225 + changeUser,
  226 + showUserDialog,
  227 + removeRel,
  228 + loadTableDataList,
  229 + selectionChange,
  230 + saveRel
  231 + }
  232 + }
  233 +}
  1 +<cm-dialog :title="title" width="500px" :showDialogVisible="show" @hidedialog="hidedialog" @okfunc="getUser">
  2 + <template v-slot>
  3 + <el-row >
  4 + <el-col :span="24" class="table-height">
  5 + <span v-if="isTwoGroup">主负责人:</span>
  6 + <el-select
  7 + v-model="selectModel"
  8 + :multiple="isMulti"
  9 + placeholder="请选择用户"
  10 + style="width:80%"
  11 + clearable
  12 + filterable
  13 + >
  14 + <el-option
  15 + v-for="item in userList"
  16 + :key="item.username"
  17 + :label="item.nickname"
  18 + :value="item.username"
  19 + >
  20 + <div >
  21 + <span>{{item.orgName}}/{{item.nickname}}</span>
  22 + </div>
  23 + </el-option>
  24 + </el-select>
  25 + </el-col>
  26 + </el-row>
  27 + <el-row v-if="isTwoGroup" style="margin-top:10px;">
  28 + <el-col :span="24">
  29 + <span>辅负责人:</span>
  30 + <el-select
  31 + v-model="selectModelSecond"
  32 + multiple
  33 + placeholder="请选择用户"
  34 + style="width:80%"
  35 + clearable
  36 + filterable
  37 + >
  38 + <el-option
  39 + v-for="item in userListSecond"
  40 + :key="item.username"
  41 + :label="item.nickname"
  42 + :value="item.username"
  43 + >
  44 + <div >
  45 + <span>{{item.orgName}}/{{item.nickname}}</span>
  46 + </div>
  47 + </el-option>
  48 + </el-select>
  49 + </el-col>
  50 + </el-row>
  51 + </template>
  52 +</cm-dialog>
  1 +export default {
  2 + name: 'changeUsersList',
  3 + template: '',
  4 + components: {
  5 +
  6 + },
  7 + data() {
  8 + },
  9 + props: {
  10 + title: {
  11 + type: String,
  12 + default: '用户列表'
  13 + },
  14 + show:{
  15 + type:Boolean,
  16 + default: false
  17 + },
  18 + //是否为多选
  19 + isMulti:{
  20 + type:Boolean,
  21 + default:false
  22 + },
  23 + //如果是主/辅负责人时为true
  24 + isTwoGroup:{
  25 + type:Boolean,
  26 + default:false
  27 + }
  28 + },
  29 + setup: function (props, {attrs, slots, emit}) {
  30 + const {proxy} = Vue.getCurrentInstance();
  31 + let height=Vue.ref(window.innerHeight);
  32 + let selectModel=Vue.ref([]);
  33 + let selectModelSecond=Vue.ref([]);
  34 +
  35 + let hidedialog = () => {
  36 + emit('hideDialog', false);
  37 + }
  38 + let getUser = () =>{
  39 + let obj={}
  40 + let arr=[];
  41 + if(props.isMulti){
  42 + arr=selectModel.value
  43 + }else{
  44 + arr=[selectModel.value];
  45 + }
  46 + if(props.isTwoGroup){
  47 + obj={
  48 + selectModel: arr,
  49 + selectModelSecond: selectModelSecond.value
  50 + }
  51 + }else{
  52 + obj={
  53 + selectModel: arr,
  54 + }
  55 + }
  56 + emit('savebtn', obj);
  57 +
  58 + }
  59 + let search=Vue.ref({
  60 + username:'',
  61 + nickname:'',
  62 + enabled:'',
  63 + orgId:'',
  64 + roles:'',
  65 + limit:999999,
  66 + page:1
  67 + })
  68 + let userList=Vue.ref([]);
  69 + let userListSecond=Vue.ref([]);
  70 + let count=Vue.ref(0);
  71 + //获取所有用户
  72 + let getAllUser = () =>{
  73 + proxy.$http.get('/api-user/users', search.value, function (res) {
  74 + if (res && res.data) {
  75 + userList.value=res.data;
  76 + userListSecond.value=res.data;
  77 + count.value=res.count;
  78 + }
  79 + })
  80 + }
  81 + // 挂载完
  82 + Vue.onMounted(() => {
  83 + getAllUser();
  84 + })
  85 + return {
  86 + selectModel,
  87 + height,
  88 + selectModelSecond,
  89 + getAllUser,
  90 + userList,
  91 + userListSecond,
  92 + count,
  93 + hidedialog,
  94 + getUser,
  95 + search
  96 + }
  97 + }
  98 +}
  1 +<el-row>
  2 + <el-col :span="24" class="search">
  3 + <div class="condition" style="display: flex;">
  4 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;width: 300px">
  5 + <el-input v-model="data.searchParams.keywords" placeholder="关键字支持:名称、负责人、业务描述"></el-input>
  6 + </el-form-item>
  7 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;">
  8 + <el-button @click="getList">查询</el-button>
  9 + </el-form-item>
  10 +
  11 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;">
  12 + <el-button type="primary" @click="removeRel">取消</el-button>
  13 + </el-form-item>
  14 +
  15 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;">
  16 + <el-button type="primary" @click="changeUser">变更</el-button>
  17 + </el-form-item>
  18 +
  19 + </div>
  20 + </el-col>
  21 +</el-row>
  22 +<el-row style="font-size: 12px;color: grey;padding: 6px;">
  23 + {{item.ddicDesc}}
  24 +</el-row>
  25 +<el-row class="margin-bottom-50" style="margin-top: 3px">
  26 + <el-col :span="24" class="table-height">
  27 + <cm-table-page :columns="data.columns"
  28 + :dataList="data.tableData"
  29 + :treeProps="{ children: 'children', hasChildren: 'hasChildren' }"
  30 + :total="data.count"
  31 + :pageSize="data.searchParams.limit"
  32 + @loaddata="loadTableDataList"
  33 + @selectionChange="selectionChange"
  34 + :showIndex="true"
  35 + :showSelection="true"
  36 + :showBorder="true"
  37 + :loading="loading"
  38 + :showPage="true"
  39 + :showTools="false"
  40 + :height="(height - 200)">
  41 + <template #default="{row,prop,column}">
  42 + </template>
  43 + </cm-table-page>
  44 + </el-col>
  45 +</el-row>
  46 +
  47 +<ChangeUsersList :show="data.userDialogFlag" @hideDialog="showUserDialog" @savebtn="saveRel"></ChangeUsersList>
  1 +export default {
  2 + name: 'fileManagePer',
  3 + template: '',
  4 + components: {
  5 + 'ChangeUsersList': Vue.defineAsyncComponent(
  6 + () => myImport('views/batchChangeLeaders/changeUsersList/index')
  7 + ),
  8 + },
  9 + data() {
  10 + },
  11 + props: {
  12 + item:{
  13 + type:Object,
  14 + default:{}
  15 + }
  16 + },
  17 + setup: function (props, {attrs, slots, emit}) {
  18 + const {proxy} = Vue.getCurrentInstance();
  19 + //列表高度
  20 + let height = Vue.ref(window.innerHeight);
  21 + let data = Vue.ref({
  22 + searchParams: {
  23 + "page": 1,
  24 + "limit": 50,
  25 + "keywords": "",
  26 + "userName": proxy.$route.query.username,
  27 + "docId": ""
  28 + },
  29 + userDialogFlag: false,
  30 + count: 0,
  31 + columns: [{
  32 + prop: "name",
  33 + label: "名称",
  34 + width: "350",
  35 + sortable: true,
  36 + align: 'center'
  37 + }, {
  38 + prop: "docNo",
  39 + label: "文档编号",
  40 + width: "100",
  41 + sortable: true,
  42 + align: 'center'
  43 + }, {
  44 + prop: "createUserName",
  45 + label: "创建用户",
  46 + width: "100",
  47 + sortable: true,
  48 + align: 'center'
  49 + }, {
  50 + prop: "localPath",
  51 + label: "文档地址",
  52 + sortable: true,
  53 + align: 'left'
  54 + }],
  55 + tableData: [],
  56 + // 表格选中
  57 + checkArr: []
  58 + })
  59 +
  60 +
  61 + const getList = () => {
  62 + proxy.$http.post(`/api-web/personnelChange/getList/fileManagePer`, data.value.searchParams, function (res) {
  63 + if (res && res.data) {
  64 + let dataVal = data.value;
  65 + let list = res.data;
  66 + let count = res.count;
  67 +
  68 + dataVal.tableData = list;
  69 + dataVal.count = count;
  70 + }
  71 + })
  72 + }
  73 +
  74 + // 展示用户选择
  75 + let showUserDialog = (flg) => {
  76 + data.value.userDialogFlag = flg;
  77 + }
  78 +
  79 + let saveRel = (obj) => {
  80 + // 获取选中
  81 + let arr = data.value.checkArr;
  82 + if (arr.length == 0) {
  83 + proxy.$global.showMsg('请至少选择一项', 'warning');
  84 + return;
  85 + }
  86 +
  87 + let params = {
  88 + targetUserName: obj.selectModel.join(''),
  89 + "userName": proxy.$route.query.username,
  90 + "docId": arr.join(',')
  91 + }
  92 + if (params.targetUserName == params.userName) {
  93 + proxy.$global.showMsg('变更用户不能与变更前用户一致,请修改!', 'warning');
  94 + return;
  95 + }
  96 + proxy.$http.post(`/api-web/personnelChange/update/fileManagePer`, params, function (res) {
  97 + if (res && res.success) {
  98 + proxy.$global.showMsg('变更成功!');
  99 + showUserDialog(false);
  100 + // 刷新表格
  101 + getList();
  102 + }
  103 + })
  104 + }
  105 +
  106 + // 变更
  107 + let changeUser = () => {
  108 + // 获取选中
  109 + let arr = data.value.checkArr;
  110 + if (arr.length == 0) {
  111 + proxy.$global.showMsg('请至少选择一项', 'warning');
  112 + return;
  113 + }
  114 +
  115 + showUserDialog(true);
  116 + }
  117 +
  118 + /**
  119 + * 取消
  120 + */
  121 + let removeRel = () => {
  122 + let arr = data.value.checkArr;
  123 + if (arr.length == 0) {
  124 + proxy.$global.showMsg('请至少选择一项', 'warning');
  125 + return;
  126 + }
  127 +
  128 + data.value.searchParams.docId = arr.join(',')
  129 + proxy.$global.confirm("确定取消相关资源?", function () {
  130 + proxy.$http.post(`/api-web/personnelChange/remove/fileManagePer`, data.value.searchParams, function (res) {
  131 + if (res && res.success) {
  132 + proxy.$global.showMsg('取消成功!');
  133 + getList()
  134 + }
  135 + })
  136 + });
  137 + }
  138 +
  139 + //重新加载表格数据
  140 + let loadTableDataList = ({page, limit}) => {
  141 + let dataVal = data.value;
  142 + dataVal.page = page;
  143 + dataVal.limit = limit;
  144 + getList();
  145 + }
  146 +
  147 + // 表格全选事件
  148 + let selectionChange = (val) => {
  149 + let checkArr = [];
  150 + val.map(item => {
  151 + checkArr.push(item.id)
  152 + })
  153 + data.value.checkArr = checkArr;
  154 + let isCheck = (list, checkArr) => {
  155 + list.forEach((v, i) => {
  156 + v.checked = checkArr.includes(v.id);
  157 + if (v.children) {
  158 + isCheck(v.children, checkArr);
  159 + }
  160 + });
  161 + }
  162 + isCheck(data.value.tableData, checkArr);
  163 + }
  164 +
  165 + // 挂载完
  166 + Vue.onMounted(() => {
  167 + getList();
  168 + })
  169 +
  170 + return {
  171 + height,
  172 + data,
  173 + getList,
  174 + changeUser,
  175 + showUserDialog,
  176 + removeRel,
  177 + loadTableDataList,
  178 + selectionChange,
  179 + saveRel
  180 + }
  181 + }
  182 +}
  1 +<div class="batchChange-container" style="padding:10px;">
  2 + <el-row >
  3 + <el-col :span="22">
  4 + <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
  5 + <el-tab-pane v-for="(item,index) in tabData" :key="index" :label="item.ddicName" :name="item.ddicCode">
  6 + </el-tab-pane>
  7 + </el-tabs>
  8 + </el-col>
  9 + <el-col :span="2">
  10 + <div style="padding:0 10px 6px;border-bottom: 2px solid var(--el-border-color-light);">
  11 + <el-button type="primary" @click="exportClick()" size="small" style="margin-left: 6px">导出</el-button>
  12 + </div>
  13 + </el-col>
  14 + </el-row>
  15 + <el-row>
  16 + <el-col :span="24">
  17 + <component :is="activeName" :item="itemInfo" ref="roomDetail" />
  18 + </el-col>
  19 + </el-row>
  20 +</div>
  21 +<cm-dialog :title="title" width="500px" :showDialogVisible="show" @hidedialog="hidedialog" @okfunc="okExport">
  22 + <template v-slot>
  23 + <el-row>
  24 + <el-col :span="24">
  25 + <el-radio-group v-model="isAll">
  26 + <el-radio :label="1">导出全部</el-radio>
  27 + <el-radio :label="0">导出部分</el-radio>
  28 + </el-radio-group>
  29 + </el-col>
  30 + </el-row>
  31 + <el-row v-if="isAll==0">
  32 + <el-col :span="24" class="table-height">
  33 + <el-select
  34 + v-model="selectModel"
  35 + placeholder="请选择需要导出的页签"
  36 + multiple
  37 + style="width:80%"
  38 + clearable
  39 + filterable>
  40 + <el-option
  41 + v-for="item in tabData"
  42 + :key="item.ddicCode"
  43 + :label="item.ddicName"
  44 + :value="item.ddicCode"
  45 + />
  46 + </el-select>
  47 + </el-col>
  48 + </el-row>
  49 +
  50 + </template>
  51 +</cm-dialog>
  1 +export default {
  2 + name: 'batchChangeLeaders',
  3 + template: '',
  4 + components: {
  5 + //选项卡组件
  6 + 'resourcePer': Vue.defineAsyncComponent(
  7 + () => myImport('views/batchChangeLeaders/resourcePer/index')
  8 + ),
  9 + 'resourceLeader': Vue.defineAsyncComponent(
  10 + () => myImport('views/batchChangeLeaders/resourceLeader/index')
  11 + ),
  12 + 'resourceTypePer': Vue.defineAsyncComponent(
  13 + () => myImport('views/batchChangeLeaders/resourceTypePer/index')
  14 + ),
  15 + 'bizPer': Vue.defineAsyncComponent(
  16 + () => myImport('views/batchChangeLeaders/bizPer/index')
  17 + ),
  18 + 'bizLeader': Vue.defineAsyncComponent(
  19 + () => myImport('views/batchChangeLeaders/bizLeader/index')
  20 + ),
  21 + 'alarmSubPer': Vue.defineAsyncComponent(
  22 + () => myImport('views/batchChangeLeaders/alarmSubPer/index')
  23 + ),
  24 + 'rolePer': Vue.defineAsyncComponent(
  25 + () => myImport('views/batchChangeLeaders/rolePer/index')
  26 + ),
  27 + 'topoPer': Vue.defineAsyncComponent(
  28 + () => myImport('views/batchChangeLeaders/topoPer/index')
  29 + ),
  30 + 'autoPatrolPortPer': Vue.defineAsyncComponent(
  31 + () => myImport('views/batchChangeLeaders/autoPatrolPortPer/index')
  32 + ),
  33 + 'fileManagePer': Vue.defineAsyncComponent(
  34 + () => myImport('views/batchChangeLeaders/fileManagePer/index')
  35 + ),
  36 + },
  37 + data() {
  38 + },
  39 + props: {
  40 + },
  41 + setup: function (props, {attrs, slots, emit}) {
  42 + const {proxy} = Vue.getCurrentInstance();
  43 + const tabData=Vue.ref();//页签列表数据
  44 + const activeName = Vue.ref('');//标签页显示的页签名称
  45 + let itemInfo = Vue.ref({});
  46 + let selectModel=Vue.ref([]);//导出列表选中的数据
  47 + let title=Vue.ref('导出列表');//导出列表弹框名称
  48 + let show=Vue.ref(false);//导出列表弹框是否显示
  49 + let isAll=Vue.ref(1);//导出全部或者部分
  50 + //页签点击事件
  51 + const handleClick = (tab, event) => {
  52 + //console.log(tab, event)
  53 + let code = tab.props.name;
  54 + tabData.value.filter((item) =>{
  55 + if(item.ddicCode == code) {
  56 + itemInfo.value = item;
  57 + }
  58 + })
  59 + }
  60 + //导出点击事件
  61 + const exportClick=()=>{
  62 + show.value=true;
  63 + }
  64 + //导出全部按钮点击事件
  65 + const clickAll=()=>{
  66 + let arr=[];
  67 + tabData.value.map(item=>{
  68 + arr.push(item.ddicCode)
  69 + })
  70 + selectModel.value=arr;
  71 + }
  72 + //导出弹框关闭事件
  73 + let hidedialog=(flag)=>{
  74 + show.value=flag;
  75 + }
  76 + //导出弹框确认事件
  77 + let okExport=()=>{
  78 + let params={
  79 + userName:proxy.$route.query.username,
  80 + }
  81 + if(isAll.value==0){
  82 + if(selectModel.value && selectModel.value.length>0){
  83 + params.code=selectModel.value.join(',');
  84 + }else{
  85 + proxy.$global.showMsg('请选择导出所需列表','warning');
  86 + return;
  87 + }
  88 + }else{
  89 + params.code='';
  90 + }
  91 + proxy.$http.downloadFile("/api-web/personnelChange/export", params);
  92 + }
  93 + //获取需变更的选项卡数据
  94 + let getBatchChangeData=()=>{
  95 + proxy.$http.post("/api-web/manage/ddic/findSucDdics/batch_change_leaders", {}, function (res) {
  96 + if (res && res.data && res.data.length>0) {
  97 + tabData.value = res.data.sort((a,b)=>a.ddicSort-b.ddicSort);
  98 + activeName.value=tabData.value[0].ddicCode;
  99 + itemInfo.value = tabData.value[0];
  100 + }
  101 + })
  102 + }
  103 + // 挂载完
  104 + Vue.onMounted(() => {
  105 + getBatchChangeData();
  106 + })
  107 + return {
  108 + getBatchChangeData,
  109 + activeName,
  110 + handleClick,
  111 + tabData,
  112 + selectModel,
  113 + title,
  114 + show,
  115 + exportClick,
  116 + hidedialog,
  117 + okExport,
  118 + clickAll,
  119 + isAll,
  120 + itemInfo
  121 + }
  122 + }
  123 +}
  1 +<el-row>
  2 + <el-col :span="24" class="search">
  3 + <div class="condition" >
  4 + <el-form ref=“form” style="display: flex;">
  5 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;width: 300px">
  6 + <el-input v-model="search.keyword" placeholder="关键字支持:资源名称、IP"></el-input>
  7 + </el-form-item>
  8 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;">
  9 + <el-select filterable clearable v-model="search.resType" placeholder="请选择资源类型">
  10 + <el-option
  11 + v-for="item in resTypeOptions"
  12 + :key="item.resTypeCode"
  13 + :label="item.resTypeName"
  14 + :value="item.resTypeCode">
  15 + </el-option>
  16 + </el-select>
  17 + </el-form-item>
  18 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;">
  19 + <el-button @click="getListData">查询</el-button>
  20 + </el-form-item>
  21 +
  22 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;">
  23 + <el-button type="primary" @click="changeCancel()" >取消</el-button>
  24 + </el-form-item>
  25 +
  26 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;">
  27 + <el-button type="primary" @click="changeAdmin()" style="margin-left: 6px">变更</el-button>
  28 + </el-form-item>
  29 + </el-form>
  30 + </div>
  31 + </el-col>
  32 +</el-row>
  33 +<!--<el-row style="margin-bottom: 10px;">
  34 + <div class="flex-div-start">
  35 + <el-button type="primary" @click="changeCancel()" size="small">取消</el-button>
  36 + <el-button type="primary" @click="changeAdmin()" size="small" style="margin-left: 6px">变更</el-button>
  37 + </div>
  38 +</el-row>-->
  39 +<el-row style="font-size: 12px;color: grey;padding: 6px;">
  40 + {{item.ddicDesc}}
  41 +</el-row>
  42 +<el-row class="margin-bottom-50" style="margin-top: 3px">
  43 + <el-col :span="24" class="table-height">
  44 + <cm-table-page :columns="columns"
  45 + :dataList="resourceData"
  46 + :total="count"
  47 + :pageSize="search.limit"
  48 + @loaddata="loadTableDataList"
  49 + @selectionChange="selectionChange"
  50 + :showIndex="true"
  51 + :showSelection="true"
  52 + :showBorder="true"
  53 + :loading="loading"
  54 + :showPage="true"
  55 + :showTools="false"
  56 + :height="(height - 200)">
  57 + <template #default="{row,prop,column}">
  58 + <div v-if="prop == 'paramDesc'">
  59 + <el-select v-if="row.resType == 'HOST_X86SERVER'" v-model="row.showType" placeholder="">
  60 + <el-option
  61 + v-for="item in showTypeList"
  62 + :key="item.value"
  63 + :label="item.name"
  64 + :value="item.value"
  65 + >
  66 + </el-option>
  67 + </el-select>
  68 + </div>
  69 + </template>
  70 + </cm-table-page>
  71 + </el-col>
  72 +</el-row>
  73 +
  74 +<ChangeUsersList :show="show" :isTwoGroup="isTwoGroup" :isMulti="isMulti" @hideDialog="hideDialog" @savebtn="savebtn"></ChangeUsersList>
  1 +export default {
  2 + name: 'resourceLeader',
  3 + template: '',
  4 + components: {
  5 + 'ChangeUsersList': Vue.defineAsyncComponent(
  6 + () => myImport('views/batchChangeLeaders/changeUsersList/index')
  7 + ),
  8 + },
  9 + data() {
  10 + },
  11 + props: {
  12 + item:{
  13 + type:Object,
  14 + default:{}
  15 + }
  16 + },
  17 + setup: function (props, {attrs, slots, emit}) {
  18 + const {proxy} = Vue.getCurrentInstance();
  19 + //接收从用户列表中选中的用户
  20 + let userName=Vue.ref(proxy.$route.query.username);
  21 + //变更人员弹框
  22 + let show=Vue.ref(false);
  23 + //变更人员列表是否多选
  24 + let isMulti=Vue.ref(false);
  25 + //变更人员列表是否是两组
  26 + let isTwoGroup=Vue.ref(false);
  27 + //配置列表总数
  28 + let count = Vue.ref(0);
  29 + //列表高度
  30 + let height = Vue.ref(window.innerHeight);
  31 + //加载
  32 + let loading = Vue.ref(true);
  33 + //选中数据
  34 + let pitch = Vue.ref([]);
  35 + let showTypeList=Vue.ref([]);
  36 + let search = Vue.ref({
  37 + resType: '',
  38 + keyword: '',
  39 + page: 1,
  40 + limit: 50,
  41 + });
  42 + let resTypeOptions=Vue.ref([])
  43 + const columns = [
  44 + {
  45 + prop: 'resName',
  46 + label: '资源名称',
  47 + sortable: true,
  48 + align: 'center',
  49 + render: function (row) {
  50 + if(!row.resName){
  51 + return row.resCode;
  52 + }
  53 + return row.resName;
  54 + }
  55 + },
  56 + {
  57 + prop: 'ip',
  58 + label: 'IP地址',
  59 + sortable: true,
  60 + align: 'center',
  61 + },
  62 + {
  63 + prop: 'port',
  64 + label: '端口号',
  65 + sortable: true,
  66 + align: 'center',
  67 + },
  68 + {
  69 + prop: 'resMainAdmin',
  70 + label: '负责人',
  71 + sortable: true,
  72 + align: 'center',
  73 + render: function (row) {
  74 + let text = "";
  75 + let preFix = "";
  76 + if(row.resMainAdmin && row.resMainAdmin.includes(userName.value)){
  77 + // 主要负责人
  78 + text = row.resMainAdmin
  79 + preFix = "主";
  80 + } else {
  81 + // 辅负责人
  82 + text = row.resAuxiliaryAdmin
  83 + preFix = "辅";
  84 + }
  85 +
  86 + return `<div style="display: flex">
  87 + <div style='width: 22px;height: 22px;border-radius: 50%;line-height: 22px;border: solid 1px #5fafff;font-size: 12px;font-weight: bold;margin-right: 3px'>
  88 + ${preFix}
  89 + </div>
  90 + ${text}
  91 + </div>`;
  92 + }
  93 + },
  94 + {
  95 + prop: 'resTypeName',
  96 + label: '资源类型',
  97 + sortable: true,
  98 + align: 'center',
  99 + },
  100 + {
  101 + prop: 'state',
  102 + label: '资源状态',
  103 + sortable: true,
  104 + align: 'center',
  105 + render: function (row) {
  106 + switch (row.state) {
  107 + case "new" :
  108 + return '<span style="background-color: #eee;color:#666;border-radius: 100px;padding:0 8px;display: inline-block;height:24px;line-height: 24px;">未监控</span>'
  109 + case "monitor" :
  110 + return '<span style="background-color: #0BAC33;color:#fff;border-radius: 100px;padding:0 8px;display: inline-block;height:24px;line-height: 24px;">监控中</span>'
  111 + case "stop" :
  112 + return '<span style="background-color: #d81e06;color:#fff;border-radius: 100px;padding:0 8px;display: inline-block;height:24px;line-height: 24px;">暂停</span>'
  113 + default :
  114 + return '<span style="background-color: #eee;color:#666;border-radius: 100px;padding:0 8px;display: inline-block;height:24px;line-height: 24px;">未监控</span>'
  115 + }
  116 + }
  117 + },
  118 + {
  119 + prop: 'resCategory',
  120 + label: '资源分类',
  121 + sortable: true,
  122 + align: 'center',
  123 + /* render: function (row) {
  124 +
  125 + }*/
  126 + }
  127 + ];
  128 +
  129 + //列表数据
  130 + let resourceData = Vue.ref([]);
  131 + //获取列表数据
  132 + const getListData = () => {
  133 + loading.value = true;
  134 + //定义列表参数
  135 + let getParams = {
  136 + resType:search.value.resType,
  137 + keywords:search.value.keyword,
  138 + userName:userName.value,
  139 + page: search.value.page,
  140 + limit: search.value.limit
  141 + };
  142 + proxy.$http.post("/api-web/personnelChange/getList/resourceLeader", getParams, function (res) {
  143 + if (res && res.data) {
  144 + resourceData.value = res.data ? res.data : [];
  145 + count.value = res.count;
  146 + loading.value = false;
  147 + }
  148 + })
  149 + }
  150 + //重新加载表格数据
  151 + let loadTableDataList = ({page, limit}) => {
  152 + search.value.page=page;
  153 + search.value.limit=limit;
  154 + getListData();
  155 + }
  156 + let resIds=Vue.ref('');//选中的ids
  157 + //表格全选事件
  158 + let selectionChange = (val) => {
  159 + pitch.value = val;
  160 + let arr=[];
  161 + pitch.value.map(item=>{
  162 + arr.push(item.resId)
  163 + })
  164 + resIds.value=arr.join(",");//选中的值
  165 + }
  166 + //获取资源类型数据
  167 + let getResourceTypoe=()=>{
  168 + proxy.$http.get(`/api-web/manage/restype/list`, {}, function (res) {
  169 + if (res && res.data) {
  170 + resTypeOptions.value=res.data
  171 + }
  172 + })
  173 + }
  174 + //获取展示类型的字典数据
  175 + let initShowType=()=>{
  176 + proxy.$http.post("/api-web/manage/ddic/findSucDdics/DETAILS_POWER", {}, function (res) {
  177 + if (res && res.data) {
  178 + let arr=res.data;
  179 + if(arr && arr.length>0){
  180 + arr.map(v=>{
  181 + showTypeList.value.push({
  182 + name: v.ddicName
  183 + ,value: v.ddicCode.substring(v.ddicCode.lastIndexOf("_")+1,v.ddicCode.length)
  184 + });
  185 + })
  186 + }
  187 +
  188 + }
  189 + })
  190 + }
  191 + //批量取消相关资源
  192 + let changeCancel = () => {
  193 + if(pitch.value.length<1){
  194 + proxy.$global.showMsg('请至少选择一项','warning');
  195 + }else{
  196 + proxy.$global.confirm("确定取消相关资源?", function () {
  197 + let parmas={
  198 + userName:userName.value,
  199 + resId:resIds.value
  200 + }
  201 + proxy.$http.post(`/api-web/personnelChange/remove/resourceLeader`, parmas, function (res) {
  202 + if (res && res.success) {
  203 + proxy.$global.showMsg('取消成功!');
  204 + getListData()
  205 + }
  206 + })
  207 + });
  208 + }
  209 + }
  210 + //变更负责人
  211 + let changeAdmin = () => {
  212 + if(pitch.value.length<1){
  213 + proxy.$global.showMsg('请至少选择一项','warning');
  214 +
  215 + }else{
  216 + show.value=true;
  217 + }
  218 +
  219 + }
  220 + //变更人员的弹框关闭后
  221 + let hideDialog =(flag)=>{
  222 + show.value=flag;
  223 + }
  224 + //变更人员的弹框保存后
  225 + let savebtn =(obj)=>{
  226 + show.value=false;
  227 + //obj.selectModel 选中的用户组(一个/主负责人) obj.selectModelSecond 辅负责人,都是数组
  228 + let targetUserName='';
  229 + if(obj.selectModel){
  230 + targetUserName=obj.selectModel.join(',')
  231 + }
  232 + let params={
  233 + resId:resIds.value,
  234 + targetUserName:targetUserName,
  235 + userName:userName.value,
  236 + }
  237 + proxy.$http.post(`/api-web/personnelChange/update/resourceLeader`, params, function (res) {
  238 + if (res && res.success) {
  239 + proxy.$global.showMsg('变更成功!');
  240 + getListData()
  241 + }
  242 + })
  243 + }
  244 + // 挂载完
  245 + Vue.onMounted(() => {
  246 + initShowType();
  247 + getResourceTypoe();
  248 + getListData();
  249 + })
  250 + return {
  251 + isMulti,
  252 + isTwoGroup,
  253 + show,
  254 + initShowType,
  255 + showTypeList,
  256 + search,
  257 + resTypeOptions,
  258 + changeCancel,
  259 + count,
  260 + hideDialog,
  261 + savebtn,
  262 + changeAdmin,
  263 + getResourceTypoe,
  264 +
  265 + resourceData,
  266 + columns,
  267 + height,
  268 + loading,
  269 +
  270 + selectionChange,
  271 +
  272 + getListData,
  273 + loadTableDataList,
  274 + userName
  275 + }
  276 + }
  277 +}
  1 +<el-row>
  2 + <el-col :span="24" class="search">
  3 + <div class="condition" >
  4 + <el-form ref=“form” style="display: flex;">
  5 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;width: 300px">
  6 + <el-input v-model="search.keyword" placeholder="关键字支持:资源名称、IP"></el-input>
  7 + </el-form-item>
  8 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;">
  9 + <el-select filterable clearable v-model="search.resType" placeholder="请选择资源类型">
  10 + <el-option
  11 + v-for="item in resTypeOptions"
  12 + :key="item.resTypeCode"
  13 + :label="item.resTypeName"
  14 + :value="item.resTypeCode">
  15 + </el-option>
  16 + </el-select>
  17 + </el-form-item>
  18 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;">
  19 + <el-button @click="getListData" >查询</el-button>
  20 + </el-form-item>
  21 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;">
  22 + <el-button type="primary" @click="changeCancel()">取消</el-button>
  23 + </el-form-item>
  24 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;">
  25 + <el-button type="primary" @click="changeAdmin()" style="margin-left: 6px">变更</el-button>
  26 + </el-form-item>
  27 + </el-form>
  28 + </div>
  29 + </el-col>
  30 +</el-row>
  31 +<!--<el-row style="margin-bottom: 10px;">
  32 + <div class="flex-div-start">
  33 + <el-button type="primary" @click="changeCancel()" size="small">取消</el-button>
  34 + <el-button type="primary" @click="changeAdmin()" size="small" style="margin-left: 6px">变更</el-button>
  35 + </div>
  36 +</el-row>-->
  37 +<el-row style="font-size: 12px;color: grey;padding: 6px;">
  38 + {{item.ddicDesc}}
  39 +</el-row>
  40 +<el-row class="margin-bottom-50" style="margin-top: 3px">
  41 + <el-col :span="24" class="table-height">
  42 + <cm-table-page :columns="columns"
  43 + :dataList="resourceData"
  44 + :total="count"
  45 + :pageSize="search.limit"
  46 + @loaddata="loadTableDataList"
  47 + @selectionChange="selectionChange"
  48 + :showIndex="true"
  49 + :showSelection="true"
  50 + :showBorder="true"
  51 + :loading="loading"
  52 + :showPage="true"
  53 + :showTools="false"
  54 + :height="(height - 200)">
  55 + <template #default="{row,prop,column}">
  56 + <div v-if="prop == 'paramDesc'">
  57 + <el-select v-if="row.resType == 'HOST_X86SERVER'" v-model="row.showType" placeholder="">
  58 + <el-option
  59 + v-for="item in showTypeList"
  60 + :key="item.value"
  61 + :label="item.name"
  62 + :value="item.value"
  63 + >
  64 + </el-option>
  65 + </el-select>
  66 + </div>
  67 + </template>
  68 + </cm-table-page>
  69 + </el-col>
  70 +</el-row>
  71 +
  72 +<ChangeUsersList :show="show" :isTwoGroup="isTwoGroup" :isMulti="isMulti" @hideDialog="hideDialog" @savebtn="savebtn"></ChangeUsersList>
  1 +export default {
  2 + name: 'resourcePer',
  3 + template: '',
  4 + components: {
  5 + 'ChangeUsersList': Vue.defineAsyncComponent(
  6 + () => myImport('views/batchChangeLeaders/changeUsersList/index')
  7 + ),
  8 + },
  9 + data() {
  10 + },
  11 + props: {
  12 + item:{
  13 + type:Object,
  14 + default:{}
  15 + }
  16 + },
  17 + setup: function (props, {attrs, slots, emit}) {
  18 + const {proxy} = Vue.getCurrentInstance();
  19 + //接收从用户列表中选中的用户
  20 + let userName=Vue.ref(proxy.$route.query.username);
  21 + //变更人员弹框
  22 + let show=Vue.ref(false);
  23 + //变更人员列表是否多选
  24 + let isMulti=Vue.ref(false);
  25 + //变更人员列表是否是两组
  26 + let isTwoGroup=Vue.ref(false);
  27 + //配置列表总数
  28 + let count = Vue.ref(0);
  29 + //列表高度
  30 + let height = Vue.ref(window.innerHeight);
  31 + //加载
  32 + let loading = Vue.ref(true);
  33 + //选中数据
  34 + let pitch = Vue.ref([]);
  35 + let showTypeList=Vue.ref([]);
  36 + let search = Vue.ref({
  37 + resType: '',
  38 + keyword: '',
  39 + page: 1,
  40 + limit: 50,
  41 + });
  42 + let resTypeOptions=Vue.ref([])
  43 + const columns = [
  44 + {
  45 + prop: 'resName',
  46 + label: '资源名称',
  47 + sortable: true,
  48 + align: 'center',
  49 + },
  50 + {
  51 + prop: 'ip',
  52 + label: 'IP地址',
  53 + sortable: true,
  54 + align: 'center',
  55 + },
  56 + {
  57 + prop: 'port',
  58 + label: '端口号',
  59 + sortable: true,
  60 + align: 'center',
  61 + },
  62 + {
  63 + prop: 'admin',
  64 + label: '负责人',
  65 + sortable: true,
  66 + align: 'center',
  67 + },
  68 + {
  69 + prop: 'resTypeName',
  70 + label: '资源类型',
  71 + sortable: true,
  72 + align: 'center',
  73 + },
  74 + {
  75 + prop: 'state',
  76 + label: '资源状态',
  77 + sortable: true,
  78 + align: 'center',
  79 + render: function (row) {
  80 + switch (row.state) {
  81 + case "new" :
  82 + return '<span style="background-color: #eee;color:#666;border-radius: 100px;padding:0 8px;display: inline-block;height:24px;line-height: 24px;">未监控</span>'
  83 + case "monitor" :
  84 + return '<span style="background-color: #0BAC33;color:#fff;border-radius: 100px;padding:0 8px;display: inline-block;height:24px;line-height: 24px;">监控中</span>'
  85 + case "stop" :
  86 + return '<span style="background-color: #d81e06;color:#fff;border-radius: 100px;padding:0 8px;display: inline-block;height:24px;line-height: 24px;">暂停</span>'
  87 + default :
  88 + return '<span style="background-color: #eee;color:#666;border-radius: 100px;padding:0 8px;display: inline-block;height:24px;line-height: 24px;">未监控</span>'
  89 + }
  90 + }
  91 + },
  92 + {
  93 + prop: 'paramDesc',
  94 + label: '展示类型',
  95 + sortable: true,
  96 + align: 'center',
  97 + /* render: function (row) {
  98 +
  99 + }*/
  100 + }
  101 + ];
  102 +
  103 + //列表数据
  104 + let resourceData = Vue.ref([]);
  105 + //获取列表数据
  106 + const getListData = () => {
  107 + // resourceData.value=[];
  108 + loading.value = true;
  109 + //定义列表参数
  110 + let getParams = {
  111 + resType:search.value.resType,
  112 + keywords:search.value.keyword,
  113 + userName:userName.value,
  114 + page: search.value.page,
  115 + limit: search.value.limit
  116 + };
  117 + proxy.$http.post("/api-web/personnelChange/getList/resourcePer", getParams, function (res) {
  118 + if (res && res.data) {
  119 + resourceData.value = res.data ? res.data : [];
  120 + count.value = res.count;
  121 + loading.value = false;
  122 + }
  123 + })
  124 + }
  125 + //重新加载表格数据
  126 + let loadTableDataList = ({page, limit}) => {
  127 + search.value.page=page;
  128 + search.value.limit=limit;
  129 + getListData();
  130 + }
  131 + let resIds=Vue.ref('');//选中的ids
  132 + //表格全选事件
  133 + let selectionChange = (val) => {
  134 + pitch.value = val;
  135 + let arr=[];
  136 + pitch.value.map(item=>{
  137 + arr.push(item.resId)
  138 + })
  139 + resIds.value=arr.join(",");//选中的值
  140 + /*proxy.resourceData.map((v, i) => {
  141 + v.checked = false;
  142 + });
  143 + let selectData = val;
  144 + if (selectData.length > 0) {
  145 + selectData.map((item, index) => {
  146 + proxy.resourceData.map((v, i) => {
  147 + if (item.id == v.id) {
  148 + v.checked = true;
  149 + }
  150 + })
  151 + })
  152 + } else {
  153 + proxy.resourceData.map((v, i) => {
  154 + v.checked = false;
  155 + })
  156 + }*/
  157 + }
  158 + //获取资源类型数据
  159 + let getResourceTypoe=()=>{
  160 + proxy.$http.get(`/api-web/manage/restype/list`, {}, function (res) {
  161 + if (res && res.data) {
  162 + resTypeOptions.value=res.data
  163 + }
  164 + })
  165 + }
  166 + //获取展示类型的字典数据
  167 + let initShowType=()=>{
  168 + proxy.$http.post("/api-web/manage/ddic/findSucDdics/DETAILS_POWER", {}, function (res) {
  169 + if (res && res.data) {
  170 + let arr=res.data;
  171 + if(arr && arr.length>0){
  172 + arr.map(v=>{
  173 + showTypeList.value.push({
  174 + name: v.ddicName
  175 + ,value: v.ddicCode.substring(v.ddicCode.lastIndexOf("_")+1,v.ddicCode.length)
  176 + });
  177 + })
  178 + }
  179 +
  180 + }
  181 + })
  182 + }
  183 + //批量取消相关资源
  184 + let changeCancel = () => {
  185 + if(pitch.value.length<1){
  186 + proxy.$global.showMsg('请至少选择一项','warning');
  187 + }else{
  188 + proxy.$global.confirm("确定取消相关资源?", function () {
  189 + let parmas={
  190 + userName:userName.value,
  191 + resId:resIds.value
  192 + }
  193 + proxy.$http.post(`/api-web/personnelChange/remove/resourcePer`, parmas, function (res) {
  194 + if (res && res.success) {
  195 + proxy.$global.showMsg('取消成功!');
  196 + getListData()
  197 + }
  198 + })
  199 + });
  200 + }
  201 + }
  202 + //变更负责人
  203 + let changeAdmin = () => {
  204 + if(pitch.value.length<1){
  205 + proxy.$global.showMsg('请至少选择一项','warning');
  206 +
  207 + }else{
  208 + show.value=true;
  209 + }
  210 +
  211 + }
  212 + //变更人员的弹框关闭后
  213 + let hideDialog =(flag)=>{
  214 + show.value=flag;
  215 + }
  216 + //变更人员的弹框保存后
  217 + let savebtn =(obj)=>{
  218 + show.value=false;
  219 + //obj.selectModel 选中的用户组(一个/主负责人) obj.selectModelSecond 辅负责人,都是数组
  220 + let targetUserName='';
  221 + if(obj.selectModel){
  222 + targetUserName=obj.selectModel.join(',')
  223 + }
  224 + let params={
  225 + resId:resIds.value,
  226 + targetUserName:targetUserName,
  227 + userName:userName.value,
  228 + }
  229 + proxy.$http.post(`/api-web/personnelChange/update/resourcePer`, params, function (res) {
  230 + if (res && res.success) {
  231 + proxy.$global.showMsg('变更成功!');
  232 + getListData()
  233 + }
  234 + })
  235 + }
  236 + // 挂载完
  237 + Vue.onMounted(() => {
  238 + initShowType();
  239 + getResourceTypoe();
  240 + getListData();
  241 + })
  242 + return {
  243 + isMulti,
  244 + isTwoGroup,
  245 + show,
  246 + initShowType,
  247 + showTypeList,
  248 + search,
  249 + resTypeOptions,
  250 + changeCancel,
  251 + count,
  252 + hideDialog,
  253 + savebtn,
  254 + changeAdmin,
  255 + getResourceTypoe,
  256 +
  257 + resourceData,
  258 + columns,
  259 + height,
  260 + loading,
  261 +
  262 + selectionChange,
  263 +
  264 + getListData,
  265 + loadTableDataList,
  266 + userName
  267 + }
  268 + }
  269 +}
  1 +<el-row>
  2 + <el-col :span="24" class="search">
  3 + <div class="condition" >
  4 + <el-form ref=“form” style="display: flex;">
  5 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;width: 300px">
  6 + <el-input v-model="search.keyword" placeholder="关键字支持:资源类型名称"></el-input>
  7 + </el-form-item>
  8 + <!-- <el-form-item style="margin-right: 6px;margin-bottom: 10px;">
  9 + <el-select filterable clearable v-model="search.resType" placeholder="请选择资源类型">
  10 + <el-option
  11 + v-for="item in resTypeOptions"
  12 + :key="item.resTypeCode"
  13 + :label="item.resTypeName"
  14 + :value="item.resTypeCode">
  15 + </el-option>
  16 + </el-select>
  17 + </el-form-item>-->
  18 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;">
  19 + <el-button @click="getListData">查询</el-button>
  20 + </el-form-item>
  21 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;">
  22 + <el-button type="primary" @click="changeCancel()" >取消</el-button>
  23 + </el-form-item>
  24 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;">
  25 + <el-button type="primary" @click="changeAdmin()" style="margin-left: 6px">变更</el-button>
  26 + </el-form-item>
  27 + </el-form>
  28 + </div>
  29 + </el-col>
  30 +</el-row>
  31 +<!--<el-row style="margin-bottom: 10px;">
  32 + <div class="flex-div-start">
  33 + <el-button type="primary" @click="changeCancel()" size="small">取消</el-button>
  34 + <el-button type="primary" @click="changeAdmin()" size="small" style="margin-left: 6px">变更</el-button>
  35 + </div>
  36 +</el-row>-->
  37 +<el-row style="font-size: 12px;color: grey;padding: 6px;">
  38 + {{item.ddicDesc}}
  39 +</el-row>
  40 +<el-row class="margin-bottom-50" style="margin-top: 3px">
  41 + <el-col :span="24" class="table-height tree-table">
  42 + <cm-table-page :columns="columns"
  43 + :dataList="resourceData"
  44 + :total="count"
  45 + :pageSize="search.limit"
  46 + @loaddata="loadTableDataList"
  47 + @selectionChange="selectionChange"
  48 + :showIndex="true"
  49 + :showSelection="true"
  50 + :showBorder="true"
  51 + :loading="loading"
  52 + :showPage="true"
  53 + :showTools="false"
  54 + :getRowKeys="'resTypeId'"
  55 + :defaultExpand="true"
  56 + :height="(height - 200)">
  57 + <template #default="{row,prop,column}">
  58 + <div v-if="prop == 'showType'">
  59 + <el-select v-if="row.resType == 'HOST_X86SERVER'" v-model="row.showType" placeholder="">
  60 + <el-option
  61 + v-for="item in showTypeList"
  62 + :key="item.value"
  63 + :label="item.name"
  64 + :value="item.value"
  65 + >
  66 + </el-option>
  67 + </el-select>
  68 + </div>
  69 + </template>
  70 + </cm-table-page>
  71 + </el-col>
  72 +</el-row>
  73 +
  74 +<ChangeUsersList :show="show" :isTwoGroup="isTwoGroup" :isMulti="isMulti" @hideDialog="hideDialog" @savebtn="savebtn"></ChangeUsersList>
  1 +export default {
  2 + name: 'resourceTypePer',
  3 + template: '',
  4 + components: {
  5 + 'ChangeUsersList': Vue.defineAsyncComponent(
  6 + () => myImport('views/batchChangeLeaders/changeUsersList/index')
  7 + ),
  8 + },
  9 + data() {
  10 + },
  11 + props: {
  12 + item:{
  13 + type:Object,
  14 + default:{}
  15 + }
  16 + },
  17 + setup: function (props, {attrs, slots, emit}) {
  18 + const {proxy} = Vue.getCurrentInstance();
  19 + //接收从用户列表中选中的用户
  20 + let userName=Vue.ref(proxy.$route.query.username);
  21 + //变更人员弹框
  22 + let show=Vue.ref(false);
  23 + //变更人员列表是否多选
  24 + let isMulti=Vue.ref(false);
  25 + //变更人员列表是否是两组
  26 + let isTwoGroup=Vue.ref(false);
  27 + //配置列表总数
  28 + let count = Vue.ref(0);
  29 + //列表高度
  30 + let height = Vue.ref(window.innerHeight);
  31 + //加载
  32 + let loading = Vue.ref(true);
  33 + //选中数据
  34 + let pitch = Vue.ref([]);
  35 + //展示类型
  36 + let showTypeList=Vue.ref([]);
  37 + //采集类型
  38 + let ddicCollType = Vue.ref([]);
  39 +
  40 + let search = Vue.ref({
  41 + resType: '',
  42 + keyword: '',
  43 + page: 1,
  44 + limit: 50,
  45 + });
  46 + let resTypeOptions=Vue.ref([])
  47 + const columns = [
  48 + {
  49 + prop: 'resTypeName',
  50 + label: '资源类型名称',
  51 + sortable: true,
  52 + align: 'center',
  53 + },
  54 + {
  55 + prop: 'resTypeCode',
  56 + label: '编码',
  57 + sortable: true,
  58 + align: 'center',
  59 + },
  60 + {
  61 + prop: 'resTypeDesc',
  62 + label: '类别',
  63 + sortable: true,
  64 + align: 'center',
  65 + },
  66 + {
  67 + prop: 'collType',
  68 + label: '采集类型',
  69 + sortable: true,
  70 + align: 'center',
  71 + render: function (row) {
  72 + let collType='';
  73 + ddicCollType.value.map(item=>{
  74 + if(row.collType==item.value){
  75 + collType=item.name
  76 + }
  77 + })
  78 + return collType;
  79 + }
  80 + },
  81 + {
  82 + prop: 'forbidden',
  83 + label: '是否启用',
  84 + sortable: true,
  85 + align: 'center',
  86 + render: function (row) {
  87 + let str='';
  88 + if(row.forbidden==0){
  89 + str='启用';
  90 + }else{
  91 + str='禁用';
  92 + }
  93 + return str;
  94 + }
  95 + },
  96 + {
  97 + prop: 'showType',
  98 + label: '展示类型',
  99 + sortable: true,
  100 + align: 'center',
  101 + /* render: function (row) {
  102 +
  103 + }*/
  104 + },
  105 + {
  106 + prop: 'createTime',
  107 + label: '创建时间',
  108 + align: 'center'
  109 + },
  110 +
  111 + ];
  112 +
  113 + //列表数据
  114 + let resourceData = Vue.ref([]);
  115 + //获取列表数据
  116 + const getListData = () => {
  117 + // resourceData.value=[];
  118 + loading.value = true;
  119 + //定义列表参数
  120 + let getParams = {
  121 + resType:search.value.resType,
  122 + keywords:search.value.keyword,
  123 + userName: userName.value,
  124 + page: search.value.page,
  125 + limit: search.value.limit
  126 + };
  127 + proxy.$http.post("/api-web/personnelChange/getList/resourceTypePer", getParams, function (res) {
  128 + if (res && res.data) {
  129 + resourceData.value = handleTree(res.data, 'resTypeCode', 'parentId')
  130 + count.value = res.count;
  131 + loading.value = false;
  132 + }else{
  133 + resourceData.value=[];
  134 + }
  135 + })
  136 + }
  137 + //组装树结构
  138 + let handleTree=(data, id, parentId, children)=> {
  139 + let config = {
  140 + id: id || 'id',
  141 + parentId: parentId || 'parentId',
  142 + childrenList: children || 'children'
  143 + };
  144 +
  145 + var childrenListMap = {};
  146 + var nodeIds = {};
  147 + var tree = [];
  148 +
  149 + for (let d of data) {
  150 + let parentId = d[config.parentId];
  151 + if (childrenListMap[parentId] == null) {
  152 + childrenListMap[parentId] = [];
  153 + }
  154 + nodeIds[d[config.id]] = d;
  155 + childrenListMap[parentId].push(d);
  156 + }
  157 +
  158 + for (let d of data) {
  159 + let parentId = d[config.parentId];
  160 + if (nodeIds[parentId] == null) {
  161 + tree.push(d);
  162 + }
  163 + }
  164 +
  165 + for (let t of tree) {
  166 + adaptToChildrenList(t);
  167 + }
  168 +
  169 + function adaptToChildrenList(o) {
  170 + if (childrenListMap[o[config.id]] !== null) {
  171 + o[config.childrenList] = childrenListMap[o[config.id]];
  172 + }
  173 + if (o[config.childrenList]) {
  174 + for (let c of o[config.childrenList]) {
  175 + adaptToChildrenList(c);
  176 + }
  177 + }
  178 + }
  179 + return tree;
  180 + }
  181 + //重新加载表格数据
  182 + let loadTableDataList = ({page, limit}) => {
  183 + search.value.page=page;
  184 + search.value.limit=limit;
  185 + selectionChange([])
  186 + getListData();
  187 + }
  188 + let resTypeId=Vue.ref('');//选中的ids
  189 + //表格全选事件
  190 + let selectionChange = (val) => {
  191 + pitch.value = val;
  192 + let arr=[];
  193 + pitch.value.map(item=>{
  194 + arr.push(item.resTypeId)
  195 + })
  196 + resTypeId.value=arr.join(",");//选中的值
  197 + }
  198 +
  199 + //获取资源类型数据
  200 + let getResourceTypoe=()=>{
  201 + proxy.$http.get(`/api-web/manage/restype/list`, {}, function (res) {
  202 + if (res && res.data) {
  203 + resTypeOptions.value=res.data
  204 + }
  205 + })
  206 + }
  207 + //获取展示类型的字典数据
  208 + let initShowType=()=>{
  209 + proxy.$http.post("/api-web/manage/ddic/findSucDdics/DETAILS_POWER", {}, function (res) {
  210 + if (res && res.data) {
  211 + let arr=res.data;
  212 + if(arr && arr.length>0){
  213 + arr.map(v=>{
  214 + showTypeList.value.push({
  215 + name: v.ddicName
  216 + ,value: v.ddicCode.substring(v.ddicCode.lastIndexOf("_")+1,v.ddicCode.length)
  217 + });
  218 + })
  219 + }
  220 +
  221 + }
  222 + })
  223 + }
  224 + //获取采集类型的字典数据
  225 + let initCollType=()=>{
  226 + proxy.$http.post("/api-web/manage/ddic/findSucDdics/collType", {}, function (res) {
  227 + if (res && res.data) {
  228 + let arr=res.data;
  229 + if(arr && arr.length>0){
  230 + arr.map(v=>{
  231 + ddicCollType.value.push({
  232 + name: v.ddicName
  233 + ,value: v.ddicCode
  234 + });
  235 + })
  236 + }
  237 +
  238 + }
  239 + })
  240 + }
  241 + //批量取消负责的相关资源
  242 + let changeCancel = () => {
  243 + if(pitch.value.length<1){
  244 + proxy.$global.showMsg('请至少选择一项','warning');
  245 + }else{
  246 + proxy.$global.confirm("确定取消负责的相关资源?", function () {
  247 + let parmas={
  248 + userName:userName.value,
  249 + resTypeId:resTypeId.value
  250 + }
  251 + proxy.$http.post(`/api-web/personnelChange/remove/resourceTypePer`, parmas, function (res) {
  252 + if (res && res.success) {
  253 + proxy.$global.showMsg('取消成功!');
  254 + getListData()
  255 + }
  256 + })
  257 + });
  258 + }
  259 + }
  260 + //变更负责人
  261 + let changeAdmin = () => {
  262 + if(pitch.value.length<1){
  263 + proxy.$global.showMsg('请至少选择一项','warning');
  264 +
  265 + }else{
  266 + show.value=true;
  267 + }
  268 +
  269 + }
  270 + //变更人员的弹框关闭后
  271 + let hideDialog =(flag)=>{
  272 + show.value=flag;
  273 + }
  274 + //变更人员的弹框保存后
  275 + let savebtn =(obj)=>{
  276 + show.value=false;
  277 + //obj.selectModel 选中的用户组(一个/主负责人) obj.selectModelSecond 辅负责人,都是数组
  278 + let targetUserName='';
  279 + if(obj.selectModel){
  280 + targetUserName=obj.selectModel.join(',')
  281 + }
  282 + let params={
  283 + resTypeId:resTypeId.value,
  284 + targetUserName:targetUserName,
  285 + userName:userName.value,
  286 + }
  287 + proxy.$http.post(`/api-web/personnelChange/update/resourceTypePer`, params, function (res) {
  288 + if (res && res.success) {
  289 + proxy.$global.showMsg('变更成功!');
  290 + getListData()
  291 + }
  292 + })
  293 + }
  294 + // 挂载完
  295 + Vue.onMounted(() => {
  296 + initShowType();
  297 + initCollType();
  298 + getResourceTypoe();
  299 + getListData();
  300 + })
  301 + return {
  302 + isMulti,
  303 + isTwoGroup,
  304 + show,
  305 + initShowType,
  306 + initCollType,
  307 + showTypeList,
  308 + ddicCollType,
  309 + search,
  310 + resTypeOptions,
  311 + changeCancel,
  312 + count,
  313 + hideDialog,
  314 + savebtn,
  315 + changeAdmin,
  316 + getResourceTypoe,
  317 +
  318 + resourceData,
  319 + columns,
  320 + height,
  321 + loading,
  322 + selectionChange,
  323 +
  324 + getListData,
  325 + loadTableDataList,
  326 + }
  327 + }
  328 +}
  1 +<el-row>
  2 + <el-col :span="24" class="search">
  3 + <div class="condition" >
  4 + <el-form ref=“form” style="display: flex;">
  5 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;width: 300px">
  6 + <el-input v-model="search.keyword" placeholder="关键字支持:角色名称"></el-input>
  7 + </el-form-item>
  8 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;">
  9 + <el-button @click="getListData" >查询</el-button>
  10 + </el-form-item>
  11 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;">
  12 + <el-button type="primary" @click="changeCancel()" >取消</el-button>
  13 + </el-form-item>
  14 + </el-form>
  15 + </div>
  16 + </el-col>
  17 +</el-row>
  18 +<!--<el-row style="margin-bottom: 10px;">
  19 + <div class="flex-div-start">
  20 + <el-button type="primary" @click="changeCancel()" size="small">取消</el-button>
  21 +&lt;!&ndash; <el-button type="primary" @click="changeAdmin()" size="small" style="margin-left: 6px">变更</el-button>&ndash;&gt;
  22 + </div>
  23 +</el-row>-->
  24 +<el-row style="font-size: 12px;color: grey;padding: 6px;">
  25 + {{item.ddicDesc}}
  26 +</el-row>
  27 +<el-row class="margin-bottom-50" style="margin-top: 3px">
  28 + <el-col :span="24" class="table-height">
  29 + <cm-table-page :columns="columns"
  30 + :dataList="resourceData"
  31 + :total="count"
  32 + :pageSize="search.limit"
  33 + @loaddata="loadTableDataList"
  34 + @selectionChange="selectionChange"
  35 + :showIndex="true"
  36 + :showSelection="true"
  37 + :showBorder="true"
  38 + :loading="loading"
  39 + :showPage="true"
  40 + :showTools="false"
  41 + :height="(height - 200)">
  42 + <template #default="{row,prop,column}">
  43 + </template>
  44 + </cm-table-page>
  45 + </el-col>
  46 +</el-row>
  47 +
  48 +<ChangeUsersList :show="show" :isTwoGroup="isTwoGroup" :isMulti="isMulti" @hideDialog="hideDialog" @savebtn="savebtn"></ChangeUsersList>
  1 +export default {
  2 + name: 'rolePer',
  3 + template: '',
  4 + components: {
  5 + 'ChangeUsersList': Vue.defineAsyncComponent(
  6 + () => myImport('views/batchChangeLeaders/changeUsersList/index')
  7 + ),
  8 + },
  9 + data() {
  10 + },
  11 + props: {
  12 + item:{
  13 + type:Object,
  14 + default:{}
  15 + }
  16 + },
  17 + setup: function (props, {attrs, slots, emit}) {
  18 + const {proxy} = Vue.getCurrentInstance();
  19 + //接收从用户列表中选中的用户
  20 + let userName=Vue.ref(proxy.$route.query.username);
  21 + //变更人员弹框
  22 + let show=Vue.ref(false);
  23 + //变更人员列表是否多选
  24 + let isMulti=Vue.ref(false);
  25 + //变更人员列表是否是两组
  26 + let isTwoGroup=Vue.ref(false);
  27 + //配置列表总数
  28 + let count = Vue.ref(0);
  29 + //列表高度
  30 + let height = Vue.ref(window.innerHeight);
  31 + //加载
  32 + let loading = Vue.ref(true);
  33 + //选中数据
  34 + let pitch = Vue.ref([]);
  35 + let search = Vue.ref({
  36 + resType: '',
  37 + keyword: '',
  38 + page: 1,
  39 + limit: 50,
  40 + });
  41 + const columns = [
  42 + {
  43 + prop: 'name',
  44 + label: '角色名称',
  45 + sortable: true,
  46 + align: 'center',
  47 + },
  48 + {
  49 + prop: 'code',
  50 + label: '角色编码',
  51 + sortable: true,
  52 + align: 'center',
  53 + },
  54 + {
  55 + prop: 'remark',
  56 + label: '角色备注',
  57 + sortable: true,
  58 + align: 'center',
  59 + }
  60 + ];
  61 +
  62 + //列表数据
  63 + let resourceData = Vue.ref([]);
  64 + //获取列表数据
  65 + const getListData = () => {
  66 + resourceData.value=[];
  67 + loading.value = true;
  68 + //定义列表参数
  69 + let getParams = {
  70 + resType:search.value.resType,
  71 + keywords:search.value.keyword,
  72 + userName:userName.value,
  73 + page: search.value.page,
  74 + limit: search.value.limit
  75 + };
  76 + proxy.$http.post("/api-web/personnelChange/getList/rolePer", getParams, function (res) {
  77 + if (res && res.data) {
  78 + resourceData.value = res.data ? res.data : [];
  79 + count.value = res.count;
  80 + loading.value = false;
  81 + }
  82 + })
  83 + }
  84 + //重新加载表格数据
  85 + let loadTableDataList = ({page, limit}) => {
  86 + search.value.page=page;
  87 + search.value.limit=limit;
  88 + getListData();
  89 + }
  90 + let roleIds=Vue.ref('');//选中的ids
  91 + //表格全选事件
  92 + let selectionChange = (val) => {
  93 + pitch.value = val;
  94 + let arr=[];
  95 + pitch.value.map(item=>{
  96 + arr.push(item.id)
  97 + })
  98 + roleIds.value=arr.join(",");//选中的值
  99 + }
  100 +
  101 + //批量取消相关资源
  102 + let changeCancel = () => {
  103 + if(pitch.value.length<1){
  104 + proxy.$global.showMsg('请至少选择一项','warning');
  105 + }else{
  106 + proxy.$global.confirm("确定取消相关资源?", function () {
  107 + let parmas={
  108 + userName:userName.value,
  109 + roleId:roleIds.value
  110 + }
  111 + proxy.$http.post(`/api-web/personnelChange/remove/rolePer`, parmas, function (res) {
  112 + if (res && res.success) {
  113 + proxy.$global.showMsg('取消成功!');
  114 + getListData()
  115 + }
  116 + })
  117 + });
  118 + }
  119 + }
  120 + //变更负责人
  121 + let changeAdmin = () => {
  122 + if(pitch.value.length<1){
  123 + proxy.$global.showMsg('请至少选择一项','warning');
  124 +
  125 + }else{
  126 + show.value=true;
  127 + }
  128 +
  129 + }
  130 + //变更人员的弹框关闭后
  131 + let hideDialog =(flag)=>{
  132 + show.value=flag;
  133 + }
  134 + //变更人员的弹框保存后
  135 + let savebtn =(obj)=>{
  136 + show.value=false;
  137 + //obj.selectModel 选中的用户组(一个/主负责人) obj.selectModelSecond 辅负责人,都是数组
  138 + let targetUserName='';
  139 + if(obj.selectModel){
  140 + targetUserName=obj.selectModel.join(',')
  141 + }
  142 + let params={
  143 + roleId:roleIds.value,
  144 + targetUserName:targetUserName,
  145 + userName:userName.value,
  146 + }
  147 + proxy.$http.post(`/api-web/personnelChange/update/rolePer`, params, function (res) {
  148 + if (res && res.success) {
  149 + proxy.$global.showMsg('变更成功!');
  150 + getListData()
  151 + }
  152 + })
  153 + }
  154 + // 挂载完
  155 + Vue.onMounted(() => {
  156 + getListData();
  157 + })
  158 + return {
  159 + isMulti,
  160 + isTwoGroup,
  161 + show,
  162 + search,
  163 + changeCancel,
  164 + count,
  165 + hideDialog,
  166 + savebtn,
  167 + changeAdmin,
  168 + resourceData,
  169 + columns,
  170 + height,
  171 + loading,
  172 + selectionChange,
  173 + getListData,
  174 + loadTableDataList,
  175 + userName
  176 + }
  177 + }
  178 +}
  1 +<el-row>
  2 + <el-col :span="24" class="search">
  3 + <div class="condition" style="display: flex;">
  4 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;width: 300px">
  5 + <el-input v-model="data.searchParams.keywords" placeholder="关键字支持:名称、负责人、业务描述"></el-input>
  6 + </el-form-item>
  7 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;">
  8 + <el-button @click="getList">查询</el-button>
  9 + </el-form-item>
  10 +
  11 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;">
  12 + <el-button type="primary" @click="removeRel">取消</el-button>
  13 + </el-form-item>
  14 +
  15 + <el-form-item style="margin-right: 6px;margin-bottom: 10px;">
  16 + <el-button type="primary" @click="changeUser">变更</el-button>
  17 + </el-form-item>
  18 +
  19 + </div>
  20 + </el-col>
  21 +</el-row>
  22 +<el-row style="font-size: 12px;color: grey;padding: 6px;">
  23 + {{item.ddicDesc}}
  24 +</el-row>
  25 +<el-row class="margin-bottom-50" style="margin-top: 3px">
  26 + <el-col :span="24" class="table-height">
  27 + <cm-table-page :columns="data.columns"
  28 + :dataList="data.tableData"
  29 + :treeProps="{ children: 'children', hasChildren: 'hasChildren' }"
  30 + :total="data.count"
  31 + :pageSize="data.searchParams.limit"
  32 + @loaddata="loadTableDataList"
  33 + @selectionChange="selectionChange"
  34 + :showIndex="true"
  35 + :showSelection="true"
  36 + :showBorder="true"
  37 + :loading="loading"
  38 + :showPage="true"
  39 + :showTools="false"
  40 + :height="(height - 200)">
  41 + <template #default="{row,prop,column}">
  42 + </template>
  43 + </cm-table-page>
  44 + </el-col>
  45 +</el-row>
  46 +
  47 +<ChangeUsersList :show="data.userDialogFlag" @hideDialog="showUserDialog" @savebtn="saveRel"></ChangeUsersList>
  1 +export default {
  2 + name: 'resourceTypePer',
  3 + template: '',
  4 + components: {
  5 + 'ChangeUsersList': Vue.defineAsyncComponent(
  6 + () => myImport('views/batchChangeLeaders/changeUsersList/index')
  7 + ),
  8 + },
  9 + data() {
  10 + },
  11 + props: {
  12 + item:{
  13 + type:Object,
  14 + default:{}
  15 + }
  16 + },
  17 + setup: function (props, {attrs, slots, emit}) {
  18 + const {proxy} = Vue.getCurrentInstance();
  19 + //列表高度
  20 + let height = Vue.ref(window.innerHeight);
  21 + let data = Vue.ref({
  22 + searchParams: {
  23 + "page": 1,
  24 + "limit": 50,
  25 + "keywords": "",
  26 + "userName": proxy.$route.query.username,
  27 + "jtopoId": ""
  28 + },
  29 + userDialogFlag : false,
  30 + count: 0,
  31 + columns: [{
  32 + prop: "topoName",
  33 + label: "名称",
  34 + width: "250",
  35 + sortable: true,
  36 + align: 'center'
  37 + },
  38 + {
  39 + prop: "isDefault",
  40 + label: "默认状态",
  41 + sortable: true,
  42 + align: 'center',
  43 + render: (row) => {
  44 + //1是默认,0为非默认
  45 + switch (row.isDefault) {
  46 + case 0:
  47 + return '非默认';
  48 + case 1:
  49 + return '默认';
  50 + default:
  51 + return '';
  52 + }
  53 + }
  54 + }, {
  55 + prop: "createUser",
  56 + label: "创建人",
  57 + sortable: true,
  58 + align: 'center',
  59 + }, {
  60 + prop: "createTime",
  61 + label: "创建时间",
  62 + sortable: true,
  63 + align: 'center'
  64 + }, {
  65 + prop: "remark",
  66 + label: "备注",
  67 + sortable: true,
  68 + align: 'center'
  69 + }],
  70 + tableData: [],
  71 + // 表格选中
  72 + checkArr:[]
  73 + })
  74 +
  75 +
  76 + const getList = () => {
  77 + proxy.$http.post(`/api-web/personnelChange/getList/topoPer`, data.value.searchParams, function (res) {
  78 + if (res && res.data) {
  79 + let dataVal = data.value;
  80 + let list = res.data;
  81 + let count = res.count;
  82 +
  83 + let tableData = list.filter(function (v) {
  84 + if (v.parentId == '0') {
  85 + // 获取子节点
  86 + let childs = list.filter(function (v1) {
  87 + if (v1.parentId != '0' && v1.parentId == v.jtopoId) {
  88 + // 获取子节点
  89 + return v1;
  90 + }
  91 + }).sort(function (a, b) {
  92 + return a.sort - b.sort
  93 + })
  94 + v.children = childs;
  95 + return v;
  96 + }
  97 + }).sort(function (a, b) {
  98 + return a.sort - b.sort
  99 + })
  100 +
  101 + dataVal.tableData = list;
  102 + dataVal.count = count;
  103 + }
  104 + })
  105 + }
  106 +
  107 + // 展示用户选择
  108 + let showUserDialog = (flg) =>{
  109 + data.value.userDialogFlag = flg;
  110 + }
  111 +
  112 + let saveRel = (obj) =>{
  113 + // 获取选中
  114 + let arr = data.value.checkArr;
  115 + if(arr.length == 0){
  116 + proxy.$global.showMsg('请至少选择一项','warning');
  117 + return;
  118 + }
  119 +
  120 + let params = {
  121 + targetUserName: obj.selectModel.join(''),
  122 + "userName": proxy.$route.query.username,
  123 + "jtopoId": arr.join(',')
  124 + }
  125 + if(params.targetUserName == params.userName){
  126 + proxy.$global.showMsg('变更用户不能与变更前用户一致,请修改!','warning');
  127 + return;
  128 + }
  129 + proxy.$http.post(`/api-web/personnelChange/update/topoPer`,params, function (res) {
  130 + if (res && res.success) {
  131 + proxy.$global.showMsg('变更成功!');
  132 + showUserDialog(false);
  133 + // 刷新表格
  134 + getList();
  135 + }
  136 + })
  137 + }
  138 +
  139 + // 变更
  140 + let changeUser = () =>{
  141 + // 获取选中
  142 + let arr = data.value.checkArr;
  143 + if(arr.length == 0){
  144 + proxy.$global.showMsg('请至少选择一项','warning');
  145 + return;
  146 + }
  147 +
  148 + showUserDialog(true);
  149 + }
  150 +
  151 + /**
  152 + * 取消
  153 + */
  154 + let removeRel = () =>{
  155 + let arr = data.value.checkArr;
  156 + if(arr.length == 0){
  157 + proxy.$global.showMsg('请至少选择一项','warning');
  158 + return;
  159 + }
  160 +
  161 + data.value.searchParams.jtopoId = arr.join(',')
  162 + proxy.$global.confirm("确定取消相关资源?", function () {
  163 + proxy.$http.post(`/api-web/personnelChange/remove/topoPer`, data.value.searchParams , function (res) {
  164 + if (res && res.success) {
  165 + proxy.$global.showMsg('取消成功!');
  166 + getList()
  167 + }
  168 + })
  169 + });
  170 + }
  171 +
  172 + //重新加载表格数据
  173 + let loadTableDataList = ({page, limit}) => {
  174 + let dataVal = data.value;
  175 + dataVal.page = page;
  176 + dataVal.limit = limit;
  177 + getList();
  178 + }
  179 +
  180 + // 表格全选事件
  181 + let selectionChange = (val) => {
  182 + let checkArr = [];
  183 + val.map(item => {
  184 + checkArr.push(item.jtopoId)
  185 + })
  186 + data.value.checkArr = checkArr;
  187 + let isCheck = (list, checkArr) => {
  188 + list.forEach((v, i) => {
  189 + v.checked = checkArr.includes(v.jtopoId);
  190 + if (v.children) {
  191 + isCheck(v.children, checkArr);
  192 + }
  193 + });
  194 + }
  195 + isCheck(data.value.tableData, checkArr);
  196 + }
  197 +
  198 + // 挂载完
  199 + Vue.onMounted(() => {
  200 + getList();
  201 + })
  202 +
  203 + return {
  204 + height,
  205 + data,
  206 + getList,
  207 + changeUser,
  208 + showUserDialog,
  209 + removeRel,
  210 + loadTableDataList,
  211 + selectionChange,
  212 + saveRel
  213 + }
  214 + }
  215 +}
  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" style="margin:6px 0;">
  4 + <div class="condition">
  5 + <el-input style="width:160px" v-model="search.keyWords" placeholder="请输入关键字"></el-input>
  6 + <el-button size="small" type="primary" style="margin-left: 6px;" @click="getDataList">查询</el-button>
  7 + <el-button size="small" type="primary" @click="addConfig">新增关系</el-button>
  8 + <el-button size="small" type="primary" @click="delConfig">删除关系</el-button>
  9 + </div>
  10 + </div>
  11 + <div class="search-table">
  12 + <cm-table-page :columns="tableData.columns" :dataList="tableData.dataList"
  13 + :showIndex="true"
  14 + :total="tableData.count"
  15 + @loaddata = "loaddata"
  16 + :showSelection="true"
  17 + @selectionChange="selectionChange"
  18 + :showBorder="true"
  19 + :loading="false"
  20 + :pageSize="search.limit"
  21 + :showPage="true"
  22 + :showTools="true"
  23 + :height="height - 110">
  24 + <template #default="{row,prop,column}">
  25 + <div v-if="prop=='showType'">
  26 + <el-select v-model="row.showType" placeholder="">
  27 + <el-option
  28 + v-for="item in showTypeList"
  29 + :key="item.value"
  30 + :label="item.name"
  31 + :value="item.value"
  32 + >
  33 + </el-option>
  34 + </el-select>
  35 + </div>
  36 + </template>
  37 + <template #tools="{scope}">
  38 + <div class="list-handle">
  39 + <i class="el-icon-delete" title="删除关系" style="cursor: pointer;" @click="handleDelete(scope.row)"></i>
  40 +<!-- <i style="margin-left:6px;cursor: pointer;" class="el-icon-edit" title="修改" @click="handleEdit(scope.row)"></i>-->
  41 + </div>
  42 + </template>
  43 + </cm-table-page>
  44 + </div>
  45 + </div>
  46 +</div>
  47 +
  48 +<!--弹框-->
  49 +<cm-dialog :title="dialog.title" width="80%" :showDialogVisible="dialog.show" @okfunc="saveConfig" @hidedialog="hideDialog" :showFooter="true">
  50 + <template v-slot>
  51 + <div class="add-container" style="height:400px;padding:0 10px;">
  52 +<!-- <div class="cm-card" :style="{'min-height':height+'px','max-height':height+'px','height':'100%'}">-->
  53 + <div class="search" style="margin:6px 0;">
  54 + <div class="condition" style="display: flex;">
  55 + <el-input style="width:160px" v-model="search.keyWordsUn" placeholder="请输入关键字"></el-input>
  56 + <el-button size="small" type="primary" style="margin-left: 6px;" @click="getDataListUnauth">查询</el-button>
  57 + </div>
  58 + </div>
  59 + <div class="search-table">
  60 + <cm-table-page :columns="tableData.columns" :dataList="tableData.dataListUn"
  61 + :showIndex="true"
  62 + :total="tableData.countUn"
  63 + @loaddata = "loaddataUn"
  64 + :showSelection="true"
  65 + @selectionChange="selectionChangeUn"
  66 + :showBorder="true"
  67 + :loading="false"
  68 + :pageSize="search.limitUn"
  69 + :showPage="true"
  70 + :showTools="false"
  71 + :height="'360'">
  72 + <template #default="{row,prop,column}">
  73 + <div v-if="prop=='showType'">
  74 + <el-select v-model="row.showType" placeholder="">
  75 + <el-option
  76 + v-for="item in showTypeList"
  77 + :key="item.value"
  78 + :label="item.name"
  79 + :value="item.value"
  80 + >
  81 + </el-option>
  82 + </el-select>
  83 + </div>
  84 + </template>
  85 + </cm-table-page>
  86 + </div>
  87 + </div>
  88 +<!-- </div>-->
  89 +
  90 + </template>
  91 +</cm-dialog>
  92 +