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
@@ -9,7 +9,7 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'soulTable', 'sessions', 'comm @@ -9,7 +9,7 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'soulTable', 'sessions', 'comm
9 var common = layui.common; 9 var common = layui.common;
10 var commonCols = layui.commonCols; 10 var commonCols = layui.commonCols;
11 var sortKey = ''; 11 var sortKey = '';
12 - 12 + var fieldExpandArr=[];//获取扩展的表格字段
13 13
14 //用树表格展示的资源类型 14 //用树表格展示的资源类型
15 var treeTableResTypes = [ 15 var treeTableResTypes = [
@@ -117,6 +117,36 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'soulTable', 'sessions', 'comm @@ -117,6 +117,36 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'soulTable', 'sessions', 'comm
117 renderSearchCondition(resType, bizId); 117 renderSearchCondition(resType, bizId);
118 118
119 var cols = commonCols.resTypeCls[resType]; 119 var cols = commonCols.resTypeCls[resType];
  120 + //start lsq 根据资源类型resType获取动态添加的列表字段 2022-08-05
  121 + admin.req({
  122 + url: common.domainName + "/api-web/resource/expand/list?resType=" + resType
  123 + , done: function (res) {
  124 + if (res && res.data ) {
  125 + let arr=res.data;
  126 + if(fieldExpandArr.indexOf(resType)!=-1){
  127 + }else{
  128 + fieldExpandArr.push(resType);
  129 + if(arr.length>0){
  130 + arr.map(item=>{
  131 + let listStr='';
  132 + if(item.list && item.list.length>0){
  133 + listStr=item.list.join(',')
  134 + }
  135 + cols.splice(item.fieldSort,0,{field: item.field, title: item.fieldName, align: 'center', width: 100, sort: true,
  136 + templet:` <div>
  137 + <div class="edit-delete-tpl T-edit-delete-tpl" lay-tips="点击修改/删除" data-fieldsourcetype="`+item.fieldSourceType+`"
  138 + data-expandid="`+item.id+`" data-list="`+listStr+`" data-tpltype="`+item.field+`" data-resid="{{d.resId}}">
  139 + {{d.`+item.field+` ? d.`+item.field+` : ''}}
  140 + </div></div>`})
  141 + })
  142 + }
  143 + }
  144 + } else {
  145 + console.log(res.msg);
  146 + }
  147 + }
  148 + });
  149 + setTimeout(function (){
120 //获取配置的列 150 //获取配置的列
121 common.getTableCols({ 151 common.getTableCols({
122 domId: 'bizResListTable', 152 domId: 'bizResListTable',
@@ -181,7 +211,7 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'soulTable', 'sessions', 'comm @@ -181,7 +211,7 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'soulTable', 'sessions', 'comm
181 } 211 }
182 }); 212 });
183 }) 213 })
184 - 214 + },300)
185 } 215 }
186 216
187 217
@@ -221,7 +251,36 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'soulTable', 'sessions', 'comm @@ -221,7 +251,36 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'soulTable', 'sessions', 'comm
221 251
222 layer.load(2); //加载层。 252 layer.load(2); //加载层。
223 var cols = commonCols.resTypeCls[resType]; 253 var cols = commonCols.resTypeCls[resType];
224 - 254 + //start lsq 根据资源类型resType获取动态添加的列表字段 2022-08-05
  255 + admin.req({
  256 + url: common.domainName + "/api-web/resource/expand/list?resType=" + resType
  257 + , done: function (res) {
  258 + if (res && res.data ) {
  259 + let arr=res.data;
  260 + if(fieldExpandArr.indexOf(resType)!=-1){
  261 + }else{
  262 + fieldExpandArr.push(resType);
  263 + if(arr.length>0){
  264 + arr.map(item=>{
  265 + let listStr='';
  266 + if(item.list && item.list.length>0){
  267 + listStr=item.list.join(',')
  268 + }
  269 + cols.splice(item.fieldSort,0,{field: item.field, title: item.fieldName, align: 'center', width: 100, sort: true,
  270 + templet:` <div>
  271 + <div class="edit-delete-tpl T-edit-delete-tpl" lay-tips="点击修改/删除" data-fieldsourcetype="`+item.fieldSourceType+`"
  272 + data-expandid="`+item.id+`" data-list="`+listStr+`" data-tpltype="`+item.field+`" data-resid="{{d.resId}}">
  273 + {{d.`+item.field+` ? d.`+item.field+` : ''}}
  274 + </div></div>`})
  275 + })
  276 + }
  277 + }
  278 + } else {
  279 + console.log(res.msg);
  280 + }
  281 + }
  282 + });
  283 + setTimeout(function (){
225 //获取配置的列 284 //获取配置的列
226 common.getTableCols({ 285 common.getTableCols({
227 domId: 'bizResTreeTable', 286 domId: 'bizResTreeTable',
@@ -360,6 +419,7 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'soulTable', 'sessions', 'comm @@ -360,6 +419,7 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'soulTable', 'sessions', 'comm
360 layer.closeAll(); 419 layer.closeAll();
361 }); 420 });
362 }) 421 })
  422 + },300)
