Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
school-paper-admin-front
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
school-paper
school-paper-admin-front
Commits
2fdf726b
Commit
2fdf726b
authored
Jul 21, 2023
by
yushien
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善用户信息 班级资料
parent
65ee652e
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
39 deletions
+42
-39
src/views/system/dept/index.vue
+39
-37
src/views/system/menu/index.vue
+1
-0
src/views/system/user/index.vue
+0
-0
vue.config.js
+2
-2
No files found.
src/views/system/dept/index.vue
View file @
2fdf726b
<
template
>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
>
<el-form-item
label=
"
部门
名称"
prop=
"deptName"
>
<el-form-item
label=
"
班级
名称"
prop=
"deptName"
>
<el-input
v-model=
"queryParams.deptName"
placeholder=
"请输入
部门
名称"
placeholder=
"请输入
班级
名称"
clearable
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item
label=
"状态"
prop=
"status"
>
<el-select
v-model=
"queryParams.status"
placeholder=
"
部门
状态"
clearable
>
<!--
<el-form-item
label=
"状态"
prop=
"status"
>
<el-select
v-model=
"queryParams.status"
placeholder=
"
班级
状态"
clearable
>
<el-option
v-for=
"dict in dict.type.sys_normal_disable"
:key=
"dict.value"
...
...
@@ -18,7 +18,7 @@
:value=
"dict.value"
/>
</el-select>
</el-form-item>
</el-form-item>
-->
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
...
...
@@ -56,13 +56,13 @@
:default-expand-all=
"isExpandAll"
:tree-props=
"
{children: 'children', hasChildren: 'hasChildren'}"
>
<el-table-column
prop=
"deptName"
label=
"
部门
名称"
width=
"260"
></el-table-column>
<el-table-column
prop=
"deptName"
label=
"
班级
名称"
width=
"260"
></el-table-column>
<el-table-column
prop=
"orderNum"
label=
"排序"
width=
"200"
></el-table-column>
<el-table-column
prop=
"status"
label=
"状态"
width=
"100"
>
<!--
<el-table-column
prop=
"status"
label=
"状态"
width=
"100"
>
<template
slot-scope=
"scope"
>
<dict-tag
:options=
"dict.type.sys_normal_disable"
:value=
"scope.row.status"
/>
</
template
>
</el-table-column>
</el-table-column>
-->
<el-table-column
label=
"创建时间"
align=
"center"
prop=
"createTime"
width=
"200"
>
<
template
slot-scope=
"scope"
>
<span>
{{
parseTime
(
scope
.
row
.
createTime
)
}}
</span>
...
...
@@ -78,6 +78,7 @@
v-hasPermi=
"['system:dept:edit']"
>
修改
</el-button>
<el-button
v-if=
"scope.row.parentId == 0"
size=
"mini"
type=
"text"
icon=
"el-icon-plus"
...
...
@@ -85,7 +86,6 @@
v-hasPermi=
"['system:dept:add']"
>
新增
</el-button>
<el-button
v-if=
"scope.row.parentId != 0"
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
...
...
@@ -96,20 +96,20 @@
</el-table-column>
</el-table>
<!-- 添加或修改
部门
对话框 -->
<!-- 添加或修改
班级
对话框 -->
<el-dialog
:title=
"title"
:visible
.
sync=
"open"
width=
"600px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-row>
<el-col
:span=
"24"
v-if=
"form.parentId !== 0"
>
<el-form-item
label=
"
上级部门
"
prop=
"parentId"
>
<treeselect
v-model=
"form.parentId"
:options=
"deptOptions"
:normalizer=
"normalizer"
placeholder=
"选择上级部门
"
/>
<el-col
:span=
"24"
>
<el-form-item
label=
"
阶段
"
prop=
"parentId"
>
<treeselect
v-model=
"form.parentId"
:options=
"deptOptions"
:normalizer=
"normalizer"
:show-count=
"true"
placeholder=
"选择上级阶段
"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"
部门
名称"
prop=
"deptName"
>
<el-input
v-model=
"form.deptName"
placeholder=
"请输入
部门
名称"
/>
<el-form-item
label=
"
班级
名称"
prop=
"deptName"
>
<el-input
v-model=
"form.deptName"
placeholder=
"请输入
班级
名称"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
...
...
@@ -120,24 +120,24 @@
</el-row>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"负责人"
prop=
"leader"
>
<el-form-item
label=
"负责人"
prop=
"leader"
style=
"display: none"
>
<el-input
v-model=
"form.leader"
placeholder=
"请输入负责人"
maxlength=
"20"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"联系电话"
prop=
"phone"
>
<el-form-item
label=
"联系电话"
prop=
"phone"
style=
"display: none"
>
<el-input
v-model=
"form.phone"
placeholder=
"请输入联系电话"
maxlength=
"11"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"邮箱"
prop=
"email"
>
<el-form-item
label=
"邮箱"
prop=
"email"
style=
"display: none"
>
<el-input
v-model=
"form.email"
placeholder=
"请输入邮箱"
maxlength=
"50"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"
部门状态
"
>
<el-form-item
label=
"
班级状态"
style=
"display: none
"
>
<el-radio-group
v-model=
"form.status"
>
<el-radio
v-for=
"dict in dict.type.sys_normal_disable"
...
...
@@ -174,7 +174,7 @@ export default {
showSearch
:
true
,
// 表格树数据
deptList
:
[],
//
部门
树选项
//
班级
树选项
deptOptions
:
[],
// 弹出层标题
title
:
""
,
...
...
@@ -194,10 +194,10 @@ export default {
// 表单校验
rules
:
{
parentId
:
[
{
required
:
true
,
message
:
"上级
部门
不能为空"
,
trigger
:
"blur"
}
{
required
:
true
,
message
:
"上级
班级
不能为空"
,
trigger
:
"blur"
}
],
deptName
:
[
{
required
:
true
,
message
:
"
部门
名称不能为空"
,
trigger
:
"blur"
}
{
required
:
true
,
message
:
"
班级
名称不能为空"
,
trigger
:
"blur"
}
],
orderNum
:
[
{
required
:
true
,
message
:
"显示排序不能为空"
,
trigger
:
"blur"
}
...
...
@@ -223,7 +223,17 @@ export default {
this
.
getList
();
},
methods
:
{
/** 查询部门列表 */
/** 查询菜单下拉树结构 */
getTreeselect
()
{
listDept
().
then
(
response
=>
{
this
.
deptOptions
=
[];
const
dept
=
{
deptId
:
0
,
deptName
:
'主类目'
,
children
:
[]
};
dept
.
children
=
this
.
handleTree
(
response
.
data
,
"deptId"
);
this
.
deptOptions
.
push
(
dept
);
});
console
.
log
(
this
.
deptOptions
,
'this.deptOptions '
)
},
/** 查询班级列表 */
getList
()
{
this
.
loading
=
true
;
listDept
(
this
.
queryParams
).
then
(
response
=>
{
...
...
@@ -231,7 +241,7 @@ export default {
this
.
loading
=
false
;
});
},
/** 转换
部门
数据结构 */
/** 转换
班级
数据结构 */
normalizer
(
node
)
{
if
(
node
.
children
&&
!
node
.
children
.
length
)
{
delete
node
.
children
;
...
...
@@ -253,7 +263,7 @@ export default {
deptId
:
undefined
,
parentId
:
undefined
,
deptName
:
undefined
,
orderNum
:
undefined
,
orderNum
:
0
,
leader
:
undefined
,
phone
:
undefined
,
email
:
undefined
,
...
...
@@ -277,10 +287,8 @@ export default {
this
.
form
.
parentId
=
row
.
deptId
;
}
this
.
open
=
true
;
this
.
title
=
"添加部门"
;
listDept
().
then
(
response
=>
{
this
.
deptOptions
=
this
.
handleTree
(
response
.
data
,
"deptId"
);
});
this
.
title
=
"添加班级"
;
this
.
getTreeselect
();
},
/** 展开/折叠操作 */
toggleExpandAll
()
{
...
...
@@ -296,14 +304,8 @@ export default {
getDept
(
row
.
deptId
).
then
(
response
=>
{
this
.
form
=
response
.
data
;
this
.
open
=
true
;
this
.
title
=
"修改部门"
;
listDeptExcludeChild
(
row
.
deptId
).
then
(
response
=>
{
this
.
deptOptions
=
this
.
handleTree
(
response
.
data
,
"deptId"
);
if
(
this
.
deptOptions
.
length
==
0
)
{
const
noResultsOptions
=
{
deptId
:
this
.
form
.
parentId
,
deptName
:
this
.
form
.
parentName
,
children
:
[]
};
this
.
deptOptions
.
push
(
noResultsOptions
);
}
});
this
.
title
=
"修改班级"
;
this
.
getTreeselect
();
});
},
/** 提交按钮 */
...
...
src/views/system/menu/index.vue
View file @
2fdf726b
...
...
@@ -335,6 +335,7 @@ export default {
getList
()
{
this
.
loading
=
true
;
listMenu
(
this
.
queryParams
).
then
(
response
=>
{
this
.
menuList
=
this
.
handleTree
(
response
.
data
,
"menuId"
);
this
.
loading
=
false
;
});
...
...
src/views/system/user/index.vue
View file @
2fdf726b
This diff is collapsed.
Click to expand it.
vue.config.js
View file @
2fdf726b
...
...
@@ -35,8 +35,8 @@ module.exports = {
proxy
:
{
// detail: https://cli.vuejs.org/config/#devserver-proxy
[
process
.
env
.
VUE_APP_BASE_API
]:
{
target
:
`https://farming.nyinhong.com/api`
,
// target: `http://192.168.0.169
`,
/* target: `https://farming.nyinhong.com/api`,*/
target
:
`http://127.0.0.1:8111
`
,
changeOrigin
:
true
,
pathRewrite
:
{
[
'^'
+
process
.
env
.
VUE_APP_BASE_API
]:
''
...
...
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