...
|
...
|
@@ -4,6 +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) {
|
...
|
...
|
@@ -169,6 +170,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'
|
|
|
, id: 'resindexList'
|
...
|
...
|
@@ -209,6 +240,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', ' |
|
|
});
|
|
|
}
|
|
|
});
|
|
|
},300)
|
|
|
});
|
|
|
}
|
|
|
//左侧树
|
...
|
...
|
@@ -752,6 +784,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"
|
...
|
...
|
@@ -894,6 +956,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', ' |
|
|
}).error(function () {
|
|
|
layer.close(index);
|
|
|
});
|
|
|
},300)
|
|
|
}
|
|
|
|
|
|
|
...
|
...
|
@@ -995,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',
|
...
|
...
|
@@ -1105,6 +1198,8 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', ' |
|
|
}
|
|
|
});
|
|
|
});
|
|
|
},300)
|
|
|
|
|
|
}
|
|
|
|
|
|
//资源列表
|
...
|
...
|
@@ -1132,6 +1227,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',
|
...
|
...
|
@@ -1211,6 +1336,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', ' |
|
|
}
|
|
|
});
|
|
|
});
|
|
|
},300)
|
|
|
}
|
|
|
|
|
|
|
...
|
...
|
|