363 } 423 }
364 424
365 //获取资源统计 425 //获取资源统计
@@ -4641,6 +4641,10 @@ layui.define(['soulTable', 'commonDetail', 'common', 'laytpl', 'view', 'admin', @@ -4641,6 +4641,10 @@ layui.define(['soulTable', 'commonDetail', 'common', 'laytpl', 'view', 'admin',
4641 {field: 'adminPhone', title: '负责人电话', minWidth: x_140, align: 'center', sort: true}, 4641 {field: 'adminPhone', title: '负责人电话', minWidth: x_140, align: 'center', sort: true},
4642 {field: 'state', title: '资源状态', minWidth: x_120, align: 'center', sort: true, templet: '#resStateTpl'}, 4642 {field: 'state', title: '资源状态', minWidth: x_120, align: 'center', sort: true, templet: '#resStateTpl'},
4643 {field: 'health', title: '健康状态', minWidth: x_120, align: 'center', sort: true, templet: '#healthTpl'}, 4643 {field: 'health', title: '健康状态', minWidth: x_120, align: 'center', sort: true, templet: '#healthTpl'},
  4644 + //lsq 增加weblogic版本号、反序列化补丁版本号、Java版本号字段 2022-08-25
  4645 + {field: 'weblogicVersion', title: 'weblogic版本号', align: 'center', width: 135, sort: true},
  4646 + {field: 'patchId', title: '反序列化补丁版本号', align: 'center', width: 83, sort: true},
  4647 + {field: 'javaVersion', title: 'Java版本号', align: 'center', width: 100, sort: true},
4644 {field: 'lastColTime', title: '最近采集时间', minWidth: x_170, align: 'center', sort: true}, 4648 {field: 'lastColTime', title: '最近采集时间', minWidth: x_170, align: 'center', sort: true},
4645 { 4649 {
4646 field: 'linkState', 4650 field: 'linkState',
@@ -5144,7 +5148,153 @@ layui.define(['soulTable', 'commonDetail', 'common', 'laytpl', 'view', 'admin', @@ -5144,7 +5148,153 @@ layui.define(['soulTable', 'commonDetail', 'common', 'laytpl', 'view', 'admin',
5144 }, function () { 5148 }, function () {
5145 layer.close(subtips); 5149 layer.close(subtips);
5146 }); 5150 });
  5151 + // 别名列点击事件
  5152 + $('.res-list-short-name').unbind('click').on('click', function () {
  5153 + var $shortNameDom = $(this);
  5154 + var resId = $shortNameDom.data('resid');
  5155 + var oldShortName = $shortNameDom.text();
  5156 + layer.prompt({
  5157 + formType: 0, // 输入框类型,支持0(文本)默认1(密码)2(多行文本)
  5158 + value: oldShortName, // 初始化值
  5159 + title: '请输入别名',
  5160 + yes: function (index, layero) {
  5161 + var value = layero.find(".layui-layer-input").val();
  5162 + if (value !== oldShortName) {
  5163 + layer.load(2);
  5164 + admin.req({
  5165 + url: common.domainName + '/api-web/bResource/changeShortName',
  5166 + data: {
  5167 + resId: resId,
  5168 + shortName: value
  5169 + },
  5170 + success: function (response) {
  5171 + layer.closeAll('loading');
  5172 + if (response && response.success) {
  5173 + layer.msg('修改成功', {icon: 1});
  5174 + $shortNameDom.text(value);
  5175 + layer.close(index);
  5176 + } else {
  5177 + layer.msg('修改失败', {icon: 2});
  5178 + }
  5179 + },
  5180 + error: function (err) {
  5181 + layer.closeAll('loading');
  5182 + layer.msg('修改失败', {icon: 2});
  5183 + }
  5184 + });
  5185 + } else {
  5186 + layer.close(index);
  5187 + }
  5188 + }
  5189 + });
  5190 + });
  5191 +//lsq T3和IOP点击修改删除 2022-08-04
  5192 + $('.edit-delete-tpl').unbind('click').on('click',function (){
  5193 + var $T3Dom = $(this);
  5194 + //判断是字段类型T3/IOP
  5195 + let tplType=$T3Dom.data('tpltype');
  5196 + //获取资源id
  5197 + var resId = $T3Dom.data('resid');
  5198 + //获取旧数据
  5199 + let old_T3Dom=$T3Dom.text();
  5200 + //获取扩展字段id
  5201 + let expandId=$T3Dom.data('expandid');
  5202 + //获取字段为输入框或者下拉选择 0 输入框 1下拉选择
  5203 + let fieldSourceType=$T3Dom.data('fieldsourcetype');
  5204 + //获取下拉选择值
  5205 + let fieldList=$T3Dom.data('list');
  5206 + let url='/api-web/resource/expand/saveOrUpdate';
  5207 + //判断类型是输入框还是下拉列表
  5208 + let titleName='';
  5209 + let promptHtml='';
  5210 + if(fieldSourceType == '0'){
  5211 + titleName='请输入';
  5212 + promptHtml=`<input type="text" id="promptInput" name="promptInput" autocomplete="off" class="layui-input">`
  5213 + }else if(fieldSourceType== '1'){
  5214 + titleName='请选择';
  5215 + promptHtml=`<select id="promptInput" style="width:80%;cursor:pointer;" class="layui-select" lay-filter="promptInput">`
  5216 + if(fieldList){
  5217 + let fieldListArr=fieldList.split(",")
  5218 + fieldListArr.map(item=>{
  5219 + promptHtml+=`<option value="`+item+`">`+item+`</option>`;
  5220 + })
  5221 + }
  5222 + promptHtml+=`</select>`;
  5223 + }else{
  5224 + promptHtml=``
  5225 + }
  5226 + let html_tpl=`<div class="T3-IOP-prompt">`+promptHtml+`</div>`;
  5227 + layer.open({
  5228 + title: [titleName+tplType, 'font-size:14px;'],
  5229 + type: 1,
  5230 + area: ['280px','170px'],
  5231 + content: html_tpl,
  5232 + success: function () {
  5233 + $('#promptInput').val(old_T3Dom)
  5234 + }
  5235 + , id: 'lay_T3_IOP' //设定一个id,防止重复弹出
  5236 + , btn: ['清空', '保存']
  5237 + , yes: function (index, layero) {
  5238 + layer.confirm('确认要删除吗?', {icon: 3, title: '提示'}, function (index1) {
  5239 + layer.load(2);
  5240 + admin.req({
  5241 + //删除T3值
  5242 + url: common.domainName + url,
  5243 + data: {
  5244 + resId:resId,
  5245 + fieldValue:'',
  5246 + expandId:expandId,//扩展字段id
  5247 +
  5248 + },
  5249 + }).done(function (response) {
  5250 + layer.closeAll('loading');
  5251 + if (response.success) {
  5252 + layer.msg('删除成功!', {icon: 1, time: 3000});
  5253 + $T3Dom.text('');
  5254 + } else {
  5255 + layer.msg('删除失败!', {icon: 2, time: 3000});
  5256 + }
  5257 + layer.close(index);
  5258 + });
  5259 + })
  5260 + }
  5261 + , btn2:function(index, layero){
  5262 + var value = $('#promptInput').val();
  5263 + if (value !== old_T3Dom) {
  5264 + layer.load(2);
  5265 +
  5266 + admin.req({
  5267 + //修改扩展字段T3/IOp值
  5268 + url: common.domainName + url,
  5269 + data: {
  5270 + resId:resId,
  5271 + fieldValue:value,
  5272 + expandId:expandId,//扩展字段id
5147 5273
  5274 + },
  5275 + success: function (response) {
  5276 + layer.closeAll('loading');
  5277 + if (response && response.success) {
  5278 + layer.msg('修改成功', {icon: 1});
  5279 + $T3Dom.text(value);
  5280 + } else {
  5281 + layer.msg('修改失败', {icon: 2});
  5282 + }
  5283 + layer.close(index);
  5284 +
  5285 + },
  5286 + error: function (err) {
  5287 + layer.closeAll('loading');
  5288 + layer.msg('修改失败', {icon: 2});
  5289 + }
  5290 + });
  5291 + } else {
  5292 + layer.close(index);
  5293 + }
  5294 + },
  5295 + });
  5296 + })
  5297 + //end lsq T3和IOP点击修改/删除 2022-08-04
5148 function showTips(id, message, state) { 5298 function showTips(id, message, state) {
5149 subtips = layer.tips(state + "失败原因:" + message, 5299 subtips = layer.tips(state + "失败原因:" + message,
5150 '#' + id, {tips: 1}); 5300 '#' + id, {tips: 1});
@@ -5170,6 +5320,10 @@ layui.define(['soulTable', 'commonDetail', 'common', 'laytpl', 'view', 'admin', @@ -5170,6 +5320,10 @@ layui.define(['soulTable', 'commonDetail', 'common', 'laytpl', 'view', 'admin',
5170 5320
5171 } 5321 }
5172 }; 5322 };
  5323 + //lsq 列表增加别名列 2022-08-25
  5324 + for(let key in obj.resTypeCls){
  5325 + obj.resTypeCls[key].splice( 2,0,{field: 'shortName', title: '别名', width: 100, align: 'center', sort: true, templet:`<div><div class="res-list-short-name" lay-tips="点击修改别名" data-resid="{{d.resId}}">{{d.shortName ? d.shortName : ''}}</div></div>`})
  5326 + }
5173 //对外暴露的接口 5327 //对外暴露的接口
5174 exports('commonCols', obj); 5328 exports('commonCols', obj);
5175 }); 5329 });
@@ -3495,7 +3495,7 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele @@ -3495,7 +3495,7 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'echarts', 'sessions', 'xmSele
3495 return; 3495 return;
3496 } 3496 }
3497 //lsq 停机计划跑马灯 2022-08-19 3497 //lsq 停机计划跑马灯 2022-08-19
3498 - title +=`<span id="title-shutdown" data-id=${resId} style="padding:0 5px;width:600px;display: inline-block;position: relative;top: 0px;left:20px;"></span>` 3498 + title +=`<span id="title-shutdown" data-id=${resId} style="padding:0 5px;max-width:480px;display: inline-block;position: relative;top: 0px;left:20px;"></span>`
3499 3499
3500 obj.openNewWin(url, title, params, editFlag, fn, cancelfn, type, sign_); 3500 obj.openNewWin(url, title, params, editFlag, fn, cancelfn, type, sign_);
3501 }, 3501 },
@@ -836,6 +836,37 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', @@ -836,6 +836,37 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form',
836 return htm; 836 return htm;
837 } 837 }
838 }); 838 });
  839 + //start lsq 根据资源类型resType获取动态添加的列表字段 2022-08-05
  840 + admin.req({
  841 + url: this.domainName + "/api-web/resource/expand/list?resType=" + resType
  842 + , done: function (res) {
  843 + if (res && res.data ) {
  844 + let arr=res.data;
  845 + //lsq 资源管理增加扩展字段 待验证 2022-08-12
  846 + // if(this.fieldExpandArr.indexOf(resType)!=-1){
  847 + // }else{
  848 + // this.fieldExpandArr.push(resType);
  849 + if(arr.length>0){
  850 + arr.map(item=>{
  851 + let listStr='';
  852 + if(item.list && item.list.length>0){
  853 + listStr=item.list.join(',')
  854 + }
  855 + cols.splice(item.fieldSort,0,{field: item.field, title: item.fieldName, align: 'center', width: 100, sort: true,
  856 + templet:` <div>
  857 + <div class="edit-delete-tpl T-edit-delete-tpl" lay-tips="点击修改/删除" data-fieldsourcetype="`+item.fieldSourceType+`"
  858 + data-expandid="`+item.id+`" data-list="`+listStr+`" data-tpltype="`+item.field+`" data-resid="{{d.resId}}">
  859 + {{d.`+item.field+` ? d.`+item.field+` : ''}}
  860 + </div></div>`})
  861 + })
  862 + }
  863 + // }
  864 + } else {
  865 + console.log(res.msg);
  866 + }
  867 + }
  868 + });
  869 + setTimeout(function (){
839 //渲染表格 870 //渲染表格
840 table.render({ 871 table.render({
841 elem: '#resManageTable' 872 elem: '#resManageTable'
@@ -1128,9 +1159,127 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form', @@ -1128,9 +1159,127 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form',
1128 commonDetail.openDetail(resId, resType, name) 1159 commonDetail.openDetail(resId, resType, name)
1129 }); 1160 });
1130 resTopo(); 1161 resTopo();
  1162 + //lsq T3和IOP点击修改删除 2022-08-04
  1163 + let fsTypeEl=$('.edit-delete-tpl');
  1164 + if(fsTypeEl && fsTypeEl.length>0){
  1165 + fsTypeEl.map((index,item)=>{
  1166 + if($(item).data('fieldsourcetype')=='text'){
  1167 + $(item).removeAttr('lay-tips')
  1168 + }
  1169 + })
  1170 + }
  1171 + $('.edit-delete-tpl').unbind('click').on('click',function (){
  1172 + var $T3Dom = $(this);
  1173 + //判断是字段类型T3/IOP
  1174 + let tplType=$T3Dom.data('tpltype');
  1175 + //获取资源id
  1176 + var resId = $T3Dom.data('resid');
  1177 + //获取旧数据
  1178 + let old_T3Dom=$T3Dom.text();
  1179 + //获取扩展字段id
  1180 + let expandId=$T3Dom.data('expandid');
  1181 + //获取字段为输入框或者下拉选择 0 输入框 1下拉选择
  1182 + let fieldSourceType=$T3Dom.data('fieldsourcetype');
  1183 + if(fieldSourceType!='text'){
  1184 + //获取下拉选择值
  1185 + let fieldList=$T3Dom.data('list');
  1186 + let url='/api-web/resource/expand/saveOrUpdate';
  1187 + //判断类型是输入框还是下拉列表
  1188 + let titleName='';
  1189 + let promptHtml='';
  1190 + if(fieldSourceType == 'input'){
  1191 + titleName='请输入';
  1192 + promptHtml=`<input type="text" id="promptInput" name="promptInput" autocomplete="off" class="layui-input">`
  1193 + }else if(fieldSourceType== 'select'){
  1194 + titleName='请选择';
  1195 + promptHtml=`<select id="promptInput" style="width:80%;cursor:pointer;" class="layui-select" lay-filter="promptInput">`
  1196 + if(fieldList){
  1197 + let fieldListArr=fieldList.split(",")
  1198 + fieldListArr.map(item=>{
  1199 + promptHtml+=`<option value="`+item+`">`+item+`</option>`;
  1200 + })
  1201 + }
  1202 + promptHtml+=`</select>`;
  1203 + }else{
  1204 + titleName='请查看';
  1205 + promptHtml=`<span style="border: 1px solid #d2d2d2;flex: 1;padding: 10px;" id="promptInput">`+old_T3Dom+`</span>`
1131 } 1206 }
  1207 + let html_tpl=`<div class="T3-IOP-prompt">`+promptHtml+`</div>`;
  1208 + layer.open({
  1209 + title: [titleName+tplType, 'font-size:14px;'],
  1210 + type: 1,
  1211 + area: ['280px','170px'],
  1212 + content: html_tpl,
  1213 + success: function () {
  1214 + $('#promptInput').val(old_T3Dom)
  1215 + }
  1216 + , id: 'lay_T3_IOP' //设定一个id,防止重复弹出
  1217 + , btn: ['清空', '保存']
  1218 + , yes: function (index, layero) {
  1219 + layer.confirm('确认要删除吗?', {icon: 3, title: '提示'}, function (index1) {
  1220 + layer.load(2);
  1221 + admin.req({
  1222 + //删除T3值
  1223 + url: common.domainName + url,
  1224 + data: {
  1225 + resId:resId,
  1226 + fieldValue:'',
  1227 + expandId:expandId,//扩展字段id
  1228 +
  1229 + },
  1230 + }).done(function (response) {
  1231 + layer.closeAll('loading');
  1232 + if (response.success) {
  1233 + layer.msg('删除成功!', {icon: 1, time: 3000});
  1234 + $T3Dom.text('');
  1235 + } else {
  1236 + layer.msg('删除失败!', {icon: 2, time: 3000});
  1237 + }
  1238 + layer.close(index);
1132 }); 1239 });
  1240 + })
  1241 + }
  1242 + , btn2:function(index, layero){
  1243 + var value = $('#promptInput').val();
  1244 + if (value !== old_T3Dom) {
  1245 + layer.load(2);
  1246 +
  1247 + admin.req({
  1248 + //修改扩展字段T3/IOp值
  1249 + url: common.domainName + url,
  1250 + data: {
  1251 + resId:resId,
  1252 + fieldValue:value,
  1253 + expandId:expandId,//扩展字段id
  1254 +
  1255 + },
  1256 + success: function (response) {
  1257 + layer.closeAll('loading');
  1258 + if (response && response.success) {
  1259 + layer.msg('修改成功', {icon: 1});
  1260 + $T3Dom.text(value);
  1261 + } else {
  1262 + layer.msg('修改失败', {icon: 2});
  1263 + }
  1264 + layer.close(index);
1133 1265
  1266 + },
  1267 + error: function (err) {
  1268 + layer.closeAll('loading');
  1269 + layer.msg('修改失败', {icon: 2});
  1270 + }
  1271 + });
  1272 + } else {
  1273 + layer.close(index);
  1274 + }
  1275 + },
  1276 + });
  1277 + }
  1278 + })
  1279 + //end lsq T3和IOP点击修改/删除 2022-08-04
  1280 + }
  1281 + });
  1282 + },300)
