|
楼主 |
发表于 2016-5-23 11:08:44
|
显示全部楼层
classificomp 是我自己做的组件 运行时候JS如下
define(function(require) {
var Request = require("$UI/system/lib/base/request");
// 加载公共资源
require("$UI/system/components/justep/common/res");
// 引入jquery
// var Model = justep.ModelBase;
var $ = require("jquery");
// 引入justep工具类
var justep = require("$UI/system/lib/justep");
// 相对路径转化为绝对路径
var url = require.normalizeName("./classification");
// 加载组件配置文件
var ComponentConfig = require("./classification.config");
// 引入css文件
require('css!./designer/css/classification').load();
var classification = justep.BindComponent.extend({
// var classification = justep.ModelComponent.extend({
// 构造函数
constructor : function(model, config) {
// 调用夫类的构造方法
this.callParent();
// 属性初始化默认值,这里对应着组件配置文件中注册的属性,必须赋给一个默认值,否在在调set方法给属性赋值的时候不起作用
this.classificationLevel = "";
this.classificationDuration = "";
this.drafter = "";
this.classificationAuthor = "";
this.issuer = "";
this.classificationOrg = "";
this.classificationBasis = "";
this.classificationId = "";
this.classificationStatus = "";
this.issuedNumber = "";
this.copys = "";
this.operationControl = "";
this.masterId = "";
this.accessScopeDescribe = "";
this.maxLength = 5 ;
},
// 获取组件配置文件
getConfig : function() {
return ComponentConfig;
},
// 构建模板,方法在通过new 的方式来动态创建组件对象的时候回调用。
buildTemplate : function(config) {
},
setValue : function(row, value, id) {
// 密级标识属性
debugger;
if ("classificationLevel" == row) {
this.classificationLevel = value;
} else if ("classificationDuration" == row) {
this.classificationDuration = value;
} else if ("drafter" == row) {
this.drafter = value;
} else if ("classificationAuthor" == row) {
this.classificationAuthor = value;
} else if ("issuer" == row) {
this.issuer = value;
} else if ("classificationOrg" == row) {
this.classificationOrg = value;
} else if ("classificationBasis" == row) {
this.classificationBasis = value;
} else if ("classificationId" == row) {
this.classificationId = value;
} else if ("classificationStatus" == row) {
this.classificationStatus = value;
} else if ("issuedNumber" == row) {
this.issuedNumber = value;
} else if ("copys" == row) {
this.copys = value;
} else if ("operationControl" == row) {
this.operationControl = value;
} else if ("masterId" == value) {
this.masterId = value;
} else if ("accessScopeDescribe" == row) {
this.accessScopeDescribe = value;
} else if ("accessScopeDescribe" == row) {
this.accessScopeDescribe = value;
} else if ("fFileUpload" == row) {
this.fFileUpload = value;
}
},
// 提交
saveData : function(options) {
debugger;
// 保存前
this.fireEvent("onBeforeSave", {
source : this
});
var onSuccess = null, onError = null, useTrans = true, ignoreInvalid = false;
var async = false;
var result = false;
var options = {};
var param = new Request.ActionParam();
param.setString('classificationLevel', this.classificationLevel);
param.setString('classificationDuration', this.classificationDuration);
param.setString('drafter', this.drafter);
param.setString('classificationAuthor', this.classificationAuthor);
param.setString('issuer', this.issuer);
param.setString('classificationOrg', this.classificationOrg);
param.setString('classificationBasis', this.classificationBasis);
param.setString('classificationId', this.classificationId);
param.setString('classificationStatus', this.classificationStatus);
param.setString('issuedNumber', this.issuedNumber);
param.setString('copys', this.copys);
param.setString('operationControl', this.operationControl);
param.setString('masterId', this.masterId);
param.setString('accessScopeDescribe', this.accessScopeDescribe);
param.setString('fFileUpload', this.fFileUpload);
var process = "/LW/classificationManagementSystem/process/classificationManagementSystem/classificationManagementSystemProcess";
var activity = "mainActivity";
options.process = process;
options.activity = activity;
options.parameters = param;
options.action = "insertClassifiComp";
var Component = this;
options.callback = function(data) {
var retText = data.response;
if (retText == "1") {
Component.fireEvent("onClassificationSucess", {
source : Component
});
} else {
Component.fireEvent("onClassificationError", {
source : Component
});
}
};
var result = Request.sendBizRequest(options);
/*
* // 保存后 Component.fireEvent("onAfterSave", { source : Component
* });
*/
},
// 初始化时调用的方法
doInit : function(value, bindingContext) {
},
doChange : function(evt) {
},
onSaveCommit : function(evt) {
},
_doClick : function(evt) {
},
_doChange : function(evt) {
},
setFiter : function(name, filter) {
},
refreshData : function() {
},
// 属性发生改变是触发的方法,主要是处理一些根据属性值更新界面的操作
propertyChangedHandler : function(key/* 属性名 */, oldVal/* 旧值 */, value/* 新值 */) {
debugger;
alert(key);
}
// 更多......
});
// 注册组件
justep.Component.register(url, classification);
// 返回组件类
return classification;
});
还有个问题 我如何能把 主BIZDATA的关系(a1,a2,a3)的数据 映射到 classification 种的关系中 (点击保存后 主表的数据 映射到classification表中 )
|
|