关闭当前弹窗页面
$.modal.close();
父页面刷新
parent.location.reload();
关闭打开的子页签
$.modal.closeTab()
机构的树状展示:
KaTeX parse error: Expected '}', got 'EOF' at end of input: …a = JSON.parse((’.jiGou’).val());
var url = ctx + “outerManage/comInfo/getComInfoTreeData”;
var options = {
id: “menuTrees”,
url: url,
loadData:treeData,
check: { enable: true },
expandLevel: 1
};
$.tree.init(options);**
/* 渠道取值返显*/
// getQuDao($('.quDao').val());
getQuDao(JSON.parse($('.quDao').attr('fiels')));
/* 全部选择点击事件*/
$('.allCheck').on('change',function (){
checkINput();
})
/*单个复选框的选中问题*/
$('.singleQudao').each(function(index,ele){
$(ele).on('click',function (){
var flag = $(ele).prop('checked');
if(flag){
var pd = quDaoValue();
if(pd && pd.length == 7){
$('.allCheck').prop('checked',true)
}
}else if(!flag){
$('.allCheck').prop('checked',false)
}
})
})
});
再在ry-ui.js中修改输的展示,加上传值返现的判断:
if(options.loadData!=undefined && options.loadData!=null){
// debugger
var treeId = $("#treeId").val();
tree =
.
f
n
.
z
T
r
e
e
.
i
n
i
t
(
.fn.zTree.init(
.fn.zTree.init(("#" + options.id), setting, options.loadData);
$._tree = tree;
for (var i = 0; i < options.expandLevel; i++) {
var nodes = tree.getNodesByParam(“level”, i);
for (var j = 0; j < nodes.length; j++) {
tree.expandNode(nodes[j], true, false, false);
}
}
var node = tree.getNodesByParam(“id”, treeId, null)[0];
$.tree.selectByIdName(treeId, node);
}else
{
$.get(options.url, function(data) {
var treeId = $("#treeId").val();
tree =
.
f
n
.
z
T
r
e
e
.
i
n
i
t
(
.fn.zTree.init(
.fn.zTree.init(("#" + options.id), setting, data);
$._tree = tree;
for (var i = 0; i < options.expandLevel; i++) {
var nodes = tree.getNodesByParam(“level”, i);
for (var j = 0; j < nodes.length; j++) {
tree.expandNode(nodes[j], true, false, false);
}
}
var node = tree.getNodesByParam(“id”, treeId, null)[0];
$.tree.selectByIdName(treeId, node);
});
}
th:field,th:value,th:text都可以用来返现信息,但是,若是需要加上三元运算符的话,只有th:field不可以,其他两个都可以的。第二远要加上变量的话需要加上括号th:value=" s e a r c h . c h a n n e l ? ( {search.channel}?( search.channel?({search.channel}):‘1234’ "。而且只能使用最外围的变量来定义,不能使用th:value=“*{}”来书写。
KaTeX parse error: Expected '}', got 'EOF' at end of input: …var idData = [[{@dict.getType(‘id_type’)}]]
var idType =’’;
// idData.forEach(function(ele,index){
// console.log(ele.dictLabel+’-’+ele.dictValue)
// if(row.idTypeValue == ele.dictValue){
// idType = ele.dictLabel;
// }
// })
// return idType;
for (var i=0;i<idData.length ;i++){
if(row.idTypeValue == idData[i].dictValue){
return idData[i].dictLabel;
}
}
注意,使用each或者foreach的时候,在循环体里面return无效,必须定义全局变量来作为返回值才会有效,而for循环中则不会。
}
},{
field: ‘idNo’,
title: ‘证件号码’
},{
field: ‘sexValue’,
title: ‘性别’
},
{
field: ‘birthday’,
title: ‘出生日期’
},{
field: ‘isValidValue’,
title: ‘账户状态’
},
{
title: ‘操作’,
align: ‘center’,
formatter: function(value, row, index) {
var actions = [];
if (row.isValid==‘1’){
// actions.push('作废 ');
actions.push('冻结 ');
}else {
// actions.push('复效 ');
actions.push('解冻 ');
}
actions.push(‘查看详情 ‘);
return actions.join(’’);
}
}]
};
$.table.init(options);
});
内容返现,出th:text,th:field:th:value之外的下拉方法:
通过th:switch和th:case来返现内容。