1134 } 1283 }
1135 1284
1136 //处理表头和内容不能对齐的问题 1285 //处理表头和内容不能对齐的问题
@@ -8613,3 +8613,22 @@ form.layui-card-header.layuiadmin-card-header-auto { @@ -8613,3 +8613,22 @@ form.layui-card-header.layuiadmin-card-header-auto {
8613 text-decoration: underline; 8613 text-decoration: underline;
8614 } 8614 }
8615 /*end lsq 2022-06-28*/ 8615 /*end lsq 2022-06-28*/
  8616 +/*lsq T3和IOP 2022-08-04*/
  8617 +.edit-delete-tpl{
  8618 + width: 100%;
  8619 + height: 100%;
  8620 + cursor: pointer;
  8621 +}
  8622 +.T3-IOP-prompt{
  8623 + display: flex;
  8624 + align-items: center;
  8625 + justify-content: center;
  8626 + height: 100%;
  8627 + padding: 0 20px;
  8628 +}
  8629 +/*别名样式*/
  8630 +.res-list-short-name {
  8631 + width: 100%;
  8632 + height: 100%;
  8633 + cursor: pointer;
  8634 +}
@@ -18,7 +18,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols @@ -18,7 +18,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
18 var curBizResType = '';//当前业务所在的资源类型 18 var curBizResType = '';//当前业务所在的资源类型
19 19
20 var sortKey = ''; 20 var sortKey = '';
21 - 21 + var fieldExpandArr=[];//获取扩展的表格字段
22 22
23 function autoHeight(el) { 23 function autoHeight(el) {
24 // var height = el.parents('.layui-card').height(); 24 // var height = el.parents('.layui-card').height();
@@ -441,6 +441,36 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols @@ -441,6 +441,36 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
441 resTypeList.push(v.value); 441 resTypeList.push(v.value);
442 busId = v.pid; 442 busId = v.pid;
443 }); 443 });
  444 + //start lsq 根据资源类型resType获取动态添加的列表字段 2022-08-05
  445 + admin.req({
  446 + url: common.domainName + "/api-web/resource/expand/list?resType=" + resType
  447 + , done: function (res) {
  448 + if (res && res.data ) {
  449 + let arr=res.data;
  450 + if(fieldExpandArr.indexOf(resType)!=-1){
  451 + }else{
  452 + fieldExpandArr.push(resType);
  453 + if(arr.length>0){
  454 + arr.map(item=>{
  455 + let listStr='';
  456 + if(item.list && item.list.length>0){
  457 + listStr=item.list.join(',')
  458 + }
  459 + cols.splice(item.fieldSort,0,{field: item.field, title: item.fieldName, align: 'center', width: 100, sort: true,
  460 + templet:` <div>
  461 + <div class="edit-delete-tpl T-edit-delete-tpl" lay-tips="点击修改/删除" data-fieldsourcetype="`+item.fieldSourceType+`"
  462 + data-expandid="`+item.id+`" data-list="`+listStr+`" data-tpltype="`+item.field+`" data-resid="{{d.resId}}">
  463 + {{d.`+item.field+` ? d.`+item.field+` : ''}}
  464 + </div></div>`})
  465 + })
  466 + }
  467 + }
  468 + } else {
  469 + console.log(res.msg);
  470 + }
  471 + }
  472 + });
  473 + setTimeout(function (){
444 //获取配置的列 474 //获取配置的列
445 common.getTableCols({ 475 common.getTableCols({
446 domId: 'bizListTable', 476 domId: 'bizListTable',
@@ -508,7 +538,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols @@ -508,7 +538,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
508 } 538 }
509 }); 539 });
510 }); 540 });
511 - 541 + },300)
512 } 542 }
513 543
514 //获取业务下的资源类型健康统计 544 //获取业务下的资源类型健康统计
@@ -550,6 +580,36 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols @@ -550,6 +580,36 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
550 renderBizSerach(resType, busId, true); 580 renderBizSerach(resType, busId, true);
551 form.render(null, 'biz-list-form'); 581 form.render(null, 'biz-list-form');
552 var cols = commonCols.resTypeCls[resType]; 582 var cols = commonCols.resTypeCls[resType];
  583 + //start lsq 根据资源类型resType获取动态添加的列表字段 2022-08-05
  584 + admin.req({
  585 + url: common.domainName + "/api-web/resource/expand/list?resType=" + resType
  586 + , done: function (res) {
  587 + if (res && res.data ) {
  588 + let arr=res.data;
  589 + if(fieldExpandArr.indexOf(resType)!=-1){
  590 + }else{
  591 + fieldExpandArr.push(resType);
  592 + if(arr.length>0){
  593 + arr.map(item=>{
  594 + let listStr='';
  595 + if(item.list && item.list.length>0){
  596 + listStr=item.list.join(',')
  597 + }
  598 + cols.splice(item.fieldSort,0,{field: item.field, title: item.fieldName, align: 'center', width: 100, sort: true,
  599 + templet:` <div>
  600 + <div class="edit-delete-tpl T-edit-delete-tpl" lay-tips="点击修改/删除" data-fieldsourcetype="`+item.fieldSourceType+`"
  601 + data-expandid="`+item.id+`" data-list="`+listStr+`" data-tpltype="`+item.field+`" data-resid="{{d.resId}}">
  602 + {{d.`+item.field+` ? d.`+item.field+` : ''}}
  603 + </div></div>`})
  604 + })
  605 + }
  606 + }
  607 + } else {
  608 + console.log(res.msg);
  609 + }
  610 + }
  611 + });
  612 + setTimeout(function (){
553 //获取配置的列 613 //获取配置的列
554 common.getTableCols({ 614 common.getTableCols({
555 domId: 'bizParentList', 615 domId: 'bizParentList',
@@ -619,6 +679,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols @@ -619,6 +679,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
619 } 679 }
620 }); 680 });
621 }); 681 });
  682 + },300)
