Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
exhibition_backstage
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
龙菲
exhibition_backstage
Commits
5da5ee84
提交
5da5ee84
authored
7月 28, 2022
作者:
龙菲
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
文献管理
上级
0a3512e2
隐藏空白字符变更
内嵌
并排
正在显示
19 个修改的文件
包含
590 行增加
和
450 行删除
+590
-450
literature.js
src/api/literature.js
+23
-0
index.js
src/components/Dict/index.js
+0
-103
TableOperation.vue
src/components/Table/TableOperation.vue
+1
-1
main.js
src/main.js
+0
-2
dict.js
src/store/modules/dict.js
+134
-30
file.js
src/utils/file.js
+67
-2
index.js
src/utils/index.js
+27
-24
InfoEditDialog.vue
src/views/culturalRelic/components/InfoEditDialog.vue
+33
-41
MultiUploadDialog.vue
src/views/culturalRelic/components/MultiUploadDialog.vue
+74
-28
index.vue
src/views/culturalRelic/index.vue
+19
-30
InfoEditDialog.vue
src/views/display/components/InfoEditDialog.vue
+19
-10
index.vue
src/views/display/index.vue
+8
-13
InfoEditDialog.vue
src/views/literature/components/InfoEditDialog.vue
+74
-72
config.js
src/views/literature/config.js
+66
-63
index.vue
src/views/literature/index.vue
+32
-6
index-old.vue
src/views/museum/index-old.vue
+0
-7
index.vue
src/views/museum/index.vue
+0
-7
index.vue
src/views/virtual/index.vue
+0
-7
vue.config.js
vue.config.js
+13
-4
没有找到文件。
src/api/literature.js
浏览文件 @
5da5ee84
...
@@ -9,6 +9,14 @@ export function getLiteratureList(data) {
...
@@ -9,6 +9,14 @@ export function getLiteratureList(data) {
data
data
})
})
}
}
export
function
addLiterature
(
data
)
{
return
request
({
url
:
'/sysLiterature/add'
,
method
:
'post'
,
data
})
}
export
function
editLiterature
(
data
)
{
export
function
editLiterature
(
data
)
{
return
request
({
return
request
({
url
:
'/sysLiterature/update'
,
url
:
'/sysLiterature/update'
,
...
@@ -16,3 +24,18 @@ export function editLiterature(data) {
...
@@ -16,3 +24,18 @@ export function editLiterature(data) {
data
data
})
})
}
}
// 带权限的文献列表分页
export
function
getLtListPer
(
data
)
{
return
request
({
url
:
'/sysLiterature/listByPagePer'
,
method
:
'post'
,
data
})
}
export
function
deleteLt
(
data
)
{
return
request
({
url
:
'/sysLiterature/delete'
,
method
:
'delete'
,
data
})
}
src/components/Dict/index.js
deleted
100644 → 0
浏览文件 @
0a3512e2
import
{
getDictCode
}
from
"@/api/dict"
;
import
{
getLiteratureList
}
from
'@/api/literature'
import
store
from
"@/store"
;
import
Vue
from
"vue"
;
class
Dict
{
constructor
(
dict
)
{
this
.
dict
=
dict
;
}
async
init
(
names
)
{
// 先判断list中的name是否存在,如果不存在,把不存在的放置在一个list中,再对list进行获取
var
nonExistentNames
=
[]
// debugger
names
.
forEach
(
name
=>
{
if
(
store
.
getters
.
dicts
[
name
])
{
Vue
.
set
(
this
.
dict
,
name
,
store
.
getters
.
dicts
[
name
]);
}
else
{
nonExistentNames
.
push
(
name
)
//存入list中,单独进行处理调用
}
});
var
index
=
nonExistentNames
.
indexOf
(
'literature'
)
if
(
index
!=
-
1
)
{
// debugger
Vue
.
set
(
this
.
dict
,
'literature'
,
[]);
nonExistentNames
.
splice
(
index
,
1
)
var
params
=
{
limit
:
100
,
page
:
1
}
var
res
=
await
getLiteratureList
(
params
)
if
(
res
.
code
==
0
)
{
var
literatureList
=
res
.
data
.
records
Vue
.
set
(
this
.
dict
,
'literature'
,
literatureList
);
this
.
dict
[
'literature'
]
=
Object
.
freeze
(
literatureList
)
store
.
commit
(
"dict/SET_DICTS"
,
{
label
:
'literature'
,
value
:
Object
.
freeze
(
literatureList
),
});
}
}
if
(
nonExistentNames
.
length
>
0
)
{
// debugger
var
res
=
await
getDictCode
(
nonExistentNames
)
nonExistentNames
.
forEach
(
n
=>
{
Vue
.
set
(
this
.
dict
,
n
,
[]);
// var arr = []
var
obj
=
{}
if
(
res
.
code
==
0
)
{
res
.
data
.
map
(
item
=>
{
if
(
item
.
dictType
===
n
)
{
obj
[
item
.
value
]
=
item
.
label
}
})
this
.
dict
[
n
]
=
Object
.
freeze
(
obj
)
store
.
commit
(
"dict/SET_DICTS"
,
{
label
:
n
,
value
:
Object
.
freeze
(
obj
),
});
}
})
}
}
}
const
install
=
function
(
Vue
)
{
Vue
.
mixin
({
data
()
{
// 如果在调用组件处data中有定义dicts,再进行初始化dict
if
(
this
.
$options
.
dicts
instanceof
Array
&&
this
.
$options
.
dicts
.
length
>
0
)
{
return
{
dict
:
{}
};
}
else
{
return
{};
}
},
created
()
{
// 如果在调用组件处data中有定义dicts,再进行获取dicts中定义的字典
if
(
this
.
$options
.
dicts
instanceof
Array
&&
this
.
$options
.
dicts
.
length
>
0
)
{
new
Dict
(
this
.
dict
).
init
(
this
.
$options
.
dicts
);
}
},
});
};
export
default
{
install
};
src/components/Table/TableOperation.vue
浏览文件 @
5da5ee84
...
@@ -61,12 +61,12 @@ export default {
...
@@ -61,12 +61,12 @@ export default {
edit
:
"el-icon-edit"
,
edit
:
"el-icon-edit"
,
view
:
"el-icon-view"
,
view
:
"el-icon-view"
,
delete
:
"el-icon-delete"
,
delete
:
"el-icon-delete"
,
download
:
'el-icon-download'
},
},
};
};
},
},
methods
:
{
methods
:
{
clickOperation
(
operation
)
{
clickOperation
(
operation
)
{
console
.
log
(
'123'
);
this
.
$emit
(
"handleOperation"
,
operation
,
this
.
rawData
);
this
.
$emit
(
"handleOperation"
,
operation
,
this
.
rawData
);
},
},
},
},
...
...
src/main.js
浏览文件 @
5da5ee84
...
@@ -13,8 +13,6 @@ import router from './router'
...
@@ -13,8 +13,6 @@ import router from './router'
import
'@/icons'
// icon
import
'@/icons'
// icon
import
'@/permission'
// permission control
import
'@/permission'
// permission control
import
dict
from
'@/components/Dict'
Vue
.
use
(
dict
);
Vue
.
use
(
ElementUI
)
Vue
.
use
(
ElementUI
)
...
...
src/store/modules/dict.js
浏览文件 @
5da5ee84
import
{
import
{
getDictCode
,
getDictTree
getDictTree
}
from
'@/api/dict'
}
from
'@/api/dict'
import
{
import
{
getCulturalRelicList
getCulturalRelicList
}
from
'@/api/culturalRelic'
}
from
'@/api/culturalRelic'
import
{
getLiteratureList
}
from
'@/api/literature'
import
{
getLtListPer
}
from
'@/api/literature'
const
state
=
{
const
state
=
{
dicts
:
{},
dicts
:
{},
//字典
crList
:
[]
//文物列表,布展关联文物时使用
crList
:
[],
//文物列表
ltList
:
[]
//文献列表
};
};
const
mutations
=
{
const
mutations
=
{
...
@@ -19,61 +29,116 @@ const mutations = {
...
@@ -19,61 +29,116 @@ const mutations = {
};
};
const
actions
=
{
const
actions
=
{
// user login
/**
getDictTree
({
* 获取普通list结构(非树结构)的字典
* @param {Array} data 字典的key集合
* @returns {Promise}
*/
getDictList
({
commit
commit
},
data
)
{
},
data
)
{
let
dicts
=
[]
let
dicts
=
{}
let
requestDicts
=
[]
let
requestDicts
=
[]
data
.
forEach
(
i
=>
{
data
.
forEach
(
i
=>
{
// 如果state中不存在的就需要重新获取
if
(
!
state
.
dicts
[
i
])
{
if
(
!
state
.
dicts
[
i
])
{
requestDicts
.
push
(
i
)
requestDicts
.
push
(
i
)
}
else
{
}
else
{
// 如果存在就直接存入dicts中
dicts
[
i
]
=
state
.
dicts
[
i
]
let
obj
=
{}
obj
[
i
]
=
state
.
dicts
[
i
]
dicts
.
push
(
obj
)
}
}
});
});
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
requestDicts
.
length
>
0
)
{
getDictTree
(
requestDicts
).
then
(
res
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
dictsObj
=
{}
getDictCode
(
requestDicts
).
then
(
res
=>
{
requestDicts
.
forEach
(
reqDict
=>
{
requestDicts
.
forEach
(
reqDict
=>
{
dictsObj
[
reqDict
]
=
[]
var
obj
=
{}
res
.
data
.
map
(
item
=>
{
if
(
res
.
code
==
0
)
{
if
(
item
.
dictType
==
reqDict
)
{
res
.
data
.
map
(
item
=>
{
dictsObj
[
reqDict
].
push
(
item
)
if
(
item
.
dictType
==
reqDict
)
{
obj
[
item
.
value
]
=
item
.
label
}
})
dicts
[
reqDict
]
=
Object
.
freeze
(
obj
)
commit
(
'SET_DICTS'
,
{
label
:
reqDict
,
value
:
Object
.
freeze
(
obj
)
})
}
}
})
})
commit
(
"SET_DICTS"
,
{
resolve
(
dicts
)
label
:
reqDict
,
}).
catch
(
error
=>
{
value
:
Object
.
freeze
(
dictsObj
[
reqDict
]),
reject
(
error
)
});
})
})
resolve
(
dictsObj
)
});
}).
catch
(
error
=>
{
}
else
{
reject
(
error
)
return
new
Promise
((
resolve
,
reject
)
=>
{
resolve
(
dicts
)
})
})
});
}
},
/**
* 获取树形结构的字典树,如文物年代、文物质地
* @param {Array} data 字典的key集合
* @returns {Promise}
*/
getDictTree
({
commit
},
data
)
{
let
dicts
=
{}
let
requestDicts
=
[]
data
.
forEach
(
i
=>
{
if
(
!
state
.
dicts
[
i
])
{
requestDicts
.
push
(
i
)
}
else
{
dicts
[
i
]
=
state
.
dicts
[
i
]
}
});
if
(
requestDicts
.
length
>
0
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
getDictTree
(
requestDicts
).
then
(
res
=>
{
let
dictsObj
=
{}
requestDicts
.
forEach
(
reqDict
=>
{
dictsObj
[
reqDict
]
=
[]
res
.
data
.
map
(
item
=>
{
if
(
item
.
dictType
==
reqDict
)
{
dictsObj
[
reqDict
].
push
(
item
)
}
})
commit
(
"SET_DICTS"
,
{
label
:
reqDict
,
value
:
Object
.
freeze
(
dictsObj
[
reqDict
]),
});
})
resolve
(
dictsObj
)
}).
catch
(
error
=>
{
reject
(
error
)
})
});
}
else
{
return
new
Promise
((
resolve
,
reject
)
=>
{
resolve
(
dicts
)
})
}
},
},
/**
* 获取文物列表
* @param {Boolean} isReload 是否要重新加载
* @param {params} params 分页或一些查询参数
* @returns {Promise}
*/
getCrList
({
getCrList
({
commit
commit
},
{
},
{
isReload
,
isReload
,
params
params
})
{
})
{
if
(
!
state
.
crList
||
state
.
crList
.
length
==
0
||
isReload
)
{
// 如果是空或者需要重新加载则重新调取接口获取,否则直接获取状态管理中的
if
(
!
state
.
crList
||
state
.
crList
==
0
||
isReload
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
getCulturalRelicList
(
params
).
then
(
response
=>
{
getCulturalRelicList
(
params
).
then
(
response
=>
{
const
{
const
{
data
data
}
=
response
}
=
response
console
.
log
(
'response'
,
response
);
commit
(
'SET_CR_LIST'
,
data
.
records
)
commit
(
'SET_CR_LIST'
,
data
.
records
)
resolve
(
response
)
resolve
(
response
)
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
...
@@ -87,6 +152,45 @@ const actions = {
...
@@ -87,6 +152,45 @@ const actions = {
}
}
},
},
/**
* 获取文献列表
* @param {Boolean} hasPer 是否含有权限
* @param {params} params 分页或一些查询参数
* @returns {Promise}
*/
getLtList
({
commit
},
{
hasPer
,
params
})
{
if
(
hasPer
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
getLtListPer
(
params
).
then
(
response
=>
{
const
{
data
}
=
response
commit
(
'SET_CR_LIST'
,
data
.
records
)
resolve
(
response
)
}).
catch
(
error
=>
{
reject
(
error
)
})
})
}
else
{
return
new
Promise
((
resolve
,
reject
)
=>
{
getLiteratureList
(
params
).
then
(
response
=>
{
const
{
data
}
=
response
commit
(
'SET_CR_LIST'
,
data
.
records
)
resolve
(
response
)
}).
catch
(
error
=>
{
reject
(
error
)
})
})
}
},
}
}
...
...
src/utils/file.js
浏览文件 @
5da5ee84
...
@@ -2,7 +2,7 @@ import axios from 'axios'
...
@@ -2,7 +2,7 @@ import axios from 'axios'
import
{
import
{
getToken
getToken
}
from
'@/utils/auth'
}
from
'@/utils/auth'
import
request
from
"./request"
;
// var uploadUrl =
// var uploadUrl =
// process.env.NODE_ENV === "test" ||
// process.env.NODE_ENV === "test" ||
// process.env.NODE_ENV === "development" ?
// process.env.NODE_ENV === "development" ?
...
@@ -23,7 +23,7 @@ var importZipUrl = process.env.VUE_APP_BASE_API + "/bizImport/importZip"
...
@@ -23,7 +23,7 @@ var importZipUrl = process.env.VUE_APP_BASE_API + "/bizImport/importZip"
* @param data
* @param data
* @returns {Promise}
* @returns {Promise}
*/
*/
export
function
upload
(
data
)
{
export
function
upload
File
(
data
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
axios
.
post
(
uploadUrl
,
data
,
{
axios
.
post
(
uploadUrl
,
data
,
{
headers
:
{
headers
:
{
...
@@ -85,3 +85,68 @@ export function importZip(data, callback) {
...
@@ -85,3 +85,68 @@ export function importZip(data, callback) {
})
})
})
})
}
}
/**
* 下载文件
* @param href 下载地址
* @param dowmloadName 下载文件用户看到的名称
*/
export
function
downloadFile
(
href
,
dowmloadName
)
{
let
a
=
document
.
createElement
(
"a"
);
a
.
href
=
href
;
a
.
download
=
dowmloadName
;
a
.
style
.
display
=
"none"
;
document
.
body
.
appendChild
(
a
);
a
.
click
();
a
.
remove
();
}
/**
* 预览文件
* @param href 预览地址
* @param previewName 预览文件用户看到的名称
*/
export
function
previewFile
(
href
,
previewName
)
{
let
a
=
document
.
createElement
(
"a"
);
a
.
href
=
href
;
a
.
target
=
'_blank'
a
.
download
=
previewName
;
a
.
style
.
display
=
"none"
;
document
.
body
.
appendChild
(
a
);
a
.
click
();
a
.
remove
();
}
/**
* 下载文件
* @param url 下载地址
* @param fileName 下载文件用户看到的名称
* @param typeSuffix 文件后缀
*/
export
function
downloadBlob
(
url
,
fileName
,
typeSuffix
)
{
axios
({
url
,
method
:
'get'
,
responseType
:
'blob'
,
headers
:
{
'authorization'
:
getToken
()
}
}).
then
(
response
=>
{
console
.
log
(
'response'
,
response
);
const
blob
=
new
Blob
([
response
.
data
])
const
link
=
document
.
createElement
(
'a'
)
link
.
href
=
URL
.
createObjectURL
(
blob
)
if
(
typeSuffix
)
{
link
.
download
=
fileName
+
'.'
+
typeSuffix
}
else
{
link
.
download
=
fileName
}
link
.
click
()
URL
.
revokeObjectURL
(
link
.
href
)
}).
catch
(
err
=>
{
console
.
error
(
err
);
})
};
src/utils/index.js
浏览文件 @
5da5ee84
...
@@ -45,7 +45,9 @@ export function parseTime(time, cFormat) {
...
@@ -45,7 +45,9 @@ export function parseTime(time, cFormat) {
const
time_str
=
format
.
replace
(
/{
([
ymdhisa
])
+}/g
,
(
result
,
key
)
=>
{
const
time_str
=
format
.
replace
(
/{
([
ymdhisa
])
+}/g
,
(
result
,
key
)
=>
{
const
value
=
formatObj
[
key
]
const
value
=
formatObj
[
key
]
// Note: getDay() returns 0 on Sunday
// Note: getDay() returns 0 on Sunday
if
(
key
===
'a'
)
{
return
[
'日'
,
'一'
,
'二'
,
'三'
,
'四'
,
'五'
,
'六'
][
value
]
}
if
(
key
===
'a'
)
{
return
[
'日'
,
'一'
,
'二'
,
'三'
,
'四'
,
'五'
,
'六'
][
value
]
}
return
value
.
toString
().
padStart
(
2
,
'0'
)
return
value
.
toString
().
padStart
(
2
,
'0'
)
})
})
return
time_str
return
time_str
...
@@ -123,18 +125,18 @@ export function param2Obj(url) {
...
@@ -123,18 +125,18 @@ export function param2Obj(url) {
* @returns {Function}
* @returns {Function}
* @constructor
* @constructor
*/
*/
export
const
Debounce
=
(
fn
,
t
)
=>
{
export
const
Debounce
=
(
fn
,
t
)
=>
{
let
delay
=
t
||
500
;
let
delay
=
t
||
500
;
let
timer
;
let
timer
;
return
function
()
{
return
function
()
{
let
args
=
arguments
;
let
args
=
arguments
;
if
(
timer
)
{
if
(
timer
)
{
clearTimeout
(
timer
);
clearTimeout
(
timer
);
}
}
timer
=
setTimeout
(()
=>
{
timer
=
setTimeout
(()
=>
{
timer
=
null
;
timer
=
null
;
fn
.
apply
(
this
,
args
);
fn
.
apply
(
this
,
args
);
},
delay
);
},
delay
);
}
}
};
};
...
@@ -150,18 +152,19 @@ export const Throttle = (fn, t) => {
...
@@ -150,18 +152,19 @@ export const Throttle = (fn, t) => {
let
last
;
let
last
;
let
timer
;
let
timer
;
let
interval
=
t
||
500
;
let
interval
=
t
||
500
;
return
function
()
{
return
function
()
{
let
args
=
arguments
;
let
args
=
arguments
;
let
now
=
+
new
Date
();
let
now
=
+
new
Date
();
if
(
last
&&
now
-
last
<
interval
)
{
if
(
last
&&
now
-
last
<
interval
)
{
clearTimeout
(
timer
);
clearTimeout
(
timer
);
timer
=
setTimeout
(()
=>
{
timer
=
setTimeout
(()
=>
{
last
=
now
;
last
=
now
;
fn
.
apply
(
this
,
args
);
fn
.
apply
(
this
,
args
);
},
interval
);
},
interval
);
}
else
{
}
else
{
last
=
now
;
last
=
now
;
fn
.
apply
(
this
,
args
);
fn
.
apply
(
this
,
args
);
}
}
}
}
}
}
src/views/culturalRelic/components/InfoEditDialog.vue
浏览文件 @
5da5ee84
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
></el-input>
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"文物类别"
:label-width=
"formLabelWidth"
>
<el-form-item
label=
"文物类别"
:label-width=
"formLabelWidth"
>
<el-select
<el-select
v-model=
"dialogForm.type"
v-model=
"dialogForm.type"
placeholder=
"请选择文物类别"
placeholder=
"请选择文物类别"
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
filterable
filterable
>
>
<el-option
<el-option
v-for=
"(value, key) in dict.culturalRelicType"
v-for=
"(value, key) in dict
s
.culturalRelicType"
:key=
"key"
:key=
"key"
:label=
"value"
:label=
"value"
:value=
"key"
:value=
"key"
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
filterable
filterable
>
>
<el-option
<el-option
v-for=
"(value, key) in dict.culturalRelicLevel"
v-for=
"(value, key) in dict
s
.culturalRelicLevel"
:key=
"key"
:key=
"key"
:label=
"value"
:label=
"value"
:value=
"key"
:value=
"key"
...
@@ -56,7 +56,7 @@
...
@@ -56,7 +56,7 @@
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"文物质地"
:label-width=
"formLabelWidth"
>
<el-form-item
label=
"文物质地"
:label-width=
"formLabelWidth"
>
<el-cascader
<el-cascader
style=
"width: 100%"
style=
"width: 100%"
v-model=
"dialogForm.textureType"
v-model=
"dialogForm.textureType"
:options=
"culturalRelicTextureType"
:options=
"culturalRelicTextureType"
...
@@ -96,7 +96,6 @@
...
@@ -96,7 +96,6 @@
filterable
filterable
>
>
</el-cascader>
</el-cascader>
</el-form-item>
</el-form-item>
<el-form-item
label=
"文物数量"
:label-width=
"formLabelWidth"
>
<el-form-item
label=
"文物数量"
:label-width=
"formLabelWidth"
>
<!--
<el-input
<!--
<el-input
...
@@ -273,13 +272,13 @@ export default {
...
@@ -273,13 +272,13 @@ export default {
},
},
},
},
computed
:
{
computed
:
{
...
mapGetters
([
"userInfo"
]),
...
mapGetters
([
"userInfo"
,
"dicts"
]),
dialogVisible
:
{
//
dialogVisible: {
get
:
function
()
{
//
get: function () {
return
this
.
visible
;
//
return this.visible;
},
//
},
set
:
function
()
{},
//
set: function () {},
},
//
},
title
()
{
title
()
{
if
(
this
.
dialogForm
.
crId
)
{
if
(
this
.
dialogForm
.
crId
)
{
return
"修改信息"
;
return
"修改信息"
;
...
@@ -287,15 +286,16 @@ export default {
...
@@ -287,15 +286,16 @@ export default {
return
"新增发布"
;
return
"新增发布"
;
}
}
},
},
// sayExplain() {
// if (this.dialogForm.sayExplainVo) {
// return this.dialogForm.sayExplainVo;
// } else {
// return [];
// }
// },
},
},
watch
:
{
watch
:
{
visible
:
{
handler
:
function
(
value
)
{
console
.
log
(
'visible'
,
value
);
this
.
dialogVisible
=
value
;
},
immediate
:
true
,
deep
:
true
,
},
form
:
{
form
:
{
handler
(
value
)
{
handler
(
value
)
{
this
.
dialogForm
=
JSON
.
parse
(
JSON
.
stringify
(
value
));
this
.
dialogForm
=
JSON
.
parse
(
JSON
.
stringify
(
value
));
...
@@ -326,7 +326,7 @@ export default {
...
@@ -326,7 +326,7 @@ export default {
this
.
dialogForm
.
literatureVo
&&
this
.
dialogForm
.
literatureVo
&&
this
.
dialogForm
.
literatureVo
.
length
>
0
this
.
dialogForm
.
literatureVo
.
length
>
0
)
{
)
{
this
.
literatureList
=
[...
this
.
dict
.
literature
];
this
.
literatureList
=
[...
this
.
dict
s
.
literature
];
this
.
literatureNames
=
[];
this
.
literatureNames
=
[];
this
.
literatureValues
=
[];
this
.
literatureValues
=
[];
this
.
dialogForm
.
literatureVo
.
forEach
((
lt
)
=>
{
this
.
dialogForm
.
literatureVo
.
forEach
((
lt
)
=>
{
...
@@ -342,13 +342,7 @@ export default {
...
@@ -342,13 +342,7 @@ export default {
immediate
:
true
,
immediate
:
true
,
deep
:
true
,
deep
:
true
,
},
},
dict
(
value
)
{
if
(
value
)
{
this
.
dict
=
value
;
}
},
},
},
dicts
:
[
"culturalRelicLevel"
,
"culturalRelicType"
,
"literature"
],
data
()
{
data
()
{
return
{
return
{
dialogForm
:
{
dialogForm
:
{
...
@@ -384,23 +378,20 @@ export default {
...
@@ -384,23 +378,20 @@ export default {
children
:
"children"
,
children
:
"children"
,
checkStrictly
:
true
,
//单选选择任意一级选项
checkStrictly
:
true
,
//单选选择任意一级选项
},
},
dialogVisible
:
false
,
};
};
},
},
async
created
()
{
async
created
()
{
// setTimeout(() => {
await
this
.
$store
.
dispatch
(
"dict/getDictList"
,
[
// console.log("22222this.dict", this.dict);
"culturalRelicLevel"
,
// });
"culturalRelicType"
,
},
]);
mounted
()
{
let
res
=
await
this
.
$store
.
dispatch
(
"dict/getDictTree"
,
[
this
.
$store
"culturalRelicTextureType"
,
.
dispatch
(
"dict/getDictTree"
,
[
"culturalRelicYears"
,
"culturalRelicTextureType"
,
]);
"culturalRelicYears"
,
this
.
culturalRelicTextureType
=
res
.
culturalRelicTextureType
;
])
this
.
culturalRelicYears
=
res
.
culturalRelicYears
;
.
then
((
res
)
=>
{
this
.
culturalRelicTextureType
=
res
.
culturalRelicTextureType
;
this
.
culturalRelicYears
=
res
.
culturalRelicYears
;
});
},
},
methods
:
{
methods
:
{
// 关联文献查询
// 关联文献查询
...
@@ -537,7 +528,8 @@ export default {
...
@@ -537,7 +528,8 @@ export default {
}
}
// 处理质地
// 处理质地
if
(
params
.
textureType
instanceof
Array
)
{
if
(
params
.
textureType
instanceof
Array
)
{
params
.
textureType
=
params
.
textureType
[
params
.
textureType
.
length
-
1
].
trim
();
params
.
textureType
=
params
.
textureType
[
params
.
textureType
.
length
-
1
].
trim
();
}
}
let
res
=
await
editCulturalRelic
(
params
);
let
res
=
await
editCulturalRelic
(
params
);
if
(
res
.
code
==
0
)
{
if
(
res
.
code
==
0
)
{
...
...
src/views/culturalRelic/components/MultiUploadDialog.vue
浏览文件 @
5da5ee84
...
@@ -37,19 +37,33 @@
...
@@ -37,19 +37,33 @@
<div
class=
"upload-progress"
v-if=
"isUpLoading"
>
<div
class=
"upload-progress"
v-if=
"isUpLoading"
>
<div
class=
"subtitle"
>
<div
class=
"subtitle"
>
<div
class=
"divider"
></div>
<div
class=
"divider"
></div>
<div
class=
"label"
>
上传进度
</div>
<div
class=
"label"
>
当前上传列表
</div>
</div>
</div>
<el-progress
:percentage=
"percentState"
:status=
"uploadStatus"
></el-progress>
<!--
<el-progress
:percentage=
"percentState"
:status=
"progressStatus"
></el-progress>
-->
<!--
<el-table>
<el-table-column
prop=
"fileName"
label=
"文件名"
>
</el-table-column>
<el-table-column
prop=
"size"
label=
"文件大小"
>
</el-table-column>
<el-table-column
prop=
"progress"
label=
"进度"
>
<template
slot-scope=
"scope"
>
<i
class=
"el-icon-time"
></i>
<span
style=
"margin-left: 10px"
>
{{
scope
.
row
.
date
}}
</span>
</
template
>
</el-table-column>
<el-table-column
prop=
"operation"
label=
"操作"
>
</el-table-column>
</el-table>
-->
</div>
</div>
<div
class=
"upload-records"
>
<div
class=
"upload-records"
>
<div
class=
"subtitle"
>
<div
class=
"subtitle"
>
<div
class=
"divider"
></div>
<div
class=
"divider"
></div>
<div
class=
"label"
>
上传记录
</div>
<div
class=
"label"
>
上传
历史
记录
</div>
</div>
</div>
<TablePage
:data=
"list.records"
:tableTitle=
"tableTitle"
/>
<TablePage
:data=
"list.records"
:tableTitle=
"tableTitle"
/>
</div>
</div>
<div
class=
"dialog-footer"
>
<div
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"handleClose"
>
关闭
</el-button>
<el-button
type=
"primary"
@
click
.
native
=
"handleClose"
>
关闭
</el-button>
</div>
</div>
</div>
</div>
</el-dialog>
</el-dialog>
...
@@ -71,9 +85,6 @@ export default {
...
@@ -71,9 +85,6 @@ export default {
},
},
},
},
watch
:
{
watch
:
{
// visible(value) {
// this.dialogVisible = value;
// },
visible
:
{
visible
:
{
handler
:
function
(
value
)
{
handler
:
function
(
value
)
{
this
.
dialogVisible
=
value
;
this
.
dialogVisible
=
value
;
...
@@ -87,7 +98,6 @@ export default {
...
@@ -87,7 +98,6 @@ export default {
dialogVisible
:
false
,
dialogVisible
:
false
,
isUpLoading
:
false
,
isUpLoading
:
false
,
percentState
:
0
,
percentState
:
0
,
uploadStatus
:
'primary'
,
list
:
{
list
:
{
records
:
[],
records
:
[],
current
:
1
,
current
:
1
,
...
@@ -120,6 +130,7 @@ export default {
...
@@ -120,6 +130,7 @@ export default {
columnAlign
:
"center"
,
columnAlign
:
"center"
,
},
},
],
],
progressStatus
:
null
,
};
};
},
},
mounted
()
{
mounted
()
{
...
@@ -128,7 +139,7 @@ export default {
...
@@ -128,7 +139,7 @@ export default {
methods
:
{
methods
:
{
// 取消编辑
// 取消编辑
cancelForm
()
{
cancelForm
()
{
this
.
$emit
(
"handleClose"
);
this
.
handleClose
(
);
},
},
async
loadData
()
{
async
loadData
()
{
const
params
=
{
const
params
=
{
...
@@ -139,12 +150,33 @@ export default {
...
@@ -139,12 +150,33 @@ export default {
this
.
list
=
res
.
data
;
this
.
list
=
res
.
data
;
},
},
handleClose
(
done
)
{
handleClose
(
done
)
{
this
.
$confirm
(
"确认关闭?"
)
let
title
=
this
.
isUpLoading
.
then
((
_
)
=>
{
?
"当前有上传任务,是否后台继续上传?"
done
();
:
"确认关闭?"
;
this
.
$emit
(
"handleClose"
);
let
confirmButtonText
=
this
.
isUpLoading
?
"是"
:
"确定"
;
let
cancelButtonText
=
this
.
isUpLoading
?
"取消上传"
:
"取消"
;
let
that
=
this
;
this
.
$confirm
(
title
,
"提示"
,
{
confirmButtonText
,
cancelButtonText
,
type
:
"warning"
,
})
.
then
(()
=>
{
// 点击继续后台上传
if
(
that
.
isUpLoading
)
{
this
.
$message
.
warning
(
"文件仍在上传,请勿关闭窗口!"
);
}
this
.
dialogVisible
=
false
;
that
.
$emit
(
"handleClose"
);
})
})
.
catch
((
_
)
=>
{});
.
catch
(()
=>
{
// 点击取消上传
if
(
that
.
isUpLoading
)
{
// TODO:取消上传
this
.
$message
.
info
(
"已取消上传!"
);
}
});
},
},
handleDownloadTemplate
()
{
handleDownloadTemplate
()
{
...
@@ -156,31 +188,45 @@ export default {
...
@@ -156,31 +188,45 @@ export default {
a
.
click
();
a
.
click
();
a
.
remove
();
a
.
remove
();
},
},
async
handleChange
(
file
,
fileList
)
{
async
handleChange
(
file
,
fileList
)
{
console
.
log
(
"handleChange"
,
file
,
fileList
);
console
.
log
(
"handleChange"
,
file
,
fileList
);
if
(
file
.
status
==
"ready"
)
{
if
(
file
.
status
==
"ready"
)
{
this
.
isUpLoading
=
true
;
let
{
name
,
size
,
raw
}
=
file
;
// TODO:
size
=
size
/
1024
/
1024
/
100
;
let
formData
=
new
FormData
();
console
.
log
(
'size'
,
size
);
formData
.
append
(
"type"
,
"biz_cultural_relic"
);
// let fileItem = {
formData
.
append
(
"zipFile"
,
file
.
raw
);
// name,
let
res
=
await
importZip
(
formData
,
this
.
updateProgress
);
// size,
if
(
res
.
code
==
0
)
{
// };
this
.
$message
.
success
(
"上传成功!"
);
// this.fileList.push(file);
// this.isUpLoading = true;
// 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.percentState = 100;
// this.$message.success("上传成功!");
// this.progressStatus = "success";
// this.isUpLoading = false;
// this.isUpLoading = false;
}
else
{
// let index = this.fileList.indexOf(file);
this
.
$message
.
error
(
res
.
msg
);
// this.fileList.splice(index, 1); //上传成功后删除当前文件
}
// } else {
// this.progressStatus = "warning";
// this.$message.error(res.msg);
// }
}
}
},
},
updateProgress
(
e
)
{
updateProgress
(
e
)
{
//e为回调回来的参数 通过进行和total的值来进行进度
//e为回调回来的参数 通过进行和total的值来进行进度
this
.
percentState
=
parseInt
((
e
.
loaded
/
e
.
total
)
*
100
);
this
.
percentState
=
parseInt
((
e
.
loaded
/
e
.
total
)
*
100
)
-
1
;
if
(
this
.
percentState
==
100
)
{
if
(
this
.
percentState
==
99
)
{
// this.$message.success("上传成功!");
// this.$message.success("上传成功!");
// this.isUpLoading = false;
// this.isUpLoading = false;
this
.
uploadStatus
=
'success'
// this.uploadStatus = "success";
}
}
},
},
},
},
...
...
src/views/culturalRelic/index.vue
浏览文件 @
5da5ee84
<
template
>
<
template
>
<div
<div
class=
"app-container"
>
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"
/>
<div
class=
"tools"
>
<div
class=
"tools"
>
...
@@ -52,16 +46,16 @@
...
@@ -52,16 +46,16 @@
/>
/>
</
template
>
</
template
>
<
template
v-slot:years=
"data"
>
<
template
v-slot:years=
"data"
>
{{
dict
.
cultural_relic_years
[
data
.
scope
.
years
]
}}
{{
dict
s
.
cultural_relic_years
[
data
.
scope
.
years
]
}}
</
template
>
</
template
>
<
template
v-slot:level=
"data"
>
<
template
v-slot:level=
"data"
>
{{
dict
.
cultural_relic_level
[
data
.
scope
.
level
]
}}
{{
dict
s
.
cultural_relic_level
[
data
.
scope
.
level
]
}}
</
template
>
</
template
>
<
template
v-slot:textureType=
"data"
>
<
template
v-slot:textureType=
"data"
>
{{
dict
.
cultural_relic_texture
[
data
.
scope
.
textureType
]
}}
{{
dict
s
.
cultural_relic_texture
[
data
.
scope
.
textureType
]
}}
</
template
>
</
template
>
<
template
v-slot:type=
"data"
>
<
template
v-slot:type=
"data"
>
{{
dict
.
cultural_relic_type
[
data
.
scope
.
type
]
}}
{{
dict
s
.
cultural_relic_type
[
data
.
scope
.
type
]
}}
</
template
>
</
template
>
<
template
v-slot:operates=
"scope"
>
<
template
v-slot:operates=
"scope"
>
<TableOperation
<TableOperation
...
@@ -98,6 +92,7 @@
...
@@ -98,6 +92,7 @@
<
script
>
<
script
>
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
SearchBar
from
"@/components/SearchBar"
;
import
{
title
,
operates
,
operations
}
from
"./config"
;
import
{
title
,
operates
,
operations
}
from
"./config"
;
import
{
import
{
getCulturalRelicList
,
getCulturalRelicList
,
...
@@ -107,23 +102,21 @@ import {
...
@@ -107,23 +102,21 @@ import {
}
from
"@/api/culturalRelic"
;
}
from
"@/api/culturalRelic"
;
import
InfoEditDialog
from
"./components/InfoEditDialog"
;
import
InfoEditDialog
from
"./components/InfoEditDialog"
;
import
MultiUploadDialog
from
"./components/MultiUploadDialog"
;
import
MultiUploadDialog
from
"./components/MultiUploadDialog"
;
import
{
mapGetters
}
from
"vuex"
;
import
SearchBar
from
"@/components/SearchBar"
;
export
default
{
export
default
{
components
:
{
components
:
{
TablePage
,
TablePage
,
TableOperation
,
TableOperation
,
InfoEditDialog
,
InfoEditDialog
,
SearchBar
,
SearchBar
,
MultiUploadDialog
MultiUploadDialog
,
},
},
dicts
:
[
//
dicts: [
// "cultural_relic_years",
//
// "cultural_relic_years",
"culturalRelicLevel"
,
//
"culturalRelicLevel",
// "cultural_relic_texture",
//
// "cultural_relic_texture",
"culturalRelicType"
,
//
"culturalRelicType",
],
//
],
data
()
{
data
()
{
return
{
return
{
list
:
{
list
:
{
...
@@ -196,13 +189,6 @@ export default {
...
@@ -196,13 +189,6 @@ export default {
imgList
:
[],
imgList
:
[],
};
};
},
},
watch
:
{
dict
(
value
)
{
if
(
value
)
{
this
.
dict
=
value
;
}
},
},
computed
:
{
computed
:
{
tableTitle
()
{
tableTitle
()
{
return
title
;
return
title
;
...
@@ -223,7 +209,7 @@ export default {
...
@@ -223,7 +209,7 @@ export default {
};
};
},
},
},
},
moun
ted
()
{
async
crea
ted
()
{
this
.
loadData
();
this
.
loadData
();
},
},
methods
:
{
methods
:
{
...
@@ -286,7 +272,9 @@ export default {
...
@@ -286,7 +272,9 @@ export default {
}
}
break
;
break
;
case
"multiAdd"
:
case
"multiAdd"
:
this
.
multiUploadVisible
=
true
// debugger
this
.
multiUploadVisible
=
true
;
console
.
log
(
'this.multiUploadVisible'
,
this
.
multiUploadVisible
);
break
;
break
;
}
}
},
},
...
@@ -360,6 +348,7 @@ export default {
...
@@ -360,6 +348,7 @@ export default {
},
},
handleMultiUploadClose
()
{
handleMultiUploadClose
()
{
this
.
multiUploadVisible
=
false
;
this
.
multiUploadVisible
=
false
;
console
.
log
(
'父组件关闭被触发'
);
},
},
},
},
};
};
...
...
src/views/display/components/InfoEditDialog.vue
浏览文件 @
5da5ee84
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
style=
"width: 100%"
style=
"width: 100%"
>
>
<el-option
<el-option
v-for=
"(value, key) in dict.display_type"
v-for=
"(value, key) in dict
s
.display_type"
:key=
"key"
:key=
"key"
:label=
"value"
:label=
"value"
:value=
"key"
:value=
"key"
...
@@ -258,7 +258,7 @@ export default {
...
@@ -258,7 +258,7 @@ export default {
},
},
},
},
computed
:
{
computed
:
{
...
mapGetters
([
"userInfo"
]),
...
mapGetters
([
"userInfo"
,
"dicts"
]),
dialogVisible
:
{
dialogVisible
:
{
get
:
function
()
{
get
:
function
()
{
return
this
.
visible
;
return
this
.
visible
;
...
@@ -369,13 +369,11 @@ export default {
...
@@ -369,13 +369,11 @@ export default {
},
},
immediate
:
true
,
immediate
:
true
,
},
},
dict
(
value
)
{
if
(
value
)
{
this
.
dict
=
value
;
}
},
},
},
dicts
:
[
"display_character"
,
"display_type"
,
"literature"
],
async
created
()
{
await
this
.
$store
.
dispatch
(
"dict/getDictList"
,
[
"display_type"
]);
},
// dicts: ["display_character", "display_type", "literature"],
data
()
{
data
()
{
return
{
return
{
dialogForm
:
{
dialogForm
:
{
...
@@ -418,7 +416,17 @@ export default {
...
@@ -418,7 +416,17 @@ export default {
};
};
setTimeout
(
async
()
=>
{
setTimeout
(
async
()
=>
{
this
.
loading
=
false
;
this
.
loading
=
false
;
const
res
=
await
getLiteratureList
(
params
);
// const res = await getLiteratureList(params);
// if (res.code == 0) {
// this.literatureList = res.data.records;
// } else {
// this.literatureList = [];
// this.$message.error(res.msg);
// }
const
res
=
await
this
.
$store
.
dispatch
(
"dict/getLtList"
,
{
hasPer
:
false
,
params
,
});
if
(
res
.
code
==
0
)
{
if
(
res
.
code
==
0
)
{
this
.
literatureList
=
res
.
data
.
records
;
this
.
literatureList
=
res
.
data
.
records
;
}
else
{
}
else
{
...
@@ -427,7 +435,7 @@ export default {
...
@@ -427,7 +435,7 @@ export default {
}
}
},
500
);
},
500
);
},
},
// 关联文
献
查询
// 关联文
物
查询
searchCR
(
queryString
)
{
searchCR
(
queryString
)
{
let
that
=
this
;
let
that
=
this
;
if
(
!
queryString
.
trim
())
{
if
(
!
queryString
.
trim
())
{
...
@@ -663,6 +671,7 @@ export default {
...
@@ -663,6 +671,7 @@ export default {
deptId
,
deptId
,
regionCode
,
regionCode
,
};
};
// params.displayCharacter = 1;//展览类型传布展
params
.
literature
=
this
.
literatureValues
.
join
(
","
);
params
.
literature
=
this
.
literatureValues
.
join
(
","
);
params
.
status
=
this
.
dialogForm
.
status
?
1
:
0
;
params
.
status
=
this
.
dialogForm
.
status
?
1
:
0
;
params
.
crIds
=
this
.
crIds
.
join
(
","
);
params
.
crIds
=
this
.
crIds
.
join
(
","
);
...
...
src/views/display/index.vue
浏览文件 @
5da5ee84
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
</el-popconfirm>
</el-popconfirm>
</
template
>
</
template
>
<
template
v-slot:displayType=
"data"
>
<
template
v-slot:displayType=
"data"
>
{{
dict
.
display_type
[
data
.
scope
.
type
]
}}
{{
dict
s
.
display_type
[
data
.
scope
.
type
]
}}
</
template
>
</
template
>
<
template
v-slot:faceImageUrl=
"data"
>
<
template
v-slot:faceImageUrl=
"data"
>
<img
<img
...
@@ -116,7 +116,7 @@ import InfoEditDialog from "./components/InfoEditDialog";
...
@@ -116,7 +116,7 @@ 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"
;
import
SearchBar
from
"@/components/SearchBar"
;
import
SearchBar
from
"@/components/SearchBar"
;
import
{
mapGetters
}
from
"vuex"
;
export
default
{
export
default
{
components
:
{
components
:
{
TablePage
,
TablePage
,
...
@@ -189,14 +189,8 @@ export default {
...
@@ -189,14 +189,8 @@ export default {
displayTypes
:
{},
displayTypes
:
{},
};
};
},
},
watch
:
{
dict
(
value
)
{
if
(
value
)
{
this
.
dict
=
value
;
}
},
},
computed
:
{
computed
:
{
...
mapGetters
([
"dicts"
]),
tableTitle
()
{
tableTitle
()
{
return
title
;
return
title
;
},
},
...
@@ -216,8 +210,9 @@ export default {
...
@@ -216,8 +210,9 @@ export default {
};
};
},
},
},
},
dicts
:
[
"display_type"
],
mounted
()
{
async
created
()
{
await
this
.
$store
.
dispatch
(
"dict/getDictList"
,
[
"display_type"
]);
this
.
loadData
();
this
.
loadData
();
},
},
methods
:
{
methods
:
{
...
@@ -342,9 +337,9 @@ export default {
...
@@ -342,9 +337,9 @@ export default {
const
{
exhibitionId
}
=
value
;
const
{
exhibitionId
}
=
value
;
let
res
=
await
getDisplayById
({
exhibitionId
});
let
res
=
await
getDisplayById
({
exhibitionId
});
delete
res
.
data
.
exhibitionId
;
delete
res
.
data
.
exhibitionId
;
this
.
form
=
{
...
res
.
data
};
this
.
form
=
{
...
res
.
data
};
this
.
editDialogVisible
=
true
;
this
.
editDialogVisible
=
true
;
console
.
log
(
'this.form'
,
this
.
form
);
console
.
log
(
"this.form"
,
this
.
form
);
},
},
},
},
};
};
...
...
src/views/literature/components/InfoEditDialog.vue
浏览文件 @
5da5ee84
<
template
>
<
template
>
<el-dialog
<el-dialog
:visible
.
sync
=
"dialogVisible"
:visible=
"dialogVisible"
width=
"40%"
width=
"40%"
style=
"height: 98%"
style=
"height: 98%"
:before-close=
"handleClose"
:before-close=
"handleClose"
...
@@ -22,47 +22,52 @@
...
@@ -22,47 +22,52 @@
</el-form-item>
</el-form-item>
<el-form-item
label=
"作者"
:label-width=
"formLabelWidth"
>
<el-form-item
label=
"作者"
:label-width=
"formLabelWidth"
>
<el-input
<el-input
v-model=
"dialogForm.
name
"
v-model=
"dialogForm.
authors
"
autocomplete=
"off"
autocomplete=
"off"
placeholder=
"请输入作者"
placeholder=
"请输入作者"
></el-input>
></el-input>
</el-form-item>
</el-form-item>
<el-form-item
label=
"
日期
"
:label-width=
"formLabelWidth"
>
<el-form-item
label=
"
文献来源
"
:label-width=
"formLabelWidth"
>
<
!--
<
el-input
<el-input
v-model=
"dialogForm.
nam
e"
v-model=
"dialogForm.
sourc
e"
autocomplete=
"off"
autocomplete=
"off"
placeholder=
"请输入作者"
placeholder=
"请输入文献来源"
></el-input>
-->
></el-input>
</el-form-item>
<el-form-item
label=
"出版/发布日期"
:label-width=
"formLabelWidth"
>
<el-date-picker
<el-date-picker
style=
"width: 100%"
v-model=
"dialogForm.date"
v-model=
"dialogForm.date"
type=
"date"
type=
"date"
placeholder=
"请选择日期(出版年份、发布日期)"
placeholder=
"请选择出版/发布日期"
value-format=
"yyyy-MM-dd"
>
>
</el-date-picker>
</el-date-picker>
</el-form-item>
</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-form-item
label=
"状态"
:label-width=
"formLabelWidth"
>
<el-switch
v-model=
"status"
>
</el-switch>
<el-switch
v-model=
"status"
>
</el-switch>
</el-form-item>
</el-form-item>
<el-form-item
label=
"文件"
:label-width=
"formLabelWidth"
>
<el-form-item
label=
"文件"
:label-width=
"formLabelWidth"
>
<
Auto
Uploader
<
Manual
Uploader
v-model=
"ltFile
"
:files=
"files
"
:fileLimit=
"1"
:fileLimit=
"1"
:fileSize=
"50"
:fileSize=
"50"
listType=
"text"
listType=
"text"
:fileType=
"['pdf']"
:fileType=
"['pdf']"
ref=
"
museumFaceImage
"
ref=
"
pdf
"
/>
/>
</el-form-item>
</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>
</el-form>
</div>
</div>
<div
class=
"dialog-footer"
>
<div
class=
"dialog-footer"
>
...
@@ -75,13 +80,14 @@
...
@@ -75,13 +80,14 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
add
Virtual
,
editVirtual
}
from
"@/api/vitual
"
;
import
{
add
Literature
,
editLiterature
}
from
"@/api/literature
"
;
import
AutoUploader
from
"@/components/Uploader/Auto
Uploader.vue"
;
import
ManualUploader
from
"@/components/Uploader/Manual
Uploader.vue"
;
import
{
mapGetters
}
from
"vuex"
;
import
{
mapGetters
}
from
"vuex"
;
import
{
uploadFile
}
from
"@/utils/file"
;
export
default
{
export
default
{
name
:
"InfoEditDialog"
,
name
:
"InfoEditDialog"
,
components
:
{
components
:
{
Auto
Uploader
,
Manual
Uploader
,
},
},
props
:
{
props
:
{
visible
:
{
visible
:
{
...
@@ -95,17 +101,11 @@ export default {
...
@@ -95,17 +101,11 @@ export default {
},
},
computed
:
{
computed
:
{
...
mapGetters
([
"userInfo"
]),
...
mapGetters
([
"userInfo"
]),
dialogVisible
:
{
get
:
function
()
{
return
this
.
visible
;
},
set
:
function
()
{},
},
title
()
{
title
()
{
if
(
this
.
dialogForm
.
bv
Id
)
{
if
(
this
.
dialogForm
.
literature
Id
)
{
return
"修改
虚拟展厅信息
"
;
return
"修改
文献
"
;
}
else
{
}
else
{
return
"添加
虚拟展厅
"
;
return
"添加
文献
"
;
}
}
},
},
},
},
...
@@ -113,28 +113,27 @@ export default {
...
@@ -113,28 +113,27 @@ export default {
form
:
{
form
:
{
handler
:
function
(
value
)
{
handler
:
function
(
value
)
{
let
that
=
this
;
let
that
=
this
;
that
.
dialogForm
=
JSON
.
parse
(
JSON
.
stringify
(
value
));
that
.
dialogForm
=
JSON
.
parse
(
JSON
.
stringify
(
value
));
// 编辑状态
// 编辑状态
if
(
that
.
dialogForm
.
literatureId
)
{
if
(
that
.
dialogForm
.
literatureId
)
{
//
console.log("that.dialogForm.", that.dialogForm);
//
回填状态
that
.
status
=
Boolean
(
Number
(
that
.
dialogForm
.
status
));
that
.
status
=
Boolean
(
Number
(
that
.
dialogForm
.
status
));
// 回填封面
// 回填文件
if
(
this
.
dialogForm
.
files
)
{
if
(
that
.
dialogForm
.
files
)
{
that
.
files
=
[
that
.
files
=
that
.
dialogForm
.
files
;
{
name
:
this
.
dialogForm
.
name
+
"封面.png"
,
url
:
this
.
dialogForm
.
faceImageUrl
,
fileId
:
this
.
dialogForm
.
faceImage
,
},
];
}
}
}
}
},
},
immediate
:
true
,
immediate
:
true
,
deep
:
true
,
deep
:
true
,
},
},
status
(
value
)
{
visible
:
{
console
.
log
(
value
);
handler
:
function
(
value
)
{
this
.
dialogVisible
=
value
;
},
deep
:
true
,
immediate
:
true
,
},
},
},
},
data
()
{
data
()
{
...
@@ -143,6 +142,7 @@ export default {
...
@@ -143,6 +142,7 @@ export default {
formLabelWidth
:
"100px"
,
formLabelWidth
:
"100px"
,
status
:
false
,
status
:
false
,
files
:
[],
//文献文件
files
:
[],
//文献文件
dialogVisible
:
false
,
};
};
},
},
methods
:
{
methods
:
{
...
@@ -159,30 +159,38 @@ export default {
...
@@ -159,30 +159,38 @@ export default {
},
},
async
handleSubmit
()
{
async
handleSubmit
()
{
if
(
this
.
dialogForm
.
bvId
)
{
// debugger
let
params
=
{
...
this
.
dialogForm
};
// console.log(this.dialogForm);
// 回填文件
// return
if
(
this
.
faceImage
.
length
>
0
)
{
let
params
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
dialogForm
));
params
.
faceImage
=
this
.
faceImage
[
0
].
fileId
;
// 回填文件
let
file
=
this
.
$refs
.
pdf
.
getFiles
();
let
formData
=
new
FormData
();
// console.log("file", file);
// return
// debugger;
if
(
file
[
0
].
status
==
"ready"
)
{
// debugger;
formData
.
append
(
"files"
,
file
[
0
].
raw
);
let
upLoadRes
=
await
uploadFile
(
formData
);
if
(
upLoadRes
.
code
==
0
)
{
params
.
pdfFile
=
upLoadRes
.
data
[
0
].
fileId
;
}
else
{
this
.
$message
.
error
(
"上传失败!:"
+
upLoadRes
.
data
.
msg
);
}
}
// 处理状态
}
else
if
(
file
[
0
].
status
==
"success"
)
{
// debugger
params
.
pdfFile
=
file
[
0
].
fileId
;
params
.
status
=
this
.
status
?
1
:
0
;
}
let
res
=
await
editVirtual
(
params
);
// 修改状态
params
.
status
=
this
.
status
?
1
:
0
;
if
(
params
.
literatureId
)
{
let
res
=
await
editLiterature
(
params
);
if
(
res
.
code
==
0
)
{
if
(
res
.
code
==
0
)
{
this
.
$message
.
success
(
"修改成功!"
);
this
.
$message
.
success
(
"修改成功!"
);
this
.
reload
();
this
.
reload
();
}
}
}
else
{
}
else
{
let
params
=
{
...
this
.
dialogForm
};
let
res
=
await
addLiterature
(
params
);
// 回填图片
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
)
{
if
(
res
.
code
==
0
)
{
this
.
$message
.
success
(
"添加成功!"
);
this
.
$message
.
success
(
"添加成功!"
);
this
.
reload
();
this
.
reload
();
...
@@ -190,16 +198,16 @@ export default {
...
@@ -190,16 +198,16 @@ export default {
}
}
},
},
reload
()
{
reload
()
{
this
.
$emit
(
"refresh"
,
true
);
//需要重新获取orgTree
this
.
$emit
(
"refresh"
);
this
.
$emit
(
"handleClose"
);
this
.
$emit
(
"handleClose"
);
this
.
f
aceImage
=
[];
this
.
f
iles
=
[];
},
},
handleClose
(
done
)
{
handleClose
(
done
)
{
this
.
$confirm
(
"确认关闭?"
)
this
.
$confirm
(
"确认关闭?"
)
.
then
((
_
)
=>
{
.
then
((
_
)
=>
{
done
();
done
();
this
.
$emit
(
"handleClose"
);
this
.
$emit
(
"handleClose"
);
this
.
f
aceImage
=
[];
this
.
f
iles
=
[];
})
})
.
catch
((
_
)
=>
{});
.
catch
((
_
)
=>
{});
},
},
...
@@ -227,15 +235,10 @@ export default {
...
@@ -227,15 +235,10 @@ export default {
flex
:
1
;
flex
:
1
;
margin-right
:
48px
;
margin-right
:
48px
;
}
}
.relate
{
flex
:
1
;
}
}
}
.dialog-footer
{
.dialog-footer
{
display
:
flex
;
display
:
flex
;
justify-content
:
flex-end
;
justify-content
:
flex-end
;
}
}
</
style
>
</
style
>
\ No newline at end of file
src/views/literature/config.js
浏览文件 @
5da5ee84
export
const
title
=
[{
export
const
title
=
[{
prop
:
"name"
,
prop
:
"name"
,
label
:
"名称"
,
label
:
"名称"
,
columnAlign
:
'center'
,
columnAlign
:
'center'
,
width
:
200
,
width
:
200
,
showOverFlowToolTip
:
true
showOverFlowToolTip
:
true
},
},
{
{
prop
:
"authors"
,
prop
:
"authors"
,
label
:
"作者"
,
label
:
"作者"
,
columnAlign
:
'center'
,
columnAlign
:
'center'
,
},
},
{
{
prop
:
"browseCount"
,
prop
:
"browseCount"
,
label
:
"浏览量"
,
label
:
"浏览量"
,
columnAlign
:
'center'
,
columnAlign
:
'center'
,
},
},
{
{
prop
:
"status"
,
prop
:
"status"
,
label
:
"状态"
,
label
:
"状态"
,
columnAlign
:
'center'
,
columnAlign
:
'center'
,
isStatus
:
true
,
isStatus
:
true
,
width
:
100
width
:
100
},
},
{
{
prop
:
"date"
,
prop
:
"date"
,
label
:
"日期(出版年份、发布日期)
"
,
label
:
"出版/发布日期
"
,
columnAlign
:
'center'
,
columnAlign
:
'center'
,
},
},
{
//
{
prop
:
"pdfFile"
,
//
prop: "pdfFile",
label
:
"pdf文件"
,
//
label: "pdf文件",
columnAlign
:
'center'
,
//
columnAlign: 'center',
},
//
},
{
{
prop
:
"source"
,
prop
:
"source"
,
label
:
"文献来源"
,
label
:
"文献来源"
,
columnAlign
:
'center'
,
columnAlign
:
'center'
,
},
},
{
{
prop
:
"remark"
,
prop
:
"remark"
,
label
:
"备注"
,
label
:
"备注"
,
columnAlign
:
'center'
,
columnAlign
:
'center'
,
showOverFlowToolTip
:
true
,
showOverFlowToolTip
:
true
,
},
},
]
]
export
const
operates
=
{
export
const
operates
=
{
operate
:
true
,
operate
:
true
,
label
:
"操作"
,
label
:
"操作"
,
width
:
"200px"
,
width
:
"360px"
,
titleAlign
:
"center"
,
minwidth
:
"220px"
,
columnAlign
:
"center"
,
titleAlign
:
"center"
,
columnAlign
:
"center"
,
}
}
export
const
operations
=
[
export
const
operations
=
[{
// {
type
:
'view'
,
// type: 'view',
title
:
'预览'
// title: '预览'
},
// },
{
{
type
:
'download'
,
type
:
'edit'
,
title
:
'下载'
title
:
'编辑'
},
},
{
{
type
:
'edit'
,
type
:
'delete'
,
title
:
'编辑'
title
:
'删除'
},
},
{
type
:
'delete'
,
title
:
'删除'
},
]
]
src/views/literature/index.vue
浏览文件 @
5da5ee84
...
@@ -26,6 +26,14 @@
...
@@ -26,6 +26,14 @@
></el-switch>
></el-switch>
</el-popconfirm>
</el-popconfirm>
</
template
>
</
template
>
<
template
v-slot:operates=
"scope"
>
<TableOperation
:operations=
"tableOperations"
:rawData=
"scope.scope.row"
@
handleOperation=
"handleOperation"
></TableOperation>
</
template
>
</TablePage>
</TablePage>
<el-pagination
<el-pagination
@
size-change=
"handleSizeChange"
@
size-change=
"handleSizeChange"
...
@@ -51,9 +59,10 @@
...
@@ -51,9 +59,10 @@
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
{
editLiterature
,
getLiteratureLis
t
}
from
"@/api/literature"
;
import
{
editLiterature
,
deleteL
t
}
from
"@/api/literature"
;
import
InfoEditDialog
from
"./components/InfoEditDialog"
;
import
InfoEditDialog
from
"./components/InfoEditDialog"
;
import
SearchBar
from
"@/components/SearchBar"
;
import
SearchBar
from
"@/components/SearchBar"
;
import
{
downloadFile
,
previewFile
,
downloadBlob
}
from
"@/utils/file"
;
export
default
{
export
default
{
components
:
{
components
:
{
...
@@ -146,8 +155,10 @@ export default {
...
@@ -146,8 +155,10 @@ export default {
if
(
params
.
status
==
""
)
{
if
(
params
.
status
==
""
)
{
delete
params
.
status
;
delete
params
.
status
;
}
}
console
.
log
(
"params"
,
params
);
const
res
=
await
this
.
$store
.
dispatch
(
"dict/getLtList"
,
{
let
res
=
await
getLiteratureList
(
params
);
hasPer
:
true
,
params
,
});
if
(
res
.
code
==
0
)
{
if
(
res
.
code
==
0
)
{
this
.
list
=
res
.
data
;
this
.
list
=
res
.
data
;
}
}
...
@@ -163,7 +174,10 @@ export default {
...
@@ -163,7 +174,10 @@ export default {
page
:
this
.
list
.
current
,
page
:
this
.
list
.
current
,
limit
:
this
.
list
.
size
,
limit
:
this
.
list
.
size
,
};
};
let
res
=
await
getLiteratureList
(
params
);
const
res
=
await
this
.
$store
.
dispatch
(
"dict/getLtList"
,
{
hasPer
:
true
,
params
,
});
if
(
res
.
code
==
0
)
{
if
(
res
.
code
==
0
)
{
this
.
list
=
res
.
data
;
this
.
list
=
res
.
data
;
}
}
...
@@ -175,14 +189,26 @@ export default {
...
@@ -175,14 +189,26 @@ export default {
this
.
drawerVisible
=
true
;
this
.
drawerVisible
=
true
;
break
;
break
;
case
"view"
:
case
"view"
:
// TODO:
if
(
row
.
files
&&
row
.
files
.
length
>
0
&&
row
.
files
[
0
].
url
)
{
previewFile
(
row
.
files
[
0
].
url
,
row
.
name
);
}
else
{
this
.
$message
.
info
(
"暂无文献附件!"
);
}
break
;
case
"download"
:
if
(
row
.
files
&&
row
.
files
.
length
>
0
&&
row
.
files
[
0
].
url
)
{
let
url
=
'/files'
+
row
.
files
[
0
].
url
.
split
(
'files'
)[
1
]
downloadBlob
(
url
,
row
.
name
,
"pdf"
);
}
else
{
this
.
$message
.
info
(
"暂无文献!"
);
}
break
;
break
;
case
"edit"
:
case
"edit"
:
this
.
form
=
row
;
this
.
form
=
row
;
this
.
drawerVisible
=
true
;
this
.
drawerVisible
=
true
;
break
;
break
;
case
"delete"
:
case
"delete"
:
let
deleteRes
=
await
delete
Virtual
([
row
.
bv
Id
]);
let
deleteRes
=
await
delete
Lt
([
row
.
literature
Id
]);
if
(
deleteRes
.
code
==
0
)
{
if
(
deleteRes
.
code
==
0
)
{
this
.
$message
.
success
(
"删除成功!"
);
this
.
$message
.
success
(
"删除成功!"
);
this
.
loadData
();
this
.
loadData
();
...
...
src/views/museum/index-old.vue
浏览文件 @
5da5ee84
...
@@ -138,13 +138,6 @@ export default {
...
@@ -138,13 +138,6 @@ export default {
loading
:
false
,
loading
:
false
,
};
};
},
},
watch
:
{
dict
(
value
)
{
if
(
value
)
{
this
.
dict
=
value
;
}
},
},
computed
:
{
computed
:
{
tableTitle
()
{
tableTitle
()
{
return
title
;
return
title
;
...
...
src/views/museum/index.vue
浏览文件 @
5da5ee84
...
@@ -141,13 +141,6 @@ export default {
...
@@ -141,13 +141,6 @@ export default {
tabelData
:[]
tabelData
:[]
};
};
},
},
watch
:
{
dict
(
value
)
{
if
(
value
)
{
this
.
dict
=
value
;
}
},
},
computed
:
{
computed
:
{
tableTitle
()
{
tableTitle
()
{
return
title
;
return
title
;
...
...
src/views/virtual/index.vue
浏览文件 @
5da5ee84
...
@@ -138,13 +138,6 @@ export default {
...
@@ -138,13 +138,6 @@ export default {
imgList
:
[],
imgList
:
[],
};
};
},
},
watch
:
{
dict
(
value
)
{
if
(
value
)
{
this
.
dict
=
value
;
}
},
},
computed
:
{
computed
:
{
tableTitle
()
{
tableTitle
()
{
return
title
;
return
title
;
...
...
vue.config.js
浏览文件 @
5da5ee84
...
@@ -28,9 +28,10 @@ module.exports = {
...
@@ -28,9 +28,10 @@ module.exports = {
outputDir
:
'dist'
,
outputDir
:
'dist'
,
assetsDir
:
'static'
,
assetsDir
:
'static'
,
// lintOnSave: process.env.NODE_ENV === 'development',
// lintOnSave: process.env.NODE_ENV === 'development',
lintOnSave
:
false
,
lintOnSave
:
false
,
productionSourceMap
:
false
,
productionSourceMap
:
false
,
devServer
:
{
devServer
:
{
host
:
'172.24.100.18'
,
port
:
port
,
port
:
port
,
open
:
true
,
open
:
true
,
overlay
:
{
overlay
:
{
...
@@ -39,13 +40,21 @@ module.exports = {
...
@@ -39,13 +40,21 @@ module.exports = {
},
},
proxy
:
{
proxy
:
{
'/api'
:
{
'/api'
:
{
// target: 'http://172.24.100.189:8080
',
target
:
'http://192.168.1.230:9566/api
'
,
target
:
'http://222.85.214.245:9066/api'
,
//
target:'http://222.85.214.245:9066/api',
changeOrigin
:
true
,
changeOrigin
:
true
,
pathRewrite
:
{
pathRewrite
:
{
'^/api'
:
''
'^/api'
:
''
}
}
}
},
'/files'
:
{
target
:
'http://192.168.1.230:9563/files'
,
changeOrigin
:
true
,
pathRewrite
:
{
'^/files'
:
''
}
},
}
}
},
},
configureWebpack
:
{
configureWebpack
:
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论