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
27fb1103
Commit
27fb1103
authored
Jul 13, 2021
by
水落(YangLei)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 专业配置部分功能完成
parent
2d384b6b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
154 additions
and
0 deletions
+154
-0
src/api/ranger.js
src/api/ranger.js
+11
-0
src/pages/ranger/basic/major/add_edit.vue
src/pages/ranger/basic/major/add_edit.vue
+67
-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
+68
-0
src/router/config.js
src/router/config.js
+5
-0
No files found.
src/api/ranger.js
View file @
27fb1103
...
...
@@ -59,3 +59,14 @@ 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
}
`
);
}
src/pages/ranger/basic/major/add_edit.vue
0 → 100644
View file @
27fb1103
<
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/index.js
0 → 100644
View file @
27fb1103
import
Index
from
'
./index.vue
'
;
export
default
Index
;
src/pages/ranger/basic/major/index.vue
0 → 100644
View file @
27fb1103
<
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"
>
<AddAndEdit
v-bind=
"drawer"
/>
</
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
'
;
export
default
{
components
:
{
Table
,
UrlSelect
,
MoreItem
,
AddAndEdit
},
data
()
{
return
{
buttons
:
[
{
label
:
'
编辑
'
,
click
:
this
.
edit
},
{
label
:
'
详情
'
,
click
:
this
.
view
},
{
label
:
'
人员
'
,
click
:
this
.
view
},
{
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
'
});
},
},
};
</
script
>
src/router/config.js
View file @
27fb1103
...
...
@@ -80,6 +80,11 @@ const hasAuthorityRoutes = [
name
:
'
单元配置
'
,
component
:
()
=>
import
(
'
@/pages/ranger/basic/unit
'
),
},
{
path
:
'
major
'
,
name
:
'
专业配置
'
,
component
:
()
=>
import
(
'
@/pages/ranger/basic/major
'
),
},
{
path
:
'
exemption
'
,
name
:
'
免检配置
'
,
...
...
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