622 } 683 }
623 684
624 //资源列表 685 //资源列表
@@ -633,6 +694,36 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols @@ -633,6 +694,36 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
633 694
634 form.render(null, 'biz-list-form'); 695 form.render(null, 'biz-list-form');
635 var cols = commonCols.resTypeCls[resType]; 696 var cols = commonCols.resTypeCls[resType];
  697 + //start lsq 根据资源类型resType获取动态添加的列表字段 2022-08-05
  698 + admin.req({
  699 + url: common.domainName + "/api-web/resource/expand/list?resType=" + resType
  700 + , done: function (res) {
  701 + if (res && res.data ) {
  702 + let arr=res.data;
  703 + if(fieldExpandArr.indexOf(resType)!=-1){
  704 + }else{
  705 + fieldExpandArr.push(resType);
  706 + if(arr.length>0){
  707 + arr.map(item=>{
  708 + let listStr='';
  709 + if(item.list && item.list.length>0){
  710 + listStr=item.list.join(',')
  711 + }
  712 + cols.splice(item.fieldSort,0,{field: item.field, title: item.fieldName, align: 'center', width: 100, sort: true,
  713 + templet:` <div>
  714 + <div class="edit-delete-tpl T-edit-delete-tpl" lay-tips="点击修改/删除" data-fieldsourcetype="`+item.fieldSourceType+`"
  715 + data-expandid="`+item.id+`" data-list="`+listStr+`" data-tpltype="`+item.field+`" data-resid="{{d.resId}}">
  716 + {{d.`+item.field+` ? d.`+item.field+` : ''}}
  717 + </div></div>`})
  718 + })
  719 + }
  720 + }
  721 + } else {
  722 + console.log(res.msg);
  723 + }
  724 + }
  725 + });
  726 + setTimeout(function (){
636 //获取配置的列 727 //获取配置的列
637 common.getTableCols({ 728 common.getTableCols({
638 domId: 'bizListTable', 729 domId: 'bizListTable',
@@ -703,6 +794,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols @@ -703,6 +794,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
703 } 794 }
704 }); 795 });
705 }); 796 });
  797 + },300)
