diff --git a/superadmin/application/admin/controller/Mattertemplatecategorizedcontent.php b/superadmin/application/admin/controller/Mattertemplatecategorizedcontent.php index 8b385ee..940ebd4 100644 --- a/superadmin/application/admin/controller/Mattertemplatecategorizedcontent.php +++ b/superadmin/application/admin/controller/Mattertemplatecategorizedcontent.php @@ -136,12 +136,15 @@ class Mattertemplatecategorizedcontent extends Backend $dataList = []; $inputInfo = []; foreach($params['inputInfo'] as $key=>$value){ - if (!empty($value['name'])){ - $inputInfo[$value['name']] = $value['value']; - } $inputInfo['mattertemplatecategorization_id'] = $params['mattertemplatecategorization_id']; $inputInfo['create_time'] = $params['create_time']; $inputInfo['update_time'] = date('Y-m-d H:i:s'); + if (!empty($value['name'])){ + $inputInfo[$value['name']] = $value['value']; + if ($value['name'] == 'id'){ + unset($inputInfo['id']); + } + } if (($key+1)%5==0){ $dataList[] = $inputInfo; $inputInfo = []; diff --git a/superadmin/application/admin/view/mattertemplatecategorizedcontent/add.html b/superadmin/application/admin/view/mattertemplatecategorizedcontent/add.html index 44c06dc..03f927f 100644 --- a/superadmin/application/admin/view/mattertemplatecategorizedcontent/add.html +++ b/superadmin/application/admin/view/mattertemplatecategorizedcontent/add.html @@ -10,7 +10,7 @@
- +
@@ -22,10 +22,10 @@
- +
- +
@@ -42,7 +42,6 @@
-
@@ -69,4 +68,41 @@
+ diff --git a/superadmin/application/admin/view/mattertemplatecategorizedcontent/edit.html b/superadmin/application/admin/view/mattertemplatecategorizedcontent/edit.html index 9a0ac98..0103c8b 100644 --- a/superadmin/application/admin/view/mattertemplatecategorizedcontent/edit.html +++ b/superadmin/application/admin/view/mattertemplatecategorizedcontent/edit.html @@ -24,7 +24,7 @@
- +
@@ -46,6 +46,12 @@
{/foreach} +
+ +
+ +
+
@@ -64,4 +70,42 @@
+ diff --git a/superadmin/public/assets/js/backend/mattertemplatecategorizedcontent.js b/superadmin/public/assets/js/backend/mattertemplatecategorizedcontent.js index 6a52a99..dc737cb 100644 --- a/superadmin/public/assets/js/backend/mattertemplatecategorizedcontent.js +++ b/superadmin/public/assets/js/backend/mattertemplatecategorizedcontent.js @@ -39,30 +39,18 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin }, add: function () { $('#add-form,#edit-form').on('click', '.shili_huashu_btn', function () { - let txt = $(this).closest('.form_group_add').find('.c-hui-fang-yao-dian'); + var that = $(this); + let txt = that.closest('.form_group_add').find('.c-hui-fang-yao-dian'); + $.post('ai/talk_skill',{txt:txt.val()},function (res) { // layer.close(load_index); //回显 - $(this).closest('.form_group_add').find('.c-content').val(res.data); + that.closest('.form_group_add').find('.c-content').val(res.data); },'json'); }); - // $('.shili_huashu_btn').on('click',function (e){ - // //读取下拉框的值 - // var groupdiv=$('.shili_huashu_btn').parent().parent().find('form_group_add'); - // console.log($(this).parent().find('.c-hui-fang-yao-dian').val()); - // let txt = $('.c-hui-fang-yao-dian').val(); - // console.log(txt); - // // console.log(e); - // // let load_index = layer.load(1); - // $.post('ai/talk_skill',{txt:txt},function (res) { - // // layer.close(load_index); - // //回显 - // $('.c-content').val(res.data); - // },'json'); - // }); $('#c-add_group_content').on('click',function (res){ res.preventDefault(); - var html = $('.form_group_add').html(); + var html = $('.form_group_add_noshow').html(); html = "
"+html+"
"; $('#c-add_group_last_div').before(html); @@ -117,9 +105,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin // layer.close(load_index); //回显 if (res.code == 1){ - layer.msg('添加成功'); + layer.msg('修改成功'); }else { - layer.msg('添加失败'); + layer.msg('修改失败'); } },'json'); });