Authored by weiqingting

提交

... ... @@ -186,6 +186,7 @@ edit.prototype = {
$(this).attr("value", response.data);
that.__listen("callback", {
key: "file_onComplete_" + $(this).attr("id"),
field: $(this).data("field"),
data: response.data
});
} else {
... ...
... ... @@ -299,7 +299,7 @@ var util = {
if(arr.length){
if(/^\d+$/.test(name)){
var objArr=$.extend(true,{},obj);
if($.inArray(obj)){
if($.isArray(obj)){
obj=[];
}
obj[name] = objArr[name] || {};
... ...
... ... @@ -104,7 +104,8 @@ var Bll = {
if (/^file_onComplete/.test(obj.key)) {
//(!!~index?index:0)
var _field = obj.key.replace(/^file_onComplete_file__/, '').split('-');
Bll.module.data[_field[1]].src = obj.data;
// Bll.module.data[_field[1]].src = obj.data;
}
});
},
... ... @@ -314,12 +315,13 @@ $(document).on("click", ".del", function() {
$(document).on("change", ".observe", function() {
var $this = $(this);
var name = $this.data("field"),
index = $this.data("index");
var module = (index == undefined) ? Bll.module.data : Bll.module.data[index];
common.util.__buildobj(name, '.', module, function(obj, name) {
var name = $this.data("field");
// index = $this.data("index");
// var module = (index == undefined) ? Bll.module.data : Bll.module.data[index];
Bll.module.data=common.util.__buildobj(name, '.', Bll.module.data, function(obj, name) {
obj[name] = $this.val();
});
console.log("module",Bll.module.data);
});
$(document).on("click", ".edit", function() {
... ... @@ -511,7 +513,10 @@ $(document).on("click", "#submit", function() {
/*测试*/
var AAA={};
var bbb=common.util.__buildobj("a.0.b",".",AAA,function(obj,name){
AAA=common.util.__buildobj("0.b",".",AAA,function(obj,name){
obj[name]="1";
});
AAA=common.util.__buildobj("1.b",".",AAA,function(obj,name){
obj[name]="1";
});
console.log(bbb);
\ No newline at end of file
console.log(AAA);
\ No newline at end of file
... ...
... ... @@ -341,7 +341,7 @@
[[each data as item index]]
<tr>
<td>[[index+1]]</td>
<td><input type="file" name="file" id="src-[[index]]" value="[[item.src]]" data-index="[[index]]" /></td>
<td><input type="file" name="file" id="src-[[index]]" value="[[item.src]]" data-field="[[index]].src" data-index="[[index]]" /></td>
</tr>
[[/each]]
</tbody>
... ... @@ -481,7 +481,7 @@
<div class="form-group">
<label class="col-sm-2 control-label">选择跳转目的地:</label>
<div class="col-sm-8">
<select class="form-control observe" data-index="0" data-field="url.action" value='[[data[0].url.action]]'>
<select class="form-control observe" data-field="0.url.action" value='[[data[0].url.action]]'>
[[layout template_default_1]]
</select>
... ... @@ -491,7 +491,7 @@
<div class="form-group">
<label class="col-sm-2 control-label">跳转地址:</label>
<div class="col-sm-8">
<textarea rows="2" class="form-control observe" placeholder="跳转地址" data-field="url.url" data-index="0">[[data[0].url.url]]</textarea>
<textarea rows="2" class="form-control observe" placeholder="跳转地址" data-field="0.url.url" >[[data[0].url.url]]</textarea>
</div>
</div>
... ...