706 } 798 }
707 799
708 //树表格 800 //树表格
@@ -729,7 +821,36 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols @@ -729,7 +821,36 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
729 } 821 }
730 822
731 var cols = commonCols.resTypeCls[resType]; 823 var cols = commonCols.resTypeCls[resType];
732 - 824 + //start lsq 根据资源类型resType获取动态添加的列表字段 2022-08-05
  825 + admin.req({
  826 + url: common.domainName + "/api-web/resource/expand/list?resType=" + resType
  827 + , done: function (res) {
  828 + if (res && res.data ) {
  829 + let arr=res.data;
  830 + if(fieldExpandArr.indexOf(resType)!=-1){
  831 + }else{
  832 + fieldExpandArr.push(resType);
  833 + if(arr.length>0){
  834 + arr.map(item=>{
  835 + let listStr='';
  836 + if(item.list && item.list.length>0){
  837 + listStr=item.list.join(',')
  838 + }
  839 + cols.splice(item.fieldSort,0,{field: item.field, title: item.fieldName, align: 'center', width: 100, sort: true,
  840 + templet:` <div>
  841 + <div class="edit-delete-tpl T-edit-delete-tpl" lay-tips="点击修改/删除" data-fieldsourcetype="`+item.fieldSourceType+`"
  842 + data-expandid="`+item.id+`" data-list="`+listStr+`" data-tpltype="`+item.field+`" data-resid="{{d.resId}}">
  843 + {{d.`+item.field+` ? d.`+item.field+` : ''}}
  844 + </div></div>`})
  845 + })
  846 + }
  847 + }
  848 + } else {
  849 + console.log(res.msg);
  850 + }
  851 + }
  852 + });
  853 + setTimeout(function (){
733 admin.req({ 854 admin.req({
734 url: common.domainName + "/api-web/home/virtual-res-list/" + resType 855 url: common.domainName + "/api-web/home/virtual-res-list/" + resType
735 , data: { 856 , data: {
@@ -870,6 +991,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols @@ -870,6 +991,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
870 }).error(function () { 991 }).error(function () {
871 layer.closeAll(); 992 layer.closeAll();
872 }); 993 });
  994 + },300)
873 } 995 }
874 996
875 //获取资源统计 997 //获取资源统计
@@ -4,7 +4,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', ' @@ -4,7 +4,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
4 var $ = layui.$; 4 var $ = layui.$;
5 var common = layui.common; 5 var common = layui.common;
6 var table = layui.table; 6 var table = layui.table;
7 - 7 + var fieldExpandArr=[];//获取扩展的表格字段
8 //对外暴露的接口 8 //对外暴露的接口
9 exports('resindex', function (data) { 9 exports('resindex', function (data) {
10 var laytpl = layui.laytpl; 10 var laytpl = layui.laytpl;
@@ -205,6 +205,36 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', ' @@ -205,6 +205,36 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
205 } else { 205 } else {
206 cols = commonCols.resTypeCls[resType]; 206 cols = commonCols.resTypeCls[resType];
207 } 207 }
  208 + //start lsq 根据资源类型resType获取动态添加的列表字段 2022-08-05
  209 + admin.req({
  210 + url: common.domainName + "/api-web/resource/expand/list?resType=" + resType
  211 + , done: function (res) {
  212 + if (res && res.data ) {
  213 + let arr=res.data;
  214 + if(fieldExpandArr.indexOf(resType)!=-1){
  215 + }else{
  216 + fieldExpandArr.push(resType);
  217 + if(arr.length>0){
  218 + arr.map(item=>{
  219 + let listStr='';
  220 + if(item.list && item.list.length>0){
  221 + listStr=item.list.join(',')
  222 + }
  223 + cols.splice(item.fieldSort,0,{field: item.field, title: item.fieldName, align: 'center', width: 100, sort: true,
  224 + templet:` <div>
  225 + <div class="edit-delete-tpl T-edit-delete-tpl" lay-tips="点击修改/删除" data-fieldsourcetype="`+item.fieldSourceType+`"
  226 + data-expandid="`+item.id+`" data-list="`+listStr+`" data-tpltype="`+item.field+`" data-resid="{{d.resId}}">
  227 + {{d.`+item.field+` ? d.`+item.field+` : ''}}
  228 + </div></div>`})
  229 + })
  230 + }
  231 + }
  232 + } else {
  233 + console.log(res.msg);
  234 + }
  235 + }
  236 + });
  237 + setTimeout(function (){
208 resTableList = table.render({ 238 resTableList = table.render({
209 elem: '#resindexList' 239 elem: '#resindexList'
210 , 240 ,
@@ -254,6 +284,8 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', ' @@ -254,6 +284,8 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
254 }); 284 });
255 } 285 }
256 }); 286 });
  287 + },300)
  288 +
