fix(群级配置): 增加结构化表单快捷入口并补充引导提示
This commit is contained in:
@@ -61,6 +61,14 @@
|
||||
|
||||
<el-dialog :title="editing ? '编辑配置' : '新增配置'" :visible.sync="dialogVisible" width="720px">
|
||||
<el-form label-width="95px">
|
||||
<el-form-item label="快捷模板">
|
||||
<div class="quick-actions">
|
||||
<el-button size="mini" type="primary" plain @click="useWelcomeTemplate">
|
||||
进群欢迎表单模板
|
||||
</el-button>
|
||||
<span class="quick-tip">点击后自动切换到“群成员变更监控 / welcome”标准表单</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="群ID">
|
||||
<el-select v-model="form.group_id" filterable placeholder="请选择群" style="width:100%">
|
||||
<el-option v-for="item in groupOptions" :key="item.wxid" :label="item.name" :value="item.wxid"></el-option>
|
||||
@@ -83,6 +91,12 @@
|
||||
<el-radio-button label="advanced">高级JSON</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-alert
|
||||
v-if="!isWelcomeTemplateForm"
|
||||
type="info"
|
||||
:closable="false"
|
||||
title="当前不是结构化模板配置。将插件设为“群成员变更监控”且配置键为“welcome”即可显示标准表单。">
|
||||
</el-alert>
|
||||
|
||||
<template v-if="isWelcomeTemplateForm && editorMode === 'simple'">
|
||||
<div class="form-tip">
|
||||
@@ -313,6 +327,12 @@ new Vue({
|
||||
this.applyWelcomeDefaults()
|
||||
this.dialogVisible = true
|
||||
},
|
||||
useWelcomeTemplate() {
|
||||
this.form.plugin_name = '群成员变更监控'
|
||||
this.form.config_key = 'welcome'
|
||||
this.editorMode = 'simple'
|
||||
this.applyWelcomeDefaults()
|
||||
},
|
||||
openEdit(row) {
|
||||
this.editing = true
|
||||
this.form = {
|
||||
@@ -395,5 +415,7 @@ new Vue({
|
||||
.form-tip code{display:inline-block;margin-right:6px;background:#eef6ff;border:1px solid #d2e6ff;color:#12539a;padding:1px 6px;border-radius:6px;font-size:12px}
|
||||
.preview-box{padding:12px;border:1px dashed #c7d8ea;background:#f8fbff;border-radius:10px;color:#3f5c77;line-height:1.7}
|
||||
.preview-box p{margin:0 0 4px 0}
|
||||
.quick-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
|
||||
.quick-tip{font-size:12px;color:#64748b}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user