feat(tickets): make ticket title/content/reply length limits configurable

Add ticket_title_max / ticket_content_max / ticket_reply_max to the
users/ticket schema (PHP + SPA) with clamped TicketSettings readers.
All write paths (front REST, admin REST, note REST, native admin page)
and front-end maxlength/counters now read the configured limits.
Remove the hardcoded TICKET_CONTENT_MAX constant.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
kate522andClaude Fable 5 committed 2026-10-27 23:06:28 +08:00
1 parent 6681b0c306
commit 63ab8b8fc9
13 files changed
+71 -28

No files matched your search

@@ -8,7 +8,7 @@ export const ticketSchema = {
key: 'users.ticket',
title: '工单中心',
icon: 'fa fas fa-headset',
description: '工单功能开关、工单号前缀、提交公告与提交表单(图片上传、关联订单、催单冷却)配置;部门、状态与预设回复在本页其余分页中维护。',
description: '工单功能开关、工单号前缀、提交公告与提交表单(图片上传、关联订单、催单冷却、字数上限)配置;部门、状态与预设回复在本页其余分页中维护。',
defaults: {
ticket_s: true,
ticket_num_prefix: 'T',
@@ -18,6 +18,9 @@ export const ticketSchema = {
ticket_attachment_max: 5,
ticket_order_link_s: true,
ticket_urge_interval: 15,
ticket_title_max: 200,
ticket_content_max: 5000,
ticket_reply_max: 3000,
},
groups: [
{
@@ -40,6 +43,9 @@ export const ticketSchema = {
{ key: 'ticket_attachment_max', label: '单个工单图片上限', type: 'number', default: 5, min: 1, max: 9, help: '工单内容与每条回复各自可上传的图片数量上限' },
{ key: 'ticket_order_link_s', label: '允许关联订单', type: 'switch', default: true, help: '开启后新建工单时可选择关联本人一个已支付订单;关闭后工单与订单完全解耦' },
{ key: 'ticket_urge_interval', label: '催单冷却(分钟)', type: 'number', default: 15, min: 1, max: 1440, help: '同一工单两次催单之间的最小间隔' },
{ key: 'ticket_title_max', label: '标题字数上限', type: 'number', default: 200, min: 10, max: 200, help: '工单标题最多可输入的字数(前台提交与后台代客提交共用)' },
{ key: 'ticket_content_max', label: '问题描述字数上限', type: 'number', default: 5000, min: 100, max: 16000, help: '新建工单时问题描述最多可输入的字数(前台提交与后台代客提交共用)' },
{ key: 'ticket_reply_max', label: '回复字数上限', type: 'number', default: 3000, min: 100, max: 16000, help: '用户与客服每条回复(含后台内部备注)最多可输入的字数' },
],
},
],