Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
online-edu-admin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
online-edu
online-edu-admin
Commits
f33c4049
Commit
f33c4049
authored
May 28, 2021
by
Liu Peng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整页面样式
parent
97a90acd
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
694 additions
and
566 deletions
+694
-566
index.vue
src/views/admin/dict/index.vue
+4
-5
index.vue
src/views/admin/menu/index.vue
+4
-2
index.vue
src/views/admin/role/index.vue
+91
-66
index.vue
src/views/admin/user/index.vue
+7
-5
index.vue
src/views/biz/course/index.vue
+8
-7
index.vue
src/views/biz/courseTag/index.vue
+203
-190
index.vue
src/views/biz/enterprise/index.vue
+358
-277
index.vue
src/views/biz/institution/index.vue
+4
-5
index.vue
src/views/biz/priceConfig/index.vue
+5
-2
index.vue
src/views/biz/teacher/index.vue
+10
-7
No files found.
src/views/admin/dict/index.vue
View file @
f33c4049
...
@@ -37,14 +37,12 @@
...
@@ -37,14 +37,12 @@
<template
slot=
"action"
slot-scope=
"text, record"
>
<template
slot=
"action"
slot-scope=
"text, record"
>
<a-button
<a-button
icon=
"edit"
icon=
"edit"
type=
"primary"
type=
"link"
class=
"btn_margin"
@
click=
"showModal(record)"
@
click=
"showModal(record)"
>
编辑
</a-button>
>
编辑
</a-button>
<a-button
<a-button
icon=
"delete"
icon=
"delete"
type=
"danger"
type=
"link"
class=
"btn_margin"
@
click=
"deleteRow(
{record})"
@
click=
"deleteRow(
{record})"
>删除
</a-button>
>删除
</a-button>
</
template
>
</
template
>
...
@@ -118,7 +116,8 @@ let columns = [
...
@@ -118,7 +116,8 @@ let columns = [
title
:
"操作"
,
title
:
"操作"
,
key
:
"action"
,
key
:
"action"
,
scopedSlots
:
{
customRender
:
"action"
},
scopedSlots
:
{
customRender
:
"action"
},
align
:
"center"
align
:
"center"
,
width
:
180
,
}
}
];
];
...
...
src/views/admin/menu/index.vue
View file @
f33c4049
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
</a-button-group>
</a-button-group>
</div>
</div>
<div>
<div>
<a-row>
<a-row
type=
"flex"
justify=
"space-between"
>
<a-col
:span=
"4"
class=
"col-h"
>
<a-col
:span=
"4"
class=
"col-h"
>
<a-tree
<a-tree
:treeData=
"menuTreeData"
:treeData=
"menuTreeData"
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
showLine
showLine
/>
/>
</a-col>
</a-col>
<a-col
:span=
"1
0
"
>
<a-col
:span=
"1
6
"
>
<a-form
:form=
"modalForm"
@
submit=
"modalHandleSubmit"
>
<a-form
:form=
"modalForm"
@
submit=
"modalHandleSubmit"
>
<a-form-item
<a-form-item
label=
"父级名称"
label=
"父级名称"
...
@@ -77,6 +77,8 @@
...
@@ -77,6 +77,8 @@
</a-form-item>
</a-form-item>
</a-form>
</a-form>
</a-col>
</a-col>
<a-col
:span=
"4"
/>
</a-row>
</a-row>
</div>
</div>
</div>
</div>
...
...
src/views/admin/role/index.vue
View file @
f33c4049
...
@@ -21,33 +21,44 @@
...
@@ -21,33 +21,44 @@
rowKey=
"id"
rowKey=
"id"
@
change=
"handleTableChange"
@
change=
"handleTableChange"
>
>
<template
slot=
"action"
slot-scope=
"text, record"
>
<template
slot=
"action"
slot-scope=
"text, record"
>
<a-button
<a-button
icon=
"edit"
icon=
"edit"
type=
"primary"
type=
"link"
class=
"btn_margin"
@
click=
"showModal(record)"
@
click=
"showModal(record)"
>
编辑
</a-button>
>
编辑
</a-button>
<a-button
<a-button
icon=
"delete"
icon=
"delete"
type=
"danger"
type=
"link"
class=
"btn_margin"
@
click=
"deleteRow(record)"
@
click=
"deleteRow(record)"
>
删除
</a-button>
>
删除
</a-button>
<a-button
<a-button
icon=
"cluster"
icon=
"cluster"
type=
"link"
type=
"link"
class=
"btn_margin"
@
click=
"menuAuthModal(record)"
@
click=
"menuAuthModal(record)"
>
菜单权限
</a-button>
>
菜单权限
</a-button>
</
template
>
</
template
>
</a-table>
</a-table>
</div>
</div>
<!-- 添加及编辑弹窗 -->
<!-- 添加及编辑弹窗 -->
<a-modal
:title=
"modalTitle"
v-model=
"modalVisible"
:footer=
"null"
>
<a-modal
<a-form
:form=
"modalForm"
@
submit=
"modalHandleSubmit"
>
:title=
"modalTitle"
v-model=
"modalVisible"
<a-form-item
label=
"角色名称"
:label-col=
"{ span: 5 }"
:wrapper-col=
"{ span: 19 }"
>
:footer=
"null"
>
<a-form
:form=
"modalForm"
@
submit=
"modalHandleSubmit"
>
<a-form-item
label=
"角色名称"
:label-col=
"{ span: 5 }"
:wrapper-col=
"{ span: 19 }"
>
<a-input
<a-input
v-decorator=
"[
v-decorator=
"[
'name',{rules: [{required: true, message: '角色名称不能为空'}]}
'name',{rules: [{required: true, message: '角色名称不能为空'}]}
...
@@ -55,7 +66,11 @@
...
@@ -55,7 +66,11 @@
placeholder=
"请输入角色名称"
placeholder=
"请输入角色名称"
/>
/>
</a-form-item>
</a-form-item>
<a-form-item
label=
"角色代码"
:label-col=
"{ span: 5 }"
:wrapper-col=
"{ span: 19 }"
>
<a-form-item
label=
"角色代码"
:label-col=
"{ span: 5 }"
:wrapper-col=
"{ span: 19 }"
>
<a-input
<a-input
v-decorator=
"[
v-decorator=
"[
'code',{rules: [{required: true, message: '角色代码不能为空'}]}
'code',{rules: [{required: true, message: '角色代码不能为空'}]}
...
@@ -63,9 +78,12 @@
...
@@ -63,9 +78,12 @@
placeholder=
"请输入角色代码"
placeholder=
"请输入角色代码"
/>
/>
</a-form-item>
</a-form-item>
<a-form-item
:wrapper-col=
"{ span: 19, offset: 5 }"
>
<a-form-item
:wrapper-col=
"{ span: 19, offset: 5 }"
>
<a-button
type=
"primary"
html-type=
"submit"
>
保存
</a-button>
<a-button
type=
"primary"
html-type=
"submit"
>
保存
</a-button>
</a-form-item>
</a-form-item>
</a-form>
</a-form>
</a-modal>
</a-modal>
...
@@ -85,10 +103,13 @@
...
@@ -85,10 +103,13 @@
@
check=
"this.onMenuCheck"
@
check=
"this.onMenuCheck"
/>
/>
<div
class=
"btn-box"
>
<div
class=
"btn-box"
>
<a-button
type=
"primary"
@
click=
"saveMenu"
>
保存
</a-button>
<a-button
type=
"primary"
@
click=
"saveMenu"
>
保存
</a-button>
</div>
</div>
</a-modal>
</a-modal>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
...
@@ -99,32 +120,38 @@ import {
...
@@ -99,32 +120,38 @@ import {
fetchList
,
fetchList
,
putObj
,
putObj
,
fetchRoleMenuIds
,
fetchRoleMenuIds
,
permissionUpd
permissionUpd
,
}
from
"@/api/admin/role"
;
}
from
"@/api/admin/role"
;
import
{
fetchMenuTree
}
from
"@/api/admin/menu"
;
import
{
fetchMenuTree
}
from
"@/api/admin/menu"
;
import
{
disposereq
}
from
"@/utils/util"
;
import
{
disposereq
,
timestampToTime
}
from
"@/utils/util"
;
let
columns
=
[
let
columns
=
[
{
{
title
:
"角色名称"
,
title
:
"角色名称"
,
dataIndex
:
"name"
,
dataIndex
:
"name"
,
align
:
"center"
align
:
"center"
,
},
},
{
{
title
:
"角色代码"
,
title
:
"角色代码"
,
dataIndex
:
"code"
,
dataIndex
:
"code"
,
align
:
"center"
align
:
"center"
,
},
},
{
{
title
:
"创建时间"
,
title
:
"创建时间"
,
dataIndex
:
"createTime"
,
dataIndex
:
"createTime"
,
align
:
"center"
align
:
"center"
,
width
:
180
,
customRender
:
(
text
,
record
)
=>
{
return
timestampToTime
(
text
);
},
},
},
{
{
title
:
"操作"
,
title
:
"操作"
,
key
:
"action"
,
key
:
"action"
,
scopedSlots
:
{
customRender
:
"action"
},
scopedSlots
:
{
customRender
:
"action"
},
align
:
"center"
align
:
"center"
,
}
width
:
300
,
},
];
];
export
default
{
export
default
{
...
@@ -135,16 +162,16 @@ export default {
...
@@ -135,16 +162,16 @@ export default {
searchPage
:
{
searchPage
:
{
pageIndex
:
1
,
pageIndex
:
1
,
pageSize
:
10
,
pageSize
:
10
,
name
:
""
name
:
""
,
},
},
columns
:
columns
,
columns
:
columns
,
data
:
[],
data
:
[],
pagination
:
{
pagination
:
{
showQuickJumper
:
true
,
showQuickJumper
:
true
,
showSizeChanger
:
true
showSizeChanger
:
true
,
},
},
modalVisible
:
false
,
modalVisible
:
false
,
modalTitle
:
'添加'
,
modalTitle
:
"添加"
,
modalForm
:
this
.
$form
.
createForm
(
this
,
{
name
:
"coordinated"
}),
modalForm
:
this
.
$form
.
createForm
(
this
,
{
name
:
"coordinated"
}),
rowData
:
{},
rowData
:
{},
menumodalVisible
:
false
,
menumodalVisible
:
false
,
...
@@ -154,9 +181,9 @@ export default {
...
@@ -154,9 +181,9 @@ export default {
menuReplaceFields
:
{
menuReplaceFields
:
{
children
:
"children"
,
children
:
"children"
,
title
:
"name"
,
title
:
"name"
,
key
:
"id"
key
:
"id"
,
},
},
tmpMenuIds
:
[]
tmpMenuIds
:
[]
,
};
};
},
},
// 创建完毕
// 创建完毕
...
@@ -165,14 +192,12 @@ export default {
...
@@ -165,14 +192,12 @@ export default {
this
.
GetAllMenu
();
this
.
GetAllMenu
();
},
},
// 即将更新渲染
// 即将更新渲染
beforeUpdate
()
{
beforeUpdate
()
{},
},
methods
:
{
methods
:
{
// 获取角色
// 获取角色
getList
(
pageData
)
{
getList
(
pageData
)
{
fetchList
(
pageData
)
fetchList
(
pageData
)
.
then
(
res
=>
{
.
then
(
(
res
)
=>
{
this
.
loading
=
false
;
this
.
loading
=
false
;
if
(
res
.
code
==
200
)
{
if
(
res
.
code
==
200
)
{
this
.
data
=
res
.
data
;
this
.
data
=
res
.
data
;
...
@@ -184,14 +209,14 @@ export default {
...
@@ -184,14 +209,14 @@ export default {
this
.
$message
.
info
(
res
.
resp_msg
);
this
.
$message
.
info
(
res
.
resp_msg
);
}
}
})
})
.
catch
(
err
=>
{
.
catch
(
(
err
)
=>
{
this
.
$message
.
info
(
err
);
this
.
$message
.
info
(
err
);
});
});
},
},
// 获取所有菜单
// 获取所有菜单
GetAllMenu
()
{
GetAllMenu
()
{
fetchMenuTree
()
fetchMenuTree
()
.
then
(
res
=>
{
.
then
(
(
res
)
=>
{
if
(
res
.
resp_code
==
200
)
{
if
(
res
.
resp_code
==
200
)
{
// console.log(res.datas)
// console.log(res.datas)
this
.
menuTreeData
=
res
.
datas
.
roots
;
this
.
menuTreeData
=
res
.
datas
.
roots
;
...
@@ -201,32 +226,34 @@ export default {
...
@@ -201,32 +226,34 @@ export default {
this
.
$message
.
info
(
res
.
resp_msg
);
this
.
$message
.
info
(
res
.
resp_msg
);
}
}
})
})
.
catch
(
err
=>
{
.
catch
(
(
err
)
=>
{
this
.
$message
.
info
(
err
);
this
.
$message
.
info
(
err
);
});
});
},
},
// 获取选中菜单
// 获取选中菜单
GetCheckMenu
(
roleId
)
{
GetCheckMenu
(
roleId
)
{
fetchRoleMenuIds
(
roleId
)
fetchRoleMenuIds
(
roleId
)
.
then
(
res
=>
{
.
then
(
(
res
)
=>
{
// console.log(this.tmpMenuIds)
// console.log(this.tmpMenuIds)
this
.
allMenuCheckedKeys
=
res
.
datas
this
.
allMenuCheckedKeys
=
res
.
datas
;
let
result
=
[...
new
Set
(
this
.
tmpMenuIds
)].
filter
((
item
)
=>
new
Set
(
eval
(
res
.
datas
)).
has
(
item
));
let
result
=
[...
new
Set
(
this
.
tmpMenuIds
)].
filter
((
item
)
=>
new
Set
(
eval
(
res
.
datas
)).
has
(
item
)
);
// console.log(result)
// console.log(result)
this
.
menuDefaultCheckedKeys
=
result
this
.
menuDefaultCheckedKeys
=
result
;
this
.
menumodalVisible
=
true
;
this
.
menumodalVisible
=
true
;
})
})
.
catch
(
err
=>
{
.
catch
(
(
err
)
=>
{
this
.
$message
.
info
(
err
);
this
.
$message
.
info
(
err
);
});
});
},
},
deepList
(
data
){
deepList
(
data
)
{
data
.
map
((
item
)
=>
{
data
.
map
((
item
)
=>
{
if
(
item
.
children
&&
item
.
children
.
length
>
0
)
{
if
(
item
.
children
&&
item
.
children
.
length
>
0
)
{
this
.
deepList
(
item
.
children
);
this
.
deepList
(
item
.
children
);
}
else
{
}
else
{
//test数组存放
//test数组存放
this
.
tmpMenuIds
.
push
(
item
.
id
);
this
.
tmpMenuIds
.
push
(
item
.
id
);
}
}
});
});
},
},
...
@@ -250,36 +277,35 @@ export default {
...
@@ -250,36 +277,35 @@ export default {
this
.
modalVisible
=
true
;
this
.
modalVisible
=
true
;
// 判断添加或者编辑
// 判断添加或者编辑
if
(
row
==
""
)
{
if
(
row
==
""
)
{
this
.
modalTitle
=
'添加'
;
this
.
modalTitle
=
"添加"
;
this
.
modalType
=
"add"
;
this
.
modalType
=
"add"
;
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
modalForm
.
setFieldsValue
({
this
.
modalForm
.
setFieldsValue
({
name
:
""
,
name
:
""
,
code
:
""
code
:
""
,
});
});
});
});
}
else
{
}
else
{
this
.
modalTitle
=
'编辑'
;
this
.
modalTitle
=
"编辑"
;
this
.
modalType
=
"edit"
;
this
.
modalType
=
"edit"
;
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
modalForm
.
setFieldsValue
({
this
.
modalForm
.
setFieldsValue
({
name
:
row
.
name
,
name
:
row
.
name
,
code
:
row
.
code
code
:
row
.
code
,
});
});
this
.
rowData
=
row
;
this
.
rowData
=
row
;
});
});
}
}
},
},
// 删除行数据
// 删除行数据
deleteRow
(
row
)
{
deleteRow
(
row
)
{
console
.
log
(
row
)
console
.
log
(
row
)
;
delObj
([
row
.
id
])
delObj
([
row
.
id
])
.
then
(
res
=>
{
.
then
(
(
res
)
=>
{
this
.
loading
=
false
;
this
.
loading
=
false
;
if
(
res
.
resp_code
==
200
)
{
if
(
res
.
resp_code
==
200
)
{
this
.
$message
.
success
(
'删除成功'
);
this
.
$message
.
success
(
"删除成功"
);
const
searchPage
=
{
...
this
.
searchPage
};
const
searchPage
=
{
...
this
.
searchPage
};
this
.
loading
=
true
;
this
.
loading
=
true
;
this
.
getList
(
searchPage
);
this
.
getList
(
searchPage
);
...
@@ -287,7 +313,7 @@ export default {
...
@@ -287,7 +313,7 @@ export default {
this
.
$message
.
info
(
res
.
resp_msg
);
this
.
$message
.
info
(
res
.
resp_msg
);
}
}
})
})
.
catch
(
err
=>
{
.
catch
(
(
err
)
=>
{
this
.
$message
.
info
(
err
);
this
.
$message
.
info
(
err
);
});
});
},
},
...
@@ -298,10 +324,10 @@ export default {
...
@@ -298,10 +324,10 @@ export default {
if
(
!
err
&&
this
.
modalType
==
"add"
)
{
if
(
!
err
&&
this
.
modalType
==
"add"
)
{
// console.log(values)
// console.log(values)
addObj
(
values
)
addObj
(
values
)
.
then
(
res
=>
{
.
then
(
(
res
)
=>
{
if
(
res
.
resp_code
==
200
)
{
if
(
res
.
resp_code
==
200
)
{
this
.
modalVisible
=
false
;
this
.
modalVisible
=
false
;
this
.
$message
.
success
(
'保存成功'
);
this
.
$message
.
success
(
"保存成功"
);
const
searchPage
=
{
...
this
.
searchPage
};
const
searchPage
=
{
...
this
.
searchPage
};
this
.
loading
=
true
;
this
.
loading
=
true
;
this
.
getList
(
searchPage
);
this
.
getList
(
searchPage
);
...
@@ -309,17 +335,17 @@ export default {
...
@@ -309,17 +335,17 @@ export default {
this
.
$message
.
info
(
res
.
resp_msg
);
this
.
$message
.
info
(
res
.
resp_msg
);
}
}
})
})
.
catch
(
err
=>
{
.
catch
(
(
err
)
=>
{
this
.
$message
.
info
(
err
);
this
.
$message
.
info
(
err
);
});
});
}
else
if
(
!
err
&&
this
.
modalType
==
"edit"
)
{
}
else
if
(
!
err
&&
this
.
modalType
==
"edit"
)
{
this
.
rowData
.
name
=
values
.
name
;
this
.
rowData
.
name
=
values
.
name
;
this
.
rowData
.
code
=
values
.
code
;
this
.
rowData
.
code
=
values
.
code
;
putObj
(
this
.
rowData
)
putObj
(
this
.
rowData
)
.
then
(
res
=>
{
.
then
(
(
res
)
=>
{
if
(
res
.
resp_code
==
200
)
{
if
(
res
.
resp_code
==
200
)
{
this
.
modalVisible
=
false
;
this
.
modalVisible
=
false
;
this
.
$message
.
success
(
'保存成功'
);
this
.
$message
.
success
(
"保存成功"
);
const
searchPage
=
{
...
this
.
searchPage
};
const
searchPage
=
{
...
this
.
searchPage
};
this
.
loading
=
true
;
this
.
loading
=
true
;
this
.
getList
(
searchPage
);
this
.
getList
(
searchPage
);
...
@@ -327,7 +353,7 @@ export default {
...
@@ -327,7 +353,7 @@ export default {
this
.
$message
.
info
(
res
.
resp_msg
);
this
.
$message
.
info
(
res
.
resp_msg
);
}
}
})
})
.
catch
(
err
=>
{
.
catch
(
(
err
)
=>
{
this
.
$message
.
info
(
err
);
this
.
$message
.
info
(
err
);
});
});
}
}
...
@@ -346,20 +372,19 @@ export default {
...
@@ -346,20 +372,19 @@ export default {
saveMenu
()
{
saveMenu
()
{
// console.log(this.allMenuCheckedKeys)
// console.log(this.allMenuCheckedKeys)
permissionUpd
(
this
.
roleId
,
this
.
allMenuCheckedKeys
)
permissionUpd
(
this
.
roleId
,
this
.
allMenuCheckedKeys
)
.
then
(
res
=>
{
.
then
(
(
res
)
=>
{
if
(
res
.
resp_code
==
200
)
{
if
(
res
.
resp_code
==
200
)
{
this
.
menumodalVisible
=
false
;
this
.
menumodalVisible
=
false
;
this
.
$message
.
success
(
'保存成功'
);
this
.
$message
.
success
(
"保存成功"
);
}
else
{
}
else
{
this
.
$message
.
info
(
res
.
resp_msg
);
this
.
$message
.
info
(
res
.
resp_msg
);
}
}
})
})
.
catch
(
err
=>
{
.
catch
(
(
err
)
=>
{
this
.
$message
.
info
(
err
);
this
.
$message
.
info
(
err
);
});
});
},
},
},
}
};
};
</
script
>
</
script
>
<
style
>
<
style
>
...
...
src/views/admin/user/index.vue
View file @
f33c4049
...
@@ -47,14 +47,13 @@
...
@@ -47,14 +47,13 @@
<template
slot=
"action"
slot-scope=
"text, record"
>
<template
slot=
"action"
slot-scope=
"text, record"
>
<a-button
<a-button
icon=
"edit"
icon=
"edit"
type=
"
primary
"
type=
"
link
"
class=
"btn_margin
"
size=
"small
"
@
click=
"showModal(record)"
@
click=
"showModal(record)"
>
修改
</a-button>
>
修改
</a-button>
<a-button
<a-button
icon=
"delete"
icon=
"delete"
type=
"danger"
type=
"link"
class=
"btn_margin"
@
click=
"deleteRow(
{record})"
@
click=
"deleteRow(
{record})"
>删除
</a-button>
>删除
</a-button>
</
template
>
</
template
>
...
@@ -135,6 +134,7 @@ let columns = [
...
@@ -135,6 +134,7 @@ let columns = [
title
:
"状态"
,
title
:
"状态"
,
dataIndex
:
"status"
,
dataIndex
:
"status"
,
align
:
"center"
,
align
:
"center"
,
width
:
'100px'
,
scopedSlots
:
{
customRender
:
"statusFlag"
}
scopedSlots
:
{
customRender
:
"statusFlag"
}
},
},
{
{
...
@@ -148,6 +148,7 @@ let columns = [
...
@@ -148,6 +148,7 @@ let columns = [
title
:
"创建时间"
,
title
:
"创建时间"
,
dataIndex
:
"createTime"
,
dataIndex
:
"createTime"
,
align
:
"center"
,
align
:
"center"
,
width
:
'180px'
,
customRender
:
(
text
,
record
)
=>
{
customRender
:
(
text
,
record
)
=>
{
return
timestampToTime
(
text
);
return
timestampToTime
(
text
);
}
}
...
@@ -156,7 +157,8 @@ let columns = [
...
@@ -156,7 +157,8 @@ let columns = [
title
:
"操作"
,
title
:
"操作"
,
key
:
"action"
,
key
:
"action"
,
scopedSlots
:
{
customRender
:
"action"
},
scopedSlots
:
{
customRender
:
"action"
},
align
:
"center"
align
:
"center"
,
width
:
'180px'
}
}
];
];
...
...
src/views/biz/course/index.vue
View file @
f33c4049
...
@@ -77,14 +77,12 @@
...
@@ -77,14 +77,12 @@
<template
slot=
"action"
slot-scope=
"text, record"
>
<template
slot=
"action"
slot-scope=
"text, record"
>
<a-button
<a-button
icon=
"edit"
icon=
"edit"
type=
"primary"
type=
"link"
class=
"btn_margin"
@
click=
"navigateDetailPage(record)"
@
click=
"navigateDetailPage(record)"
>
编辑
</a-button>
>
编辑
</a-button>
<a-button
<a-button
icon=
"edit"
icon=
"edit"
type=
"primary"
type=
"link"
class=
"btn_margin"
@
click=
"changeStatus(record)"
@
click=
"changeStatus(record)"
>
{{
record
.
status
==
'UP'
?
'下架'
:
'上架'
}}
</a-button>
>
{{
record
.
status
==
'UP'
?
'下架'
:
'上架'
}}
</a-button>
</
template
>
</
template
>
...
@@ -120,7 +118,8 @@ let columns = [
...
@@ -120,7 +118,8 @@ let columns = [
title
:
'收费模式'
,
title
:
'收费模式'
,
dataIndex
:
'chargeModel'
,
dataIndex
:
'chargeModel'
,
align
:
'center'
,
align
:
'center'
,
scopedSlots
:
{
customRender
:
'chargeModel'
}
scopedSlots
:
{
customRender
:
'chargeModel'
},
width
:
120
,
},
},
{
{
title
:
'标签'
,
title
:
'标签'
,
...
@@ -132,13 +131,15 @@ let columns = [
...
@@ -132,13 +131,15 @@ let columns = [
title
:
'状态'
,
title
:
'状态'
,
dataIndex
:
'status'
,
dataIndex
:
'status'
,
align
:
'center'
,
align
:
'center'
,
scopedSlots
:
{
customRender
:
'status'
}
scopedSlots
:
{
customRender
:
'status'
},
width
:
100
,
},
},
{
{
title
:
'操作'
,
title
:
'操作'
,
key
:
"action"
,
key
:
"action"
,
scopedSlots
:
{
customRender
:
"action"
},
scopedSlots
:
{
customRender
:
"action"
},
align
:
"center"
align
:
"center"
,
width
:
180
,
}
}
]
]
export
default
{
export
default
{
...
...
src/views/biz/courseTag/index.vue
View file @
f33c4049
...
@@ -2,24 +2,32 @@
...
@@ -2,24 +2,32 @@
<div
class=
"template_content"
>
<div
class=
"template_content"
>
<!-- 搜索 -->
<!-- 搜索 -->
<div
class=
"search_box"
>
<div
class=
"search_box"
>
<a-form
layout=
"inline"
>
<a-form
layout=
"inline"
>
<a-form-item
label=
"标签名:"
>
<a-form-item
label=
"标签名:"
>
<a-input
v-model=
"searchPage.name"
placeholder=
"请输入标签名"
allowClear
></a-input>
<a-input
</a-form-item>
v-model=
"searchPage.name"
<a-form-item>
placeholder=
"请输入标签名"
<a-button
icon=
"search"
type=
"primary"
@
click=
"handleSubmit"
>
查询
</a-button>
allowClear
</a-form-item>
></a-input>
</a-form>
</a-form-item>
<a-form-item>
<a-button
icon=
"search"
type=
"primary"
@
click=
"handleSubmit"
>
查询
</a-button>
</a-form-item>
</a-form>
</div>
</div>
<!-- 主体内容 -->
<!-- 主体内容 -->
<div
class=
"content_box"
>
<div
class=
"content_box"
>
<!-- 表格操作 -->
<!-- 表格操作 -->
<div
class=
"table_top"
>
<div
class=
"table_top"
>
<a-button
<a-button
icon=
"plus"
icon=
"plus"
type=
"primary"
type=
"primary"
class=
"btn_right_margin"
class=
"btn_right_margin"
@
click=
"showModal('')"
@
click=
"showModal('')"
>
添加
</a-button>
>
添加
</a-button>
</div>
</div>
<a-table
<a-table
...
@@ -33,19 +41,20 @@
...
@@ -33,19 +41,20 @@
@
change=
"handleTableChange"
@
change=
"handleTableChange"
rowKey=
"id"
rowKey=
"id"
>
>
<!-- 操作 -->
<!-- 操作 -->
<template
slot=
"action"
slot-scope=
"text, record"
>
<template
slot=
"action"
slot-scope=
"text, record"
>
<a-button
<a-button
icon=
"edit"
icon=
"edit"
type=
"primary"
type=
"link"
class=
"btn_margin"
@
click=
"showModal(record)"
@
click=
"showModal(record)"
>
修改
</a-button>
>
修改
</a-button>
<a-button
<a-button
icon=
"delete"
icon=
"delete"
type=
"danger"
type=
"link"
class=
"btn_margin"
@
click=
"deleteRow(record)"
@
click=
"deleteRow(record)"
>
删除
</a-button>
>
删除
</a-button>
</
template
>
</
template
>
...
@@ -54,11 +63,11 @@
...
@@ -54,11 +63,11 @@
<!-- 弹窗 -->
<!-- 弹窗 -->
<
template
>
<
template
>
<a-modal
<a-modal
:visible=
"modalVisible"
:visible=
"modalVisible"
:title=
"modalTitle"
:title=
"modalTitle"
@
ok=
"onSave"
@
ok=
"onSave"
@
cancel=
"onCancel"
@
cancel=
"onCancel"
>
>
<a-form-model
<a-form-model
:model=
"formModel"
:model=
"formModel"
...
@@ -66,13 +75,16 @@
...
@@ -66,13 +75,16 @@
:wrapper-col="{span: 8}"
:wrapper-col="{span: 8}"
:rules="formRules"
:rules="formRules"
ref="formModelRef"
ref="formModelRef"
>
>
<a-form-model-item
<a-form-model-item
label=
"标签名称"
label=
"标签名称"
ref=
"nameVal"
ref=
"nameVal"
prop=
"name"
prop=
"name"
>
>
<a-input
v-model=
"formModel.name"
@
blur=
"blurValidate('nameVal')"
></a-input>
<a-input
v-model=
"formModel.name"
@
blur=
"blurValidate('nameVal')"
></a-input>
</a-form-model-item>
</a-form-model-item>
</a-form-model>
</a-form-model>
...
@@ -82,183 +94,184 @@
...
@@ -82,183 +94,184 @@
</template>
</template>
<
script
>
<
script
>
import
{
fetchList
,
addObj
,
putObj
,
delObj
}
from
'@/api/biz/courseTag'
import
{
fetchList
,
addObj
,
putObj
,
delObj
}
from
"@/api/biz/courseTag"
;
import
{
disposereq
}
from
'@/utils/util'
import
{
disposereq
}
from
"@/utils/util"
;
let
columns
=
[
let
columns
=
[
{
{
title
:
"标签名"
,
title
:
"标签名"
,
dataIndex
:
"name"
,
dataIndex
:
"name"
,
align
:
"center"
align
:
"center"
,
},
},
{
{
title
:
'操作'
,
title
:
"操作"
,
key
:
"action"
,
key
:
"action"
,
scopedSlots
:
{
customRender
:
"action"
},
scopedSlots
:
{
customRender
:
"action"
},
align
:
"center"
align
:
"center"
,
}
width
:
180
,
]
},
];
export
default
{
export
default
{
data
(){
data
()
{
return
{
return
{
loading
:
false
,
loading
:
false
,
searchPage
:
{
searchPage
:
{
pageIndex
:
1
,
pageIndex
:
1
,
pageSize
:
10
,
pageSize
:
10
,
name
:
""
name
:
""
,
},
},
columns
:
columns
,
columns
:
columns
,
data
:
[],
data
:
[],
pagination
:
{
pagination
:
{
showQuickJumper
:
true
,
showQuickJumper
:
true
,
showSizeChanger
:
true
showSizeChanger
:
true
,
},
},
modalVisible
:
false
,
modalVisible
:
false
,
modalTitle
:
'添加'
,
modalTitle
:
"添加"
,
modalType
:
''
,
modalType
:
""
,
rowData
:
''
,
rowData
:
""
,
formModel
:
{
formModel
:
{
name
:
''
name
:
""
,
},
},
formRules
:
{
formRules
:
{
name
:
[
name
:
[
{
{
required
:
true
,
required
:
true
,
message
:
'不能为空'
,
message
:
"不能为空"
,
trigger
:
'blur'
trigger
:
"blur"
,
},
},
]
],
}
},
}
};
},
created
()
{
this
.
getList
(
this
.
searchPage
);
},
beforeUpdate
()
{},
methods
:
{
getList
(
query
)
{
this
.
loading
=
true
;
fetchList
(
query
)
.
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
this
.
loading
=
false
;
this
.
data
=
res
.
data
;
const
pager
=
{
...
this
.
pagination
};
pager
.
current
=
query
.
pageIndex
;
pager
.
total
=
res
.
count
;
this
.
pagination
=
pager
;
}
else
{
this
.
$message
.
info
(
res
.
resp_msg
);
}
})
.
catch
((
err
)
=>
{
this
.
loading
=
false
;
disposereq
(
this
,
err
);
});
},
},
created
(
)
{
blurValidate
(
prop
)
{
this
.
getList
(
this
.
searchPage
)
this
.
$refs
[
prop
].
onFieldBlur
();
},
},
beforeUpdate
()
{
// 表格数据变化触发事件
handleTableChange
(
pagination
,
filters
,
sorter
)
{
const
searchPage
=
{
...
this
.
searchPage
};
searchPage
.
pageIndex
=
pagination
.
current
;
searchPage
.
pageSize
=
pagination
.
pageSize
;
this
.
loading
=
true
;
this
.
getList
(
searchPage
);
},
},
methods
:
{
// 搜索事件
getList
(
query
){
handleSubmit
()
{
this
.
loading
=
true
;
const
searchPage
=
{
...
this
.
searchPage
};
fetchList
(
query
).
then
(
res
=>
{
this
.
getList
(
searchPage
);
if
(
res
.
code
==
200
){
},
this
.
loading
=
false
// 显示对话框
this
.
data
=
res
.
data
;
showModal
(
row
)
{
const
pager
=
{
...
this
.
pagination
};
this
.
modalVisible
=
true
;
pager
.
current
=
query
.
pageIndex
;
// 判断添加或者编辑
pager
.
total
=
res
.
count
;
if
(
row
==
""
)
{
this
.
pagination
=
pager
;
this
.
modalTitle
=
"添加"
;
}
else
{
this
.
modalType
=
"add"
;
this
.
$message
.
info
(
res
.
resp_msg
);
this
.
formModel
.
name
=
""
;
}
this
.
rowData
=
""
;
}).
catch
(
err
=>
{
}
else
{
this
.
loading
=
false
this
.
modalTitle
=
"编辑"
;
disposereq
(
this
,
err
)
this
.
modalType
=
"edit"
;
})
this
.
formModel
.
name
=
row
.
name
;
},
this
.
rowData
=
row
;
blurValidate
(
prop
){
}
this
.
$refs
[
prop
].
onFieldBlur
()
},
},
// 删除行数据
// 表格数据变化触发事件
deleteRow
(
row
)
{
handleTableChange
(
pagination
,
filters
,
sorter
)
{
delObj
([
row
.
id
])
.
then
((
res
)
=>
{
this
.
loading
=
false
;
if
(
res
.
resp_code
==
200
)
{
this
.
$message
.
success
(
"删除成功"
);
const
searchPage
=
{
...
this
.
searchPage
};
const
searchPage
=
{
...
this
.
searchPage
};
searchPage
.
pageIndex
=
pagination
.
current
;
searchPage
.
pageSize
=
pagination
.
pageSize
;
this
.
loading
=
true
;
this
.
loading
=
true
;
this
.
getList
(
searchPage
);
this
.
getList
(
searchPage
);
},
}
else
{
// 搜索事件
this
.
$message
.
info
(
res
.
resp_msg
);
handleSubmit
()
{
}
const
searchPage
=
{
...
this
.
searchPage
};
})
this
.
getList
(
searchPage
);
.
catch
((
err
)
=>
{
},
disposereq
(
this
,
err
);
// 显示对话框
});
showModal
(
row
)
{
},
this
.
modalVisible
=
true
;
//对话框确定
// 判断添加或者编辑
onSave
()
{
if
(
row
==
""
)
{
this
.
$refs
.
formModelRef
.
validate
((
valid
)
=>
{
this
.
modalTitle
=
'添加'
;
if
(
valid
)
{
this
.
modalType
=
"add"
;
if
(
this
.
modalType
==
"add"
)
{
this
.
formModel
.
name
=
""
let
data
=
{};
this
.
rowData
=
''
data
.
name
=
this
.
formModel
.
name
;
}
else
{
addObj
(
data
)
this
.
modalTitle
=
'编辑'
;
.
then
((
res
)
=>
{
this
.
modalType
=
"edit"
;
if
(
res
.
resp_code
==
200
)
{
this
.
formModel
.
name
=
row
.
name
this
.
modalVisible
=
false
;
this
.
rowData
=
row
;
this
.
$message
.
success
(
"保存成功"
);
const
searchPage
=
{
...
this
.
searchPage
};
}
this
.
loading
=
true
;
},
this
.
getList
(
searchPage
);
// 删除行数据
}
else
{
deleteRow
(
row
)
{
this
.
$message
.
info
(
res
.
resp_msg
);
delObj
([
row
.
id
])
.
then
(
res
=>
{
this
.
loading
=
false
;
if
(
res
.
resp_code
==
200
)
{
this
.
$message
.
success
(
'删除成功'
);
const
searchPage
=
{
...
this
.
searchPage
};
this
.
loading
=
true
;
this
.
getList
(
searchPage
);
}
else
{
this
.
$message
.
info
(
res
.
resp_msg
);
}
})
.
catch
(
err
=>
{
disposereq
(
this
,
err
);
});
},
//对话框确定
onSave
(){
this
.
$refs
.
formModelRef
.
validate
(
valid
=>
{
if
(
valid
){
if
(
this
.
modalType
==
'add'
){
let
data
=
{}
data
.
name
=
this
.
formModel
.
name
addObj
(
data
).
then
(
res
=>
{
if
(
res
.
resp_code
==
200
){
this
.
modalVisible
=
false
this
.
$message
.
success
(
'保存成功'
);
const
searchPage
=
{
...
this
.
searchPage
};
this
.
loading
=
true
;
this
.
getList
(
searchPage
);
}
else
{
this
.
$message
.
info
(
res
.
resp_msg
);
}
}).
catch
(
err
=>
{
disposereq
(
this
,
err
)
})
}
else
if
(
this
.
modalType
==
'edit'
){
let
data
=
{}
data
.
id
=
this
.
rowData
.
id
data
.
name
=
this
.
formModel
.
name
putObj
(
data
).
then
(
res
=>
{
if
(
res
.
resp_code
==
200
){
this
.
modalVisible
=
false
this
.
$message
.
success
(
'保存成功'
);
const
searchPage
=
{
...
this
.
searchPage
};
this
.
loading
=
true
;
this
.
getList
(
searchPage
);
}
else
{
this
.
$message
.
info
(
res
.
resp_msg
)
}
}).
catch
(
err
=>
{
disposereq
(
this
,
err
)
})
}
}
}
})
})
.
catch
((
err
)
=>
{
},
disposereq
(
this
,
err
);
//对话框取消
});
onCancel
(){
}
else
if
(
this
.
modalType
==
"edit"
)
{
this
.
modalVisible
=
false
let
data
=
{};
this
.
$refs
.
formModelRef
.
resetFields
()
data
.
id
=
this
.
rowData
.
id
;
data
.
name
=
this
.
formModel
.
name
;
putObj
(
data
)
.
then
((
res
)
=>
{
if
(
res
.
resp_code
==
200
)
{
this
.
modalVisible
=
false
;
this
.
$message
.
success
(
"保存成功"
);
const
searchPage
=
{
...
this
.
searchPage
};
this
.
loading
=
true
;
this
.
getList
(
searchPage
);
}
else
{
this
.
$message
.
info
(
res
.
resp_msg
);
}
})
.
catch
((
err
)
=>
{
disposereq
(
this
,
err
);
});
}
}
}
}
});
}
},
//对话框取消
onCancel
()
{
this
.
modalVisible
=
false
;
this
.
$refs
.
formModelRef
.
resetFields
();
},
},
};
</
script
>
</
script
>
<
style
>
<
style
>
.template_content
{
.template_content
{
...
...
src/views/biz/enterprise/index.vue
View file @
f33c4049
...
@@ -4,14 +4,26 @@
...
@@ -4,14 +4,26 @@
<div
class=
"search_box"
>
<div
class=
"search_box"
>
<a-form
layout=
"inline"
>
<a-form
layout=
"inline"
>
<a-form-item
label=
"企业名称"
>
<a-form-item
label=
"企业名称"
>
<a-input
v-model=
"searchPage.enterpriseName"
placeholder=
"请输入企业名称"
allowClear
></a-input>
<a-input
</a-form-item>
v-model=
"searchPage.enterpriseName"
<a-form-item
label=
"管理员手机号"
>
placeholder=
"请输入企业名称"
<a-input
v-model=
"searchPage.adminMobile"
placeholder=
"请输入管理员手机号"
allowClear
></a-input>
allowClear
</a-form-item>
></a-input>
<a-form-item>
</a-form-item>
<a-button
type=
"primary"
icon=
"search"
@
click=
"handlSearch"
>
查询
</a-button>
<a-form-item
label=
"管理员手机号"
>
</a-form-item>
<a-input
v-model=
"searchPage.adminMobile"
placeholder=
"请输入管理员手机号"
allowClear
></a-input>
</a-form-item>
<a-form-item>
<a-button
type=
"primary"
icon=
"search"
@
click=
"handlSearch"
>
查询
</a-button>
</a-form-item>
</a-form>
</a-form>
</div>
</div>
<!-- 表格内容 -->
<!-- 表格内容 -->
...
@@ -19,10 +31,10 @@
...
@@ -19,10 +31,10 @@
<!-- 表格操作 -->
<!-- 表格操作 -->
<div
class=
"table_top"
>
<div
class=
"table_top"
>
<a-button
<a-button
icon=
"plus"
icon=
"plus"
type=
"primary"
type=
"primary"
class=
"btn_right_margin"
class=
"btn_right_margin"
@
click=
"showModal('')"
@
click=
"showModal('')"
>
添加
</a-button>
>
添加
</a-button>
</div>
</div>
<a-table
<a-table
...
@@ -34,68 +46,118 @@
...
@@ -34,68 +46,118 @@
size=
"small"
size=
"small"
@
change=
"handleTableChange"
@
change=
"handleTableChange"
rowKey=
"id"
rowKey=
"id"
>
>
<!-- 企业名称 -->
<!-- 企业名称 -->
<div
slot=
"name"
slot-scope=
"text,record"
>
<div
<a-row
type=
"flex"
justify=
"start"
>
slot=
"name"
slot-scope=
"text,record"
>
<a-row
type=
"flex"
justify=
"space-between"
align=
"start"
>
<!-- 头像 -->
<!-- 头像 -->
<a-col>
<a-col
:span=
"4"
>
<a-avatar
v-if=
"!record.logoUrl || record.logoUrl == ''"
shape=
"square"
:size=
"64"
icon=
"user"
/>
<a-avatar
<a-avatar
v-if=
"record.logoUrl && record.logoUrl != ''"
shape=
"square"
:size=
"64"
:src=
"record.logoUrl"
/>
v-if=
"!record.logoUrl || record.logoUrl == ''"
shape=
"square"
:size=
"64"
icon=
"user"
/>
<a-avatar
v-if=
"record.logoUrl && record.logoUrl != ''"
shape=
"square"
:size=
"64"
:src=
"record.logoUrl"
/>
</a-col>
</a-col>
<!-- 企业名称 -->
<!-- 企业名称 -->
<a-col>
<a-col
:span=
"20"
>
<span
style=
"margin: 10px;"
>
{{
record
.
name
}}
</span>
<span
style=
"margin: 10px;"
>
{{
record
.
name
}}
</span>
</a-col>
</a-col>
</a-row>
</a-row>
</div>
</div>
<!-- 用户 -->
<!-- 用户 -->
<div
slot=
"adminName"
slot-scope=
"text,record"
>
<div
<a-row
type=
"flex"
justify=
"start"
align=
"middle"
>
slot=
"adminName"
slot-scope=
"text,record"
>
<a-row
type=
"flex"
justify=
"space-between"
align=
"middle"
>
<!-- 头像 -->
<!-- 头像 -->
<a-col
:span=
"4"
>
<a-col
:span=
"4"
>
<a-avatar
v-if=
"!record.adminAvatarUrl || record.adminAvatarUrl == ''"
shape=
"square"
:size=
"64"
icon=
"user"
/>
<a-avatar
<a-avatar
v-if=
"record.adminAvatarUrl && record.adminAvatarUrl != ''"
shape=
"square"
:size=
"64"
:src=
"record.adminAvatarUrl"
/>
v-if=
"!record.adminAvatarUrl || record.adminAvatarUrl == ''"
</a-col>
shape=
"square"
<!-- 管理员姓名、昵称,注册时间 -->
:size=
"64"
<a-col
:span=
"12"
>
icon=
"user"
<a-space
direction=
"vertical"
align=
"start"
>
/>
<span>
姓名:
{{
record
.
adminName
&&
record
.
adminName
!=
''
?
record
.
adminName
:
'-'
}}
</span>
<a-avatar
<span>
昵称:
{{
record
.
adminNickName
&&
record
.
adminNickName
!=
''
?
record
.
adminNickName
:
'-'
}}
</span>
v-if=
"record.adminAvatarUrl && record.adminAvatarUrl != ''"
<span>
注册时间:
{{
timestampToTime
(
record
.
createTime
)
}}
</span>
shape=
"square"
</a-space>
:size=
"64"
<!--
<a-row
type=
"flex"
justify=
"start"
align=
"middle"
>
:src=
"record.adminAvatarUrl"
/>
</a-col>
<!-- 管理员姓名、昵称,注册时间 -->
<a-col
:span=
"20"
>
<a-space
direction=
"vertical"
align=
"start"
>
<span>
姓名:
{{
record
.
adminName
&&
record
.
adminName
!=
''
?
record
.
adminName
:
'-'
}}
</span>
<span>
昵称:
{{
record
.
adminNickName
&&
record
.
adminNickName
!=
''
?
record
.
adminNickName
:
'-'
}}
</span>
<span>
注册时间:
{{
timestampToymd
(
record
.
createTime
)
}}
</span>
</a-space>
<!--
<a-row
type=
"flex"
justify=
"start"
align=
"middle"
>
<a-col
:span=
"24"
><span>
姓名:
{{
record
.
adminName
&&
record
.
adminName
!=
''
?
record
.
adminName
:
'-'
}}
</span></a-col>
<a-col
:span=
"24"
><span>
姓名:
{{
record
.
adminName
&&
record
.
adminName
!=
''
?
record
.
adminName
:
'-'
}}
</span></a-col>
<a-col
:span=
"24"
><span>
昵称:
{{
record
.
adminNickName
&&
record
.
adminNickName
!=
''
?
record
.
adminNickName
:
'-'
}}
</span></a-col>
<a-col
:span=
"24"
><span>
昵称:
{{
record
.
adminNickName
&&
record
.
adminNickName
!=
''
?
record
.
adminNickName
:
'-'
}}
</span></a-col>
<a-col
:span=
"24"
><span>
注册时间:
{{
timestampToTime
(
record
.
createTime
)
}}
</span></a-col>
<a-col
:span=
"24"
><span>
注册时间:
{{
timestampToTime
(
record
.
createTime
)
}}
</span></a-col>
</a-row>
-->
</a-row>
-->
</a-col>
</a-col>
</a-row>
</a-row>
</div>
</div>
<!-- 用户状态 -->
<!-- 用户状态 -->
<div
slot=
"adminStatus"
slot-scope=
"text,record"
>
<div
<a-tag
v-if=
"record.adminStatus == 'ENABLE'"
color=
"green"
>
启用
</a-tag>
slot=
"adminStatus"
<a-tag
v-if=
"record.adminStatus == 'DISABLE'"
color=
"red"
>
禁用
</a-tag>
slot-scope=
"text,record"
<a-tag
v-if=
"record.adminStatus == 'UNACTIVATE'"
color=
"orange"
>
未激活
</a-tag>
>
<a-tag
v-if=
"record.adminStatus == 'ENABLE'"
color=
"green"
>
启用
</a-tag>
<a-tag
v-if=
"record.adminStatus == 'DISABLE'"
color=
"red"
>
禁用
</a-tag>
<a-tag
v-if=
"record.adminStatus == 'UNACTIVATE'"
color=
"orange"
>
未激活
</a-tag>
</div>
</div>
<!-- 操作 -->
<!-- 操作 -->
<template
slot=
"action"
slot-scope=
"text, record"
>
<template
slot=
"action"
slot-scope=
"text, record"
>
<a-button
<a-button
icon=
"edit"
icon=
"edit"
type=
"primary"
type=
"link"
class=
"btn_margin"
@
click=
"showModal(record)"
@
click=
"showModal(record)"
>
修改
</a-button>
>
修改
</a-button>
</
template
>
</
template
>
</a-table>
</a-table>
</div>
</div>
<!-- Modal窗口 -->
<!-- Modal窗口 -->
<
template
>
<
template
>
<a-modal
<a-modal
:visible=
"modalVisible"
:visible=
"modalVisible"
:title=
"modalTitle"
:title=
"modalTitle"
@
ok=
"onConfirm"
@
ok=
"onConfirm"
@
cancel=
"onCancel"
@
cancel=
"onCancel"
...
@@ -111,8 +173,20 @@
...
@@ -111,8 +173,20 @@
label=
"企业LOGO"
label=
"企业LOGO"
prop=
"logoUrl"
prop=
"logoUrl"
>
>
<a-avatar
v-if=
"!formModel.logoUrl || formModel.logoUrl == ''"
shape=
"square"
:size=
"64"
icon=
"user"
@
click=
"changeLogo"
/>
<a-avatar
<a-avatar
v-if=
"formModel.logoUrl && formModel.logoUrl != ''"
shape=
"square"
:size=
"64"
:src=
"formModel.logoUrl"
@
click=
"changeLogo"
/>
v-if=
"!formModel.logoUrl || formModel.logoUrl == ''"
shape=
"square"
:size=
"64"
icon=
"user"
@
click=
"changeLogo"
/>
<a-avatar
v-if=
"formModel.logoUrl && formModel.logoUrl != ''"
shape=
"square"
:size=
"64"
:src=
"formModel.logoUrl"
@
click=
"changeLogo"
/>
<a-input
<a-input
v-model=
"formModel.logoUrl"
v-model=
"formModel.logoUrl"
type=
"hidden"
type=
"hidden"
...
@@ -123,9 +197,7 @@
...
@@ -123,9 +197,7 @@
label=
"企业名称"
label=
"企业名称"
prop=
"name"
prop=
"name"
>
>
<a-input
<a-input
v-model=
"formModel.name"
>
v-model=
"formModel.name"
>
</a-input>
</a-input>
</a-form-model-item>
</a-form-model-item>
<a-form-model-item
<a-form-model-item
...
@@ -162,16 +234,20 @@
...
@@ -162,16 +234,20 @@
label=
"省/市"
label=
"省/市"
prop=
"province"
prop=
"province"
>
>
<area-cascader
v-if=
"showAreaSelect"
type=
"text"
v-model=
"formModel.areaSelected"
:data=
"pca"
placeholder=
""
></area-cascader>
<area-cascader
v-if=
"showAreaSelect"
type=
"text"
v-model=
"formModel.areaSelected"
:data=
"pca"
placeholder=
""
></area-cascader>
</a-form-model-item>
</a-form-model-item>
<a-form-model-item
<a-form-model-item
label=
"地址"
label=
"地址"
prop=
"address"
prop=
"address"
>
>
<a-input
<a-input
v-model=
"formModel.address"
>
v-model=
"formModel.address"
>
</a-input>
</a-input>
</a-form-model-item>
</a-form-model-item>
</a-form-model>
</a-form-model>
...
@@ -181,239 +257,243 @@
...
@@ -181,239 +257,243 @@
</template>
</template>
<
script
>
<
script
>
import
{
fetchList
,
addObj
,
putObj
}
from
"@/api/biz/enterprise"
;
import
{
fetchList
,
addObj
,
putObj
}
from
'@/api/biz/enterprise'
import
{
disposereq
,
timestampToTime
,
timestampToymd
}
from
"@/utils/util"
;
import
{
disposereq
,
timestampToTime
}
from
'@/utils/util'
import
{
pca
,
pcaa
}
from
"area-data"
;
import
{
pca
,
pcaa
}
from
'area-data'
;
let
columns
=
[
let
columns
=
[
{
{
title
:
"企业名称"
,
title
:
'企业名称'
,
dataIndex
:
"name"
,
dataIndex
:
'name'
,
align
:
"center"
,
align
:
'center'
,
scopedSlots
:
{
customRender
:
"name"
},
scopedSlots
:
{
customRender
:
'name'
}
},
{
title
:
"管理员"
,
dataIndex
:
"adminName"
,
align
:
"center"
,
scopedSlots
:
{
customRender
:
"adminName"
},
},
{
title
:
"注册手机号"
,
dataIndex
:
"adminMobile"
,
align
:
"center"
,
},
{
title
:
"管理员状态"
,
dataIndex
:
"adminStatus"
,
align
:
"center"
,
scopedSlots
:
{
customRender
:
"adminStatus"
},
width
:
100
,
},
{
title
:
"成员人数"
,
dataIndex
:
"memberCount"
,
align
:
"center"
,
width
:
80
,
},
{
title
:
"最后登陆时间"
,
dataIndex
:
"lastLoginTime"
,
align
:
"center"
,
customRender
:
(
text
)
=>
{
return
text
?
timestampToTime
(
text
)
:
"-"
;
},
},
{
width
:
180
,
title
:
"管理员"
,
},
dataIndex
:
"adminName"
,
{
align
:
"center"
,
title
:
"操作"
,
scopedSlots
:
{
customRender
:
'adminName'
}
key
:
"action"
,
scopedSlots
:
{
customRender
:
"action"
},
align
:
"center"
,
width
:
90
,
},
];
export
default
{
data
()
{
return
{
columns
:
columns
,
data
:
[],
searchPage
:
{
pageIndex
:
1
,
pageSize
:
10
,
enterpriseName
:
""
,
adminMobile
:
""
,
},
pagination
:
{
showQuickJumper
:
true
,
showSizeChanger
:
true
,
},
loading
:
false
,
modalVisible
:
false
,
modalTitle
:
"添加"
,
modalType
:
"add"
,
formModel
:
{
id
:
""
,
name
:
""
,
logoUrl
:
""
,
adminMobile
:
""
,
adminNickName
:
""
,
adminName
:
""
,
province
:
""
,
city
:
""
,
address
:
""
,
areaSelected
:
[],
},
formRules
:
{
name
:
[{
required
:
true
,
message
:
"不能为空"
,
trigger
:
"blur"
}],
adminMobile
:
[
{
required
:
true
,
message
:
"不能为空"
,
trigger
:
"blur"
,
},
{
pattern
:
/^1
[
3456789
]\d{9}
$/
,
message
:
"手机号格式不正确"
,
trigger
:
"blur"
,
},
],
},
pca
,
showAreaSelect
:
true
,
};
},
// 创建完毕
created
()
{
this
.
getList
(
this
.
searchPage
);
},
// 即将更新渲染
beforeUpdate
()
{},
methods
:
{
getList
(
query
)
{
this
.
loading
=
true
;
fetchList
(
query
)
.
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
this
.
data
=
res
.
data
;
let
paper
=
{
...
this
.
pagination
};
paper
.
current
=
query
.
pageIndex
;
paper
.
total
=
res
.
count
;
this
.
pagination
=
paper
;
}
else
{
this
.
$message
.
info
(
res
.
resp_msg
);
}
this
.
loading
=
false
;
})
.
catch
((
err
)
=>
{
this
.
loading
=
false
;
disposereq
(
this
,
err
);
});
},
},
{
handleTableChange
()
{
title
:
"注册手机号"
,
let
queryParam
=
{
...
this
.
searchPage
};
dataIndex
:
"adminMobile"
,
queryParam
.
pageIndex
=
pagination
.
current
;
align
:
"center"
,
queryParam
.
pageSize
=
pagination
.
pageSize
;
this
.
getList
(
queryParam
);
},
},
{
handlSearch
()
{
title
:
"管理员状态"
,
let
queryParam
=
{
...
this
.
searchPage
};
dataIndex
:
"adminStatus"
,
this
.
getList
(
queryParam
);
align
:
"center"
,
scopedSlots
:
{
customRender
:
'adminStatus'
}
},
},
{
timestampToTime
,
title
:
'成员人数'
,
timestampToymd
,
dataIndex
:
'memberCount'
,
showModal
(
row
)
{
align
:
'center'
// console.log(this.formModel.areaSelected)
this
.
modalVisible
=
true
;
if
(
row
==
""
)
{
this
.
modalTitle
=
"添加"
;
this
.
modalType
=
"add"
;
}
else
{
this
.
modalTitle
=
"编辑"
;
this
.
modalType
=
"edit"
;
if
(
row
.
province
&&
row
.
city
)
{
row
.
areaSelected
=
[
row
.
province
,
row
.
city
];
}
this
.
formModel
=
{
...
row
};
}
},
},
{
saveData
()
{
title
:
'最后登陆时间'
,
if
(
this
.
modalType
==
"add"
)
{
dataIndex
:
'lastLoginTime'
,
let
data
=
{
...
this
.
formModel
};
align
:
'center'
,
if
(
data
.
areaSelected
.
length
>
0
)
{
customRender
:
(
text
)
=>
{
data
.
province
=
data
.
areaSelected
[
0
];
return
text
?
timestampToTime
(
text
)
:
'-'
data
.
city
=
data
.
areaSelected
[
1
];
}
addObj
(
data
)
.
then
((
res
)
=>
{
if
(
res
.
resp_code
==
200
)
{
this
.
$message
.
info
(
"保存成功"
);
this
.
getList
(
this
.
searchPage
);
this
.
closeModal
();
}
else
{
this
.
$message
.
info
(
res
.
resp_msg
);
}
})
.
catch
((
err
)
=>
{
disposereq
(
this
,
err
);
});
}
else
if
(
this
.
modalType
==
"edit"
)
{
let
data
=
{
...
this
.
formModel
};
if
(
data
.
areaSelected
.
length
>
0
)
{
data
.
province
=
data
.
areaSelected
[
0
];
data
.
city
=
data
.
areaSelected
[
1
];
}
}
putObj
(
data
)
.
then
((
res
)
=>
{
if
(
res
.
resp_code
==
200
)
{
this
.
$message
.
info
(
"保存成功"
);
this
.
getList
(
this
.
searchPage
);
this
.
closeModal
();
}
else
{
this
.
$message
.
info
(
res
.
resp_msg
);
}
})
.
catch
((
err
)
=>
{
disposereq
(
this
,
err
);
});
}
},
},
{
onConfirm
()
{
title
:
'操作'
,
this
.
$refs
.
formModelRef
.
validate
((
valid
)
=>
{
key
:
"action"
,
if
(
valid
)
{
scopedSlots
:
{
customRender
:
"action"
},
this
.
saveData
();
align
:
"center"
}
else
{
}
return
false
;
]
export
default
{
data
(){
return
{
columns
:
columns
,
data
:
[],
searchPage
:
{
pageIndex
:
1
,
pageSize
:
10
,
enterpriseName
:
''
,
adminMobile
:
''
},
pagination
:
{
showQuickJumper
:
true
,
showSizeChanger
:
true
},
loading
:
false
,
modalVisible
:
false
,
modalTitle
:
'添加'
,
modalType
:
'add'
,
formModel
:
{
id
:
''
,
name
:
''
,
logoUrl
:
''
,
adminMobile
:
''
,
adminNickName
:
''
,
adminName
:
''
,
province
:
''
,
city
:
''
,
address
:
''
,
areaSelected
:
[]
},
formRules
:
{
name
:
[
{
required
:
true
,
message
:
'不能为空'
,
trigger
:
'blur'
}
],
adminMobile
:
[
{
required
:
true
,
message
:
'不能为空'
,
trigger
:
'blur'
},
{
pattern
:
/^1
[
3456789
]\d{9}
$/
,
message
:
'手机号格式不正确'
,
trigger
:
'blur'
}
]
},
pca
,
showAreaSelect
:
true
}
}
});
},
},
// 创建完毕
onCancel
()
{
created
()
{
this
.
closeModal
();
this
.
getList
(
this
.
searchPage
);
},
},
// 即将更新渲染
closeModal
()
{
beforeUpdate
()
{
this
.
modalVisible
=
false
;
this
.
formModel
=
{
id
:
""
,
name
:
""
,
logoUrl
:
""
,
adminMobile
:
""
,
adminNickName
:
""
,
adminName
:
""
,
province
:
""
,
city
:
""
,
address
:
""
,
areaSelected
:
[],
};
this
.
resetAreaSelected
();
},
},
methods
:
{
resetAreaSelected
()
{
getList
(
query
){
this
.
showAreaSelect
=
false
;
this
.
loading
=
true
;
var
t
=
setTimeout
(()
=>
{
fetchList
(
query
).
then
(
res
=>
{
this
.
showAreaSelect
=
true
;
if
(
res
.
code
==
200
){
},
0
);
this
.
data
=
res
.
data
},
let
paper
=
{...
this
.
pagination
}
changeLogo
()
{
paper
.
current
=
query
.
pageIndex
console
.
log
(
"changeLogo click"
);
paper
.
total
=
res
.
count
},
this
.
pagination
=
paper
},
}
else
{
};
this
.
$message
.
info
(
res
.
resp_msg
)
}
this
.
loading
=
false
;
}).
catch
(
err
=>
{
this
.
loading
=
false
;
disposereq
(
this
,
err
)
})
},
handleTableChange
(){
let
queryParam
=
{...
this
.
searchPage
}
queryParam
.
pageIndex
=
pagination
.
current
queryParam
.
pageSize
=
pagination
.
pageSize
this
.
getList
(
queryParam
)
},
handlSearch
(){
let
queryParam
=
{...
this
.
searchPage
}
this
.
getList
(
queryParam
)
},
timestampToTime
,
showModal
(
row
){
// console.log(this.formModel.areaSelected)
this
.
modalVisible
=
true
if
(
row
==
''
){
this
.
modalTitle
=
'添加'
this
.
modalType
=
'add'
}
else
{
this
.
modalTitle
=
'编辑'
this
.
modalType
=
'edit'
if
(
row
.
province
&&
row
.
city
){
row
.
areaSelected
=
[
row
.
province
,
row
.
city
]
}
this
.
formModel
=
{...
row
}
}
},
saveData
(){
if
(
this
.
modalType
==
'add'
){
let
data
=
{...
this
.
formModel
}
if
(
data
.
areaSelected
.
length
>
0
){
data
.
province
=
data
.
areaSelected
[
0
]
data
.
city
=
data
.
areaSelected
[
1
]
}
addObj
(
data
).
then
(
res
=>
{
if
(
res
.
resp_code
==
200
){
this
.
$message
.
info
(
'保存成功'
)
this
.
getList
(
this
.
searchPage
)
this
.
closeModal
()
}
else
{
this
.
$message
.
info
(
res
.
resp_msg
)
}
}).
catch
(
err
=>
{
disposereq
(
this
,
err
)
})
}
else
if
(
this
.
modalType
==
'edit'
){
let
data
=
{...
this
.
formModel
}
if
(
data
.
areaSelected
.
length
>
0
){
data
.
province
=
data
.
areaSelected
[
0
]
data
.
city
=
data
.
areaSelected
[
1
]
}
putObj
(
data
).
then
(
res
=>
{
if
(
res
.
resp_code
==
200
){
this
.
$message
.
info
(
'保存成功'
)
this
.
getList
(
this
.
searchPage
)
this
.
closeModal
()
}
else
{
this
.
$message
.
info
(
res
.
resp_msg
)
}
}).
catch
(
err
=>
{
disposereq
(
this
,
err
)
})
}
},
onConfirm
(){
this
.
$refs
.
formModelRef
.
validate
(
valid
=>
{
if
(
valid
){
this
.
saveData
()
}
else
{
return
false
}
})
},
onCancel
(){
this
.
closeModal
()
},
closeModal
(){
this
.
modalVisible
=
false
this
.
formModel
=
{
id
:
''
,
name
:
''
,
logoUrl
:
''
,
adminMobile
:
''
,
adminNickName
:
''
,
adminName
:
''
,
province
:
''
,
city
:
''
,
address
:
''
,
areaSelected
:
[]
}
this
.
resetAreaSelected
()
},
resetAreaSelected
(){
this
.
showAreaSelect
=
false
var
t
=
setTimeout
(()
=>
{
this
.
showAreaSelect
=
true
},
0
);
},
changeLogo
(){
console
.
log
(
'changeLogo click'
)
}
}
}
</
script
>
</
script
>
<
style
>
<
style
>
.template_content
{
.template_content
{
...
@@ -441,7 +521,7 @@ export default {
...
@@ -441,7 +521,7 @@ export default {
margin
:
0px
5px
;
margin
:
0px
5px
;
}
}
.area-select
.area-selected-trigger
{
.area-select
.area-selected-trigger
{
padding
:
0px
0px
0px
0px
;
padding
:
0px
0px
0px
0px
;
margin
:
0px
0px
0px
10px
;
margin
:
0px
0px
0px
10px
;
}
}
</
style
>
</
style
>
\ No newline at end of file
src/views/biz/institution/index.vue
View file @
f33c4049
...
@@ -37,18 +37,16 @@
...
@@ -37,18 +37,16 @@
<!-- 表格操作 -->
<!-- 表格操作 -->
<template
slot=
"action"
slot-scope=
"text,record"
>
<template
slot=
"action"
slot-scope=
"text,record"
>
<a-button
<a-button
type=
"
primary
"
type=
"
link
"
icon=
"edit"
icon=
"edit"
@
click=
"showModal(record)"
@
click=
"showModal(record)"
class=
"btn_margin"
>
>
修改
修改
</a-button>
</a-button>
<a-button
<a-button
type=
"danger"
icon=
"delete"
icon=
"delete"
@
click=
"deleteRow(record)"
@
click=
"deleteRow(record)"
class=
"btn_margin
"
type=
"link
"
>
>
删除
删除
</a-button>
</a-button>
...
@@ -130,7 +128,8 @@ let columns = [
...
@@ -130,7 +128,8 @@ let columns = [
title
:
'操作'
,
title
:
'操作'
,
key
:
"action"
,
key
:
"action"
,
scopedSlots
:
{
customRender
:
"action"
},
scopedSlots
:
{
customRender
:
"action"
},
align
:
"center"
align
:
"center"
,
width
:
180
,
}
}
]
]
...
...
src/views/biz/priceConfig/index.vue
View file @
f33c4049
<
template
>
<
template
>
<div>
<div
class=
"price-config-container"
>
<a-form-model
<a-form-model
:model=
"formModel"
:model=
"formModel"
:label-col=
"
{span:4}"
:label-col=
"
{span:4}"
...
@@ -168,5 +168,7 @@ export default {
...
@@ -168,5 +168,7 @@ export default {
}
}
</
script
>
</
script
>
<
style
>
<
style
>
.price-config-container
{
margin
:
10px
;
}
</
style
>
</
style
>
\ No newline at end of file
src/views/biz/teacher/index.vue
View file @
f33c4049
...
@@ -40,18 +40,18 @@
...
@@ -40,18 +40,18 @@
<!-- 表格操作 -->
<!-- 表格操作 -->
<template
slot=
"action"
slot-scope=
"text,record"
>
<template
slot=
"action"
slot-scope=
"text,record"
>
<a-button
<a-button
type=
"primary"
icon=
"edit"
icon=
"edit"
@
click=
"showModal(record)"
@
click=
"showModal(record)"
class=
"btn_margin
"
type=
"link
"
>
>
修改
修改
</a-button>
</a-button>
<a-button
<a-button
type=
"danger"
icon=
"delete"
icon=
"delete"
@
click=
"deleteRow(record)"
@
click=
"deleteRow(record)"
class=
"btn_margin
"
type=
"link
"
>
>
删除
删除
</a-button>
</a-button>
...
@@ -139,7 +139,8 @@ let columns = [
...
@@ -139,7 +139,8 @@ let columns = [
{
{
title
:
"讲师编号"
,
title
:
"讲师编号"
,
dataIndex
:
"code"
,
dataIndex
:
"code"
,
align
:
"center"
align
:
"center"
,
width
:
120
,
},
},
{
{
title
:
"讲师名称"
,
title
:
"讲师名称"
,
...
@@ -165,13 +166,15 @@ let columns = [
...
@@ -165,13 +166,15 @@ let columns = [
{
{
title
:
"课程数"
,
title
:
"课程数"
,
dataIndex
:
"courseCount"
,
dataIndex
:
"courseCount"
,
align
:
"center"
align
:
"center"
,
width
:
80
,
},
},
{
{
title
:
'操作'
,
title
:
'操作'
,
key
:
"action"
,
key
:
"action"
,
scopedSlots
:
{
customRender
:
"action"
},
scopedSlots
:
{
customRender
:
"action"
},
align
:
"center"
align
:
"center"
,
width
:
180
,
}
}
]
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment