表单模型新建权限

This commit is contained in:
zhal 2022-08-05 13:52:56 +08:00
parent 34435cfcf4
commit c67c3a77dd
2 changed files with 161 additions and 56 deletions

View File

@ -8881,6 +8881,7 @@ public class CoeProcessLevelWeb extends ActionWeb {
*/
public String relationFindSameRole(String uuid,String methodId){
ResponseObject ro = ResponseObject.newOkResponse();
List data=new ArrayList();
data.add(0,methodId);
data.add(1,uuid);

View File

@ -981,12 +981,11 @@ function openRelationDialog(obj, callback) {
var methodName="";
if(title=="支持文件"){
methodName="新建表单模型";
//data.form
method="data.form";
}else if(method=="control.kpi"){
methodName="新建绩效模型";
}
if(title=="支持文件" || method=="control.kpi"){
if(method=="control.kpi") {
//根据角色
$.ajax({
type: "POST",
@ -1001,10 +1000,10 @@ function openRelationDialog(obj, callback) {
if (msg.data.result == "ok") {
var relationDlg = parent.FrmDialog.open({
title: title,
width:710,
width: 710,
height: 400,
url:"./w",
data:{
url: "./w",
data: {
sid: $("#sid").val(),
cmd: "com.actionsoft.apps.coe.pal_pl_repository_designer_shapes_tree",
wsId: $("#wsid").val(),
@ -1016,10 +1015,11 @@ function openRelationDialog(obj, callback) {
modelId: $("#id").val(),
ruuid: uuid
},
id:"relationDialog",
id: "relationDialog",
buttons: [
{text:'确定',cls:"blue",handler:function(){
{
text: '确定', cls: "blue", handler: function () {
var attrId = obj.attr("id");
var relationFileId = "";
var relationShapeId = "";
@ -1028,15 +1028,15 @@ function openRelationDialog(obj, callback) {
var isRequired = obj.attr('isRequired')
if (isRequired == 'true' && relations.length == 0) {
obj.val('');
obj.attr('placeholder',title +'不能为空')
obj.attr('placeholder', title + '不能为空')
obj.addClass("required_input_css");
parent.FrmDialog.close("relationDialog");
return;
}
if (relations != undefined && relations.length > 0) {
for(var i = 0; i < relations.length; i++) {
for (var i = 0; i < relations.length; i++) {
var relationShape = relations[i];
if(i == relations.length -1) {
if (i == relations.length - 1) {
relationFileId += relationShape.relationFileId;
relationShapeId += relationShape.relationShapeId;
relationShapeText += relationShape.relationShapeText;
@ -1055,19 +1055,22 @@ function openRelationDialog(obj, callback) {
saveContent(obj);
}
parent.FrmDialog.close("relationDialog");
}},
{text:'取消',handler:function(){
}
},
{
text: '取消', handler: function () {
parent.FrmDialog.close("relationDialog");
}}
}
}
]
});
}else{
} else {
var relationDlg = parent.FrmDialog.open({
title: title,
width:710,
width: 710,
height: 400,
url:"./w",
data:{
url: "./w",
data: {
sid: $("#sid").val(),
cmd: "com.actionsoft.apps.coe.pal_pl_repository_designer_shapes_tree",
wsId: $("#wsid").val(),
@ -1079,57 +1082,56 @@ function openRelationDialog(obj, callback) {
modelId: $("#id").val(),
ruuid: uuid
},
id:"relationDialog",
id: "relationDialog",
buttons: [
{
text : '刷新',
cls : "yellow",
handler : function() {
text: '刷新',
cls: "yellow",
handler: function () {
// 刷新页面
parent.document.getElementById("id-awsui-win-frm-2013-frmrelationDialog").contentWindow.location.reload(true);
}
},{
text : methodName,
cls : "green",
handler : function() {
}, {
text: methodName,
cls: "green",
handler: function () {
//根据角色
$.ajax({
type : "POST",
url : "./jd?sid="
type: "POST",
url: "./jd?sid="
+ $("#sid").val()
+ "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer_relation_find_same_role",
data : {
uuid:uuid,
methodId:method
data: {
uuid: uuid,
methodId: method
},
success : function(msg) {
if (msg.data.result== "ok") {
window.top.$.simpleAlert("请勿重复"+methodName+"!!!");
}else{
success: function (msg) {
if (msg.data.result == "ok") {
window.top.$.simpleAlert("请勿重复" + methodName + "!!!");
} else {
//跳转表单/绩效模型
$.ajax({
type : "POST",
url : "./jd?sid="
type: "POST",
url: "./jd?sid="
+ $("#sid").val()
+ "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_createDialogModel",
data : {
uuid:uuid,
methodId:method,
wsId:$("#wsid").val(),
teamId : $('#teamId').val()
data: {
uuid: uuid,
methodId: method,
wsId: $("#wsid").val(),
teamId: $('#teamId').val()
},
success : function(msg) {
success: function (msg) {
if (msg.result == "ok") {
//关闭新建按钮
var dlgButton=parent.$(".dlg-button button");
for(var i=0;i<dlgButton.length;i++){
var text=dlgButton.eq(i).text();
if(text=="新建绩效模型" || text=="新建表单模型"){
var dlgButton = parent.$(".dlg-button button");
for (var i = 0; i < dlgButton.length; i++) {
var text = dlgButton.eq(i).text();
if (text == "新建绩效模型") {
dlgButton.eq(i).hide();
}
}
window.open("./w?uuid=" + msg.data.uuid+"&teamId"
window.open("./w?uuid=" + msg.data.uuid + "&teamId"
+ "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer&sid=" + encodeURIComponent($('#sid').val()));
}
@ -1141,7 +1143,8 @@ function openRelationDialog(obj, callback) {
}
},
{text:'确定',cls:"blue",handler:function(){
{
text: '确定', cls: "blue", handler: function () {
var attrId = obj.attr("id");
var relationFileId = "";
var relationShapeId = "";
@ -1150,15 +1153,15 @@ function openRelationDialog(obj, callback) {
var isRequired = obj.attr('isRequired')
if (isRequired == 'true' && relations.length == 0) {
obj.val('');
obj.attr('placeholder',title +'不能为空')
obj.attr('placeholder', title + '不能为空')
obj.addClass("required_input_css");
parent.FrmDialog.close("relationDialog");
return;
}
if (relations != undefined && relations.length > 0) {
for(var i = 0; i < relations.length; i++) {
for (var i = 0; i < relations.length; i++) {
var relationShape = relations[i];
if(i == relations.length -1) {
if (i == relations.length - 1) {
relationFileId += relationShape.relationFileId;
relationShapeId += relationShape.relationShapeId;
relationShapeText += relationShape.relationShapeText;
@ -1177,19 +1180,120 @@ function openRelationDialog(obj, callback) {
saveContent(obj);
}
parent.FrmDialog.close("relationDialog");
}},
{text:'取消',handler:function(){
}
},
{
text: '取消', handler: function () {
parent.FrmDialog.close("relationDialog");
}}
}
}
]
});
}
}
});
});
}else if(title=="支持文件"){
var relationDlg = parent.FrmDialog.open({
title: title,
width: 710,
height: 400,
url: "./w",
data: {
sid: $("#sid").val(),
cmd: "com.actionsoft.apps.coe.pal_pl_repository_designer_shapes_tree",
wsId: $("#wsid").val(),
ref: ref,
shapeId: "",
attrId: obj.attr("id"),
relationShapeIds: obj.attr("relationShapeId"),
relationFileIds: obj.attr("relationFileId"),
modelId: $("#id").val(),
ruuid: uuid
},
id: "relationDialog",
buttons: [
{
text: '刷新',
cls: "yellow",
handler: function () {
// 刷新页面
parent.document.getElementById("id-awsui-win-frm-2013-frmrelationDialog").contentWindow.location.reload(true);
}
}, {
text: methodName,
cls: "green",
handler: function () {
//跳转表单/绩效模型
$.ajax({
type: "POST",
url: "./jd?sid="
+ $("#sid").val()
+ "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer_relation_shape_createDialogModel",
data: {
uuid: uuid,
methodId: method,
wsId: $("#wsid").val(),
teamId: $('#teamId').val()
},
success: function (msg) {
if (msg.result == "ok") {
window.open("./w?uuid=" + msg.data.uuid + "&teamId"
+ "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer&sid=" + encodeURIComponent($('#sid').val()));
}
}
});
}
},
{
text: '确定', cls: "blue", handler: function () {
var attrId = obj.attr("id");
var relationFileId = "";
var relationShapeId = "";
var relationShapeText = "";
var relations = relationDlg.win().getRelationShapeInfos();
var isRequired = obj.attr('isRequired')
if (isRequired == 'true' && relations.length == 0) {
obj.val('');
obj.attr('placeholder', title + '不能为空')
obj.addClass("required_input_css");
parent.FrmDialog.close("relationDialog");
return;
}
if (relations != undefined && relations.length > 0) {
for (var i = 0; i < relations.length; i++) {
var relationShape = relations[i];
if (i == relations.length - 1) {
relationFileId += relationShape.relationFileId;
relationShapeId += relationShape.relationShapeId;
relationShapeText += relationShape.relationShapeText;
} else {
relationFileId += relationShape.relationFileId + ",";
relationShapeId += relationShape.relationShapeId + ",";
relationShapeText += relationShape.relationShapeText + ",";
}
}
}
obj.attr("attrId", attrId);
obj.attr("relationFileId", relationFileId);
obj.attr("relationShapeId", relationShapeId);
obj.val(relationShapeText);
if (callback && callback == "saveContent") {
saveContent(obj);
}
parent.FrmDialog.close("relationDialog");
}
},
{
text: '取消', handler: function () {
parent.FrmDialog.close("relationDialog");
}
}
]
});
}else{
var relationDlg = parent.FrmDialog.open({
title: title,