|
@@ -34,7 +34,7 @@ function getCategoryHtml(category) {
|
|
|
for (const d of data) {
|
|
|
html.push('<tr ', d.value && d.value.length > 0 ? '' : 'class="table-warning"', 'cid="' + d.id + '">');
|
|
|
html.push('<td>', d.name, '</td>');
|
|
|
- html.push('<td>', d.typeStr, '</td>');
|
|
|
+ // html.push('<td>', d.typeStr, '</td>');
|
|
|
html.push('<td>');
|
|
|
if (d.value && d.value.length > 0) {
|
|
|
for (const v of d.value) {
|
|
@@ -182,8 +182,8 @@ function bindCategoryControl() {
|
|
|
const id = parseInt($(this).attr('cid'));
|
|
|
const category = findCategory(id);
|
|
|
$('input[name=name]', '#edit-cate').val(category.name);
|
|
|
- $('div[name=type]', '#edit-cate').html(getTypeHtml());
|
|
|
- $('#inlineRadio' + category.type, '#edit-cate')[0].checked = true;
|
|
|
+ // $('div[name=type]', '#edit-cate').html(getTypeHtml());
|
|
|
+ // $('#inlineRadio' + category.type, '#edit-cate')[0].checked = true;
|
|
|
$('#edit-cate-ok').attr('cid', $(this).attr('cid'));
|
|
|
$('#edit-cate').modal('show');
|
|
|
});
|
|
@@ -195,26 +195,26 @@ function bindCategoryControl() {
|
|
|
}
|
|
|
|
|
|
$(document).ready(() => {
|
|
|
- InitCategoryData(cData);
|
|
|
+ // InitCategoryData(cData);
|
|
|
$('#categoryList').html(getCategoryHtml(cData));
|
|
|
bindCategoryControl();
|
|
|
- $('div[name=type]', '#add-cate').html(getTypeHtml());
|
|
|
+ // $('div[name=type]', '#add-cate').html(getTypeHtml());
|
|
|
// 新增分类
|
|
|
$('#add-cate-ok').click(function () {
|
|
|
const name = $('input[name=name]', '#add-cate');
|
|
|
- const type = $('input[type=radio]:checked', '#add-cate');
|
|
|
+ // const type = $('input[type=radio]:checked', '#add-cate');
|
|
|
const data = {
|
|
|
name: name.val(),
|
|
|
- type: parseInt(type.val()),
|
|
|
+ // type: parseInt(type.val()),
|
|
|
};
|
|
|
postData('/setting/category/add', data, function (data) {
|
|
|
- InitCategoryData(data);
|
|
|
+ // InitCategoryData(data);
|
|
|
$('#categoryList').append(getCategoryHtml(data));
|
|
|
bindCategoryControl();
|
|
|
cData.push(data);
|
|
|
$('#add-cate').modal('hide');
|
|
|
name.val('');
|
|
|
- type[0].checked = false;
|
|
|
+ // type[0].checked = false;
|
|
|
}, function (msg) {
|
|
|
$('#add-cate').modal('hide');
|
|
|
});
|
|
@@ -250,7 +250,7 @@ $(document).ready(() => {
|
|
|
tenders = data.tenders;
|
|
|
const category = findCategory(data.category.id);
|
|
|
category.value = data.category.value;
|
|
|
- InitCategoryData(category);
|
|
|
+ // InitCategoryData(category);
|
|
|
$('tr[cid=' + data.category.id + ']')[0].outerHTML = getCategoryHtml(category);
|
|
|
bindCategoryControl();
|
|
|
$('#add').modal('hide');
|
|
@@ -261,18 +261,18 @@ $(document).ready(() => {
|
|
|
// 编辑
|
|
|
$('#edit-cate-ok').click(function () {
|
|
|
const name = $('input[name=name]', '#edit-cate');
|
|
|
- const type = $('input[type=radio]:checked', '#edit-cate');
|
|
|
+ // const type = $('input[type=radio]:checked', '#edit-cate');
|
|
|
const data = {
|
|
|
id: parseInt($(this).attr('cid')),
|
|
|
name: name.val(),
|
|
|
- type: parseInt(type.val()),
|
|
|
+ // type: parseInt(type.val()),
|
|
|
}
|
|
|
postData('/setting/category/update', data, function (data) {
|
|
|
const category = findCategory(data.id);
|
|
|
for (const c in data) {
|
|
|
category[c] = data[c];
|
|
|
}
|
|
|
- InitCategoryData(category);
|
|
|
+ // InitCategoryData(category);
|
|
|
$('tr[cid=' + data.id + ']')[0].outerHTML = getCategoryHtml(category);
|
|
|
bindCategoryControl();
|
|
|
$('#edit-cate').modal('hide');
|
|
@@ -292,4 +292,4 @@ $(document).ready(() => {
|
|
|
$('#del-cate').modal('hide');
|
|
|
});
|
|
|
});
|
|
|
-});
|
|
|
+});
|