257 }); 289 });
258 } 290 }
259 291
@@ -795,6 +827,36 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', ' @@ -795,6 +827,36 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
795 var index = layer.load(2); //加载层 827 var index = layer.load(2); //加载层
796 828
797 var cols = commonCols.resTypeCls[resType]; 829 var cols = commonCols.resTypeCls[resType];
  830 + //start lsq 根据资源类型resType获取动态添加的列表字段 2022-08-05
  831 + admin.req({
  832 + url: common.domainName + "/api-web/resource/expand/list?resType=" + resType
  833 + , done: function (res) {
  834 + if (res && res.data ) {
  835 + let arr=res.data;
  836 + if(fieldExpandArr.indexOf(resType)!=-1){
  837 + }else{
  838 + fieldExpandArr.push(resType);
  839 + if(arr.length>0){
  840 + arr.map(item=>{
  841 + let listStr='';
  842 + if(item.list && item.list.length>0){
  843 + listStr=item.list.join(',')
  844 + }
  845 + cols.splice(item.fieldSort,0,{field: item.field, title: item.fieldName, align: 'center', width: 100, sort: true,
  846 + templet:` <div>
  847 + <div class="edit-delete-tpl T-edit-delete-tpl" lay-tips="点击修改/删除" data-fieldsourcetype="`+item.fieldSourceType+`"
  848 + data-expandid="`+item.id+`" data-list="`+listStr+`" data-tpltype="`+item.field+`" data-resid="{{d.resId}}">
  849 + {{d.`+item.field+` ? d.`+item.field+` : ''}}
  850 + </div></div>`})
  851 + })
  852 + }
  853 + }
  854 + } else {
  855 + console.log(res.msg);
  856 + }
  857 + }
  858 + });
  859 + setTimeout(function (){
798 admin.req({ 860 admin.req({
799 url: common.domainName + "/api-web/home/virtual-res-list/" + resType 861 url: common.domainName + "/api-web/home/virtual-res-list/" + resType
800 , type: "get" 862 , type: "get"
@@ -895,6 +957,8 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', ' @@ -895,6 +957,8 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
895 }).error(function () { 957 }).error(function () {
896 layer.close(index); 958 layer.close(index);
897 }); 959 });
  960 + },300)
  961 +
