Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
exhibition_backstage
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
龙菲
exhibition_backstage
Commits
61c932d0
提交
61c932d0
authored
9月 15, 2022
作者:
龙菲
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
完成首页展览及文物数量统计页面
上级
06e83445
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
512 行增加
和
94 行删除
+512
-94
culturalRelic.js
src/api/culturalRelic.js
+10
-0
display.js
src/api/display.js
+10
-0
user.js
src/api/user.js
+19
-0
vitual.js
src/api/vitual.js
+9
-0
index.vue
src/components/Echarts/index.vue
+25
-19
InfoEditDialog.vue
src/views/culturalRelic/components/InfoEditDialog.vue
+1
-1
InfoEditDialog.vue
src/views/display/components/InfoEditDialog.vue
+1
-1
index.vue
src/views/home/components/CombinationChart/index.vue
+251
-0
index.vue
src/views/home/components/CustomTitle/index.vue
+35
-0
index.vue
src/views/home/index.vue
+0
-0
InfoEditDialog.vue
src/views/literature/components/InfoEditDialog.vue
+1
-1
InfoEditDialog.vue
src/views/museum/components/InfoEditDialog.vue
+1
-1
InfoEditDialog.vue
src/views/role/components/InfoEditDialog.vue
+2
-9
InfoEditDialog.vue
src/views/user/components/InfoEditDialog.vue
+109
-34
config.js
src/views/user/config.js
+38
-28
index.vue
src/views/user/index.vue
+0
-0
没有找到文件。
src/api/culturalRelic.js
浏览文件 @
61c932d0
...
@@ -39,3 +39,13 @@ export function deleteCultralRelic(data) {
...
@@ -39,3 +39,13 @@ export function deleteCultralRelic(data) {
data
data
})
})
}
}
// 获取文物数量统计
export
function
getCulturalRelicStatistic
(
params
)
{
return
request
({
url
:
'/bizStatistic/getCulturalRelicStatistic'
,
method
:
'get'
,
params
})
}
src/api/display.js
浏览文件 @
61c932d0
...
@@ -39,3 +39,12 @@ export function deleteDisplay(data) {
...
@@ -39,3 +39,12 @@ export function deleteDisplay(data) {
data
data
})
})
}
}
// 获取展览数量统计
export
function
getExhibitionStatistic
(
params
)
{
return
request
({
url
:
'/bizStatistic/getExhibitionStatistic'
,
method
:
'get'
,
params
})
}
\ No newline at end of file
src/api/user.js
浏览文件 @
61c932d0
...
@@ -15,6 +15,7 @@ export function login(data) {
...
@@ -15,6 +15,7 @@ export function login(data) {
data
data
})
})
}
}
export
function
getInfo
(
token
)
{
export
function
getInfo
(
token
)
{
return
request
({
return
request
({
url
:
'/sys/user'
,
url
:
'/sys/user'
,
...
@@ -68,6 +69,24 @@ export function getUserList(data) {
...
@@ -68,6 +69,24 @@ export function getUserList(data) {
}
}
// 增加用户
export
function
addUser
(
data
)
{
return
request
({
url
:
'sys/user'
,
method
:
'post'
,
data
})
}
// 修改用户信息
export
function
upadateUser
(
data
)
{
return
request
({
url
:
'sys/user'
,
method
:
'put'
,
data
})
}
// 以用户行为统计排序分页查询资源
// 以用户行为统计排序分页查询资源
export
function
getListByPageSort
(
data
)
{
export
function
getListByPageSort
(
data
)
{
return
request
({
return
request
({
...
...
src/api/vitual.js
浏览文件 @
61c932d0
...
@@ -42,3 +42,11 @@ export function getVirtualListById(data) {
...
@@ -42,3 +42,11 @@ export function getVirtualListById(data) {
})
})
}
}
// 获取展览数量统计
export
function
getVirtualStatistic
(
params
)
{
return
request
({
url
:
'/bizStatistic/getVirtualStatistic'
,
method
:
'get'
,
params
})
}
\ No newline at end of file
src/components/Echarts/index.vue
浏览文件 @
61c932d0
<
template
>
<
template
>
<div
:id=
"id"
:class=
"className"
:style=
"
{ height: height, width: width }" />
<div
:id=
"id"
:class=
"className"
:style=
"
{ height: height, width: width }" />
</
template
>
</
template
>
<
script
>
<
script
>
// import tdTheme from './theme.json' // 引入默认主题
// import tdTheme from './theme.json' // 引入默认主题
import
resizeMixins
from
"@/utils/resizeMixin"
;
import
resizeMixins
from
"@/utils/resizeMixin"
;
// import '../map/fujian.js'
// import '../map/fujian.js'
export
default
{
export
default
{
name
:
'echart'
,
name
:
'echart'
,
mixins
:
[
resizeMixins
],
mixins
:
[
resizeMixins
],
...
@@ -29,38 +29,44 @@
...
@@ -29,38 +29,44 @@
},
},
options
:
{
options
:
{
type
:
Object
,
type
:
Object
,
default
:
()
=>
({})
default
:
()
=>
({})
}
}
},
},
data
()
{
data
()
{
return
{
return
{
chart
:
null
chart
:
null
}
}
},
},
watch
:
{
watch
:
{
options
:
{
options
:
{
handler
(
options
)
{
handler
(
options
)
{
// 设置true清空echart缓存
// 设置true清空echart缓存
this
.
chart
.
setOption
(
options
,
true
)
this
.
chart
.
setOption
(
options
,
true
)
},
},
deep
:
true
deep
:
true
}
}
},
},
mounted
()
{
mounted
()
{
// this.$echarts.registerTheme('tdTheme', tdTheme); // 覆盖默认主题
// this.$echarts.registerTheme('tdTheme', tdTheme); // 覆盖默认主题
this
.
initChart
();
this
.
initChart
();
},
},
methods
:
{
methods
:
{
initChart
()
{
initChart
()
{
// 初始化echart
// 初始化echart
this
.
dispose
()
this
.
chart
=
this
.
$echarts
.
init
(
this
.
$el
)
this
.
chart
=
this
.
$echarts
.
init
(
this
.
$el
)
this
.
$emit
(
'myCharts'
,
this
.
chart
)
// 把实例丢出来
this
.
$emit
(
'myCharts'
,
this
.
chart
)
// 把实例丢出来
this
.
chart
.
setOption
(
this
.
options
,
true
)
this
.
chart
.
setOption
(
this
.
options
,
true
)
},
// 销毁
dispose
()
{
if
(
this
.
chart
)
{
this
.
chart
.
dispose
()
}
}
}
}
}
}
}
</
script
>
</
script
>
<
style
>
<
style
>
</
style
>
</
style
>
\ No newline at end of file
\ No newline at end of file
src/views/culturalRelic/components/InfoEditDialog.vue
浏览文件 @
61c932d0
...
@@ -240,7 +240,7 @@
...
@@ -240,7 +240,7 @@
<div
class=
"dialog-footer"
>
<div
class=
"dialog-footer"
>
<el-button
@
click=
"cancelForm"
>
取 消
</el-button>
<el-button
@
click=
"cancelForm"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"handleSubmit"
:loading=
"loading"
<el-button
type=
"primary"
@
click=
"handleSubmit"
:loading=
"loading"
>
确定
<i
class=
"el-icon-
right
"
style=
"margin-left: 5px"
></i
>
确定
<i
class=
"el-icon-
s-promotion
"
style=
"margin-left: 5px"
></i
></el-button>
></el-button>
</div>
</div>
</div>
</div>
...
...
src/views/display/components/InfoEditDialog.vue
浏览文件 @
61c932d0
...
@@ -223,7 +223,7 @@
...
@@ -223,7 +223,7 @@
<div
class=
"dialog-footer"
>
<div
class=
"dialog-footer"
>
<el-button
@
click=
"cancelForm"
>
取 消
</el-button>
<el-button
@
click=
"cancelForm"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"loading"
<el-button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"loading"
>
发布
<i
class=
"el-icon-
right
"
style=
"margin-left: 5px"
></i
>
发布
<i
class=
"el-icon-
s-promotion
"
style=
"margin-left: 5px"
></i
></el-button>
></el-button>
</div>
</div>
</el-dialog>
</el-dialog>
...
...
src/views/home/components/CombinationChart/index.vue
0 → 100644
浏览文件 @
61c932d0
<!-- -->
<
template
>
<div
style=
"height: 400px;width: 100%;"
>
<Echart
ref=
"Echart"
:options=
"options"
height=
'100%'
width=
"100%"
v-if=
"options"
></Echart>
</div>
</
template
>
<
script
>
import
Echart
from
'@/components/Echarts'
//引入echatrs组件
export
default
{
name
:
'CombinationChart'
,
components
:
{
Echart
},
props
:
{
pieData
:
{
type
:
Array
,
default
:
()
=>
[]
///[{name:'name',value:0}]
}
},
data
()
{
return
{
options
:
null
}
},
watch
:
{
pieData
:
function
()
{
this
.
getOptions
()
}
},
mounted
()
{
setTimeout
(()
=>
{
this
.
getOptions
()
},
300
);
},
methods
:
{
getOptions
()
{
var
pie_color
=
[
'#32D790'
,
'#F4B561'
,
'#7080DB'
,
'#DF7A90'
,
'#3CC4EF'
,
'#EF7F3C'
,
'#EF3C81'
,
'#0DBF8C'
,
'#2F73C0'
,
'#C55E18'
,
'#C899FF'
,
'#C6D727'
,
'#FF688F'
,
'#87A0DC'
,
'#00D9F7'
,
'#A24EED'
];
var
legendList
=
[];
// var pieData = [{
// name: 'A 农、林、牧、渔业',
// value: 290
// }, {
// name: 'G 交通运输、仓储和邮政业',
// value: 450
// }, {
// name: 'H 住宿和餐饮业',
// value: 120
// }, {
// name: 'I 信息传输、软件和信息技术服务业',
// value: 288
// },];
let
pieData
=
this
.
pieData
||
[]
for
(
var
i
=
0
;
i
<
pieData
.
length
;
i
++
)
{
if
(
pieData
[
i
])
{
legendList
.
push
(
pieData
[
i
].
name
);
}
}
this
.
options
=
{
color
:
pie_color
,
title
:
{
show
:
false
,
text
:
''
,
textStyle
:
{
color
:
'#333333'
,
fontSize
:
16
,
},
},
tooltip
:{},
grid
:
{
show
:
false
,
left
:
'2%'
,
right
:
'50%'
,
bottom
:
0
,
top
:
'2%'
,
containLabel
:
true
},
legend
:
{
bottom
:
'4%'
,
right
:
'10%'
,
orient
:
'vertical'
,
width
:
540
,
height
:
240
,
padding
:
[
14
,
20
],
backgroundColor
:
'rgba(236,246,255,0.30)'
,
borderWidth
:
1
,
borderColor
:
'#E7F2FB'
,
borderRadius
:
4
,
icon
:
'circle'
,
itemWidth
:
8
,
itemHeight
:
8
,
textStyle
:
{
color
:
'#333333'
,
fontSize
:
12
,
},
data
:
legendList
,
},
xAxis
:
{
type
:
'value'
,
gridIndex
:
0
,
name
:
'个'
,
nameTextStyle
:
{
color
:
'#9B9B9B'
,
fontSize
:
14
},
axisLabel
:
{
color
:
'#727272'
,
fontSize
:
14
,
},
axisLine
:
{
show
:
true
,
lineStyle
:
{
color
:
'#333333'
,
opacity
:
0.35
,
}
},
axisTick
:
{
show
:
true
,
inside
:
true
,
lineStyle
:
{
color
:
'#333333'
,
opacity
:
0.35
,
}
},
splitLine
:
{
show
:
false
}
},
yAxis
:
{
type
:
'category'
,
gridIndex
:
0
,
data
:
legendList
,
inverse
:
true
,
axisLabel
:
{
color
:
'#727272'
,
fontSize
:
14
,
},
axisLine
:
{
show
:
true
,
lineStyle
:
{
color
:
'#333333'
,
opacity
:
0.35
,
}
},
axisTick
:
{
show
:
false
},
splitLine
:
{
show
:
false
}
},
series
:
[{
name
:
'展览数量'
,
type
:
'bar'
,
xAxisIndex
:
0
,
yAxisIndex
:
0
,
data
:
pieData
,
label
:
{
show
:
true
,
position
:
'right'
,
color
:
'#4A4A4A'
,
fontSize
:
14
,
},
barWidth
:
20
,
itemStyle
:
{
color
:
{
type
:
'linear'
,
x
:
0
,
y
:
0
,
x1
:
0
,
y1
:
1
,
colorStops
:
[{
offset
:
0
,
color
:
'#FF9A91'
},
{
offset
:
1
,
color
:
'#F8B44F'
}],
global
:
false
},
barBorderRadius
:
[
0
,
10
,
10
,
0
]
}
},
{
type
:
'pie'
,
radius
:
[
'10%'
,
'36%'
],
center
:
[
'75%'
,
'30%'
],
data
:
pieData
,
hoverAnimation
:
false
,
label
:
{
show
:
true
,
position
:
'outside'
,
formatter
:
'{b}:{d}%'
,
},
zlevel
:
2
},
{
// name: '外圈',
type
:
'pie'
,
radius
:
[
'36%'
,
'37.5%'
],
center
:
[
'75%'
,
'30%'
],
hoverAnimation
:
false
,
itemStyle
:
{
color
:
'rgb(21 132 214 / 0.1)'
,
},
emphasis
:
{
itemStyle
:
{
color
:
'rgb(21 132 214 / 0.1)'
}
},
labelLine
:
{
show
:
false
},
data
:
[{
value
:
1
}],
zlevel
:
1
},
{
// name: '内圈',
type
:
'pie'
,
radius
:
[
'8.5%'
,
'10%'
],
center
:
[
'75%'
,
'30%'
],
hoverAnimation
:
false
,
itemStyle
:
{
color
:
'rgb(21 132 214 / 0.1)'
,
},
emphasis
:
{
itemStyle
:
{
color
:
'rgb(21 132 214 / 0.1)'
}
},
labelLine
:
{
show
:
false
},
data
:
[{
value
:
1
}],
zlevel
:
1
}]
}
}
},
}
</
script
>
<
style
lang=
"scss"
scoped
>
</
style
>
\ No newline at end of file
src/views/home/components/CustomTitle/index.vue
0 → 100644
浏览文件 @
61c932d0
<
template
>
<div
class=
"custom-title"
>
<div
class=
"divider"
></div>
<div
class=
"title"
>
{{
title
}}
</div>
</div>
</
template
>
<
script
>
export
default
{
name
:
"CustomTitle"
,
props
:
{
title
:
{
type
:
String
,
default
:
""
,
},
},
};
</
script
>
<
style
lang=
"scss"
scoped
>
.custom-title
{
display
:
flex
;
align-items
:
center
;
.divider
{
width
:
4px
;
height
:
18px
;
background-color
:
#409eff
;
margin-right
:
8px
;
}
.title
{
font-size
:
16px
;
font-weight
:
bold
;
color
:
#333
;
}
}
</
style
>
\ No newline at end of file
src/views/home/index.vue
浏览文件 @
61c932d0
差异被折叠。
点击展开。
src/views/literature/components/InfoEditDialog.vue
浏览文件 @
61c932d0
...
@@ -73,7 +73,7 @@
...
@@ -73,7 +73,7 @@
<div
class=
"dialog-footer"
>
<div
class=
"dialog-footer"
>
<el-button
@
click=
"cancelForm"
>
取 消
</el-button>
<el-button
@
click=
"cancelForm"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"handleSubmit"
<el-button
type=
"primary"
@
click=
"handleSubmit"
>
确定
<i
class=
"el-icon-
right
"
style=
"margin-left: 5px"
></i
>
确定
<i
class=
"el-icon-
s-promotion
"
style=
"margin-left: 5px"
></i
></el-button>
></el-button>
</div>
</div>
</el-dialog>
</el-dialog>
...
...
src/views/museum/components/InfoEditDialog.vue
浏览文件 @
61c932d0
...
@@ -92,7 +92,7 @@
...
@@ -92,7 +92,7 @@
<div
class=
"dialog-footer"
>
<div
class=
"dialog-footer"
>
<el-button
@
click=
"cancelForm"
>
取 消
</el-button>
<el-button
@
click=
"cancelForm"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"handleSubmit"
<el-button
type=
"primary"
@
click=
"handleSubmit"
>
确定
<i
class=
"el-icon-
right
"
style=
"margin-left: 5px"
></i
>
确定
<i
class=
"el-icon-
s-promotion
"
style=
"margin-left: 5px"
></i
></el-button>
></el-button>
</div>
</div>
</el-dialog>
</el-dialog>
...
...
src/views/role/components/InfoEditDialog.vue
浏览文件 @
61c932d0
...
@@ -73,11 +73,11 @@
...
@@ -73,11 +73,11 @@
<div
class=
"dialog-footer"
>
<div
class=
"dialog-footer"
>
<el-button
@
click=
"cancelForm"
>
取 消
</el-button>
<el-button
@
click=
"cancelForm"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"handleSubmit"
<el-button
type=
"primary"
@
click=
"handleSubmit"
>
确定
<i
class=
"el-icon-
right
"
style=
"margin-left: 5px"
></i
>
确定
<i
class=
"el-icon-
s-promotion
"
style=
"margin-left: 5px"
></i
></el-button>
></el-button>
</div>
</div>
</el-dialog>
</el-dialog>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
addLiterature
,
editLiterature
}
from
"@/api/literature"
;
import
{
addLiterature
,
editLiterature
}
from
"@/api/literature"
;
...
@@ -159,18 +159,11 @@ export default {
...
@@ -159,18 +159,11 @@ export default {
},
},
async
handleSubmit
()
{
async
handleSubmit
()
{
// debugger
// console.log(this.dialogForm);
// return
let
params
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
dialogForm
));
let
params
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
dialogForm
));
// 回填文件
// 回填文件
let
file
=
this
.
$refs
.
pdf
.
getFiles
();
let
file
=
this
.
$refs
.
pdf
.
getFiles
();
let
formData
=
new
FormData
();
let
formData
=
new
FormData
();
// console.log("file", file);
// return
// debugger;
if
(
file
[
0
].
status
==
"ready"
)
{
if
(
file
[
0
].
status
==
"ready"
)
{
// debugger;
formData
.
append
(
"files"
,
file
[
0
].
raw
);
formData
.
append
(
"files"
,
file
[
0
].
raw
);
let
upLoadRes
=
await
uploadFile
(
formData
);
let
upLoadRes
=
await
uploadFile
(
formData
);
if
(
upLoadRes
.
code
==
0
)
{
if
(
upLoadRes
.
code
==
0
)
{
...
...
src/views/user/components/InfoEditDialog.vue
浏览文件 @
61c932d0
...
@@ -49,18 +49,16 @@
...
@@ -49,18 +49,16 @@
<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.dept
Id
"
v-model=
"dialogForm.dept
No
"
:options=
"orgTreeData"
:options=
"orgTreeData"
:props=
"optionProps"
:props=
"optionProps"
placeholder=
"请选择所属部门"
placeholder=
"请选择所属部门"
:key=
"deptId"
>
>
</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-switch
v-model=
"status"
>
</el-switch>
<el-switch
v-model=
"status"
>
</el-switch>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
</div>
</div>
<div
class=
"dialog-footer"
>
<div
class=
"dialog-footer"
>
...
@@ -73,7 +71,7 @@
...
@@ -73,7 +71,7 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
add
Literature
,
editLiterature
}
from
"@/api/literature
"
;
import
{
add
User
,
upadateUser
}
from
"@/api/user
"
;
import
ManualUploader
from
"@/components/Uploader/ManualUploader.vue"
;
import
ManualUploader
from
"@/components/Uploader/ManualUploader.vue"
;
import
{
mapGetters
}
from
"vuex"
;
import
{
mapGetters
}
from
"vuex"
;
import
{
uploadFile
}
from
"@/utils/file"
;
import
{
uploadFile
}
from
"@/utils/file"
;
...
@@ -91,18 +89,18 @@ export default {
...
@@ -91,18 +89,18 @@ export default {
type
:
Object
,
type
:
Object
,
default
:
()
=>
({}),
default
:
()
=>
({}),
},
},
orgTreeData
:{
orgTreeData
:
{
type
:
Object
,
type
:
Array
,
default
:
()
=>
[],
default
:
()
=>
[],
}
}
,
},
},
computed
:
{
computed
:
{
...
mapGetters
([
"userInfo"
]),
...
mapGetters
([
"userInfo"
]),
title
()
{
title
()
{
if
(
this
.
dialogForm
.
literatureI
d
)
{
if
(
this
.
dialogForm
.
i
d
)
{
return
"修改
文献
"
;
return
"修改
用户信息
"
;
}
else
{
}
else
{
return
"添加
文献
"
;
return
"添加
用户
"
;
}
}
},
},
},
},
...
@@ -110,16 +108,11 @@ export default {
...
@@ -110,16 +108,11 @@ 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
.
literatureI
d
)
{
if
(
that
.
dialogForm
.
i
d
)
{
// 回填状态
// 回填状态
that
.
status
=
Boolean
(
Number
(
that
.
dialogForm
.
status
));
that
.
status
=
Boolean
(
Number
(
that
.
dialogForm
.
status
));
// 回填文件
if
(
that
.
dialogForm
.
files
)
{
that
.
files
=
that
.
dialogForm
.
files
;
}
}
}
},
},
immediate
:
true
,
immediate
:
true
,
...
@@ -132,14 +125,108 @@ export default {
...
@@ -132,14 +125,108 @@ export default {
deep
:
true
,
deep
:
true
,
immediate
:
true
,
immediate
:
true
,
},
},
// orgTreeData(value){
// console.log(1111,value);
// }
},
},
data
()
{
data
()
{
var
validatePass
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
===
""
)
{
callback
(
new
Error
(
"请输入密码"
));
}
else
{
var
pattern
=
/^
(?![
a-zA-Z
]
+$
)(?![
A-Z0-9
]
+$
)(?![
A-Z
\\
W_!@#$%^&*`~()-+=
]
+$
)(?![
a-z0-9
]
+$
)(?![
a-z
\\
W_!@#$%^&*`~()-+=
]
+$
)(?![
0-9
\\
W_!@#$%^&*`~()-+=
]
+$
)[
a-zA-Z0-9
\\
W_!@#$%^&*`~()-+=
]{8,30}
$/
;
if
(
!
pattern
.
test
(
value
))
{
callback
(
new
Error
(
"密码长度至少8位,至少含数字,大写字母,小写字母,特殊符其中三种"
)
);
}
callback
();
}
};
var
validateUserName
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
===
""
)
{
callback
(
new
Error
(
"请输入账号"
));
}
else
{
var
pattern
=
/^
[
0-9a-zA-Z|_
]{4,20}
$/g
;
if
(
!
pattern
.
test
(
value
))
{
callback
(
new
Error
(
"账号长度4-20个字符,只能包括字母、数字、下划线"
));
}
else
{
const
formData
=
new
FormData
();
formData
.
append
(
"userName"
,
value
);
checkUserName
(
formData
)
.
then
((
res
)
=>
{
if
(
res
.
code
==
"0"
)
{
callback
();
}
else
{
callback
(
res
.
msg
);
}
})
.
catch
((
err
)
=>
{
console
.
error
(
err
);
});
}
}
};
var
validatePhone
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
===
""
)
{
callback
(
new
Error
(
"请输入手机号"
));
}
else
{
var
pattern
=
/^
((
0
\d{2,3}
-
\d{7,8})
|
(
1
[
3584
]\d{9}))
$/
;
if
(
!
pattern
.
test
(
value
))
{
callback
(
new
Error
(
"请输入合法手机号/电话号"
));
}
else
{
const
formData
=
new
FormData
();
formData
.
append
(
"phone"
,
value
);
checkPhone
(
formData
)
.
then
((
res
)
=>
{
console
.
log
(
res
);
if
(
res
.
code
==
"0"
)
{
callback
();
}
else
{
callback
(
res
.
msg
);
}
})
.
catch
((
err
)
=>
{
console
.
error
(
err
);
});
}
}
};
return
{
return
{
dialogForm
:
{},
dialogForm
:
{},
formLabelWidth
:
"100px"
,
formLabelWidth
:
"100px"
,
status
:
false
,
status
:
false
,
files
:
[],
//文献文件
files
:
[],
//文献文件
dialogVisible
:
false
,
dialogVisible
:
false
,
optionProps
:
{
value
:
"id"
,
label
:
"label"
,
children
:
"children"
,
checkStrictly
:
true
,
//单选选择任意一级选项
},
rules
:
{
username
:
[
{
validator
:
validateUserName
,
trigger
:
"blur"
,
required
:
true
},
],
phone
:
[{
validator
:
validatePhone
,
trigger
:
"blur"
,
required
:
true
}],
nickName
:
[
{
required
:
true
,
message
:
"请输入昵称"
,
trigger
:
"blur"
},
{
pattern
:
/^
(?!
_
)(?!
.*
?
_$
)[
a-zA-Z0-9_
\u
4e00-
\u
9fa5
]
+$/
,
message
:
"昵称长度2~10位,只能包含中文、英文大小写、数字及下划线,不能以下划线开头或结尾"
,
trigger
:
"blur"
,
},
],
password
:
[
{
validator
:
validatePass
,
trigger
:
"blur"
,
required
:
true
},
],
},
};
};
},
},
methods
:
{
methods
:
{
...
@@ -157,30 +244,18 @@ export default {
...
@@ -157,30 +244,18 @@ export default {
async
handleSubmit
()
{
async
handleSubmit
()
{
let
params
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
dialogForm
));
let
params
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
dialogForm
));
// 回填文件
let
file
=
this
.
$refs
.
pdf
.
getFiles
();
let
formData
=
new
FormData
();
if
(
file
[
0
].
status
==
"ready"
)
{
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"
)
{
params
.
pdfFile
=
file
[
0
].
fileId
;
}
// 修改状态
// 修改状态
params
.
status
=
this
.
status
?
1
:
0
;
params
.
status
=
this
.
status
?
1
:
0
;
if
(
params
.
literatureId
)
{
console
.
log
(
22
,
params
);
let
res
=
await
editLiterature
(
params
);
return
;
if
(
params
.
id
)
{
let
res
=
await
upadateUser
(
params
);
if
(
res
.
code
==
0
)
{
if
(
res
.
code
==
0
)
{
this
.
$message
.
success
(
"修改成功!"
);
this
.
$message
.
success
(
"修改成功!"
);
this
.
reload
();
this
.
reload
();
}
}
}
else
{
}
else
{
let
res
=
await
add
Literature
(
params
);
let
res
=
await
add
User
(
params
);
if
(
res
.
code
==
0
)
{
if
(
res
.
code
==
0
)
{
this
.
$message
.
success
(
"添加成功!"
);
this
.
$message
.
success
(
"添加成功!"
);
this
.
reload
();
this
.
reload
();
...
...
src/views/user/config.js
浏览文件 @
61c932d0
export
const
title
=
[{
export
const
title
=
[{
prop
:
"username"
,
prop
:
"username"
,
label
:
"账号"
,
label
:
"账号"
,
columnAlign
:
'center'
,
columnAlign
:
'center'
,
},
},
{
{
prop
:
"nickName"
,
prop
:
"nickName"
,
label
:
"昵称"
,
label
:
"昵称"
,
columnAlign
:
'center'
,
columnAlign
:
'center'
,
},
},
{
{
prop
:
"deptName"
,
prop
:
"realName"
,
label
:
"所属部门"
,
label
:
"真实姓名"
,
columnAlign
:
'center'
,
columnAlign
:
'center'
,
},
},
{
// {
prop
:
"phone"
,
// prop: "sex",
label
:
"手机号"
,
// label: "性别",
columnAlign
:
'center'
,
// columnAlign: 'center',
},
// },
{
{
prop
:
"status"
,
prop
:
"deptName"
,
label
:
"状态"
,
label
:
"所属部门"
,
columnAlign
:
'center'
,
columnAlign
:
'center'
,
isStatus
:
true
,
showOverFlowToolTip
:
true
width
:
100
},
},
{
prop
:
"phone"
,
label
:
"手机号"
,
columnAlign
:
'center'
,
},
{
prop
:
"status"
,
label
:
"状态"
,
columnAlign
:
'center'
,
isStatus
:
true
,
},
]
]
export
const
operates
=
{
export
const
operates
=
{
operate
:
true
,
operate
:
true
,
label
:
"操作"
,
label
:
"操作"
,
width
:
"260px"
,
width
:
"190px"
,
minwidth
:
"220px"
,
titleAlign
:
"center"
,
titleAlign
:
"center"
,
columnAlign
:
"center"
,
columnAlign
:
"center"
,
}
}
...
...
src/views/user/index.vue
浏览文件 @
61c932d0
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论