<template>
|
<app-page-form v-bind="pageFormProps" v-loading="appStore.getLoading('getEntity')">
|
<div class="editor-content-view" v-html="htmlValue"></div>
|
</app-page-form>
|
</template>
|
|
<script setup>
|
|
import {closeTab} from '@/utils/iframe.js';
|
import {useAppStore, useEntityStore} from "@/store/modules";
|
import {convertFilter} from "@/utils/filter.js";
|
import * as baseApi from "@/api/index.js";
|
|
const entityStore = useEntityStore();
|
const appStore = useAppStore();
|
|
const router = useRouter();
|
|
const params = router.currentRoute.value.query;
|
|
const htmlValue = ref('');
|
|
onMounted(async () => {
|
if (params.id) {
|
const {data} = await entityStore.getEntity({
|
dataName: "affiche",
|
filter: convertFilter({
|
andEqParams: {
|
id: params.id
|
}
|
})
|
});
|
|
const content = await baseApi.file.getFileText(data.affiche.file_id);
|
htmlValue.value = content;
|
}
|
});
|
|
const pageFormProps = {
|
subClose() {
|
closeTab();
|
},
|
submitDom: false,
|
resetDom: false,
|
}
|
|
</script>
|
|
<style lang="scss">
|
.editor-content-view {
|
|
p, li {
|
white-space: pre-wrap; /* 保留空格 */
|
}
|
|
blockquote {
|
border-left: 8px solid #d0e5f2;
|
padding: 10px 10px;
|
margin: 10px 0;
|
background-color: #f1f1f1;
|
}
|
|
code {
|
font-family: monospace;
|
padding: 3px;
|
border-radius: 3px;
|
}
|
|
pre{
|
code {
|
background-color: #eee;
|
}
|
}
|
|
pre > code {
|
display: block;
|
padding: 10px;
|
}
|
|
table {
|
border-collapse: collapse;
|
}
|
|
td, th {
|
border: 1px solid #ccc;
|
min-width: 50px;
|
height: 20px;
|
}
|
|
th {
|
background-color: #f1f1f1;
|
}
|
|
ul, ol {
|
padding-left: 20px;
|
}
|
|
input[type="checkbox"] {
|
margin-right: 5px;
|
}
|
}
|
</style>
|