Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
multiSystem
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
Yulun Yao
multiSystem
Commits
ff3f97df
Commit
ff3f97df
authored
Aug 05, 2021
by
Yulun Yao
🇨🇳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
123
parent
03158127
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
1216 additions
and
261 deletions
+1216
-261
routes.js
src/router/routes.js
+10
-0
ajax.js
src/server/ajax.js
+10
-10
api.js
src/server/api.js
+21
-3
actionList.vue
src/views/action/actionList.vue
+16
-216
actionListAction.vue
src/views/action/actionListAction.vue
+351
-0
actionListTrigger.vue
src/views/action/actionListTrigger.vue
+403
-0
businessSystemList.vue
src/views/businessSystem/businessSystemList.vue
+106
-25
iftttRulesList.vue
src/views/iftttRules/iftttRulesList.vue
+292
-0
login.vue
src/views/login.vue
+7
-7
No files found.
src/router/routes.js
View file @
ff3f97df
...
...
@@ -53,6 +53,16 @@ const appRoutes = [
},
]
},
{
path
:
'/iftttRules'
,
name
:
'iftttRules'
,
component
:
resolve
=>
require
([
'@/components/Layout/content-wrapper'
],
resolve
),
//ContentWrapper,
meta
:
{
title
:
'规则'
,
menuPath
:
true
,
menuIcon
:
'profile'
,
authCode
:
'0000'
,
hideInBread
:
true
},
children
:
[
{
path
:
'/iftttRules/iftttRulesList'
,
name
:
'iftttRulesList'
,
component
:
resolve
=>
require
([
'@/views/iftttRules/iftttRulesList.vue'
],
resolve
),
//basicInfo,
meta
:
{
title
:
'规则列表'
,
menuPath
:
true
,
hideInBread
:
false
,
},
},
]
},
],
},
{
...
...
src/server/ajax.js
View file @
ff3f97df
...
...
@@ -101,16 +101,16 @@ const errorHandler = (err) => {
}
}
//
Axios.interceptors.request.use(config => {
//
const token = Cookie.get('token') || Store.state.token
//
console.log(token)
//
if (token) {
//
config.headers.Authorization = token
//
}
//
return config
//
}, error => {
//
return Promise.reject(error)
//
})
Axios
.
interceptors
.
request
.
use
(
config
=>
{
const
token
=
Cookie
.
get
(
'token'
)
||
Store
.
state
.
token
console
.
log
(
token
)
if
(
token
)
{
config
.
headers
.
Authorization
=
token
}
return
config
},
error
=>
{
return
Promise
.
reject
(
error
)
})
Axios
.
interceptors
.
response
.
use
(
response
=>
{
...
...
src/server/api.js
View file @
ff3f97df
...
...
@@ -45,7 +45,7 @@ default: // 默认环境下(开发环境)
// WBX_URL = 'https://wbx-uat.omniview.pro/pc'
// BASE_URL = '/api'
// BASE_URL = 'http://yangpu-hm.omniview.pro/api/v2'
BASE_URL
=
'http
s://yapi.omniview.pro/mock/161
'
BASE_URL
=
'http
://www.962121.net/hmfmstest/ifttt/api/
'
// BASE_URL = 'http://xuhui.hm.omniview.pro/api/v2'
// BASE_URL = 'http://yangpu-hm.omniview.pro/api/v2'
// BASE_URL = 'http://211.136.105.193/apiv2'
...
...
@@ -145,7 +145,7 @@ export default {
// 首页统计列表
GET_RESOURE_LIST
:
'/service-basicdatasync-ddd/resource/count'
,
// 首页统计列表
POST_LOGIN
:
'/
public/logi
n'
,
POST_LOGIN
:
'/
uaa/oauth/toke
n'
,
// 居委会列表
GET_NEI_LIST
:
'/service-basicdatasync-ddd/residentsCommittees'
,
...
...
@@ -238,6 +238,24 @@ export default {
GET_RESERVATION_LIST
:
'/service-documents/repair/reservations'
,
GET_IFTTT_RULES_LIST
:
'/api/ifttt-center/executor/logs/query'
,
// 业务系统
GET_BUSINESS_LIST
:
'/api/ifttt-center/business/system/query'
,
POST_ADD_BUSINESS_RECORD
:
'/api/ifttt-center/business/system'
POST_ADD_BUSINESS_RECORD
:
'/api/ifttt-center/business/system'
,
DELETE_BUSINESS_RECORD
:
'/api/ifttt-center/busines/ssystem/delete/{id}'
,
// trigger
GET_TRIGGER_LIST
:
'/api/ifttt-center/trigger/query'
,
POST_ADD_TRIGGER_RECORD
:
'/api/ifttt-center/trigger'
,
DELETE_TRIGGER_RECORD
:
'/api/ifttt-center/trigger/delete/{id}'
,
// action
GET_ACTION_LIST
:
'/api/ifttt-center/action/query'
,
POST_ADD_ACTION_RECORD
:
'/api/ifttt-center/action'
,
DELETE_ACTION_RECORD
:
'/api/ifttt-center/action/delete/{id}'
,
// rules
GET_RULES_LIST
:
'/api/ifttt-center/iftttrule/query'
,
POST_ADD_RULE_RECORD
:
'/api/ifttt-center/iftttrule'
,
DELETE_RULE_RECORD
:
'/api/ifttt-center/iftttrule/delete/{id}'
}
src/views/action/actionList.vue
View file @
ff3f97df
<
template
>
<div
class=
"routerWapper"
>
<div
class=
"portalDetailTitle"
v-if=
"$route.name == 'actionList'"
>
<a-tabs
default-active-key=
"1"
>
<a-tab-pane
key=
"1"
tab=
"触发Action"
>
<div
class=
"layoutMargin"
>
<a-row>
<a-col
span=
"24"
>
<a-button
icon=
"plus"
type=
"primary"
@
click=
"onCreate"
>
新建
</a-button>
</a-col>
</a-row>
<div
class=
"itemMargin"
>
<a-alert
type=
"info"
show-icon
>
<p
slot=
"description"
>
已选择:
{{
selectedRowKeys
.
length
}}
</p>
</a-alert>
</div>
<a-table
class=
"elevator-table portalTable"
:dataSource=
"list"
:columns=
"columns"
size=
"small"
:pagination=
"pagination"
rowKey=
"id"
:row-selection=
"
{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }">
<span
slot=
"operation"
slot-scope=
"text, record"
>
<span
class=
"actionBtn"
@
click=
"edit(record)"
>
编辑
</span>
<span
class=
"actionBtn"
@
click=
"more(record)"
>
更多
</span>
</span>
<span
slot=
"no"
slot-scope=
"text, record, index"
>
{{
index
+
1
}}
</span>
</a-table>
<a-modal
title=
"系统注册"
v-model=
"isShow"
width=
'900px'
style=
"padding: 20px"
>
<a-steps
:current=
"current"
style=
"margin-bottom: 20px"
>
<a-step
v-for=
"item in steps"
:key=
"item.title"
:title=
"item.title"
/>
</a-steps>
<div
class=
"steps-content"
>
<!--
{{
steps
[
current
].
content
}}
-->
<a-form
:form=
'form'
>
<div
v-show=
"current == 0"
>
<a-form-item
label=
"所属系统"
:label-col=
"
{ span: 5 }" :wrapper-col="{ span: 12 }">
<a-select
placeholder=
"请选择授权类型"
v-decorator=
"['ssxt',
{validateTrigger:'blur', rules: [{required: true, message: '请填写此项!'}]}]">
<a-select-option
value=
"物业App"
>
物业App
</a-select-option>
</a-select>
</a-form-item>
<a-form-item
label=
"服务编码"
:label-col=
"
{ span: 5 }" :wrapper-col="{ span: 12 }">
<a-input
v-decorator=
"['fwbm',
{validateTrigger:'blur', rules: [{required: true, message: '请填写此项!'}]}]" />
</a-form-item>
<a-form-item
label=
"服务名称"
:label-col=
"
{ span: 5 }" :wrapper-col="{ span: 12 }">
<a-input
v-decorator=
"['fwmc',
{validateTrigger:'blur', rules: [{required: true, message: '请填写此项!'}]}]" />
</a-form-item>
</div>
<div
v-show=
"current == 1"
>
<a-row
v-for=
"(item, index) in rowLoop"
:key=
"index"
>
<a-col
:span=
'6'
offset=
'1'
>
<a-form-item>
<a-input
v-decorator=
"['first'+index,
{validateTrigger:'blur', rules: [{required: true, message: '请填写此项!'}]}]" />
</a-form-item>
</a-col>
<a-col
:span=
'6'
offset=
'1'
>
<a-form-item>
<a-select
v-decorator=
"['second' + index,
{validateTrigger:'blur', rules: [{required: true, message: '请填写此项!'}]}]">
<a-select-option
value=
"String"
>
String
</a-select-option>
<a-select-option
value=
"Integer"
>
Integer
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col
:span=
'6'
offset=
'1'
>
<a-form-item>
<a-input
v-decorator=
"['third' + index,
{validateTrigger:'blur', rules: [{required: true, message: '请填写此项!'}]}]" />
</a-form-item>
</a-col>
<a-col
:span=
'2'
offset=
'1'
>
<a-button
v-if=
"index+1 == rowLoop.length"
icon=
'minus'
@
click=
"deleteRow()"
></a-button>
<a-button
v-if=
"index+1 == rowLoop.length"
icon=
'plus'
@
click=
"addRow()"
></a-button>
</a-col>
</a-row>
</div>
<div
v-show=
"current == 2"
>
<a-form-item
label=
"回调地址"
:label-col=
"
{ span: 5 }" :wrapper-col="{ span: 12 }">
<a-input
v-decorator=
"['hddz',
{validateTrigger:'blur', rules: [{required: true, message: '请填写此项!'}]}]" />
</a-form-item>
</div>
</a-form>
</div>
<template
slot=
"footer"
>
<a-button
key=
"back"
@
click=
"isShow = !isShow"
>
取消
</a-button>
<a-button
v-if=
"current >= 1"
type=
"primary"
@
click=
"handlePrevStep()"
>
上一步
</a-button>
<a-button
v-if=
"current
<
2
"
type=
"primary"
@
click=
"handleNextStep()"
>
下一步
</a-button>
<a-button
v-if=
"current == 2"
type=
"primary"
@
click=
"handleRegisterOk()"
>
完成
</a-button>
</
template
>
</a-modal>
</div>
<a-tabs
default-active-key=
"1"
@
change=
"handleLoad"
>
<a-tab-pane
key=
"1"
tab=
"触发"
>
<Trigger
/>
</a-tab-pane>
<a-tab-pane
key=
"2"
tab=
"执行"
>
<Actions
/>
</a-tab-pane>
<a-tab-pane
key=
"2"
tab=
"执行Action"
></a-tab-pane>
</a-tabs>
</div>
</div>
</
template
>
<
script
>
import
Trigger
from
'@/views/action/actionListTrigger'
import
Actions
from
'@/views/action/actionListAction'
export
default
{
components
:
{
Trigger
,
Actions
},
data
()
{
return
{
form
:
this
.
$form
.
createForm
(
this
),
current
:
0
,
steps
:
[
{
title
:
'基本信息'
},
{
title
:
'输出参数'
},
{
title
:
'回调设置'
},
],
isShow
:
false
,
selectedRowKeys
:
[],
list
:
[
{
ssxt
:
'wuyeapp'
,
fwbm
:
'物业APP'
,
fwmc
:
'http://www.962121.net'
,
fwdz
:
'服务地址示例'
}
],
columns
:
[
{
title
:
'#'
,
dataIndex
:
'no'
,
align
:
'center'
,
key
:
'no'
,
scopedSlots
:
{
customRender
:
'no'
,
},
},
{
title
:
'所属系统'
,
dataIndex
:
'ssxt'
,
align
:
'center'
,
key
:
'ssxt'
},
{
title
:
'服务编码'
,
dataIndex
:
'fwbm'
,
align
:
'center'
,
key
:
'fwbm'
},
{
title
:
'服务名称'
,
dataIndex
:
'fwmc'
,
align
:
'center'
,
key
:
'fwmc'
},
{
title
:
'服务地址'
,
dataIndex
:
'fwdz'
,
align
:
'center'
,
key
:
'fwdz'
},
{
title
:
'操作'
,
dataIndex
:
'operation'
,
key
:
'operation'
,
width
:
'120px'
,
scopedSlots
:
{
customRender
:
'operation'
,
},
}
],
pagination
:
{
//分页
pageNo
:
1
,
pageSize
:
10
,
total
:
10
,
current
:
1
,
defaultCurrent
:
1
,
showQuickJumper
:
true
,
onChange
:
this
.
pageChange
},
formStoreList
:
[],
rowLoop
:
[{
first
:
''
,
second
:
''
,
third
:
''
}]
timer
:
''
,
}
},
methods
:
{
pageChange
(
val
)
{
this
.
pagination
.
pageNo
=
val
this
.
pagination
.
current
=
val
// this.getCompanyList()
},
onSelectChange
(
selectedRowKeys
)
{
this
.
selectedRowKeys
=
selectedRowKeys
},
onCreate
()
{
this
.
current
=
0
this
.
form
.
resetFields
()
this
.
isShow
=
!
this
.
isShow
},
handlePrevStep
()
{
if
(
this
.
current
>=
1
)
{
this
.
current
-=
1
}
},
handleNextStep
()
{
this
.
current
+=
1
},
handleRegisterOk
()
{
this
.
form
.
validateFields
((
err
,
values
)
=>
{
if
(
!
err
)
{
console
.
log
(
this
.
form
.
getFieldsValue
())
}
else
{
this
.
$message
.
info
(
'请填写表单所有项目!'
)
}
})
},
addRow
()
{
this
.
rowLoop
.
push
({
first
:
''
,
second
:
''
,
third
:
''
})
},
deleteRow
()
{}
handleLoad
()
{
this
.
timer
=
new
Date
().
getTime
()
}
}
}
</
script
>
...
...
src/views/action/actionListAction.vue
0 → 100644
View file @
ff3f97df
<
template
>
<div
class=
"layoutMargin"
>
<a-row>
<a-col
span=
"24"
>
<a-button
icon=
"plus"
type=
"primary"
@
click=
"onCreate"
>
新建
</a-button>
</a-col>
</a-row>
<div
class=
"itemMargin"
>
<a-alert
type=
"info"
show-icon
>
<p
slot=
"description"
>
已选择:
{{
selectedRowKeys
.
length
}}
</p>
</a-alert>
</div>
<a-table
class=
"elevator-table portalTable"
:dataSource=
"list"
:columns=
"columns"
size=
"small"
:pagination=
"pagination"
rowKey=
"id"
:row-selection=
"
{
selectedRowKeys: selectedRowKeys,
onChange: onSelectChange,
}"
>
<span
slot=
"operation"
slot-scope=
"text, record"
>
<span
class=
"actionBtn"
@
click=
"onEdit(record)"
>
编辑
</span>
<span
class=
"actionBtn"
@
click=
"onDelete(record.id)"
>
删除
</span>
</span>
<span
slot=
"no"
slot-scope=
"text, record, index"
>
{{
index
+
1
}}
</span>
</a-table>
<a-modal
title=
"服务注册"
v-model=
"isShow"
width=
"900px"
style=
"padding: 20px"
>
<template
slot=
"footer"
>
<a-button
key=
"back"
@
click=
"isShow = !isShow"
>
取消
</a-button>
<a-button
type=
"primary"
@
click=
"handleRegisterOk()"
>
提交
</a-button>
</
template
>
<a-form
:form=
"form"
>
<a-form-item
label=
"所属系统"
:label-col=
"{ span: 5 }"
:wrapper-col=
"{ span: 12 }"
>
<a-select
placeholder=
"请选择授权类型"
v-decorator=
"[
'systemId',
{
validateTrigger: 'blur',
rules: [{ required: true, message: '请填写此项!' }],
},
]"
>
<a-select-option
v-for=
"item in businessOptionsList"
:key=
"item.value"
>
{{ item.key }}
</a-select-option
>
</a-select>
</a-form-item>
<a-form-item
label=
"服务编码"
:label-col=
"{ span: 5 }"
:wrapper-col=
"{ span: 12 }"
>
<a-input
v-decorator=
"[
'code',
{
validateTrigger: 'blur',
rules: [{ required: true, message: '请填写此项!' }]
}
]"
/>
</a-form-item>
<a-form-item
label=
"服务名称"
:label-col=
"{ span: 5 }"
:wrapper-col=
"{ span: 12 }"
>
<a-input
v-decorator=
"[
'name',
{
validateTrigger: 'blur',
rules: [{ required: true, message: '请填写此项!' }]
}
]"
/>
</a-form-item>
<a-form-item
label=
"服务路径"
:label-col=
"{ span: 5 }"
:wrapper-col=
"{ span: 12 }"
>
<a-input
v-decorator=
"[
'path',
{
validateTrigger: 'blur',
rules: [{ required: true, message: '请填写此项!' }]
}
]"
/>
</a-form-item>
<a-form-item
label=
"授权方法"
:label-col=
"{ span: 5 }"
:wrapper-col=
"{ span: 12 }"
>
<a-select
placeholder=
"请选择授权方法"
v-decorator=
"['method', {validateTrigger:'blur', rules: [{required: true, message: '请填写此项!'}]}]"
>
<a-select-option
value=
"POST"
>
POST
</a-select-option>
<a-select-option
value=
"GET"
>
GET
</a-select-option>
</a-select>
</a-form-item>
<a-form-item
label=
"输入参数"
:label-col=
"{ span: 5 }"
:wrapper-col=
"{ span: 12 }"
>
<a-textarea
v-decorator=
"[
'args',
{
validateTrigger: 'blur',
rules: [
{ required: true, message: '请填写此项!' },
{validator: confirmJson}
]
}
]"
/>
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
<
script
>
export
default
{
data
()
{
return
{
form
:
this
.
$form
.
createForm
(
this
),
current
:
0
,
steps
:
[
{
title
:
'基本信息'
,
},
{
title
:
'输出参数'
,
},
{
title
:
'回调设置'
,
},
],
isShow
:
false
,
selectedRowKeys
:
[],
list
:
[],
columns
:
[
{
title
:
'#'
,
dataIndex
:
'no'
,
align
:
'center'
,
key
:
'no'
,
scopedSlots
:
{
customRender
:
'no'
,
},
},
{
title
:
'所属系统'
,
dataIndex
:
'systemId'
,
align
:
'center'
,
key
:
'systemId'
,
},
{
title
:
'服务编码'
,
dataIndex
:
'code'
,
align
:
'center'
,
key
:
'code'
,
},
{
title
:
'服务名称'
,
dataIndex
:
'name'
,
align
:
'center'
,
key
:
'name'
,
},
{
title
:
'服务地址'
,
dataIndex
:
'callBackPath'
,
align
:
'center'
,
key
:
'callBackPath'
,
},
{
title
:
'操作'
,
dataIndex
:
'operation'
,
key
:
'operation'
,
width
:
'120px'
,
scopedSlots
:
{
customRender
:
'operation'
,
},
},
],
pagination
:
{
//分页
pageNo
:
1
,
pageSize
:
10
,
total
:
10
,
current
:
1
,
defaultCurrent
:
1
,
showQuickJumper
:
true
,
onChange
:
this
.
pageChange
,
},
formStoreList
:
[],
rowLoop
:
[
{
first
:
''
,
second
:
''
,
third
:
''
,
},
],
businessOptionsList
:
[],
}
},
mounted
()
{
this
.
getList
()
this
.
getBusinessOptions
()
},
methods
:
{
confirmJson
(
rule
,
value
,
callback
)
{
if
(
!
value
||
value
==
undefined
)
{
callback
(
'不能为空!'
)
}
else
if
(
typeof
value
==
'string'
)
{
try
{
let
obj
=
JSON
.
parse
(
value
)
if
(
typeof
obj
==
'object'
&&
obj
){
callback
()
}
else
{
callback
(
'不是有效的JSON格式'
)
}
}
catch
(
e
)
{
callback
(
'不是有效的JSON格式'
)
}
}
},
onDelete
(
id
)
{
this
.
$ajax
.
delete
({
url
:
this
.
$api
.
DELETE_ACTION_RECORD
.
replace
(
'{id}'
,
id
),
})
.
then
((
res
)
=>
{
if
(
res
.
code
==
'200'
)
{
this
.
$message
.
success
(
'删除成功!'
)
this
.
getList
()
}
})
},
getBusinessOptions
()
{
this
.
$ajax
.
post
({
url
:
this
.
$api
.
GET_BUSINESS_LIST
,
// page信息需要拼接在地址栏
})
.
then
((
res
)
=>
{
if
(
res
.
code
===
'200'
)
{
let
result
=
this
.
$com
.
confirm
(
res
,
'data.content'
,
[])
for
(
let
i
=
0
;
i
<
result
.
length
;
i
++
)
{
this
.
businessOptionsList
.
push
({
key
:
result
[
i
].
name
,
value
:
result
[
i
].
id
,
})
}
}
})
},
getList
()
{
this
.
$ajax
.
post
({
url
:
this
.
$api
.
GET_ACTION_LIST
,
})
.
then
((
res
)
=>
{
this
.
list
=
this
.
$com
.
confirm
(
res
,
'data.content'
,
[])
})
},
pageChange
(
val
)
{
this
.
pagination
.
pageNo
=
val
this
.
pagination
.
current
=
val
// this.getCompanyList()
},
onSelectChange
(
selectedRowKeys
)
{
this
.
selectedRowKeys
=
selectedRowKeys
},
onCreate
()
{
this
.
current
=
0
this
.
form
.
resetFields
()
this
.
isShow
=
!
this
.
isShow
},
handlePrevStep
()
{
if
(
this
.
current
>=
1
)
{
this
.
current
-=
1
}
},
handleNextStep
()
{
this
.
current
+=
1
},
handleRegisterOk
()
{
this
.
form
.
validateFields
((
err
,
values
)
=>
{
if
(
!
err
)
{
let
formContent
=
this
.
form
.
getFieldsValue
()
this
.
$ajax
.
post
({
url
:
this
.
$api
.
POST_ADD_ACTION_RECORD
,
params
:
formContent
}).
then
(
res
=>
{
if
(
res
.
code
==
'200'
)
{
this
.
$message
.
success
(
'新增成功!'
)
this
.
isShow
=
!
this
.
isShow
this
.
form
.
resetFields
()
this
.
getList
()
}
})
}
else
{
this
.
$message
.
info
(
'请填写表单所有项目!'
)
}
})
},
addRow
()
{
this
.
rowLoop
.
push
({
key
:
''
,
type
:
''
,
name
:
''
,
})
},
deleteRow
()
{},
},
}
</
script
>
<
style
scoped
>
.itemMargin
{
margin-top
:
14px
;
margin-bottom
:
14px
;
}
</
style
>
src/views/action/actionListTrigger.vue
0 → 100644
View file @
ff3f97df
<
template
>
<div
class=
"layoutMargin"
>
<a-row>
<a-col
span=
"24"
>
<a-button
icon=
"plus"
type=
"primary"
@
click=
"onCreate"
>
新建
</a-button>
</a-col>
</a-row>
<div
class=
"itemMargin"
>
<a-alert
type=
"info"
show-icon
>
<p
slot=
"description"
>
已选择:
{{
selectedRowKeys
.
length
}}
</p>
</a-alert>
</div>
<a-table
class=
"elevator-table portalTable"
:dataSource=
"list"
:columns=
"columns"
size=
"small"
:pagination=
"pagination"
rowKey=
"id"
:row-selection=
"
{
selectedRowKeys: selectedRowKeys,
onChange: onSelectChange
}"
>
<span
slot=
"operation"
slot-scope=
"text, record"
>
<span
class=
"actionBtn"
@
click=
"onEdit(record)"
>
编辑
</span>
<span
class=
"actionBtn"
@
click=
"onDelete(record.id)"
>
删除
</span>
</span>
<span
slot=
"no"
slot-scope=
"text, record, index"
>
{{
index
+
1
}}
</span>
</a-table>
<a-modal
title=
"服务注册"
v-model=
"isShow"
width=
"900px"
style=
"padding: 20px"
>
<a-steps
:current=
"current"
style=
"margin-bottom: 20px"
>
<a-step
v-for=
"item in steps"
:key=
"item.title"
:title=
"item.title"
/>
</a-steps>
<div
class=
"steps-content"
>
<!--
{{
steps
[
current
].
content
}}
-->
<a-form
:form=
"form"
>
<div
v-show=
"current == 0"
>
<a-form-item
label=
"所属系统"
:label-col=
"
{ span: 5 }"
:wrapper-col="{ span: 12 }"
>
<a-select
placeholder=
"请选择授权类型"
v-decorator=
"[
'systemId',
{
validateTrigger: 'blur',
rules: [{ required: true, message: '请填写此项!' }]
}
]"
>
<a-select-option
v-for=
"item in businessOptionsList"
:key=
"item.value"
>
{{
item
.
key
}}
</a-select-option
>
</a-select>
</a-form-item>
<a-form-item
label=
"服务编码"
:label-col=
"
{ span: 5 }"
:wrapper-col="{ span: 12 }"
>
<a-input
v-decorator=
"[
'code',
{
validateTrigger: 'blur',
rules: [{ required: true, message: '请填写此项!' }]
}
]"
/>
</a-form-item>
<a-form-item
label=
"服务名称"
:label-col=
"
{ span: 5 }"
:wrapper-col="{ span: 12 }"
>
<a-input
v-decorator=
"[
'name',
{
validateTrigger: 'blur',
rules: [{ required: true, message: '请填写此项!' }]
}
]"
/>
</a-form-item>
</div>
<div
v-show=
"current == 1"
>
<a-row
v-for=
"(item, index) in rowLoop"
:key=
"index"
>
<a-col
:span=
"6"
offset=
"1"
>
<a-form-item>
<a-input
v-decorator=
"[
'key' + index,
{
validateTrigger: 'blur',
rules: [{ required: true, message: '请填写此项!' }]
}
]"
/>
</a-form-item>
</a-col>
<a-col
:span=
"6"
offset=
"1"
>
<a-form-item>
<a-select
v-decorator=
"[
'type' + index,
{
validateTrigger: 'blur',
rules: [{ required: true, message: '请填写此项!' }]
}
]"
>
<a-select-option
value=
"String"
>
String
</a-select-option>
<a-select-option
value=
"Integer"
>
Integer
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col
:span=
"6"
offset=
"1"
>
<a-form-item>
<a-input
v-decorator=
"[
'name' + index,
{
validateTrigger: 'blur',
rules: [{ required: true, message: '请填写此项!' }]
}
]"
/>
</a-form-item>
</a-col>
<a-col
:span=
"2"
offset=
"1"
>
<a-button
v-if=
"index + 1 == rowLoop.length"
icon=
"minus"
@
click=
"deleteRow()"
></a-button>
<a-button
v-if=
"index + 1 == rowLoop.length"
icon=
"plus"
@
click=
"addRow()"
></a-button>
</a-col>
</a-row>
</div>
<div
v-show=
"current == 2"
>
<a-form-item
label=
"回调地址"
:label-col=
"
{ span: 5 }"
:wrapper-col="{ span: 12 }"
>
<a-input
v-decorator=
"[
'callBackPath',
{
validateTrigger: 'blur',
rules: [{ required: true, message: '请填写此项!' }]
}
]"
/>
</a-form-item>
</div>
</a-form>
</div>
<template
slot=
"footer"
>
<a-button
key=
"back"
@
click=
"isShow = !isShow"
>
取消
</a-button>
<a-button
v-if=
"current >= 1"
type=
"primary"
@
click=
"handlePrevStep()"
>
上一步
</a-button>
<a-button
v-if=
"current
<
2
"
type=
"primary"
@
click=
"handleNextStep()"
>
下一步
</a-button>
<a-button
v-if=
"current == 2"
type=
"primary"
@
click=
"handleRegisterOk()"
>
完成
</a-button>
</
template
>
</a-modal>
</div>
</template>
<
script
>
export
default
{
data
()
{
return
{
form
:
this
.
$form
.
createForm
(
this
),
current
:
0
,
steps
:
[
{
title
:
'基本信息'
},
{
title
:
'输出参数'
},
{
title
:
'回调设置'
},
],
isShow
:
false
,
selectedRowKeys
:
[],
list
:
[],
columns
:
[
{
title
:
'#'
,
dataIndex
:
'no'
,
align
:
'center'
,
key
:
'no'
,
scopedSlots
:
{
customRender
:
'no'
,
},
},
{
title
:
'所属系统'
,
dataIndex
:
'systemId'
,
align
:
'center'
,
key
:
'systemId'
},
{
title
:
'服务编码'
,
dataIndex
:
'code'
,
align
:
'center'
,
key
:
'code'
},
{
title
:
'服务名称'
,
dataIndex
:
'name'
,
align
:
'center'
,
key
:
'name'
},
{
title
:
'服务地址'
,
dataIndex
:
'callBackPath'
,
align
:
'center'
,
key
:
'callBackPath'
},
{
title
:
'操作'
,
dataIndex
:
'operation'
,
key
:
'operation'
,
width
:
'120px'
,
scopedSlots
:
{
customRender
:
'operation'
,
},
}
],
pagination
:
{
//分页
pageNo
:
1
,
pageSize
:
10
,
total
:
10
,
current
:
1
,
defaultCurrent
:
1
,
showQuickJumper
:
true
,
onChange
:
this
.
pageChange
},
formStoreList
:
[],
rowLoop
:
[{
first
:
''
,
second
:
''
,
third
:
''
}],
businessOptionsList
:
[]
}
},
mounted
()
{
this
.
getList
()
this
.
getBusinessOptions
()
},
methods
:
{
onDelete
(
id
)
{
this
.
$ajax
.
delete
({
url
:
this
.
$api
.
DELETE_TRIGGER_RECORD
.
replace
(
'{id}'
,
id
)
}).
then
(
res
=>
{
if
(
res
.
code
==
'200'
)
{
this
.
$message
.
success
(
'删除成功!'
)
this
.
getList
()
}
})
},
getBusinessOptions
()
{
this
.
$ajax
.
post
({
url
:
this
.
$api
.
GET_BUSINESS_LIST
,
// page信息需要拼接在地址栏
}).
then
(
res
=>
{
if
(
res
.
code
===
'200'
)
{
let
result
=
this
.
$com
.
confirm
(
res
,
'data.content'
,
[])
for
(
let
i
=
0
;
i
<
result
.
length
;
i
++
)
{
this
.
businessOptionsList
.
push
({
key
:
result
[
i
].
name
,
value
:
result
[
i
].
id
})
}
}
})
},
getList
()
{
this
.
$ajax
.
post
({
url
:
this
.
$api
.
GET_TRIGGER_LIST
}).
then
(
res
=>
{
this
.
list
=
this
.
$com
.
confirm
(
res
,
'data.content'
,
[])
})
},
pageChange
(
val
)
{
this
.
pagination
.
pageNo
=
val
this
.
pagination
.
current
=
val
// this.getCompanyList()
},
onSelectChange
(
selectedRowKeys
)
{
this
.
selectedRowKeys
=
selectedRowKeys
},
onCreate
()
{
this
.
current
=
0
this
.
form
.
resetFields
()
this
.
isShow
=
!
this
.
isShow
},
handlePrevStep
()
{
if
(
this
.
current
>=
1
)
{
this
.
current
-=
1
}
},
handleNextStep
()
{
this
.
current
+=
1
},
handleRegisterOk
()
{
this
.
form
.
validateFields
((
err
,
values
)
=>
{
if
(
!
err
)
{
let
formContent
=
this
.
form
.
getFieldsValue
()
// console.log(formContent)
let
paramsJson
=
[]
let
finalParse
=
{}
// 遍历有多少行授权参数
for
(
let
i
=
0
;
i
<
this
.
rowLoop
.
length
;
i
++
)
{
paramsJson
.
push
({
required
:
'false'
,
key
:
formContent
[
'key'
+
i
],
type
:
formContent
[
'type'
+
i
],
name
:
formContent
[
'name'
+
i
],
example
:
null
,
group
:
null
})
}
finalParse
=
{
code
:
this
.
form
.
getFieldValue
(
'code'
),
name
:
this
.
form
.
getFieldValue
(
'name'
),
systemId
:
this
.
form
.
getFieldValue
(
'systemId'
),
callBackPath
:
this
.
form
.
getFieldValue
(
'callBackPath'
),
args
:
paramsJson
}
this
.
$ajax
.
post
({
url
:
this
.
$api
.
POST_ADD_TRIGGER_RECORD
,
params
:
finalParse
}).
then
(
res
=>
{
if
(
res
.
code
==
'200'
)
{
this
.
$message
.
success
(
'新增成功!'
)
this
.
isShow
=
!
this
.
isShow
this
.
form
.
resetFields
()
this
.
getList
()
}
})
}
else
{
this
.
$message
.
info
(
'请填写表单所有项目!'
)
}
})
console
.
log
(
finalParse
)
},
addRow
()
{
this
.
rowLoop
.
push
({
key
:
''
,
type
:
''
,
name
:
''
})
},
deleteRow
()
{}
}
}
</
script
>
<
style
scoped
>
.itemMargin
{
margin-top
:
14px
;
margin-bottom
:
14px
}
</
style
>
src/views/businessSystem/businessSystemList.vue
View file @
ff3f97df
...
...
@@ -17,8 +17,8 @@
</div>
<a-table
class=
"elevator-table portalTable"
:dataSource=
"list"
:columns=
"columns"
size=
"small"
:pagination=
"pagination"
rowKey=
"id"
:row-selection=
"
{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }">
<span
slot=
"operation"
slot-scope=
"text, record"
>
<span
class=
"actionBtn"
@
click=
"
e
dit(record)"
>
编辑
</span>
<span
class=
"actionBtn"
@
click=
"
more(record)"
>
更多
</span>
<span
class=
"actionBtn"
@
click=
"
onE
dit(record)"
>
编辑
</span>
<span
class=
"actionBtn"
@
click=
"
onDelete(record.id)"
>
删除
</span>
</span>
<span
slot=
"no"
slot-scope=
"text, record, index"
>
{{
index
+
1
}}
...
...
@@ -33,50 +33,77 @@
<a-form
:form=
'form'
>
<div
v-show=
"current == 0"
>
<a-form-item
label=
"系统编码"
:label-col=
"
{ span: 5 }" :wrapper-col="{ span: 12 }">
<a-input
v-decorator=
"['
xtbm
',
{ validateTrigger:'blur', rules: [{required: true, message: '请填写此项!'}]}]" />
<a-input
v-decorator=
"['
code
',
{ validateTrigger:'blur', rules: [{required: true, message: '请填写此项!'}]}]" />
</a-form-item>
<a-form-item
label=
"系统名称"
:label-col=
"
{ span: 5 }" :wrapper-col="{ span: 12 }">
<a-input
v-decorator=
"['
xtmc
',
{validateTrigger:'blur', rules: [{required: true, message: '请填写此项!'}]}]" />
<a-input
v-decorator=
"['
name
',
{validateTrigger:'blur', rules: [{required: true, message: '请填写此项!'}]}]" />
</a-form-item>
<a-form-item
label=
"系统地址"
:label-col=
"
{ span: 5 }" :wrapper-col="{ span: 12 }">
<a-input
v-decorator=
"['
xtdz
',
{validateTrigger:'blur', rules: [{required: true, message: '请填写此项!'}]}]" />
<a-input
v-decorator=
"['
url
',
{validateTrigger:'blur', rules: [{required: true, message: '请填写此项!'}]}]" />
</a-form-item>
</div>
<div
v-show=
"current == 1"
>
<a-form-item
label=
"授权类型"
:label-col=
"
{ span: 5 }" :wrapper-col="{ span: 12 }">
<a-select
placeholder=
"请选择授权类型"
v-decorator=
"['
sqlx
',
{validateTrigger:'blur', rules: [{required: true, message: '请填写此项!'}]}]">
<a-select
placeholder=
"请选择授权类型"
v-decorator=
"['
authType
',
{validateTrigger:'blur', rules: [{required: true, message: '请填写此项!'}]}]">
<a-select-option
value=
"oauth2"
>
oauth2
</a-select-option>
</a-select>
</a-form-item>
<a-form-item
label=
"授权路径"
:label-col=
"
{ span: 5 }" :wrapper-col="{ span: 12 }">
<a-input
v-decorator=
"['
sqlj
',
{validateTrigger:'blur', rules: [{required: true, message: '请填写此项!'}]}]" />
<a-input
v-decorator=
"['
authPath
',
{validateTrigger:'blur', rules: [{required: true, message: '请填写此项!'}]}]" />
</a-form-item>
<a-form-item
label=
"授权方法"
:label-col=
"
{ span: 5 }" :wrapper-col="{ span: 12 }">
<a-select
placeholder=
"请选择授权方法"
v-decorator=
"['
sqff
',
{validateTrigger:'blur', rules: [{required: true, message: '请填写此项!'}]}]">
<a-select
placeholder=
"请选择授权方法"
v-decorator=
"['
method
',
{validateTrigger:'blur', rules: [{required: true, message: '请填写此项!'}]}]">
<a-select-option
value=
"POST"
>
POST
</a-select-option>
<a-select-option
value=
"GET"
>
GET
</a-select-option>
</a-select>
</a-form-item>
<a-row>
<a-col
:span=
'5'
style=
"text-align: right; color: black"
>
授权参数:
</a-col>
<a-col
:span=
'19'
>
<a-row
v-for=
"(item, index) in rowLoop"
:key=
"index"
>
<a-col
:span=
'6'
>
<a-form-item>
<a-input
v-decorator=
"['key'+index,
{validateTrigger:'blur', rules: [{required: true, message: '请填写此项!'}]}]" />
</a-form-item>
</a-col>
<a-col
:span=
'6'
:offset=
'1'
>
<a-form-item>
<a-input
v-decorator=
"['value'+index,
{validateTrigger:'blur', rules: [{required: true, message: '请填写此项!'}]}]" />
</a-form-item>
</a-col>
<a-col
:span=
'1'
:offset=
'1'
>
<a-button
icon=
'minus'
@
click=
"deleteRow(index)"
/>
</a-col>
</a-row>
</a-col>
</a-row>
<a-row
style=
"text-align: center"
>
<a-button
icon=
'plus'
type=
"dashed"
style=
"padding: 0px 100px"
@
click=
"addRow()"
>
添加参数
</a-button>
</a-row>
</div>
<div
v-show=
"current == 2"
>
<a-form-item
label=
"Token Key"
:label-col=
"
{ span: 5 }" :wrapper-col="{ span: 12 }">
<a-input
v-decorator=
"['
t
okenKey',
{validateTrigger:'blur', rules: [{required: true, message: '请填写此项!'}]}]" />
<a-input
v-decorator=
"['
authT
okenKey',
{validateTrigger:'blur', rules: [{required: true, message: '请填写此项!'}]}]" />
</a-form-item>
<a-form-item
label=
"Token Header Name"
:label-col=
"
{ span: 5 }" :wrapper-col="{ span: 12 }">
<a-input
v-decorator=
"['
t
okenHeaderName',
{validateTrigger:'blur', rules: [{required: true, message: '请填写此项!'}]}]" />
<a-input
v-decorator=
"['
authT
okenHeaderName',
{validateTrigger:'blur', rules: [{required: true, message: '请填写此项!'}]}]" />
</a-form-item>
<a-form-item
label=
"Token Prefix"
:label-col=
"
{ span: 5 }" :wrapper-col="{ span: 12 }">
<a-input
v-decorator=
"['
t
okenPrefix',
{validateTrigger:'blur', rules: [{required: true, message: '请填写此项!'}]}]" />
<a-input
v-decorator=
"['
authT
okenPrefix',
{validateTrigger:'blur', rules: [{required: true, message: '请填写此项!'}]}]" />
</a-form-item>
<a-form-item
label=
"Token Expires Time Key"
:label-col=
"
{ span: 5 }" :wrapper-col="{ span: 12 }">
<a-input
v-decorator=
"['
tokenExpires
TimeKey',
{validateTrigger:'blur', rules: [{required: true, message: '请填写此项!'}]}]" />
<a-input
v-decorator=
"['
authToken
TimeKey',
{validateTrigger:'blur', rules: [{required: true, message: '请填写此项!'}]}]" />
</a-form-item>
</div>
</a-form>
...
...
@@ -105,6 +132,10 @@
export
default
{
data
()
{
return
{
rowLoop
:
[{
name
:
''
,
key
:
''
}],
form
:
this
.
$form
.
createForm
(
this
),
current
:
0
,
steps
:
[
...
...
@@ -174,13 +205,31 @@ export default {
showQuickJumper
:
true
,
onChange
:
this
.
pageChange
},
formStoreList
:
[]
formStoreList
:
[],
businessOptionsList
:
[]
}
},
mounted
()
{
this
.
getList
()
},
methods
:
{
onDelete
(
id
)
{
this
.
$ajax
.
delete
({
url
:
this
.
$api
.
DELETE_BUSINESS_RECORD
.
replace
(
'{id}'
,
id
)
}).
then
(
res
=>
{
if
(
res
.
code
==
'200'
)
{
this
.
$message
.
success
(
'删除成功!'
)
this
.
getList
()
}
})
},
addRow
()
{
this
.
rowLoop
.
push
({
name
:
''
,
key
:
''
})
},
deleteRow
()
{},
getList
()
{
this
.
$ajax
.
post
({
url
:
this
.
$api
.
GET_BUSINESS_LIST
...
...
@@ -210,18 +259,50 @@ export default {
this
.
current
+=
1
},
handleRegisterOk
()
{
let
addForm
=
{}
// this.form.validateFields((err, values) => {
// if (!err) {
addForm
.
code
=
this
.
form
.
getFieldValue
(
'xtbm'
)
addForm
.
name
=
this
.
form
.
getFieldValue
(
'xtmc'
)
addForm
.
url
=
this
.
form
.
getFieldValue
(
'xtdz'
)
console
.
log
(
addForm
)
// } else {
// this.$message.info('请填写表单所有项目!')
// }
// })
this
.
form
.
validateFields
((
err
,
values
)
=>
{
if
(
!
err
)
{
let
formContent
=
this
.
form
.
getFieldsValue
()
let
paramsJson
=
[]
let
finalParse
=
{}
// 遍历有多少行授权参数
for
(
let
i
=
0
;
i
<
this
.
rowLoop
.
length
;
i
++
)
{
paramsJson
.
push
({
key
:
formContent
[
'key'
+
i
],
value
:
formContent
[
'value'
+
i
],
})
}
finalParse
=
{
code
:
this
.
form
.
getFieldValue
(
'code'
),
name
:
this
.
form
.
getFieldValue
(
'name'
),
url
:
this
.
form
.
getFieldValue
(
'url'
),
method
:
this
.
form
.
getFieldValue
(
'method'
),
data
:
paramsJson
,
authType
:
this
.
form
.
getFieldValue
(
'authType'
),
authPath
:
this
.
form
.
getFieldValue
(
'authPath'
),
authTokenKey
:
this
.
form
.
getFieldValue
(
'authTokenKey'
),
authTokenHeaderName
:
this
.
form
.
getFieldValue
(
'authTokenHeaderName'
),
authTokenPrefix
:
this
.
form
.
getFieldValue
(
'authTokenPrefix'
),
authTokenTimeKey
:
this
.
form
.
getFieldValue
(
'authTokenTimeKey'
)
}
this
.
$ajax
.
post
({
url
:
this
.
$api
.
POST_ADD_BUSINESS_RECORD
,
params
:
finalParse
}).
then
(
res
=>
{
if
(
res
.
code
==
'200'
)
{
this
.
$message
.
success
(
'新增成功!'
)
this
.
isShow
=
!
this
.
isShow
this
.
form
.
resetFields
()
this
.
getList
()
}
})
}
else
{
this
.
$message
.
info
(
'请填写表单所有项目!'
)
}
})
}
}
}
...
...
src/views/iftttRules/iftttRulesList.vue
View file @
ff3f97df
<
template
>
<div
class=
"routerWapper"
>
<div
class=
"portalDetailTitle"
v-if=
"$route.name == 'iftttRulesList'"
>
<span
class=
"title"
>
规则列表
</span>
<div
class=
"layoutMargin layoutPadding"
>
<a-row>
<a-col
span=
"24"
>
<a-button
icon=
"plus"
type=
"primary"
@
click=
"onRegister"
>
新建规则
</a-button>
</a-col>
</a-row>
<div
class=
"itemMargin"
>
<a-alert
type=
"info"
show-icon
>
<p
slot=
"description"
>
已选择:
{{
selectedRowKeys
.
length
}}
</p>
</a-alert>
</div>
<a-table
class=
"elevator-table portalTable"
:dataSource=
"list"
:columns=
"columns"
size=
"small"
:pagination=
"pagination"
rowKey=
"id"
:row-selection=
"
{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }">
<span
slot=
"operation"
slot-scope=
"text, record"
>
<span
class=
"actionBtn"
@
click=
"onEdit(record)"
>
编辑
</span>
<span
class=
"actionBtn"
@
click=
"onDelete(record.id)"
>
删除
</span>
</span>
<span
slot=
"no"
slot-scope=
"text, record, index"
>
{{
index
+
1
}}
</span>
<span
slot=
"trigger"
slot-scope=
"text, record, index"
>
{{
record
.
trigger
.
name
}}
</span>
<span
slot=
"action"
slot-scope=
"text, record, index"
>
{{
record
.
action
.
name
}}
</span>
<span
slot=
"rules"
slot-scope=
"text, record, index"
>
<a-tag
v-for=
"(item, index) in record.rules"
:key=
"index"
>
{{
`{`
+
record
.
rules
[
index
].
key
+
`: `
+
record
.
rules
[
index
].
value
+
`
}
`
}}
<
/a-tag
>
<
/span
>
<
/a-table
>
<
a
-
modal
title
=
"新建规则"
v
-
model
=
"isShow"
width
=
'900px'
style
=
"padding: 20px"
>
<
a
-
form
:
form
=
'form'
>
<
a
-
form
-
item
label
=
"触发服务"
:
label
-
col
=
"{ span: 5
}
"
:
wrapper
-
col
=
"{ span: 12
}
"
>
<
a
-
select
placeholder
=
"请选择触发服务"
v
-
decorator
=
"['trigger', {validateTrigger:'blur', rules: [{required: true, message: '请选择此项!'
}
]
}
]"
>
<
a
-
select
-
option
v
-
for
=
"(item) in triggerOptions"
:
key
=
"item.id"
>
{{
item
.
name
}}
<
/a-select-option
>
<
/a-select
>
<
/a-form-item
>
<
a
-
form
-
item
label
=
"执行服务"
:
label
-
col
=
"{ span: 5
}
"
:
wrapper
-
col
=
"{ span: 12
}
"
>
<
a
-
select
placeholder
=
"请选择执行服务"
v
-
decorator
=
"['action', {validateTrigger:'blur', rules: [{required: true, message: '请选择此项!'
}
]
}
]"
>
<
a
-
select
-
option
v
-
for
=
"(item) in actionOptions"
:
key
=
"item.id"
>
{{
item
.
name
}}
<
/a-select-option
>
<
/a-select
>
<
/a-form-item
>
<
a
-
form
-
item
label
=
"规则字段定义"
:
label
-
col
=
"{ span: 5
}
"
:
wrapper
-
col
=
"{ span: 12
}
"
>
<
a
-
textarea
v
-
decorator
=
"[
'rules',
{
validateTrigger: 'blur',
rules: [
{ required: true, message: '请填写此项!'
}
,
{validator: confirmJson
}
]
}
]"
/>
<
/a-form-item
>
<
/a-form
>
<
template
slot
=
"footer"
>
<
a
-
button
key
=
"back"
@
click
=
"isShow = !isShow"
>
取消
<
/a-button
>
<
a
-
button
type
=
"primary"
@
click
=
"handleRegisterOk()"
>
完成
<
/a-button
>
<
/template
>
<
/a-modal
>
<
/div
>
<
/div
>
<
/div
>
<
/template
>
<
script
>
export
default
{
data
()
{
return
{
rowLoop
:
[{
name
:
''
,
key
:
''
}
],
form
:
this
.
$form
.
createForm
(
this
),
current
:
0
,
steps
:
[
{
title
:
'基本信息'
}
,
{
title
:
'授权认证信息'
}
,
{
title
:
'授权结果映射'
}
,
],
isShow
:
false
,
selectedRowKeys
:
[],
list
:
[],
columns
:
[
{
title
:
'#'
,
dataIndex
:
'no'
,
align
:
'center'
,
key
:
'no'
,
scopedSlots
:
{
customRender
:
'no'
,
}
,
}
,
{
title
:
'触发服务'
,
dataIndex
:
'trigger'
,
align
:
'center'
,
key
:
'trigger'
,
width
:
'100px'
,
scopedSlots
:
{
customRender
:
'trigger'
,
}
,
}
,
{
title
:
'执行服务'
,
dataIndex
:
'action'
,
align
:
'center'
,
key
:
'action'
,
width
:
'100px'
,
scopedSlots
:
{
customRender
:
'action'
,
}
,
}
,
{
title
:
'规则字段定义'
,
dataIndex
:
'rules'
,
align
:
'center'
,
key
:
'rules'
,
scopedSlots
:
{
customRender
:
'rules'
,
}
,
}
,
{
title
:
'操作'
,
dataIndex
:
'operation'
,
key
:
'operation'
,
width
:
'120px'
,
scopedSlots
:
{
customRender
:
'operation'
,
}
,
}
],
pagination
:
{
//分页
pageNo
:
1
,
pageSize
:
10
,
total
:
10
,
current
:
1
,
defaultCurrent
:
1
,
showQuickJumper
:
true
,
onChange
:
this
.
pageChange
}
,
formStoreList
:
[],
triggerOptions
:
[],
actionOptions
:
[]
}
}
,
mounted
()
{
this
.
getList
()
this
.
getTriggerServiceOption
()
this
.
getActionServiceOption
()
}
,
methods
:
{
getTriggerServiceOption
()
{
this
.
$ajax
.
post
({
url
:
this
.
$api
.
GET_TRIGGER_LIST
,
}
).
then
(
res
=>
{
if
(
res
.
code
==
'200'
)
{
let
result
=
this
.
$com
.
confirm
(
res
,
'data.content'
,
[])
for
(
let
i
=
0
;
i
<
result
.
length
;
i
++
)
{
this
.
triggerOptions
.
push
(
result
[
i
])
}
}
}
)
}
,
getActionServiceOption
()
{
this
.
$ajax
.
post
({
url
:
this
.
$api
.
GET_ACTION_LIST
,
}
).
then
(
res
=>
{
if
(
res
.
code
==
'200'
)
{
let
result
=
this
.
$com
.
confirm
(
res
,
'data.content'
,
[])
for
(
let
i
=
0
;
i
<
result
.
length
;
i
++
)
{
this
.
actionOptions
.
push
(
result
[
i
])
}
}
}
)
}
,
confirmJson
(
rule
,
value
,
callback
)
{
if
(
!
value
||
value
==
undefined
)
{
callback
(
'不能为空!'
)
}
else
if
(
typeof
value
==
'string'
)
{
try
{
let
obj
=
JSON
.
parse
(
value
)
if
(
typeof
obj
==
'object'
&&
obj
){
callback
()
}
else
{
callback
(
'不是有效的JSON格式'
)
}
}
catch
(
e
)
{
callback
(
'不是有效的JSON格式'
)
}
}
}
,
onDelete
(
id
)
{
this
.
$ajax
.
delete
({
url
:
this
.
$api
.
DELETE_RULE_RECORD
.
replace
(
'{id
}
'
,
id
)
}
).
then
(
res
=>
{
if
(
res
.
code
==
'200'
)
{
this
.
$message
.
success
(
'删除成功!'
)
this
.
getList
()
}
}
)
}
,
addRow
()
{
this
.
rowLoop
.
push
({
name
:
''
,
key
:
''
}
)
}
,
deleteRow
()
{
}
,
getList
()
{
this
.
$ajax
.
post
({
url
:
this
.
$api
.
GET_RULES_LIST
}
).
then
(
res
=>
{
this
.
list
=
this
.
$com
.
confirm
(
res
,
'data.content'
,
[])
}
)
}
,
pageChange
(
val
)
{
this
.
pagination
.
pageNo
=
val
this
.
pagination
.
current
=
val
// this.getCompanyList()
}
,
onSelectChange
(
selectedRowKeys
)
{
this
.
selectedRowKeys
=
selectedRowKeys
}
,
onRegister
()
{
this
.
current
=
0
this
.
form
.
resetFields
()
this
.
isShow
=
!
this
.
isShow
}
,
handlePrevStep
()
{
if
(
this
.
current
>=
1
)
{
this
.
current
-=
1
}
}
,
handleNextStep
()
{
this
.
current
+=
1
}
,
handleRegisterOk
()
{
this
.
form
.
validateFields
((
err
,
values
)
=>
{
if
(
!
err
)
{
let
formContent
=
this
.
form
.
getFieldsValue
()
this
.
$ajax
.
post
({
url
:
this
.
$api
.
POST_ADD_RULE_RECORD
,
params
:
formContent
}
).
then
(
res
=>
{
if
(
res
.
code
==
'200'
)
{
this
.
$message
.
success
(
'新增成功!'
)
this
.
isShow
=
!
this
.
isShow
this
.
form
.
resetFields
()
this
.
getList
()
}
}
)
}
else
{
this
.
$message
.
info
(
'请填写表单所有项目!'
)
}
}
)
}
}
}
<
/script
>
<
style
scoped
>
.
itemMargin
{
margin
-
top
:
14
px
;
margin
-
bottom
:
14
px
}
<
/style
>
src/views/login.vue
View file @
ff3f97df
...
...
@@ -78,23 +78,23 @@ export default {
this
.
form
.
validateFields
((
err
,
values
)
=>
{
if
(
!
err
)
{
const
params
=
{
'username'
:
this
.
form
.
getFieldValue
(
'username'
),
'pwd'
:
encryptDes
(
this
.
form
.
getFieldValue
(
'pwd'
))
'client_id'
:
this
.
form
.
getFieldValue
(
'username'
),
'client_secret'
:
this
.
form
.
getFieldValue
(
'pwd'
),
'grant_type'
:
'client_credentials'
}
this
.
$ajax
.
post
({
url
:
this
.
$api
.
POST_LOGIN
,
params
,
url
:
this
.
$api
.
POST_LOGIN
+
'?client_id='
+
this
.
form
.
getFieldValue
(
'username'
)
+
'&client_secret='
+
this
.
form
.
getFieldValue
(
'pwd'
)
+
'&grant_type=client_credentials'
}).
then
(
res
=>
{
const
store
=
JSON
.
parse
(
sessionStorage
.
getItem
(
'VuexStore'
))
if
(
store
)
store
.
content
=
''
sessionStorage
.
setItem
(
'VuexStore'
,
JSON
.
stringify
(
store
))
// 当前登录的账号密码的返回值
if
(
res
.
code
==
200
)
{
if
(
!!
res
.
access_token
)
{
res
.
token
=
this
.
$com
.
confirm
(
res
,
'data.content'
,
[])
// console.log(res.token)
this
.
$cookie
.
set
(
'token'
,
'bearer '
+
res
.
token
.
access_token
)
this
.
$cookie
.
set
(
'userName'
,
res
.
name
)
// 存储当前账号的用户名
this
.
$cookie
.
set
(
'token'
,
'bearer '
+
res
.
access_token
)
//
this.$cookie.set('userName', res.name) // 存储当前账号的用户名
this
.
$router
.
push
({
path
:
'/businessSystem/businessSystemList'
})
...
...
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