Authored by 陶雨

帮助内容修改分类名称显示逻辑及添加添加编辑提示

var $ = require('jquery'),
common = require('../common/common');
common = require('../common/common'),
util = require('../common/util');
new common.dropDown({el: "#help-categoryId", "ajax": "getHelpCategory"});
new common.dropDown({el: "#help-platform"});
var ENUM = {
id:{}
id:[]
};
var g = new common.grid({
... ... @@ -21,7 +22,7 @@ var $ = require('jquery'),
{display: "编号", name: "id"},
{display: "标题", name: "title"},
{display: "分类", name: "categoryId", render: function(item) {
return ENUM.id[item.id];
return ENUM.id[item.categoryId];
}},
{display: "平台", name: "platform", render: function(item) {
if(item.platform != null && item.platform.trim() != "") {
... ... @@ -53,10 +54,11 @@ var $ = require('jquery'),
for(var i = 0; i < list.length; i++) {
ENUM.id[list[i].id] = list[i].categoryName;
}
g.init('/operations/helpcontent/getAllHelpContent');
},function() {
g.init('/operations/helpcontent/getAllHelpContent');
},true);
g.init('/operations/helpcontent/getAllHelpContent');
var Bll = {
toast:function(url, item, hint) {
var e = new common.edit("#baseform");
... ... @@ -65,8 +67,12 @@ var $ = require('jquery'),
common.util.__template($("#template").html(), item),
function() {
e.submit(url, function (option) {
option.data.categoryId = item.categoryId;
option.success=function() {
option.success=function(res) {
if(res.data.code == 200) {
util.__tip(res.data.message, "success");
} else {
util.__tip(res.data.message);
}
g.reload();
};
option.error=function(){};
... ... @@ -77,7 +83,7 @@ var $ = require('jquery'),
new common.dropDown({el: "#categoryId", "ajax": "getByCategoryId"});
if(hint == "修改内容") {
$("#select2-categoryId-container").html(ENUM.id[item.id]);
$("#select2-categoryId-container").html(ENUM.id[item.categoryId]);
}
}
};
... ...
... ... @@ -59,7 +59,7 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="helpContent">帮助内容</label>
<label class="col-sm-2 control-label" for="content">帮助内容</label>
<div class="col-sm-10">
<input type="text" value="{content}" class="form-control" id="content" required="required" />
</div>
... ... @@ -68,7 +68,7 @@
<label class="col-sm-2 control-label" for="categoryId">分类</label>
<div class="col-sm-10">
<select id="categoryId" style="width: 280px;" value="{categoryId}">
<option value="-1">请选择分类</option>
<option value="{categoryId}">请选择分类</option>
</select>
</div>
</div>
... ...