Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
exhibition_backstage
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
龙菲
exhibition_backstage
Commits
1e7b8bbf
提交
1e7b8bbf
authored
7月 26, 2022
作者:
龙菲
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加文献管理、日志管理、布展增加关联文物、文物导入
上级
2f49a7ab
显示空白字符变更
内嵌
并排
正在显示
20 个修改的文件
包含
1427 行增加
和
46 行删除
+1427
-46
upload_cr_template.zip
public/static/upload_cr_template.zip
+0
-0
culturalRelic.js
src/api/culturalRelic.js
+28
-0
literature.js
src/api/literature.js
+8
-1
log.js
src/api/log.js
+10
-0
index.vue
src/components/SearchBar/index.vue
+2
-2
ManualUploader.vue
src/components/Uploader/ManualUploader.vue
+0
-5
dict.js
src/store/modules/dict.js
+37
-2
file.js
src/utils/file.js
+39
-10
MultiUploadDialog.vue
src/views/culturalRelic/components/MultiUploadDialog.vue
+236
-0
config.js
src/views/culturalRelic/config.js
+42
-2
import.vue
src/views/culturalRelic/import.vue
+159
-0
index.vue
src/views/culturalRelic/index.vue
+33
-10
InfoEditDialog.vue
src/views/display/components/InfoEditDialog.vue
+73
-4
index.vue
src/views/display/index.vue
+1
-1
InfoEditDialog.vue
src/views/literature/components/InfoEditDialog.vue
+242
-0
config.js
src/views/literature/config.js
+73
-0
index.vue
src/views/literature/index.vue
+238
-4
config.js
src/views/log/config.js
+49
-0
index.vue
src/views/log/index.vue
+156
-4
index.vue
src/views/museum/index.vue
+1
-1
没有找到文件。
public/static/upload_cr_template.zip
0 → 100644
浏览文件 @
1e7b8bbf
File added
src/api/culturalRelic.js
浏览文件 @
1e7b8bbf
...
...
@@ -39,3 +39,30 @@ export function deleteCultralRelic(data) {
data
})
}
// // 导入文件
// export function importZip(data) {
// return request({
// url: '/bizImport/importZip',
// method: 'post',
// data
// })
// }
// 查询导入批次分页
export
function
getImportListPage
(
data
)
{
return
request
({
url
:
'/bizImport/listByPage'
,
method
:
'post'
,
data
})
}
// 查询导入批次
export
function
getImportNum
(
data
)
{
return
request
({
url
:
'/bizImport/batchNum'
,
method
:
'post'
,
data
})
}
\ No newline at end of file
src/api/literature.js
浏览文件 @
1e7b8bbf
...
...
@@ -4,8 +4,15 @@ import request from '@/utils/request'
export
function
getLiteratureList
(
data
)
{
return
request
({
url
:
'sysLiterature/listByPage'
,
url
:
'
/
sysLiterature/listByPage'
,
method
:
'post'
,
data
})
}
export
function
editLiterature
(
data
)
{
return
request
({
url
:
'/sysLiterature/update'
,
method
:
'put'
,
data
})
}
src/api/log.js
浏览文件 @
1e7b8bbf
import
request
from
'@/utils/request'
export
function
getLogList
(
data
)
{
return
request
({
url
:
'/sysOptLog/listByPage'
,
method
:
'post'
,
data
})
}
src/components/SearchBar/index.vue
浏览文件 @
1e7b8bbf
...
...
@@ -8,12 +8,12 @@
<el-input
v-if=
"item.type == 'input'"
v-model=
"searchData[item.prop]"
:placeholder=
"
item.placeholder || item.label
"
:placeholder=
"
`请输入$
{item.placeholder || item.label}`
"
>
</el-input>
<el-select
v-if=
"item.type == 'select'"
v-model=
"searchData[item.prop]"
:placeholder=
"
item.placeholder || item.label
"
:placeholder=
"
`请选择$
{item.placeholder || item.label}`
"
>
<el-option
:label=
"option.label"
...
...
src/components/Uploader/ManualUploader.vue
浏览文件 @
1e7b8bbf
...
...
@@ -70,11 +70,6 @@ export default {
},
data
()
{
return
{
uploadUrl
:
process
.
env
.
NODE_ENV
===
"test"
||
process
.
env
.
NODE_ENV
===
"development"
?
"/api/sysFiles/upload"
:
process
.
env
.
NODE_ENV
+
"/sysFiles/upload"
,
// 上传的图片服务器地址
fileList
:
[],
};
},
...
...
src/store/modules/dict.js
浏览文件 @
1e7b8bbf
import
{
getDictTree
}
from
'@/api/dict'
import
{
getCulturalRelicList
}
from
'@/api/culturalRelic'
const
state
=
{
dicts
:
{},
//{ displayTypes: }
dicts
:
{},
crList
:
[]
//文物列表,布展关联文物时使用
};
const
mutations
=
{
SET_DICTS
(
state
,
obj
)
{
state
.
dicts
[
obj
.
label
]
=
obj
.
value
;
},
SET_CR_LIST
(
state
,
crList
)
{
state
.
crList
=
crList
}
};
const
actions
=
{
...
...
@@ -31,7 +38,6 @@ const actions = {
});
return
new
Promise
((
resolve
,
reject
)
=>
{
getDictTree
(
requestDicts
).
then
(
res
=>
{
console
.
log
(
res
.
data
);
let
dictsObj
=
{}
requestDicts
.
forEach
(
reqDict
=>
{
dictsObj
[
reqDict
]
=
[]
...
...
@@ -51,7 +57,36 @@ const actions = {
})
});
},
getCrList
({
commit
},
{
isReload
,
params
})
{
// 如果是空或者需要重新加载则重新调取接口获取,否则直接获取状态管理中的
if
(
!
state
.
crList
||
state
.
crList
==
0
||
isReload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
getCulturalRelicList
(
params
).
then
(
response
=>
{
const
{
data
}
=
response
console
.
log
(
'response'
,
response
);
commit
(
'SET_CR_LIST'
,
data
.
records
)
resolve
(
response
)
}).
catch
(
error
=>
{
reject
(
error
)
})
})
}
else
{
return
new
Promise
((
resolve
,
reject
)
=>
{
resolve
(
state
.
crList
)
})
}
},
}
...
...
src/utils/file.js
浏览文件 @
1e7b8bbf
...
...
@@ -3,18 +3,21 @@ import {
getToken
}
from
'@/utils/auth'
var
uploadUrl
=
process
.
env
.
NODE_ENV
===
"test"
||
process
.
env
.
NODE_ENV
===
"development"
?
"/api/sysFiles/upload"
:
process
.
env
.
NODE_ENV
+
"/sysFiles/upload"
//
var uploadUrl =
//
process.env.NODE_ENV === "test" ||
//
process.env.NODE_ENV === "development" ?
//
"/api/sysFiles/upload" :
//
process.env.NODE_ENV + "/sysFiles/upload"
var
uploadV1Url
=
process
.
env
.
NODE_ENV
===
"test"
||
process
.
env
.
NODE_ENV
===
"development"
?
"/api/sysFiles/v1/upload"
:
process
.
env
.
NODE_ENV
+
"/sysFiles/v1/upload"
//
var uploadV1Url =
//
process.env.NODE_ENV === "test" ||
//
process.env.NODE_ENV === "development" ?
//
"/api/sysFiles/v1/upload" :
//
process.env.NODE_ENV + "/sysFiles/v1/upload"
var
uploadUrl
=
process
.
env
.
VUE_APP_BASE_API
+
"/sysFiles/upload"
var
uploadV1Url
=
process
.
env
.
VUE_APP_BASE_API
+
"/sysFiles/v1/upload"
var
importZipUrl
=
process
.
env
.
VUE_APP_BASE_API
+
"/bizImport/importZip"
/**
* 封装上传文件的post方法
* @param data
...
...
@@ -56,3 +59,29 @@ export function uploadV1(data) {
})
}
/**
* 批量上传文件
* @param data formData类型 * 参数1 type:导入数据类别(biz_cultural_relic、biz_exhibition二选一) 参数2 zipFile:zip压缩文件
* @param callback 用于获取上传进度
* @returns {Promise}
*/
export
function
importZip
(
data
,
callback
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
axios
.
post
(
importZipUrl
,
data
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data;boundary = '
+
new
Date
().
getTime
(),
'authorization'
:
getToken
(),
},
onUploadProgress
:
progressEvent
=>
{
// 原生获取上传进度的事件
if
(
progressEvent
.
lengthComputable
)
{
callback
&&
callback
(
progressEvent
);
}
},
}).
then
(
response
=>
{
resolve
(
response
.
data
)
}).
catch
(
error
=>
{
reject
(
error
)
})
})
}
src/views/culturalRelic/components/MultiUploadDialog.vue
0 → 100644
浏览文件 @
1e7b8bbf
<
template
>
<el-dialog
:visible=
"dialogVisible"
width=
"50%"
style=
"height: 98%"
:before-close=
"handleClose"
top=
"5vh"
lock-scroll
>
<div
class=
"title"
slot=
"title"
>
<div
class=
"divider"
></div>
<div
class=
"label"
>
<span
style=
"margin-right: 10px"
>
批量上传文物
</span>
<el-button
type=
"text"
icon=
"el-icon-download"
@
click=
"handleDownloadTemplate"
style=
"padding: 0"
>
下载模板文件
</el-button
>
</div>
</div>
<div
class=
"dialog-content"
>
<el-upload
class=
"upload-area"
drag
action=
"#"
accept=
".zip"
:auto-upload=
"false"
:show-file-list=
"false"
:on-change=
"handleChange"
>
<i
class=
"el-icon-upload"
></i>
<div
class=
"el-upload__text"
>
将文件拖到此处,或
<em>
点击上传
</em></div>
<div
class=
"el-upload__tip"
slot=
"tip"
>
只能上传.zip文件
</div>
</el-upload>
<div
class=
"upload-progress"
v-if=
"isUpLoading"
>
<div
class=
"subtitle"
>
<div
class=
"divider"
></div>
<div
class=
"label"
>
上传进度
</div>
</div>
<el-progress
:percentage=
"percentState"
:status=
"uploadStatus"
></el-progress>
</div>
<div
class=
"upload-records"
>
<div
class=
"subtitle"
>
<div
class=
"divider"
></div>
<div
class=
"label"
>
上传记录
</div>
</div>
<TablePage
:data=
"list.records"
:tableTitle=
"tableTitle"
/>
</div>
<div
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"handleClose"
>
关闭
</el-button>
</div>
</div>
</el-dialog>
</
template
>
<
script
>
import
TablePage
from
"@/components/Table/TablePage"
;
import
{
getImportListPage
}
from
"@/api/culturalRelic"
;
import
{
importZip
}
from
"@/utils/file"
;
export
default
{
name
:
"MultiUploadDialog"
,
components
:
{
TablePage
,
},
props
:
{
visible
:
{
type
:
Boolean
,
default
:
false
,
},
},
watch
:
{
// visible(value) {
// this.dialogVisible = value;
// },
visible
:
{
handler
:
function
(
value
)
{
this
.
dialogVisible
=
value
;
},
deep
:
true
,
immediate
:
true
,
},
},
data
()
{
return
{
dialogVisible
:
false
,
isUpLoading
:
false
,
percentState
:
0
,
uploadStatus
:
'primary'
,
list
:
{
records
:
[],
current
:
1
,
size
:
10
,
},
tableTitle
:
[
{
prop
:
"createTime"
,
label
:
"导入时间"
,
columnAlign
:
"center"
,
},
{
prop
:
"batchNum"
,
label
:
"导入批次"
,
columnAlign
:
"center"
,
},
{
prop
:
"fileName"
,
label
:
"文件名称"
,
columnAlign
:
"center"
,
},
{
prop
:
"fileSize"
,
label
:
"文件大小"
,
columnAlign
:
"center"
,
},
{
prop
:
"remark"
,
label
:
"备注"
,
columnAlign
:
"center"
,
},
],
};
},
mounted
()
{
this
.
loadData
();
},
methods
:
{
// 取消编辑
cancelForm
()
{
this
.
$emit
(
"handleClose"
);
},
async
loadData
()
{
const
params
=
{
limit
:
this
.
list
.
size
,
page
:
this
.
list
.
current
,
};
let
res
=
await
getImportListPage
(
params
);
this
.
list
=
res
.
data
;
},
handleClose
(
done
)
{
this
.
$confirm
(
"确认关闭?"
)
.
then
((
_
)
=>
{
done
();
this
.
$emit
(
"handleClose"
);
})
.
catch
((
_
)
=>
{});
},
handleDownloadTemplate
()
{
let
a
=
document
.
createElement
(
"a"
);
a
.
href
=
"./static/upload_cr_template.zip"
;
a
.
download
=
"批量上传文物模板.zip"
;
a
.
style
.
display
=
"none"
;
document
.
body
.
appendChild
(
a
);
a
.
click
();
a
.
remove
();
},
async
handleChange
(
file
,
fileList
)
{
console
.
log
(
"handleChange"
,
file
,
fileList
);
if
(
file
.
status
==
"ready"
)
{
this
.
isUpLoading
=
true
;
// TODO:
let
formData
=
new
FormData
();
formData
.
append
(
"type"
,
"biz_cultural_relic"
);
formData
.
append
(
"zipFile"
,
file
.
raw
);
let
res
=
await
importZip
(
formData
,
this
.
updateProgress
);
if
(
res
.
code
==
0
)
{
this
.
$message
.
success
(
"上传成功!"
);
// this.isUpLoading = false;
}
else
{
this
.
$message
.
error
(
res
.
msg
);
}
}
},
updateProgress
(
e
)
{
//e为回调回来的参数 通过进行和total的值来进行进度
this
.
percentState
=
parseInt
((
e
.
loaded
/
e
.
total
)
*
100
);
if
(
this
.
percentState
==
100
)
{
// this.$message.success("上传成功!");
// this.isUpLoading = false;
this
.
uploadStatus
=
'success'
}
},
},
};
</
script
>
<
style
lang=
'scss'
scoped
>
.title
{
.label
{
font-weight
:
bold
;
}
}
.subtitle
{
display
:
flex
;
margin-bottom
:
16px
;
.divider
{
width
:
8px
;
border-left
:
4px
solid
#409eff
;
margin-right
:
8px
;
}
.label
{
font-weight
:
bold
;
}
}
.dialog-content
{
padding
:
0
32px
;
display
:
flex
;
flex-direction
:
column
;
.upload-area
{
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
flex-direction
:
column
;
margin-bottom
:
30px
;
}
.upload-progress
{
margin-bottom
:
30px
;
}
.upload-records
{
margin-bottom
:
30px
;
}
.dialog-footer
{
display
:
flex
;
justify-content
:
flex-end
;
}
}
.el-dialog__body
{
padding
:
0
20px
30px
20px
;
}
</
style
>
\ No newline at end of file
src/views/culturalRelic/config.js
浏览文件 @
1e7b8bbf
export
const
title
=
[{
prop
:
"name"
,
label
:
"名称"
,
...
...
@@ -53,7 +52,7 @@ export const title = [{
prop
:
"intro"
,
label
:
"馆藏介绍"
,
columnAlign
:
'center'
,
showOverFlowToolTip
:
true
showOverFlowToolTip
:
true
},
{
...
...
@@ -142,3 +141,44 @@ export const operations = [
},
]
export
const
importRecordsTitle
=
[{
prop
:
"createTime"
,
label
:
"导入时间"
,
columnAlign
:
"center"
,
},
{
prop
:
"batchNum"
,
label
:
"导入批次"
,
columnAlign
:
"center"
,
},
{
prop
:
"fileName"
,
label
:
"文件名称"
,
columnAlign
:
"center"
,
},
{
prop
:
"fileSize"
,
label
:
"文件大小"
,
columnAlign
:
"center"
,
},
{
prop
:
"remark"
,
label
:
"备注"
,
columnAlign
:
"center"
,
},
,
]
export
const
importOperates
=
{
operate
:
true
,
label
:
"操作"
,
width
:
"260px"
,
minwidth
:
"220px"
,
titleAlign
:
"center"
,
columnAlign
:
"center"
,
}
export
const
importOperations
=
[{
type
:
'delete'
,
title
:
'删除'
},
]
src/views/culturalRelic/import.vue
0 → 100644
浏览文件 @
1e7b8bbf
<
template
>
<div
class=
"app-container"
>
<div
class=
"top-bar"
>
<SearchBar
:config=
"searchConfig"
@
search=
"search"
@
reset=
"reset"
/>
<TablePage
:data=
"list.records"
:tableTitle=
"tableTitle"
:operates=
"tableOperates"
>
<template
v-slot:operates=
"scope"
>
<TableOperation
:operations=
"tableOperations"
:rawData=
"scope.scope.row"
@
handleOperation=
"handleOperation"
></TableOperation>
</
template
>
</TablePage>
<el-pagination
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"Number(list.current)"
:page-sizes=
"[10, 20, 40, 50]"
:page-size=
"Number(list.size)"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"Number(list.total)"
class=
"pagination"
>
</el-pagination>
</div>
</div>
</template>
<
script
>
import
TablePage
from
"@/components/Table/TablePage.vue"
;
import
TableOperation
from
"@/components/Table/TableOperation.vue"
;
import
{
importRecordsTitle
,
importOperates
,
importOperations
}
from
"./config"
;
import
{
getImportListPage
}
from
"@/api/culturalRelic"
;
import
SearchBar
from
"@/components/SearchBar"
;
export
default
{
components
:
{
TablePage
,
TableOperation
,
SearchBar
,
},
data
()
{
return
{
list
:
{
records
:
[],
size
:
10
,
current
:
1
,
total
:
0
,
},
searchForm
:
{
name
:
""
,
status
:
""
,
},
searchConfig
:
[
{
prop
:
"name"
,
type
:
"input"
,
label
:
"批次"
,
},
],
};
},
computed
:
{
tableTitle
()
{
return
importRecordsTitle
;
},
tableOperates
()
{
return
importOperates
;
},
tableOperations
()
{
return
importOperations
;
},
},
mounted
()
{
this
.
loadData
();
},
methods
:
{
async
search
(
form
)
{
var
params
=
{
page
:
this
.
list
.
current
,
limit
:
this
.
list
.
size
,
...
form
,
};
if
(
!
params
.
level
)
{
delete
params
.
level
;
}
let
res
=
await
getImportListPage
(
params
);
if
(
res
.
code
==
0
)
{
this
.
list
=
res
.
data
;
}
},
reset
()
{
console
.
log
(
"reset"
);
this
.
loadData
();
},
// 加载表格数据
async
loadData
()
{
var
params
=
{
page
:
this
.
list
.
current
,
limit
:
this
.
list
.
size
,
};
let
res
=
await
getImportListPage
(
params
);
if
(
res
.
code
==
0
)
{
// debugger
this
.
list
=
res
.
data
;
}
},
async
handleOperation
(
value
,
row
)
{
console
.
log
(
"handleOperation"
,
value
,
row
);
switch
(
value
.
type
)
{
case
"add"
:
this
.
editVisible
=
true
;
break
;
case
"view"
:
break
;
case
"delete"
:
// let deleteRes = await deleteCultralRelic([row.crId]);
// if (deleteRes.code == 0) {
// this.$message.success("删除成功!");
// this.loadData();
// }
break
;
}
},
// 改变页容量
handleSizeChange
(
value
)
{
this
.
list
.
size
=
value
;
this
.
loadData
();
},
// 改变当前显示页
handleCurrentChange
(
value
)
{
this
.
list
.
current
=
value
;
this
.
loadData
();
},
},
};
</
script
>
<
style
lang=
"scss"
scoped
>
.top-bar
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
margin-bottom
:
10px
;
}
.pagination
{
margin
:
16px
;
}
</
style
>
\ No newline at end of file
src/views/culturalRelic/index.vue
浏览文件 @
1e7b8bbf
...
...
@@ -8,14 +8,23 @@
>
<div
class=
"top-bar"
>
<SearchBar
:config=
"searchConfig"
@
search=
"search"
@
reset=
"reset"
/>
<div
class=
"tools"
>
<el-button
type=
"primary"
@
click
.
native=
"handleOperation(
{ type: 'multiAdd' })"
icon="el-icon-upload"
>
批量导入
</el-button
>
<el-button
type=
"primary"
@
click
.
native=
"handleOperation(
{ type: 'add' })"
icon="el-icon-s-promotion
"
icon="el-icon-plus
"
>
发布
</el-button
添加
</el-button
>
</div>
</div>
<TablePage
:data=
"list.records"
:tableTitle=
"tableTitle"
...
...
@@ -74,11 +83,15 @@
>
</el-pagination>
<InfoEditDialog
:visible=
"
drawer
Visible"
:visible=
"
edit
Visible"
:form=
"form"
@
handleClose=
"handleClose"
@
handleClose=
"handle
Edit
Close"
@
refresh=
"loadData"
/>
<MultiUploadDialog
:visible=
"multiUploadVisible"
@
handleClose=
"handleMultiUploadClose"
/>
</div>
</template>
...
...
@@ -93,6 +106,8 @@ import {
editCulturalRelic
,
}
from
"@/api/culturalRelic"
;
import
InfoEditDialog
from
"./components/InfoEditDialog"
;
import
MultiUploadDialog
from
"./components/MultiUploadDialog"
;
import
SearchBar
from
"@/components/SearchBar"
;
export
default
{
...
...
@@ -101,6 +116,7 @@ export default {
TableOperation
,
InfoEditDialog
,
SearchBar
,
MultiUploadDialog
},
dicts
:
[
// "cultural_relic_years",
...
...
@@ -148,7 +164,8 @@ export default {
],
},
],
drawerVisible
:
false
,
editVisible
:
false
,
//编辑
multiUploadVisible
:
false
,
//批量上传
isAdd
:
true
,
form
:
{
name
:
""
,
//名称
...
...
@@ -250,7 +267,7 @@ export default {
console
.
log
(
"handleOperation"
,
value
,
row
);
switch
(
value
.
type
)
{
case
"add"
:
this
.
drawer
Visible
=
true
;
this
.
edit
Visible
=
true
;
break
;
case
"view"
:
break
;
...
...
@@ -258,7 +275,7 @@ export default {
let
detailRes
=
await
getRCDetailById
({
crId
:
row
.
crId
});
if
(
detailRes
.
code
==
0
)
{
this
.
form
=
detailRes
.
data
;
this
.
drawer
Visible
=
true
;
this
.
edit
Visible
=
true
;
}
break
;
case
"delete"
:
...
...
@@ -268,6 +285,9 @@ export default {
this
.
loadData
();
}
break
;
case
"multiAdd"
:
this
.
multiUploadVisible
=
true
break
;
}
},
// 关闭预览图片
...
...
@@ -321,7 +341,7 @@ export default {
// 打开drawer
handleOpenDialog
(
type
,
value
)
{
this
.
drawer
Visible
=
true
;
this
.
edit
Visible
=
true
;
switch
(
type
)
{
case
"add"
:
console
.
log
(
"新增"
);
...
...
@@ -332,12 +352,15 @@ export default {
}
},
// 关闭Dialog
handleClose
()
{
this
.
drawer
Visible
=
false
;
handle
Edit
Close
()
{
this
.
edit
Visible
=
false
;
this
.
form
=
{
status
:
0
,
};
},
handleMultiUploadClose
()
{
this
.
multiUploadVisible
=
false
;
},
},
};
</
script
>
...
...
src/views/display/components/InfoEditDialog.vue
浏览文件 @
1e7b8bbf
...
...
@@ -100,6 +100,27 @@
>
</el-input>
</el-form-item>
<el-form-item
label=
"展览文物"
:label-width=
"formLabelWidth"
>
<el-select
v-model=
"crIds"
multiple
filterable
remote
reserve-keyword
placeholder=
"请输入关键词搜索文物"
:remote-method=
"searchCR"
:loading=
"loading"
style=
"width: 100%"
>
<el-option
v-for=
"item in crList"
:key=
"item.crId"
:label=
"item.name"
:value=
"item.crId"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"关联文献"
:label-width=
"formLabelWidth"
>
<el-select
v-model=
"literatureValues"
...
...
@@ -151,7 +172,7 @@
</el-col>
</el-row>
<el-row>
<el-form-item
label=
"
布展
单元"
:label-width=
"formLabelWidth"
>
<el-form-item
label=
"
展览
单元"
:label-width=
"formLabelWidth"
>
<ExhibitionUnit
:exhibitionUnits=
"dialogForm.exhibitionUnits"
ref=
"exhibitionUnits"
...
...
@@ -328,6 +349,19 @@ export default {
}
});
}
// 回填文物
this
.
crIds
=
[];
if
(
this
.
dialogForm
.
culturalRelicVo
&&
this
.
dialogForm
.
culturalRelicVo
.
length
>
0
)
{
this
.
crList
=
this
.
dialogForm
.
culturalRelicVo
;
this
.
dialogForm
.
culturalRelicVo
.
forEach
((
cr
)
=>
{
if
(
this
.
crIds
)
{
this
.
crIds
.
push
(
cr
.
crId
);
}
});
}
// if (this.dialogForm.exhibitionUnits.length > 0) {
// }
...
...
@@ -356,11 +390,12 @@ export default {
{
label
:
"模板主题2"
,
value
:
"主题二"
},
{
label
:
"模板主题3"
,
value
:
"主题三"
},
],
literatureList
:
[],
disabled
:
false
,
exhibitionUnits
:
[],
// literatureNames: "",
literatureValues
:
[],
//文献绑定的数组,编辑回显时需要将后台传的值转成[id1,id2,]并赋值给它,新增时记得清空,提交时改成id 的str
literatureList
:
[],
//文献列表
literatureValues
:
[],
//选中的文献列表
crList
:
[],
//文物列表
crIds
:
[],
//选中的文物列表
// showUnit: false,
faceImage
:
[],
images
:
[],
...
...
@@ -392,6 +427,35 @@ export default {
}
},
500
);
},
// 关联文献查询
searchCR
(
queryString
)
{
let
that
=
this
;
if
(
!
queryString
.
trim
())
{
that
.
crList
=
[];
return
;
}
that
.
loading
=
true
;
const
params
=
{
name
:
queryString
,
page
:
"1"
,
limit
:
"100"
,
};
setTimeout
(
async
()
=>
{
// debugger
that
.
loading
=
false
;
const
res
=
await
that
.
$store
.
dispatch
(
"dict/getCrList"
,
{
params
,
isReload
:
true
,
});
if
(
res
.
code
==
0
)
{
that
.
crList
=
res
.
data
.
records
;
}
else
{
that
.
crList
=
[];
that
.
$message
.
error
(
res
.
msg
);
}
},
500
);
},
handlePreview
({
type
,
file
})
{
console
.
log
(
type
,
file
);
},
...
...
@@ -601,6 +665,7 @@ export default {
};
params
.
literature
=
this
.
literatureValues
.
join
(
","
);
params
.
status
=
this
.
dialogForm
.
status
?
1
:
0
;
params
.
crIds
=
this
.
crIds
.
join
(
","
);
console
.
log
(
"新增参数-----------"
,
params
);
let
res
=
await
addDisplay
(
params
);
...
...
@@ -629,6 +694,7 @@ export default {
}
=
this
.
dialogForm
;
let
literature
=
this
.
literatureValues
.
join
(
","
);
let
crIds
=
this
.
crIds
.
join
(
","
);
let
status
=
this
.
dialogForm
.
status
?
1
:
0
;
// return;
const
params
=
{
...
...
@@ -648,6 +714,7 @@ export default {
videos
,
status
,
literature
,
crIds
,
exhibitionUnits
:
unitData
,
};
console
.
log
(
"修改参数-----------"
,
params
);
...
...
@@ -669,6 +736,8 @@ export default {
this
.
$emit
(
"handleClose"
);
// 清空文献
this
.
literatureValues
=
[];
// 清空文物
this
.
crIds
=
[];
// this.literatureNames = [];
// 清空布展单元
this
.
exhibitionUnits
=
[
...
...
src/views/display/index.vue
浏览文件 @
1e7b8bbf
...
...
@@ -9,7 +9,7 @@
>
发布
</el-button
>
<
el-button
type=
"primary"
@
click
.
native=
"handleCopy"
>
复制
</el-button
>
<
!--
<el-button
type=
"primary"
@
click
.
native=
"handleCopy"
>
复制
</el-button>
--
>
</div>
<TablePage
:data=
"list.records"
...
...
src/views/literature/components/InfoEditDialog.vue
0 → 100644
浏览文件 @
1e7b8bbf
<
template
>
<el-dialog
:visible
.
sync=
"dialogVisible"
width=
"40%"
style=
"height: 98%"
:before-close=
"handleClose"
top=
"5vh"
lock-scroll
>
<div
class=
"title"
slot=
"title"
>
<div
class=
"divider"
></div>
<div
class=
"label"
>
{{
title
}}
</div>
</div>
<div
class=
"dialog-content"
>
<el-form
:model=
"dialogForm"
class=
"basic-info"
>
<el-form-item
label=
"名称"
:label-width=
"formLabelWidth"
>
<el-input
v-model=
"dialogForm.name"
autocomplete=
"off"
placeholder=
"请输入文献名称"
></el-input>
</el-form-item>
<el-form-item
label=
"作者"
:label-width=
"formLabelWidth"
>
<el-input
v-model=
"dialogForm.name"
autocomplete=
"off"
placeholder=
"请输入作者"
></el-input>
</el-form-item>
<el-form-item
label=
"日期"
:label-width=
"formLabelWidth"
>
<!--
<el-input
v-model=
"dialogForm.name"
autocomplete=
"off"
placeholder=
"请输入作者"
></el-input>
-->
<el-date-picker
v-model=
"dialogForm.date"
type=
"date"
placeholder=
"请选择日期(出版年份、发布日期)"
>
</el-date-picker>
</el-form-item>
<el-form-item
label=
"备注"
:label-width=
"formLabelWidth"
>
<el-input
type=
"textarea"
placeholder=
"请输入备注"
v-model=
"dialogForm.remark"
maxlength=
"600"
show-word-limit
>
</el-input>
</el-form-item>
<el-form-item
label=
"状态"
:label-width=
"formLabelWidth"
>
<el-switch
v-model=
"status"
>
</el-switch>
</el-form-item>
<el-form-item
label=
"文件"
:label-width=
"formLabelWidth"
>
<AutoUploader
v-model=
"ltFile"
:fileLimit=
"1"
:fileSize=
"50"
listType=
"text"
:fileType=
"['pdf']"
ref=
"museumFaceImage"
/>
</el-form-item>
</el-form>
</div>
<div
class=
"dialog-footer"
>
<el-button
@
click=
"cancelForm"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"handleSubmit"
>
确定
<i
class=
"el-icon-right"
style=
"margin-left: 5px"
></i
></el-button>
</div>
</el-dialog>
</
template
>
<
script
>
import
{
addVirtual
,
editVirtual
}
from
"@/api/vitual"
;
import
AutoUploader
from
"@/components/Uploader/AutoUploader.vue"
;
import
{
mapGetters
}
from
"vuex"
;
export
default
{
name
:
"InfoEditDialog"
,
components
:
{
AutoUploader
,
},
props
:
{
visible
:
{
type
:
Boolean
,
default
:
false
,
},
form
:
{
type
:
Object
,
default
:
()
=>
({}),
},
},
computed
:
{
...
mapGetters
([
"userInfo"
]),
dialogVisible
:
{
get
:
function
()
{
return
this
.
visible
;
},
set
:
function
()
{},
},
title
()
{
if
(
this
.
dialogForm
.
bvId
)
{
return
"修改虚拟展厅信息"
;
}
else
{
return
"添加虚拟展厅"
;
}
},
},
watch
:
{
form
:
{
handler
:
function
(
value
)
{
let
that
=
this
;
that
.
dialogForm
=
JSON
.
parse
(
JSON
.
stringify
(
value
));
// 编辑状态
if
(
that
.
dialogForm
.
literatureId
)
{
// console.log("that.dialogForm.", that.dialogForm);
that
.
status
=
Boolean
(
Number
(
that
.
dialogForm
.
status
));
// 回填封面
if
(
this
.
dialogForm
.
files
)
{
that
.
files
=
[
{
name
:
this
.
dialogForm
.
name
+
"封面.png"
,
url
:
this
.
dialogForm
.
faceImageUrl
,
fileId
:
this
.
dialogForm
.
faceImage
,
},
];
}
}
},
immediate
:
true
,
deep
:
true
,
},
status
(
value
)
{
console
.
log
(
value
);
},
},
data
()
{
return
{
dialogForm
:
{},
formLabelWidth
:
"100px"
,
status
:
false
,
files
:
[],
//文献文件
};
},
methods
:
{
handlePreview
({
type
,
file
})
{
console
.
log
(
type
,
file
);
},
handleRemove
(
file
,
fileList
)
{
console
.
log
(
file
,
fileList
);
},
// 取消编辑
cancelForm
()
{
this
.
$emit
(
"handleClose"
);
this
.
faceImage
=
[];
},
async
handleSubmit
()
{
if
(
this
.
dialogForm
.
bvId
)
{
let
params
=
{
...
this
.
dialogForm
};
// 回填文件
if
(
this
.
faceImage
.
length
>
0
)
{
params
.
faceImage
=
this
.
faceImage
[
0
].
fileId
;
}
// 处理状态
// debugger
params
.
status
=
this
.
status
?
1
:
0
;
let
res
=
await
editVirtual
(
params
);
if
(
res
.
code
==
0
)
{
this
.
$message
.
success
(
"修改成功!"
);
this
.
reload
();
}
}
else
{
let
params
=
{
...
this
.
dialogForm
};
// 回填图片
if
(
this
.
faceImage
.
length
>
0
)
{
params
.
faceImage
=
this
.
faceImage
[
0
].
fileId
;
}
// 处理状态
params
.
status
=
this
.
status
?
1
:
0
;
// return
let
res
=
await
addVirtual
(
params
);
if
(
res
.
code
==
0
)
{
this
.
$message
.
success
(
"添加成功!"
);
this
.
reload
();
}
}
},
reload
()
{
this
.
$emit
(
"refresh"
,
true
);
//需要重新获取orgTree
this
.
$emit
(
"handleClose"
);
this
.
faceImage
=
[];
},
handleClose
(
done
)
{
this
.
$confirm
(
"确认关闭?"
)
.
then
((
_
)
=>
{
done
();
this
.
$emit
(
"handleClose"
);
this
.
faceImage
=
[];
})
.
catch
((
_
)
=>
{});
},
},
};
</
script
>
<
style
lang=
'scss'
scoped
>
.title
{
display
:
flex
;
margin-bottom
:
16px
;
.divider
{
width
:
8px
;
border-left
:
4px
solid
#409eff
;
margin-right
:
8px
;
}
.label
{
font-weight
:
bold
;
}
}
.dialog-content
{
padding
:
0
32px
;
display
:
flex
;
.basic-info
{
flex
:
1
;
margin-right
:
48px
;
}
.relate
{
flex
:
1
;
}
}
.dialog-footer
{
display
:
flex
;
justify-content
:
flex-end
;
}
</
style
>
\ No newline at end of file
src/views/literature/config.js
0 → 100644
浏览文件 @
1e7b8bbf
export
const
title
=
[{
prop
:
"name"
,
label
:
"名称"
,
columnAlign
:
'center'
,
width
:
200
,
showOverFlowToolTip
:
true
},
{
prop
:
"authors"
,
label
:
"作者"
,
columnAlign
:
'center'
,
},
{
prop
:
"browseCount"
,
label
:
"浏览量"
,
columnAlign
:
'center'
,
},
{
prop
:
"status"
,
label
:
"状态"
,
columnAlign
:
'center'
,
isStatus
:
true
,
width
:
100
},
{
prop
:
"date"
,
label
:
"日期(出版年份、发布日期)"
,
columnAlign
:
'center'
,
},
{
prop
:
"pdfFile"
,
label
:
"pdf文件"
,
columnAlign
:
'center'
,
},
{
prop
:
"source"
,
label
:
"文献来源"
,
columnAlign
:
'center'
,
},
{
prop
:
"remark"
,
label
:
"备注"
,
columnAlign
:
'center'
,
showOverFlowToolTip
:
true
,
},
]
export
const
operates
=
{
operate
:
true
,
label
:
"操作"
,
width
:
"200px"
,
titleAlign
:
"center"
,
columnAlign
:
"center"
,
}
export
const
operations
=
[
// {
// type: 'view',
// title: '预览'
// },
{
type
:
'edit'
,
title
:
'编辑'
},
{
type
:
'delete'
,
title
:
'删除'
},
]
src/views/literature/index.vue
浏览文件 @
1e7b8bbf
<
template
>
<div>
布展管理
</div>
<div
class=
"app-container"
>
<div
class=
"top-bar"
>
<SearchBar
:config=
"searchConfig"
@
search=
"search"
@
reset=
"reset"
/>
<el-button
type=
"primary"
@
click
.
native=
"handleOperation(
{ type: 'add' })"
icon="el-icon-s-promotion"
>
发布
</el-button
>
</div>
<TablePage
:data=
"list.records"
:tableTitle=
"tableTitle"
:operates=
"tableOperates"
>
<template
v-slot:status=
"data"
>
<el-popconfirm
:title=
"getStatusTitle(data.scope.status)"
@
onConfirm=
"handleChangeStatus(data.scope)"
>
<el-switch
slot=
"reference"
:value=
"Boolean(Number(data.scope.status))"
></el-switch>
</el-popconfirm>
</
template
>
</TablePage>
<el-pagination
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"Number(list.current)"
:page-sizes=
"[10, 20, 40, 50]"
:page-size=
"Number(list.size)"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"Number(list.total)"
class=
"pagination"
>
</el-pagination>
<InfoEditDialog
:visible=
"drawerVisible"
:form=
"form"
@
handleClose=
"handleClose"
@
refresh=
"loadData"
/>
</div>
</template>
<
script
>
import
TablePage
from
"@/components/Table/TablePage.vue"
;
import
TableOperation
from
"@/components/Table/TableOperation.vue"
;
import
{
title
,
operates
,
operations
}
from
"./config"
;
import
{
editLiterature
,
getLiteratureList
}
from
"@/api/literature"
;
import
InfoEditDialog
from
"./components/InfoEditDialog"
;
import
SearchBar
from
"@/components/SearchBar"
;
export
default
{
components
:
{
TablePage
,
TableOperation
,
InfoEditDialog
,
SearchBar
,
},
data
()
{
return
{
list
:
{
records
:
[],
size
:
10
,
current
:
1
,
total
:
0
,
},
searchForm
:
{
name
:
""
,
status
:
""
,
},
searchConfig
:
[
{
prop
:
"name"
,
type
:
"input"
,
label
:
"文献名称"
,
},
{
prop
:
"authors"
,
type
:
"input"
,
label
:
"作者"
,
},
{
prop
:
"status"
,
type
:
"select"
,
label
:
"状态"
,
selectOptions
:
[
{
label
:
"已上架"
,
value
:
"1"
,
},
{
label
:
"已下架"
,
value
:
"0"
,
},
],
},
],
drawerVisible
:
false
,
form
:
{
name
:
""
,
//名称
authors
:
""
,
//作者
date
:
""
,
//日期(出版年份、发布日期)
source
:
""
,
//文献来源
status
:
false
,
//上下架状态
remark
:
""
,
//备注
},
};
},
}
</
script
>
computed
:
{
tableTitle
()
{
return
title
;
},
tableOperates
()
{
return
operates
;
},
tableOperations
()
{
return
operations
;
},
getStatusTitle
(
status
)
{
return
(
status
)
=>
{
if
(
Number
(
status
))
{
return
"是否确定要下架?"
;
}
else
{
return
"是否确定要上架?"
;
}
};
},
},
mounted
()
{
this
.
loadData
();
},
methods
:
{
async
search
(
form
)
{
var
params
=
{
page
:
this
.
list
.
current
,
limit
:
this
.
list
.
size
,
...
form
,
};
if
(
params
.
status
==
""
)
{
delete
params
.
status
;
}
console
.
log
(
"params"
,
params
);
let
res
=
await
getLiteratureList
(
params
);
if
(
res
.
code
==
0
)
{
this
.
list
=
res
.
data
;
}
},
reset
()
{
this
.
loadData
();
},
// 加载表格数据
async
loadData
()
{
var
params
=
{
page
:
this
.
list
.
current
,
limit
:
this
.
list
.
size
,
};
let
res
=
await
getLiteratureList
(
params
);
if
(
res
.
code
==
0
)
{
this
.
list
=
res
.
data
;
}
},
async
handleOperation
(
value
,
row
)
{
console
.
log
(
"handleOperation"
,
value
,
row
);
switch
(
value
.
type
)
{
case
"add"
:
this
.
drawerVisible
=
true
;
break
;
case
"view"
:
// TODO:
break
;
case
"edit"
:
this
.
form
=
row
;
this
.
drawerVisible
=
true
;
break
;
case
"delete"
:
let
deleteRes
=
await
deleteVirtual
([
row
.
bvId
]);
if
(
deleteRes
.
code
==
0
)
{
this
.
$message
.
success
(
"删除成功!"
);
this
.
loadData
();
}
break
;
}
},
async
handleChangeStatus
(
row
)
{
console
.
log
(
"status"
,
row
);
const
{
status
}
=
row
;
let
newStatus
=
status
===
"0"
?
"1"
:
"0"
;
const
params
=
{
...
row
,
status
:
newStatus
,
};
let
res
=
await
editLiterature
(
params
);
if
(
res
.
code
==
0
)
{
this
.
loadData
();
this
.
$message
.
success
(
"修改成功!"
);
}
},
<
style
>
// 改变页容量
handleSizeChange
(
value
)
{
this
.
list
.
size
=
value
;
this
.
loadData
();
},
// 改变当前显示页
handleCurrentChange
(
value
)
{
this
.
list
.
current
=
value
;
this
.
loadData
();
},
// 关闭Dialog
handleClose
()
{
this
.
drawerVisible
=
false
;
this
.
form
=
{
status
:
true
,
};
},
},
};
</
script
>
<
style
lang=
"scss"
scoped
>
.top-bar
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
margin-bottom
:
10px
;
}
.pagination
{
margin
:
16px
;
}
::v-deep
.el-card__header
{
padding
:
10px
20px
;
font-weight
:
bold
;
}
</
style
>
\ No newline at end of file
src/views/log/config.js
0 → 100644
浏览文件 @
1e7b8bbf
export
const
title
=
[{
prop
:
"createTime"
,
label
:
"创建时间"
,
columnAlign
:
'center'
,
width
:
200
,
},
{
prop
:
"ip"
,
label
:
"IP地址"
,
columnAlign
:
'center'
,
},
{
prop
:
"userId"
,
label
:
"用户id"
,
columnAlign
:
'center'
,
},
{
prop
:
"username"
,
label
:
"用户名"
,
columnAlign
:
'center'
,
},
{
prop
:
"operation"
,
label
:
"用户操作描述"
,
columnAlign
:
'center'
,
},
{
prop
:
"optType"
,
label
:
"操作类型"
,
columnAlign
:
'center'
,
},
{
prop
:
"params"
,
label
:
"请求参数"
,
columnAlign
:
'center'
,
showOverFlowToolTip
:
true
},
{
prop
:
"sourceName"
,
label
:
"资源名称"
,
columnAlign
:
'center'
,
},
{
prop
:
"sourceType"
,
label
:
"资源类型"
,
columnAlign
:
'center'
,
},
]
src/views/log/index.vue
浏览文件 @
1e7b8bbf
<
template
>
<div>
日志管理
</div>
<div
class=
"app-container"
>
<div
class=
"top-bar"
>
<!--
<SearchBar
:config=
"searchConfig"
@
search=
"search"
@
reset=
"reset"
/>
-->
</div>
<TablePage
:data=
"list.records"
:tableTitle=
"tableTitle"
:operates=
"tableOperates"
>
</TablePage>
<el-pagination
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"Number(list.current)"
:page-sizes=
"[10, 20, 40, 50]"
:page-size=
"Number(list.size)"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"Number(list.total)"
class=
"pagination"
>
</el-pagination>
</div>
</
template
>
<
script
>
import
TablePage
from
"@/components/Table/TablePage.vue"
;
import
TableOperation
from
"@/components/Table/TableOperation.vue"
;
import
{
title
,
operates
,
operations
}
from
"./config"
;
import
{
getLogList
}
from
"@/api/log"
;
import
SearchBar
from
"@/components/SearchBar"
;
export
default
{
components
:
{
TablePage
,
TableOperation
,
SearchBar
,
},
data
()
{
return
{
list
:
{
records
:
[],
size
:
10
,
current
:
1
,
total
:
0
,
},
searchForm
:
{
name
:
""
,
status
:
""
,
},
searchConfig
:
[
{
prop
:
"name"
,
type
:
"input"
,
label
:
"文献名称"
,
},
{
prop
:
"authors"
,
type
:
"input"
,
label
:
"作者"
,
},
{
prop
:
"status"
,
type
:
"select"
,
label
:
"状态"
,
selectOptions
:
[
{
label
:
"已上架"
,
value
:
"1"
,
},
{
label
:
"已下架"
,
value
:
"0"
,
},
],
},
],
};
},
}
</
script
>
computed
:
{
tableTitle
()
{
return
title
;
},
tableOperates
()
{
return
operates
;
},
tableOperations
()
{
return
operations
;
},
getStatusTitle
(
status
)
{
return
(
status
)
=>
{
if
(
Number
(
status
))
{
return
"是否确定要下架?"
;
}
else
{
return
"是否确定要上架?"
;
}
};
},
},
mounted
()
{
this
.
loadData
();
},
methods
:
{
async
search
(
form
)
{
var
params
=
{
page
:
this
.
list
.
current
,
limit
:
this
.
list
.
size
,
...
form
,
};
if
(
params
.
status
==
""
)
{
delete
params
.
status
;
}
console
.
log
(
"params"
,
params
);
let
res
=
await
getLogList
(
params
);
if
(
res
.
code
==
0
)
{
this
.
list
=
res
.
data
;
}
},
reset
()
{
this
.
loadData
();
},
<
style
>
// 加载表格数据
async
loadData
()
{
var
params
=
{
page
:
this
.
list
.
current
,
limit
:
this
.
list
.
size
,
};
let
res
=
await
getLogList
(
params
);
if
(
res
.
code
==
0
)
{
this
.
list
=
res
.
data
;
}
},
// 改变页容量
handleSizeChange
(
value
)
{
this
.
list
.
size
=
value
;
this
.
loadData
();
},
// 改变当前显示页
handleCurrentChange
(
value
)
{
this
.
list
.
current
=
value
;
this
.
loadData
();
},
},
};
</
script
>
<
style
lang=
"scss"
scoped
>
.top-bar
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
margin-bottom
:
10px
;
}
.pagination
{
margin
:
16px
;
}
</
style
>
\ No newline at end of file
src/views/museum/index.vue
浏览文件 @
1e7b8bbf
...
...
@@ -39,7 +39,7 @@
</el-table-column>
-->
<el-table-column
align=
"center"
label=
"封面"
>
<
template
slot-scope=
"scope"
>
<img
:src=
"scope.row.faceImageUrl"
width=
"100%"
height=
"1
5
0px"
/>
<img
:src=
"scope.row.faceImageUrl"
width=
"100%"
height=
"1
0
0px"
/>
</
template
>
</el-table-column>
<!-- <el-table-column align="center" prop="longitude" label="经度">
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论