fix: 心路历程改成富文本框。
This commit is contained in:
@@ -37,7 +37,11 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="记录时间" align="center" width="160" prop="createTime" />
|
||||
<el-table-column label="内容" align="center" prop="remark" />
|
||||
<el-table-column label="内容" align="center" prop="remark">
|
||||
<template #default="scope">
|
||||
<div v-html="scope.row.remark" class="content-preview"></div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
<div class="ctrl-btn d-flex">
|
||||
@@ -72,8 +76,8 @@
|
||||
<el-form-item label="时间" prop="createTime">
|
||||
<el-date-picker clearable v-model="form.createTime" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择时间"> </el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="内容">
|
||||
<el-input v-model="form.remark" type="textarea" rows="12" placeholder="请输入备注" />
|
||||
<el-form-item label="内容" prop="remark">
|
||||
<wx-editor v-model="form.remark" :height="400" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template v-if="title !== '查看心路历程'" #footer>
|
||||
@@ -91,6 +95,7 @@ import { listHeartJourney, getHeartJourney, delHeartJourney, addHeartJourney, up
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
import { require } from '@/utils/require'
|
||||
import dayjs from 'dayjs'
|
||||
import WxEditor from '@/components/WxEditor'
|
||||
const { proxy } = getCurrentInstance()
|
||||
const { journey_type } = proxy.useDict('journey_type')
|
||||
|
||||
@@ -286,3 +291,65 @@ function handleExport() {
|
||||
|
||||
getList()
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.content-preview {
|
||||
text-align: left;
|
||||
padding: 8px 0;
|
||||
line-height: 1.6;
|
||||
word-break: break-word;
|
||||
|
||||
// 保留富文本的基本样式
|
||||
::v-deep(p) {
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
::v-deep(h1),
|
||||
::v-deep(h2),
|
||||
::v-deep(h3),
|
||||
::v-deep(h4),
|
||||
::v-deep(h5),
|
||||
::v-deep(h6) {
|
||||
margin: 10px 0 5px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
::v-deep(ul),
|
||||
::v-deep(ol) {
|
||||
margin: 5px 0;
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
::v-deep(img) {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
::v-deep(a) {
|
||||
color: #409eff;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
::v-deep(blockquote) {
|
||||
border-left: 3px solid #ddd;
|
||||
padding-left: 10px;
|
||||
margin: 5px 0;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
::v-deep(code) {
|
||||
background-color: #f5f5f5;
|
||||
padding: 2px 4px;
|
||||
border-radius: 3px;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
::v-deep(pre) {
|
||||
background-color: #f5f5f5;
|
||||
padding: 10px;
|
||||
border-radius: 3px;
|
||||
overflow-x: auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user