Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
exhibition_backstage
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
龙菲
exhibition_backstage
Commits
14854e65
提交
14854e65
authored
6月 28, 2022
作者:
龙菲
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
文物修改
上级
83d4acc0
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
28 行增加
和
97 行删除
+28
-97
AudioUploader.vue
src/components/Uploader/AudioUploader.vue
+0
-68
ManualUploader.vue
src/components/Uploader/ManualUploader.vue
+7
-16
index.vue
src/components/Uploader/index.vue
+0
-5
InfoEditDialog.vue
src/views/culturalRelic/components/InfoEditDialog.vue
+0
-0
index.vue
src/views/culturalRelic/index.vue
+21
-8
没有找到文件。
src/components/Uploader/AudioUploader.vue
deleted
100644 → 0
浏览文件 @
83d4acc0
<
template
>
<el-upload
:action=
"uploadUrl"
:before-upload=
"handleBeforeUpload"
:on-success=
"handleSuccess"
:on-error=
"handleUploadError"
:on-remove=
"handleRemove"
:on-exceed=
"handleExceed"
:on-change=
"handleChange"
:file-list=
"fileList"
:multiple=
"fileLimit > 1"
:headers=
"headers"
:limit=
"fileLimit"
:list-type=
"listType"
name=
"files"
:class=
"
{ disabled: uploadDisabled }"
:accept="fileAccept"
>
<el-button
slot=
"trigger"
size=
"small"
type=
"primary"
>
选取文件
</el-button>
<div
slot=
"tip"
class=
"el-upload__tip"
style=
"margin-bottom: 10px"
>
只能上传mp3文件,且不超过2M,播放长度不超过60s
</div>
</el-upload>
</
template
>
<
script
>
export
default
{
beforeAvatarUpload
(
file
)
{
// 文件类型进行判断
const
isAudio
=
file
.
type
===
"audio/mp3"
||
file
.
type
===
"audio/mpeg"
;
// 限制上传文件大小 2M
const
isLt2M
=
file
.
size
/
1024
/
1024
<
2
;
const
isTime60S
=
this
.
audioDuration
>=
60
?
true
:
""
;
// 获取时长
this
.
getTimes
(
file
);
if
(
!
isAudio
)
{
this
.
$message
.
error
(
"上传文件只能是Mp3格式!"
);
this
.
fileList
=
[];
}
else
{
if
(
!
isLt2M
)
{
this
.
$message
.
error
(
"上传文件大小不能超过 2MB!"
);
this
.
fileList
=
[];
}
else
{
if
(
!
isTime60S
)
{
this
.
$message
.
error
(
"上传文件时长不能超过60秒!"
);
this
.
fileList
=
[];
}
}
}
return
isAudio
&&
isLt2M
&&
isTime60S
;
},
getTimes
(
file
)
{
var
content
=
file
;
//获取录音时长
var
url
=
URL
.
createObjectURL
(
content
);
//经测试,发现audio也可获取视频的时长
var
audioElement
=
new
Audio
(
url
);
audioElement
.
addEventListener
(
"loadedmetadata"
,
(
_event
)
=>
{
this
.
audioDuration
=
parseInt
(
audioElement
.
duration
);
// console.log(this.audioDuration);
});
},
};
</
script
>
<
style
>
</
style
>
\ No newline at end of file
src/components/Uploader/ManualUploader.vue
浏览文件 @
14854e65
...
@@ -70,19 +70,13 @@ export default {
...
@@ -70,19 +70,13 @@ export default {
process
.
env
.
NODE_ENV
===
"development"
process
.
env
.
NODE_ENV
===
"development"
?
"/api/sysFiles/upload"
?
"/api/sysFiles/upload"
:
process
.
env
.
NODE_ENV
+
"/sysFiles/upload"
,
// 上传的图片服务器地址
:
process
.
env
.
NODE_ENV
+
"/sysFiles/upload"
,
// 上传的图片服务器地址
// headers: {
// authorization: getToken(),
// },
fileList
:
[],
fileList
:
[],
// tempFileList: [],
// uploadDisabled: false,
upLoadList
:
[],
};
};
},
},
watch
:
{
watch
:
{
files
:
{
files
:
{
handler
:
function
(
newVal
,
oldV
al
)
{
handler
:
function
(
v
al
)
{
this
.
fileList
=
newVal
;
this
.
fileList
=
[...
val
]
;
},
},
immediate
:
true
,
immediate
:
true
,
deep
:
true
,
deep
:
true
,
...
@@ -108,12 +102,9 @@ export default {
...
@@ -108,12 +102,9 @@ export default {
return
fileAccept
;
return
fileAccept
;
},
},
},
},
created
()
{
this
.
fileList
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
files
));
},
methods
:
{
methods
:
{
getFiles
(){
getFiles
()
{
return
this
.
upLoadList
return
this
.
fileList
;
},
},
// 上传前校检格式和大小
// 上传前校检格式和大小
handleBeforeUpload
(
file
)
{
handleBeforeUpload
(
file
)
{
...
@@ -161,9 +152,9 @@ export default {
...
@@ -161,9 +152,9 @@ export default {
// 文件列表移除文件时的钩子
// 文件列表移除文件时的钩子
handleRemove
(
file
,
fileList
)
{
handleRemove
(
file
,
fileList
)
{
this
.
upLoad
List
.
map
((
item
,
index
)
=>
{
this
.
file
List
.
map
((
item
,
index
)
=>
{
if
(
item
.
uid
===
file
.
uid
)
{
if
(
item
.
uid
===
file
.
uid
)
{
this
.
upLoad
List
.
splice
(
index
,
1
);
this
.
file
List
.
splice
(
index
,
1
);
}
}
});
});
},
},
...
@@ -172,7 +163,7 @@ export default {
...
@@ -172,7 +163,7 @@ export default {
if
(
file
.
status
===
"ready"
)
{
if
(
file
.
status
===
"ready"
)
{
this
.
handleBeforeUpload
(
file
)
this
.
handleBeforeUpload
(
file
)
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
this
.
upLoad
List
.
push
(
res
);
this
.
file
List
.
push
(
res
);
})
})
.
catch
((
err
)
=>
{
.
catch
((
err
)
=>
{
console
.
log
(
"err"
,
err
);
console
.
log
(
"err"
,
err
);
...
...
src/components/Uploader/index.vue
浏览文件 @
14854e65
...
@@ -82,11 +82,6 @@ export default {
...
@@ -82,11 +82,6 @@ export default {
handler
:
function
(
newVal
,
oldVal
)
{
handler
:
function
(
newVal
,
oldVal
)
{
console
.
log
(
"newVal"
,
newVal
);
console
.
log
(
"newVal"
,
newVal
);
this
.
fileList
=
newVal
;
this
.
fileList
=
newVal
;
// if (this.fileList.length >= this.fileLimit) {
// this.uploadDisabled = true;
// }else{
// this.uploadDisabled = false;
// }
},
},
immediate
:
true
,
immediate
:
true
,
deep
:
true
,
deep
:
true
,
...
...
src/views/culturalRelic/components/InfoEditDialog.vue
浏览文件 @
14854e65
差异被折叠。
点击展开。
src/views/culturalRelic/index.vue
浏览文件 @
14854e65
<
template
>
<
template
>
<div
class=
"app-container"
>
<div
class=
"app-container"
v-loading=
"loading"
element-loading-text=
"拼命加载中"
element-loading-spinner=
"el-icon-loading"
element-loading-background=
"rgba(0, 0, 0, 0.3)"
>
<div
class=
"top-bar"
>
<div
class=
"top-bar"
>
<SearchBar
:config=
"searchConfig"
@
search=
"search"
@
reset=
"reset"
/>
<SearchBar
:config=
"searchConfig"
@
search=
"search"
@
reset=
"reset"
/>
<el-button
<el-button
...
@@ -67,7 +73,7 @@
...
@@ -67,7 +73,7 @@
import
TablePage
from
"@/components/Table/TablePage.vue"
;
import
TablePage
from
"@/components/Table/TablePage.vue"
;
import
TableOperation
from
"@/components/Table/TableOperation.vue"
;
import
TableOperation
from
"@/components/Table/TableOperation.vue"
;
import
{
title
,
operates
,
operations
}
from
"./config"
;
import
{
title
,
operates
,
operations
}
from
"./config"
;
import
{
getCulturalRelicList
}
from
"@/api/culturalRelic"
;
import
{
getCulturalRelicList
,
getRCDetailById
}
from
"@/api/culturalRelic"
;
import
InfoEditDialog
from
"./components/InfoEditDialog"
;
import
InfoEditDialog
from
"./components/InfoEditDialog"
;
import
SearchBar
from
"@/components/SearchBar"
;
import
SearchBar
from
"@/components/SearchBar"
;
...
@@ -141,7 +147,7 @@ export default {
...
@@ -141,7 +147,7 @@ export default {
// regionCode:'',//所属地(分号分隔的编号)——传当前用户的regionCode
// regionCode:'',//所属地(分号分隔的编号)——传当前用户的regionCode
sourceWay
:
""
,
//来源方式
sourceWay
:
""
,
//来源方式
sayExplain
:
""
,
//讲解词文件。文件id
sayExplain
:
""
,
//讲解词文件。文件id
status
:
""
,
//上下架状态(0-下架,1-上架)
status
:
0
,
//上下架状态(0-下架,1-上架)
// flag3d:'',//是否有3D图片(字典值:1-有;0-无)
// flag3d:'',//是否有3D图片(字典值:1-有;0-无)
themeWord
:
""
,
//主题词
themeWord
:
""
,
//主题词
url3d
:
""
,
//3durl链接
url3d
:
""
,
//3durl链接
...
@@ -158,8 +164,6 @@ export default {
...
@@ -158,8 +164,6 @@ export default {
if
(
value
)
{
if
(
value
)
{
this
.
dict
=
value
;
this
.
dict
=
value
;
this
.
culturalLevel
=
[];
this
.
culturalLevel
=
[];
console
.
log
(
"this.dict "
,
this
.
dict
);
}
}
},
},
},
},
...
@@ -227,9 +231,14 @@ export default {
...
@@ -227,9 +231,14 @@ export default {
break
;
break
;
case
"edit"
:
case
"edit"
:
// 查询接口,并复制给form
// 查询接口,并复制给form
// this.loading = true;
const
{
crId
}
=
row
;
// let res = await getRCDetailById;
this
.
loading
=
true
;
// this.drawerVisible = true;
let
res
=
await
getRCDetailById
({
crId
});
if
(
res
.
code
==
0
)
{
this
.
loading
=
false
;
this
.
form
=
res
.
data
;
this
.
drawerVisible
=
true
;
}
break
;
break
;
// case "delete":
// case "delete":
// break;
// break;
...
@@ -287,4 +296,7 @@ export default {
...
@@ -287,4 +296,7 @@ export default {
align-items
:
center
;
align-items
:
center
;
margin-bottom
:
10px
;
margin-bottom
:
10px
;
}
}
.pagination
{
margin
:
16px
;
}
</
style
>
</
style
>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论