898 } 962 }
899 963
900 964
@@ -994,6 +1058,36 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', ' @@ -994,6 +1058,36 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
994 } 1058 }
995 //渲染表格 1059 //渲染表格
996 var cols = commonCols.resTypeCls[resType]; 1060 var cols = commonCols.resTypeCls[resType];
  1061 + //start lsq 根据资源类型resType获取动态添加的列表字段 2022-08-05
  1062 + admin.req({
  1063 + url: common.domainName + "/api-web/resource/expand/list?resType=" + resType
  1064 + , done: function (res) {
  1065 + if (res && res.data ) {
  1066 + let arr=res.data;
  1067 + if(fieldExpandArr.indexOf(resType)!=-1){
  1068 + }else{
  1069 + fieldExpandArr.push(resType);
  1070 + if(arr.length>0){
  1071 + arr.map(item=>{
  1072 + let listStr='';
  1073 + if(item.list && item.list.length>0){
  1074 + listStr=item.list.join(',')
  1075 + }
  1076 + cols.splice(item.fieldSort,0,{field: item.field, title: item.fieldName, align: 'center', width: 100, sort: true,
  1077 + templet:` <div>
  1078 + <div class="edit-delete-tpl T-edit-delete-tpl" lay-tips="点击修改/删除" data-fieldsourcetype="`+item.fieldSourceType+`"
  1079 + data-expandid="`+item.id+`" data-list="`+listStr+`" data-tpltype="`+item.field+`" data-resid="{{d.resId}}">
  1080 + {{d.`+item.field+` ? d.`+item.field+` : ''}}
  1081 + </div></div>`})
  1082 + })
  1083 + }
  1084 + }
  1085 + } else {
  1086 + console.log(res.msg);
  1087 + }
  1088 + }
  1089 + });
  1090 + setTimeout(function (){
997 //获取配置的列 1091 //获取配置的列
998 common.getTableCols({ 1092 common.getTableCols({
999 domId: 'parentResListTable', 1093 domId: 'parentResListTable',
@@ -1093,6 +1187,8 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', ' @@ -1093,6 +1187,8 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
1093 } 1187 }
1094 }); 1188 });
1095 }); 1189 });
  1190 + },300)
  1191 +
