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
提交
d6e4fb65
提交
d6e4fb65
编写于
2月 05, 2021
作者:
guangjun.yang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
代码优化
上级
8bad3dc8
变更
4
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
8 行增加
和
167 行删除
+8
-167
img-size.vue
src/components/IM/img-size.vue
+0
-96
detail.vue
src/views/IM/chain-history/detail.vue
+0
-6
index.vue
src/views/IM/current-session/index.vue
+8
-59
detail.vue
src/views/IM/search-message/detail.vue
+0
-6
未找到文件。
src/components/IM/img-size.vue
已删除
100644 → 0
浏览文件 @
8bad3dc8
<
template
>
<div
class=
"img-handle-container"
>
<div
class=
"img-box"
>
<img
:src=
"imgUrl"
:style=
"
{width: imgData.newW + 'px', height: imgData.newH + 'px' }"/>
</div>
</div>
</
template
>
<
script
>
export
default
{
name
:
'imgSize'
,
props
:
{
imgUrl
:
{
type
:
String
,
default
:
''
},
imgData
:
{
type
:
Object
,
default
:
{}
},
index
:
{
type
:
Number
,
default
:
0
}
},
data
()
{
return
{
imgWidth
:
0
,
imgHeight
:
0
,
imgProportion
:
0
,
lw
:
0
,
lh
:
0
,
newW
:
0
,
newH
:
0
,
}
},
mounted
()
{
let
{
lw
,
lh
,
newW
,
newH
}
=
this
;
if
(
typeof
this
.
imgData
.
content
==
'string'
)
{
this
.
imgWidth
=
this
.
imgData
.
width
||
JSON
.
parse
(
this
.
imgData
.
content
).
w
;
this
.
imgHeight
=
this
.
imgData
.
height
||
JSON
.
parse
(
this
.
imgData
.
content
).
h
;
}
else
{
this
.
imgWidth
=
this
.
imgData
.
width
||
this
.
imgData
.
content
.
w
;
this
.
imgHeight
=
this
.
imgData
.
height
||
this
.
imgData
.
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
.
$emit
(
'imgHandle'
,
{
width
:
newW
,
height
:
newH
,
index
:
this
.
index
});
},
methods
:
{
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.img-handle-container
{
.img-box
{
max-width
:
192px
;
max-height
:
320px
;
overflow
:
hidden
;
}
}
</
style
>
\ No newline at end of file
src/views/IM/chain-history/detail.vue
浏览文件 @
d6e4fb65
...
...
@@ -38,14 +38,12 @@
</
template
>
<
script
>
import
BreadCrumb
from
"@/components/breadcrumb.vue"
;
import
ImgSize
from
"@/components/IM/img-size.vue"
;
import
{
doUpload
,
getFilePath
}
from
"@/utils/qiniu-util"
;
import
{
openLoading
,
closeLoading
,
betaHandle
}
from
"@/utils/utils"
;
import
*
as
commonUtil
from
"@/utils/utils"
;
export
default
{
components
:
{
BreadCrumb
,
ImgSize
},
data
()
{
return
{
...
...
@@ -90,10 +88,6 @@ export default {
}
});
},
imgHandle
(
data
)
{
this
.
$set
(
this
.
detailData
.
contentModelList
[
data
.
index
],
'newW'
,
data
.
width
)
this
.
$set
(
this
.
detailData
.
contentModelList
[
data
.
index
],
'newH'
,
data
.
height
)
},
// 下载目标文件
downFile
()
{
...
...
src/views/IM/current-session/index.vue
浏览文件 @
d6e4fb65
...
...
@@ -210,7 +210,6 @@
<
script
>
import
{
mapGetters
,
mapMutations
}
from
"vuex"
;
import
BreadCrumb
from
"@/components/breadcrumb.vue"
;
import
ImgSize
from
"@/components/IM/img-size.vue"
;
import
{
doUpload
,
getFilePath
}
from
"@/utils/qiniu-util"
;
import
{
validateWord
}
from
"@/utils/validate.js"
;
import
{
openLoading
,
closeLoading
,
betaHandle
}
from
"@/utils/utils"
;
...
...
@@ -228,7 +227,6 @@ export default {
components
:
{
BreadCrumb
,
UserInfo
,
ImgSize
},
data
()
{
return
{
...
...
@@ -272,7 +270,8 @@ export default {
},
imgWidth
:
0
,
imgHeight
:
0
,
imgProportion
:
0
imgProportion
:
0
,
hasNoHistoryData
:
false
,
};
},
...
...
@@ -446,7 +445,7 @@ export default {
// 查询医生和居民的消息历史(下拉刷新时调用)
getOldMSGHistory
()
{
// if(this.hasNoHistory
) return;
if
(
this
.
hasNoHistoryData
)
return
;
let
session
=
this
.
currentSession
;
let
params
=
{
doctorAccId
:
this
.
currentToAccId
,
...
...
@@ -461,7 +460,11 @@ export default {
this
.
POST
(
"/im/msg/history"
,
params
).
then
(
res
=>
{
if
(
res
.
code
===
"000000"
)
{
// 将新消息合并到之前的消息中, 并且重置最后一条消息
this
.
convertMessageList
(
res
.
data
,
3
);
if
(
res
.
data
&&
res
.
data
.
length
>
0
)
{
this
.
convertMessageList
(
res
.
data
,
3
);
}
else
{
this
.
hasNoHistoryData
=
true
;
}
}
else
{
this
.
$message
({
message
:
res
.
message
,
...
...
@@ -592,12 +595,6 @@ 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
)
{
...
...
@@ -1057,54 +1054,6 @@ 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);
// },
// 图片处理
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
()
{
...
...
src/views/IM/search-message/detail.vue
浏览文件 @
d6e4fb65
...
...
@@ -54,14 +54,12 @@
</
template
>
<
script
>
import
BreadCrumb
from
"@/components/breadcrumb.vue"
;
import
ImgSize
from
"@/components/IM/img-size.vue"
;
import
{
doUpload
,
getFilePath
}
from
"@/utils/qiniu-util"
;
import
{
openLoading
,
closeLoading
,
betaHandle
,
timeHandle
}
from
"@/utils/utils"
;
import
{
getPicaKFAccid
}
from
"@/utils"
;
export
default
{
components
:
{
BreadCrumb
,
ImgSize
},
data
()
{
return
{
...
...
@@ -201,10 +199,6 @@ export default {
}
})
},
imgHandle
(
data
)
{
this
.
$set
(
this
.
detailData
[
data
.
index
],
'newW'
,
data
.
width
)
this
.
$set
(
this
.
detailData
[
data
.
index
],
'newH'
,
data
.
height
)
},
// 按照时间大小排序
timeSort
(
arrList
)
{
arrList
.
sort
((
a
,
b
)
=>
{
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录