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
提交
bb7339e6
提交
bb7339e6
编写于
1月 29, 2021
作者:
guangjun.yang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
数据处理
上级
6d9f7fb6
变更
1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
99 行增加
和
48 行删除
+99
-48
index.vue
src/views/IM/current-session/index.vue
+99
-48
未找到文件。
src/views/IM/current-session/index.vue
浏览文件 @
bb7339e6
...
...
@@ -96,14 +96,19 @@
</div>
<div
v-if=
"item.showType == 2"
class=
"mid-img"
v-viewer
>
<div
class=
"img-box"
>
<img
class=
"img"
:src=
"item.url"
:style=
"
{width: item.newW + 'px', height: item.newH + 'px' }" alt />
<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"
>
...
...
@@ -273,7 +278,7 @@ export default {
},
imgWidth
:
0
,
imgHeight
:
0
,
imgProportion
:
0
,
imgProportion
:
0
};
},
...
...
@@ -377,7 +382,6 @@ export default {
}
},
// 查询医生和居民的消息 - 向前查找
getMSGForwardForAC
(
msg
)
{
let
session
=
this
.
currentSession
;
...
...
@@ -435,6 +439,10 @@ export default {
msg
.
realTimestamp
=
this
.
realTimestamp
;
msg
.
taskLogId
=
this
.
currentTaskLogId
;
console
.
log
(
"####msg####"
,
msg
);
// 处理图片的大小
if
(
msg
.
type
==
1
)
{
this
.
handleSendMsg
(
msg
,
msg
.
width
,
msg
.
height
);
}
this
.
messageList
.
push
(
msg
);
this
.
$nextTick
(()
=>
{
var
element
=
document
.
querySelector
(
".scroll-box"
);
...
...
@@ -578,6 +586,7 @@ export default {
url
=
content
.
url
;
text
=
content
.
name
;
showType
=
2
;
this
.
imgSizeHandle
(
msg
,
content
.
w
,
content
.
h
);
}
else
{
showType
=
1
;
text
=
msg
.
content
;
...
...
@@ -589,11 +598,12 @@ export default {
msg
.
url
=
url
;
msg
.
sessionFlag
=
false
;
cMessageList
.
push
(
msg
);
if
(
msg
.
type
.
toLowerCase
()
==
"image"
||
msg
.
type
.
toLowerCase
()
==
"picture"
)
{
this
.
imgSizeHandle
(
msg
)
}
if
(
msg
.
type
.
toLowerCase
()
==
"image"
||
msg
.
type
.
toLowerCase
()
==
"picture"
)
{
this
.
imgSizeHandle
(
msg
);
}
});
if
(
directFlag
===
1
)
{
...
...
@@ -602,7 +612,7 @@ export default {
forwardMsgIntervalId
&&
clearInterval
(
forwardMsgIntervalId
);
this
.
messageList
=
cMessageList
;
this
.
$forceUpdate
();
setTimeout
(
()
=>
{
setTimeout
(()
=>
{
this
.
$nextTick
(()
=>
{
const
scrollBoxDom
=
document
.
querySelector
(
".scroll-box"
);
scrollBoxDom
.
scrollTop
=
scrollBoxDom
.
scrollHeight
;
...
...
@@ -1060,47 +1070,88 @@ export default {
// 图片处理
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
;
}
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
;
}
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
;
}
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
;
}
this
.
$set
(
item
,
"newW"
,
newW
);
this
.
$set
(
item
,
"newH"
,
newH
);
}
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
);
},
// 图片处理-新
imgSizeHandle
(
item
,
imgWidth
,
imgHeight
)
{
let
lw
,
lh
,
newW
,
newH
,
imgProportion
=
(
imgWidth
/
imgHeight
).
toFixed
(
1
);
if
(
this
.
imgProportion
>
0.6
)
{
if
(
imgWidth
>
192
)
{
lw
=
192
;
lh
=
(
imgHeight
*
lw
)
/
imgWidth
;
}
else
if
(
imgWidth
<=
192
)
{
lw
=
imgWidth
;
lh
=
imgHeight
;
}
}
else
if
(
this
.
imgProportion
==
0.6
)
{
if
(
imgHeight
>
320
)
{
lh
=
320
;
}
else
{
lh
=
imgHeight
;
}
lw
=
lh
*
0.6
;
}
else
{
if
(
imgHeight
>
320
)
{
lh
=
320
;
lw
=
(
imgWidth
*
lh
)
/
imgHeight
;
}
else
if
(
imgHeight
<=
320
)
{
lh
=
imgHeight
;
lw
=
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
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录