Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
Starter Web Vue
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
product
kim3-web-vue
Starter Web Vue
Commits
be882268
Commit
be882268
authored
Jul 14, 2021
by
水落(YangLei)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 人员管理完成
parent
27fb1103
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
161 additions
and
4 deletions
+161
-4
src/api/ranger.js
src/api/ranger.js
+8
-0
src/pages/oceanus/equipment/Left/OrganizationTree.vue
src/pages/oceanus/equipment/Left/OrganizationTree.vue
+2
-1
src/pages/ranger/basic/major/add_member.vue
src/pages/ranger/basic/major/add_member.vue
+80
-0
src/pages/ranger/basic/major/index.vue
src/pages/ranger/basic/major/index.vue
+8
-3
src/pages/ranger/basic/major/member.vue
src/pages/ranger/basic/major/member.vue
+63
-0
No files found.
src/api/ranger.js
View file @
be882268
...
...
@@ -70,3 +70,11 @@ export function updateMajorApi(data) {
export
function
getMajorInfoApi
(
id
)
{
return
getReq
(
`/ranger/inspection/api/v1/specialities/
${
id
}
`
);
}
export
function
getOrganizationUserApi
(
id
)
{
return
getReq
(
`/api/v1/users/organizations/
${
id
}
`
);
}
export
function
addSpecialitiesStaffsApi
(
data
)
{
return
postReq
(
`/ranger/inspection/api/v1/specialities/staffs`
,
data
);
}
src/pages/oceanus/equipment/Left/OrganizationTree.vue
View file @
be882268
...
...
@@ -12,10 +12,11 @@
@change="onChange"
/>
</
template
>
<!-- v-on="$listeners" -->
<
script
>
import
api
from
'
@/api/organization
'
;
import
{
arrayToTree
}
from
'
@/utils
'
;
export
default
{
model
:
{
prop
:
'
value
'
,
...
...
src/pages/ranger/basic/major/add_member.vue
0 → 100644
View file @
be882268
<
template
>
<Wraper
:hidden=
"hidden"
:onOk=
"submit"
:refresh=
"refresh"
>
<OrganizationTree
v-model=
"value"
style=
"margin-bottom: 10px"
@
change=
"organizationChange"
/>
<a-table
:data-source=
"data"
:row-selection=
"rowSelection"
:pagination=
"false"
rowKey=
"userId"
:loading=
"loading"
>
<a-table-column
title=
"姓名"
data-index=
"userName"
/>
</a-table>
</Wraper>
</
template
>
<
script
>
import
Wraper
from
'
@/components/table/wraper.vue
'
;
import
OrganizationTree
from
'
@/pages/oceanus/equipment/Left/OrganizationTree.vue
'
;
import
{
getOrganizationUserApi
,
addSpecialitiesStaffsApi
}
from
'
@/api
'
;
export
default
{
components
:
{
Wraper
,
OrganizationTree
},
props
:
{
hidden
:
Function
,
row
:
Object
,
specialityId
:
Number
,
refresh
:
Function
,
},
data
()
{
return
{
value
:
undefined
,
loading
:
false
,
data
:
[],
form
:
{
specialityId
:
this
.
specialityId
,
staffOrgCommands
:
[],
},
selectedRowKeys
:
[],
};
},
computed
:
{
rowSelection
()
{
const
{
selectedRowKeys
,
onSelectChange
}
=
this
;
return
{
selectedRowKeys
,
onChange
:
onSelectChange
,
};
},
},
methods
:
{
submit
()
{
this
.
form
.
staffOrgCommands
=
this
.
selectedRowKeys
.
map
((
staffId
)
=>
({
orgId
:
this
.
value
,
staffId
,
}));
return
addSpecialitiesStaffsApi
(
this
.
form
);
},
onSelectChange
(
selectedRowKeys
)
{
this
.
selectedRowKeys
=
selectedRowKeys
;
},
async
organizationChange
(
val
)
{
this
.
loading
=
true
;
this
.
data
=
await
this
.
getTableData
(
val
);
this
.
loading
=
false
;
},
getTableData
(
id
)
{
return
getOrganizationUserApi
(
id
);
},
},
};
</
script
>
src/pages/ranger/basic/major/index.vue
View file @
be882268
...
...
@@ -21,7 +21,8 @@
</
template
>
<
template
#drawer=
"drawer"
>
<AddAndEdit
v-bind=
"drawer"
/>
<Member
v-if=
"drawer.type === 'member'"
v-bind=
"drawer"
/>
<AddAndEdit
v-bind=
"drawer"
v-else
/>
</
template
>
<a-table-column
title=
"专业名称"
data-index=
"specialityName"
/>
...
...
@@ -36,15 +37,16 @@ import Table from '@/components/table/table.vue';
import
UrlSelect
from
'
@/components/MySelect/url_select.vue
'
;
import
MoreItem
from
'
@/components/table/more_item.vue
'
;
import
AddAndEdit
from
'
./add_edit.vue
'
;
import
Member
from
'
./member.vue
'
;
export
default
{
components
:
{
Table
,
UrlSelect
,
MoreItem
,
AddAndEdit
},
components
:
{
Table
,
UrlSelect
,
MoreItem
,
AddAndEdit
,
Member
},
data
()
{
return
{
buttons
:
[
{
label
:
'
编辑
'
,
click
:
this
.
edit
},
{
label
:
'
详情
'
,
click
:
this
.
view
},
{
label
:
'
人员
'
,
click
:
this
.
view
},
{
label
:
'
人员
'
,
click
:
this
.
showMember
},
{
type
:
'
confirm
'
,
url
:
(
row
)
=>
`/ranger/inspection/api/v1/specialities/
${
row
.
specialityId
}
`
,
...
...
@@ -63,6 +65,9 @@ export default {
view
(
row
)
{
this
.
$refs
.
table
.
show
({
row
,
title
:
'
详情
'
,
type
:
'
view
'
});
},
showMember
(
row
)
{
this
.
$refs
.
table
.
show
({
row
,
title
:
'
人员
'
,
type
:
'
member
'
});
},
},
};
</
script
>
src/pages/ranger/basic/major/member.vue
0 → 100644
View file @
be882268
<
template
>
<Wraper
:hidden=
"hidden"
noFooter
>
<Table
:url=
"tableUrl"
rowKey=
"staffId"
noPadding
:addBtn=
"addBtn"
:buttons=
"buttons"
:width=
"400"
ref=
"table"
>
<template
#drawer
="
drawer
"
>
<AddMember
v-bind=
"drawer"
:specialityId=
"row.specialityId"
/>
</
template
>
<a-table-column
title=
"部门"
data-index=
"orgName"
/>
<a-table-column
title=
"用户姓名"
data-index=
"staffName"
/>
</Table>
</Wraper>
</template>
<
script
>
import
Wraper
from
'
@/components/table/wraper.vue
'
;
import
Table
from
'
@/components/table/table.vue
'
;
import
AddMember
from
'
./add_member.vue
'
;
export
default
{
components
:
{
Wraper
,
Table
,
AddMember
},
props
:
{
hidden
:
Function
,
row
:
Object
,
},
data
()
{
return
{
addBtn
:
{
text
:
'
添加
'
,
title
:
'
添加
'
,
},
buttons
:
[
{
type
:
'
confirm
'
,
url
:
(
row
)
=>
({
url
:
`/ranger/inspection/api/v1/specialities/staffs`
,
method
:
'
del
'
,
data
:
{
staffBindIds
:
[
row
.
staffBindId
]
},
}),
after
:
this
.
refreshTable
,
},
],
};
},
computed
:
{
tableUrl
()
{
return
`/ranger/inspection/api/v1/specialities/staffs?specialityId=
${
this
.
row
.
specialityId
}
`
;
},
},
methods
:
{
refreshTable
()
{
this
.
$refs
[
'
table
'
].
getData
();
},
},
};
</
script
>
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