Authored by jack.xue

fix add type

... ... @@ -570,7 +570,7 @@
<input type="hidden" id="tx_type_action"/>
<input type="hidden" id="tx_type_id"/>
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" id="btn4type" class="btn btn-primary">确认</button>
<button type="button" id="btn4type" class="btn btn-primary" onclick="btn_click()">确认</button>
</div>
</div>
</div>
... ...
... ... @@ -208,7 +208,7 @@ var doAddType = function () {
return;
}
var isleaf = $('#cb_new_type_isleaf').prop("checked") == true ? 1 : 0;
$.get("type/add", {"pid": pid, "name": name, "isleaf": isleaf},
$.get(contextPath+"/type/add", {"pid": pid, "name": name, "isleaf": isleaf},
function (data, state) {
var repjson = JSON.parse(data);
if (state == "success" && repjson.code == 200) {
... ... @@ -239,7 +239,7 @@ var doUpdateType = function () {
return;
}
console.log("update " + id + " name " + name);
$.get("type/update", {"id": id, "name": name},
$.get(contextPath+"/type/update", {"id": id, "name": name},
function (data, state) {
var repjson = JSON.parse(data);
if (state == "success" && repjson.code == 200) {
... ... @@ -256,7 +256,7 @@ var doUpdateType = function () {
var doDelType = function () {
var id = $('#tx_type_id').val();
console.log("delete " + id);
$.get("type/del", {"id": id},
$.get(contextPath+"/type/del", {"id": id},
function (data, state) {
var repjson = JSON.parse(data);
if (state == "success" && repjson.code == 200) {
... ... @@ -303,7 +303,7 @@ var checkIsLeaf = function (nodeid) {
}
$("#btn4type").click(function () {
function btn_click() {
console.log("frw");
if ($("#tx_type_action").val() == "add") {
doAddType();
... ... @@ -314,14 +314,14 @@ $("#btn4type").click(function () {
doDelType();
}
});
};
var refreshTypeTree = function () {
var basepath = getUrlBasePath();
console.log("refresh tree");
treeData = []; //重置
$.get(basepath+"/type/all", function (data, state) {
$.get(contextPath+"/type/all", function (data, state) {
console.log(state)
var jsonData = JSON.parse(data);
$.each(jsonData.data, function (n, val) {
... ...