Authored by 鲁尚清

【无】列表增加扩展字段T3、IOP、nginx版本号

@@ -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 //获取资源统计
@@ -5144,7 +5144,113 @@ layui.define(['soulTable', 'commonDetail', 'common', 'laytpl', 'view', 'admin', @@ -5144,7 +5144,113 @@ layui.define(['soulTable', 'commonDetail', 'common', 'laytpl', 'view', 'admin',
5144 }, function () { 5144 }, function () {
5145 layer.close(subtips); 5145 layer.close(subtips);
5146 }); 5146 });
  5147 +//lsq T3和IOP点击修改删除 2022-08-04
  5148 + $('.edit-delete-tpl').unbind('click').on('click',function (){
  5149 + var $T3Dom = $(this);
  5150 + //判断是字段类型T3/IOP
  5151 + let tplType=$T3Dom.data('tpltype');
  5152 + //获取资源id
  5153 + var resId = $T3Dom.data('resid');
  5154 + //获取旧数据
  5155 + let old_T3Dom=$T3Dom.text();
  5156 + //获取扩展字段id
  5157 + let expandId=$T3Dom.data('expandid');
  5158 + //获取字段为输入框或者下拉选择 0 输入框 1下拉选择
  5159 + let fieldSourceType=$T3Dom.data('fieldsourcetype');
  5160 + //获取下拉选择值
  5161 + let fieldList=$T3Dom.data('list');
  5162 + let url='/api-web/resource/expand/saveOrUpdate';
  5163 + //判断类型是输入框还是下拉列表
  5164 + let titleName='';
  5165 + let promptHtml='';
  5166 + if(fieldSourceType == '0'){
  5167 + titleName='请输入';
  5168 + promptHtml=`<input type="text" id="promptInput" name="promptInput" autocomplete="off" class="layui-input">`
  5169 + }else if(fieldSourceType== '1'){
  5170 + titleName='请选择';
  5171 + promptHtml=`<select id="promptInput" style="width:80%;cursor:pointer;" class="layui-select" lay-filter="promptInput">`
  5172 + if(fieldList){
  5173 + let fieldListArr=fieldList.split(",")
  5174 + fieldListArr.map(item=>{
  5175 + promptHtml+=`<option value="`+item+`">`+item+`</option>`;
  5176 + })
  5177 + }
  5178 + promptHtml+=`</select>`;
  5179 + }else{
  5180 + promptHtml=``
  5181 + }
  5182 + let html_tpl=`<div class="T3-IOP-prompt">`+promptHtml+`</div>`;
  5183 + layer.open({
  5184 + title: [titleName+tplType, 'font-size:14px;'],
  5185 + type: 1,
  5186 + area: ['280px','170px'],
  5187 + content: html_tpl,
  5188 + success: function () {
  5189 + $('#promptInput').val(old_T3Dom)
  5190 + }
  5191 + , id: 'lay_T3_IOP' //设定一个id,防止重复弹出
  5192 + , btn: ['清空', '保存']
  5193 + , yes: function (index, layero) {
  5194 + layer.confirm('确认要删除吗?', {icon: 3, title: '提示'}, function (index1) {
  5195 + layer.load(2);
  5196 + admin.req({
  5197 + //删除T3值
  5198 + url: common.domainName + url,
  5199 + data: {
  5200 + resId:resId,
  5201 + fieldValue:'',
  5202 + expandId:expandId,//扩展字段id
  5203 +
  5204 + },
  5205 + }).done(function (response) {
  5206 + layer.closeAll('loading');
  5207 + if (response.success) {
  5208 + layer.msg('删除成功!', {icon: 1, time: 3000});
  5209 + $T3Dom.text('');
  5210 + } else {
  5211 + layer.msg('删除失败!', {icon: 2, time: 3000});
  5212 + }
  5213 + layer.close(index);
  5214 + });
  5215 + })
  5216 + }
  5217 + , btn2:function(index, layero){
  5218 + var value = $('#promptInput').val();
  5219 + if (value !== old_T3Dom) {
  5220 + layer.load(2);
5147 5221
  5222 + admin.req({
  5223 + //修改扩展字段T3/IOp值
  5224 + url: common.domainName + url,
  5225 + data: {
  5226 + resId:resId,
  5227 + fieldValue:value,
  5228 + expandId:expandId,//扩展字段id
  5229 +
  5230 + },
  5231 + success: function (response) {
  5232 + layer.closeAll('loading');
  5233 + if (response && response.success) {
  5234 + layer.msg('修改成功', {icon: 1});
  5235 + $T3Dom.text(value);
  5236 + } else {
  5237 + layer.msg('修改失败', {icon: 2});
  5238 + }
  5239 + layer.close(index);
  5240 +
  5241 + },
  5242 + error: function (err) {
  5243 + layer.closeAll('loading');
  5244 + layer.msg('修改失败', {icon: 2});
  5245 + }
  5246 + });
  5247 + } else {
  5248 + layer.close(index);
  5249 + }
  5250 + },
  5251 + });
  5252 + })
  5253 + //end lsq T3和IOP点击修改/删除 2022-08-04
5148 function showTips(id, message, state) { 5254 function showTips(id, message, state) {
5149 subtips = layer.tips(state + "失败原因:" + message, 5255 subtips = layer.tips(state + "失败原因:" + message,
5150 '#' + id, {tips: 1}); 5256 '#' + id, {tips: 1});
@@ -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,16 @@ form.layui-card-header.layuiadmin-card-header-auto { @@ -8613,3 +8613,16 @@ 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 +}
@@ -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