refactor: 查看默认模板改用CodeEditor替代pre/alert
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user