1096 } 1192 }
1097 1193
1098 //资源列表 1194 //资源列表
@@ -1120,6 +1216,36 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', ' @@ -1120,6 +1216,36 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
1120 $('#power_state_div').show(); 1216 $('#power_state_div').show();
1121 } 1217 }
1122 var cols = commonCols.resTypeCls[resType]; 1218 var cols = commonCols.resTypeCls[resType];
  1219 + //start lsq 根据资源类型resType获取动态添加的列表字段 2022-08-05
  1220 + admin.req({
  1221 + url: common.domainName + "/api-web/resource/expand/list?resType=" + resType
  1222 + , done: function (res) {
  1223 + if (res && res.data ) {
  1224 + let arr=res.data;
  1225 + if(fieldExpandArr.indexOf(resType)!=-1){
  1226 + }else{
  1227 + fieldExpandArr.push(resType);
  1228 + if(arr.length>0){
  1229 + arr.map(item=>{
  1230 + let listStr='';
  1231 + if(item.list && item.list.length>0){
  1232 + listStr=item.list.join(',')
  1233 + }
  1234 + cols.splice(item.fieldSort,0,{field: item.field, title: item.fieldName, align: 'center', width: 100, sort: true,
  1235 + templet:` <div>
  1236 + <div class="edit-delete-tpl T-edit-delete-tpl" lay-tips="点击修改/删除" data-fieldsourcetype="`+item.fieldSourceType+`"
  1237 + data-expandid="`+item.id+`" data-list="`+listStr+`" data-tpltype="`+item.field+`" data-resid="{{d.resId}}">
  1238 + {{d.`+item.field+` ? d.`+item.field+` : ''}}
  1239 + </div></div>`})
  1240 + })
  1241 + }
  1242 + }
  1243 + } else {
  1244 + console.log(res.msg);
  1245 + }
  1246 + }
  1247 + });
  1248 + setTimeout(function (){
1123 //获取配置的列 1249 //获取配置的列
1124 common.getTableCols({ 1250 common.getTableCols({
1125 domId: 'resListTable', 1251 domId: 'resListTable',
@@ -1210,6 +1336,8 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', ' @@ -1210,6 +1336,8 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
1210 } 1336 }
1211 }); 1337 });
1212 }); 1338 });
  1339 + },300)
  1340 +
1213 } 1341 }
1214 1342
1215 1343