Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-admin-IM
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.education.frontend
pica-admin-IM
提交
0d9ea6aa
提交
0d9ea6aa
编写于
1月 29, 2021
作者:
huangwensu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
当前会话图片处理
上级
f8eba1de
变更
2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
68 行增加
和
8 行删除
+68
-8
index.scss
src/views/IM/current-session/index.scss
+5
-0
index.vue
src/views/IM/current-session/index.vue
+63
-8
未找到文件。
src/views/IM/current-session/index.scss
浏览文件 @
0d9ea6aa
...
...
@@ -271,6 +271,11 @@
// height: 108px;
// border-radius: 8px;
// }
.img-box
{
max-width
:
192px
;
max-height
:
320px
;
overflow
:
hidden
;
}
}
}
...
...
src/views/IM/current-session/index.vue
浏览文件 @
0d9ea6aa
...
...
@@ -95,13 +95,15 @@
<div
class=
"mid-text"
>
{{
item
.
text
}}
</div>
</div>
<div
v-if=
"item.showType == 2"
class=
"mid-img"
v-viewer
>
<!--
<img
class=
"img"
:src=
"item.url"
alt
/>
-->
<img-size
<div
class=
"img-box"
>
<img
class=
"img"
:src=
"item.url"
:style=
"
{width: item.newW + 'px', height: item.newH + 'px' }" alt />
</div>
<!--
<img-size
:imgUrl=
"item.url"
:imgData=
"item"
:index=
"index"
@
imgHandle=
"imgHandle"
></img-size>
></img-size>
-->
</div>
<div
v-if=
"item.showType == 3"
class=
"mid-pdf"
@
click=
"openPDF(item)"
>
<div
class=
"midp-left"
>
...
...
@@ -268,7 +270,10 @@ export default {
{
required
:
true
,
message
:
"请填写链接显示文案"
,
trigger
:
"blur"
}
],
url
:
[{
required
:
true
,
message
:
"请选择链接"
,
trigger
:
"change"
}]
}
},
imgWidth
:
0
,
imgHeight
:
0
,
imgProportion
:
0
,
};
},
...
...
@@ -372,6 +377,7 @@ export default {
}
},
// 查询医生和居民的消息 - 向前查找
getMSGForwardForAC
(
msg
)
{
let
session
=
this
.
currentSession
;
...
...
@@ -583,6 +589,11 @@ export default {
msg
.
url
=
url
;
msg
.
sessionFlag
=
false
;
cMessageList
.
push
(
msg
);
if
(
msg
.
type
.
toLowerCase
()
==
"image"
||
msg
.
type
.
toLowerCase
()
==
"picture"
)
{
this
.
imgSizeHandle
(
msg
)
}
});
if
(
directFlag
===
1
)
{
...
...
@@ -1037,10 +1048,54 @@ export default {
return
betaHandle
(
val
);
},
imgHandle
(
data
)
{
this
.
$set
(
this
.
messageList
[
data
.
index
],
"newW"
,
data
.
width
);
this
.
$set
(
this
.
messageList
[
data
.
index
],
"newH"
,
data
.
height
);
}
// imgHandle(data) {
// this.$set(this.messageList[data.index], "newW", data.width);
// this.$set(this.messageList[data.index], "newH", data.height);
// },
// 图片处理
imgSizeHandle
(
item
)
{
let
lw
,
lh
,
newW
,
newH
;
this
.
imgWidth
=
JSON
.
parse
(
item
.
content
).
w
;
this
.
imgHeight
=
JSON
.
parse
(
item
.
content
).
h
;
this
.
imgProportion
=
(
this
.
imgWidth
/
this
.
imgHeight
).
toFixed
(
1
);
if
(
this
.
imgProportion
>
0.6
)
{
if
(
this
.
imgWidth
>
192
)
{
lw
=
192
;
lh
=
(
this
.
imgHeight
*
lw
)
/
this
.
imgWidth
;
}
else
if
(
this
.
imgWidth
<=
192
)
{
lw
=
this
.
imgWidth
;
lh
=
this
.
imgHeight
;
}
}
else
if
(
this
.
imgProportion
==
0.6
)
{
if
(
this
.
imgHeight
>
320
)
{
lh
=
320
;
}
else
{
lh
=
this
.
imgHeight
;
}
lw
=
lh
*
0.6
;
}
else
{
if
(
this
.
imgHeight
>
320
)
{
lh
=
320
;
lw
=
(
this
.
imgWidth
*
lh
)
/
this
.
imgHeight
;
}
else
if
(
this
.
imgHeight
<=
320
)
{
lh
=
this
.
imgHeight
;
lw
=
this
.
imgWidth
;
}
}
if
((
lh
<
32
)
&&
(
lh
<
lw
))
{
newH
=
32
;
newW
=
(
lw
*
32
)
/
lh
;
}
else
if
((
lw
<
32
)
&&
(
lw
<
lh
))
{
newW
=
32
;
newH
=
(
lh
*
32
)
/
lw
;
}
else
{
newH
=
lh
;
newW
=
lw
;
}
this
.
$set
(
item
,
"newW"
,
newW
);
this
.
$set
(
item
,
"newH"
,
newH
);
},
},
beforeDestroy
()
{
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录