Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-admin-consultation
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.education.frontend
pica-admin-consultation
提交
ac9c3738
提交
ac9c3738
编写于
3月 22, 2024
作者:
zhaosheng.zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 预约单列表/病情照片支持上传视频优化
上级
9e350330
变更
1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
39 行增加
和
11 行删除
+39
-11
upload-img.vue
src/components/editor/upload-img.vue
+39
-11
未找到文件。
src/components/editor/upload-img.vue
浏览文件 @
ac9c3738
...
...
@@ -68,6 +68,12 @@ export default {
},
watch
:
{
imgList
(
newv
)
{
// 接口返回的视频格式第一帧,作为图片显示
newv
.
forEach
((
item
)
=>
{
if
(
this
.
isVideoFormat
(
item
?.
url
))
{
this
.
getVideoCover
(
item
);
}
});
this
.
imgArr
=
newv
;
},
},
...
...
@@ -80,21 +86,43 @@ export default {
this
.
imgArr
=
fileList
;
},
handlePictureCardPreview
(
file
)
{
const
isImage
=
file
.
raw
.
type
.
startsWith
(
'image/'
);
const
isVideo
=
file
.
raw
.
type
.
startsWith
(
'video/mp4'
);
this
.
dialogVisible
=
true
;
if
(
file
?.
raw
)
{
const
isImage
=
this
.
isImageURL
(
file
?.
raw
?.
name
);
const
isVideo
=
this
.
isVideoFormat
(
file
?.
raw
?.
name
);
if
(
isVideo
)
{
this
.
isVideoStatus
(
file
);
}
if
(
isVideo
)
{
this
.
isVideo
=
true
;
this
.
isImage
=
false
;
if
(
isImage
)
{
this
.
isImageStatus
(
file
);
}
return
;
}
if
(
isImage
)
{
this
.
isImage
=
true
;
this
.
isVideo
=
false
;
this
.
dialogImageUrl
=
file
.
url
;
if
(
this
.
isImageURL
(
file
?.
url
)
)
{
this
.
isImage
Status
(
file
)
;
}
else
{
this
.
isVideoStatus
(
file
)
;
}
},
isImageStatus
(
file
)
{
this
.
isImage
=
true
;
this
.
isVideo
=
false
;
this
.
dialogImageUrl
=
file
?.
url
;
},
isVideoStatus
(
file
)
{
this
.
isVideo
=
true
;
this
.
isImage
=
false
;
this
.
getVideoCover
(
file
);
},
isImageURL
(
url
)
{
return
/
\.(
jpg|jpeg|png
)
$/i
.
test
(
url
);
},
isVideoFormat
(
url
)
{
const
videoExtensions
=
/
\.(
mp4
)
$/i
;
return
videoExtensions
.
test
(
url
);
},
handleExceed
(
files
,
fileList
)
{
this
.
$message
.
warning
(
`当前限制选择 3 个文件,本次选择了
${
files
.
length
}
个文件,共选择了
${
...
...
@@ -121,8 +149,8 @@ export default {
return
newArr
;
},
beforeUpload
(
file
)
{
const
isImage
=
file
.
type
.
startsWith
(
'image/'
);
const
isVideo
=
file
.
type
.
startsWith
(
'video/mp4'
);
const
isImage
=
this
.
isImageURL
(
file
?.
name
);
const
isVideo
=
this
.
isVideoFormat
(
file
?.
name
);
if
(
isImage
)
{
this
.
isImage
=
true
;
this
.
isVideo
=
false
;
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录