Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
project-road-admin
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
project-road-admin
Commits
dd218558
提交
dd218558
authored
7月 24, 2022
作者:
lihuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
0f3e8c1c
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
371 行增加
和
45 行删除
+371
-45
Update.vue
src/modules/banner/views/Update.vue
+1
-0
api.js
src/modules/menu/api.js
+12
-38
essay.vue
src/modules/menu/components/essay.vue
+130
-0
pages.vue
src/modules/menu/components/pages.vue
+126
-0
Update.vue
src/modules/menu/views/Update.vue
+102
-7
没有找到文件。
src/modules/banner/views/Update.vue
浏览文件 @
dd218558
...
...
@@ -67,6 +67,7 @@
<pages
v-if=
"ruleForm.type == '2'"
@
selectionConfirm=
"pagesSelectionConfirm"
:selectData=
"pagesList"
></pages>
<div
style=
"padding: 0 20px"
>
<el-input
v-if=
"ruleForm.type == '3'"
v-model=
"ruleForm.url"
placeholder=
"请输入链接"
></el-input>
<el-button
style=
"margin-top: 20px;"
@
click=
"drawer = false"
type=
"primary"
>
确认
</el-button>
</div>
</el-drawer>
</div>
...
...
src/modules/menu/api.js
浏览文件 @
dd218558
...
...
@@ -35,42 +35,16 @@ export function deleteMenu(data) {
return
httpRequest
.
post
(
'/api/road/v1/backend/menu/delete'
,
data
)
}
// /**
// * 获取应用列表
// */
// export function getAppList(params) {
// return httpRequest.get('/api/register/v1/activity/index', { params })
// }
// /**
// * 新建报名
// */
// export function createRegister(data) {
// return httpRequest.post('/api/register/v1/activity/create', data)
// }
// /**
// * 报名详情
// */
// export function getRegisterDetail(params) {
// return httpRequest.get('/api/register/v1/activity/view', { params })
// }
// /**
// * 更新报名
// */
// export function updateRegister(data) {
// return httpRequest.post('/api/register/v1/activity/update', data)
// }
/**
* 获取应用列表
*/
export
function
getEssayList
(
params
)
{
return
httpRequest
.
get
(
'/api/road/v1/backend/doc/list'
,
{
params
})
}
// /**
// * 删除报名
// */
// export function deleteRegister(data) {
// return httpRequest.post('/api/register/v1/activity/delete', data)
// }
// /**
// * 停止活动
// */
// export function stopRegister(data) {
// return httpRequest.post('/api/register/v1/activity/drop', data)
// }
/**
* 获pages列表
*/
export
function
getPagesList
(
params
)
{
return
httpRequest
.
get
(
'/api/road/v1/backend/page/list'
,
{
params
})
}
src/modules/menu/components/essay.vue
0 → 100644
浏览文件 @
dd218558
<
template
>
<app-card
class=
"register-box"
>
<app-list
highlight-current-row
@
current-change=
"selectionChange"
v-bind=
"tableOptions"
ref=
"list"
>
<template
v-slot:filter-time
>
<el-date-picker
v-model=
"filterDate"
@
change=
"changeDate"
type=
"datetimerange"
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
>
</el-date-picker>
</
template
>
<
template
v-slot:picture=
"{ row }"
>
<div
:style=
"`background-image:url($
{row.picture});background-size: cover;width:200px;height:100px;`">
</div>
</
template
>
</app-list>
<el-button
@
click=
"confirmBanner"
type=
"primary"
>
确认
</el-button>
</app-card>
</template>
<
script
>
// 接口
import
{
getEssayList
}
from
'../api'
export
default
{
props
:
{
selectData
:
{
type
:
Array
}
},
data
()
{
const
count
=
[]
for
(
let
i
=
0
;
i
<
100
;
i
++
)
{
count
.
push
({
value
:
i
,
options
:
i
})
}
return
{
value1
:
''
,
filterDate
:
''
,
options
:
count
,
createdStart
:
''
,
createdEnd
:
''
,
tableCheckboxValue
:
[]
}
},
computed
:
{
// 列表配置
tableOptions
()
{
return
{
limit
:
10
,
remote
:
{
httpRequest
:
getEssayList
,
params
:
{
title
:
''
,
created_time_start
:
this
.
createdStart
,
created_time_end
:
this
.
createdEnd
},
callback
:
res
=>
{
// 选中后不在列表展示
const
filterData
=
[]
res
.
forEach
(
element
=>
{
if
(
!
this
.
selectData
.
find
(
item
=>
item
.
id
===
element
.
id
))
{
element
.
status
=
!!
parseInt
(
element
.
status
)
filterData
.
push
(
element
)
}
})
return
filterData
}
},
filters
:
[
{
type
:
'input'
,
prop
:
'title'
,
label
:
'标题:'
},
{
slots
:
'filter-time'
,
label
:
'创建时间:'
}
],
columns
:
[
{
label
:
'id'
,
prop
:
'id'
,
align
:
'center'
},
{
label
:
'封面图'
,
slots
:
'picture'
,
align
:
'center'
,
width
:
'170px'
},
{
label
:
'标题'
,
prop
:
'title'
,
align
:
'center'
},
{
label
:
'摘要'
,
prop
:
'remark'
,
align
:
'center'
},
{
label
:
'备注'
,
prop
:
'comment'
,
align
:
'center'
},
{
label
:
'创建时间'
,
prop
:
'created_time'
,
align
:
'center'
}
]
}
}
},
methods
:
{
selectionChange
(
selection
)
{
console
.
log
(
111
,
selection
)
this
.
tableCheckboxValue
=
selection
},
confirmBanner
()
{
this
.
$emit
(
'selectionConfirm'
,
this
.
tableCheckboxValue
)
},
// 时间搜索
changeDate
()
{
if
(
this
.
filterDate
)
{
this
.
createdStart
=
this
.
filterDate
[
0
]
this
.
createdEnd
=
this
.
filterDate
[
1
]
}
else
{
this
.
createdStart
=
''
this
.
createdEnd
=
''
}
}
}
}
</
script
>
<
style
lang=
"scss"
>
.register-box
{
.el-form-item
{
margin-right
:
20px
!
important
;
}
.line
{
height
:
1px
;
background
:
#d6d6d6
;
margin
:
8px
0
23px
;
box-sizing
:
border-box
;
}
.btn-box
{
margin-bottom
:
16px
;
}
}
</
style
>
src/modules/menu/components/pages.vue
0 → 100644
浏览文件 @
dd218558
<
template
>
<app-card
class=
"register-box"
>
<app-list
highlight-current-row
@
current-change=
"selectionChange"
v-bind=
"tableOptions"
ref=
"list"
>
<!--
<div
class=
"line"
></div>
-->
<template
v-slot:filter-time
>
<el-date-picker
v-model=
"filterDate"
@
change=
"changeDate"
type=
"datetimerange"
range-separator=
"至"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
>
</el-date-picker>
</
template
>
</app-list>
<el-button
@
click=
"confirmBanner"
type=
"primary"
>
确认
</el-button>
</app-card>
</template>
<
script
>
// 接口
import
{
getPagesList
}
from
'../api'
export
default
{
props
:
{
selectData
:
{
type
:
Array
}
},
data
()
{
const
count
=
[]
for
(
let
i
=
0
;
i
<
100
;
i
++
)
{
count
.
push
({
value
:
i
,
options
:
i
})
}
return
{
value1
:
''
,
filterDate
:
''
,
options
:
count
,
createdStart
:
''
,
createdEnd
:
''
,
tableCheckboxValue
:
[]
}
},
computed
:
{
// 列表配置
tableOptions
()
{
return
{
limit
:
10
,
remote
:
{
httpRequest
:
getPagesList
,
params
:
{
title
:
''
,
created_time_start
:
this
.
createdStart
,
created_time_end
:
this
.
createdEnd
},
callback
:
res
=>
{
// 选中后不在列表展示
const
filterData
=
[]
res
.
forEach
(
element
=>
{
if
(
!
this
.
selectData
.
find
(
item
=>
item
.
id
===
element
.
id
))
{
element
.
status
=
!!
parseInt
(
element
.
status
)
filterData
.
push
(
element
)
}
})
return
filterData
}
},
filters
:
[
{
type
:
'input'
,
prop
:
'title'
,
label
:
'标题:'
},
{
slots
:
'filter-time'
,
label
:
'创建时间:'
}
],
columns
:
[
{
label
:
'id'
,
prop
:
'id'
,
align
:
'center'
},
{
label
:
'页面类型'
,
prop
:
'type_name'
,
align
:
'center'
},
{
label
:
'页面模板'
,
prop
:
'layout_name'
,
align
:
'center'
},
{
label
:
'标题'
,
prop
:
'title'
,
align
:
'center'
},
{
label
:
'创建时间'
,
prop
:
'created_time'
,
align
:
'center'
}
]
}
}
},
methods
:
{
selectionChange
(
selection
)
{
this
.
tableCheckboxValue
=
selection
},
confirmBanner
()
{
this
.
$emit
(
'selectionConfirm'
,
this
.
tableCheckboxValue
)
},
// 时间搜索
changeDate
()
{
if
(
this
.
filterDate
)
{
this
.
createdStart
=
this
.
filterDate
[
0
]
this
.
createdEnd
=
this
.
filterDate
[
1
]
}
else
{
this
.
createdStart
=
''
this
.
createdEnd
=
''
}
}
}
}
</
script
>
<
style
lang=
"scss"
>
.register-box
{
.el-form-item
{
margin-right
:
20px
!
important
;
}
.line
{
height
:
1px
;
background
:
#d6d6d6
;
margin
:
8px
0
23px
;
box-sizing
:
border-box
;
}
.btn-box
{
margin-bottom
:
16px
;
}
}
</
style
>
src/modules/menu/views/Update.vue
浏览文件 @
dd218558
...
...
@@ -7,7 +7,7 @@
ref=
"ruleForm"
label-width=
"100px"
class=
"demo-ruleForm"
style=
"width:
4
0%; margin: 0 auto"
style=
"width:
8
0%; margin: 0 auto"
>
<el-form-item
label=
"菜单名称"
prop=
"title"
>
<el-input
v-model=
"ruleForm.title"
></el-input>
...
...
@@ -23,6 +23,32 @@
</el-form-item>
<el-form-item
label=
"关联选择"
>
<el-button
type=
"primary"
@
click=
"drawer = true"
>
点击选择
</el-button>
<el-card
class=
"box-card"
style=
"margin-top: 20px"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
{{
ruleForm
.
type
==
'1'
?
'关联图文'
:
ruleForm
.
type
==
'2'
?
'关联页面'
:
'跳转链接'
}}
</span>
</div>
<app-list
v-if=
"ruleForm.type == '1'"
v-bind=
"essayTableOptions"
ref=
"list"
>
<template
v-slot:table-x=
"
{ row }">
<el-button
type=
"text"
@
click=
"handleEssayDelete(row)"
>
删除
</el-button>
</
template
>
<
template
v-slot:picture=
"{ row }"
>
<div
:style=
"`background-image:url($
{row.picture});background-size: cover;width:200px;height:100px;`"
>
</div>
</
template
>
</app-list>
<app-list
v-if=
"ruleForm.type == '2'"
v-bind=
"pagesTableOptions"
ref=
"list"
>
<
template
v-slot:table-x=
"{ row }"
>
<el-button
type=
"text"
@
click=
"handlePagesDelete(row)"
>
删除
</el-button>
</
template
>
<
template
v-slot:picture=
"{ row }"
>
<div
:style=
"`background-image:url($
{row.picture});background-size: cover;width:200px;height:100px;`"
>
</div>
</
template
>
</app-list>
<div
v-if=
"ruleForm.type == '3'"
>
{{ ruleForm.url }}
</div>
</el-card>
</el-form-item>
<el-form-item>
<div
style=
"padding-top: 20px"
>
...
...
@@ -32,28 +58,39 @@
</el-form-item>
</el-form>
</app-card>
<el-drawer
size=
"
4
0%"
:visible
.
sync=
"drawer"
:direction=
"direction"
>
<el-drawer
size=
"
6
0%"
:visible
.
sync=
"drawer"
:direction=
"direction"
>
<div
style=
"padding: 0 20px"
>
<el-tabs
v-model=
"
activeNam
e"
>
<el-tabs
v-model=
"
ruleForm.typ
e"
>
<el-tab-pane
label=
"关联图文"
name=
"1"
></el-tab-pane>
<el-tab-pane
label=
"关联页面"
name=
"2"
></el-tab-pane>
<el-tab-pane
label=
"跳转链接"
name=
"3"
></el-tab-pane>
</el-tabs>
</div>
<essay
v-if=
"ruleForm.type == '1'"
@
selectionConfirm=
"essaySelectionConfirm"
:selectData=
"essayList"
></essay>
<pages
v-if=
"ruleForm.type == '2'"
@
selectionConfirm=
"pagesSelectionConfirm"
:selectData=
"pagesList"
></pages>
<div
style=
"padding: 0 20px"
>
<el-input
v-if=
"ruleForm.type == '3'"
v-model=
"ruleForm.url"
placeholder=
"请输入链接"
></el-input>
<el-button
style=
"margin-top: 20px;"
@
click=
"drawer = false"
type=
"primary"
>
确认
</el-button>
</div>
</el-drawer>
</div>
</template>
<
script
>
import
essay
from
'../components/essay.vue'
import
pages
from
'../components/pages.vue'
import
UploadImage
from
'@/components/upload/UploadImage.vue'
import
{
createMenu
,
getDetails
,
updateMenu
}
from
'../api'
export
default
{
components
:
{
UploadImage
UploadImage
,
essay
,
pages
},
data
()
{
return
{
activeName
:
'1'
,
essayList
:
[],
pagesList
:
[],
status
:
true
,
drawer
:
false
,
direction
:
'rtl'
,
...
...
@@ -61,7 +98,7 @@ export default {
title
:
''
,
url
:
''
,
picture
:
''
,
type
:
''
,
type
:
'
1
'
,
status
:
true
,
relations_id
:
''
,
comment
:
''
...
...
@@ -76,12 +113,70 @@ export default {
computed
:
{
id
()
{
return
this
.
$route
.
query
.
id
},
essayTableOptions
()
{
return
{
hasPagination
:
false
,
columns
:
[
{
label
:
'id'
,
prop
:
'id'
,
align
:
'center'
},
{
label
:
'封面图'
,
slots
:
'picture'
,
align
:
'center'
,
width
:
'170px'
},
{
label
:
'标题'
,
prop
:
'title'
,
align
:
'center'
},
{
label
:
'摘要'
,
prop
:
'remark'
,
align
:
'center'
},
{
label
:
'备注'
,
prop
:
'comment'
,
align
:
'center'
},
{
label
:
'创建时间'
,
prop
:
'created_time'
,
align
:
'center'
},
{
label
:
'操作'
,
slots
:
'table-x'
,
align
:
'center'
}
],
data
:
this
.
essayList
}
},
pagesTableOptions
()
{
return
{
hasPagination
:
false
,
columns
:
[
{
label
:
'id'
,
prop
:
'id'
,
align
:
'center'
},
{
label
:
'页面类型'
,
prop
:
'type_name'
,
align
:
'center'
},
{
label
:
'页面模板'
,
prop
:
'layout_name'
,
align
:
'center'
},
{
label
:
'标题'
,
prop
:
'title'
,
align
:
'center'
},
{
label
:
'创建时间'
,
prop
:
'created_time'
,
align
:
'center'
},
{
label
:
'操作'
,
slots
:
'table-x'
,
align
:
'center'
}
],
data
:
this
.
pagesList
}
}
},
methods
:
{
// 删除essay关联
handleEssayDelete
(
row
)
{
const
findIndex
=
this
.
essayList
.
findIndex
(
item
=>
row
.
id
===
item
.
id
)
if
(
findIndex
!==
-
1
)
{
this
.
essayList
.
splice
(
findIndex
,
1
)
}
},
// 删除pages关联
handlePagesDelete
(
row
)
{
const
findIndex
=
this
.
pagesList
.
findIndex
(
item
=>
row
.
id
===
item
.
id
)
if
(
findIndex
!==
-
1
)
{
this
.
pagesList
.
splice
(
findIndex
,
1
)
}
},
// 图文选择
essaySelectionConfirm
(
value
)
{
this
.
drawer
=
false
this
.
essayList
=
[
value
]
},
// 页面关联
pagesSelectionConfirm
(
value
)
{
this
.
drawer
=
false
this
.
pagesList
=
[
value
]
},
// 提交
submitForm
()
{
this
.
ruleForm
.
type
=
this
.
activeName
if
(
this
.
ruleForm
.
type
===
'1'
)
{
this
.
ruleForm
.
relations_id
=
this
.
essayList
.
length
?
this
.
essayList
[
0
].
id
:
''
}
if
(
this
.
ruleForm
.
type
===
'2'
)
{
this
.
ruleForm
.
relations_id
=
this
.
pagesList
.
length
?
this
.
pagesList
[
0
].
id
:
''
}
this
.
ruleForm
.
status
=
this
.
status
?
1
:
0
if
(
this
.
id
)
{
updateMenu
(
this
.
ruleForm
).
then
(
res
=>
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论