feat: 页面编辑器支持compose复合操作(+复合按钮+标签显示)
This commit is contained in:
@@ -99,13 +99,18 @@
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
<el-button size="small" @click="addComposeEntry">+ 复合</el-button>
|
||||
<el-button v-else size="small" disabled>已全部添加</el-button>
|
||||
</div>
|
||||
<div v-if="!parsed.length" style="text-align:center;padding:40px;color:#909399">暂无,点击添加</div>
|
||||
<div v-for="(entry, idx) in parsed" :key="idx" style="margin-bottom:12px;padding:12px;border:1px solid #ebeef5;border-radius:4px;background:#fafafa">
|
||||
<div style="display:flex;gap:8px;align-items:center;margin-bottom:8px">
|
||||
<el-tag size="small" type="primary">{{ entry.key }} - {{ keyLabel(entry.key) }}</el-tag>
|
||||
<el-select v-model="entry.method" size="small" @change="syncToJson" style="width:80px">
|
||||
<el-tag size="small" :type="entry.compose ? 'warning' : 'primary'">{{ entry.key }} - {{ keyLabel(entry.key) }}</el-tag>
|
||||
<template v-if="entry.compose">
|
||||
<span style="font-size:12px;color:#b88230;margin:0 4px">→</span>
|
||||
<el-tag v-for="k in entry.compose" :key="k" size="small" type="warning" effect="plain" style="margin-right:4px">{{ k }}</el-tag>
|
||||
</template>
|
||||
<el-select v-if="!entry.compose" v-model="entry.method" size="small" @change="syncToJson" style="width:80px">
|
||||
<el-option label="GET" value="GET"/><el-option label="POST" value="POST"/>
|
||||
</el-select>
|
||||
<div style="flex:1"></div>
|
||||
@@ -310,6 +315,10 @@ const addEntryByKey = (k) => {
|
||||
parsed.value.push({ key: k.key, method: k.defaultMethod || 'GET', url: defaultUrls[k.key] || '' })
|
||||
syncToJson()
|
||||
}
|
||||
const addComposeEntry = () => {
|
||||
parsed.value.push({ key: 'sync', compose: ['profile', 'peerStats'] })
|
||||
syncToJson()
|
||||
}
|
||||
const deletePages = async () => {
|
||||
try { await ElMessageBox.confirm('删除后站点将使用默认模板','确认',{type:'warning',confirmButtonText:'确认删除'}) } catch { return }
|
||||
deleting.value = true
|
||||
|
||||
Reference in New Issue
Block a user