Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bms-vue-obear
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
daywrite
bms-vue-obear
Commits
7fd807b6
Commit
7fd807b6
authored
May 22, 2019
by
daywrite
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
3.服务类型
parent
6a0eedfa
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
333 additions
and
1 deletion
+333
-1
setting.js
src/apis/setting.js
+2
-1
group.vue
src/components/setting/group.vue
+5
-0
form.vue
src/components/setting_list/service_type/form.vue
+99
-0
modal.vue
src/components/setting_list/service_type/modal.vue
+90
-0
service_type_list.vue
...omponents/setting_list/service_type/service_type_list.vue
+132
-0
setting.js
src/routes/setting.js
+5
-0
No files found.
src/apis/setting.js
View file @
7fd807b6
...
@@ -24,5 +24,6 @@ function temp (t, tt) {
...
@@ -24,5 +24,6 @@ function temp (t, tt) {
export
default
{
export
default
{
...
temp
(
'implement'
,
'type'
),
...
temp
(
'implement'
,
'type'
),
...
temp
(
'implement'
,
'method'
)
...
temp
(
'implement'
,
'method'
),
...
temp
(
'service'
,
'type'
)
}
}
src/components/setting/group.vue
View file @
7fd807b6
...
@@ -151,6 +151,11 @@
...
@@ -151,6 +151,11 @@
name
:
'实施方式'
,
name
:
'实施方式'
,
path
:
'/setting/implement-method'
,
path
:
'/setting/implement-method'
,
icon
:
'fa fa-fw fa-pencil-square-o'
icon
:
'fa fa-fw fa-pencil-square-o'
},
{
name
:
'服务类型'
,
path
:
'/setting/service-type'
,
icon
:
'fa fa-fw fa-crosshairs'
}
}
]
]
},
},
...
...
src/components/setting_list/service_type/form.vue
0 → 100644
View file @
7fd807b6
<
template
>
<section
class=
"ec-page-wrapper"
style=
"overflow: hidden; padding-bottom: 0px;"
>
<el-form
label-width=
"120px"
ref=
"form"
:rules=
"rules"
:model=
"model"
class=
"ec-create-form"
>
<el-form-item
label=
"服务类型"
prop=
"title"
class=
"ec-clear-left is-required"
>
<el-input
class=
"ec-input-normal"
size=
"mini"
v-model
.
trim=
"model.title"
>
</el-input>
</el-form-item>
<el-form-item
label=
"备注"
prop=
"description"
class=
"ec-clear-left ec-form-item-lg"
>
<el-input
class=
"ec-input-normal"
type=
"textarea"
size=
"mini"
:rows=
"3"
v-model
.
trim=
"model.description"
>
</el-input>
</el-form-item>
<el-form-item
label=
"排序"
prop=
"order"
class=
"ec-clear-left is-required"
>
<el-input
class=
"ec-input-normal"
size=
"mini"
v-model
.
trim=
"model.order"
>
</el-input>
</el-form-item>
</el-form>
</section>
</
template
>
<
script
>
import
{
requestAPI
,
api
}
from
'@/lib/commonMixin'
export
default
{
name
:
'implementForm'
,
props
:
{
model
:
Object
,
t
:
String
,
tt
:
String
},
components
:
{
},
data
()
{
return
{
rules
:
{
}
}
},
created
()
{
},
mounted
()
{
},
computed
:
{
},
methods
:
{
getNew
()
{
requestAPI
(
api
[
`getNew
${
this
.
t
}${
this
.
tt
}
`
],
{})
.
then
((
res
)
=>
{
this
.
model
.
order
=
res
.
nextOrder
})
},
getEdit
(
id
)
{
return
requestAPI
(
api
[
`getEdit
${
this
.
t
}${
this
.
tt
}
`
],
{
id
})
.
then
((
res
)
=>
{
return
res
.
model
})
},
_validate
(
cb
)
{
this
.
$refs
[
'form'
].
validate
((
valid
)
=>
{
if
(
valid
)
{
cb
&&
cb
()
}
})
},
_resetFields
()
{
this
.
$refs
[
'form'
].
resetFields
()
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.ec-create-form
.el-form-item
{
width
:
70%
;
}
// .ec-create-form .el-form-item {
// width: 100%;
// }
</
style
>
src/components/setting_list/service_type/modal.vue
0 → 100644
View file @
7fd807b6
<
template
>
<section>
<sidePopup
ref=
"sidePopup"
title=
"新建服务类型"
:width=
"50"
@
update:close=
"() => btnClose()"
>
<Foom
ref=
"form"
:t=
"t"
:tt=
"tt"
:model=
"model"
>
</Foom>
<div
class=
"mt20"
style=
"margin-left: 150px;"
>
<el-button
type=
"cancel"
@
click
.
stop
.
prevent=
"handleClose"
size=
"mini"
>
取 消
</el-button>
<el-button
type=
"confirm"
@
click
.
stop
.
prevent=
"save"
size=
"mini"
>
确 定
</el-button>
</div>
</sidePopup>
</section>
</
template
>
<
script
>
import
{
requestAPI
,
api
,
UTIL
}
from
'@/lib/commonMixin'
import
Foom
from
'./form'
import
{
setModule
}
from
'@/lib/viewHelper'
export
default
{
props
:
{
t
:
String
,
tt
:
String
},
components
:
{
Foom
},
data
()
{
return
{
diaVis
:
false
,
model
:
{
id
:
''
,
title
:
''
,
order
:
''
,
description
:
''
}
}
},
methods
:
{
show
(
model
)
{
if
(
model
)
{
this
.
$refs
.
form
.
getEdit
(
model
.
id
)
.
then
((
_model
)
=>
{
UTIL
.
flatten
(
this
.
model
,
_model
)
})
}
else
{
this
.
$refs
.
form
.
getNew
()
}
this
.
$refs
.
sidePopup
.
show
()
},
handleClose
()
{
this
.
$refs
.
sidePopup
.
close
(()
=>
{
this
.
$refs
.
form
.
_resetFields
()
})
},
btnClose
()
{
this
.
$refs
.
form
.
_resetFields
()
},
save
()
{
let
_params
=
Object
.
assign
({},
setModule
(
this
.
model
,
'ServiceType'
))
let
_apiUrl
=
!
this
.
model
.
id
?
api
[
`saveNew
${
this
.
t
}${
this
.
tt
}
`
]
:
api
[
`saveEdit
${
this
.
t
}${
this
.
tt
}
`
]
!
this
.
model
.
id
&&
delete
_params
[
'ServiceType[id]'
]
this
.
$refs
[
'form'
].
_validate
(()
=>
{
requestAPI
(
Object
.
assign
(
_apiUrl
,
{
method
:
'POST'
}),
_params
)
.
then
((
res
)
=>
{
this
.
$refs
.
sidePopup
.
close
(()
=>
{
this
.
btnClose
()
})
this
.
$message
.
success
(
'操作成功'
)
this
.
$parent
.
_reload
()
})
// save
})
// validate
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
</
style
>
src/components/setting_list/service_type/service_type_list.vue
0 → 100644
View file @
7fd807b6
<
template
>
<section>
<div
class=
"content"
>
<search-header
ref=
"searchHeader"
:title=
"'服务类型'"
:add-title=
"'新建服务类型'"
@
update:headerAdd=
"() => add()"
@
update:headerClear=
"() => searchClear()"
>
</search-header>
<div
class=
"page-body-content"
>
<el-alert
title=
""
type=
"info"
>
<BreadCrumb
name=
"服务类型"
></BreadCrumb>
</el-alert>
<el-table
:data=
"result.list"
border
stripe
style=
"width: 100%;margin-top:20px;"
>
<el-table-column
prop=
"title"
align=
"center"
label=
"服务类型"
>
</el-table-column>
<el-table-column
prop=
"description"
align=
"center"
label=
"备注"
>
</el-table-column>
<el-table-column
prop=
"order"
align=
"center"
label=
"排序"
>
</el-table-column>
<el-table-column
align=
"center"
label=
"操作"
>
<template
slot-scope=
"scope"
>
<el-button
type=
"primary"
size=
"mini"
@
click
.
prevent
.
stop=
"editEvent(scope.row)"
:disabled=
"!scope.row.can_update"
><i
class=
"fa fa-edit animated"
></i>
编辑
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click
.
prevent
.
stop=
"deleteEvent(scope.row.id)"
:disabled=
"!scope.row.can_delete"
><i
class=
"fa fa-trash-o animated-hove"
></i>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
<Pagenation
@
update:pager=
"pager => {updatePage(pager)}"
:total=
"result.pagenation.totalcount"
>
</Pagenation>
</div>
</div>
<FormModal
ref=
"formModal"
:t=
"t"
:tt=
"tt"
></FormModal>
</section>
</template>
<
script
>
import
SearchHeader
from
'../../common/searchHeader'
import
BreadCrumb
from
'../BreadCrumb'
import
FormModal
from
'./modal'
import
Pagenation
from
'../pagenation'
import
{
requestAPI
,
api
}
from
'@/lib/commonMixin'
export
default
{
name
:
'implement_type_list'
,
components
:
{
SearchHeader
,
BreadCrumb
,
Pagenation
,
FormModal
},
data
()
{
return
{
t
:
'service'
,
tt
:
'type'
,
pagenation
:
{
thispage
:
1
,
pagesize
:
20
},
result
:
{
list
:
[],
pagenation
:
{
totalcount
:
1
,
thispage
:
1
,
pagesize
:
20
}
}
}
},
created
()
{
this
.
getList
()
},
methods
:
{
getList
(
params
)
{
requestAPI
(
api
[
`getList
${
this
.
t
}${
this
.
tt
}
`
],
params
)
.
then
((
res
)
=>
{
this
.
result
.
list
=
res
.
list
this
.
result
.
pagenation
=
res
.
pagenation
})
},
updatePage
(
pager
)
{
let
ret
=
Object
.
assign
({
page
:
this
.
pagenation
.
thispage
},
{
page
:
pager
.
thispage
})
this
.
getList
(
ret
)
},
_reload
()
{
this
.
getList
({
page
:
this
.
pagenation
.
thispage
})
},
// 6.1新增
add
()
{
this
.
$refs
.
formModal
.
show
()
},
// 6.2编辑
editEvent
(
item
)
{
this
.
$refs
.
formModal
.
show
(
item
)
},
deleteEvent
(
id
)
{
let
deleteTip
=
'删除'
this
.
$confirm
(
`
${
deleteTip
}
?`
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
requestAPI
(
api
[
`delete
${
this
.
t
}${
this
.
tt
}
`
],
{
id
})
.
then
((
res
)
=>
{
this
.
$message
.
success
(
`
${
deleteTip
}
成功`
)
this
.
_reload
()
})
}).
catch
(()
=>
{
this
.
$message
.
info
(
`取消
${
deleteTip
}
`
)
})
},
searchClear
()
{}
}
}
</
script
>
<
style
scoped
>
</
style
>
src/routes/setting.js
View file @
7fd807b6
...
@@ -2,6 +2,7 @@ import SettingIndex from '../components/setting/index'
...
@@ -2,6 +2,7 @@ import SettingIndex from '../components/setting/index'
import
ClientTypeList
from
'../components/setting_list/client_type/client_type_list'
import
ClientTypeList
from
'../components/setting_list/client_type/client_type_list'
import
ImplementTypeList
from
'../components/setting_list/implement_type/implement_type_list'
import
ImplementTypeList
from
'../components/setting_list/implement_type/implement_type_list'
import
ImplementMethodList
from
'../components/setting_list/implement_method/implement_method_list'
import
ImplementMethodList
from
'../components/setting_list/implement_method/implement_method_list'
import
ImplementServiceList
from
'../components/setting_list/service_type/service_type_list'
const
routes
=
[{
const
routes
=
[{
path
:
'/setting'
,
path
:
'/setting'
,
name
:
'settingIndex'
,
name
:
'settingIndex'
,
...
@@ -18,5 +19,9 @@ const routes = [{
...
@@ -18,5 +19,9 @@ const routes = [{
path
:
'/setting/implement-method'
,
path
:
'/setting/implement-method'
,
name
:
'settingImplementMethod'
,
name
:
'settingImplementMethod'
,
component
:
ImplementMethodList
component
:
ImplementMethodList
},
{
path
:
'/setting/service-type'
,
name
:
'settingImplementService'
,
component
:
ImplementServiceList
}]
}]
export
default
routes
export
default
routes
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