Authored by 姜敏

资源位-添加图标和楼层

... ... @@ -164,6 +164,23 @@ $(document).on("click", '#matchImage-addOne', function() {
});
Bll.renderDialog("matchImage-template");
});
//添加一个图标
$(document).on("click", '#icon-addOne', function() {
Bll.module.contentData.data.push({
//"title": "",
"url": {
"action": "",
"url": ""
}
});
Bll.renderDialog("icon-template");
});
//删除一个图标
$(document).on("click", '#icon-delOne', function() {
var index = $(this).data("index");
Bll.module.contentData.data.splice(index,1);
Bll.renderDialog("icon-template");
});
$(document).on("click", "#sub_btn", function() {
var data = {
... ...
<!-- 添加图标、楼层 -->
<script type="text/template" id="icon-template">
<div class="panel-body">
<div>
<table class="table table-hover table-bordered responsive dataTable no-footer">
<thead>
<tr>
<th>序号</th>
<th>图标</th>
<th>选项</th>
<th>操作</th>
</tr>
</thead>
<tbody>
[[each contentData.data as item index]]
<tr>
<td>
[[index+1]]
<!--<input type="hidden" value="[[index]]" data-field="[[index]].imgId">-->
</td>
<td><input type="file" name="file" value="[[item.src]]" class="observe" data-field="[[index]].src"/>
</td>
<td>
<div class="col-sm-12">
<label class="col-sm-2">跳转目的</label>
<select name="goTo" class="form-control observe" value="[[item.url.action]]"
data-field="[[index]].url.action">
[[layout action_template]]
</select>
</div>
<div class="col-sm-12">
<label class="col-sm-2">图片链接</label>
<input value="[[item.url.url]]" class="form-control observe" required="required"
data-field="[[index]].url.url"/>
<p style="color:#999;margin-top: 5px;">注:链接中不能有英文单引号</p>
</div>
<div class="col-sm-12">
<label class="col-sm-2">图片描述</label>
<input value="[[item.alt]]" class="form-control observe" required="required"
data-field="[[index]].alt"/>
</div>
[[if contentData.template_name=='addfloor']]
<div class="col-sm-12">
<label class="col-sm-2">英文描述</label>
<input value="[[item.altEn]]" class="form-control observe" required="required"
data-field="list.[[index]].altEn"/>
</div>
[[/if]]
</td>
<td>
<a class="btn btn-danger" id="icon-delOne" data_index="[[index]]">删除</a>
</td>
</tr>
[[/each]]
</tbody>
</table>
</div>
<a href="JavaScript:;" id="icon-addOne" class="btn btn-primary btn-xs">添加一个</a>
</div>
</script>
\ No newline at end of file
... ...