diff --git a/view/templates/admin/formula_list.html b/view/templates/admin/formula_list.html index 7642820..7f901eb 100644 --- a/view/templates/admin/formula_list.html +++ b/view/templates/admin/formula_list.html @@ -107,7 +107,9 @@ {/foreach}
用法:{$item.method}
- {if $item.remark}
备注:{$item.remark}
{/if} +
+ 备注: 保存 +
{if $item.uid==0} @@ -239,6 +241,38 @@ }); } + function saveRemark(id){ + let remark = $('.remark_'+id).val(); + const data = { + id: id, + remark: remark, + }; + + $.ajax({ + url: '/admin/ajax_update_formula', // 替换为你的服务器端处理文件 + type: 'POST', + data: data, + dataType: 'json', + success: function (response) { + if (response.status == true) { + showAlert('保存成功') + return true; + } + + if(response.data.code == 40002){ + showAlert('请登录','/admin/login') + return true; + } + + showAlert(response.info) + }, + error: function (xhr, status, error) { + console.error('错误:', response); + alert('提交失败,请重试。'); + } + }); + } + function adjustFlexWidth(container) { const items = container.querySelectorAll('.item'); let maxWidth = 0;