Authored by 鲁尚清

【无】域视图展开/收起

... ... @@ -231,46 +231,6 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'treeTable'
if ($.isFunction(fun)) {
fun.call(this, data, node.data, options);
}
//start lsq 域视图搜索条件太多,增加展开/收起的功能 2022-06-27
let formWidth =$('.form-item-open-stow').width();
let elem=$('.form-item-open-stow');
if(elem){
for(let i=0;i<elem.length;i++){
if($(elem[i]).width()){
formWidth=$(elem[i]).width();
}
}
}
if(!formWidth){
formWidth= sessionStorage.getItem('formWidth');
}else{
sessionStorage.setItem('formWidth',formWidth)
}
let winWidth = $('.form-item-open-stow').parents('.layui-status').width();
let elemW=$('.form-item-open-stow').parents('.layui-status');
if(elemW){
for(let i=0;i<elemW.length;i++){
if($(elemW[i]).width()){
winWidth=$(elemW[i]).width();
}
}
}
if (formWidth + 130 > winWidth) {
$('.openStow').css('display', 'inline-block')
$('.form-item-open-stow').css('height', '50px');
} else {
$('.openStow').css('display', 'none')
}
$(".openStow").unbind('click').on('click', function () {
if ($(this).text() == '展开') {
$(this).text('收起')
$('.form-item-open-stow').css('height', 'auto');
} else {
$(this).text('展开')
$('.form-item-open-stow').css('height', '50px');
}
})
//end lsq 2022-06-27
}
});
loadParamSelect();
... ... @@ -302,6 +262,49 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'treeTable'
loadDomainTree($(this).val())
}
});
//lsq 设置展开/收起
function setOpenStow(){
//start lsq 域视图搜索条件太多,增加展开/收起的功能 2022-06-27
let formWidth =$('.form-item-open-stow').width();
let elem=$('.form-item-open-stow');
if(elem){
for(let i=0;i<elem.length;i++){
if($(elem[i]).width()){
formWidth=$(elem[i]).width();
}
}
}
if(!formWidth){
formWidth= sessionStorage.getItem('formWidth');
}else{
sessionStorage.setItem('formWidth',formWidth)
}
let winWidth = $('.form-item-open-stow').parents('.layui-status').width();
let elemW=$('.form-item-open-stow').parents('.layui-status');
if(elemW){
for(let i=0;i<elemW.length;i++){
if($(elemW[i]).width()){
winWidth=$(elemW[i]).width();
}
}
}
if (winWidth>0 && formWidth + 130 > winWidth) {
$('.openStow').css('display', 'inline-block')
$('.form-item-open-stow').css('height', '50px');
} else {
$('.openStow').css('display', 'none')
}
$(".openStow").unbind('click').on('click', function () {
if ($(this).text() == '展开') {
$(this).text('收起')
$('.form-item-open-stow').css('height', 'auto');
} else {
$(this).text('展开')
$('.form-item-open-stow').css('height', '50px');
}
})
//end lsq 2022-06-27
}
//资源详细页面
function loadResDetailInfo(parentNode, data, node, options) {
... ... @@ -427,6 +430,8 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'treeTable'
renderDomainSerach(resType, domainId);
form.render(null, 'domain-list-form');
setOpenStow();
// var cols = [{type: 'numbers', title: '序号', align: 'center', fixed: 'left'}
// , {
// field: 'resName', title: '资源名称', minWidth: 210, align: 'center', sort: true,
... ... @@ -788,6 +793,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'treeTable'
common.saveTableCols(params);
$(this).addClass("hide");
});
}
});
});
... ... @@ -801,6 +807,8 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'treeTable'
renderDomainSerach(resType, domainId, true);
form.render(null, 'domain-list-form');
setOpenStow();
// var cols = [{type: 'numbers', title: '序号', align: 'center', fixed: 'left'}
// , {
// field: 'resName', title: '资源名称', minWidth: 210, align: 'center', sort: true,
... ...