fix(manuscript): 稿件类型收敛到上游 doc_type 枚举
与 admin 同一处病根:picker 把界面标签直接当 doc_type 下发, 而「公众号推文」「宣传稿」「发言稿」「短视频脚本」上游一个都不认, 选中就是一次必失败的提交。 - 选项收敛为 新闻稿 / 活动总结 / 微信推文 / 通知公告(外加「自由创作」) - picker 拆成 label / value 两份:界面仍显示「公众号推文」,下发「微信推文」 - 快捷模板「发言稿提纲」换成「通知公告」,补对应示例内容
This commit is contained in:
@@ -4,11 +4,11 @@
|
||||
<view class="hero-card">
|
||||
<view class="hero-kicker">AI CONTENT STUDIO</view>
|
||||
<view class="hero-title">AI 内容创作与宣传助手</view>
|
||||
<view class="hero-desc">写新闻稿、推文、发言稿,或直接说明你的需求,AI 先给出一份初稿。</view>
|
||||
<view class="hero-desc">写新闻稿、活动总结、公众号推文或通知公告,说清需求就行,AI 先给出一份初稿。</view>
|
||||
<view class="hero-actions">
|
||||
<view class="hero-action" @tap="fillDemo('news')">活动新闻稿</view>
|
||||
<view class="hero-action" @tap="fillDemo('wechat')">公众号推文</view>
|
||||
<view class="hero-action" @tap="fillDemo('speech')">发言稿提纲</view>
|
||||
<view class="hero-action" @tap="fillDemo('notice')">通知公告</view>
|
||||
<view class="hero-action" @tap="fillDemo('free')">自由创作示例</view>
|
||||
<view class="hero-action hero-action--primary" @tap="goChatPage">进入问答助手</view>
|
||||
</view>
|
||||
@@ -21,7 +21,7 @@
|
||||
<view class="field-label">稿件类型</view>
|
||||
<picker mode="selector" :range="docTypeLabels" :value="docTypeIndex" @change="handleDocTypeChange">
|
||||
<view class="field-picker">
|
||||
<text class="field-value">{{ form.docType || '请选择稿件类型' }}</text>
|
||||
<text class="field-value">{{ docTypeLabel || '请选择稿件类型' }}</text>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
@@ -207,7 +207,19 @@
|
||||
|
||||
const DOC_TYPE_FREE = '自由创作'
|
||||
// 「自由创作」是默认项:不选具体模板时只填一段内容,后端转「AI 创意助手」。
|
||||
const DOC_TYPE_OPTIONS = [DOC_TYPE_FREE, '新闻稿', '公众号推文', '宣传稿', '活动总结', '发言稿', '短视频脚本']
|
||||
// 其余选项必须与上游「内容创作与宣传助手」的 doc_type 枚举逐一对应:
|
||||
// 新闻稿 / 活动总结 / 微信推文 / 通知公告。上游没有的文体(宣传稿、发言稿、
|
||||
// 短视频脚本)一律不提供 —— 下发过去只会换来一次必失败的提交。
|
||||
// label 给学生看的叫法,value 是真正下发的 doc_type。
|
||||
const DOC_TYPE_ITEMS = [
|
||||
{ label: '自由创作(不套模板)', value: DOC_TYPE_FREE },
|
||||
{ label: '新闻稿', value: '新闻稿' },
|
||||
{ label: '活动总结', value: '活动总结' },
|
||||
{ label: '公众号推文', value: '微信推文' },
|
||||
{ label: '通知公告', value: '通知公告' }
|
||||
]
|
||||
const DOC_TYPE_OPTIONS = DOC_TYPE_ITEMS.map((item) => item.label)
|
||||
const DOC_TYPE_VALUES = DOC_TYPE_ITEMS.map((item) => item.value)
|
||||
const EVENT_TYPE_OPTIONS = ['校园活动', '志愿服务', '会议论坛', '社会实践', '文体活动', '品牌项目']
|
||||
|
||||
const createDefaultForm = () => ({
|
||||
@@ -240,9 +252,14 @@
|
||||
},
|
||||
computed: {
|
||||
docTypeIndex() {
|
||||
const index = this.docTypeLabels.indexOf(this.form.docType)
|
||||
const index = DOC_TYPE_VALUES.indexOf(this.form.docType)
|
||||
return index > -1 ? index : 0
|
||||
},
|
||||
docTypeLabel() {
|
||||
// 选中项显示 label,而不是下发的 doc_type(如「公众号推文」→「微信推文」)
|
||||
const index = DOC_TYPE_VALUES.indexOf(this.form.docType)
|
||||
return index > -1 ? DOC_TYPE_OPTIONS[index] : this.form.docType
|
||||
},
|
||||
eventTypeIndex() {
|
||||
const index = this.eventTypeLabels.indexOf(this.form.eventType)
|
||||
return index > -1 ? index : 0
|
||||
@@ -279,7 +296,7 @@
|
||||
},
|
||||
handleDocTypeChange(event) {
|
||||
const index = Number(event.detail.value)
|
||||
this.form.docType = this.docTypeLabels[index] || this.form.docType
|
||||
this.form.docType = DOC_TYPE_VALUES[index] || this.form.docType
|
||||
},
|
||||
handleEventTypeChange(event) {
|
||||
const index = Number(event.detail.value)
|
||||
@@ -555,7 +572,7 @@
|
||||
}
|
||||
if (type === 'wechat') {
|
||||
this.form.theme = '青春集结!这场校园科技文化节亮点抢先看'
|
||||
this.form.docType = '公众号推文'
|
||||
this.form.docType = '微信推文'
|
||||
this.form.eventType = '校园活动'
|
||||
this.form.time = '2026年4月中旬'
|
||||
this.form.location = '大学生活动中心'
|
||||
@@ -564,14 +581,14 @@
|
||||
this.form.number = '1200'
|
||||
return
|
||||
}
|
||||
this.form.theme = '在学校共青团工作会议上的发言提纲'
|
||||
this.form.docType = '发言稿'
|
||||
this.form.eventType = '会议论坛'
|
||||
this.form.time = '2026年春季学期工作会议'
|
||||
this.form.location = '学校综合楼报告厅'
|
||||
this.form.participants = '各学院团委书记、团干部代表'
|
||||
this.form.highlights = '总结上阶段工作,分析问题不足,部署下一阶段思想引领、基层组织建设和实践育人重点任务。'
|
||||
this.form.number = '1500'
|
||||
this.form.theme = '关于举办2026年广西医科大学青年志愿服务项目大赛的通知'
|
||||
this.form.docType = '通知公告'
|
||||
this.form.eventType = '志愿服务'
|
||||
this.form.time = '2026年4月10日至5月20日'
|
||||
this.form.location = '各学院团委、大学生活动中心'
|
||||
this.form.participants = '全校各团支部、青年志愿者服务队'
|
||||
this.form.highlights = '说明报名条件、赛程安排、材料提交截止时间和联系方式,语气正式、条目清晰。'
|
||||
this.form.number = '600'
|
||||
},
|
||||
async chooseFiles() {
|
||||
if (this.uploading) {
|
||||
|
||||
Reference in New Issue
Block a user