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
提交
db492ac0
提交
db492ac0
编写于
2月 04, 2021
作者:
guangjun.yang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
代码优化
上级
a1f7ae70
变更
3
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
66 行增加
和
11 行删除
+66
-11
detail.vue
src/views/IM/chain-history/detail.vue
+1
-1
index.vue
src/views/IM/current-session/index.vue
+4
-2
detail.vue
src/views/IM/search-message/detail.vue
+61
-8
未找到文件。
src/views/IM/chain-history/detail.vue
浏览文件 @
db492ac0
...
...
@@ -62,7 +62,7 @@ export default {
},
// 挂载到Dom完成时
mounted
()
{
commonUtil
.
resizeHeight
();
commonUtil
.
resizeHeight
(
92
);
this
.
getData
();
},
...
...
src/views/IM/current-session/index.vue
浏览文件 @
db492ac0
...
...
@@ -1149,8 +1149,10 @@ export default {
newH
=
lh
;
newW
=
lw
;
}
this
.
$set
(
item
,
"newW"
,
newW
);
this
.
$set
(
item
,
"newH"
,
newH
);
item
.
newW
=
newW
;
item
.
newH
=
newH
;
// this.$set(item, "newW", newW);
// this.$set(item, "newH", newH);
}
},
...
...
src/views/IM/search-message/detail.vue
浏览文件 @
db492ac0
...
...
@@ -22,11 +22,16 @@
</div>
<div
v-if=
"item.type == 'PICTURE'"
class=
"img-content"
v-viewer
>
<!--
<img
:src=
"item.content.url"
/>
-->
<img-size
:imgUrl=
"item.content.url"
<div
class=
"img-handle-container"
>
<div
class=
"img-box"
>
<img
:src=
"item.content.url"
:style=
"
{width: item.newW + 'px', height: item.newH + 'px'}"/>
</div>
</div>
<!--
<img-size
:imgUrl=
"item.content.url"
:imgData=
"item"
:index=
"index"
@
imgHandle=
"imgHandle"
></img-size>
@
imgHandle=
"imgHandle"
></img-size>
-->
</div>
<div
v-if=
"item.type == 'CUSTOM'"
>
<div
v-if=
"item.content.bizType == 18"
class=
"file-content"
>
...
...
@@ -221,10 +226,56 @@ export default {
this
.
$set
(
element
,
index
,
'sessionFlag'
);
if
(
element
.
type
==
'CUSTOM'
||
element
.
type
==
'PICTURE'
)
{
element
.
content
=
JSON
.
parse
(
element
.
content
);
if
(
element
.
type
==
'PICTURE'
)
{
this
.
imgSizeHandleNew
(
element
,
element
.
content
.
w
,
element
.
content
.
h
);
}
}
});
return
data
;
},
// 图片处理-新
imgSizeHandleNew
(
item
,
imgWidth
,
imgHeight
)
{
let
lw
,
lh
,
newW
,
newH
,
imgProportion
=
(
imgWidth
/
imgHeight
).
toFixed
(
1
);
if
(
imgProportion
>
0.6
)
{
if
(
imgWidth
>
192
)
{
lw
=
192
;
lh
=
(
imgHeight
*
lw
)
/
imgWidth
;
}
else
if
(
imgWidth
<=
192
)
{
lw
=
imgWidth
;
lh
=
imgHeight
;
}
}
else
if
(
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
;
}
item
.
newW
=
newW
;
item
.
newH
=
newH
;
// this.$set(item, "newW", newW);
// this.$set(item, "newH", newH);
},
// 时间格式转换
timeChange
(
data
)
{
return
timeHandle
(
data
)
...
...
@@ -313,11 +364,13 @@ export default {
.img-content
{
padding
:
10px
0
16px
;
cursor
:
pointer
;
// & > img {
// width: 170px;
// height: 108px;
// border-radius: 8px;
// }
.img-handle-container
{
.img-box
{
max-width
:
192px
;
max-height
:
320px
;
overflow
:
hidden
;
}
}
}
.file-content
{
padding
:
10px
0
16px
;
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录