Commit d0b02276 by yuwei

2.0.0项目初始化

parent 15f0d08b
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);
}
}
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);
}
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;
}
}
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;
}
...@@ -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 {
......
...@@ -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);
} }
......
import request from '@/utils/request' import request from '@/utils/request'
export function getApiCall (data) { export function getApiHeader (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
}) })
} }
...@@ -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' }
......
...@@ -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' }
] ]
......
...@@ -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
......
...@@ -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: [],
// 返回格式数据字典 // 返回格式数据字典
......
...@@ -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)
} }
} }
} }
......
...@@ -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: [],
// 返回格式数据字典 // 返回格式数据字典
......
...@@ -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)
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
......
...@@ -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
} }
} }
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment