Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
exhibition_backstage
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
龙菲
exhibition_backstage
Commits
8ce391d6
提交
8ce391d6
authored
7月 07, 2022
作者:
龙菲
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat:完善虚拟展厅
上级
0d1a6d1a
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
119 行增加
和
104 行删除
+119
-104
org.js
src/api/org.js
+0
-1
index.vue
src/components/Breadcrumb/index.vue
+1
-1
index.js
src/router/index.js
+14
-15
index.vue
src/views/dashboard/index.vue
+1
-1
InfoEditDialog.vue
src/views/museum/components/InfoEditDialog.vue
+31
-44
index.vue
src/views/museum/index.vue
+6
-9
InfoEditDialog.vue
src/views/virtual/components/InfoEditDialog.vue
+8
-23
config.js
src/views/virtual/config.js
+5
-2
index.vue
src/views/virtual/index.vue
+51
-7
vue.config.js
vue.config.js
+2
-1
没有找到文件。
src/api/org.js
浏览文件 @
8ce391d6
...
...
@@ -52,7 +52,6 @@ export function deleteMuseum(id) {
return
request
({
url
:
`/sys/dept/
${
id
}
`
,
method
:
'delete'
,
data
})
}
...
...
src/components/Breadcrumb/index.vue
浏览文件 @
8ce391d6
...
...
@@ -33,7 +33,7 @@ export default {
const
first
=
matched
[
0
]
if
(
!
this
.
isDashboard
(
first
))
{
matched
=
[{
path
:
'/dashboard'
,
meta
:
{
title
:
'
Dashboard
'
}}].
concat
(
matched
)
matched
=
[{
path
:
'/dashboard'
,
meta
:
{
title
:
'
首页
'
}}].
concat
(
matched
)
}
this
.
levelList
=
matched
.
filter
(
item
=>
item
.
meta
&&
item
.
meta
.
title
&&
item
.
meta
.
breadcrumb
!==
false
)
...
...
src/router/index.js
浏览文件 @
8ce391d6
...
...
@@ -42,24 +42,23 @@ export const constantRoutes = [{
hidden
:
true
},
// {
// path: '/',
// component: Layout,
// redirect: '/dashboard',
// children: [{
// path: 'dashboard',
// name: 'Dashboard',
// component: () => import('@/views/dashboard/index'),
// meta: {
// title: 'Dashboard',
// icon: 'dashboard'
// }
// }]
// },
{
path
:
'/'
,
component
:
Layout
,
redirect
:
'/display'
,
redirect
:
'/dashboard'
,
children
:
[{
path
:
'dashboard'
,
name
:
'Dashboard'
,
component
:
()
=>
import
(
'@/views/dashboard/index'
),
meta
:
{
title
:
'首页'
,
icon
:
'dashboard'
}
}]
},
{
path
:
'/display'
,
component
:
Layout
,
children
:
[{
path
:
'display'
,
name
:
'Display'
,
...
...
src/views/dashboard/index.vue
浏览文件 @
8ce391d6
<
template
>
<div
class=
"dashboard-container"
>
<div
class=
"dashboard-text"
>
name:
{{
name
}}
</div>
<div
class=
"dashboard-text"
>
数据看板
</div>
</div>
</
template
>
...
...
src/views/museum/components/InfoEditDialog.vue
浏览文件 @
8ce391d6
...
...
@@ -28,6 +28,7 @@
:props=
"optionProps"
placeholder=
"请选择所属部门"
:key=
"pidModalKey"
disabled
>
</el-cascader>
</el-form-item>
...
...
@@ -43,21 +44,26 @@
</el-cascader>
</el-form-item>
<el-form-item
label=
"经度"
:label-width=
"formLabelWidth"
>
<el-input
v-model=
"dialogForm.longitude"
autocomplete=
"off"
placeholder=
"请输入经度"
></el-input>
</el-form-item>
<el-form-item
label=
"纬度"
:label-width=
"formLabelWidth"
>
<el-input
v-model=
"dialogForm.latitude"
autocomplete=
"off"
placeholder=
"请输入纬度"
></el-input>
</el-form-item>
<el-row
:gutter=
"5"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"经度"
:label-width=
"formLabelWidth"
>
<el-input
style=
"width: 100%"
v-model=
"dialogForm.longitude"
autocomplete=
"off"
placeholder=
"请输入经度"
></el-input>
</el-form-item>
</el-col>
<el-col
:span=
"12"
><el-form-item
label=
"纬度"
:label-width=
"formLabelWidth"
>
<el-input
v-model=
"dialogForm.latitude"
autocomplete=
"off"
placeholder=
"请输入纬度"
></el-input>
</el-form-item
></el-col>
</el-row>
<el-form-item
label=
"状态"
:label-width=
"formLabelWidth"
>
<el-switch
v-model=
"status"
>
</el-switch>
</el-form-item>
...
...
@@ -142,6 +148,7 @@ export default {
handler
:
function
(
value
)
{
let
that
=
this
;
that
.
dialogForm
=
JSON
.
parse
(
JSON
.
stringify
(
value
));
// 编辑状态
if
(
that
.
dialogForm
.
id
)
{
that
.
status
=
Boolean
(
Number
(
that
.
dialogForm
.
status
));
...
...
@@ -156,41 +163,21 @@ export default {
];
}
// 编辑状态下禁用当前所属地之下的节点
if
(
this
.
regionTree
.
length
>
0
)
{
this
.
regionTree
.
forEach
((
item
,
index
)
=>
{
// TODO:
if
(
item
.
regionCode
==
this
.
dialogForm
.
regionCode
)
{
item
.
disabled
=
true
;
// 修改当前这一层和下面一层为禁用
// for (let index = 0; index
<
this
.
regionTree
.
length
;
index
++
)
{
// this.regionTree[index].disabled = true
// if (this.regionTree[index].children) {
// }
// }
}
});
}
}
},
immediate
:
true
,
deep
:
true
,
},
orgTreeData
(
value
)
{
// 遍历,如果children为空,则直接去掉children,以免选择器中显示无结果
if
(
value
)
{
let
tree
=
[...
value
];
loopTree
(
tree
);
function
loopTree
(
arr
)
{
arr
.
forEach
((
item
)
=>
{
if
(
item
.
children
&&
item
.
children
.
length
==
0
)
{
delete
item
.
children
;
}
else
{
loopTree
(
item
.
children
);
}
});
orgTreeData
:
{
handler
:
function
(
value
)
{
if
(
value
&&
value
.
length
>
0
)
{
if
(
value
.
length
>
0
&&
!
this
.
dialogForm
.
id
)
{
this
.
dialogForm
.
pid
=
value
[
0
].
id
;
//新增状态下,将所属部门默认填写为树结构根节点
}
}
}
},
immediate
:
true
,
deep
:
true
,
},
status
(
value
)
{
console
.
log
(
value
);
...
...
src/views/museum/index.vue
浏览文件 @
8ce391d6
...
...
@@ -83,7 +83,7 @@ import TableOperation from "@/components/Table/TableOperation.vue";
import
{
title
,
operates
,
operations
}
from
"./config"
;
import
InfoEditDialog
from
"./components/InfoEditDialog"
;
import
SearchBar
from
"@/components/SearchBar"
;
import
{
delete
Files
}
from
"@/api/file
"
;
import
{
delete
Museum
}
from
"@/api/org
"
;
export
default
{
components
:
{
TablePage
,
...
...
@@ -135,10 +135,6 @@ export default {
this
.
dict
=
value
;
}
},
orgTreeData
(
value
)
{
console
.
log
(
"123"
,
value
);
// setTimeout(()=>{value},500)
},
},
computed
:
{
tableTitle
()
{
...
...
@@ -244,9 +240,10 @@ export default {
break
;
case
"delete"
:
const
{
id
}
=
row
;
let
res
=
await
delete
Files
([
id
]
);
let
res
=
await
delete
Museum
(
id
);
if
(
res
.
code
==
0
)
{
this
.
$message
.
success
(
"删除成功!"
);
this
.
loadData
(
true
);
}
break
;
}
...
...
@@ -261,7 +258,7 @@ export default {
};
let
res
=
await
editCulturalRelic
(
params
);
if
(
res
.
code
==
0
)
{
this
.
loadData
();
this
.
loadData
(
true
);
this
.
$message
.
success
(
"修改成功!"
);
}
},
...
...
@@ -273,13 +270,13 @@ export default {
// 改变页容量
handleSizeChange
(
value
)
{
this
.
list
.
size
=
value
;
this
.
loadData
();
this
.
loadData
(
true
);
},
// 改变当前显示页
handleCurrentChange
(
value
)
{
this
.
list
.
current
=
value
;
this
.
loadData
(
);
this
.
loadData
(
true
);
},
// 搜索
...
...
src/views/virtual/components/InfoEditDialog.vue
浏览文件 @
8ce391d6
...
...
@@ -23,7 +23,7 @@
<el-form-item
label=
"所属博物馆"
:label-width=
"formLabelWidth"
>
<el-cascader
style=
"width: 100%"
v-model=
"dialogForm.
pi
d"
v-model=
"dialogForm.
deptI
d"
:options=
"orgTreeData"
:props=
"optionProps"
placeholder=
"请选择所属博物馆"
...
...
@@ -109,7 +109,7 @@ export default {
set
:
function
()
{},
},
title
()
{
if
(
this
.
dialogForm
.
i
d
)
{
if
(
this
.
dialogForm
.
bvI
d
)
{
return
"修改虚拟展厅信息"
;
}
else
{
return
"添加虚拟展厅"
;
...
...
@@ -128,7 +128,8 @@ export default {
let
that
=
this
;
that
.
dialogForm
=
JSON
.
parse
(
JSON
.
stringify
(
value
));
// 编辑状态
if
(
that
.
dialogForm
.
id
)
{
if
(
that
.
dialogForm
.
bvId
)
{
console
.
log
(
'that.dialogForm.'
,
that
.
dialogForm
);
that
.
status
=
Boolean
(
Number
(
that
.
dialogForm
.
status
));
// 回填封面
if
(
this
.
dialogForm
.
faceImage
)
{
...
...
@@ -140,22 +141,6 @@ export default {
},
];
}
// 编辑状态下禁用当前所属地之下的节点
if
(
this
.
regionTree
.
length
>
0
)
{
this
.
regionTree
.
forEach
((
item
,
index
)
=>
{
// TODO:
if
(
item
.
regionCode
==
this
.
dialogForm
.
regionCode
)
{
item
.
disabled
=
true
;
// 修改当前这一层和下面一层为禁用
// for (let index = 0; index
<
this
.
regionTree
.
length
;
index
++
)
{
// this.regionTree[index].disabled = true
// if (this.regionTree[index].children) {
// }
// }
}
});
}
}
},
immediate
:
true
,
...
...
@@ -236,7 +221,7 @@ export default {
});
},
async
handleSubmit
()
{
if
(
this
.
dialogForm
.
i
d
)
{
if
(
this
.
dialogForm
.
bvI
d
)
{
let
params
=
{
...
this
.
dialogForm
};
// 回填图片
if
(
this
.
faceImage
.
length
>
0
)
{
...
...
@@ -248,8 +233,8 @@ export default {
params
.
regionCode
=
params
.
regionCode
[
params
.
regionCode
.
length
-
1
];
}
// 处理所属部门
if
(
params
.
pi
d
instanceof
Array
)
{
params
.
pid
=
params
.
pid
[
params
.
pi
d
.
length
-
1
];
if
(
params
.
deptI
d
instanceof
Array
)
{
params
.
deptId
=
params
.
deptId
[
params
.
deptI
d
.
length
-
1
];
}
// 处理状态
// debugger
...
...
@@ -268,7 +253,7 @@ export default {
// 处理行政区划
params
.
regionCode
=
params
.
regionCode
[
params
.
regionCode
.
length
-
1
];
// 处理所属部门
params
.
pid
=
params
.
pid
[
params
.
pi
d
.
length
-
1
];
params
.
deptId
=
params
.
deptId
[
params
.
deptI
d
.
length
-
1
];
// 处理状态
params
.
status
=
this
.
status
?
1
:
0
;
// return
...
...
src/views/virtual/config.js
浏览文件 @
8ce391d6
...
...
@@ -10,9 +10,10 @@ export const title = [{
columnAlign
:
'center'
,
},
{
prop
:
"faceImage"
,
prop
:
"faceImage
Url
"
,
label
:
"封面"
,
columnAlign
:
'center'
,
isFaceImage
:
true
,
},
{
prop
:
"regionName"
,
...
...
@@ -23,12 +24,14 @@ export const title = [{
prop
:
"status"
,
label
:
"状态"
,
columnAlign
:
'center'
,
isStatus
:
true
isStatus
:
true
,
width
:
100
},
{
prop
:
"url"
,
label
:
"链接"
,
columnAlign
:
'center'
,
width
:
350
},
]
...
...
src/views/virtual/index.vue
浏览文件 @
8ce391d6
...
...
@@ -6,7 +6,7 @@
type=
"primary"
@
click
.
native=
"handleOperation(
{ type: 'add' })"
>
<i
class=
"el-icon-s-promotion"
></i
>
<i
class=
"el-icon-s-promotion"
/
>
发布
</el-button
>
</div>
...
...
@@ -15,10 +15,20 @@
:tableTitle=
"tableTitle"
:operates=
"tableOperates"
>
<template
v-slot:faceImageUrl=
"data"
>
<img
:src=
"data.scope.faceImageUrl"
alt=
"查看大图"
v-if=
"data.scope.faceImageUrl"
style=
"cursor: pointer"
width=
"100px"
@
click=
"handelPreviewImages(data.scope.faceImageUrl)"
/>
</
template
>
<
template
v-slot:status=
"data"
>
<el-popconfirm
:title=
"getStatusTitle(data.scope.status)"
@
confirm=
"handleChangeStatus(data.scope.status
)"
@
onConfirm=
"handleChangeStatus(data.scope
)"
>
<el-switch
slot=
"reference"
...
...
@@ -26,6 +36,7 @@
></el-switch>
</el-popconfirm>
</
template
>
<
template
v-slot:operates=
"scope"
>
<TableOperation
:operations=
"tableOperations"
...
...
@@ -48,9 +59,15 @@
<InfoEditDialog
:visible=
"drawerVisible"
:form=
"form"
:orgTreeData=
"orgTreeData"
@
handleClose=
"handleClose"
@
refresh=
"loadData"
/>
<el-image-viewer
v-if=
"imgViewerVisible"
:on-close=
"closeImgViewer"
:url-list=
"imgList"
/>
</div>
</template>
...
...
@@ -58,7 +75,7 @@
import
TablePage
from
"@/components/Table/TablePage.vue"
;
import
TableOperation
from
"@/components/Table/TableOperation.vue"
;
import
{
title
,
operates
,
operations
}
from
"./config"
;
import
{
deleteVirtual
,
getVirtualList
}
from
"@/api/vitual"
;
import
{
deleteVirtual
,
editVirtual
,
getVirtualList
}
from
"@/api/vitual"
;
import
InfoEditDialog
from
"./components/InfoEditDialog"
;
import
SearchBar
from
"@/components/SearchBar"
;
...
...
@@ -68,6 +85,8 @@ export default {
TableOperation
,
InfoEditDialog
,
SearchBar
,
"el-image-viewer"
:
()
=>
import
(
"element-ui/packages/image/src/image-viewer"
),
},
data
()
{
return
{
...
...
@@ -106,13 +125,16 @@ export default {
drawerVisible
:
false
,
form
:
{
name
:
""
,
//名称
pi
d
:
""
,
//所属博物馆
deptI
d
:
""
,
//所属博物馆
regionCode
:
""
,
//所属地code
status
:
false
,
//上下架状态
faceImage
:
""
,
//封面
url
:
""
,
//链接
},
loading
:
false
,
orgTreeData
:
[],
imgViewerVisible
:
false
,
imgList
:
[],
};
},
watch
:
{
...
...
@@ -144,6 +166,7 @@ export default {
},
mounted
()
{
this
.
loadData
();
this
.
loadOrgTree
();
},
methods
:
{
async
search
(
form
)
{
...
...
@@ -177,7 +200,11 @@ export default {
this
.
list
=
res
.
data
;
}
},
loadOrgTree
()
{
this
.
$store
.
dispatch
(
"org/getMuseumTreeData"
,
true
).
then
((
res
)
=>
{
this
.
orgTreeData
=
res
;
});
},
async
handleOperation
(
value
,
row
)
{
console
.
log
(
"handleOperation"
,
value
,
row
);
switch
(
value
.
type
)
{
...
...
@@ -192,7 +219,7 @@ export default {
this
.
drawerVisible
=
true
;
break
;
case
"delete"
:
let
deleteRes
=
await
deleteVirtual
([
row
.
cr
Id
]);
let
deleteRes
=
await
deleteVirtual
([
row
.
bv
Id
]);
if
(
deleteRes
.
code
==
0
)
{
this
.
$message
.
success
(
"删除成功!"
);
this
.
loadData
();
...
...
@@ -200,6 +227,20 @@ export default {
break
;
}
},
// 关闭预览图片
closeImgViewer
()
{
this
.
imgViewerVisible
=
false
;
},
// 预览图片
handelPreviewImages
(
images
)
{
this
.
imgViewerVisible
=
true
;
if
(
images
.
length
>
1
)
{
this
.
imgList
=
images
.
split
(
","
);
}
else
{
this
.
imgList
=
[
images
];
}
},
async
handleChangeStatus
(
row
)
{
console
.
log
(
"status"
,
row
);
const
{
status
}
=
row
;
...
...
@@ -208,7 +249,7 @@ export default {
...
row
,
status
:
newStatus
,
};
let
res
=
await
edit
CulturalRelic
(
params
);
let
res
=
await
edit
Virtual
(
params
);
if
(
res
.
code
==
0
)
{
this
.
loadData
();
this
.
$message
.
success
(
"修改成功!"
);
...
...
@@ -251,6 +292,9 @@ export default {
// 关闭Dialog
handleClose
()
{
this
.
drawerVisible
=
false
;
this
.
form
=
{
status
:
true
,
};
},
},
};
...
...
vue.config.js
浏览文件 @
8ce391d6
...
...
@@ -27,7 +27,8 @@ module.exports = {
publicPath
:
'/'
,
outputDir
:
'dist'
,
assetsDir
:
'static'
,
lintOnSave
:
process
.
env
.
NODE_ENV
===
'development'
,
// lintOnSave: process.env.NODE_ENV === 'development',
lintOnSave
:
false
,
productionSourceMap
:
false
,
devServer
:
{
port
:
port
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论