refactor: 查看默认模板改用CodeEditor替代pre/alert

This commit is contained in:
mediabot-pt
2026-07-05 18:54:56 +08:00
parent ba7230401c
commit 9cf6274656
3 changed files with 28 additions and 7 deletions

View File

@@ -74,6 +74,12 @@
</div>
</div>
</el-card>
<el-dialog v-model="viewVisible" :title="'默认模板: '+viewType" width="700px">
<div style="height:400px;border-radius:4px;overflow:hidden">
<CodeEditor v-model="viewJson" language="json" readonly />
</div>
</el-dialog>
</div>
</template>
@@ -165,8 +171,12 @@ const editDefault = (dt) => {
window.scrollTo({top: document.body.scrollHeight, behavior:'smooth'})
}
const viewVisible = ref(false), viewType = ref(''), viewJson = ref('')
const previewDefault = (dt) => {
ElMessageBox.alert(JSON.stringify(dt.entries, null, 2), dt.type + ' 默认模板')
viewType.value = dt.type
viewJson.value = JSON.stringify(dt.entries, null, 2)
viewVisible.value = true
}
const toggleEdit = (row) => {