Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cust_web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张伯涛
cust_web
Commits
6151a097
Commit
6151a097
authored
Feb 25, 2025
by
罗林杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改图片预览
parent
d55a2611
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
13 deletions
+28
-13
index.vue
src/views/contentManagement/activity/info/index.vue
+14
-7
index.vue
src/views/contentManagement/notice/info/index.vue
+14
-6
No files found.
src/views/contentManagement/activity/info/index.vue
View file @
6151a097
...
...
@@ -337,7 +337,7 @@
</div>
</div>
<el-dialog
:visible
.
sync=
"open"
width=
"500px"
append-to-body
>
<div
v-if=
"form
.details"
class=
"preview-content"
v-html=
"form.d
etails"
/>
<div
v-if=
"form
attedDetails"
class=
"preview-content"
v-html=
"formattedD
etails"
/>
<div
v-else
>
暂无预览内容
</div>
</el-dialog>
<!-- 按钮区 -->
...
...
@@ -436,6 +436,18 @@ export default {
// 第一种禁用情况 1.查看的情况
secondFromDisabled
()
{
return
(
this
.
controls
.
isOperation
===
'3'
)
},
formattedDetails
()
{
if
(
!
this
.
form
.
details
)
return
''
// 使用正则表达式查找并替换
<
img
>
标签
const
updatedHtml
=
this
.
form
.
details
.
replace
(
/<img
[^
>
]
+>/gi
,
(
match
)
=>
{
// 检查是否已经有 width 和 height 属性
if
(
!
/width
\s
*=
\s
*
(
'|"
)[^
'|"
]
+
(
'|"
)
/i
.
test
(
match
))
{
match
=
match
.
replace
(
/
\/?
>/i
,
' style="max-width: 100%; height: auto;" />'
)
}
return
match
})
return
updatedHtml
}
},
mounted
()
{
...
...
@@ -658,15 +670,10 @@ export default {
padding
:
10px
;
background-color
:
#f9f9f9
;
min-height
:
736px
;
min
_
width
:
414px
;
min
-
width
:
414px
;
word-wrap
:
break-word
;
overflow
:
hidden
;
}
.preview-content
img
{
max-width
:
100%
;
height
:
auto
;
}
::v-deep
.avatar-uploader
.el-upload
{
border
:
1px
dashed
#d9d9d9
;
border-radius
:
6px
;
...
...
src/views/contentManagement/notice/info/index.vue
View file @
6151a097
...
...
@@ -143,7 +143,7 @@
</div>
</div>
<el-dialog
:visible
.
sync=
"open"
width=
"500px"
append-to-body
>
<div
v-if=
"form
.details"
class=
"preview-content"
v-html=
"form.d
etails"
/>
<div
v-if=
"form
attedDetails"
class=
"preview-content"
v-html=
"formattedD
etails"
/>
<div
v-else
>
暂无预览内容
</div>
</el-dialog>
<!-- 按钮区 -->
...
...
@@ -250,6 +250,18 @@ export default {
// 第一种禁用情况 1.查看的情况
secondFromDisabled
()
{
return
(
this
.
controls
.
isOperation
===
'3'
)
},
formattedDetails
()
{
if
(
!
this
.
form
.
details
)
return
''
// 使用正则表达式查找并替换
<
img
>
标签
const
updatedHtml
=
this
.
form
.
details
.
replace
(
/<img
[^
>
]
+>/gi
,
(
match
)
=>
{
// 检查是否已经有 width 和 height 属性
if
(
!
/width
\s
*=
\s
*
(
'|"
)[^
'|"
]
+
(
'|"
)
/i
.
test
(
match
))
{
match
=
match
.
replace
(
/
\/?
>/i
,
' style="max-width: 100%; height: auto;" />'
)
}
return
match
})
return
updatedHtml
}
},
mounted
()
{
...
...
@@ -497,14 +509,10 @@ export default {
padding
:
10px
;
background-color
:
#f9f9f9
;
min-height
:
736px
;
min
_
width
:
414px
;
min
-
width
:
414px
;
word-wrap
:
break-word
;
}
.preview-content
img
{
max-width
:
100%
;
height
:
auto
;
}
::v-deep
.avatar-uploader
.el-upload
{
border
:
1px
dashed
#d9d9d9
;
border-radius
:
6px
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment