Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
x-training-admin
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
x-training-admin
Commits
8fda3e9f
提交
8fda3e9f
authored
1月 30, 2021
作者:
wangyizheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增分类
上级
412677d9
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
168 行增加
和
3 行删除
+168
-3
.gitignore
.gitignore
+1
-0
package-lock.json
package-lock.json
+0
-0
categories.js
src/api/categories.js
+14
-0
aside.vue
src/components/layout/aside.vue
+5
-0
category.vue
src/pages/v2/categories/category.vue
+142
-0
routes.js
src/router/routes.js
+6
-3
没有找到文件。
.gitignore
浏览文件 @
8fda3e9f
...
...
@@ -2,3 +2,4 @@
node_modules
client-dist
.idea
.package-lock.json
package-lock.json
浏览文件 @
8fda3e9f
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/api/categories.js
0 → 100644
浏览文件 @
8fda3e9f
import
httpRequest
from
'@/utils/axios'
// 分类列表
export
function
categories
(
params
)
{
return
httpRequest
.
get
(
'/api/opera/v2/tranning/categories'
,
{
params
})
}
// 添加分类
export
function
addCategory
(
data
)
{
var
headers
=
{
'Content-Type'
:
'application/json'
}
return
httpRequest
.
post
(
'/api/opera/v2/tranning/category'
,
data
,
{
headers
})
}
src/components/layout/aside.vue
浏览文件 @
8fda3e9f
...
...
@@ -25,6 +25,11 @@ export default {
data
()
{
return
{
defaultMenus
:
[
{
title
:
'分类管理'
,
icon
:
'el-icon-s-management'
,
path
:
'/tranning/categories'
},
{
title
:
'案例背景编辑'
,
icon
:
''
,
...
...
src/pages/v2/categories/category.vue
0 → 100644
浏览文件 @
8fda3e9f
<
template
>
<div>
<div>
<el-card
class=
"box-card"
>
<el-breadcrumb
separator-class=
"el-icon-arrow-right"
>
<el-breadcrumb-item
:to=
"
{ path: '/' }">首页
</el-breadcrumb-item>
<el-breadcrumb-item>
分类管理
</el-breadcrumb-item>
</el-breadcrumb>
</el-card>
</div>
<div>
<el-card
class=
"box-card"
>
<el-button
size=
"mini"
type=
"primary"
@
click=
"mainCategorydialogFormVisible = true"
>
添加主分类
</el-button>
</el-card>
</div>
<div>
<el-card
class=
"box-card"
>
<el-table
:data=
"tableData"
style=
"width: 100%"
size=
"mini"
row-key=
"id"
border
:tree-props=
"
{children: 'children', hasChildren: 'hasChildren'}">
<el-table-column
label=
"分类名称"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
name
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"分类标签"
>
<
template
slot-scope=
"scope"
>
<div
slot=
"reference"
class=
"name-wrapper"
>
<el-tag
size=
"medium"
>
{{
scope
.
row
.
tag
}}
</el-tag>
</div>
</
template
>
</el-table-column>
<el-table-column
prop=
"order"
label=
"分类排序码"
width=
"90px"
>
</el-table-column>
<el-table-column
label=
"创建时间"
>
<
template
slot-scope=
"scope"
>
<i
class=
"el-icon-time"
></i>
<span
style=
"margin-left: 10px"
>
{{
scope
.
row
.
created_at
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<el-select
size=
"mini"
:value=
"opera"
@
change=
"operation"
placeholder=
"请选择"
>
<el-option
:value=
"
{ tag: 'detail', row: scope.row }" label="详情">
</el-option>
<el-option
:value=
"
{ tag: 'edit', row: scope.row }" label="编辑">
</el-option>
<el-option
:value=
"
{ tag: 'addChild', row: scope.row }" label="添加子分类">
</el-option>
<el-option
:value=
"
{ tag: 'delete', row: scope.row }" label="删除">
</el-option>
</el-select>
</
template
>
</el-table-column>
</el-table>
</el-card>
</div>
<div>
<el-dialog
title=
"添加主分类"
:visible
.
sync=
"mainCategorydialogFormVisible"
>
<el-form
size=
"mini"
:model=
"mainForm"
>
<el-form-item
label=
"名称"
label-width=
"50px"
>
<el-input
v-model=
"mainForm.name"
autocomplete=
"off"
></el-input>
</el-form-item>
<el-form-item
label=
"标签"
label-width=
"50px"
>
<el-select
v-model=
"mainForm.tag"
placeholder=
"请选标签"
>
<el-option
label=
"case"
value=
"case"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"排序码"
label-width=
"50px"
>
<el-input
v-model=
"mainForm.order"
autocomplete=
"off"
></el-input>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
size=
"mini"
@
click=
"mainCategorydialogFormVisible = false"
>
取 消
</el-button>
<el-button
size=
"mini"
type=
"primary"
@
click=
"add"
>
添 加
</el-button>
</div>
</el-dialog>
</div>
</div>
</template>
<
script
>
import
*
as
categoryApi
from
'@/api/categories'
export
default
{
name
:
'category'
,
data
()
{
return
{
tableData
:
[],
opera
:
''
,
mainCategorydialogFormVisible
:
false
,
mainForm
:
{
name
:
''
,
tag
:
''
,
pid
:
0
,
order
:
0
}
}
},
mounted
()
{
this
.
list
()
},
methods
:
{
list
(
params
=
{})
{
categoryApi
.
categories
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
this
.
tableData
=
res
.
data
.
data
}
else
{
this
.
$message
.
error
(
res
.
message
)
return
false
}
})
},
handleEdit
(
index
,
row
)
{
},
handleDelete
(
index
,
row
)
{
},
operation
(
opera
)
{
console
.
log
(
opera
)
},
add
()
{
categoryApi
.
addCategory
(
this
.
mainForm
).
then
(
res
=>
{
if
(
res
.
code
===
-
1
)
{
this
.
$message
.
error
(
res
.
message
)
return
false
}
this
.
$message
.
success
(
res
.
message
)
this
.
mainCategorydialogFormVisible
=
false
this
.
list
()
})
}
}
}
</
script
>
<
style
lang=
'stylus'
rel=
'stylesheet/stylus'
>
</
style
>
src/router/routes.js
浏览文件 @
8fda3e9f
...
...
@@ -13,12 +13,15 @@ const userGroup = [
{
path
:
'/yhfq/reach'
,
name
:
'reach-list'
,
component
:
()
=>
import
(
/* webpackChunkName: "usergroup" */
'@/pages/yhfq/reach/index'
)
},
{
path
:
'/albj'
,
component
:
()
=>
import
(
/* webpackChunkName: "usergroup" */
'@/pages/yhfq/albj'
)
},
{
path
:
'/yhfq/alfx'
,
component
:
()
=>
import
(
/* webpackChunkName: "usergroup" */
'@/pages/yhfq/alfx'
)
},
{
path
:
'/yhfq/yhqfx'
,
component
:
()
=>
import
(
/* webpackChunkName: "usergroup" */
'@/pages/yhfq/yhqfx'
)
}
{
path
:
'/yhfq/yhqfx'
,
component
:
()
=>
import
(
/* webpackChunkName: "usergroup" */
'@/pages/yhfq/yhqfx'
)
},
/* 版本2:首页 */
{
path
:
'/tranning'
,
redirect
:
'/tranning/categories'
},
{
path
:
'/tranning/categories'
,
name
:
'category'
,
component
:
()
=>
import
(
'@/pages/v2/categories/category'
)
}
]
export
default
[
{
path
:
'*'
,
redirect
:
'/
yhfq/albj
'
},
{
path
:
'/'
,
redirect
:
'/
yhfq/albj
'
},
{
path
:
'*'
,
redirect
:
'/
tranning/categories
'
},
{
path
:
'/'
,
redirect
:
'/
tranning/categories
'
},
{
path
:
'/'
,
component
:
Layout
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论