Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
datax-cloud
Overview
Overview
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
黄营
datax-cloud
Commits
d0b02276
Commit
d0b02276
authored
Jun 28, 2020
by
yuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2.0.0项目初始化
parent
15f0d08b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
224 additions
and
77 deletions
+224
-77
ApiHeaderController.java
.../data/market/api/call/controller/ApiHeaderController.java
+23
-0
ApiHeaderService.java
...ervice/data/market/api/call/service/ApiHeaderService.java
+8
-0
ApiHeaderServiceImpl.java
...ta/market/api/call/service/impl/ApiHeaderServiceImpl.java
+26
-0
ApiHeader.java
...n/java/cn/datax/service/data/market/api/vo/ApiHeader.java
+15
-0
SqlParseVo.java
.../java/cn/datax/service/data/market/api/vo/SqlParseVo.java
+1
-0
ApiMaskServiceImpl.java
.../service/data/market/service/impl/ApiMaskServiceImpl.java
+8
-0
apicall.js
datax-ui/src/api/market/apicall.js
+13
-4
DataSetAdd.vue
datax-ui/src/views/factory/dataset/DataSetAdd.vue
+1
-1
DataSetEdit.vue
datax-ui/src/views/factory/dataset/DataSetEdit.vue
+3
-0
ApiMaskEdit.vue
datax-ui/src/views/market/apimask/ApiMaskEdit.vue
+1
-6
DataApiAdd.vue
datax-ui/src/views/market/dataapi/DataApiAdd.vue
+49
-25
DataApiCall.vue
datax-ui/src/views/market/dataapi/DataApiCall.vue
+0
-0
DataApiDetail.vue
datax-ui/src/views/market/dataapi/DataApiDetail.vue
+15
-13
DataApiEdit.vue
datax-ui/src/views/market/dataapi/DataApiEdit.vue
+49
-25
DataApiList.vue
datax-ui/src/views/market/dataapi/DataApiList.vue
+5
-1
index.vue
datax-ui/src/views/market/dataapi/index.vue
+7
-2
No files found.
datax-modules/data-market-service-parent/data-market-service-api-call/src/main/java/cn/datax/service/data/market/api/call/controller/ApiHeaderController.java
0 → 100644
View file @
d0b02276
package
cn
.
datax
.
service
.
data
.
market
.
api
.
call
.
controller
;
import
cn.datax.common.base.BaseController
;
import
cn.datax.common.core.R
;
import
cn.datax.service.data.market.api.call.service.ApiHeaderService
;
import
cn.datax.service.data.market.api.vo.ApiHeader
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
public
class
ApiHeaderController
extends
BaseController
{
@Autowired
private
ApiHeaderService
apiHeaderService
;
@GetMapping
(
value
=
"/{id}/header"
)
public
R
getApiHeader
(
@PathVariable
String
id
){
ApiHeader
apiHeader
=
apiHeaderService
.
getApiHeader
(
id
);
return
R
.
ok
().
setData
(
apiHeader
);
}
}
datax-modules/data-market-service-parent/data-market-service-api-call/src/main/java/cn/datax/service/data/market/api/call/service/ApiHeaderService.java
0 → 100644
View file @
d0b02276
package
cn
.
datax
.
service
.
data
.
market
.
api
.
call
.
service
;
import
cn.datax.service.data.market.api.vo.ApiHeader
;
public
interface
ApiHeaderService
{
ApiHeader
getApiHeader
(
String
id
);
}
datax-modules/data-market-service-parent/data-market-service-api-call/src/main/java/cn/datax/service/data/market/api/call/service/impl/ApiHeaderServiceImpl.java
0 → 100644
View file @
d0b02276
package
cn
.
datax
.
service
.
data
.
market
.
api
.
call
.
service
.
impl
;
import
cn.datax.common.utils.MD5Util
;
import
cn.datax.common.utils.SecurityUtil
;
import
cn.datax.service.data.market.api.call.service.ApiHeaderService
;
import
cn.datax.service.data.market.api.vo.ApiHeader
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
@Service
@Transactional
(
propagation
=
Propagation
.
SUPPORTS
,
readOnly
=
true
,
rollbackFor
=
Exception
.
class
)
public
class
ApiHeaderServiceImpl
implements
ApiHeaderService
{
@Override
public
ApiHeader
getApiHeader
(
String
id
)
{
ApiHeader
apiHeader
=
new
ApiHeader
();
try
{
MD5Util
mt
=
MD5Util
.
getInstance
();
apiHeader
.
setApiKey
(
mt
.
encode
(
id
));
apiHeader
.
setSecretKey
(
mt
.
encode
(
SecurityUtil
.
getUserId
()));
}
catch
(
Exception
e
)
{
}
return
apiHeader
;
}
}
datax-modules/data-market-service-parent/data-market-service-api/src/main/java/cn/datax/service/data/market/api/vo/ApiHeader.java
0 → 100644
View file @
d0b02276
package
cn
.
datax
.
service
.
data
.
market
.
api
.
vo
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
ApiHeader
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
String
authorization
;
private
String
apiKey
;
private
String
secretKey
;
}
datax-modules/data-market-service-parent/data-market-service-api/src/main/java/cn/datax/service/data/market/api/vo/SqlParseVo.java
View file @
d0b02276
...
@@ -6,6 +6,7 @@ import lombok.Data;
...
@@ -6,6 +6,7 @@ import lombok.Data;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.List
;
import
java.util.List
;
@Data
@Data
public
class
SqlParseVo
implements
Serializable
{
public
class
SqlParseVo
implements
Serializable
{
...
...
datax-modules/data-market-service-parent/data-market-service/src/main/java/cn/datax/service/data/market/service/impl/ApiMaskServiceImpl.java
View file @
d0b02276
...
@@ -2,12 +2,15 @@ package cn.datax.service.data.market.service.impl;
...
@@ -2,12 +2,15 @@ package cn.datax.service.data.market.service.impl;
import
cn.datax.common.base.BaseServiceImpl
;
import
cn.datax.common.base.BaseServiceImpl
;
import
cn.datax.common.core.RedisConstant
;
import
cn.datax.common.core.RedisConstant
;
import
cn.datax.common.exception.DataException
;
import
cn.datax.service.data.market.api.dto.ApiMaskDto
;
import
cn.datax.service.data.market.api.dto.ApiMaskDto
;
import
cn.datax.service.data.market.api.entity.ApiMaskEntity
;
import
cn.datax.service.data.market.api.entity.ApiMaskEntity
;
import
cn.datax.service.data.market.dao.ApiMaskDao
;
import
cn.datax.service.data.market.dao.ApiMaskDao
;
import
cn.datax.service.data.market.mapstruct.ApiMaskMapper
;
import
cn.datax.service.data.market.mapstruct.ApiMaskMapper
;
import
cn.datax.service.data.market.service.ApiMaskService
;
import
cn.datax.service.data.market.service.ApiMaskService
;
import
cn.datax.service.system.api.entity.DeptEntity
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cache.annotation.CacheConfig
;
import
org.springframework.cache.annotation.CacheConfig
;
import
org.springframework.cache.annotation.CacheEvict
;
import
org.springframework.cache.annotation.CacheEvict
;
...
@@ -42,6 +45,11 @@ public class ApiMaskServiceImpl extends BaseServiceImpl<ApiMaskDao, ApiMaskEntit
...
@@ -42,6 +45,11 @@ public class ApiMaskServiceImpl extends BaseServiceImpl<ApiMaskDao, ApiMaskEntit
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
saveApiMask
(
ApiMaskDto
apiMaskDto
)
{
public
void
saveApiMask
(
ApiMaskDto
apiMaskDto
)
{
ApiMaskEntity
apiMask
=
apiMaskMapper
.
toEntity
(
apiMaskDto
);
ApiMaskEntity
apiMask
=
apiMaskMapper
.
toEntity
(
apiMaskDto
);
// 校验api唯一
int
n
=
apiMaskDao
.
selectCount
(
Wrappers
.<
ApiMaskEntity
>
lambdaQuery
().
eq
(
ApiMaskEntity:
:
getApiId
,
apiMask
.
getApiId
()));
if
(
n
>
0
){
throw
new
DataException
(
"该api已进行过脱敏配置"
);
}
apiMaskDao
.
insert
(
apiMask
);
apiMaskDao
.
insert
(
apiMask
);
}
}
...
...
datax-ui/src/api/market/apicall.js
View file @
d0b02276
import
request
from
'@/utils/request'
import
request
from
'@/utils/request'
export
function
getApi
Call
(
data
)
{
export
function
getApi
Header
(
id
)
{
return
request
({
return
request
({
url
:
'/data/api/v1/list'
,
url
:
'/data/api/'
+
id
+
'/header'
,
method
:
'get'
})
}
export
function
getApiCall
(
url
,
header
,
data
)
{
return
request
({
url
:
'/data/api/v1'
+
url
,
method
:
'get'
,
method
:
'get'
,
headers
:
header
,
params
:
data
params
:
data
})
})
}
}
export
function
postApiCall
(
data
)
{
export
function
postApiCall
(
url
,
header
,
data
)
{
return
request
({
return
request
({
url
:
'/data/api/v1
/list'
,
url
:
'/data/api/v1
'
+
url
,
method
:
'post'
,
method
:
'post'
,
headers
:
header
,
data
:
data
data
:
data
})
})
}
}
datax-ui/src/views/factory/dataset/DataSetAdd.vue
View file @
d0b02276
...
@@ -137,7 +137,7 @@ export default {
...
@@ -137,7 +137,7 @@ export default {
// 表单校验
// 表单校验
rules
:
{
rules
:
{
sourceId
:
[
sourceId
:
[
{
required
:
true
,
message
:
'数据源不能为空'
,
trigger
:
'
blur
'
}
{
required
:
true
,
message
:
'数据源不能为空'
,
trigger
:
'
change
'
}
],
],
setName
:
[
setName
:
[
{
required
:
true
,
message
:
'数据集名称不能为空'
,
trigger
:
'blur'
}
{
required
:
true
,
message
:
'数据集名称不能为空'
,
trigger
:
'blur'
}
...
...
datax-ui/src/views/factory/dataset/DataSetEdit.vue
View file @
d0b02276
...
@@ -130,6 +130,9 @@ export default {
...
@@ -130,6 +130,9 @@ export default {
form
:
{},
form
:
{},
// 表单校验
// 表单校验
rules
:
{
rules
:
{
sourceId
:
[
{
required
:
true
,
message
:
'数据源不能为空'
,
trigger
:
'change'
}
],
setName
:
[
setName
:
[
{
required
:
true
,
message
:
'数据集名称不能为空'
,
trigger
:
'blur'
}
{
required
:
true
,
message
:
'数据集名称不能为空'
,
trigger
:
'blur'
}
]
]
...
...
datax-ui/src/views/market/apimask/ApiMaskEdit.vue
View file @
d0b02276
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
<div
:style=
"classCardbody"
>
<div
:style=
"classCardbody"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-form-item
label=
"数据API"
prop=
"apiId"
>
<el-form-item
label=
"数据API"
prop=
"apiId"
>
<el-select
v-model=
"form.apiId"
placeholder=
"请选择数据API"
@
change=
"apiSelectChanged"
>
<el-select
v-model=
"form.apiId"
placeholder=
"请选择数据API"
disabled
>
<el-option
<el-option
v-for=
"api in apiOptions"
v-for=
"api in apiOptions"
:key=
"api.id"
:key=
"api.id"
...
@@ -254,11 +254,6 @@ export default {
...
@@ -254,11 +254,6 @@ export default {
}
}
})
})
},
},
apiSelectChanged
(
val
)
{
this
.
resParamList
=
this
.
apiOptions
.
find
(
function
(
item
)
{
return
item
.
id
===
val
}).
resParams
},
fieldRule
(
fieldName
)
{
fieldRule
(
fieldName
)
{
this
.
cipher
.
open
=
true
this
.
cipher
.
open
=
true
this
.
form2
.
fieldName
=
fieldName
this
.
form2
.
fieldName
=
fieldName
...
...
datax-ui/src/views/market/dataapi/DataApiAdd.vue
View file @
d0b02276
...
@@ -186,36 +186,44 @@
...
@@ -186,36 +186,44 @@
</el-table-column>
</el-table-column>
<el-table-column
prop=
"paramType"
label=
"参数类型"
align=
"center"
show-overflow-tooltip
>
<el-table-column
prop=
"paramType"
label=
"参数类型"
align=
"center"
show-overflow-tooltip
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-select
v-model=
"scope.row.paramType"
placeholder=
"请选择参数类型"
>
<el-form-item
:prop=
" 'reqParams.' + scope.$index + '.paramType' "
:rules=
"rules3.paramType"
>
<el-option
<el-select
v-model=
"scope.row.paramType"
placeholder=
"请选择参数类型"
>
v-for=
"dict in paramTypeOptions"
<el-option
:key=
"dict.id"
v-for=
"dict in paramTypeOptions"
:label=
"dict.itemValue"
:key=
"dict.id"
:value=
"dict.itemText"
:label=
"dict.itemValue"
></el-option>
:value=
"dict.itemText"
</el-select>
></el-option>
</el-select>
</el-form-item>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"whereType"
label=
"操作符"
align=
"center"
show-overflow-tooltip
>
<el-table-column
prop=
"whereType"
label=
"操作符"
align=
"center"
show-overflow-tooltip
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-select
v-model=
"scope.row.whereType"
placeholder=
"请选择操作符"
>
<el-form-item
:prop=
" 'reqParams.' + scope.$index + '.whereType' "
:rules=
"rules3.whereType"
>
<el-option
<el-select
v-model=
"scope.row.whereType"
placeholder=
"请选择操作符"
>
v-for=
"dict in whereTypeOptions"
<el-option
:key=
"dict.id"
v-for=
"dict in whereTypeOptions"
:label=
"dict.itemValue"
:key=
"dict.id"
:value=
"dict.itemText"
:label=
"dict.itemValue"
></el-option>
:value=
"dict.itemText"
</el-select>
></el-option>
</el-select>
</el-form-item>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"exampleValue"
label=
"示例值"
align=
"center"
show-overflow-tooltip
>
<el-table-column
prop=
"exampleValue"
label=
"示例值"
align=
"center"
show-overflow-tooltip
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-input
v-model=
"scope.row.exampleValue"
placeholder=
"请输入示例值"
/>
<el-form-item
:prop=
" 'reqParams.' + scope.$index + '.exampleValue' "
:rules=
"rules3.exampleValue"
>
<el-input
v-model=
"scope.row.exampleValue"
placeholder=
"请输入示例值"
/>
</el-form-item>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"defaultValue"
label=
"默认值"
align=
"center"
show-overflow-tooltip
>
<el-table-column
prop=
"defaultValue"
label=
"默认值"
align=
"center"
show-overflow-tooltip
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-input
v-model=
"scope.row.defaultValue"
placeholder=
"请输入默认值"
/>
<el-form-item
:prop=
" 'reqParams.' + scope.$index + '.defaultValue' "
:rules=
"rules3.defaultValue"
>
<el-input
v-model=
"scope.row.defaultValue"
placeholder=
"请输入默认值"
/>
</el-form-item>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
...
@@ -237,7 +245,9 @@
...
@@ -237,7 +245,9 @@
</el-table-column>
</el-table-column>
<el-table-column
prop=
"exampleValue"
label=
"示例值"
align=
"center"
show-overflow-tooltip
>
<el-table-column
prop=
"exampleValue"
label=
"示例值"
align=
"center"
show-overflow-tooltip
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-input
v-model=
"scope.row.exampleValue"
placeholder=
"请输入示例值"
/>
<el-form-item
:prop=
" 'resParams.' + scope.$index + '.exampleValue' "
:rules=
"rules3.exampleValue"
>
<el-input
v-model=
"scope.row.exampleValue"
placeholder=
"请输入示例值"
/>
</el-form-item>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
...
@@ -281,7 +291,8 @@ export default {
...
@@ -281,7 +291,8 @@ export default {
showList
:
true
,
showList
:
true
,
showAdd
:
false
,
showAdd
:
false
,
showEdit
:
false
,
showEdit
:
false
,
showDetail
:
false
showDetail
:
false
,
showCall
:
false
},
},
// 保存按钮
// 保存按钮
loadingOptions
:
{
loadingOptions
:
{
...
@@ -320,10 +331,10 @@ export default {
...
@@ -320,10 +331,10 @@ export default {
{
required
:
true
,
message
:
'API路径不能为空'
,
trigger
:
'blur'
}
{
required
:
true
,
message
:
'API路径不能为空'
,
trigger
:
'blur'
}
],
],
reqMethod
:
[
reqMethod
:
[
{
required
:
true
,
message
:
'请求方式不能为空'
,
trigger
:
'
blur
'
}
{
required
:
true
,
message
:
'请求方式不能为空'
,
trigger
:
'
change
'
}
],
],
resType
:
[
resType
:
[
{
required
:
true
,
message
:
'返回格式不能为空'
,
trigger
:
'
blur
'
}
{
required
:
true
,
message
:
'返回格式不能为空'
,
trigger
:
'
change
'
}
]
]
},
},
form2
:
{
form2
:
{
...
@@ -335,17 +346,30 @@ export default {
...
@@ -335,17 +346,30 @@ export default {
},
},
rules2
:
{
rules2
:
{
configType
:
[
configType
:
[
{
required
:
true
,
message
:
'配置方式不能为空'
,
trigger
:
'
blur
'
}
{
required
:
true
,
message
:
'配置方式不能为空'
,
trigger
:
'
change
'
}
],
],
sourceId
:
[
sourceId
:
[
{
required
:
true
,
message
:
'数据源不能为空'
,
trigger
:
'
blur
'
}
{
required
:
true
,
message
:
'数据源不能为空'
,
trigger
:
'
change
'
}
]
]
},
},
form3
:
{
form3
:
{
reqParams
:
[],
reqParams
:
[],
resParams
:
[]
resParams
:
[]
},
},
rules3
:
{},
rules3
:
{
paramType
:
[
{
required
:
true
,
message
:
'参数类型不能为空'
,
trigger
:
'change'
}
],
whereType
:
[
{
required
:
true
,
message
:
'操作符不能为空'
,
trigger
:
'change'
}
],
exampleValue
:
[
{
required
:
true
,
message
:
'示例值不能为空'
,
trigger
:
'blur'
}
],
defaultValue
:
[
{
required
:
true
,
message
:
'默认值不能为空'
,
trigger
:
'blur'
}
]
},
// 请求方式数据字典
// 请求方式数据字典
reqMethodOptions
:
[],
reqMethodOptions
:
[],
// 返回格式数据字典
// 返回格式数据字典
...
...
datax-ui/src/views/market/dataapi/DataApiCall.vue
0 → 100644
View file @
d0b02276
This diff is collapsed.
Click to expand it.
datax-ui/src/views/market/dataapi/DataApiDetail.vue
View file @
d0b02276
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
<div
slot=
"header"
class=
"clearfix"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
{{
title
}}
</span>
<span>
{{
title
}}
</span>
<el-button-group
style=
"float: right;"
>
<el-button-group
style=
"float: right;"
>
<el-button
size=
"mini"
icon=
"el-icon-s-data"
round
@
click=
"apiCall"
>
数据调用
</el-button>
<el-button
size=
"mini"
icon=
"el-icon-back"
round
@
click=
"showCard"
>
返回
</el-button>
<el-button
size=
"mini"
icon=
"el-icon-back"
round
@
click=
"showCard"
>
返回
</el-button>
</el-button-group>
</el-button-group>
</div>
</div>
...
@@ -13,7 +14,7 @@
...
@@ -13,7 +14,7 @@
<el-step
title=
"执行配置"
></el-step>
<el-step
title=
"执行配置"
></el-step>
<el-step
title=
"参数配置"
></el-step>
<el-step
title=
"参数配置"
></el-step>
</el-steps>
</el-steps>
<el-form
ref=
"form1"
:model=
"form1"
:rules=
"rules1"
label-width=
"80px"
v-if=
"active == 1"
disabled
>
<el-form
ref=
"form1"
:model=
"form1"
label-width=
"80px"
v-if=
"active == 1"
disabled
>
<el-form-item
label=
"API名称"
prop=
"apiName"
>
<el-form-item
label=
"API名称"
prop=
"apiName"
>
<el-input
v-model=
"form1.apiName"
placeholder=
"请输入API名称"
/>
<el-input
v-model=
"form1.apiName"
placeholder=
"请输入API名称"
/>
</el-form-item>
</el-form-item>
...
@@ -74,7 +75,7 @@
...
@@ -74,7 +75,7 @@
<el-input
v-model=
"form1.remark"
type=
"textarea"
placeholder=
"请输入内容"
/>
<el-input
v-model=
"form1.remark"
type=
"textarea"
placeholder=
"请输入内容"
/>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
<el-form
ref=
"form2"
:model=
"form2"
:rules=
"rules2"
label-width=
"80px"
v-if=
"active == 2"
disabled
>
<el-form
ref=
"form2"
:model=
"form2"
label-width=
"80px"
v-if=
"active == 2"
disabled
>
<el-form-item
label=
"配置方式"
prop=
"configType"
>
<el-form-item
label=
"配置方式"
prop=
"configType"
>
<el-select
v-model=
"form2.configType"
placeholder=
"请选择配置方式"
>
<el-select
v-model=
"form2.configType"
placeholder=
"请选择配置方式"
>
<el-option
<el-option
...
@@ -161,7 +162,7 @@
...
@@ -161,7 +162,7 @@
</el-col>
</el-col>
</el-row>
</el-row>
</el-form>
</el-form>
<el-form
ref=
"form3"
:model=
"form3"
:rules=
"rules3"
label-width=
"80px"
v-if=
"active == 3"
disabled
>
<el-form
ref=
"form3"
:model=
"form3"
label-width=
"80px"
v-if=
"active == 3"
disabled
>
<el-form-item
label=
"请求参数"
>
<el-form-item
label=
"请求参数"
>
<el-table
:data=
"form3.reqParams"
stripe
border
<el-table
:data=
"form3.reqParams"
stripe
border
:max-height=
"300"
:max-height=
"300"
...
@@ -205,14 +206,8 @@
...
@@ -205,14 +206,8 @@
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"exampleValue"
label=
"示例值"
align=
"center"
show-overflow-tooltip
>
<el-table-column
prop=
"exampleValue"
label=
"示例值"
align=
"center"
show-overflow-tooltip
>
<
template
slot-scope=
"scope"
>
<el-input
v-model=
"scope.row.exampleValue"
placeholder=
"请输入示例值"
/>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"defaultValue"
label=
"默认值"
align=
"center"
show-overflow-tooltip
>
<el-table-column
prop=
"defaultValue"
label=
"默认值"
align=
"center"
show-overflow-tooltip
>
<
template
slot-scope=
"scope"
>
<el-input
v-model=
"scope.row.defaultValue"
placeholder=
"请输入默认值"
/>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
</el-form-item>
</el-form-item>
...
@@ -232,9 +227,6 @@
...
@@ -232,9 +227,6 @@
<el-table-column
prop=
"dataType"
label=
"数据类型"
align=
"center"
show-overflow-tooltip
>
<el-table-column
prop=
"dataType"
label=
"数据类型"
align=
"center"
show-overflow-tooltip
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"exampleValue"
label=
"示例值"
align=
"center"
show-overflow-tooltip
>
<el-table-column
prop=
"exampleValue"
label=
"示例值"
align=
"center"
show-overflow-tooltip
>
<
template
slot-scope=
"scope"
>
<el-input
v-model=
"scope.row.exampleValue"
placeholder=
"请输入示例值"
/>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
</el-form-item>
</el-form-item>
...
@@ -277,7 +269,8 @@ export default {
...
@@ -277,7 +269,8 @@ export default {
showList
:
true
,
showList
:
true
,
showAdd
:
false
,
showAdd
:
false
,
showEdit
:
false
,
showEdit
:
false
,
showDetail
:
false
showDetail
:
false
,
showCall
:
false
},
},
active
:
1
,
active
:
1
,
// 表单参数
// 表单参数
...
@@ -462,6 +455,15 @@ export default {
...
@@ -462,6 +455,15 @@ export default {
}
}
}
}
})
})
},
apiCall
()
{
this
.
showOptions
.
data
.
id
=
this
.
data
.
id
this
.
showOptions
.
showList
=
false
this
.
showOptions
.
showAdd
=
false
this
.
showOptions
.
showEdit
=
false
this
.
showOptions
.
showDetail
=
false
this
.
showOptions
.
showCall
=
true
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
}
}
}
}
}
}
...
...
datax-ui/src/views/market/dataapi/DataApiEdit.vue
View file @
d0b02276
...
@@ -186,36 +186,44 @@
...
@@ -186,36 +186,44 @@
</el-table-column>
</el-table-column>
<el-table-column
prop=
"paramType"
label=
"参数类型"
align=
"center"
show-overflow-tooltip
>
<el-table-column
prop=
"paramType"
label=
"参数类型"
align=
"center"
show-overflow-tooltip
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-select
v-model=
"scope.row.paramType"
placeholder=
"请选择参数类型"
>
<el-form-item
:prop=
" 'reqParams.' + scope.$index + '.paramType' "
:rules=
"rules3.paramType"
>
<el-option
<el-select
v-model=
"scope.row.paramType"
placeholder=
"请选择参数类型"
>
v-for=
"dict in paramTypeOptions"
<el-option
:key=
"dict.id"
v-for=
"dict in paramTypeOptions"
:label=
"dict.itemValue"
:key=
"dict.id"
:value=
"dict.itemText"
:label=
"dict.itemValue"
></el-option>
:value=
"dict.itemText"
</el-select>
></el-option>
</el-select>
</el-form-item>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"whereType"
label=
"操作符"
align=
"center"
show-overflow-tooltip
>
<el-table-column
prop=
"whereType"
label=
"操作符"
align=
"center"
show-overflow-tooltip
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-select
v-model=
"scope.row.whereType"
placeholder=
"请选择操作符"
>
<el-form-item
:prop=
" 'reqParams.' + scope.$index + '.whereType' "
:rules=
"rules3.whereType"
>
<el-option
<el-select
v-model=
"scope.row.whereType"
placeholder=
"请选择操作符"
>
v-for=
"dict in whereTypeOptions"
<el-option
:key=
"dict.id"
v-for=
"dict in whereTypeOptions"
:label=
"dict.itemValue"
:key=
"dict.id"
:value=
"dict.itemText"
:label=
"dict.itemValue"
></el-option>
:value=
"dict.itemText"
</el-select>
></el-option>
</el-select>
</el-form-item>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"exampleValue"
label=
"示例值"
align=
"center"
show-overflow-tooltip
>
<el-table-column
prop=
"exampleValue"
label=
"示例值"
align=
"center"
show-overflow-tooltip
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-input
v-model=
"scope.row.exampleValue"
placeholder=
"请输入示例值"
/>
<el-form-item
:prop=
" 'reqParams.' + scope.$index + '.exampleValue' "
:rules=
"rules3.exampleValue"
>
<el-input
v-model=
"scope.row.exampleValue"
placeholder=
"请输入示例值"
/>
</el-form-item>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
prop=
"defaultValue"
label=
"默认值"
align=
"center"
show-overflow-tooltip
>
<el-table-column
prop=
"defaultValue"
label=
"默认值"
align=
"center"
show-overflow-tooltip
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-input
v-model=
"scope.row.defaultValue"
placeholder=
"请输入默认值"
/>
<el-form-item
:prop=
" 'reqParams.' + scope.$index + '.defaultValue' "
:rules=
"rules3.defaultValue"
>
<el-input
v-model=
"scope.row.defaultValue"
placeholder=
"请输入默认值"
/>
</el-form-item>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
...
@@ -237,7 +245,9 @@
...
@@ -237,7 +245,9 @@
</el-table-column>
</el-table-column>
<el-table-column
prop=
"exampleValue"
label=
"示例值"
align=
"center"
show-overflow-tooltip
>
<el-table-column
prop=
"exampleValue"
label=
"示例值"
align=
"center"
show-overflow-tooltip
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-input
v-model=
"scope.row.exampleValue"
placeholder=
"请输入示例值"
/>
<el-form-item
:prop=
" 'resParams.' + scope.$index + '.exampleValue' "
:rules=
"rules3.exampleValue"
>
<el-input
v-model=
"scope.row.exampleValue"
placeholder=
"请输入示例值"
/>
</el-form-item>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
...
@@ -281,7 +291,8 @@ export default {
...
@@ -281,7 +291,8 @@ export default {
showList
:
true
,
showList
:
true
,
showAdd
:
false
,
showAdd
:
false
,
showEdit
:
false
,
showEdit
:
false
,
showDetail
:
false
showDetail
:
false
,
showCall
:
false
},
},
// 保存按钮
// 保存按钮
loadingOptions
:
{
loadingOptions
:
{
...
@@ -320,10 +331,10 @@ export default {
...
@@ -320,10 +331,10 @@ export default {
{
required
:
true
,
message
:
'API路径不能为空'
,
trigger
:
'blur'
}
{
required
:
true
,
message
:
'API路径不能为空'
,
trigger
:
'blur'
}
],
],
reqMethod
:
[
reqMethod
:
[
{
required
:
true
,
message
:
'请求方式不能为空'
,
trigger
:
'
blur
'
}
{
required
:
true
,
message
:
'请求方式不能为空'
,
trigger
:
'
change
'
}
],
],
resType
:
[
resType
:
[
{
required
:
true
,
message
:
'返回格式不能为空'
,
trigger
:
'
blur
'
}
{
required
:
true
,
message
:
'返回格式不能为空'
,
trigger
:
'
change
'
}
]
]
},
},
form2
:
{
form2
:
{
...
@@ -335,17 +346,30 @@ export default {
...
@@ -335,17 +346,30 @@ export default {
},
},
rules2
:
{
rules2
:
{
configType
:
[
configType
:
[
{
required
:
true
,
message
:
'配置方式不能为空'
,
trigger
:
'
blur
'
}
{
required
:
true
,
message
:
'配置方式不能为空'
,
trigger
:
'
change
'
}
],
],
sourceId
:
[
sourceId
:
[
{
required
:
true
,
message
:
'数据源不能为空'
,
trigger
:
'
blur
'
}
{
required
:
true
,
message
:
'数据源不能为空'
,
trigger
:
'
change
'
}
]
]
},
},
form3
:
{
form3
:
{
reqParams
:
[],
reqParams
:
[],
resParams
:
[]
resParams
:
[]
},
},
rules3
:
{},
rules3
:
{
paramType
:
[
{
required
:
true
,
message
:
'参数类型不能为空'
,
trigger
:
'change'
}
],
whereType
:
[
{
required
:
true
,
message
:
'操作符不能为空'
,
trigger
:
'change'
}
],
exampleValue
:
[
{
required
:
true
,
message
:
'示例值不能为空'
,
trigger
:
'blur'
}
],
defaultValue
:
[
{
required
:
true
,
message
:
'默认值不能为空'
,
trigger
:
'blur'
}
]
},
// 请求方式数据字典
// 请求方式数据字典
reqMethodOptions
:
[],
reqMethodOptions
:
[],
// 返回格式数据字典
// 返回格式数据字典
...
...
datax-ui/src/views/market/dataapi/DataApiList.vue
View file @
d0b02276
...
@@ -173,7 +173,8 @@ export default {
...
@@ -173,7 +173,8 @@ export default {
showList
:
true
,
showList
:
true
,
showAdd
:
false
,
showAdd
:
false
,
showEdit
:
false
,
showEdit
:
false
,
showDetail
:
false
showDetail
:
false
,
showCall
:
false
},
},
// 遮罩层
// 遮罩层
loading
:
true
,
loading
:
true
,
...
@@ -272,6 +273,7 @@ export default {
...
@@ -272,6 +273,7 @@ export default {
this
.
showOptions
.
showAdd
=
true
this
.
showOptions
.
showAdd
=
true
this
.
showOptions
.
showEdit
=
false
this
.
showOptions
.
showEdit
=
false
this
.
showOptions
.
showDetail
=
false
this
.
showOptions
.
showDetail
=
false
this
.
showOptions
.
showCall
=
false
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
},
},
/** 修改按钮操作 */
/** 修改按钮操作 */
...
@@ -281,6 +283,7 @@ export default {
...
@@ -281,6 +283,7 @@ export default {
this
.
showOptions
.
showAdd
=
false
this
.
showOptions
.
showAdd
=
false
this
.
showOptions
.
showEdit
=
true
this
.
showOptions
.
showEdit
=
true
this
.
showOptions
.
showDetail
=
false
this
.
showOptions
.
showDetail
=
false
this
.
showOptions
.
showCall
=
false
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
},
},
/** 详情按钮操作 */
/** 详情按钮操作 */
...
@@ -290,6 +293,7 @@ export default {
...
@@ -290,6 +293,7 @@ export default {
this
.
showOptions
.
showAdd
=
false
this
.
showOptions
.
showAdd
=
false
this
.
showOptions
.
showEdit
=
false
this
.
showOptions
.
showEdit
=
false
this
.
showOptions
.
showDetail
=
true
this
.
showOptions
.
showDetail
=
true
this
.
showOptions
.
showCall
=
false
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
},
},
/** 删除按钮操作 */
/** 删除按钮操作 */
...
...
datax-ui/src/views/market/dataapi/index.vue
View file @
d0b02276
...
@@ -12,6 +12,9 @@
...
@@ -12,6 +12,9 @@
<transition
name=
"el-zoom-in-bottom"
>
<transition
name=
"el-zoom-in-bottom"
>
<data-api-detail
v-if=
"options.showDetail"
:data=
"options.data"
@
showCard=
"showCard"
></data-api-detail>
<data-api-detail
v-if=
"options.showDetail"
:data=
"options.data"
@
showCard=
"showCard"
></data-api-detail>
</transition>
</transition>
<transition
name=
"el-zoom-in-bottom"
>
<data-api-call
v-if=
"options.showCall"
:data=
"options.data"
@
showCard=
"showCard"
></data-api-call>
</transition>
</div>
</div>
</
template
>
</
template
>
...
@@ -20,10 +23,11 @@ import DataApiList from './DataApiList'
...
@@ -20,10 +23,11 @@ import DataApiList from './DataApiList'
import
DataApiAdd
from
'./DataApiAdd'
import
DataApiAdd
from
'./DataApiAdd'
import
DataApiEdit
from
'./DataApiEdit'
import
DataApiEdit
from
'./DataApiEdit'
import
DataApiDetail
from
'./DataApiDetail'
import
DataApiDetail
from
'./DataApiDetail'
import
DataApiCall
from
'./DataApiCall'
export
default
{
export
default
{
name
:
'DataApi'
,
name
:
'DataApi'
,
components
:
{
DataApiList
,
DataApiAdd
,
DataApiEdit
,
DataApiDetail
},
components
:
{
DataApiList
,
DataApiAdd
,
DataApiEdit
,
DataApiDetail
,
DataApiCall
},
data
()
{
data
()
{
return
{
return
{
options
:
{
options
:
{
...
@@ -31,7 +35,8 @@ export default {
...
@@ -31,7 +35,8 @@ export default {
showList
:
true
,
showList
:
true
,
showAdd
:
false
,
showAdd
:
false
,
showEdit
:
false
,
showEdit
:
false
,
showDetail
:
false
showDetail
:
false
,
showCall
:
false
}
}
}
}
},
},
...
...
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