|
楼主 |
发表于 2019-12-4 14:07:30
|
显示全部楼层
//显示按钮:详细信息
Model.prototype.mainGridCellRender = function(event){
if(event.colName=="operate"){
event.html="<a class='btn btn-link' onclick='justep.Bind.contextFor(this).$model.operate(event)'>详细信息</a>"
}
};
//打开详细信息
Model.prototype.executeTask = function() {
var mainData = this.comp("taskData");
var name = mainData.val("sName");
var url = mainData.val("sEURL");
if (!url) {
throw new Error("任务: '" + name + "' 的处理页面(sEURL)不允许为空!");
} else {
if (url.charAt(0) === "/"){
if (url.indexOf(".a") !== -1){
url = "$UI" + url;
}else{
url = "$model/UI" + url;
}
}
var id = mainData.getCurrentRowID();
var executorFID = mainData.val("sExecutorFID");
var process = mainData.val("sProcess");
var activity = mainData.val("sActivity");
url += ((url.indexOf("?") == -1) ? "?" : "&");
url += 'task=' + id + '&_pagePattern=write&process=' + process + '&activity=' + activity;
url = this.addTaskData(url, mainData.getCurrentRow());
if (mainData.val("sStatusID") === "tesReady"){
var param = new biz.Request.ActionParam();
param.setString("task", id);
param.setString("executor", executorFID);
var self = this;
var options = {
context : this.getContext(),
parameters : param,
process : process,
activity : activity,
action : "executeTaskAction",
contentType : biz.Request.JSON_TYPE,
dataType : biz.Request.JSON_TYPE,
directExecute : true,
callback : function(data) {
if (data.state) {
justep.Shell.showPage({url:url,
title : name,
executor : data.response || ""
});
} else {
data.ignoreError = false;
}
}
};
biz.Request.sendBizRequest(options);
}else{
justep.Shell.showPage({url:url, title : name, executor : executorFID || ""});
}
}
};
Model.prototype.addTaskData = function(url, row){
var data1 = row.val("sData1") || "";
var data2 = row.val("sData2") || "";
var data3 = row.val("sData3") || "";
var data4 = row.val("sData4") || "";
if (data1){
url += "&sData1=" + data1;
}
if (data2){
url += "&sData2=" + data2;
}
if (data3){
url += "&sData3=" + data3;
}
if (data4){
url += "&sData4=" + data4;
}
return url;
}
Model.prototype.operate = function(event){
this.executeTask();
};
当前行是通过什么指定的?我把详细信息按钮放在我的列表后面,怎么样才能打开它对应的行呢? |
|