Authored by 鲁尚清

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

... ... @@ -9,7 +9,7 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'soulTable', 'sessions', 'comm
var common = layui.common;
var commonCols = layui.commonCols;
var sortKey = '';
var fieldExpandArr=[];//获取扩展的表格字段
//用树表格展示的资源类型
var treeTableResTypes = [
... ... @@ -117,6 +117,36 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'soulTable', 'sessions', 'comm
renderSearchCondition(resType, bizId);
var cols = commonCols.resTypeCls[resType];
//start lsq 根据资源类型resType获取动态添加的列表字段 2022-08-05
admin.req({
url: common.domainName + "/api-web/resource/expand/list?resType=" + resType
, done: function (res) {
if (res && res.data ) {
let arr=res.data;
if(fieldExpandArr.indexOf(resType)!=-1){
}else{
fieldExpandArr.push(resType);
if(arr.length>0){
arr.map(item=>{
let listStr='';
if(item.list && item.list.length>0){
listStr=item.list.join(',')
}
cols.splice(item.fieldSort,0,{field: item.field, title: item.fieldName, align: 'center', width: 100, sort: true,
templet:` <div>
<div class="edit-delete-tpl T-edit-delete-tpl" lay-tips="点击修改/删除" data-fieldsourcetype="`+item.fieldSourceType+`"
data-expandid="`+item.id+`" data-list="`+listStr+`" data-tpltype="`+item.field+`" data-resid="{{d.resId}}">
{{d.`+item.field+` ? d.`+item.field+` : ''}}
</div></div>`})
})
}
}
} else {
console.log(res.msg);
}
}
});
setTimeout(function (){
//获取配置的列
common.getTableCols({
domId: 'bizResListTable',
... ... @@ -181,7 +211,7 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'soulTable', 'sessions', 'comm
}
});
})
},300)
}
... ... @@ -221,7 +251,36 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'soulTable', 'sessions', 'comm
layer.load(2); //加载层。
var cols = commonCols.resTypeCls[resType];
//start lsq 根据资源类型resType获取动态添加的列表字段 2022-08-05
admin.req({
url: common.domainName + "/api-web/resource/expand/list?resType=" + resType
, done: function (res) {
if (res && res.data ) {
let arr=res.data;
if(fieldExpandArr.indexOf(resType)!=-1){
}else{
fieldExpandArr.push(resType);
if(arr.length>0){
arr.map(item=>{
let listStr='';
if(item.list && item.list.length>0){
listStr=item.list.join(',')
}
cols.splice(item.fieldSort,0,{field: item.field, title: item.fieldName, align: 'center', width: 100, sort: true,
templet:` <div>
<div class="edit-delete-tpl T-edit-delete-tpl" lay-tips="点击修改/删除" data-fieldsourcetype="`+item.fieldSourceType+`"
data-expandid="`+item.id+`" data-list="`+listStr+`" data-tpltype="`+item.field+`" data-resid="{{d.resId}}">
{{d.`+item.field+` ? d.`+item.field+` : ''}}
</div></div>`})
})
}
}
} else {
console.log(res.msg);
}
}
});
setTimeout(function (){
//获取配置的列
common.getTableCols({
domId: 'bizResTreeTable',
... ... @@ -360,6 +419,7 @@ layui.define(['laytpl', 'admin', 'form', 'table', 'soulTable', 'sessions', 'comm
layer.closeAll();
});
})
},300)
}
//获取资源统计
... ...
... ... @@ -5144,7 +5144,113 @@ layui.define(['soulTable', 'commonDetail', 'common', 'laytpl', 'view', 'admin',
}, function () {
layer.close(subtips);
});
//lsq T3和IOP点击修改删除 2022-08-04
$('.edit-delete-tpl').unbind('click').on('click',function (){
var $T3Dom = $(this);
//判断是字段类型T3/IOP
let tplType=$T3Dom.data('tpltype');
//获取资源id
var resId = $T3Dom.data('resid');
//获取旧数据
let old_T3Dom=$T3Dom.text();
//获取扩展字段id
let expandId=$T3Dom.data('expandid');
//获取字段为输入框或者下拉选择 0 输入框 1下拉选择
let fieldSourceType=$T3Dom.data('fieldsourcetype');
//获取下拉选择值
let fieldList=$T3Dom.data('list');
let url='/api-web/resource/expand/saveOrUpdate';
//判断类型是输入框还是下拉列表
let titleName='';
let promptHtml='';
if(fieldSourceType == '0'){
titleName='请输入';
promptHtml=`<input type="text" id="promptInput" name="promptInput" autocomplete="off" class="layui-input">`
}else if(fieldSourceType== '1'){
titleName='请选择';
promptHtml=`<select id="promptInput" style="width:80%;cursor:pointer;" class="layui-select" lay-filter="promptInput">`
if(fieldList){
let fieldListArr=fieldList.split(",")
fieldListArr.map(item=>{
promptHtml+=`<option value="`+item+`">`+item+`</option>`;
})
}
promptHtml+=`</select>`;
}else{
promptHtml=``
}
let html_tpl=`<div class="T3-IOP-prompt">`+promptHtml+`</div>`;
layer.open({
title: [titleName+tplType, 'font-size:14px;'],
type: 1,
area: ['280px','170px'],
content: html_tpl,
success: function () {
$('#promptInput').val(old_T3Dom)
}
, id: 'lay_T3_IOP' //设定一个id,防止重复弹出
, btn: ['清空', '保存']
, yes: function (index, layero) {
layer.confirm('确认要删除吗?', {icon: 3, title: '提示'}, function (index1) {
layer.load(2);
admin.req({
//删除T3值
url: common.domainName + url,
data: {
resId:resId,
fieldValue:'',
expandId:expandId,//扩展字段id
},
}).done(function (response) {
layer.closeAll('loading');
if (response.success) {
layer.msg('删除成功!', {icon: 1, time: 3000});
$T3Dom.text('');
} else {
layer.msg('删除失败!', {icon: 2, time: 3000});
}
layer.close(index);
});
})
}
, btn2:function(index, layero){
var value = $('#promptInput').val();
if (value !== old_T3Dom) {
layer.load(2);
admin.req({
//修改扩展字段T3/IOp值
url: common.domainName + url,
data: {
resId:resId,
fieldValue:value,
expandId:expandId,//扩展字段id
},
success: function (response) {
layer.closeAll('loading');
if (response && response.success) {
layer.msg('修改成功', {icon: 1});
$T3Dom.text(value);
} else {
layer.msg('修改失败', {icon: 2});
}
layer.close(index);
},
error: function (err) {
layer.closeAll('loading');
layer.msg('修改失败', {icon: 2});
}
});
} else {
layer.close(index);
}
},
});
})
//end lsq T3和IOP点击修改/删除 2022-08-04
function showTips(id, message, state) {
subtips = layer.tips(state + "失败原因:" + message,
'#' + id, {tips: 1});
... ...
... ... @@ -836,6 +836,37 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form',
return htm;
}
});
//start lsq 根据资源类型resType获取动态添加的列表字段 2022-08-05
admin.req({
url: this.domainName + "/api-web/resource/expand/list?resType=" + resType
, done: function (res) {
if (res && res.data ) {
let arr=res.data;
//lsq 资源管理增加扩展字段 待验证 2022-08-12
// if(this.fieldExpandArr.indexOf(resType)!=-1){
// }else{
// this.fieldExpandArr.push(resType);
if(arr.length>0){
arr.map(item=>{
let listStr='';
if(item.list && item.list.length>0){
listStr=item.list.join(',')
}
cols.splice(item.fieldSort,0,{field: item.field, title: item.fieldName, align: 'center', width: 100, sort: true,
templet:` <div>
<div class="edit-delete-tpl T-edit-delete-tpl" lay-tips="点击修改/删除" data-fieldsourcetype="`+item.fieldSourceType+`"
data-expandid="`+item.id+`" data-list="`+listStr+`" data-tpltype="`+item.field+`" data-resid="{{d.resId}}">
{{d.`+item.field+` ? d.`+item.field+` : ''}}
</div></div>`})
})
}
// }
} else {
console.log(res.msg);
}
}
});
setTimeout(function (){
//渲染表格
table.render({
elem: '#resManageTable'
... ... @@ -1128,9 +1159,127 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'upload', 'admin', 'form',
commonDetail.openDetail(resId, resType, name)
});
resTopo();
//lsq T3和IOP点击修改删除 2022-08-04
let fsTypeEl=$('.edit-delete-tpl');
if(fsTypeEl && fsTypeEl.length>0){
fsTypeEl.map((index,item)=>{
if($(item).data('fieldsourcetype')=='text'){
$(item).removeAttr('lay-tips')
}
})
}
$('.edit-delete-tpl').unbind('click').on('click',function (){
var $T3Dom = $(this);
//判断是字段类型T3/IOP
let tplType=$T3Dom.data('tpltype');
//获取资源id
var resId = $T3Dom.data('resid');
//获取旧数据
let old_T3Dom=$T3Dom.text();
//获取扩展字段id
let expandId=$T3Dom.data('expandid');
//获取字段为输入框或者下拉选择 0 输入框 1下拉选择
let fieldSourceType=$T3Dom.data('fieldsourcetype');
if(fieldSourceType!='text'){
//获取下拉选择值
let fieldList=$T3Dom.data('list');
let url='/api-web/resource/expand/saveOrUpdate';
//判断类型是输入框还是下拉列表
let titleName='';
let promptHtml='';
if(fieldSourceType == 'input'){
titleName='请输入';
promptHtml=`<input type="text" id="promptInput" name="promptInput" autocomplete="off" class="layui-input">`
}else if(fieldSourceType== 'select'){
titleName='请选择';
promptHtml=`<select id="promptInput" style="width:80%;cursor:pointer;" class="layui-select" lay-filter="promptInput">`
if(fieldList){
let fieldListArr=fieldList.split(",")
fieldListArr.map(item=>{
promptHtml+=`<option value="`+item+`">`+item+`</option>`;
})
}
promptHtml+=`</select>`;
}else{
titleName='请查看';
promptHtml=`<span style="border: 1px solid #d2d2d2;flex: 1;padding: 10px;" id="promptInput">`+old_T3Dom+`</span>`
}
let html_tpl=`<div class="T3-IOP-prompt">`+promptHtml+`</div>`;
layer.open({
title: [titleName+tplType, 'font-size:14px;'],
type: 1,
area: ['280px','170px'],
content: html_tpl,
success: function () {
$('#promptInput').val(old_T3Dom)
}
, id: 'lay_T3_IOP' //设定一个id,防止重复弹出
, btn: ['清空', '保存']
, yes: function (index, layero) {
layer.confirm('确认要删除吗?', {icon: 3, title: '提示'}, function (index1) {
layer.load(2);
admin.req({
//删除T3值
url: common.domainName + url,
data: {
resId:resId,
fieldValue:'',
expandId:expandId,//扩展字段id
},
}).done(function (response) {
layer.closeAll('loading');
if (response.success) {
layer.msg('删除成功!', {icon: 1, time: 3000});
$T3Dom.text('');
} else {
layer.msg('删除失败!', {icon: 2, time: 3000});
}
layer.close(index);
});
})
}
, btn2:function(index, layero){
var value = $('#promptInput').val();
if (value !== old_T3Dom) {
layer.load(2);
admin.req({
//修改扩展字段T3/IOp值
url: common.domainName + url,
data: {
resId:resId,
fieldValue:value,
expandId:expandId,//扩展字段id
},
success: function (response) {
layer.closeAll('loading');
if (response && response.success) {
layer.msg('修改成功', {icon: 1});
$T3Dom.text(value);
} else {
layer.msg('修改失败', {icon: 2});
}
layer.close(index);
},
error: function (err) {
layer.closeAll('loading');
layer.msg('修改失败', {icon: 2});
}
});
} else {
layer.close(index);
}
},
});
}
})
//end lsq T3和IOP点击修改/删除 2022-08-04
}
});
},300)
}
//处理表头和内容不能对齐的问题
... ...
... ... @@ -8613,3 +8613,16 @@ form.layui-card-header.layuiadmin-card-header-auto {
text-decoration: underline;
}
/*end lsq 2022-06-28*/
/*lsq T3和IOP 2022-08-04*/
.edit-delete-tpl{
width: 100%;
height: 100%;
cursor: pointer;
}
.T3-IOP-prompt{
display: flex;
align-items: center;
justify-content: center;
height: 100%;
padding: 0 20px;
}
\ No newline at end of file
... ...
... ... @@ -18,7 +18,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
var curBizResType = '';//当前业务所在的资源类型
var sortKey = '';
var fieldExpandArr=[];//获取扩展的表格字段
function autoHeight(el) {
// var height = el.parents('.layui-card').height();
... ... @@ -441,6 +441,36 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
resTypeList.push(v.value);
busId = v.pid;
});
//start lsq 根据资源类型resType获取动态添加的列表字段 2022-08-05
admin.req({
url: common.domainName + "/api-web/resource/expand/list?resType=" + resType
, done: function (res) {
if (res && res.data ) {
let arr=res.data;
if(fieldExpandArr.indexOf(resType)!=-1){
}else{
fieldExpandArr.push(resType);
if(arr.length>0){
arr.map(item=>{
let listStr='';
if(item.list && item.list.length>0){
listStr=item.list.join(',')
}
cols.splice(item.fieldSort,0,{field: item.field, title: item.fieldName, align: 'center', width: 100, sort: true,
templet:` <div>
<div class="edit-delete-tpl T-edit-delete-tpl" lay-tips="点击修改/删除" data-fieldsourcetype="`+item.fieldSourceType+`"
data-expandid="`+item.id+`" data-list="`+listStr+`" data-tpltype="`+item.field+`" data-resid="{{d.resId}}">
{{d.`+item.field+` ? d.`+item.field+` : ''}}
</div></div>`})
})
}
}
} else {
console.log(res.msg);
}
}
});
setTimeout(function (){
//获取配置的列
common.getTableCols({
domId: 'bizListTable',
... ... @@ -508,7 +538,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
}
});
});
},300)
}
//获取业务下的资源类型健康统计
... ... @@ -550,6 +580,36 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
renderBizSerach(resType, busId, true);
form.render(null, 'biz-list-form');
var cols = commonCols.resTypeCls[resType];
//start lsq 根据资源类型resType获取动态添加的列表字段 2022-08-05
admin.req({
url: common.domainName + "/api-web/resource/expand/list?resType=" + resType
, done: function (res) {
if (res && res.data ) {
let arr=res.data;
if(fieldExpandArr.indexOf(resType)!=-1){
}else{
fieldExpandArr.push(resType);
if(arr.length>0){
arr.map(item=>{
let listStr='';
if(item.list && item.list.length>0){
listStr=item.list.join(',')
}
cols.splice(item.fieldSort,0,{field: item.field, title: item.fieldName, align: 'center', width: 100, sort: true,
templet:` <div>
<div class="edit-delete-tpl T-edit-delete-tpl" lay-tips="点击修改/删除" data-fieldsourcetype="`+item.fieldSourceType+`"
data-expandid="`+item.id+`" data-list="`+listStr+`" data-tpltype="`+item.field+`" data-resid="{{d.resId}}">
{{d.`+item.field+` ? d.`+item.field+` : ''}}
</div></div>`})
})
}
}
} else {
console.log(res.msg);
}
}
});
setTimeout(function (){
//获取配置的列
common.getTableCols({
domId: 'bizParentList',
... ... @@ -619,6 +679,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
}
});
});
},300)
}
//资源列表
... ... @@ -633,6 +694,36 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
form.render(null, 'biz-list-form');
var cols = commonCols.resTypeCls[resType];
//start lsq 根据资源类型resType获取动态添加的列表字段 2022-08-05
admin.req({
url: common.domainName + "/api-web/resource/expand/list?resType=" + resType
, done: function (res) {
if (res && res.data ) {
let arr=res.data;
if(fieldExpandArr.indexOf(resType)!=-1){
}else{
fieldExpandArr.push(resType);
if(arr.length>0){
arr.map(item=>{
let listStr='';
if(item.list && item.list.length>0){
listStr=item.list.join(',')
}
cols.splice(item.fieldSort,0,{field: item.field, title: item.fieldName, align: 'center', width: 100, sort: true,
templet:` <div>
<div class="edit-delete-tpl T-edit-delete-tpl" lay-tips="点击修改/删除" data-fieldsourcetype="`+item.fieldSourceType+`"
data-expandid="`+item.id+`" data-list="`+listStr+`" data-tpltype="`+item.field+`" data-resid="{{d.resId}}">
{{d.`+item.field+` ? d.`+item.field+` : ''}}
</div></div>`})
})
}
}
} else {
console.log(res.msg);
}
}
});
setTimeout(function (){
//获取配置的列
common.getTableCols({
domId: 'bizListTable',
... ... @@ -703,6 +794,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
}
});
});
},300)
}
//树表格
... ... @@ -729,7 +821,36 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
}
var cols = commonCols.resTypeCls[resType];
//start lsq 根据资源类型resType获取动态添加的列表字段 2022-08-05
admin.req({
url: common.domainName + "/api-web/resource/expand/list?resType=" + resType
, done: function (res) {
if (res && res.data ) {
let arr=res.data;
if(fieldExpandArr.indexOf(resType)!=-1){
}else{
fieldExpandArr.push(resType);
if(arr.length>0){
arr.map(item=>{
let listStr='';
if(item.list && item.list.length>0){
listStr=item.list.join(',')
}
cols.splice(item.fieldSort,0,{field: item.field, title: item.fieldName, align: 'center', width: 100, sort: true,
templet:` <div>
<div class="edit-delete-tpl T-edit-delete-tpl" lay-tips="点击修改/删除" data-fieldsourcetype="`+item.fieldSourceType+`"
data-expandid="`+item.id+`" data-list="`+listStr+`" data-tpltype="`+item.field+`" data-resid="{{d.resId}}">
{{d.`+item.field+` ? d.`+item.field+` : ''}}
</div></div>`})
})
}
}
} else {
console.log(res.msg);
}
}
});
setTimeout(function (){
admin.req({
url: common.domainName + "/api-web/home/virtual-res-list/" + resType
, data: {
... ... @@ -870,6 +991,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
}).error(function () {
layer.closeAll();
});
},300)
}
//获取资源统计
... ...
... ... @@ -4,7 +4,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
var $ = layui.$;
var common = layui.common;
var table = layui.table;
var fieldExpandArr=[];//获取扩展的表格字段
//对外暴露的接口
exports('resindex', function (data) {
var laytpl = layui.laytpl;
... ... @@ -205,6 +205,36 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
} else {
cols = commonCols.resTypeCls[resType];
}
//start lsq 根据资源类型resType获取动态添加的列表字段 2022-08-05
admin.req({
url: common.domainName + "/api-web/resource/expand/list?resType=" + resType
, done: function (res) {
if (res && res.data ) {
let arr=res.data;
if(fieldExpandArr.indexOf(resType)!=-1){
}else{
fieldExpandArr.push(resType);
if(arr.length>0){
arr.map(item=>{
let listStr='';
if(item.list && item.list.length>0){
listStr=item.list.join(',')
}
cols.splice(item.fieldSort,0,{field: item.field, title: item.fieldName, align: 'center', width: 100, sort: true,
templet:` <div>
<div class="edit-delete-tpl T-edit-delete-tpl" lay-tips="点击修改/删除" data-fieldsourcetype="`+item.fieldSourceType+`"
data-expandid="`+item.id+`" data-list="`+listStr+`" data-tpltype="`+item.field+`" data-resid="{{d.resId}}">
{{d.`+item.field+` ? d.`+item.field+` : ''}}
</div></div>`})
})
}
}
} else {
console.log(res.msg);
}
}
});
setTimeout(function (){
resTableList = table.render({
elem: '#resindexList'
,
... ... @@ -254,6 +284,8 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
});
}
});
},300)
});
}
... ... @@ -795,6 +827,36 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
var index = layer.load(2); //加载层
var cols = commonCols.resTypeCls[resType];
//start lsq 根据资源类型resType获取动态添加的列表字段 2022-08-05
admin.req({
url: common.domainName + "/api-web/resource/expand/list?resType=" + resType
, done: function (res) {
if (res && res.data ) {
let arr=res.data;
if(fieldExpandArr.indexOf(resType)!=-1){
}else{
fieldExpandArr.push(resType);
if(arr.length>0){
arr.map(item=>{
let listStr='';
if(item.list && item.list.length>0){
listStr=item.list.join(',')
}
cols.splice(item.fieldSort,0,{field: item.field, title: item.fieldName, align: 'center', width: 100, sort: true,
templet:` <div>
<div class="edit-delete-tpl T-edit-delete-tpl" lay-tips="点击修改/删除" data-fieldsourcetype="`+item.fieldSourceType+`"
data-expandid="`+item.id+`" data-list="`+listStr+`" data-tpltype="`+item.field+`" data-resid="{{d.resId}}">
{{d.`+item.field+` ? d.`+item.field+` : ''}}
</div></div>`})
})
}
}
} else {
console.log(res.msg);
}
}
});
setTimeout(function (){
admin.req({
url: common.domainName + "/api-web/home/virtual-res-list/" + resType
, type: "get"
... ... @@ -895,6 +957,8 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
}).error(function () {
layer.close(index);
});
},300)
}
... ... @@ -994,6 +1058,36 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
}
//渲染表格
var cols = commonCols.resTypeCls[resType];
//start lsq 根据资源类型resType获取动态添加的列表字段 2022-08-05
admin.req({
url: common.domainName + "/api-web/resource/expand/list?resType=" + resType
, done: function (res) {
if (res && res.data ) {
let arr=res.data;
if(fieldExpandArr.indexOf(resType)!=-1){
}else{
fieldExpandArr.push(resType);
if(arr.length>0){
arr.map(item=>{
let listStr='';
if(item.list && item.list.length>0){
listStr=item.list.join(',')
}
cols.splice(item.fieldSort,0,{field: item.field, title: item.fieldName, align: 'center', width: 100, sort: true,
templet:` <div>
<div class="edit-delete-tpl T-edit-delete-tpl" lay-tips="点击修改/删除" data-fieldsourcetype="`+item.fieldSourceType+`"
data-expandid="`+item.id+`" data-list="`+listStr+`" data-tpltype="`+item.field+`" data-resid="{{d.resId}}">
{{d.`+item.field+` ? d.`+item.field+` : ''}}
</div></div>`})
})
}
}
} else {
console.log(res.msg);
}
}
});
setTimeout(function (){
//获取配置的列
common.getTableCols({
domId: 'parentResListTable',
... ... @@ -1093,6 +1187,8 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
}
});
});
},300)
}
//资源列表
... ... @@ -1120,6 +1216,36 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
$('#power_state_div').show();
}
var cols = commonCols.resTypeCls[resType];
//start lsq 根据资源类型resType获取动态添加的列表字段 2022-08-05
admin.req({
url: common.domainName + "/api-web/resource/expand/list?resType=" + resType
, done: function (res) {
if (res && res.data ) {
let arr=res.data;
if(fieldExpandArr.indexOf(resType)!=-1){
}else{
fieldExpandArr.push(resType);
if(arr.length>0){
arr.map(item=>{
let listStr='';
if(item.list && item.list.length>0){
listStr=item.list.join(',')
}
cols.splice(item.fieldSort,0,{field: item.field, title: item.fieldName, align: 'center', width: 100, sort: true,
templet:` <div>
<div class="edit-delete-tpl T-edit-delete-tpl" lay-tips="点击修改/删除" data-fieldsourcetype="`+item.fieldSourceType+`"
data-expandid="`+item.id+`" data-list="`+listStr+`" data-tpltype="`+item.field+`" data-resid="{{d.resId}}">
{{d.`+item.field+` ? d.`+item.field+` : ''}}
</div></div>`})
})
}
}
} else {
console.log(res.msg);
}
}
});
setTimeout(function (){
//获取配置的列
common.getTableCols({
domId: 'resListTable',
... ... @@ -1210,6 +1336,8 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
}
});
});
},300)
}
... ...