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
9bfc5762
Commit
9bfc5762
authored
Jul 13, 2021
by
水落(YangLei)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 巡检管理,地区配置完成
parent
2468f14a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
150 additions
and
6 deletions
+150
-6
src/api/xunjian.js
src/api/xunjian.js
+13
-1
src/components/table/more_item.vue
src/components/table/more_item.vue
+3
-2
src/components/table/table.vue
src/components/table/table.vue
+0
-2
src/pages/xunjian/basic/region/add_edit.vue
src/pages/xunjian/basic/region/add_edit.vue
+68
-0
src/pages/xunjian/basic/region/index.vue
src/pages/xunjian/basic/region/index.vue
+66
-1
No files found.
src/api/xunjian.js
View file @
9bfc5762
import
{
getReq
,
postReq
}
from
'
@/utils/requestUtil
'
;
import
{
getReq
,
postReq
,
putReq
}
from
'
@/utils/requestUtil
'
;
export
function
getXunJianDownloadUrlApi
(
idList
)
{
return
getReq
(
'
/ranger/inspection/api/v1/jobs/export
'
,
{
jobIdList
:
idList
.
join
(
'
,
'
)
});
...
...
@@ -7,3 +7,15 @@ export function getXunJianDownloadUrlApi(idList) {
export
function
addXunJianTaskApi
(
data
)
{
return
postReq
(
'
/ranger/inspection/api/v1/jobs/temporary
'
,
data
);
}
export
function
getRegionInfoApi
(
id
)
{
return
getReq
(
`/ranger/inspection/api/v1/region/
${
id
}
`
);
}
export
function
addRegionApi
(
data
)
{
return
postReq
(
'
/ranger/inspection/api/v1/region
'
,
data
);
}
export
function
editRegionApi
(
data
)
{
return
putReq
(
`ranger/inspection/api/v1/region`
,
data
);
}
src/components/table/more_item.vue
View file @
9bfc5762
...
...
@@ -14,9 +14,10 @@ export default {
</
script
>
<
style
module
lang=
"less"
>
.container
:last-child
{
m
in-width: 25
0px;
.container {
m
ax-width: 40
0px;
}
.label {
color: rgba(0, 0, 0, 0.85);
width: 6em;
...
...
src/components/table/table.vue
View file @
9bfc5762
...
...
@@ -163,7 +163,6 @@ export default {
methods
:
{
async
getData
()
{
this
.
loading
=
true
;
console
.
log
(
this
.
queryForm
);
try
{
this
.
noPage
?
await
this
.
getDataNoPage
()
:
await
this
.
getDataWithPage
();
}
catch
(
error
)
{
...
...
@@ -215,7 +214,6 @@ export default {
addBtnClick
()
{
const
{
click
}
=
typeof
this
.
addBtn
===
'
object
'
?
this
.
addBtn
:
{};
click
&&
click
();
this
.
type
=
'
add
'
;
this
.
visible
=
true
;
},
},
...
...
src/pages/xunjian/basic/region/add_edit.vue
0 → 100644
View file @
9bfc5762
<
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=
"regionName"
>
<a-input
v-model=
"form.regionName"
:disabled=
"isView"
/>
</a-form-model-item>
<a-form-model-item
label=
"所属组织"
prop=
"organizationId"
>
<UrlSelect
url=
"/api/v1/users/organizations"
labelFiled=
"orgName"
valueFiled=
"orgId"
v-model=
"form.organizationId"
: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
{
addRegionApi
,
editRegionApi
,
getRegionInfoApi
}
from
'
@/api
'
;
export
default
{
components
:
{
Wraper
,
UrlSelect
},
props
:
{
hidden
:
Function
,
row
:
Object
,
type
:
String
,
refresh
:
Function
},
data
:
()
=>
({
form
:
{},
rules
:
{
regionName
:
[{
required
:
true
}],
organizationId
:
[{
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
getRegionInfoApi
(
this
.
row
.
regionId
);
}
},
methods
:
{
async
submit
()
{
await
this
.
$refs
.
form
.
validate
();
console
.
log
(
this
.
isAdd
);
if
(
this
.
isAdd
)
return
addRegionApi
(
this
.
form
);
if
(
this
.
isEdit
)
return
editRegionApi
(
this
.
form
);
},
},
};
</
script
>
src/pages/xunjian/basic/region/index.vue
View file @
9bfc5762
<
template
>
<h1>
template
</h1>
<Table
url=
"/ranger/inspection/api/v1/region/page"
rowKey=
"regionId"
addBtn
:buttons=
"buttons"
ref=
"table"
>
<template
#search
="
{ query }">
<MoreItem
label=
"所属组织"
>
<UrlSelect
v-model=
"query.organizationId"
url=
"/api/v1/users/organizations"
labelFiled=
"orgName"
valueFiled=
"orgId"
/>
</MoreItem>
<MoreItem
label=
"地区名称"
>
<a-input
v-model=
"query.regionName"
/>
</MoreItem>
</
template
>
<
template
#drawer=
"drawer"
>
<AddAndEdit
v-bind=
"drawer"
/>
</
template
>
<a-table-column
title=
"地区名称"
data-index=
"regionName"
/>
<a-table-column
title=
"所属组织"
data-index=
"organizationName"
/>
<a-table-column
title=
"备注"
data-index=
"remark"
/>
<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
},
{
type
:
'
confirm
'
,
url
:
(
row
)
=>
`/ranger/inspection/api/v1/region/
${
row
.
regionId
}
`
,
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
>
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