|
楼主 |
发表于 2016-11-12 10:13:50
|
显示全部楼层
题库维护详细页的.js源码
- define(function(require){
- var $ = require("jquery");
- var justep = require("$UI/system/lib/justep");
-
- var Model = function(){
- this.callParent();
- };
- Model.prototype.result = function(){
- //这里实现返回的逻辑
- return this.comp("mainData").getCurrentRow();
-
- };
- Model.prototype.OKBtnClick = function(event){
- this.comp('wReceiver').windowEnsure(this.result());
- };
- Model.prototype.uploadFileChange = function(event){
- if(!event.target.files){ //如果客户没有选择相关文件,直接返回
- return;
- }
-
- /* var storeFileName=justep.UUID.createUUID();
- var rowID=this.comp("statusData").val("rowID");*/
- var self=this;
- var uploadFile = event.target.files[0];
-
- canvasResize(uploadFile, { //压缩图片
- width: 400,
- height: 0,
- crop: false,
- quality: 80,
- callback: function(resizedPic, width, height) { //压缩成功后的回调
- debugger;
- self.comp("mainData").setValue("fQuestionPic",resizedPic);
- /* justep.Baas.sendRequest({
- "url" : "/TianCheng/TianCheng",
- "action" : "uploadPic",
- "async" : false,
- "params" : {'resizedPic':resizedPic,'rowID':rowID,'storeFileName':storeFileName},
- "success" : function(data) {
-
- if(data.success=="上传文件成功!"){
- self.comp("statusData").setValue("picUrl",rowID+'/'+storeFileName);
- justep.Util.hint(data.success);
-
- }
-
- }
- });*/
-
- }});
-
- };
- Model.prototype.modelParamsReceive = function(event){
- if(event.params.actionType=="new"){
- this.comp("mainData").newData();
- }else if(event.params.actionType=='edit'){
- this.comp("mainData").loadData([event.params.data.currentRow],false);
- this.comp("mainData").first();
- }
- };
- return Model;
- });
复制代码 |
|