Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
exhibition_backstage
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
龙菲
exhibition_backstage
Commits
7039b69c
提交
7039b69c
authored
9月 20, 2022
作者:
龙菲
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复布展单元多个单元图片一起上传出现上传失败的情况
上级
1e821fce
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
192 行增加
和
65 行删除
+192
-65
ManualUploader.vue
src/components/Uploader/ManualUploader.vue
+12
-1
ExhibitionUnit.vue
src/views/display/components/ExhibitionUnit.vue
+84
-10
InfoEditDialog.vue
src/views/display/components/InfoEditDialog.vue
+76
-49
index.vue
src/views/display/index.vue
+20
-5
没有找到文件。
src/components/Uploader/ManualUploader.vue
浏览文件 @
7039b69c
...
@@ -79,6 +79,15 @@ export default {
...
@@ -79,6 +79,15 @@ export default {
immediate
:
true
,
immediate
:
true
,
deep
:
true
,
deep
:
true
,
},
},
value
:
{
handler
:
function
(
val
)
{
if
(
val
)
{
this
.
fileList
=
JSON
.
parse
(
JSON
.
stringify
(
val
));
}
},
immediate
:
true
,
deep
:
true
,
},
},
},
computed
:
{
computed
:
{
// 是否显示提示
// 是否显示提示
...
@@ -165,11 +174,13 @@ export default {
...
@@ -165,11 +174,13 @@ export default {
handleChange
(
file
,
fileList
)
{
handleChange
(
file
,
fileList
)
{
let
that
=
this
;
let
that
=
this
;
// debugger
if
(
file
.
status
===
"ready"
)
{
if
(
file
.
status
===
"ready"
)
{
this
.
handleBeforeUpload
(
file
)
this
.
handleBeforeUpload
(
file
)
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
that
.
fileList
.
push
(
res
);
that
.
fileList
.
push
(
res
);
// that.$emit('input',that.fileList)
that
.
$emit
(
"input"
,
that
.
fileList
);
})
})
.
catch
((
err
)
=>
{
.
catch
((
err
)
=>
{
console
.
log
(
"err"
,
err
);
console
.
log
(
"err"
,
err
);
...
...
src/views/display/components/ExhibitionUnit.vue
浏览文件 @
7039b69c
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
<
template
>
<
template
>
<div
class=
"exhibiton-unit"
ref=
"exhibitionUnit"
>
<div
class=
"exhibiton-unit"
ref=
"exhibitionUnit"
>
<el-row
class=
"tree-container"
v-if=
"treeData.length > 0"
>
<el-row
class=
"tree-container"
v-if=
"treeData.length > 0"
>
<el-col
:span=
"
8
"
>
<el-col
:span=
"
9
"
>
<el-tree
:data=
"treeData"
node-key=
"euId"
default-expand-all
>
<el-tree
:data=
"treeData"
node-key=
"euId"
>
<div
class=
"exhibition-units-tree-node"
slot-scope=
"
{ node, data }">
<div
class=
"exhibition-units-tree-node"
slot-scope=
"
{ node, data }">
<div
style=
"display: flex; align-items: center"
>
<div
style=
"display: flex; align-items: center"
>
<div
class=
"title"
@
click=
"handleClickNode(node, data)"
>
<div
class=
"title"
@
click=
"handleClickNode(node, data)"
>
...
@@ -48,7 +48,7 @@
...
@@ -48,7 +48,7 @@
</div>
</div>
</el-tree>
</el-tree>
</el-col>
</el-col>
<el-col
class=
"node-detail"
:span=
"1
6
"
>
<el-col
class=
"node-detail"
:span=
"1
5
"
>
<el-row
:gutter=
"20"
>
<el-row
:gutter=
"20"
>
<el-col
:span=
"24"
class=
"mg-bt20"
>
<el-col
:span=
"24"
class=
"mg-bt20"
>
<el-input
placeholder=
"请输入标题"
v-model=
"currentData.title"
>
<el-input
placeholder=
"请输入标题"
v-model=
"currentData.title"
>
...
@@ -114,6 +114,22 @@
...
@@ -114,6 +114,22 @@
</el-col>
</el-col>
</el-row>
</el-row>
</el-collapse-transition>
</el-collapse-transition>
<div
class=
"next-prev"
>
<el-button
size=
"mini"
type=
"primary"
icon=
"el-icon-back"
@
click=
"handleToUnit('prev')"
>
上一节点
</el-button
>
<el-button
size=
"mini"
type=
"primary"
icon=
"el-icon-right"
@
click=
"handleToUnit('next')"
>
下一节点
</el-button
>
</div>
</el-col>
</el-col>
</el-row>
</el-row>
<el-button
<el-button
...
@@ -178,7 +194,6 @@ export default {
...
@@ -178,7 +194,6 @@ export default {
loopData
(
that
.
treeData
);
loopData
(
that
.
treeData
);
function
loopData
(
arr
)
{
function
loopData
(
arr
)
{
if
(
arr
.
length
>
0
)
{
if
(
arr
.
length
>
0
)
{
console
.
log
(
arr
);
arr
.
forEach
((
item
)
=>
{
arr
.
forEach
((
item
)
=>
{
if
(
item
.
culturalRelics
&&
item
.
culturalRelics
.
length
>
0
)
{
if
(
item
.
culturalRelics
&&
item
.
culturalRelics
.
length
>
0
)
{
that
.
$set
(
that
,
"CRList"
,
item
.
culturalRelics
);
that
.
$set
(
that
,
"CRList"
,
item
.
culturalRelics
);
...
@@ -247,6 +262,7 @@ export default {
...
@@ -247,6 +262,7 @@ export default {
},
},
methods
:
{
methods
:
{
getUnitData
()
{
getUnitData
()
{
return
this
.
treeData
;
return
this
.
treeData
;
},
},
// 关联文献查询
// 关联文献查询
...
@@ -297,7 +313,7 @@ export default {
...
@@ -297,7 +313,7 @@ export default {
intro
:
""
,
intro
:
""
,
showMediaUploader
:
false
,
showMediaUploader
:
false
,
images
:
""
,
images
:
""
,
imagesVo
:[],
imagesVo
:
[],
crIds
:
[],
crIds
:
[],
videos
:
""
,
videos
:
""
,
children
:
[],
children
:
[],
...
@@ -320,7 +336,7 @@ export default {
...
@@ -320,7 +336,7 @@ export default {
crIds
:
[],
crIds
:
[],
showMediaUploader
:
false
,
showMediaUploader
:
false
,
images
:
""
,
images
:
""
,
imagesVo
:[],
imagesVo
:
[],
videos
:
""
,
videos
:
""
,
children
:
[],
children
:
[],
};
};
...
@@ -328,7 +344,7 @@ export default {
...
@@ -328,7 +344,7 @@ export default {
if
(
parent
instanceof
Array
)
{
if
(
parent
instanceof
Array
)
{
parent
.
push
(
newChild
);
parent
.
push
(
newChild
);
}
else
{
}
else
{
parent
.
children
.
push
(
newChild
)
parent
.
children
.
push
(
newChild
)
;
}
}
},
},
remove
(
node
,
data
)
{
remove
(
node
,
data
)
{
...
@@ -342,8 +358,8 @@ export default {
...
@@ -342,8 +358,8 @@ export default {
const
index
=
children
.
findIndex
((
d
)
=>
d
.
euId
===
data
.
euId
);
const
index
=
children
.
findIndex
((
d
)
=>
d
.
euId
===
data
.
euId
);
children
.
splice
(
index
,
1
);
children
.
splice
(
index
,
1
);
},
},
changeFileList
(
fileList
){
changeFileList
(
fileList
)
{
this
.
currentData
.
imagesVo
=
fileList
this
.
currentData
.
imagesVo
=
fileList
;
},
},
handleAddUnit
(
type
)
{
handleAddUnit
(
type
)
{
switch
(
type
)
{
switch
(
type
)
{
...
@@ -384,6 +400,60 @@ export default {
...
@@ -384,6 +400,60 @@ export default {
console
.
log
(
"editor change!"
,
quill
,
html
,
text
);
console
.
log
(
"editor change!"
,
quill
,
html
,
text
);
this
.
content
=
html
;
this
.
content
=
html
;
},
},
handleToUnit
(
type
)
{
// debugger
const
{
euId
}
=
this
.
currentData
;
let
next
=
{};
let
prev
=
{};
let
that
=
this
;
// debugger
traverseTree
(
this
.
treeData
);
console
.
log
(
"next"
,
next
);
console
.
log
(
"prev"
,
prev
);
function
traverseTree
(
arr
)
{
if
(
arr
&&
arr
.
length
>
0
)
{
arr
.
map
((
item
,
index
)
=>
{
if
(
item
.
euId
==
euId
)
{
console
.
log
(
item
);
switch
(
type
)
{
case
"next"
:
if
(
arr
[
index
+
1
])
{
next
=
arr
[
index
+
1
];
that
.
currentData
=
next
;
}
else
{
that
.
$message
.
info
(
"已是最后一个节点!"
);
}
break
;
case
"prev"
:
if
(
arr
[
index
-
1
])
{
prev
=
arr
[
index
-
1
];
that
.
currentData
=
prev
;
}
else
{
that
.
$message
.
info
(
"已是第一个节点!"
);
}
break
;
}
}
else
{
// debugger
if
(
item
.
children
&&
item
.
children
.
length
>
0
)
{
traverseTree
(
item
.
children
);
}
}
});
}
}
// this.treeData.map();
// switch (type) {
// case "prev":
// console.log(1);
// break;
// case "next":
// console.log(-1);
// break;
// }
},
},
},
};
};
</
script
>
</
script
>
...
@@ -394,7 +464,7 @@ export default {
...
@@ -394,7 +464,7 @@ export default {
width
:
100%
;
width
:
100%
;
flex-direction
:
column
;
flex-direction
:
column
;
.title
{
.title
{
width
:
1
00px
;
width
:
2
00px
;
overflow
:
hidden
;
overflow
:
hidden
;
white-space
:
nowrap
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
text-overflow
:
ellipsis
;
...
@@ -477,6 +547,10 @@ export default {
...
@@ -477,6 +547,10 @@ export default {
white-space
:
pre-wrap
;
white-space
:
pre-wrap
;
}
}
}
}
.next-prev
{
display
:
flex
;
justify-content
:
flex-end
;
}
</
style
>
</
style
>
<
style
lang=
'scss'
>
<
style
lang=
'scss'
>
...
...
src/views/display/components/InfoEditDialog.vue
浏览文件 @
7039b69c
<
template
>
<
template
>
<el-dialog
<el-dialog
:visible
.
sync=
"dialogVisible"
:visible
.
sync=
"dialogVisible"
width=
"8
0
%"
width=
"8
6
%"
style=
"height: 98%"
style=
"height: 98%"
:before-close=
"handleClose"
:before-close=
"handleClose"
top=
"2vh"
top=
"2vh"
...
@@ -527,63 +527,90 @@ export default {
...
@@ -527,63 +527,90 @@ export default {
let
unitData
=
[...
this
.
$refs
[
"exhibitionUnits"
].
getUnitData
()];
let
unitData
=
[...
this
.
$refs
[
"exhibitionUnits"
].
getUnitData
()];
// debugger;
// debugger;
// return
// return
// 批量添加image进入formdata
addUnitI
ds
(
unitData
);
//添加unit的id作为上传文件的key
addUnitI
mgToFormData
(
unitData
);
function
addUnitI
ds
(
arr
)
{
function
addUnitI
mgToFormData
(
arr
)
{
if
(
arr
.
length
>
0
)
{
if
(
arr
.
length
>
0
)
{
arr
.
map
((
item
)
=>
{
arr
.
map
((
item
)
=>
{
unitIds
.
push
(
item
.
euId
);
// unitIds.push(item.euId);
if
(
item
.
imagesVo
&&
item
.
imagesVo
.
length
>
0
)
{
let
imageFiles
=
item
.
imagesVo
;
imageFiles
.
map
((
imgFile
)
=>
{
if
(
imgFile
.
status
===
"ready"
)
{
formData
.
append
(
`unit-images-
${
item
.
euId
}
`
,
imgFile
.
raw
);
}
else
{
//
if
(
successFilesObj
[
`unit-images-
${
item
.
euId
}
`
])
{
successFilesObj
[
`unit-images-
${
item
.
euId
}
`
].
push
(
imgFile
);
}
else
{
successFilesObj
[
`unit-images-
${
item
.
euId
}
`
]
=
[
imgFile
];
}
}
});
}
if
(
item
.
children
)
{
if
(
item
.
children
)
{
addUnitI
ds
(
item
.
children
);
addUnitI
mgToFormData
(
item
.
children
);
}
}
});
});
}
}
}
}
unitIds
.
map
(
async
(
euId
)
=>
{
let
exhibitionUnitsDom
=
this
.
$refs
.
exhibitionUnits
;
let
imageFiles
=
[];
let
videoFiles
=
[];
if
(
exhibitionUnitsDom
.
$refs
[
`unit-images-
${
euId
}
`
])
{
imageFiles
=
[
...
exhibitionUnitsDom
.
$refs
[
`unit-images-
${
euId
}
`
].
getFiles
(),
];
// debugger
}
if
(
exhibitionUnitsDom
.
$refs
[
`unit-videos-
${
euId
}
`
])
{
// addUnitIds(unitData); //添加unit的id作为上传文件的key
videoFiles
=
[
// function addUnitIds(arr) {
...
exhibitionUnitsDom
.
$refs
[
`unit-videos-
${
euId
}
`
].
getFiles
(),
// if (arr.length > 0) {
];
// arr.map((item) => {
}
// unitIds.push(item.euId);
// if (item.children) {
// addUnitIds(item.children);
// }
// });
// }
// }
// unitIds.map(async (euId) => {
// let exhibitionUnitsDom = this.$refs.exhibitionUnits;
// let imageFiles = [];
// let videoFiles = [];
// if (exhibitionUnitsDom.$refs[`unit-images-${euId}`]) {
// imageFiles = [
// ...exhibitionUnitsDom.$refs[`unit-images-${euId}`].getFiles(),
// ];
// // debugger
// }
if
(
imageFiles
.
length
>
0
)
{
// if (exhibitionUnitsDom.$refs[`unit-videos-${euId}`]) {
imageFiles
.
forEach
((
imgFile
)
=>
{
// videoFiles = [
if
(
imgFile
.
status
===
"ready"
)
{
// ...exhibitionUnitsDom.$refs[`unit-videos-${euId}`].getFiles(),
formData
.
append
(
`unit-images-
${
euId
}
`
,
imgFile
.
raw
);
// ];
}
else
{
// }
//
if
(
successFilesObj
[
`unit-images-
${
euId
}
`
])
{
// if (imageFiles.length > 0) {
successFilesObj
[
`unit-images-
${
euId
}
`
].
push
(
imgFile
);
// imageFiles.forEach((imgFile) => {
}
else
{
// if (imgFile.status === "ready") {
successFilesObj
[
`unit-images-
${
euId
}
`
]
=
[
imgFile
];
// formData.append(`unit-images-${euId}`, imgFile.raw);
}
// } else {
}
// //
});
// if (successFilesObj[`unit-images-${euId}`]) {
}
// successFilesObj[`unit-images-${euId}`].push(imgFile);
if
(
videoFiles
.
length
>
0
)
{
// } else {
videoFiles
.
forEach
((
videoFile
)
=>
{
// successFilesObj[`unit-images-${euId}`] = [imgFile];
if
(
videoFile
.
status
===
"ready"
)
{
// }
formData
.
append
(
`unit-videos-
${
euId
}
`
,
videoFile
.
raw
);
// }
}
else
{
// });
if
(
successFilesObj
[
`unit-videos-
${
euId
}
`
])
{
// }
successFilesObj
[
`unit-videos-
${
euId
}
`
].
push
(
videoFiles
);
// if (videoFiles.length > 0) {
}
else
{
// videoFiles.forEach((videoFile) => {
successFilesObj
[
`unit-videos-
${
euId
}
`
]
=
[
videoFiles
];
// if (videoFile.status === "ready") {
}
// formData.append(`unit-videos-${euId}`, videoFile.raw);
}
// } else {
});
// if (successFilesObj[`unit-videos-${euId}`]) {
}
// successFilesObj[`unit-videos-${euId}`].push(videoFiles);
});
// } else {
// successFilesObj[`unit-videos-${euId}`] = [videoFiles];
// }
// }
// });
// }
// });
// 上传所有媒体文件
// 上传所有媒体文件
let
filesObj
=
{};
let
filesObj
=
{};
...
...
src/views/display/index.vue
浏览文件 @
7039b69c
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
<template
v-slot:status=
"data"
>
<template
v-slot:status=
"data"
>
<el-popconfirm
<el-popconfirm
:title=
"getStatusTitle(data.scope.status)"
:title=
"getStatusTitle(data.scope.status)"
@
confirm=
"handleChangeStatus(data.scope.status
)"
@
onConfirm=
"handleChangeStatus(data.scope
)"
>
>
<el-switch
<el-switch
slot=
"reference"
slot=
"reference"
...
@@ -98,7 +98,12 @@
...
@@ -98,7 +98,12 @@
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
{
getList
,
deleteDisplay
,
getDisplayById
}
from
"@/api/display"
;
import
{
getList
,
deleteDisplay
,
getDisplayById
,
editDisplay
,
}
from
"@/api/display"
;
import
InfoEditDialog
from
"./components/InfoEditDialog"
;
import
InfoEditDialog
from
"./components/InfoEditDialog"
;
import
PreviewDialog
from
"./components/PreviewDialog"
;
import
PreviewDialog
from
"./components/PreviewDialog"
;
import
CopyDialog
from
"./components/CopyDialog"
;
import
CopyDialog
from
"./components/CopyDialog"
;
...
@@ -238,7 +243,7 @@ export default {
...
@@ -238,7 +243,7 @@ export default {
}
}
},
},
handlePreview
(){
handlePreview
()
{
// debugger
// debugger
// this.previewDialogVisible = true;
// this.previewDialogVisible = true;
// console.log(this.previewDialogVisible);
// console.log(this.previewDialogVisible);
...
@@ -271,8 +276,18 @@ export default {
...
@@ -271,8 +276,18 @@ export default {
break
;
break
;
}
}
},
},
handleChangeStatus
(
status
)
{
async
handleChangeStatus
(
row
)
{
console
.
log
(
"status"
,
status
);
const
{
status
}
=
row
;
let
newStatus
=
status
===
"0"
?
"1"
:
"0"
;
const
params
=
{
...
row
,
status
:
newStatus
,
};
let
res
=
await
editDisplay
(
params
);
if
(
res
.
code
==
0
)
{
this
.
loadData
();
this
.
$message
.
success
(
"修改成功!"
);
}
},
},
// 多选
// 多选
handleSelectionChange
(
val
)
{
handleSelectionChange
(
val
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论