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
c1f5f17c
Commit
c1f5f17c
authored
Jul 14, 2021
by
陈浩玮
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 'feature/chw'
# Conflicts: # src/router/config.js
parents
6aad0cad
4ee60ff3
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
314 additions
and
1 deletion
+314
-1
src/api/ranger.js
src/api/ranger.js
+19
-0
src/pages/oceanus/equipment/Left/OrganizationTree.vue
src/pages/oceanus/equipment/Left/OrganizationTree.vue
+2
-1
src/pages/ranger/basic/major/add_edit.vue
src/pages/ranger/basic/major/add_edit.vue
+67
-0
src/pages/ranger/basic/major/add_member.vue
src/pages/ranger/basic/major/add_member.vue
+80
-0
src/pages/ranger/basic/major/index.js
src/pages/ranger/basic/major/index.js
+3
-0
src/pages/ranger/basic/major/index.vue
src/pages/ranger/basic/major/index.vue
+73
-0
src/pages/ranger/basic/major/member.vue
src/pages/ranger/basic/major/member.vue
+63
-0
src/router/config.js
src/router/config.js
+7
-0
No files found.
src/api/ranger.js
View file @
c1f5f17c
...
...
@@ -70,3 +70,22 @@ export function getExemptionApi(id) {
export
function
updateExemptionApi
(
data
)
{
return
putReq
(
`/ranger/inspection/api/v1/exemptions`
,
data
);
}
export
function
addMajorApi
(
data
)
{
return
postReq
(
`/ranger/inspection/api/v1/specialities`
,
data
);
}
export
function
updateMajorApi
(
data
)
{
return
putReq
(
'
/ranger/inspection/api/v1/specialities
'
,
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 @
c1f5f17c
...
...
@@ -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_edit.vue
0 → 100644
View file @
c1f5f17c
<
template
>
<Wraper
:hidden=
"hidden"
:onOk=
"submit"
:refresh=
"refresh"
:noFooter=
"isView"
>
<a-form-model
layout=
"vertical"
:model=
"form"
:rules=
"rules"
ref=
"form"
>
<a-form-model-item
label=
"专业名称"
prop=
"specialityName"
>
<a-input
v-model=
"form.specialityName"
:disabled=
"isView"
/>
</a-form-model-item>
<a-form-model-item
label=
"所属地区"
prop=
"regionId"
>
<UrlSelect
url=
"/ranger/inspection/api/v1/region/list"
v-model=
"form.regionId"
labelFiled=
"regionName"
valueFiled=
"regionId"
:disabled=
"isView"
/>
</a-form-model-item>
<a-form-model-item
label=
"备注"
prop=
"remark"
>
<a-textarea
placeholder=
"Basic usage"
:rows=
"4"
v-model=
"form.remark"
:disabled=
"isView"
/>
</a-form-model-item>
</a-form-model>
</Wraper>
</
template
>
<
script
>
import
Wraper
from
'
@/components/table/wraper.vue
'
;
import
UrlSelect
from
'
@/components/MySelect/url_select.vue
'
;
import
{
addMajorApi
,
updateMajorApi
,
getMajorInfoApi
}
from
'
@/api
'
;
export
default
{
components
:
{
Wraper
,
UrlSelect
},
props
:
{
hidden
:
Function
,
row
:
Object
,
type
:
String
,
refresh
:
Function
},
data
:
()
=>
({
form
:
{},
rules
:
{
specialityName
:
[{
required
:
true
}],
regionId
:
[{
required
:
true
}],
},
}),
computed
:
{
isView
()
{
return
this
.
type
===
'
view
'
;
},
isEdit
()
{
return
this
.
type
===
'
edit
'
;
},
isAdd
()
{
return
this
.
type
===
null
;
},
},
async
mounted
()
{
if
(
!
this
.
isAdd
)
{
this
.
form
=
await
getMajorInfoApi
(
this
.
row
.
specialityId
);
}
},
methods
:
{
async
submit
()
{
await
this
.
$refs
.
form
.
validate
();
if
(
this
.
isAdd
)
return
addMajorApi
(
this
.
form
);
if
(
this
.
isEdit
)
return
updateMajorApi
(
this
.
form
);
},
},
};
</
script
>
src/pages/ranger/basic/major/add_member.vue
0 → 100644
View file @
c1f5f17c
<
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.js
0 → 100644
View file @
c1f5f17c
import
Index
from
'
./index.vue
'
;
export
default
Index
;
src/pages/ranger/basic/major/index.vue
0 → 100644
View file @
c1f5f17c
<
template
>
<Table
url=
"/ranger/inspection/api/v1/specialities"
rowKey=
"specialityId"
addBtn
:buttons=
"buttons"
ref=
"table"
>
<template
#search
="
{ query }">
<MoreItem
label=
"地区"
>
<UrlSelect
url=
"/ranger/inspection/api/v1/region/list"
v-model=
"query.regionId"
labelFiled=
"regionName"
valueFiled=
"regionId"
/>
</MoreItem>
<MoreItem
label=
"专业名称"
>
<a-input
v-model=
"query.specialityName"
/>
</MoreItem>
</
template
>
<
template
#drawer=
"drawer"
>
<Member
v-if=
"drawer.type === 'member'"
v-bind=
"drawer"
/>
<AddAndEdit
v-bind=
"drawer"
v-else
/>
</
template
>
<a-table-column
title=
"专业名称"
data-index=
"specialityName"
/>
<a-table-column
title=
"所属地区"
data-index=
"regionName"
/>
<a-table-column
title=
"修改人"
data-index=
"editorName"
/>
<a-table-column
title=
"修改时间"
data-index=
"editTime"
/>
</Table>
</template>
<
script
>
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
,
Member
},
data
()
{
return
{
buttons
:
[
{
label
:
'
编辑
'
,
click
:
this
.
edit
},
{
label
:
'
详情
'
,
click
:
this
.
view
},
{
label
:
'
人员
'
,
click
:
this
.
showMember
},
{
type
:
'
confirm
'
,
url
:
(
row
)
=>
`/ranger/inspection/api/v1/specialities/
${
row
.
specialityId
}
`
,
after
:
this
.
refresh
,
},
],
};
},
methods
:
{
refresh
()
{
this
.
$refs
.
table
.
getData
();
},
edit
(
row
)
{
this
.
$refs
.
table
.
show
({
row
,
title
:
'
编辑
'
,
type
:
'
edit
'
});
},
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 @
c1f5f17c
<
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
>
src/router/config.js
View file @
c1f5f17c
...
...
@@ -81,6 +81,13 @@ const hasAuthorityRoutes = [
component
:
()
=>
import
(
'
@/pages/ranger/basic/unit
'
),
},
{
path
:
'
major
'
,
name
:
'
专业配置
'
,
component
:
()
=>
import
(
'
@/pages/ranger/basic/major
'
),
},
{
path
:
'
item
'
,
name
:
'
项目配置
'
,
component
:
()
=>
import
(
'
@/pages/ranger/basic/item
'
),
...
...
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