1
This commit is contained in:
@@ -5,13 +5,15 @@
|
||||
<el-form-item label="输入指令">
|
||||
<el-input v-model="form.command" type="textarea" :rows="8" placeholder="💰💰💰💰💰💰💰💰" />
|
||||
</el-form-item>
|
||||
<div class="button-group button-group-primary">
|
||||
<div class="button-group button-group-primary" :class="{ 'is-mobile-compact': isMobile }">
|
||||
<el-button type="success" size="medium" @click="run" :loading="loading">执行</el-button>
|
||||
<el-button type="danger" size="medium" @click="clearAll">清空</el-button>
|
||||
<el-button size="warning" @click="fillMan">慢单</el-button>
|
||||
<el-button size="success" @click="fillSheng">通用格式</el-button>
|
||||
<template v-if="!isMobile">
|
||||
<el-button size="warning" @click="fillMan">慢单</el-button>
|
||||
<el-button size="success" @click="fillSheng">通用格式</el-button>
|
||||
</template>
|
||||
</div>
|
||||
<div class="button-group button-group-secondary">
|
||||
<div v-if="!isMobile" class="button-group button-group-secondary">
|
||||
<el-button type="primary" size="medium" @click="fillTF">腾峰</el-button>
|
||||
<el-button type="primary" size="medium" @click="fillFan">凡</el-button>
|
||||
<!-- <el-button type="primary" size="medium" @click="fillWen">纹</el-button> -->
|
||||
@@ -60,27 +62,33 @@
|
||||
<el-divider>历史消息记录</el-divider>
|
||||
|
||||
<div class="history-controls">
|
||||
<span class="history-label">显示条数:</span>
|
||||
<el-select v-model="historyLimit" size="small" style="width: 120px;" @change="loadHistory">
|
||||
<el-option label="10条" :value="10"></el-option>
|
||||
<el-option label="20条" :value="20"></el-option>
|
||||
<el-option label="50条" :value="50"></el-option>
|
||||
<el-option label="100条" :value="100"></el-option>
|
||||
<el-option label="200条" :value="200"></el-option>
|
||||
<el-option label="500条" :value="500"></el-option>
|
||||
<el-option label="1000条" :value="1000"></el-option>
|
||||
</el-select>
|
||||
<span class="history-label history-search-label">搜索匹配:</span>
|
||||
<el-input
|
||||
v-model="historySearchKeyword"
|
||||
size="small"
|
||||
placeholder="输入关键词,在全部历史数据中搜索"
|
||||
clearable
|
||||
style="width: 240px;"
|
||||
prefix-icon="el-icon-search"
|
||||
@input="onHistorySearchInput"
|
||||
/>
|
||||
<span v-if="historySearchKeyword.trim()" class="history-search-tip">(在全部数据中匹配)</span>
|
||||
<div class="history-field history-field-limit">
|
||||
<span class="history-label">显示条数</span>
|
||||
<el-select v-model="historyLimit" size="small" class="history-limit-select" @change="loadHistory">
|
||||
<el-option label="10条" :value="10"></el-option>
|
||||
<el-option label="20条" :value="20"></el-option>
|
||||
<el-option label="50条" :value="50"></el-option>
|
||||
<el-option label="100条" :value="100"></el-option>
|
||||
<el-option label="200条" :value="200"></el-option>
|
||||
<el-option label="500条" :value="500"></el-option>
|
||||
<el-option label="1000条" :value="1000"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="history-field history-field-search">
|
||||
<span class="history-label">搜索匹配</span>
|
||||
<div class="history-search-input-wrap">
|
||||
<el-input
|
||||
v-model="historySearchKeyword"
|
||||
size="small"
|
||||
placeholder="关键词,搜索全部历史"
|
||||
clearable
|
||||
class="history-search-input"
|
||||
prefix-icon="el-icon-search"
|
||||
@input="onHistorySearchInput"
|
||||
/>
|
||||
</div>
|
||||
<span v-if="historySearchKeyword.trim()" class="history-search-tip">全部数据中匹配</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="history-container">
|
||||
@@ -846,6 +854,10 @@ export default {
|
||||
width: 100% !important;
|
||||
max-width: 100% !important;
|
||||
}
|
||||
|
||||
.button-group-primary.is-mobile-compact {
|
||||
grid-template-columns: repeat(2, 1fr) !important;
|
||||
}
|
||||
|
||||
/* 次要按钮组:腾峰、凡、纹、鸿、拼多多、拼多多-纹 - 每行4个 */
|
||||
.button-group-secondary {
|
||||
@@ -872,7 +884,9 @@ export default {
|
||||
/* 历史记录控制条 */
|
||||
.history-controls {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
align-items: flex-end;
|
||||
gap: 12px 20px;
|
||||
margin-top: 16px;
|
||||
margin-bottom: 12px;
|
||||
padding: 12px 16px;
|
||||
@@ -881,21 +895,56 @@ export default {
|
||||
border: 1px solid #DCDFE6;
|
||||
}
|
||||
|
||||
.history-field {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.history-field-limit .history-limit-select {
|
||||
width: 120px;
|
||||
}
|
||||
|
||||
.history-field-search {
|
||||
flex: 1;
|
||||
min-width: 220px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.history-search-input-wrap {
|
||||
flex: 1;
|
||||
min-width: 160px;
|
||||
}
|
||||
|
||||
.history-search-input-wrap ::v-deep .el-input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.history-label {
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
margin-right: 12px;
|
||||
font-weight: 500;
|
||||
white-space: nowrap;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.history-search-label {
|
||||
margin-left: 16px;
|
||||
.history-label::after {
|
||||
content: ':';
|
||||
}
|
||||
|
||||
.history-search-tip {
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
margin-left: 8px;
|
||||
flex-basis: 100%;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
/* 桌面:搜索提示与输入同一行时不占满宽 */
|
||||
.history-field-search .history-search-tip {
|
||||
flex-basis: auto;
|
||||
margin-top: 0;
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
/* 历史消息容器 */
|
||||
@@ -922,14 +971,42 @@ export default {
|
||||
|
||||
.history-controls {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 10px;
|
||||
padding: 10px 12px;
|
||||
align-items: stretch;
|
||||
gap: 14px;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
|
||||
.history-field {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
gap: 6px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.history-field-limit .history-limit-select {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.history-field-search {
|
||||
min-width: 0;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.history-search-input-wrap {
|
||||
min-width: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.history-label {
|
||||
margin-right: 0;
|
||||
margin-bottom: 0;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.history-field-search .history-search-tip {
|
||||
flex-basis: auto;
|
||||
margin-left: 0;
|
||||
margin-top: 4px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
</mobile-search-form>
|
||||
|
||||
<!-- 操作按钮区域(移动端单独显示) -->
|
||||
<div class="action-buttons-section mobile-only">
|
||||
<div v-if="actionButtons.length" class="action-buttons-section mobile-only">
|
||||
<mobile-button-group
|
||||
:buttons="actionButtons"
|
||||
:primary-count="2"
|
||||
@@ -1190,11 +1190,9 @@ export default {
|
||||
return has ? t : ''
|
||||
},
|
||||
actionButtons() {
|
||||
// 移动端只保留推送监控按钮
|
||||
// 移动端不展示顶部工具按钮(统一用底部导航与各页内操作)
|
||||
if (this.isMobile) {
|
||||
return [
|
||||
{ key: 'monitor', label: '推送监控', type: 'success', icon: 'el-icon-monitor', handler: () => { this.showPushMonitor = true } }
|
||||
]
|
||||
return []
|
||||
}
|
||||
// 桌面端显示所有按钮
|
||||
return [
|
||||
|
||||
@@ -1,39 +1,13 @@
|
||||
<template>
|
||||
<div class="xianyu-wenan-container">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<div slot="header">
|
||||
<span class="card-title">
|
||||
<i class="el-icon-edit-outline"></i>
|
||||
闲鱼文案(手动)
|
||||
</span>
|
||||
<el-button
|
||||
style="float: right; padding: 3px 0"
|
||||
type="text"
|
||||
@click="showHelp = !showHelp">
|
||||
{{ showHelp ? '隐藏帮助' : '显示帮助' }}
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<el-collapse-transition>
|
||||
<div v-show="showHelp" class="help-section">
|
||||
<el-alert
|
||||
title="使用说明"
|
||||
type="info"
|
||||
:closable="false"
|
||||
show-icon>
|
||||
<div slot="default">
|
||||
<p><strong>功能说明:</strong></p>
|
||||
<ul>
|
||||
<li>不依赖 JD 接口,手动输入标题即可生成闲鱼文案,用于接口限流时的应急</li>
|
||||
<li>一键生成「代下单」和「教你下单」两种文案</li>
|
||||
<li>标题和型号会自动清洗敏感词(以旧、政府、换新等)</li>
|
||||
<li>支持可选备注(型号),会拼在标题后参与生成</li>
|
||||
</ul>
|
||||
</div>
|
||||
</el-alert>
|
||||
</div>
|
||||
</el-collapse-transition>
|
||||
|
||||
<div class="input-section">
|
||||
<el-form
|
||||
:model="form"
|
||||
@@ -51,9 +25,19 @@
|
||||
<el-form-item label="型号/备注">
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
placeholder="选填,如型号、规格等,会拼在标题后"
|
||||
placeholder="选填,如型号、规格等,会拼在标题后(生成种草时必填)"
|
||||
clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-checkbox v-model="form.generateSeedNote">同时生成种草文案(AI)</el-checkbox>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.generateSeedNote" label="商品类型" required>
|
||||
<el-input
|
||||
v-model="form.goodsType"
|
||||
placeholder="种草必填,如:冰箱、空调、洗衣机"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
@@ -72,7 +56,33 @@
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div v-if="result.daixiadan || result.jiaonixiadan" class="result-section">
|
||||
<el-alert
|
||||
v-if="result.seedNoteError"
|
||||
:title="result.seedNoteError"
|
||||
type="warning"
|
||||
:closable="false"
|
||||
show-icon
|
||||
class="seed-error-alert"
|
||||
/>
|
||||
|
||||
<div v-if="result.daixiadan || result.jiaonixiadan || result.seedNote" class="result-section">
|
||||
<el-row v-if="result.seedNote" :gutter="gutter" class="seed-row">
|
||||
<el-col :span="24">
|
||||
<el-card shadow="hover" class="result-card">
|
||||
<div slot="header" class="result-card-header">
|
||||
<span class="result-card-title">种草文案(AI)</span>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
class="btn-copy"
|
||||
@click="copyResult('seedNote')">
|
||||
<i class="el-icon-document-copy"></i> 复制
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="result-content">{{ result.seedNote }}</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="gutter">
|
||||
<el-col :xs="24" :sm="24" :md="12">
|
||||
<el-card shadow="hover" class="result-card">
|
||||
@@ -117,14 +127,17 @@ export default {
|
||||
name: 'XianyuWenan',
|
||||
data() {
|
||||
return {
|
||||
showHelp: false,
|
||||
form: {
|
||||
title: '',
|
||||
remark: ''
|
||||
remark: '',
|
||||
generateSeedNote: false,
|
||||
goodsType: ''
|
||||
},
|
||||
result: {
|
||||
daixiadan: '',
|
||||
jiaonixiadan: ''
|
||||
jiaonixiadan: '',
|
||||
seedNote: '',
|
||||
seedNoteError: ''
|
||||
},
|
||||
generating: false,
|
||||
mobile: false,
|
||||
@@ -161,6 +174,8 @@ export default {
|
||||
handleClearInput() {
|
||||
this.form.title = ''
|
||||
this.form.remark = ''
|
||||
this.form.generateSeedNote = false
|
||||
this.form.goodsType = ''
|
||||
this.$message.success('已清空输入')
|
||||
},
|
||||
async handleGenerate() {
|
||||
@@ -169,18 +184,47 @@ export default {
|
||||
this.$message.warning('请输入商品标题')
|
||||
return
|
||||
}
|
||||
if (this.form.generateSeedNote) {
|
||||
const remark = (this.form.remark || '').trim()
|
||||
const goodsType = (this.form.goodsType || '').trim()
|
||||
if (!remark) {
|
||||
this.$message.warning('生成种草时需要填写型号/备注')
|
||||
return
|
||||
}
|
||||
if (!goodsType) {
|
||||
this.$message.warning('请填写商品类型')
|
||||
return
|
||||
}
|
||||
}
|
||||
this.generating = true
|
||||
this.result.seedNote = ''
|
||||
this.result.seedNoteError = ''
|
||||
try {
|
||||
const res = await generateXianyuWenan({
|
||||
const payload = {
|
||||
title: title,
|
||||
remark: (this.form.remark || '').trim() || undefined
|
||||
})
|
||||
}
|
||||
if (this.form.generateSeedNote) {
|
||||
payload.goods_title = title
|
||||
payload.goods_model = (this.form.remark || '').trim()
|
||||
payload.goods_type = (this.form.goodsType || '').trim()
|
||||
payload.generateSeedNote = true
|
||||
}
|
||||
const res = await generateXianyuWenan(payload)
|
||||
if (res.code === 200 && res.data) {
|
||||
const data = res.data
|
||||
if (data.success) {
|
||||
this.result.daixiadan = data.daixiadan || ''
|
||||
this.result.jiaonixiadan = data.jiaonixiadan || ''
|
||||
this.$message.success('生成成功')
|
||||
this.result.seedNote = (data.seedNote || '').trim()
|
||||
this.result.seedNoteError = data.seedNoteError || ''
|
||||
if (this.result.seedNote) {
|
||||
this.$message.success('生成成功')
|
||||
} else if (this.result.seedNoteError) {
|
||||
this.$message.warning('种草未生成:' + this.result.seedNoteError)
|
||||
} else {
|
||||
this.$message.success('生成成功')
|
||||
}
|
||||
} else {
|
||||
this.$message.error(data.error || '生成失败')
|
||||
}
|
||||
@@ -242,9 +286,6 @@ export default {
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
}
|
||||
.help-section {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.input-section {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
@@ -281,6 +322,12 @@ export default {
|
||||
.btn-clear {
|
||||
margin-left: 12px;
|
||||
}
|
||||
.seed-error-alert {
|
||||
margin: 0 0 16px;
|
||||
}
|
||||
.seed-row {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
/* 移动端适配 */
|
||||
@media (max-width: 767px) {
|
||||
@@ -301,12 +348,6 @@ export default {
|
||||
.card-title {
|
||||
font-size: 15px;
|
||||
}
|
||||
.help-section {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
.help-section ::v-deep .el-alert__content {
|
||||
font-size: 13px;
|
||||
}
|
||||
.input-section {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user