yili-apps/com.actionsoft.apps.coe.pal/template/page/pal.pl.manage.main.shape.attr.new.html
2022-06-27 23:38:56 +08:00

228 lines
9.8 KiB
HTML
Executable File

<!Doctype html><html xmlns=http://www.w3.org/1999/xhtml>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Welcome to AWSUI Index Page.</title>
<link rel="stylesheet" href="../commons/css/awsui.css"/>
<link rel="stylesheet" href="../commons/js/jquery/themes/default/ui/reference/jquery-ui.css">
<link type="text/css" rel="stylesheet" href="../commons/js/jquery/themes/default/demo/shCoreDefault.css"/>
<link type="text/css" rel="stylesheet" href="../apps/_bpm.platform/css/amc/console.admin.amc.public.css" />
<script src="../commons/js/jquery/scripts/jquery.js"></script>
<script src="../commons/js/awsui.js"></script>
<style type="text/css">
.head_height{
height:40px;
}
.treecls{
color:red;
}
body{
margin:0px;
overflow-y:hidden;
}
.awsui-layout-left-title {
text-align: center;
}
.trBackgroud{
background-color: #E0EEFF;
}
th div{
padding: 4px 5px;
}
#innerTable td {
white-space:pre-line;
}
.listTable{
min-width:300px;
}
#listTable th {
border-bottom: 0px solid #fff;
}
</style>
<script type="text/javascript">
function addCssToTr(obj){
$(obj).addClass("trBackgroud");
}
function removeCssFromTr(obj){
$(obj).removeClass("trBackgroud");
}
//切换为输入框
function changeInput(obj) {
$(obj).children("td").eq(3).children("div").css("display", "none");
$(obj).children("td").eq(3).children("input").css("display", "block");
$(obj).children("td").eq(9).children("div").css("display", "none");
$(obj).children("td").eq(9).children("input").css("display", "block");
}
//移除输入框
function removeInput(obj) {
$(obj).children("td").eq(3).children("div").css("display", "block");
$(obj).children("td").eq(3).children("input").css("display", "none");
$(obj).children("td").eq(9).children("div").css("display", "block");
$(obj).children("td").eq(9).children("input").css("display", "none");
}
//修改名称
function updateAttrName(obj) {
var attrName = $(obj).val();
var oldAttrName = obj.previousSibling.innerText;
//校验值是否变化来触发请求
if (attrName == oldAttrName || attrName.trim().length == 0) {
$(obj).val(oldAttrName);
return;
}
var attrId = obj.parentNode.previousSibling.previousSibling.firstChild.innerText;
var sort = obj.parentNode.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.innerText;
var type = "<#type>";
var attrType = obj.parentNode.nextSibling.innerText;
var value = obj.parentNode.nextSibling.nextSibling.innerText;
//添加确认框
/*var options = {
title : "修改名称",
content: oldAttrName + "->" +attrName,
onConfirm: function(){
//替换修改后的值
obj.previousSibling.innerText = attrName;
awsui.ajax.post("./jd?sid=<#sid>&cmd=com.actionsoft.apps.coe.pal_pl_manage_main_attr_update", { wsid: "<#wsid>", type: type, attrId: attrId, methodId: "<#methodId>", attrName: attrName, orderIndex: sort, value: value, attrType: attrType}, function(data) {
if (data.msg == "updateSuccess") {
$.simpleAlert("修改成功", "ok", 1500);
} else {
$(obj).val(oldAttrName);
obj.previousSibling.innerText = oldAttrName;
$.simpleAlert("修改失败","error",1000);
}
}, 'json');
},
onClose : function(){
obj.previousSibling.innerText = oldAttrName;
}
};
$.confirm(options);*/
//替换修改后的值
obj.previousSibling.innerText = attrName;
awsui.ajax.post("./jd?sid=<#sid>&cmd=com.actionsoft.apps.coe.pal_pl_manage_main_attr_update", { wsid: "<#wsid>", type: type, attrId: attrId, methodId: "<#methodId>", attrName: attrName, orderIndex: sort, value: value, attrType: attrType}, function(data) {
if (data.msg == "updateSuccess") {
$.simpleAlert("修改成功", "ok", 1500);
} else {
$(obj).val(oldAttrName);
obj.previousSibling.innerText = oldAttrName;
$.simpleAlert("修改失败","error",1000);
}
}, 'json');
}
//修改排序
function updateAttrSort(obj) {
var sort = $(obj).val();
var oldSort = obj.previousSibling.innerText;
//校验值是否变化来触发请求
if (sort == oldSort || sort.trim().length == 0) {
$(obj).val(oldSort);
return;
}
//替换修改后的值
obj.previousSibling.innerText = sort;
var attrId = obj.parentNode.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling.firstChild.innerText;
var attrName = obj.parentNode.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling.firstChild.innerText;
var type = "<#type>";
var value = obj.parentNode.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling.innerText;
var attrType = obj.parentNode.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling.previousSibling.innerText;
//添加确认框
/*var options = {
title : "修改排序",
content: oldSort + "->" +sort,
onConfirm: function(){
//替换修改后的值
obj.previousSibling.innerText = sort;
awsui.ajax.post("./jd?sid=<#sid>&cmd=com.actionsoft.apps.coe.pal_pl_manage_main_attr_update", { wsid: "<#wsid>", type: type, attrId: attrId, methodId: "<#methodId>", attrName: attrName, orderIndex: sort, value: value, attrType: attrType}, function(data) {
if (data.msg == "updateSuccess") {
$.simpleAlert("修改成功", "ok", 1500);
} else if (data.msg == "please input number") {
$(obj).val(oldSort);
obj.previousSibling.innerText = oldSort;
$.simpleAlert("非法输入,请输入数字","error",1000);
} else {
$(obj).val(oldSort);
obj.previousSibling.innerText = oldSort;
$.simpleAlert("修改失败","error",1000);
}
}, 'json');
},
onClose : function(){
obj.previousSibling.innerText = oldSort;
}
};
$.confirm(options);*/
//替换修改后的值
obj.previousSibling.innerText = sort;
awsui.ajax.post("./jd?sid=<#sid>&cmd=com.actionsoft.apps.coe.pal_pl_manage_main_attr_update", { wsid: "<#wsid>", type: type, attrId: attrId, methodId: "<#methodId>", attrName: attrName, orderIndex: sort, value: value, attrType: attrType}, function(data) {
if (data.msg == "updateSuccess") {
$.simpleAlert("修改成功", "ok", 1500);
} else if (data.msg == "please input number") {
$(obj).val(oldSort);
obj.previousSibling.innerText = oldSort;
$.simpleAlert("非法输入,请输入数字","error",1000);
} else {
$(obj).val(oldSort);
obj.previousSibling.innerText = oldSort;
$.simpleAlert("修改失败","error",1000);
}
}, 'json');
}
//点击-修改
function updateAttr() {
}
$(function(){
$(window).trigger('resize');
})
$(window).resize(function(){
$('#mainDiv').height($(window).height());
$("#secondDiv").width($(window).width());
$('#listDiv').width($('#mainDiv').width() + 30).height($('#mainDiv').height() - 108);
$("#number").width(Math.round($('#mainDiv').width()*0.03));
$("#attrId").width(Math.round($('#mainDiv').width()*0.10));
$("#attrName").width(Math.round($('#mainDiv').width()*0.105));
$("#newAttrName").width(Math.round($('#mainDiv').width()*0.11));
$("#attrType").width(Math.round($('#mainDiv').width()*0.1));
$("#attrValue").width(Math.round($('#mainDiv').width()*0.085));
$("#readOnly").width(Math.round($('#mainDiv').width()*0.092));
$("#schema").width(Math.round($('#mainDiv').width()*0.1));
$("#scope").width(Math.round($('#mainDiv').width()*0.235));
$("#sort").width(Math.round($('#mainDiv').width()*0.05));
})
</script>
</head>
<body style='background:url("../apps/com.actionsoft.apps.coe.pal/img/noise-dark_195x195.png") repeat scroll 0 0 #FFFFFF'>
<div id="mainDiv" style="width:100%; overflow-y:hidden;">
<div style="height:100%;">
<div id="secondDiv" style="margin-left:0px;margin-right:0px;margin-top:0px; overflow-y:hidden;">
<table id="listTable" class="listTable awsui-table awsui-table-thin" style="margin-top: -8px;">
<tr style="width:100%">
<th id="number" style="width:5%;text-align:center;"><div>序号</div></th>
<th id="attrId" style="width:10%;text-align:center;"><div>属性代码</div></th>
<th id="attrName" style="width:10%;text-align:center;"><div>属性名称(原)</div></th>
<th id="newAttrName" style="width:10%;text-align:center;"><div>属性名称</div></th>
<th id="attrType" style="width:9%;text-align:center;"><div>属性类型</div></th>
<th id="attrValue" style="width:9%;text-align:center;"><div>默认值</div></th>
<th id="readOnly" style="width:8%;text-align:center;"><div>是否只读</div></th>
<th id="schema" style="width:8%;text-align:center;"><div>所属目录</div></th>
<th id="scope" style="width:21%;text-align:center;"><div>作用范围</div></th>
<th id="sort" style="width:8%;text-align:center;"><div>排序</div></th>
</tr>
<tr>
<td colspan="12" style="padding: 0px;">
<div id="listDiv" style="overflow:auto;">
<table style="width:100%;" cellspacing=0 cellpadding=0 id='innerTable'>
<#content>
</table>
</div>
<td>
</tr>
</table>
</div>
</div>
</div>
</body>
</html>