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
29896776
Commit
29896776
authored
Jul 13, 2021
by
水落(YangLei)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 单元配置完成
parent
b41116c0
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
199 additions
and
22 deletions
+199
-22
src/api/xunjian.js
src/api/xunjian.js
+12
-0
src/components/MySelect/search_select.vue
src/components/MySelect/search_select.vue
+1
-0
src/config/setting.config.js
src/config/setting.config.js
+13
-20
src/pages/frame/layouts/AdminLayout.vue
src/pages/frame/layouts/AdminLayout.vue
+0
-2
src/pages/ranger/basic/unit/add_edit.vue
src/pages/ranger/basic/unit/add_edit.vue
+91
-0
src/pages/ranger/basic/unit/index.js
src/pages/ranger/basic/unit/index.js
+3
-0
src/pages/ranger/basic/unit/index.vue
src/pages/ranger/basic/unit/index.vue
+74
-0
src/router/config.js
src/router/config.js
+5
-0
No files found.
src/api/xunjian.js
View file @
29896776
...
@@ -19,3 +19,15 @@ export function addRegionApi(data) {
...
@@ -19,3 +19,15 @@ export function addRegionApi(data) {
export
function
editRegionApi
(
data
)
{
export
function
editRegionApi
(
data
)
{
return
putReq
(
`ranger/inspection/api/v1/region`
,
data
);
return
putReq
(
`ranger/inspection/api/v1/region`
,
data
);
}
}
export
function
addUnitApi
(
data
)
{
return
postReq
(
'
/ranger/inspection/api/v1/units
'
,
data
);
}
export
function
editUnitApi
(
data
)
{
return
putReq
(
'
/ranger/inspection/api/v1/units
'
,
data
);
}
export
function
getUnitInfoApi
(
id
)
{
return
getReq
(
`/ranger/inspection/api/v1/units/
${
id
}
`
);
}
src/components/MySelect/search_select.vue
View file @
29896776
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
:options=
"options"
:options=
"options"
:mode=
"mode"
:mode=
"mode"
v-on=
"$listeners"
v-on=
"$listeners"
v-bind=
"$attrs"
/>
/>
</
template
>
</
template
>
...
...
src/config/setting.config.js
View file @
29896776
//ts 此配置为系统默认设置。
//ts 此配置为系统默认设置。
const
settingConfig
=
{
const
settingConfig
=
{
lang
:
"
zh_CN
"
,
//语言,可选 CN(简体)、HK(繁体)、US(英语),也可扩展其它语言
lang
:
'
zh_CN
'
,
//语言,可选 CN(简体)、HK(繁体)、US(英语),也可扩展其它语言
fallbackLang
:
"
en_US
"
,
fallbackLang
:
'
en_US
'
,
theme
:
{
theme
:
{
//主题
//主题
color
:
"
#3eaf7c
"
,
//主题色
color
:
'
#3eaf7c
'
,
//主题色
mode
:
"
dark
"
,
//主题模式 可选 dark、 light 和 night
mode
:
'
dark
'
,
//主题模式 可选 dark、 light 和 night
success
:
"
#52c41a
"
,
//成功色
success
:
'
#52c41a
'
,
//成功色
warning
:
"
#faad14
"
,
//警告色
warning
:
'
#faad14
'
,
//警告色
error
:
"
#f5222f
"
,
//错误色
error
:
'
#f5222f
'
,
//错误色
},
},
layout
:
"
side
"
,
//导航布局,可选 side 和 head,分别为侧边导航和顶部导航
layout
:
'
side
'
,
//导航布局,可选 side 和 head,分别为侧边导航和顶部导航
fixedHeader
:
false
,
//固定头部状态栏,true:固定,false:不固定
fixedHeader
:
false
,
//固定头部状态栏,true:固定,false:不固定
fixedSideBar
:
true
,
//固定侧边栏,true:固定,false:不固定
fixedSideBar
:
true
,
//固定侧边栏,true:固定,false:不固定
fixedTabs
:
false
,
//固定页签头,true:固定,false:不固定
fixedTabs
:
false
,
//固定页签头,true:固定,false:不固定
pageWidth
:
"
fixed
"
,
//内容区域宽度,fixed:固定宽度,fluid:流式宽度
pageWidth
:
'
fixed
'
,
//内容区域宽度,fixed:固定宽度,fluid:流式宽度
multiPage
:
true
,
//多页签模式,true:开启,false:不开启
multiPage
:
true
,
//多页签模式,true:开启,false:不开启
cachePage
:
true
,
//是否缓存页面数据,仅多页签模式下生效,true 缓存, false 不缓存
cachePage
:
true
,
//是否缓存页面数据,仅多页签模式下生效,true 缓存, false 不缓存
hideSetting
:
false
,
//隐藏设置抽屉,true:隐藏,false:不隐藏
hideSetting
:
false
,
//隐藏设置抽屉,true:隐藏,false:不隐藏
systemCode
:
"
Karot
"
,
//系统编码
systemCode
:
'
Karot
'
,
//系统编码
systemName
:
"
Karot文档管理系统
"
,
//系统名称
systemName
:
'
Karot文档管理系统
'
,
//系统名称
copyright
:
"
2021~ C.T 工作室出品
"
,
//copyright
asyncRoutes
:
false
,
//异步加载路由,true:开启,false:不开启
asyncRoutes
:
false
,
//异步加载路由,true:开启,false:不开启
showPageTitle
:
true
,
//是否显示页面标题(PageLayout 布局中的页面标题),true:显示,false:不显示
showPageTitle
:
true
,
//是否显示页面标题(PageLayout 布局中的页面标题),true:显示,false:不显示
filterMenu
:
true
,
//根据权限过滤菜单,true:过滤,false:不过滤
filterMenu
:
true
,
//根据权限过滤菜单,true:过滤,false:不过滤
animate
:
{
animate
:
{
//动画设置
//动画设置
disabled
:
false
,
//禁用动画,true:禁用,false:启用
disabled
:
false
,
//禁用动画,true:禁用,false:启用
name
:
"
lightSpeed
"
,
//动画效果,支持的动画效果可参考 ./animate.config.js
name
:
'
lightSpeed
'
,
//动画效果,支持的动画效果可参考 ./animate.config.js
direction
:
"
Left
"
,
//动画方向,切换页面时动画的方向,参考 ./animate.config.js
direction
:
'
Left
'
,
//动画方向,切换页面时动画的方向,参考 ./animate.config.js
},
},
footerLinks
:
[
//页面底部链接,{link: '链接地址', name: '名称/显示文字', icon: '图标,支持 ant design vue 图标库'}
{
link
:
"
https://www.antdv.com/
"
,
name
:
"
AntD Vue
"
},
{
link
:
"
http://platform.kuopu.net:9999/gitlab/product/akina-antd-vue-pro
"
,
icon
:
"
gitlab
"
},
{
link
:
"
https://vuejs.org/
"
,
name
:
"
Vue
"
},
],
};
};
module
.
exports
=
settingConfig
;
module
.
exports
=
settingConfig
;
src/pages/frame/layouts/AdminLayout.vue
View file @
29896776
...
@@ -83,8 +83,6 @@ export default {
...
@@ -83,8 +83,6 @@ export default {
...
mapState
(
'
settingModule
'
,
[
...
mapState
(
'
settingModule
'
,
[
'
theme
'
,
'
theme
'
,
'
layout
'
,
'
layout
'
,
'
footerLinks
'
,
'
copyright
'
,
'
fixedHeader
'
,
'
fixedHeader
'
,
'
fixedSideBar
'
,
'
fixedSideBar
'
,
'
fixedTabs
'
,
'
fixedTabs
'
,
...
...
src/pages/ranger/basic/unit/add_edit.vue
0 → 100644
View file @
29896776
<
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=
"unitName"
>
<a-input
v-model=
"form.unitName"
: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=
"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=
"equipmentCode"
>
<SearchSelect
url=
"oceanus/api/v1/equipments/list"
searchField=
"searchKey"
v-model=
"form.equipmentCode"
labelFiled=
"equipmentCode"
valueFiled=
"equipmentCode"
: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
SearchSelect
from
'
@/components/MySelect/search_select.vue
'
;
import
{
addUnitApi
,
editUnitApi
,
getUnitInfoApi
}
from
'
@/api
'
;
export
default
{
components
:
{
Wraper
,
UrlSelect
,
SearchSelect
},
props
:
{
hidden
:
Function
,
row
:
Object
,
type
:
String
,
refresh
:
Function
},
data
:
()
=>
({
form
:
{},
rules
:
{
unitName
:
[{
required
:
true
}],
regionId
:
[{
required
:
true
}],
placeId
:
[{
required
:
true
}],
equipmentCode
:
[{
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
getUnitInfoApi
(
this
.
row
.
unitId
);
}
},
methods
:
{
async
submit
()
{
await
this
.
$refs
.
form
.
validate
();
if
(
this
.
isAdd
)
return
addUnitApi
(
this
.
form
);
if
(
this
.
isEdit
)
return
editUnitApi
(
this
.
form
);
},
},
};
</
script
>
src/pages/ranger/basic/unit/index.js
0 → 100644
View file @
29896776
import
Index
from
'
./index.vue
'
;
export
default
Index
;
src/pages/ranger/basic/unit/index.vue
0 → 100644
View file @
29896776
<
template
>
<Table
url=
"/ranger/inspection/api/v1/units"
rowKey=
"unitId"
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=
"地点"
>
<UrlSelect
v-model=
"query.placeId"
:url=
"
query.regionId ? `/ranger/inspection/api/v1/place/regions/$
{query.regionId}/list` : ''
"
labelFiled="placeName"
valueFiled="placeId"
/>
</MoreItem>
<MoreItem
label=
"关键字"
>
<a-input
v-model=
"query.inputValue"
/>
</MoreItem>
</
template
>
<
template
#drawer=
"drawer"
>
<AddAndEdit
v-bind=
"drawer"
/>
</
template
>
<a-table-column
title=
"单元名称"
data-index=
"unitName"
/>
<a-table-column
title=
"所属地点"
data-index=
"placeName"
/>
<a-table-column
title=
"设备编号"
data-index=
"equipmentCode"
/>
<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
},
{
label
:
'
文档
'
,
click
:
this
.
view
},
{
type
:
'
confirm
'
,
url
:
(
row
)
=>
`/ranger/inspection/api/v1/units/
${
row
.
unitId
}
`
,
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 @
29896776
...
@@ -75,6 +75,11 @@ const hasAuthorityRoutes = [
...
@@ -75,6 +75,11 @@ const hasAuthorityRoutes = [
name
:
'
地区配置
'
,
name
:
'
地区配置
'
,
component
:
()
=>
import
(
'
@/pages/ranger/basic/place
'
),
component
:
()
=>
import
(
'
@/pages/ranger/basic/place
'
),
},
},
{
path
:
'
unit
'
,
name
:
'
单元配置
'
,
component
:
()
=>
import
(
'
@/pages/ranger/basic/unit
'
),
},
],
],
},
},
{
{
...
...
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