feat: 脚本编辑器可折叠,收起后解析结果占满全宽
This commit is contained in:
@@ -33,19 +33,26 @@
|
||||
|
||||
<!-- 主体:脚本 + 结果 -->
|
||||
<div style="display:flex;gap:12px;flex:1;min-height:0">
|
||||
<!-- 左侧:脚本编辑器 -->
|
||||
<div style="flex:0 0 440px;display:flex;flex-direction:column;min-height:0">
|
||||
<div style="font-size:13px;font-weight:500;margin-bottom:4px;display:flex;justify-content:space-between;align-items:center">
|
||||
<span>Groovy 脚本</span>
|
||||
<el-button size="small" type="primary" @click="saveScript" :loading="saving" v-if="selectedConfigId">保存</el-button>
|
||||
<!-- 左侧:脚本编辑器(可折叠) -->
|
||||
<div :style="{flex: scriptExpanded ? '0 0 440px' : '0 0 auto',display:'flex',flexDirection:'column',minHeight:0}">
|
||||
<div style="font-size:13px;font-weight:500;display:flex;justify-content:space-between;align-items:center;margin-bottom:4px">
|
||||
<span style="cursor:pointer" @click="scriptExpanded=!scriptExpanded">
|
||||
<el-icon><component :is="scriptExpanded?'ArrowLeft':'ArrowRight'" /></el-icon>
|
||||
Groovy 脚本
|
||||
</span>
|
||||
<template v-if="scriptExpanded && selectedConfigId">
|
||||
<el-button size="small" type="primary" @click="saveScript" :loading="saving">保存</el-button>
|
||||
</template>
|
||||
<el-button v-if="!scriptExpanded && selectedConfigId" size="small" type="primary" @click="saveScript" :loading="saving">保存</el-button>
|
||||
</div>
|
||||
<template v-if="scriptExpanded">
|
||||
<div style="flex:1;min-height:0;border-radius:4px;overflow:hidden">
|
||||
<CodeEditor v-model="scriptContent" />
|
||||
</div>
|
||||
<div style="font-size:10px;color:#909399;margin-top:2px">
|
||||
内置: <code>content</code> <code>url</code> <code>jsoup</code> <code>json</code> <code>utils</code>
|
||||
· 返回 Map{pageName,extracted} 或 List
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<!-- 右侧:URL卡片 -->
|
||||
@@ -126,7 +133,7 @@ import { Loading } from '@element-plus/icons-vue'
|
||||
const route = useRoute()
|
||||
const siteId = route.params.siteId
|
||||
|
||||
const loading = ref(false), parseLoading = ref(false)
|
||||
const loading = ref(false), parseLoading = ref(false), scriptExpanded = ref(true)
|
||||
const selectedConfigId = ref(null), selectedConfig = ref(null)
|
||||
const scriptContent = ref(''), saving = ref(false), approving = ref(false), rejecting = ref(false)
|
||||
const allConfigVersions = ref([]), allResults = ref([])
|
||||
|
||||
Reference in New Issue
Block a user