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
c58037a4
Commit
c58037a4
authored
Jul 13, 2021
by
陈浩玮
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 'feature/chw'
# Conflicts: # src/api/ranger.js # src/router/config.js
parents
120737c3
2d384b6b
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
259 additions
and
3 deletions
+259
-3
src/api/ranger.js
src/api/ranger.js
+12
-0
src/components/MySelect/range_time_select.vue
src/components/MySelect/range_time_select.vue
+32
-0
src/components/table/table.vue
src/components/table/table.vue
+6
-2
src/pages/ranger/basic/exemption/add_edit.vue
src/pages/ranger/basic/exemption/add_edit.vue
+98
-0
src/pages/ranger/basic/exemption/index.js
src/pages/ranger/basic/exemption/index.js
+3
-0
src/pages/ranger/basic/exemption/index.vue
src/pages/ranger/basic/exemption/index.vue
+101
-0
src/router/config.js
src/router/config.js
+7
-1
No files found.
src/api/ranger.js
View file @
c58037a4
...
...
@@ -48,6 +48,7 @@ export function getUnitInfoApi(id) {
return
getReq
(
`/ranger/inspection/api/v1/units/
${
id
}
`
);
}
<<<<<<<
src
/
api
/
ranger
.
js
export
function
getItemsInfoApi
(
id
)
{
return
getReq
(
`/ranger/inspection/api/v1/items/
${
id
}
`
);
}
...
...
@@ -59,3 +60,14 @@ export function addItemsApi(data) {
export
function
editItemsApi
(
data
)
{
return
putReq
(
'
/ranger/inspection/api/v1/items
'
,
data
);
}
export
function
addExemptionApi
(
data
)
{
return
postReq
(
'
/ranger/inspection/api/v1/exemptions
'
,
data
);
}
export
function
getExemptionApi
(
id
)
{
return
getReq
(
`ranger/inspection/api/v1/exemptions/
${
id
}
`
);
}
export
function
updateExemptionApi
(
data
)
{
return
putReq
(
`/ranger/inspection/api/v1/exemptions`
,
data
);
}
src/components/MySelect/range_time_select.vue
0 → 100644
View file @
c58037a4
<
template
>
<a-range-picker
@
change=
"onChange"
style=
"width: 100%"
:showTime=
"showTime"
:value=
"value"
v-bind=
"$attrs"
/>
</
template
>
<
script
>
import
moment
from
'
moment
'
;
export
default
{
props
:
{
startTime
:
String
,
endTime
:
String
,
showTime
:
Boolean
,
},
computed
:
{
value
()
{
return
this
.
startTime
?
[
moment
(
this
.
startTime
),
moment
(
this
.
endTime
)]
:
[];
},
},
methods
:
{
onChange
(
val
,
[
startTimeString
,
endTimeString
])
{
this
.
$emit
(
'
update:startTime
'
,
startTimeString
);
this
.
$emit
(
'
update:endTime
'
,
endTimeString
);
},
},
};
</
script
>
src/components/table/table.vue
View file @
c58037a4
...
...
@@ -100,6 +100,10 @@ export default {
noPadding
:
Boolean
,
scroll
:
Object
,
width
:
{
type
:
Number
,
default
:
900
},
defaultQuery
:
{
type
:
Object
,
default
:
()
=>
({}),
},
},
data
()
{
...
...
@@ -109,7 +113,7 @@ export default {
...
initQuery
,
},
data
:
[],
queryForm
:
{},
queryForm
:
{
...
this
.
defaultQuery
},
loading
:
false
,
total
:
0
,
visible
:
false
,
...
...
@@ -208,7 +212,7 @@ export default {
},
reset
()
{
this
.
queryForm
=
{};
this
.
queryForm
=
{
...
this
.
defaultQuery
};
this
.
initQuery
=
{
...
initQuery
};
this
.
getData
();
},
...
...
src/pages/ranger/basic/exemption/add_edit.vue
0 → 100644
View file @
c58037a4
<
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=
"exemptionType"
>
<a-select
class=
"tw-w-full"
v-model=
"form.exemptionType"
:disabled=
"isView"
>
<a-select-option
value=
"PLACE"
>
地点免检
</a-select-option>
<a-select-option
value=
"UNIT"
>
单元免检
</a-select-option>
</a-select>
</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=
"placeId"
>
<UrlSelect
v-model=
"form.placeId"
:url=
"
form.regionId ? `/ranger/inspection/api/v1/place/regions/$
{form.regionId}/list` : ''
"
labelFiled="placeName"
valueFiled="placeId"
:disabled="isView"
/>
</a-form-model-item>
<a-form-model-item
label=
"时间"
prop=
"startTime"
>
<RangeTime
:startTime.sync=
"form.startTime"
:endTime.sync=
"form.endTime"
showTime
:disabled=
"isView"
/>
</a-form-model-item>
<a-form-model-item
label=
"免检原因"
prop=
"exemptionReason"
>
<a-textarea
placeholder=
"Basic usage"
:rows=
"4"
v-model=
"form.exemptionReason"
: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
RangeTime
from
'
@/components/MySelect/range_time_select.vue
'
;
import
{
addExemptionApi
,
updateExemptionApi
,
getExemptionApi
}
from
'
@/api
'
;
export
default
{
components
:
{
Wraper
,
UrlSelect
,
RangeTime
},
props
:
{
hidden
:
Function
,
row
:
Object
,
type
:
String
,
refresh
:
Function
},
data
:
()
=>
({
form
:
{},
rules
:
{
exemptionType
:
[{
required
:
true
}],
regionId
:
[{
required
:
true
}],
placeId
:
[{
required
:
true
}],
exemptionReason
:
[{
required
:
true
}],
startTime
:
[{
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
getExemptionApi
(
this
.
row
.
exemptionId
);
}
},
methods
:
{
async
submit
()
{
await
this
.
$refs
.
form
.
validate
();
if
(
this
.
isAdd
)
return
addExemptionApi
(
this
.
form
);
if
(
this
.
isEdit
)
return
updateExemptionApi
(
this
.
form
);
},
},
};
</
script
>
src/pages/ranger/basic/exemption/index.js
0 → 100644
View file @
c58037a4
import
Index
from
'
./index.vue
'
;
export
default
Index
;
src/pages/ranger/basic/exemption/index.vue
0 → 100644
View file @
c58037a4
<
template
>
<Table
url=
"/ranger/inspection/api/v1/exemptions"
rowKey=
"exemptionId"
addBtn
:buttons=
"buttons"
ref=
"table"
:defaultQuery=
"defaultQuery"
>
<template
#search
="
{ query }">
<MoreItem
label=
"免检类型"
>
<a-select
class=
"tw-w-full"
v-model=
"query.exemptionType"
>
<a-select-option
value=
"PLACE"
>
地点免检
</a-select-option>
<a-select-option
value=
"UNIT"
>
单元免检
</a-select-option>
</a-select>
</MoreItem>
<MoreItem
label=
"地区"
>
<UrlSelect
url=
"/ranger/inspection/api/v1/region/list"
v-model=
"query.regionId"
labelFiled=
"regionName"
valueFiled=
"regionId"
/>
</MoreItem>
<MoreItem
label=
"地点"
>
<UrlSelect
v-model=
"query.placeId"
:url=
"
query.regionId ? `/ranger/inspection/api/v1/place/regions/$
{query.regionId}/list` : ''
"
labelFiled="placeName"
valueFiled="placeId"
/>
</MoreItem>
<MoreItem
label=
"单元"
v-if=
"query.exemptionType === 'UNIT'"
>
<UrlSelect
v-model=
"query.unitId"
:url=
"query.placeId ? `/ranger/inspection/api/v1/units/places/$
{query.placeId}/list` : ''"
labelFiled="unitName"
valueFiled="unitId"
/>
</MoreItem>
</
template
>
<
template
#drawer=
"drawer"
>
<AddAndEdit
v-bind=
"drawer"
/>
</
template
>
<a-table-column
title=
"免检地点/单元名称"
data-index=
"exemptionName"
/>
<a-table-column
title=
"所属地区"
data-index=
"regionName"
/>
<a-table-column
title=
"类型"
>
<
template
#default=
"row"
>
<span>
{{
row
.
exemptionType
===
'
PLACE
'
?
'
地点免检
'
:
'
单元免检
'
}}
</span>
</
template
>
</a-table-column>
<a-table-column
title=
"开始时间"
data-index=
"startTime"
/>
<a-table-column
title=
"结束时间"
data-index=
"endTime"
/>
<a-table-column
title=
"原因"
data-index=
"exemptionReason"
/>
<a-table-column
title=
"免检状态"
data-index=
"exemptionStateName"
/>
<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
{
defaultQuery
:
{
exemptionType
:
'
PLACE
'
,
},
buttons
:
[
{
label
:
'
编辑
'
,
click
:
this
.
edit
},
{
label
:
'
详情
'
,
click
:
this
.
view
},
{
type
:
'
confirm
'
,
url
:
(
row
)
=>
`ranger/inspection/api/v1/exemptions/
${
row
.
exemptionId
}
`
,
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 @
c58037a4
...
...
@@ -72,7 +72,7 @@ const hasAuthorityRoutes = [
},
{
path
:
'
place
'
,
name
:
'
地
区
配置
'
,
name
:
'
地
点
配置
'
,
component
:
()
=>
import
(
'
@/pages/ranger/basic/place
'
),
},
{
...
...
@@ -81,9 +81,15 @@ const hasAuthorityRoutes = [
component
:
()
=>
import
(
'
@/pages/ranger/basic/unit
'
),
},
{
path
:
'
item
'
,
name
:
'
项目配置
'
,
component
:
()
=>
import
(
'
@/pages/ranger/basic/item
'
),
},{
path
:
'
exemption
'
,
name
:
'
免检配置
'
,
component
:
()
=>
import
(
'
@/pages/ranger/basic/exemption
'
),
},
],
},
...
...
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