...
|
...
|
@@ -139,15 +139,21 @@ var operationEdit={ |
|
|
}
|
|
|
},
|
|
|
promotionId:null,
|
|
|
promotionType:null,
|
|
|
actionParam:null,
|
|
|
edit:null,
|
|
|
actionUrl:"/promotionInfo/setOperation",
|
|
|
load:function(config){
|
|
|
var _e= new edit("#tab_body",{});
|
|
|
this.edit=_e;
|
|
|
if(config){
|
|
|
this.promotionId=config.promotionId
|
|
|
if(config){
|
|
|
this.promotionType=config.promotionType;
|
|
|
this.actionParam=config.actionParam;
|
|
|
this.promotionId=config.promotionId;
|
|
|
}
|
|
|
$("#promotionType").val(this.promotionType);
|
|
|
_e.init();
|
|
|
selectOneOption(this.promotionType);
|
|
|
this.bindEvent();
|
|
|
},
|
|
|
template:function(_htmlObj,_data){
|
...
|
...
|
@@ -161,11 +167,20 @@ var operationEdit={ |
|
|
switch(_param.type){
|
|
|
case "text":
|
|
|
_input=$("<input type=\"text\" class=\"form-control\" />");
|
|
|
_input.val(_param.default_value);
|
|
|
if(this.actionParam&&this.actionParam[_param.name]){
|
|
|
_input.val(this.actionParam[_param.name]);
|
|
|
}else{
|
|
|
_input.val(_param.default_value);
|
|
|
}
|
|
|
break;
|
|
|
case "textarea":
|
|
|
_input=$("<textarea style=\"width: 400px; height: 90px;\"></textarea>");
|
|
|
_input.text(_param.default_value);
|
|
|
if(this.actionParam&&this.actionParam[_param.name]){
|
|
|
_input.text(this.actionParam[_param.name]);
|
|
|
}else{
|
|
|
_input.text(_param.default_value);
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
}
|
|
|
_input.attr("id",_param.name);
|
...
|
...
|
@@ -176,11 +191,10 @@ var operationEdit={ |
|
|
}
|
|
|
}
|
|
|
},
|
|
|
selectOneOption:function(_sel){
|
|
|
selectOneOption:function(selectKey){
|
|
|
var firstGroup=$("#tab_body>.row").find(".form-group:eq(0)");
|
|
|
//移除兄弟节点
|
|
|
firstGroup.nextAll().remove();
|
|
|
var selectKey=$(_sel).children('option:selected').val();
|
|
|
firstGroup.nextAll().remove();
|
|
|
var _html;
|
|
|
var _selectObj;
|
|
|
switch(selectKey){
|
...
|
...
|
@@ -220,7 +234,10 @@ var operationEdit={ |
|
|
bindEvent:function(){
|
|
|
var _g=this;
|
|
|
$(document).on('click','#save',function(){return this.save()});
|
|
|
$("#promotionType").change(function(){return _g.selectOneOption(this)});
|
|
|
$("#promotionType").change(function(){
|
|
|
var selectKey=$(this).children('option:selected').val();
|
|
|
return _g.selectOneOption(selectKey);
|
|
|
});
|
|
|
},
|
|
|
save:function(){
|
|
|
var e=this.edit;
|
...
|
...
|
|