Commit d3df4c3b by yuwei

项目初始化

parent 7af5dd36
...@@ -160,8 +160,8 @@ public class MetadataColumnController extends BaseController { ...@@ -160,8 +160,8 @@ public class MetadataColumnController extends BaseController {
@ApiImplicitParam(name = "metadataColumnQuery", value = "查询实体metadataColumnQuery", required = false, dataType = "MetadataColumnQuery") @ApiImplicitParam(name = "metadataColumnQuery", value = "查询实体metadataColumnQuery", required = false, dataType = "MetadataColumnQuery")
}) })
@GetMapping("/tree/{level}") @GetMapping("/tree/{level}")
public R getDataMetadataTree(@PathVariable String level) { public R getDataMetadataTree(@PathVariable String level, MetadataColumnQuery metadataColumnQuery) {
List<MetadataTreeVo> list = metadataColumnService.getDataMetadataTree(level); List<MetadataTreeVo> list = metadataColumnService.getDataMetadataTree(level, metadataColumnQuery);
return R.ok().setData(list); return R.ok().setData(list);
} }
} }
...@@ -3,6 +3,7 @@ package cn.datax.service.data.metadata.service; ...@@ -3,6 +3,7 @@ package cn.datax.service.data.metadata.service;
import cn.datax.service.data.metadata.api.dto.MetadataColumnDto; import cn.datax.service.data.metadata.api.dto.MetadataColumnDto;
import cn.datax.common.base.BaseService; import cn.datax.common.base.BaseService;
import cn.datax.service.data.metadata.api.entity.MetadataColumnEntity; import cn.datax.service.data.metadata.api.entity.MetadataColumnEntity;
import cn.datax.service.data.metadata.api.query.MetadataColumnQuery;
import cn.datax.service.data.metadata.api.vo.MetadataTreeVo; import cn.datax.service.data.metadata.api.vo.MetadataTreeVo;
import java.util.List; import java.util.List;
...@@ -27,5 +28,5 @@ public interface MetadataColumnService extends BaseService<MetadataColumnEntity> ...@@ -27,5 +28,5 @@ public interface MetadataColumnService extends BaseService<MetadataColumnEntity>
void deleteMetadataColumnBatch(List<String> ids); void deleteMetadataColumnBatch(List<String> ids);
List<MetadataTreeVo> getDataMetadataTree(String level); List<MetadataTreeVo> getDataMetadataTree(String level, MetadataColumnQuery metadataColumnQuery);
} }
...@@ -8,6 +8,7 @@ import cn.datax.service.data.metadata.api.entity.MetadataColumnEntity; ...@@ -8,6 +8,7 @@ import cn.datax.service.data.metadata.api.entity.MetadataColumnEntity;
import cn.datax.service.data.metadata.api.entity.MetadataSourceEntity; import cn.datax.service.data.metadata.api.entity.MetadataSourceEntity;
import cn.datax.service.data.metadata.api.entity.MetadataTableEntity; import cn.datax.service.data.metadata.api.entity.MetadataTableEntity;
import cn.datax.service.data.metadata.api.enums.DataLevel; import cn.datax.service.data.metadata.api.enums.DataLevel;
import cn.datax.service.data.metadata.api.query.MetadataColumnQuery;
import cn.datax.service.data.metadata.api.vo.MetadataTreeVo; import cn.datax.service.data.metadata.api.vo.MetadataTreeVo;
import cn.datax.service.data.metadata.service.MetadataColumnService; import cn.datax.service.data.metadata.service.MetadataColumnService;
import cn.datax.service.data.metadata.mapstruct.MetadataColumnMapper; import cn.datax.service.data.metadata.mapstruct.MetadataColumnMapper;
...@@ -23,6 +24,7 @@ import java.util.ArrayList; ...@@ -23,6 +24,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream;
/** /**
* <p> * <p>
...@@ -80,26 +82,32 @@ public class MetadataColumnServiceImpl extends BaseServiceImpl<MetadataColumnDao ...@@ -80,26 +82,32 @@ public class MetadataColumnServiceImpl extends BaseServiceImpl<MetadataColumnDao
} }
@Override @Override
public List<MetadataTreeVo> getDataMetadataTree(String level) { public List<MetadataTreeVo> getDataMetadataTree(String level, MetadataColumnQuery metadataColumnQuery) {
List<MetadataSourceEntity> sourceList = (List<MetadataSourceEntity>) redisService.get(RedisConstant.METADATA_SOURCE_KEY); List<MetadataSourceEntity> sourceList = (List<MetadataSourceEntity>) redisService.get(RedisConstant.METADATA_SOURCE_KEY);
List<MetadataTreeVo> list = Optional.ofNullable(sourceList).orElseGet(ArrayList::new).stream().filter(s -> DataConstant.EnableState.ENABLE.getKey().equals(s.getStatus())) Stream<MetadataSourceEntity> stream = Optional.ofNullable(sourceList).orElseGet(ArrayList::new).stream().filter(s -> DataConstant.EnableState.ENABLE.getKey().equals(s.getStatus()));
.map(m -> { if (StrUtil.isNotBlank(metadataColumnQuery.getSourceId())) {
stream.filter(s -> metadataColumnQuery.getSourceId().equals(s.getId()));
}
List<MetadataTreeVo> list = stream.map(m -> {
MetadataTreeVo tree = new MetadataTreeVo(); MetadataTreeVo tree = new MetadataTreeVo();
tree.setId(m.getId()); tree.setId(m.getId());
tree.setType(DataLevel.DATABASE.getKey()); tree.setType(DataLevel.DATABASE.getKey());
tree.setLabel(m.getSourceName()); tree.setLabel(m.getSourceName());
if (DataLevel.getLevel(level).getLevel() >= DataLevel.TABLE.getLevel()) { if (DataLevel.getLevel(level).getLevel() >= DataLevel.TABLE.getLevel()) {
tree.setChildren(getTableChildrens(m.getId(), level)); tree.setChildren(getTableChildrens(m.getId(), level, metadataColumnQuery.getTableId()));
} }
return tree; return tree;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
return list; return list;
} }
private List<MetadataTreeVo> getTableChildrens(String id, String level) { private List<MetadataTreeVo> getTableChildrens(String id, String level, String tableId) {
List<MetadataTableEntity> tableList = (List<MetadataTableEntity>) redisService.hget(RedisConstant.METADATA_TABLE_KEY, id); List<MetadataTableEntity> tableList = (List<MetadataTableEntity>) redisService.hget(RedisConstant.METADATA_TABLE_KEY, id);
List<MetadataTreeVo> children = Optional.ofNullable(tableList).orElseGet(ArrayList::new).stream() Stream<MetadataTableEntity> stream = Optional.ofNullable(tableList).orElseGet(ArrayList::new).stream();
.map(m -> { if (StrUtil.isNotBlank(tableId)) {
stream.filter(s -> tableId.equals(s.getId()));
}
List<MetadataTreeVo> children = stream.map(m -> {
MetadataTreeVo tree = new MetadataTreeVo(); MetadataTreeVo tree = new MetadataTreeVo();
tree.setId(m.getId()); tree.setId(m.getId());
tree.setType(DataLevel.TABLE.getKey()); tree.setType(DataLevel.TABLE.getKey());
......
...@@ -53,9 +53,10 @@ export function updateDataColumn (data) { ...@@ -53,9 +53,10 @@ export function updateDataColumn (data) {
}) })
} }
export function getDataMetadataTree (level) { export function getDataMetadataTree (level, data) {
return request({ return request({
url: '/data/metadata/columns/tree/' + level, url: '/data/metadata/columns/tree/' + level,
method: 'get' method: 'get',
params: data
}) })
} }
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>{{ title }}</span> <span>{{ title }}</span>
...@@ -7,7 +6,7 @@ ...@@ -7,7 +6,7 @@
<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>
<div :style="classCardbody"> <div class="body-wrapper">
<el-form ref="form" :model="form" label-width="80px" disabled> <el-form ref="form" :model="form" label-width="80px" disabled>
<el-form-item label="接口名称" prop="apiName"> <el-form-item label="接口名称" prop="apiName">
<el-input v-model="form.apiName" /> <el-input v-model="form.apiName" />
...@@ -42,7 +41,6 @@ ...@@ -42,7 +41,6 @@
</el-form> </el-form>
</div> </div>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -105,5 +103,8 @@ export default { ...@@ -105,5 +103,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 230px);
overflow-y: auto;
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<el-form ref="queryForm" :model="queryParams" :inline="true"> <el-form ref="queryForm" :model="queryParams" :inline="true">
<el-form-item label="接口名称" prop="apiName"> <el-form-item label="接口名称" prop="apiName">
...@@ -136,7 +135,6 @@ ...@@ -136,7 +135,6 @@
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
/> />
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -146,7 +144,7 @@ export default { ...@@ -146,7 +144,7 @@ export default {
name: 'ApiLogList', name: 'ApiLogList',
data() { data() {
return { return {
tableHeight: document.body.offsetHeight - 340 + 'px', tableHeight: document.body.offsetHeight - 310 + 'px',
// 展示切换 // 展示切换
showOptions: { showOptions: {
data: {}, data: {},
...@@ -308,4 +306,7 @@ export default { ...@@ -308,4 +306,7 @@ export default {
.right-toolbar { .right-toolbar {
float: right; float: right;
} }
.el-card ::v-deep .el-card__body {
height: calc(100vh - 170px);
}
</style> </style>
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<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>
<div :style="classCardbody"> <div class="body-wrapper">
<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" @change="apiSelectChanged">
...@@ -304,5 +304,8 @@ export default { ...@@ -304,5 +304,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 230px);
overflow-y: auto;
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>{{ title }}</span> <span>{{ title }}</span>
...@@ -7,7 +6,7 @@ ...@@ -7,7 +6,7 @@
<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>
<div :style="classCardbody"> <div class="body-wrapper">
<el-form ref="form" :model="form" label-width="80px" disabled> <el-form ref="form" :model="form" label-width="80px" disabled>
<el-form-item label="数据API" prop="apiId"> <el-form-item label="数据API" prop="apiId">
<el-select v-model="form.apiId" placeholder="请选择数据API"> <el-select v-model="form.apiId" placeholder="请选择数据API">
...@@ -17,33 +16,31 @@ ...@@ -17,33 +16,31 @@
:label="api.apiName" :label="api.apiName"
:value="api.id" :value="api.id"
:disabled="api.status === '0'" :disabled="api.status === '0'"
></el-option> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="脱敏名称" prop="maskName"> <el-form-item label="脱敏名称" prop="maskName">
<el-input v-model="form.maskName" placeholder="请输入脱敏名称" /> <el-input v-model="form.maskName" placeholder="请输入脱敏名称" />
</el-form-item> </el-form-item>
<el-form-item label="脱敏字段规则配置" prop="rules"> <el-form-item label="脱敏字段规则配置" prop="rules">
<el-table :data="resParamList" stripe border <el-table
:data="resParamList"
stripe
border
:max-height="300" :max-height="300"
style="width: 100%; margin: 15px 0;"> style="width: 100%; margin: 15px 0;"
>
<el-table-column label="序号" width="55" align="center"> <el-table-column label="序号" width="55" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.$index +1 }}</span> <span>{{ scope.$index +1 }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="fieldName" label="字段名称" align="center" show-overflow-tooltip > <el-table-column prop="fieldName" label="字段名称" align="center" show-overflow-tooltip />
</el-table-column> <el-table-column prop="remark" label="描述" align="center" show-overflow-tooltip />
<el-table-column prop="remark" label="描述" align="center" show-overflow-tooltip > <el-table-column prop="dataType" label="数据类型" align="center" show-overflow-tooltip />
</el-table-column> <el-table-column prop="exampleValue" label="示例值" align="center" show-overflow-tooltip />
<el-table-column prop="dataType" label="数据类型" align="center" show-overflow-tooltip > <el-table-column prop="cipherType" label="脱敏类型" align="center" show-overflow-tooltip />
</el-table-column> <el-table-column prop="cryptType" label="规则类型" align="center" show-overflow-tooltip />
<el-table-column prop="exampleValue" label="示例值" align="center" show-overflow-tooltip >
</el-table-column>
<el-table-column prop="cipherType" label="脱敏类型" align="center" show-overflow-tooltip >
</el-table-column>
<el-table-column prop="cryptType" label="规则类型" align="center" show-overflow-tooltip >
</el-table-column>
</el-table> </el-table>
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
...@@ -52,7 +49,7 @@ ...@@ -52,7 +49,7 @@
v-for="dict in statusOptions" v-for="dict in statusOptions"
:key="dict.id" :key="dict.id"
:label="dict.itemText" :label="dict.itemText"
>{{dict.itemValue}}</el-radio> >{{ dict.itemValue }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
...@@ -61,7 +58,6 @@ ...@@ -61,7 +58,6 @@
</el-form> </el-form>
</div> </div>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -73,17 +69,13 @@ export default { ...@@ -73,17 +69,13 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function () { default: function() {
return {} return {}
} }
} }
}, },
data () { data() {
return { return {
classCardbody: {
overflow: 'auto',
height: document.body.offsetHeight - 240 + 'px'
},
title: '数据API脱敏详情', title: '数据API脱敏详情',
// 展示切换 // 展示切换
showOptions: { showOptions: {
...@@ -116,7 +108,7 @@ export default { ...@@ -116,7 +108,7 @@ export default {
algorithmCryptoOptions: [] algorithmCryptoOptions: []
} }
}, },
created () { created() {
console.log('id:' + this.data.id) console.log('id:' + this.data.id)
this.getDicts('sys_common_status').then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
...@@ -140,14 +132,14 @@ export default { ...@@ -140,14 +132,14 @@ export default {
}) })
this.getDataApiList() this.getDataApiList()
}, },
mounted () { mounted() {
this.getApiMask(this.data.id) this.getApiMask(this.data.id)
}, },
methods: { methods: {
showCard () { showCard() {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
getDataApiList () { getDataApiList() {
listDataApi().then(response => { listDataApi().then(response => {
if (response.success) { if (response.success) {
this.apiOptions = response.data this.apiOptions = response.data
...@@ -155,14 +147,14 @@ export default { ...@@ -155,14 +147,14 @@ export default {
}) })
}, },
/** 获取详情 */ /** 获取详情 */
async getApiMask () { async getApiMask() {
this.form = await getApiMask(this.data.id).then(response => { this.form = await getApiMask(this.data.id).then(response => {
if (response.success) { if (response.success) {
return response.data return response.data
} }
}) || {} }) || {}
if (this.form && this.form.apiId) { if (this.form && this.form.apiId) {
let dataApi = await getDataApi(this.form.apiId).then(response => { const dataApi = await getDataApi(this.form.apiId).then(response => {
if (response.success) { if (response.success) {
return response.data return response.data
} }
...@@ -170,11 +162,11 @@ export default { ...@@ -170,11 +162,11 @@ export default {
if (dataApi && dataApi.resParams.length > 0) { if (dataApi && dataApi.resParams.length > 0) {
this.resParamList = dataApi.resParams this.resParamList = dataApi.resParams
this.form.rules.forEach(rule => { this.form.rules.forEach(rule => {
let fieldParamIndex = this.resParamList.findIndex((param) => { const fieldParamIndex = this.resParamList.findIndex((param) => {
return param.fieldName === rule.fieldName return param.fieldName === rule.fieldName
}) })
if (fieldParamIndex !== -1) { if (fieldParamIndex !== -1) {
let cipher = this.cipherTypeOptions.find((item) => { const cipher = this.cipherTypeOptions.find((item) => {
return item.itemText === rule.cipherType return item.itemText === rule.cipherType
}) })
let crypt = {} let crypt = {}
...@@ -187,7 +179,7 @@ export default { ...@@ -187,7 +179,7 @@ export default {
return item.itemText === rule.cryptType return item.itemText === rule.cryptType
}) })
} }
let resParam = Object.assign({}, this.resParamList[fieldParamIndex], { cipherType: (cipher && cipher.itemValue) || undefined, cryptType: (crypt && crypt.itemValue) || undefined }) const resParam = Object.assign({}, this.resParamList[fieldParamIndex], { cipherType: (cipher && cipher.itemValue) || undefined, cryptType: (crypt && crypt.itemValue) || undefined })
this.$set(this.resParamList, fieldParamIndex, resParam) this.$set(this.resParamList, fieldParamIndex, resParam)
} }
}) })
...@@ -199,5 +191,8 @@ export default { ...@@ -199,5 +191,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 230px);
overflow-y: auto;
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<el-form :model="queryParams" ref="queryForm" :inline="true"> <el-form ref="queryForm" :model="queryParams" :inline="true">
<el-form-item label="脱敏名称" prop="maskName"> <el-form-item label="脱敏名称" prop="maskName">
<el-input <el-input
v-model="queryParams.maskName" v-model="queryParams.maskName"
...@@ -91,12 +90,12 @@ ...@@ -91,12 +90,12 @@
<el-table <el-table
v-loading="loading" v-loading="loading"
:data="apiMaskList" :data="apiMaskList"
@selection-change="handleSelectionChange"
border border
tooltip-effect="dark" tooltip-effect="dark"
:size="tableSize" :size="tableSize"
:height="tableHeight" :height="tableHeight"
style="width: 100%;margin: 15px 0;" style="width: 100%;margin: 15px 0;"
@selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" width="55" align="center"> <el-table-column label="序号" width="55" align="center">
...@@ -107,9 +106,9 @@ ...@@ -107,9 +106,9 @@
<template v-for="(item, index) in tableColumns"> <template v-for="(item, index) in tableColumns">
<el-table-column <el-table-column
v-if="item.show" v-if="item.show"
:key="index"
:prop="item.prop" :prop="item.prop"
:label="item.label" :label="item.label"
:key="index"
:formatter="item.formatter" :formatter="item.formatter"
align="center" align="center"
show-overflow-tooltip show-overflow-tooltip
...@@ -119,7 +118,8 @@ ...@@ -119,7 +118,8 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-popover <el-popover
placement="left" placement="left"
trigger="click"> trigger="click"
>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
...@@ -147,14 +147,13 @@ ...@@ -147,14 +147,13 @@
<el-pagination <el-pagination
:page-sizes="[10, 20, 50, 100]" :page-sizes="[10, 20, 50, 100]"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="queryParams.pageNum" :current-page.sync="queryParams.pageNum"
:page-size.sync="queryParams.pageSize" :page-size.sync="queryParams.pageSize"
:total="total" :total="total"
></el-pagination> @size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -162,9 +161,9 @@ import { pageApiMask, delApiMask, delApiMasks } from '@/api/market/apimask' ...@@ -162,9 +161,9 @@ import { pageApiMask, delApiMask, delApiMasks } from '@/api/market/apimask'
export default { export default {
name: 'ApiMaskList', name: 'ApiMaskList',
data () { data() {
return { return {
tableHeight: document.body.offsetHeight - 340 + 'px', tableHeight: document.body.offsetHeight - 310 + 'px',
// 展示切换 // 展示切换
showOptions: { showOptions: {
data: {}, data: {},
...@@ -209,7 +208,7 @@ export default { ...@@ -209,7 +208,7 @@ export default {
} }
} }
}, },
created () { created() {
this.getDicts('sys_common_status').then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
this.statusOptions = response.data this.statusOptions = response.data
...@@ -217,12 +216,12 @@ export default { ...@@ -217,12 +216,12 @@ export default {
}) })
this.getList() this.getList()
}, },
mounted () { mounted() {
this.initCols() this.initCols()
}, },
methods: { methods: {
/** 查询数据Api脱敏列表 */ /** 查询数据Api脱敏列表 */
getList () { getList() {
this.loading = true this.loading = true
pageApiMask(this.queryParams).then(response => { pageApiMask(this.queryParams).then(response => {
this.loading = false this.loading = false
...@@ -233,10 +232,10 @@ export default { ...@@ -233,10 +232,10 @@ export default {
} }
}) })
}, },
initCols () { initCols() {
this.checkedTableColumns = this.tableColumns.map(col => col.prop) this.checkedTableColumns = this.tableColumns.map(col => col.prop)
}, },
handleCheckedColsChange (val) { handleCheckedColsChange(val) {
this.tableColumns.forEach(col => { this.tableColumns.forEach(col => {
if (!this.checkedTableColumns.includes(col.prop)) { if (!this.checkedTableColumns.includes(col.prop)) {
col.show = false col.show = false
...@@ -245,31 +244,31 @@ export default { ...@@ -245,31 +244,31 @@ export default {
} }
}) })
}, },
handleCommand (command) { handleCommand(command) {
this.tableSize = command this.tableSize = command
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery () { handleQuery() {
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
this.getList() this.getList()
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery () { resetQuery() {
this.$refs['queryForm'].resetFields() this.$refs['queryForm'].resetFields()
this.handleQuery() this.handleQuery()
}, },
/** 刷新列表 */ /** 刷新列表 */
handleRefresh () { handleRefresh() {
this.getList() this.getList()
}, },
/** 多选框选中数据 */ /** 多选框选中数据 */
handleSelectionChange (selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id) this.ids = selection.map(item => item.id)
this.single = selection.length !== 1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd () { handleAdd() {
this.showOptions.data = {} this.showOptions.data = {}
this.showOptions.showList = false this.showOptions.showList = false
this.showOptions.showAdd = true this.showOptions.showAdd = true
...@@ -278,7 +277,7 @@ export default { ...@@ -278,7 +277,7 @@ export default {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleEdit (row) { handleEdit(row) {
this.showOptions.data.id = row.id || this.ids[0] this.showOptions.data.id = row.id || this.ids[0]
this.showOptions.showList = false this.showOptions.showList = false
this.showOptions.showAdd = false this.showOptions.showAdd = false
...@@ -287,7 +286,7 @@ export default { ...@@ -287,7 +286,7 @@ export default {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 详情按钮操作 */ /** 详情按钮操作 */
handleDetail (row) { handleDetail(row) {
this.showOptions.data.id = row.id || this.ids[0] this.showOptions.data.id = row.id || this.ids[0]
this.showOptions.showList = false this.showOptions.showList = false
this.showOptions.showAdd = false this.showOptions.showAdd = false
...@@ -296,7 +295,7 @@ export default { ...@@ -296,7 +295,7 @@ export default {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete (row) { handleDelete(row) {
this.$confirm('选中数据将被永久删除, 是否继续?', '提示', { this.$confirm('选中数据将被永久删除, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
...@@ -309,7 +308,7 @@ export default { ...@@ -309,7 +308,7 @@ export default {
}) })
}, },
/** 批量删除按钮操作 */ /** 批量删除按钮操作 */
handleBatchDelete () { handleBatchDelete() {
if (!this.ids.length) { if (!this.ids.length) {
this.$message({ this.$message({
message: '请先选择需要操作的数据', message: '请先选择需要操作的数据',
...@@ -318,23 +317,23 @@ export default { ...@@ -318,23 +317,23 @@ export default {
} }
this.$message.warning('不支持批量删除') this.$message.warning('不支持批量删除')
}, },
handleSizeChange (val) { handleSizeChange(val) {
console.log(`每页 ${val} 条`) console.log(`每页 ${val} 条`)
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
this.queryParams.pageSize = val this.queryParams.pageSize = val
this.getList() this.getList()
}, },
handleCurrentChange (val) { handleCurrentChange(val) {
console.log(`当前页: ${val}`) console.log(`当前页: ${val}`)
this.queryParams.pageNum = val this.queryParams.pageNum = val
this.getList() this.getList()
}, },
statusFormatter (row, column, cellValue, index) { statusFormatter(row, column, cellValue, index) {
let dictLabel = this.selectDictLabel(this.statusOptions, cellValue) const dictLabel = this.selectDictLabel(this.statusOptions, cellValue)
if (cellValue === '1') { if (cellValue === '1') {
return <el-tag type="success">{dictLabel}</el-tag> return <el-tag type='success'>{dictLabel}</el-tag>
} else { } else {
return <el-tag type="warning">{dictLabel}</el-tag> return <el-tag type='warning'>{dictLabel}</el-tag>
} }
} }
} }
...@@ -345,4 +344,7 @@ export default { ...@@ -345,4 +344,7 @@ export default {
.right-toolbar { .right-toolbar {
float: right; float: right;
} }
.el-card ::v-deep .el-card__body {
height: calc(100vh - 170px);
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>{{ title }}</span> <span>{{ title }}</span>
...@@ -8,7 +7,7 @@ ...@@ -8,7 +7,7 @@
<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>
<div :style="classCardbody"> <div class="body-wrapper">
<el-steps :active="active" finish-status="success" align-center> <el-steps :active="active" finish-status="success" align-center>
<el-step title="属性配置" /> <el-step title="属性配置" />
<el-step title="执行配置" /> <el-step title="执行配置" />
...@@ -254,7 +253,6 @@ ...@@ -254,7 +253,6 @@
<el-button v-if="active > 1" style="margin-top: 12px;" @click="handleLastStep">上一步</el-button> <el-button v-if="active > 1" style="margin-top: 12px;" @click="handleLastStep">上一步</el-button>
</div> </div>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -279,10 +277,6 @@ export default { ...@@ -279,10 +277,6 @@ export default {
}, },
data() { data() {
return { return {
classCardbody: {
overflow: 'auto',
height: document.body.offsetHeight - 240 + 'px'
},
title: '数据API新增', title: '数据API新增',
// 展示切换 // 展示切换
showOptions: { showOptions: {
...@@ -576,5 +570,8 @@ export default { ...@@ -576,5 +570,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 230px);
overflow-y: auto;
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>{{ title }}</span> <span>{{ title }}</span>
...@@ -8,7 +7,7 @@ ...@@ -8,7 +7,7 @@
<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>
<div :style="classCardbody"> <div class="body-wrapper">
<el-form ref="form1" :model="form" label-width="80px" :disabled="true"> <el-form ref="form1" :model="form" label-width="80px" :disabled="true">
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
...@@ -159,7 +158,6 @@ ...@@ -159,7 +158,6 @@
</el-row> </el-row>
</div> </div>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -178,10 +176,6 @@ export default { ...@@ -178,10 +176,6 @@ export default {
}, },
data() { data() {
return { return {
classCardbody: {
overflow: 'auto',
height: document.body.offsetHeight - 240 + 'px'
},
title: '数据API调用', title: '数据API调用',
// 展示切换 // 展示切换
showOptions: { showOptions: {
...@@ -304,5 +298,8 @@ export default { ...@@ -304,5 +298,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 230px);
overflow-y: auto;
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>{{ title }}</span> <span>{{ title }}</span>
...@@ -9,7 +8,7 @@ ...@@ -9,7 +8,7 @@
<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>
<div :style="classCardbody"> <div class="body-wrapper">
<el-steps :active="active" finish-status="success" align-center> <el-steps :active="active" finish-status="success" align-center>
<el-step title="属性配置" /> <el-step title="属性配置" />
<el-step title="执行配置" /> <el-step title="执行配置" />
...@@ -228,7 +227,6 @@ ...@@ -228,7 +227,6 @@
<el-button v-if="active > 1" style="margin-top: 12px;" @click="handleLastStep">上一步</el-button> <el-button v-if="active > 1" style="margin-top: 12px;" @click="handleLastStep">上一步</el-button>
</div> </div>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -252,10 +250,6 @@ export default { ...@@ -252,10 +250,6 @@ export default {
}, },
data() { data() {
return { return {
classCardbody: {
overflow: 'auto',
height: document.body.offsetHeight - 240 + 'px'
},
title: '数据API详情', title: '数据API详情',
// 展示切换 // 展示切换
showOptions: { showOptions: {
...@@ -463,5 +457,8 @@ export default { ...@@ -463,5 +457,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 230px);
overflow-y: auto;
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>{{ title }}</span> <span>{{ title }}</span>
...@@ -254,7 +253,6 @@ ...@@ -254,7 +253,6 @@
<el-button v-if="active > 1" style="margin-top: 12px;" @click="handleLastStep">上一步</el-button> <el-button v-if="active > 1" style="margin-top: 12px;" @click="handleLastStep">上一步</el-button>
</div> </div>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -279,10 +277,6 @@ export default { ...@@ -279,10 +277,6 @@ export default {
}, },
data() { data() {
return { return {
classCardbody: {
overflow: 'auto',
height: document.body.offsetHeight - 240 + 'px'
},
title: '数据API编辑', title: '数据API编辑',
// 展示切换 // 展示切换
showOptions: { showOptions: {
...@@ -607,5 +601,8 @@ export default { ...@@ -607,5 +601,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 230px);
overflow-y: auto;
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<el-form :model="queryParams" ref="queryForm" :inline="true"> <el-form ref="queryForm" :model="queryParams" :inline="true">
<el-form-item label="API名称" prop="apiName"> <el-form-item label="API名称" prop="apiName">
<el-input <el-input
v-model="queryParams.apiName" v-model="queryParams.apiName"
...@@ -91,12 +90,12 @@ ...@@ -91,12 +90,12 @@
<el-table <el-table
v-loading="loading" v-loading="loading"
:data="dataApiList" :data="dataApiList"
@selection-change="handleSelectionChange"
border border
tooltip-effect="dark" tooltip-effect="dark"
:size="tableSize" :size="tableSize"
:height="tableHeight" :height="tableHeight"
style="width: 100%;margin: 15px 0;" style="width: 100%;margin: 15px 0;"
@selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" width="55" align="center"> <el-table-column label="序号" width="55" align="center">
...@@ -107,9 +106,9 @@ ...@@ -107,9 +106,9 @@
<template v-for="(item, index) in tableColumns"> <template v-for="(item, index) in tableColumns">
<el-table-column <el-table-column
v-if="item.show" v-if="item.show"
:key="index"
:prop="item.prop" :prop="item.prop"
:label="item.label" :label="item.label"
:key="index"
:formatter="item.formatter" :formatter="item.formatter"
align="center" align="center"
show-overflow-tooltip show-overflow-tooltip
...@@ -119,7 +118,8 @@ ...@@ -119,7 +118,8 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-popover <el-popover
placement="left" placement="left"
trigger="click"> trigger="click"
>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
...@@ -167,14 +167,13 @@ ...@@ -167,14 +167,13 @@
<el-pagination <el-pagination
:page-sizes="[10, 20, 50, 100]" :page-sizes="[10, 20, 50, 100]"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="queryParams.pageNum" :current-page.sync="queryParams.pageNum"
:page-size.sync="queryParams.pageSize" :page-size.sync="queryParams.pageSize"
:total="total" :total="total"
></el-pagination> @size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -182,9 +181,9 @@ import { pageDataApi, delDataApi, delDataApis, copyDataApi, releaseDataApi, canc ...@@ -182,9 +181,9 @@ import { pageDataApi, delDataApi, delDataApis, copyDataApi, releaseDataApi, canc
export default { export default {
name: 'DataApiList', name: 'DataApiList',
data () { data() {
return { return {
tableHeight: document.body.offsetHeight - 340 + 'px', tableHeight: document.body.offsetHeight - 310 + 'px',
// 展示切换 // 展示切换
showOptions: { showOptions: {
data: {}, data: {},
...@@ -234,7 +233,7 @@ export default { ...@@ -234,7 +233,7 @@ export default {
} }
} }
}, },
created () { created() {
this.getDicts('data_api_status').then(response => { this.getDicts('data_api_status').then(response => {
if (response.success) { if (response.success) {
this.statusOptions = response.data this.statusOptions = response.data
...@@ -242,12 +241,12 @@ export default { ...@@ -242,12 +241,12 @@ export default {
}) })
this.getList() this.getList()
}, },
mounted () { mounted() {
this.initCols() this.initCols()
}, },
methods: { methods: {
/** 查询数据Api列表 */ /** 查询数据Api列表 */
getList () { getList() {
this.loading = true this.loading = true
pageDataApi(this.queryParams).then(response => { pageDataApi(this.queryParams).then(response => {
this.loading = false this.loading = false
...@@ -258,10 +257,10 @@ export default { ...@@ -258,10 +257,10 @@ export default {
} }
}) })
}, },
initCols () { initCols() {
this.checkedTableColumns = this.tableColumns.map(col => col.prop) this.checkedTableColumns = this.tableColumns.map(col => col.prop)
}, },
handleCheckedColsChange (val) { handleCheckedColsChange(val) {
this.tableColumns.forEach(col => { this.tableColumns.forEach(col => {
if (!this.checkedTableColumns.includes(col.prop)) { if (!this.checkedTableColumns.includes(col.prop)) {
col.show = false col.show = false
...@@ -270,31 +269,31 @@ export default { ...@@ -270,31 +269,31 @@ export default {
} }
}) })
}, },
handleCommand (command) { handleCommand(command) {
this.tableSize = command this.tableSize = command
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery () { handleQuery() {
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
this.getList() this.getList()
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery () { resetQuery() {
this.$refs['queryForm'].resetFields() this.$refs['queryForm'].resetFields()
this.handleQuery() this.handleQuery()
}, },
/** 刷新列表 */ /** 刷新列表 */
handleRefresh () { handleRefresh() {
this.getList() this.getList()
}, },
/** 多选框选中数据 */ /** 多选框选中数据 */
handleSelectionChange (selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id) this.ids = selection.map(item => item.id)
this.single = selection.length !== 1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd () { handleAdd() {
this.showOptions.data = {} this.showOptions.data = {}
this.showOptions.showList = false this.showOptions.showList = false
this.showOptions.showAdd = true this.showOptions.showAdd = true
...@@ -304,7 +303,7 @@ export default { ...@@ -304,7 +303,7 @@ export default {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleEdit (row) { handleEdit(row) {
this.showOptions.data.id = row.id || this.ids[0] this.showOptions.data.id = row.id || this.ids[0]
this.showOptions.showList = false this.showOptions.showList = false
this.showOptions.showAdd = false this.showOptions.showAdd = false
...@@ -314,7 +313,7 @@ export default { ...@@ -314,7 +313,7 @@ export default {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 详情按钮操作 */ /** 详情按钮操作 */
handleDetail (row) { handleDetail(row) {
this.showOptions.data.id = row.id || this.ids[0] this.showOptions.data.id = row.id || this.ids[0]
this.showOptions.showList = false this.showOptions.showList = false
this.showOptions.showAdd = false this.showOptions.showAdd = false
...@@ -324,7 +323,7 @@ export default { ...@@ -324,7 +323,7 @@ export default {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete (row) { handleDelete(row) {
this.$confirm('选中数据将被永久删除, 是否继续?', '提示', { this.$confirm('选中数据将被永久删除, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
...@@ -337,7 +336,7 @@ export default { ...@@ -337,7 +336,7 @@ export default {
}) })
}, },
/** 接口拷贝 */ /** 接口拷贝 */
handleCopy (row) { handleCopy(row) {
copyDataApi(row.id).then(response => { copyDataApi(row.id).then(response => {
if (response.success) { if (response.success) {
this.$message.success('拷贝成功') this.$message.success('拷贝成功')
...@@ -346,7 +345,7 @@ export default { ...@@ -346,7 +345,7 @@ export default {
}) })
}, },
/** 接口发布 */ /** 接口发布 */
handleRegister (row) { handleRegister(row) {
releaseDataApi(row.id).then(response => { releaseDataApi(row.id).then(response => {
if (response.success) { if (response.success) {
this.$message.success('接口发布成功') this.$message.success('接口发布成功')
...@@ -355,7 +354,7 @@ export default { ...@@ -355,7 +354,7 @@ export default {
}) })
}, },
/** 接口注销 */ /** 接口注销 */
handleUnRegister (row) { handleUnRegister(row) {
cancelDataApi(row.id).then(response => { cancelDataApi(row.id).then(response => {
if (response.success) { if (response.success) {
this.$message.success('接口注销成功') this.$message.success('接口注销成功')
...@@ -364,7 +363,7 @@ export default { ...@@ -364,7 +363,7 @@ export default {
}) })
}, },
/** 批量删除按钮操作 */ /** 批量删除按钮操作 */
handleBatchDelete () { handleBatchDelete() {
if (!this.ids.length) { if (!this.ids.length) {
this.$message({ this.$message({
message: '请先选择需要操作的数据', message: '请先选择需要操作的数据',
...@@ -373,25 +372,25 @@ export default { ...@@ -373,25 +372,25 @@ export default {
} }
this.$message.warning('不支持批量删除') this.$message.warning('不支持批量删除')
}, },
handleSizeChange (val) { handleSizeChange(val) {
console.log(`每页 ${val} 条`) console.log(`每页 ${val} 条`)
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
this.queryParams.pageSize = val this.queryParams.pageSize = val
this.getList() this.getList()
}, },
handleCurrentChange (val) { handleCurrentChange(val) {
console.log(`当前页: ${val}`) console.log(`当前页: ${val}`)
this.queryParams.pageNum = val this.queryParams.pageNum = val
this.getList() this.getList()
}, },
statusFormatter (row, column, cellValue, index) { statusFormatter(row, column, cellValue, index) {
let dictLabel = this.selectDictLabel(this.statusOptions, cellValue) const dictLabel = this.selectDictLabel(this.statusOptions, cellValue)
if (cellValue === '1') { if (cellValue === '1') {
return <el-tag>{dictLabel}</el-tag> return <el-tag>{dictLabel}</el-tag>
} else if (cellValue === '2') { } else if (cellValue === '2') {
return <el-tag type="success">{dictLabel}</el-tag> return <el-tag type='success'>{dictLabel}</el-tag>
} else if (cellValue === '3') { } else if (cellValue === '3') {
return <el-tag type="warning">{dictLabel}</el-tag> return <el-tag type='warning'>{dictLabel}</el-tag>
} }
} }
} }
...@@ -402,4 +401,7 @@ export default { ...@@ -402,4 +401,7 @@ export default {
.right-toolbar { .right-toolbar {
float: right; float: right;
} }
.el-card ::v-deep .el-card__body {
height: calc(100vh - 170px);
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>{{ title }}</span> <span>{{ title }}</span>
...@@ -8,7 +7,7 @@ ...@@ -8,7 +7,7 @@
<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>
<div :style="classCardbody"> <div class="body-wrapper">
<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="服务名称" prop="serviceName"> <el-form-item label="服务名称" prop="serviceName">
<el-input v-model="form.serviceName" placeholder="请输入服务名称" /> <el-input v-model="form.serviceName" placeholder="请输入服务名称" />
...@@ -73,7 +72,6 @@ ...@@ -73,7 +72,6 @@
</el-form> </el-form>
</div> </div>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -91,10 +89,6 @@ export default { ...@@ -91,10 +89,6 @@ export default {
}, },
data() { data() {
return { return {
classCardbody: {
overflow: 'auto',
height: document.body.offsetHeight - 240 + 'px'
},
title: '服务集成新增', title: '服务集成新增',
// 展示切换 // 展示切换
showOptions: { showOptions: {
...@@ -200,5 +194,8 @@ export default { ...@@ -200,5 +194,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 230px);
overflow-y: auto;
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>{{ title }}</span> <span>{{ title }}</span>
...@@ -7,7 +6,7 @@ ...@@ -7,7 +6,7 @@
<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>
<div :style="classCardbody"> <div class="body-wrapper">
<el-form ref="form" :model="form" label-width="80px" disabled> <el-form ref="form" :model="form" label-width="80px" disabled>
<el-form-item label="服务名称"> <el-form-item label="服务名称">
<el-input v-model="form.serviceName" placeholder="请输入服务名称" /> <el-input v-model="form.serviceName" placeholder="请输入服务名称" />
...@@ -75,7 +74,6 @@ ...@@ -75,7 +74,6 @@
</el-form> </el-form>
</div> </div>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -93,10 +91,6 @@ export default { ...@@ -93,10 +91,6 @@ export default {
}, },
data() { data() {
return { return {
classCardbody: {
overflow: 'auto',
height: document.body.offsetHeight - 240 + 'px'
},
title: '服务集成详情', title: '服务集成详情',
// 展示切换 // 展示切换
showOptions: { showOptions: {
...@@ -152,5 +146,8 @@ export default { ...@@ -152,5 +146,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 230px);
overflow-y: auto;
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>{{ title }}</span> <span>{{ title }}</span>
...@@ -8,7 +7,7 @@ ...@@ -8,7 +7,7 @@
<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>
<div :style="classCardbody"> <div class="body-wrapper">
<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="服务名称" prop="serviceName"> <el-form-item label="服务名称" prop="serviceName">
<el-input v-model="form.serviceName" placeholder="请输入服务名称" /> <el-input v-model="form.serviceName" placeholder="请输入服务名称" />
...@@ -76,7 +75,6 @@ ...@@ -76,7 +75,6 @@
</el-form> </el-form>
</div> </div>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -94,10 +92,6 @@ export default { ...@@ -94,10 +92,6 @@ export default {
}, },
data() { data() {
return { return {
classCardbody: {
overflow: 'auto',
height: document.body.offsetHeight - 240 + 'px'
},
title: '服务集成编辑', title: '服务集成编辑',
// 展示切换 // 展示切换
showOptions: { showOptions: {
...@@ -210,5 +204,8 @@ export default { ...@@ -210,5 +204,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 230px);
overflow-y: auto;
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<el-form ref="queryForm" :model="queryParams" :inline="true"> <el-form ref="queryForm" :model="queryParams" :inline="true">
<el-form-item label="服务名称" prop="serviceName"> <el-form-item label="服务名称" prop="serviceName">
...@@ -155,7 +154,6 @@ ...@@ -155,7 +154,6 @@
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
/> />
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -165,7 +163,7 @@ export default { ...@@ -165,7 +163,7 @@ export default {
name: 'DataServiceList', name: 'DataServiceList',
data() { data() {
return { return {
tableHeight: document.body.offsetHeight - 340 + 'px', tableHeight: document.body.offsetHeight - 310 + 'px',
// 展示切换 // 展示切换
showOptions: { showOptions: {
data: {}, data: {},
...@@ -357,4 +355,7 @@ export default { ...@@ -357,4 +355,7 @@ export default {
.right-toolbar { .right-toolbar {
float: right; float: right;
} }
.el-card ::v-deep .el-card__body {
height: calc(100vh - 170px);
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>{{ title }}</span> <span>{{ title }}</span>
...@@ -7,7 +6,7 @@ ...@@ -7,7 +6,7 @@
<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>
<div :style="classCardbody"> <div class="body-wrapper">
<el-form ref="form" :model="form" label-width="80px" disabled> <el-form ref="form" :model="form" label-width="80px" disabled>
<el-form-item label="服务名称" prop="serviceName"> <el-form-item label="服务名称" prop="serviceName">
<el-input v-model="form.serviceName" /> <el-input v-model="form.serviceName" />
...@@ -45,7 +44,6 @@ ...@@ -45,7 +44,6 @@
</el-form> </el-form>
</div> </div>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -63,10 +61,6 @@ export default { ...@@ -63,10 +61,6 @@ export default {
}, },
data() { data() {
return { return {
classCardbody: {
overflow: 'auto',
height: document.body.offsetHeight - 240 + 'px'
},
title: '服务日志详情', title: '服务日志详情',
// 展示切换 // 展示切换
showOptions: { showOptions: {
...@@ -108,5 +102,8 @@ export default { ...@@ -108,5 +102,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 230px);
overflow-y: auto;
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<el-form ref="queryForm" :model="queryParams" :inline="true"> <el-form ref="queryForm" :model="queryParams" :inline="true">
<el-form-item label="服务名称" prop="serviceName"> <el-form-item label="服务名称" prop="serviceName">
...@@ -136,7 +135,6 @@ ...@@ -136,7 +135,6 @@
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
/> />
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -146,7 +144,7 @@ export default { ...@@ -146,7 +144,7 @@ export default {
name: 'ServiceLogList', name: 'ServiceLogList',
data() { data() {
return { return {
tableHeight: document.body.offsetHeight - 340 + 'px', tableHeight: document.body.offsetHeight - 310 + 'px',
// 展示切换 // 展示切换
showOptions: { showOptions: {
data: {}, data: {},
...@@ -307,4 +305,7 @@ export default { ...@@ -307,4 +305,7 @@ export default {
.right-toolbar { .right-toolbar {
float: right; float: right;
} }
.el-card ::v-deep .el-card__body {
height: calc(100vh - 170px);
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<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-plus" round @click="submitForm" :loading="loadingOptions.loading" :disabled="loadingOptions.isDisabled">{{loadingOptions.loadingText}}</el-button> <el-button size="mini" icon="el-icon-plus" round :loading="loadingOptions.loading" :disabled="loadingOptions.isDisabled" @click="submitForm">{{ loadingOptions.loadingText }}</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>
<div :style="classCardbody"> <div class="body-wrapper">
<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="源数据表主键" prop="objectId"> <el-form-item label="源数据表主键" prop="objectId">
<el-input v-model="form.objectId" placeholder="请输入源数据表主键" /> <el-input v-model="form.objectId" placeholder="请输入源数据表主键" />
...@@ -31,7 +30,7 @@ ...@@ -31,7 +30,7 @@
v-for="dict in statusOptions" v-for="dict in statusOptions"
:key="dict.id" :key="dict.id"
:label="dict.itemText" :label="dict.itemText"
>{{dict.itemValue}}</el-radio> >{{ dict.itemValue }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
...@@ -40,7 +39,6 @@ ...@@ -40,7 +39,6 @@
</el-form> </el-form>
</div> </div>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -51,17 +49,13 @@ export default { ...@@ -51,17 +49,13 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function () { default: function() {
return {} return {}
} }
} }
}, },
data () { data() {
return { return {
classCardbody: {
overflow: 'auto',
height: document.body.offsetHeight - 240 + 'px'
},
title: '变更记录新增', title: '变更记录新增',
// 展示切换 // 展示切换
showOptions: { showOptions: {
...@@ -103,7 +97,7 @@ export default { ...@@ -103,7 +97,7 @@ export default {
statusOptions: [] statusOptions: []
} }
}, },
created () { created() {
this.getDicts('sys_common_status').then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
this.statusOptions = response.data this.statusOptions = response.data
...@@ -111,11 +105,11 @@ export default { ...@@ -111,11 +105,11 @@ export default {
}) })
}, },
methods: { methods: {
showCard () { showCard() {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function () { submitForm: function() {
this.$refs['form'].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
this.loadingOptions.loading = true this.loadingOptions.loading = true
...@@ -143,5 +137,8 @@ export default { ...@@ -143,5 +137,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 230px);
overflow-y: auto;
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>{{ title }}</span> <span>{{ title }}</span>
...@@ -7,7 +6,7 @@ ...@@ -7,7 +6,7 @@
<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>
<div :style="classCardbody"> <div class="body-wrapper">
<el-form ref="form" :model="form" label-width="80px" disabled> <el-form ref="form" :model="form" label-width="80px" disabled>
<el-form-item label="变更字段" prop="fieldName"> <el-form-item label="变更字段" prop="fieldName">
<el-input v-model="fieldName" /> <el-input v-model="fieldName" />
...@@ -27,7 +26,7 @@ ...@@ -27,7 +26,7 @@
v-for="dict in statusOptions" v-for="dict in statusOptions"
:key="dict.id" :key="dict.id"
:label="dict.itemText" :label="dict.itemText"
>{{dict.itemValue}}</el-radio> >{{ dict.itemValue }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
...@@ -36,7 +35,6 @@ ...@@ -36,7 +35,6 @@
</el-form> </el-form>
</div> </div>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -47,17 +45,13 @@ export default { ...@@ -47,17 +45,13 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function () { default: function() {
return {} return {}
} }
} }
}, },
data () { data() {
return { return {
classCardbody: {
overflow: 'auto',
height: document.body.offsetHeight - 240 + 'px'
},
title: '变更记录详情', title: '变更记录详情',
// 展示切换 // 展示切换
showOptions: { showOptions: {
...@@ -84,7 +78,12 @@ export default { ...@@ -84,7 +78,12 @@ export default {
]) ])
} }
}, },
created () { computed: {
fieldName() {
return this.dicts.get(this.form.fieldName)
}
},
created() {
console.log('id:' + this.data.id) console.log('id:' + this.data.id)
this.getDicts('sys_common_status').then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
...@@ -92,20 +91,15 @@ export default { ...@@ -92,20 +91,15 @@ export default {
} }
}) })
}, },
mounted () { mounted() {
this.getChangeRecord(this.data.id) this.getChangeRecord(this.data.id)
}, },
computed: {
fieldName () {
return this.dicts.get(this.form.fieldName)
}
},
methods: { methods: {
showCard () { showCard() {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 获取详情 */ /** 获取详情 */
getChangeRecord: function (id) { getChangeRecord: function(id) {
getChangeRecord(id).then(response => { getChangeRecord(id).then(response => {
if (response.success) { if (response.success) {
this.form = response.data this.form = response.data
...@@ -117,5 +111,8 @@ export default { ...@@ -117,5 +111,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 230px);
overflow-y: auto;
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<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-plus" round @click="submitForm" :loading="loadingOptions.loading" :disabled="loadingOptions.isDisabled">{{loadingOptions.loadingText}}</el-button> <el-button size="mini" icon="el-icon-plus" round :loading="loadingOptions.loading" :disabled="loadingOptions.isDisabled" @click="submitForm">{{ loadingOptions.loadingText }}</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>
<div :style="classCardbody"> <div class="body-wrapper">
<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="变更字段" prop="fieldName"> <el-form-item label="变更字段" prop="fieldName">
<el-input v-model="fieldName" placeholder="请输入变更字段" disabled /> <el-input v-model="fieldName" placeholder="请输入变更字段" disabled />
...@@ -28,7 +27,7 @@ ...@@ -28,7 +27,7 @@
v-for="dict in statusOptions" v-for="dict in statusOptions"
:key="dict.id" :key="dict.id"
:label="dict.itemText" :label="dict.itemText"
>{{dict.itemValue}}</el-radio> >{{ dict.itemValue }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
...@@ -37,7 +36,6 @@ ...@@ -37,7 +36,6 @@
</el-form> </el-form>
</div> </div>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -48,17 +46,13 @@ export default { ...@@ -48,17 +46,13 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function () { default: function() {
return {} return {}
} }
} }
}, },
data () { data() {
return { return {
classCardbody: {
overflow: 'auto',
height: document.body.offsetHeight - 240 + 'px'
},
title: '变更记录编辑', title: '变更记录编辑',
// 展示切换 // 展示切换
showOptions: { showOptions: {
...@@ -109,7 +103,12 @@ export default { ...@@ -109,7 +103,12 @@ export default {
]) ])
} }
}, },
created () { computed: {
fieldName() {
return this.dicts.get(this.form.fieldName)
}
},
created() {
console.log('id:' + this.data.id) console.log('id:' + this.data.id)
this.getDicts('sys_common_status').then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
...@@ -117,20 +116,15 @@ export default { ...@@ -117,20 +116,15 @@ export default {
} }
}) })
}, },
mounted () { mounted() {
this.getChangeRecord(this.data.id) this.getChangeRecord(this.data.id)
}, },
computed: {
fieldName () {
return this.dicts.get(this.form.fieldName)
}
},
methods: { methods: {
showCard () { showCard() {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 获取详情 */ /** 获取详情 */
getChangeRecord: function (id) { getChangeRecord: function(id) {
getChangeRecord(id).then(response => { getChangeRecord(id).then(response => {
if (response.success) { if (response.success) {
this.form = response.data this.form = response.data
...@@ -138,7 +132,7 @@ export default { ...@@ -138,7 +132,7 @@ export default {
}) })
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function () { submitForm: function() {
this.$refs['form'].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
this.loadingOptions.loading = true this.loadingOptions.loading = true
...@@ -166,5 +160,8 @@ export default { ...@@ -166,5 +160,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 230px);
overflow-y: auto;
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<el-form :model="queryParams" ref="queryForm" :inline="true"> <el-form ref="queryForm" :model="queryParams" :inline="true">
<el-form-item label="字段名称" prop="fieldName"> <el-form-item label="字段名称" prop="fieldName">
<el-input <el-input
v-model="queryParams.fieldName" v-model="queryParams.fieldName"
...@@ -85,12 +84,12 @@ ...@@ -85,12 +84,12 @@
<el-table <el-table
v-loading="loading" v-loading="loading"
:data="changeRecordList" :data="changeRecordList"
@selection-change="handleSelectionChange"
border border
tooltip-effect="dark" tooltip-effect="dark"
:size="tableSize" :size="tableSize"
:height="tableHeight" :height="tableHeight"
style="width: 100%;margin: 15px 0;" style="width: 100%;margin: 15px 0;"
@selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" width="55" align="center"> <el-table-column label="序号" width="55" align="center">
...@@ -101,9 +100,9 @@ ...@@ -101,9 +100,9 @@
<template v-for="(item, index) in tableColumns"> <template v-for="(item, index) in tableColumns">
<el-table-column <el-table-column
v-if="item.show" v-if="item.show"
:key="index"
:prop="item.prop" :prop="item.prop"
:label="item.label" :label="item.label"
:key="index"
:formatter="item.formatter" :formatter="item.formatter"
align="center" align="center"
show-overflow-tooltip show-overflow-tooltip
...@@ -113,7 +112,8 @@ ...@@ -113,7 +112,8 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-popover <el-popover
placement="left" placement="left"
trigger="click"> trigger="click"
>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
...@@ -141,14 +141,13 @@ ...@@ -141,14 +141,13 @@
<el-pagination <el-pagination
:page-sizes="[10, 20, 50, 100]" :page-sizes="[10, 20, 50, 100]"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="queryParams.pageNum" :current-page.sync="queryParams.pageNum"
:page-size.sync="queryParams.pageSize" :page-size.sync="queryParams.pageSize"
:total="total" :total="total"
></el-pagination> @size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -156,9 +155,9 @@ import { pageChangeRecord, delChangeRecord, delChangeRecords } from '@/api/metad ...@@ -156,9 +155,9 @@ import { pageChangeRecord, delChangeRecord, delChangeRecords } from '@/api/metad
export default { export default {
name: 'ChangeRecordList', name: 'ChangeRecordList',
data () { data() {
return { return {
tableHeight: document.body.offsetHeight - 340 + 'px', tableHeight: document.body.offsetHeight - 310 + 'px',
// 展示切换 // 展示切换
showOptions: { showOptions: {
data: {}, data: {},
...@@ -217,7 +216,7 @@ export default { ...@@ -217,7 +216,7 @@ export default {
]) ])
} }
}, },
created () { created() {
this.getDicts('sys_common_status').then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
this.statusOptions = response.data this.statusOptions = response.data
...@@ -225,12 +224,12 @@ export default { ...@@ -225,12 +224,12 @@ export default {
}) })
this.getList() this.getList()
}, },
mounted () { mounted() {
this.initCols() this.initCols()
}, },
methods: { methods: {
/** 查询数据源列表 */ /** 查询数据源列表 */
getList () { getList() {
this.loading = true this.loading = true
pageChangeRecord(this.queryParams).then(response => { pageChangeRecord(this.queryParams).then(response => {
this.loading = false this.loading = false
...@@ -241,10 +240,10 @@ export default { ...@@ -241,10 +240,10 @@ export default {
} }
}) })
}, },
initCols () { initCols() {
this.checkedTableColumns = this.tableColumns.map(col => col.prop) this.checkedTableColumns = this.tableColumns.map(col => col.prop)
}, },
handleCheckedColsChange (val) { handleCheckedColsChange(val) {
this.tableColumns.forEach(col => { this.tableColumns.forEach(col => {
if (!this.checkedTableColumns.includes(col.prop)) { if (!this.checkedTableColumns.includes(col.prop)) {
col.show = false col.show = false
...@@ -253,31 +252,31 @@ export default { ...@@ -253,31 +252,31 @@ export default {
} }
}) })
}, },
handleCommand (command) { handleCommand(command) {
this.tableSize = command this.tableSize = command
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery () { handleQuery() {
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
this.getList() this.getList()
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery () { resetQuery() {
this.$refs['queryForm'].resetFields() this.$refs['queryForm'].resetFields()
this.handleQuery() this.handleQuery()
}, },
/** 刷新列表 */ /** 刷新列表 */
handleRefresh () { handleRefresh() {
this.getList() this.getList()
}, },
/** 多选框选中数据 */ /** 多选框选中数据 */
handleSelectionChange (selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id) this.ids = selection.map(item => item.id)
this.single = selection.length !== 1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleEdit (row) { handleEdit(row) {
this.showOptions.data.id = row.id || this.ids[0] this.showOptions.data.id = row.id || this.ids[0]
this.showOptions.showList = false this.showOptions.showList = false
this.showOptions.showAdd = false this.showOptions.showAdd = false
...@@ -286,7 +285,7 @@ export default { ...@@ -286,7 +285,7 @@ export default {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 详情按钮操作 */ /** 详情按钮操作 */
handleDetail (row) { handleDetail(row) {
this.showOptions.data.id = row.id || this.ids[0] this.showOptions.data.id = row.id || this.ids[0]
this.showOptions.showList = false this.showOptions.showList = false
this.showOptions.showAdd = false this.showOptions.showAdd = false
...@@ -295,7 +294,7 @@ export default { ...@@ -295,7 +294,7 @@ export default {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete (row) { handleDelete(row) {
this.$confirm('选中数据将被永久删除, 是否继续?', '提示', { this.$confirm('选中数据将被永久删除, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
...@@ -308,7 +307,7 @@ export default { ...@@ -308,7 +307,7 @@ export default {
}) })
}, },
/** 批量删除按钮操作 */ /** 批量删除按钮操作 */
handleBatchDelete () { handleBatchDelete() {
if (!this.ids.length) { if (!this.ids.length) {
this.$message({ this.$message({
message: '请先选择需要操作的数据', message: '请先选择需要操作的数据',
...@@ -317,26 +316,26 @@ export default { ...@@ -317,26 +316,26 @@ export default {
} }
this.$message.warning('不支持批量删除') this.$message.warning('不支持批量删除')
}, },
handleSizeChange (val) { handleSizeChange(val) {
console.log(`每页 ${val} 条`) console.log(`每页 ${val} 条`)
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
this.queryParams.pageSize = val this.queryParams.pageSize = val
this.getList() this.getList()
}, },
handleCurrentChange (val) { handleCurrentChange(val) {
console.log(`当前页: ${val}`) console.log(`当前页: ${val}`)
this.queryParams.pageNum = val this.queryParams.pageNum = val
this.getList() this.getList()
}, },
statusFormatter (row, column, cellValue, index) { statusFormatter(row, column, cellValue, index) {
let dictLabel = this.selectDictLabel(this.statusOptions, cellValue) const dictLabel = this.selectDictLabel(this.statusOptions, cellValue)
if (cellValue === '1') { if (cellValue === '1') {
return <el-tag type="success">{dictLabel}</el-tag> return <el-tag type='success'>{dictLabel}</el-tag>
} else { } else {
return <el-tag type="warning">{dictLabel}</el-tag> return <el-tag type='warning'>{dictLabel}</el-tag>
} }
}, },
fieldNameFormatter (row, column, cellValue, index) { fieldNameFormatter(row, column, cellValue, index) {
return this.dicts.get(cellValue) return this.dicts.get(cellValue)
} }
} }
...@@ -347,4 +346,7 @@ export default { ...@@ -347,4 +346,7 @@ export default {
.right-toolbar { .right-toolbar {
float: right; float: right;
} }
.el-card ::v-deep .el-card__body {
height: calc(100vh - 170px);
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>{{ title }}</span> <span>{{ title }}</span>
...@@ -7,27 +6,27 @@ ...@@ -7,27 +6,27 @@
<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>
<div :style="classCardbody"> <div class="body-wrapper">
<el-form ref="form" :model="form" label-width="100px" size="mini"> <el-form ref="form" :model="form" label-width="100px" size="mini">
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="字段名称" prop="columnName"> <el-form-item label="字段名称" prop="columnName">
<el-input v-model="form.columnName" disabled> <el-input v-model="form.columnName" disabled>
<el-button slot="append" icon="el-icon-edit-outline" @click="changeRecord('columnName')"></el-button> <el-button slot="append" icon="el-icon-edit-outline" @click="changeRecord('columnName')" />
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="字段注释" prop="columnComment"> <el-form-item label="字段注释" prop="columnComment">
<el-input v-model="form.columnComment" disabled> <el-input v-model="form.columnComment" disabled>
<el-button slot="append" icon="el-icon-edit-outline" @click="changeRecord('columnComment')"></el-button> <el-button slot="append" icon="el-icon-edit-outline" @click="changeRecord('columnComment')" />
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="数据默认值" prop="dataDefault"> <el-form-item label="数据默认值" prop="dataDefault">
<el-input v-model="form.dataDefault" disabled> <el-input v-model="form.dataDefault" disabled>
<el-button slot="append" icon="el-icon-edit-outline" @click="changeRecord('dataDefault')"></el-button> <el-button slot="append" icon="el-icon-edit-outline" @click="changeRecord('dataDefault')" />
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -70,32 +69,32 @@ ...@@ -70,32 +69,32 @@
<el-divider content-position="center">变更记录</el-divider> <el-divider content-position="center">变更记录</el-divider>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-table :data="changeData.dataList" stripe border <el-table
:data="changeData.dataList"
stripe
border
:max-height="200" :max-height="200"
style="width: 100%; margin: 15px 0;"> style="width: 100%; margin: 15px 0;"
>
<el-table-column label="序号" align="center"> <el-table-column label="序号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.$index + 1 }}</span> <span>{{ scope.$index + 1 }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="fieldName" label="变更字段" align="center" show-overflow-tooltip :formatter="fieldNameFormatter"> <el-table-column prop="fieldName" label="变更字段" align="center" show-overflow-tooltip :formatter="fieldNameFormatter" />
</el-table-column> <el-table-column prop="version" label="版本号" align="center" show-overflow-tooltip />
<el-table-column prop="version" label="版本号" align="center" show-overflow-tooltip > <el-table-column prop="fieldOldValue" label="原来的值" align="center" show-overflow-tooltip />
</el-table-column> <el-table-column prop="fieldNewValue" label="最新的值" align="center" show-overflow-tooltip />
<el-table-column prop="fieldOldValue" label="原来的值" align="center" show-overflow-tooltip >
</el-table-column>
<el-table-column prop="fieldNewValue" label="最新的值" align="center" show-overflow-tooltip >
</el-table-column>
</el-table> </el-table>
<el-pagination <el-pagination
:page-sizes="[10, 20, 50, 100]" :page-sizes="[10, 20, 50, 100]"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="changeData.pageNum" :current-page.sync="changeData.pageNum"
:page-size.sync="changeData.pageSize" :page-size.sync="changeData.pageSize"
:total="changeData.dataTotal" :total="changeData.dataTotal"
></el-pagination> @size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
...@@ -104,16 +103,16 @@ ...@@ -104,16 +103,16 @@
<el-dialog :title="record.title" :visible.sync="record.open" min-width="600px" append-to-body> <el-dialog :title="record.title" :visible.sync="record.open" min-width="600px" append-to-body>
<el-form ref="form2" :model="form2" :rules="rules2" label-width="80px"> <el-form ref="form2" :model="form2" :rules="rules2" label-width="80px">
<el-form-item label="变更字段" prop="fieldName"> <el-form-item label="变更字段" prop="fieldName">
<el-input v-model="form2.fieldName" placeholder="请输入变更字段" :disabled="true"/> <el-input v-model="form2.fieldName" placeholder="请输入变更字段" :disabled="true" />
</el-form-item> </el-form-item>
<el-form-item label="版本号" prop="version"> <el-form-item label="版本号" prop="version">
<el-input v-model="form2.version" placeholder="请输入版本号"/> <el-input v-model="form2.version" placeholder="请输入版本号" />
</el-form-item> </el-form-item>
<el-form-item label="原来的值" prop="fieldOldValue"> <el-form-item label="原来的值" prop="fieldOldValue">
<el-input v-model="form2.fieldOldValue" placeholder="请输入原来的值" :disabled="true"/> <el-input v-model="form2.fieldOldValue" placeholder="请输入原来的值" :disabled="true" />
</el-form-item> </el-form-item>
<el-form-item label="最新的值" prop="fieldNewValue"> <el-form-item label="最新的值" prop="fieldNewValue">
<el-input v-model="form2.fieldNewValue" placeholder="请输入最新的值"/> <el-input v-model="form2.fieldNewValue" placeholder="请输入最新的值" />
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-radio-group v-model="form2.status"> <el-radio-group v-model="form2.status">
...@@ -121,7 +120,7 @@ ...@@ -121,7 +120,7 @@
v-for="dict in statusOptions" v-for="dict in statusOptions"
:key="dict.id" :key="dict.id"
:label="dict.itemText" :label="dict.itemText"
>{{dict.itemValue}}</el-radio> >{{ dict.itemValue }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
...@@ -134,7 +133,6 @@ ...@@ -134,7 +133,6 @@
</div> </div>
</el-dialog> </el-dialog>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -146,17 +144,13 @@ export default { ...@@ -146,17 +144,13 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function () { default: function() {
return {} return {}
} }
} }
}, },
data () { data() {
return { return {
classCardbody: {
overflow: 'auto',
height: document.body.offsetHeight - 240 + 'px'
},
title: '元数据详情', title: '元数据详情',
// 展示切换 // 展示切换
showOptions: { showOptions: {
...@@ -210,7 +204,7 @@ export default { ...@@ -210,7 +204,7 @@ export default {
statusOptions: [] statusOptions: []
} }
}, },
created () { created() {
console.log('id:' + this.data.id) console.log('id:' + this.data.id)
this.getDicts('sys_common_status').then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
...@@ -218,32 +212,32 @@ export default { ...@@ -218,32 +212,32 @@ export default {
} }
}) })
}, },
mounted () { mounted() {
this.getDataColumn(this.data.id) this.getDataColumn(this.data.id)
}, },
methods: { methods: {
showCard () { showCard() {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 获取详情 */ /** 获取详情 */
getDataColumn: function (id) { getDataColumn: function(id) {
getDataColumn(id).then(response => { getDataColumn(id).then(response => {
if (response.success) { if (response.success) {
this.form = response.data this.form = response.data
} }
}) })
}, },
handleSizeChange (val) { handleSizeChange(val) {
this.changeData.pageNum = 1 this.changeData.pageNum = 1
this.changeData.pageSize = val this.changeData.pageSize = val
this.getChangeRecordList() this.getChangeRecordList()
}, },
handleCurrentChange (val) { handleCurrentChange(val) {
this.changeData.pageNum = val this.changeData.pageNum = val
this.getChangeRecordList() this.getChangeRecordList()
}, },
getChangeRecordList () { getChangeRecordList() {
let data = {} const data = {}
data.objectId = this.data.id data.objectId = this.data.id
data.pageNum = this.changeData.pageNum data.pageNum = this.changeData.pageNum
data.pageSize = this.changeData.pageSize data.pageSize = this.changeData.pageSize
...@@ -255,17 +249,17 @@ export default { ...@@ -255,17 +249,17 @@ export default {
} }
}) })
}, },
fieldNameFormatter (row, column, cellValue, index) { fieldNameFormatter(row, column, cellValue, index) {
return this.dicts.get(cellValue) return this.dicts.get(cellValue)
}, },
changeRecord (field) { changeRecord(field) {
this.record.open = true this.record.open = true
this.form2.objectId = this.data.id this.form2.objectId = this.data.id
this.form2.fieldName = field this.form2.fieldName = field
this.form2.fieldOldValue = this.form[field] this.form2.fieldOldValue = this.form[field]
this.form2.version = 1 this.form2.version = 1
}, },
submitRecordForm () { submitRecordForm() {
this.$refs['form2'].validate(valid => { this.$refs['form2'].validate(valid => {
if (valid) { if (valid) {
addChangeRecord(this.form2).then(response => { addChangeRecord(this.form2).then(response => {
...@@ -285,5 +279,8 @@ export default { ...@@ -285,5 +279,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 230px);
overflow-y: auto;
}
</style> </style>
<template> <template>
<div>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="6"> <el-col :span="6">
<el-card class="box-card tree-wrapper" shadow="always"> <el-card class="box-card tree-wrapper" shadow="always">
<el-tree <el-tree
:data="treeOptions"
ref="tree" ref="tree"
:data="treeOptions"
node-key="id" node-key="id"
empty-text="加载中,请稍后" empty-text="加载中,请稍后"
:props="defaultProps" :props="defaultProps"
default-expand-all default-expand-all
:expand-on-click-node="false" :expand-on-click-node="false"
@node-click="handleNodeClick"
:render-content="renderContent" :render-content="renderContent"
></el-tree> @node-click="handleNodeClick"
/>
</el-card> </el-card>
</el-col> </el-col>
<el-col :span="18"> <el-col :span="18">
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<el-form :model="queryParams" ref="queryForm" :inline="true"> <el-form ref="queryForm" :model="queryParams" :inline="true">
<el-form-item label="字段名称" prop="columnName"> <el-form-item label="字段名称" prop="columnName">
<el-input <el-input
v-model="queryParams.columnName" v-model="queryParams.columnName"
...@@ -91,12 +90,12 @@ ...@@ -91,12 +90,12 @@
<el-table <el-table
v-loading="loading" v-loading="loading"
:data="columnList" :data="columnList"
@selection-change="handleSelectionChange"
border border
tooltip-effect="dark" tooltip-effect="dark"
:size="tableSize" :size="tableSize"
height="calc(100vh - 50%)" :height="tableHeight"
style="width: 100%;margin: 15px 0;" style="width: 100%;margin: 15px 0;"
@selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" width="55" align="center"> <el-table-column label="序号" width="55" align="center">
...@@ -107,9 +106,9 @@ ...@@ -107,9 +106,9 @@
<template v-for="(item, index) in tableColumns"> <template v-for="(item, index) in tableColumns">
<el-table-column <el-table-column
v-if="item.show" v-if="item.show"
:key="index"
:prop="item.prop" :prop="item.prop"
:label="item.label" :label="item.label"
:key="index"
:formatter="item.formatter" :formatter="item.formatter"
align="center" align="center"
show-overflow-tooltip show-overflow-tooltip
...@@ -119,7 +118,8 @@ ...@@ -119,7 +118,8 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-popover <el-popover
placement="left" placement="left"
trigger="click"> trigger="click"
>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
...@@ -135,16 +135,15 @@ ...@@ -135,16 +135,15 @@
<el-pagination <el-pagination
:page-sizes="[10, 20, 50, 100]" :page-sizes="[10, 20, 50, 100]"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="queryParams.pageNum" :current-page.sync="queryParams.pageNum"
:page-size.sync="queryParams.pageSize" :page-size.sync="queryParams.pageSize"
:total="total" :total="total"
></el-pagination> @size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</el-card> </el-card>
</el-col> </el-col>
</el-row> </el-row>
</div>
</template> </template>
<script> <script>
...@@ -152,9 +151,9 @@ import { pageDataColumn, getDataMetadataTree } from '@/api/metadata/datacolumn' ...@@ -152,9 +151,9 @@ import { pageDataColumn, getDataMetadataTree } from '@/api/metadata/datacolumn'
export default { export default {
name: 'DataColumnList', name: 'DataColumnList',
data () { data() {
return { return {
tableHeight: document.body.offsetHeight - 340 + 'px', tableHeight: document.body.offsetHeight - 310 + 'px',
// 展示切换 // 展示切换
showOptions: { showOptions: {
data: {}, data: {},
...@@ -204,16 +203,16 @@ export default { ...@@ -204,16 +203,16 @@ export default {
} }
} }
}, },
created () { created() {
this.getList() this.getList()
this.getTree() this.getTree()
}, },
mounted () { mounted() {
this.initCols() this.initCols()
}, },
methods: { methods: {
/** 查询列表 */ /** 查询列表 */
getList () { getList() {
this.loading = true this.loading = true
pageDataColumn(this.queryParams).then(response => { pageDataColumn(this.queryParams).then(response => {
this.loading = false this.loading = false
...@@ -225,7 +224,7 @@ export default { ...@@ -225,7 +224,7 @@ export default {
}) })
}, },
/** 查询树结构 */ /** 查询树结构 */
getTree () { getTree() {
getDataMetadataTree('table').then(response => { getDataMetadataTree('table').then(response => {
if (response.success) { if (response.success) {
const { data } = response const { data } = response
...@@ -233,10 +232,10 @@ export default { ...@@ -233,10 +232,10 @@ export default {
} }
}) })
}, },
initCols () { initCols() {
this.checkedTableColumns = this.tableColumns.map(col => col.prop) this.checkedTableColumns = this.tableColumns.map(col => col.prop)
}, },
handleCheckedColsChange (val) { handleCheckedColsChange(val) {
this.tableColumns.forEach(col => { this.tableColumns.forEach(col => {
if (!this.checkedTableColumns.includes(col.prop)) { if (!this.checkedTableColumns.includes(col.prop)) {
col.show = false col.show = false
...@@ -245,63 +244,63 @@ export default { ...@@ -245,63 +244,63 @@ export default {
} }
}) })
}, },
handleCommand (command) { handleCommand(command) {
this.tableSize = command this.tableSize = command
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery () { handleQuery() {
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
this.getList() this.getList()
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery () { resetQuery() {
this.$refs['queryForm'].resetFields() this.$refs['queryForm'].resetFields()
this.queryParams.sourceId = '' this.queryParams.sourceId = ''
this.queryParams.tableId = '' this.queryParams.tableId = ''
this.handleQuery() this.handleQuery()
}, },
/** 刷新列表 */ /** 刷新列表 */
handleRefresh () { handleRefresh() {
this.getList() this.getList()
}, },
/** 多选框选中数据 */ /** 多选框选中数据 */
handleSelectionChange (selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id) this.ids = selection.map(item => item.id)
this.single = selection.length !== 1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 详情按钮操作 */ /** 详情按钮操作 */
handleDetail (row) { handleDetail(row) {
this.showOptions.data.id = row.id || this.ids[0] this.showOptions.data.id = row.id || this.ids[0]
this.showOptions.showList = false this.showOptions.showList = false
this.showOptions.showDetail = true this.showOptions.showDetail = true
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
handleSizeChange (val) { handleSizeChange(val) {
console.log(`每页 ${val} 条`) console.log(`每页 ${val} 条`)
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
this.queryParams.pageSize = val this.queryParams.pageSize = val
this.getList() this.getList()
}, },
handleCurrentChange (val) { handleCurrentChange(val) {
console.log(`当前页: ${val}`) console.log(`当前页: ${val}`)
this.queryParams.pageNum = val this.queryParams.pageNum = val
this.getList() this.getList()
}, },
renderContent (h, { node, data, store }) { renderContent(h, { node, data, store }) {
if (node.level === 1) { if (node.level === 1) {
data.icon = 'icon iconfont icon-weidu' data.icon = 'icon iconfont icon-weidu'
} else { } else {
data.icon = 'icon iconfont icon-zhibiao' data.icon = 'icon iconfont icon-zhibiao'
} }
return ( return (
<span class="custom-tree-node"> <span class='custom-tree-node'>
<i class={data.icon}></i> <i class={data.icon}></i>
<span>{node.label}</span> <span>{node.label}</span>
</span>) </span>)
}, },
/** 节点单击事件 */ /** 节点单击事件 */
handleNodeClick (data) { handleNodeClick(data) {
if (data.type === 'database') { if (data.type === 'database') {
this.queryParams.sourceId = data.id this.queryParams.sourceId = data.id
this.queryParams.tableId = '' this.queryParams.tableId = ''
...@@ -311,14 +310,14 @@ export default { ...@@ -311,14 +310,14 @@ export default {
} }
this.getList() this.getList()
}, },
keyFormatter (row, column, cellValue, index) { keyFormatter(row, column, cellValue, index) {
if (cellValue === '1') { if (cellValue === '1') {
return 'Y' return 'Y'
} else { } else {
return 'N' return 'N'
} }
}, },
nullableFormatter (row, column, cellValue, index) { nullableFormatter(row, column, cellValue, index) {
if (cellValue === '1') { if (cellValue === '1') {
return 'Y' return 'Y'
} else { } else {
...@@ -333,17 +332,19 @@ export default { ...@@ -333,17 +332,19 @@ export default {
.right-toolbar { .right-toolbar {
float: right; float: right;
} }
.el-card ::v-deep .el-card__body { .el-card ::v-deep .el-card__body {
height: calc(100vh - 170px); height: calc(100vh - 170px);
} }
.tree-wrapper {
::v-deep .custom-tree-node { overflow-y: auto;
::v-deep .custom-tree-node {
flex: 1; flex: 1;
display: flex; display: flex;
font-size: 14px; font-size: 14px;
.icon { .icon {
margin-right: 5px; margin-right: 5px;
} }
}
} }
</style> </style>
<template> <template>
<div class="app-container"> <div class="app-container">
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<div :style="classCardbody"> <div class="body-wrapper">
<el-form :inline="true" :model="searchForm"> <el-form :inline="true" :model="searchForm">
<el-form-item label="数据库"> <el-form-item label="数据库">
<el-select v-model="searchForm.sourceId" placeholder="数据库"> <el-select v-model="searchForm.sourceId" placeholder="数据库">
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
:key="item.id" :key="item.id"
:label="item.sourceName" :label="item.sourceName"
:value="item.id" :value="item.id"
></el-option> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="数据表"> <el-form-item label="数据表">
...@@ -20,15 +20,15 @@ ...@@ -20,15 +20,15 @@
:key="item.id" :key="item.id"
:label="item.tableComment ? item.tableComment : item.tableName" :label="item.tableComment ? item.tableComment : item.tableName"
:value="item.id" :value="item.id"
></el-option> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" :disabled="btnEnable" @click="onSubmit">查询</el-button> <el-button type="primary" :disabled="btnEnable" @click="onSubmit">查询</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-divider></el-divider> <el-divider />
<div id="chart" :style="{width: '100%', height: '85%'}"></div> <div id="chart" :style="{width: '100%', height: '85%'}" />
</div> </div>
</el-card> </el-card>
</div> </div>
...@@ -42,12 +42,8 @@ import echarts from 'echarts' ...@@ -42,12 +42,8 @@ import echarts from 'echarts'
export default { export default {
name: 'DataMap', name: 'DataMap',
data: function () { data: function() {
return { return {
classCardbody: {
overflow: 'auto',
height: document.body.offsetHeight - 150 + 'px'
},
searchForm: { searchForm: {
sourceId: '', sourceId: '',
tableId: '' tableId: ''
...@@ -103,22 +99,43 @@ export default { ...@@ -103,22 +99,43 @@ export default {
] ]
} }
}, },
created () { watch: {
'searchForm.sourceId': {
immediate: true,
// handler:是一个回调函数,即监听到变化应该执行的函数
handler(value) {
if (value) {
// 清空数据
this.searchForm.tableId = ''
this.getDataTableList(value)
this.btnEnable = false
}
}
}
},
created() {
this.getDataSourceList() this.getDataSourceList()
}, },
mounted () { mounted() {
this.chart = echarts.init(document.getElementById('chart')) this.chart = echarts.init(document.getElementById('chart'))
}, },
beforeDestroy() {
if (!this.chart) {
return false
}
this.chart.dispose()
this.chart = null
},
methods: { methods: {
getDataSourceList () { getDataSourceList() {
listDataSource().then(response => { listDataSource().then(response => {
if (response.success) { if (response.success) {
this.sourceOptions = response.data this.sourceOptions = response.data
} }
}) })
}, },
getDataTableList (sourceId) { getDataTableList(sourceId) {
let data = {} const data = {}
data.sourceId = sourceId data.sourceId = sourceId
listDataTable(data).then(response => { listDataTable(data).then(response => {
if (response.success) { if (response.success) {
...@@ -126,7 +143,7 @@ export default { ...@@ -126,7 +143,7 @@ export default {
} }
}) })
}, },
onSubmit () { onSubmit() {
getDataMetadataTree('column', { sourceId: this.searchForm.sourceId, tableId: this.searchForm.tableId }).then(response => { getDataMetadataTree('column', { sourceId: this.searchForm.sourceId, tableId: this.searchForm.tableId }).then(response => {
if (response.success) { if (response.success) {
const { data } = response const { data } = response
...@@ -135,7 +152,7 @@ export default { ...@@ -135,7 +152,7 @@ export default {
} }
}) })
}, },
handleList (arr, idx, color, category) { handleList(arr, idx, color, category) {
arr.forEach((item, index) => { arr.forEach((item, index) => {
if (item.label === null) { if (item.label === null) {
return false return false
...@@ -175,7 +192,7 @@ export default { ...@@ -175,7 +192,7 @@ export default {
this.chartLegend.push(item.label) this.chartLegend.push(item.label)
} }
// 设置线条颜色 // 设置线条颜色
let lineStyle = { const lineStyle = {
color: color.c2 color: color.c2
} }
// 设置节点样式 // 设置节点样式
...@@ -283,7 +300,7 @@ export default { ...@@ -283,7 +300,7 @@ export default {
} }
}) })
}, },
handleLink (arr, idx, color) { handleLink(arr, idx, color) {
arr.forEach(item => { arr.forEach(item => {
if (item.children) { if (item.children) {
item.children.forEach((item2, eq) => { item.children.forEach((item2, eq) => {
...@@ -315,7 +332,7 @@ export default { ...@@ -315,7 +332,7 @@ export default {
} }
break break
} }
let obj = { const obj = {
source: item.id, source: item.id,
target: item2.id, target: item2.id,
lineStyle lineStyle
...@@ -328,13 +345,13 @@ export default { ...@@ -328,13 +345,13 @@ export default {
} }
}) })
}, },
initChart () { initChart() {
this.chart.showLoading() this.chart.showLoading()
this.chartList = [] this.chartList = []
this.chartLinks = [] this.chartLinks = []
this.chartLegend = [] this.chartLegend = []
// 获取表名 // 获取表名
let categories = this.treeData[0].children.map(item => { const categories = this.treeData[0].children.map(item => {
return { return {
name: item.label name: item.label
} }
...@@ -429,32 +446,14 @@ export default { ...@@ -429,32 +446,14 @@ export default {
this.chart.setOption(option) this.chart.setOption(option)
this.chart.hideLoading() this.chart.hideLoading()
} }
},
beforeDestroy () {
if (!this.chart) {
return false
}
this.chart.dispose()
this.chart = null
},
watch: {
'searchForm.sourceId': {
immediate: true,
// handler:是一个回调函数,即监听到变化应该执行的函数
handler (value) {
if (value) {
// 清空数据
this.searchForm.tableId = ''
this.getDataTableList(value)
this.btnEnable = false
}
}
}
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 170px);
}
::v-deep .el-divider { ::v-deep .el-divider {
margin: 0; margin: 0;
} }
......
<template> <template>
<div class="app-container"> <div class="app-container">
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<div :style="classCardbody"> <div class="body-wrapper">
<div v-if="searchExecuting"> <div v-if="searchExecuting">
<el-row> <el-row>
<el-col :span="12" :offset="6"> <el-col :span="12" :offset="6">
<el-input placeholder="请输入内容" v-model="keyword"> <el-input v-model="keyword" placeholder="请输入内容">
<el-select v-model="type" slot="prepend" placeholder="请选择" style="width: 100px;" @change="typeSelectChanged"> <el-select slot="prepend" v-model="type" placeholder="请选择" style="width: 100px;" @change="typeSelectChanged">
<el-option label="数据库" value="1"></el-option> <el-option label="数据库" value="1" />
<el-option label="数据表" value="2"></el-option> <el-option label="数据表" value="2" />
<el-option label="数据元" value="3"></el-option> <el-option label="数据元" value="3" />
</el-select> </el-select>
<el-button slot="append" :disabled="btnEnable" icon="el-icon-search" @click="search"></el-button> <el-button slot="append" :disabled="btnEnable" icon="el-icon-search" @click="search" />
</el-input> </el-input>
</el-col> </el-col>
</el-row> </el-row>
<el-divider></el-divider> <el-divider />
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<source-pane v-if="type === '1'" :data="dataList"></source-pane> <source-pane v-if="type === '1'" :data="dataList" />
<table-pane v-if="type === '2'" :data="dataList"></table-pane> <table-pane v-if="type === '2'" :data="dataList" />
<column-pane v-if="type === '3'" :data="dataList"></column-pane> <column-pane v-if="type === '3'" :data="dataList" />
<el-pagination <el-pagination
:page-sizes="[10, 20, 50, 100]" :page-sizes="[10, 20, 50, 100]"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="queryParams.pageNum" :current-page.sync="queryParams.pageNum"
:page-size.sync="queryParams.pageSize" :page-size.sync="queryParams.pageSize"
:total="total" :total="total"
></el-pagination> @size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<div v-else> <div v-else>
<div class="search-container"> <div class="search-container">
<el-input placeholder="请输入内容" v-model="keyword"> <el-input v-model="keyword" placeholder="请输入内容">
<el-select v-model="type" slot="prepend" placeholder="请选择" style="width: 100px;"> <el-select slot="prepend" v-model="type" placeholder="请选择" style="width: 100px;">
<el-option label="数据库" value="1"></el-option> <el-option label="数据库" value="1" />
<el-option label="数据表" value="2"></el-option> <el-option label="数据表" value="2" />
<el-option label="数据元" value="3"></el-option> <el-option label="数据元" value="3" />
</el-select> </el-select>
<el-button slot="append" icon="el-icon-search" :disabled="btnEnable" @click="search"></el-button> <el-button slot="append" icon="el-icon-search" :disabled="btnEnable" @click="search" />
</el-input> </el-input>
</div> </div>
</div> </div>
...@@ -62,12 +62,8 @@ import { pageDataColumn } from '@/api/metadata/datacolumn' ...@@ -62,12 +62,8 @@ import { pageDataColumn } from '@/api/metadata/datacolumn'
export default { export default {
name: 'DataSearch', name: 'DataSearch',
components: { SourcePane, TablePane, ColumnPane }, components: { SourcePane, TablePane, ColumnPane },
data () { data() {
return { return {
classCardbody: {
overflow: 'auto',
height: document.body.offsetHeight - 150 + 'px'
},
searchExecuting: false, searchExecuting: false,
type: '', type: '',
keyword: '', keyword: '',
...@@ -80,10 +76,25 @@ export default { ...@@ -80,10 +76,25 @@ export default {
} }
} }
}, },
computed: {
listenChange() {
const { type, keyword } = this
return { type, keyword }
}
},
watch: {
listenChange(val) {
if (val.type && val.keyword) {
this.btnEnable = false
} else {
this.btnEnable = true
}
}
},
methods: { methods: {
search () { search() {
this.searchExecuting = true this.searchExecuting = true
let data = JSON.parse(JSON.stringify(this.queryParams)) const data = JSON.parse(JSON.stringify(this.queryParams))
if (this.type === '1') { if (this.type === '1') {
data.sourceName = this.keyword data.sourceName = this.keyword
pageDataSource(data).then(response => { pageDataSource(data).then(response => {
...@@ -113,42 +124,30 @@ export default { ...@@ -113,42 +124,30 @@ export default {
}) })
} }
}, },
typeSelectChanged (val) { typeSelectChanged(val) {
this.dataList = [] this.dataList = []
this.total = 0 this.total = 0
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
this.queryParams.pageSize = 20 this.queryParams.pageSize = 20
console.log(val) console.log(val)
}, },
handleSizeChange (val) { handleSizeChange(val) {
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
this.queryParams.pageSize = val this.queryParams.pageSize = val
this.search() this.search()
}, },
handleCurrentChange (val) { handleCurrentChange(val) {
this.queryParams.pageNum = val this.queryParams.pageNum = val
this.search() this.search()
} }
},
computed: {
listenChange () {
const { type, keyword } = this
return { type, keyword }
}
},
watch: {
listenChange (val) {
if (val.type && val.keyword) {
this.btnEnable = false
} else {
this.btnEnable = true
}
}
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 170px);
}
.search-container { .search-container {
min-height: 100%; min-height: 100%;
width: 100%; width: 100%;
...@@ -161,8 +160,7 @@ export default { ...@@ -161,8 +160,7 @@ export default {
margin: 0 auto; margin: 0 auto;
} }
} }
::v-deep .el-divider { ::v-deep .el-divider {
margin: 0; margin: 10px 0;
} }
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<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-plus" v-if="active == 2" round @click="submitForm" :loading="loadingOptions.loading" :disabled="loadingOptions.isDisabled">{{loadingOptions.loadingText}}</el-button> <el-button v-if="active == 2" size="mini" icon="el-icon-plus" round :loading="loadingOptions.loading" :disabled="loadingOptions.isDisabled" @click="submitForm">{{ loadingOptions.loadingText }}</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>
<div :style="classCardbody"> <div class="body-wrapper">
<el-steps :active="active" finish-status="success" align-center> <el-steps :active="active" finish-status="success" align-center>
<el-step title="数据源信息"></el-step> <el-step title="数据源信息" />
<el-step title="连接信息"></el-step> <el-step title="连接信息" />
</el-steps> </el-steps>
<el-form ref="form" :model="form" :rules="rules" label-width="80px" v-if="active == 1"> <el-form v-if="active == 1" ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="数据源类型" prop="dbType"> <el-form-item label="数据源类型" prop="dbType">
<el-select v-model="form.dbType"> <el-select v-model="form.dbType">
<el-option <el-option
...@@ -21,7 +20,7 @@ ...@@ -21,7 +20,7 @@
:key="item.id" :key="item.id"
:label="item.itemValue" :label="item.itemValue"
:value="item.itemText" :value="item.itemText"
></el-option> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="数据源名称" prop="sourceName"> <el-form-item label="数据源名称" prop="sourceName">
...@@ -33,24 +32,24 @@ ...@@ -33,24 +32,24 @@
v-for="dict in statusOptions" v-for="dict in statusOptions"
:key="dict.id" :key="dict.id"
:label="dict.itemText" :label="dict.itemText"
>{{dict.itemValue}}</el-radio> >{{ dict.itemValue }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> <el-input v-model="form.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"> <el-form v-if="active == 2" ref="form2" :model="form2" :rules="rules2" label-width="80px">
<el-form-item label="主机" prop="host"> <el-form-item label="主机" prop="host">
<el-input v-model="form2.host" placeholder="请输入主机" /> <el-input v-model="form2.host" placeholder="请输入主机" />
</el-form-item> </el-form-item>
<el-form-item label="端口" prop="port"> <el-form-item label="端口" prop="port">
<el-input v-model="form2.port" placeholder="请输入端口" /> <el-input v-model="form2.port" placeholder="请输入端口" />
</el-form-item> </el-form-item>
<el-form-item label="服务名" prop="sid" v-if="form.dbType === '3' || form.dbType === '4'"> <el-form-item v-if="form.dbType === '3' || form.dbType === '4'" label="服务名" prop="sid">
<el-input v-model="form2.sid" placeholder="请输入服务名" /> <el-input v-model="form2.sid" placeholder="请输入服务名" />
</el-form-item> </el-form-item>
<el-form-item label="数据库" prop="dbName" v-if="form.dbType !== '3' && form.dbType !== '4'"> <el-form-item v-if="form.dbType !== '3' && form.dbType !== '4'" label="数据库" prop="dbName">
<el-input v-model="form2.dbName" placeholder="请输入数据库" /> <el-input v-model="form2.dbName" placeholder="请输入数据库" />
</el-form-item> </el-form-item>
<el-form-item label="用户名" prop="username"> <el-form-item label="用户名" prop="username">
...@@ -63,11 +62,10 @@ ...@@ -63,11 +62,10 @@
<el-button size="mini" type="primary" @click="handleCheckConnection">连通性检测</el-button> <el-button size="mini" type="primary" @click="handleCheckConnection">连通性检测</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-button style="margin-top: 12px;" @click="handleNextStep" v-if="active == 1">下一步</el-button> <el-button v-if="active == 1" style="margin-top: 12px;" @click="handleNextStep">下一步</el-button>
<el-button style="margin-top: 12px;" @click="handleLastStep" v-if="active == 2">上一步</el-button> <el-button v-if="active == 2" style="margin-top: 12px;" @click="handleLastStep">上一步</el-button>
</div> </div>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -78,17 +76,13 @@ export default { ...@@ -78,17 +76,13 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function () { default: function() {
return {} return {}
} }
} }
}, },
data () { data() {
return { return {
classCardbody: {
overflow: 'auto',
height: document.body.offsetHeight - 240 + 'px'
},
title: '数据源新增', title: '数据源新增',
// 展示切换 // 展示切换
showOptions: { showOptions: {
...@@ -158,7 +152,7 @@ export default { ...@@ -158,7 +152,7 @@ export default {
dbTypeOptions: [] dbTypeOptions: []
} }
}, },
created () { created() {
this.getDicts('sys_common_status').then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
this.statusOptions = response.data this.statusOptions = response.data
...@@ -171,11 +165,11 @@ export default { ...@@ -171,11 +165,11 @@ export default {
}) })
}, },
methods: { methods: {
showCard () { showCard() {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 步骤条下一步 */ /** 步骤条下一步 */
handleNextStep () { handleNextStep() {
this.$refs['form'].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
this.active++ this.active++
...@@ -183,11 +177,11 @@ export default { ...@@ -183,11 +177,11 @@ export default {
}) })
}, },
/** 步骤条上一步 */ /** 步骤条上一步 */
handleLastStep () { handleLastStep() {
this.active-- this.active--
}, },
/** 检测数据库连通性 */ /** 检测数据库连通性 */
handleCheckConnection () { handleCheckConnection() {
this.$refs['form2'].validate(valid => { this.$refs['form2'].validate(valid => {
if (valid) { if (valid) {
this.form.dbSchema = this.form2 this.form.dbSchema = this.form2
...@@ -200,7 +194,7 @@ export default { ...@@ -200,7 +194,7 @@ export default {
}) })
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function () { submitForm: function() {
this.$refs['form2'].validate(valid => { this.$refs['form2'].validate(valid => {
if (valid) { if (valid) {
this.form.dbSchema = this.form2 this.form.dbSchema = this.form2
...@@ -229,5 +223,8 @@ export default { ...@@ -229,5 +223,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 230px);
overflow-y: auto;
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<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-coin" type="primary" round @click="handleSync">元数据同步</el-button> <el-button size="mini" icon="el-icon-coin" type="primary" round @click="handleSync">元数据同步</el-button>
<el-button size="mini" icon="el-icon-coin" type="primary" round @click="handleWord">数据库文档</el-button> <el-button size="mini" icon="el-icon-coin" type="primary" round @click="handleWord">数据库文档</el-button>
<el-button size="mini" icon="el-icon-coin" type="primary" round @click="handleCheckConnection" v-if="active == 2">连通性检测</el-button> <el-button v-if="active == 2" size="mini" icon="el-icon-coin" type="primary" round @click="handleCheckConnection">连通性检测</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>
<div :style="classCardbody"> <div class="body-wrapper">
<el-steps :active="active" finish-status="success" align-center> <el-steps :active="active" finish-status="success" align-center>
<el-step title="数据源信息"></el-step> <el-step title="数据源信息" />
<el-step title="连接信息"></el-step> <el-step title="连接信息" />
</el-steps> </el-steps>
<el-form ref="form" :model="form" label-width="80px" v-if="active == 1" disabled> <el-form v-if="active == 1" ref="form" :model="form" label-width="80px" disabled>
<el-form-item label="数据源类型" prop="dbType"> <el-form-item label="数据源类型" prop="dbType">
<el-select v-model="form.dbType"> <el-select v-model="form.dbType">
<el-option <el-option
...@@ -23,7 +22,7 @@ ...@@ -23,7 +22,7 @@
:key="item.id" :key="item.id"
:label="item.itemValue" :label="item.itemValue"
:value="item.itemText" :value="item.itemText"
></el-option> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="数据源名称" prop="sourceName"> <el-form-item label="数据源名称" prop="sourceName">
...@@ -35,24 +34,24 @@ ...@@ -35,24 +34,24 @@
v-for="dict in statusOptions" v-for="dict in statusOptions"
:key="dict.id" :key="dict.id"
:label="dict.itemText" :label="dict.itemText"
>{{dict.itemValue}}</el-radio> >{{ dict.itemValue }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-form ref="form2" :model="form2" label-width="80px" v-if="active == 2" disabled> <el-form v-if="active == 2" ref="form2" :model="form2" label-width="80px" disabled>
<el-form-item label="主机" prop="host"> <el-form-item label="主机" prop="host">
<el-input v-model="form2.host" placeholder="请输入主机" /> <el-input v-model="form2.host" placeholder="请输入主机" />
</el-form-item> </el-form-item>
<el-form-item label="端口" prop="port"> <el-form-item label="端口" prop="port">
<el-input v-model="form2.port" placeholder="请输入端口" /> <el-input v-model="form2.port" placeholder="请输入端口" />
</el-form-item> </el-form-item>
<el-form-item label="服务名" prop="sid" v-if="form.dbType === '3' || form.dbType === '4'"> <el-form-item v-if="form.dbType === '3' || form.dbType === '4'" label="服务名" prop="sid">
<el-input v-model="form2.sid" placeholder="请输入服务名" /> <el-input v-model="form2.sid" placeholder="请输入服务名" />
</el-form-item> </el-form-item>
<el-form-item label="数据库" prop="dbName" v-if="form.dbType !== '3' || form.dbType !== '4'"> <el-form-item v-if="form.dbType !== '3' || form.dbType !== '4'" label="数据库" prop="dbName">
<el-input v-model="form2.dbName" placeholder="请输入数据库" /> <el-input v-model="form2.dbName" placeholder="请输入数据库" />
</el-form-item> </el-form-item>
<el-form-item label="用户名" prop="username"> <el-form-item label="用户名" prop="username">
...@@ -62,11 +61,10 @@ ...@@ -62,11 +61,10 @@
<el-input v-model="form2.password" placeholder="请输入密码" /> <el-input v-model="form2.password" placeholder="请输入密码" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-button style="margin-top: 12px;" @click="handleNextStep" v-if="active == 1">下一步</el-button> <el-button v-if="active == 1" style="margin-top: 12px;" @click="handleNextStep">下一步</el-button>
<el-button style="margin-top: 12px;" @click="handleLastStep" v-if="active == 2">上一步</el-button> <el-button v-if="active == 2" style="margin-top: 12px;" @click="handleLastStep">上一步</el-button>
</div> </div>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -77,17 +75,13 @@ export default { ...@@ -77,17 +75,13 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function () { default: function() {
return {} return {}
} }
} }
}, },
data () { data() {
return { return {
classCardbody: {
overflow: 'auto',
height: document.body.offsetHeight - 240 + 'px'
},
title: '数据源详情', title: '数据源详情',
// 展示切换 // 展示切换
showOptions: { showOptions: {
...@@ -107,7 +101,7 @@ export default { ...@@ -107,7 +101,7 @@ export default {
dbTypeOptions: [] dbTypeOptions: []
} }
}, },
created () { created() {
console.log('id:' + this.data.id) console.log('id:' + this.data.id)
this.getDicts('sys_common_status').then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
...@@ -120,15 +114,15 @@ export default { ...@@ -120,15 +114,15 @@ export default {
} }
}) })
}, },
mounted () { mounted() {
this.getDataSource(this.data.id) this.getDataSource(this.data.id)
}, },
methods: { methods: {
showCard () { showCard() {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 获取详情 */ /** 获取详情 */
getDataSource: function (id) { getDataSource: function(id) {
getDataSource(id).then(response => { getDataSource(id).then(response => {
if (response.success) { if (response.success) {
this.form = response.data this.form = response.data
...@@ -137,7 +131,7 @@ export default { ...@@ -137,7 +131,7 @@ export default {
}) })
}, },
/** 步骤条下一步 */ /** 步骤条下一步 */
handleNextStep () { handleNextStep() {
this.$refs['form'].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
this.active++ this.active++
...@@ -145,11 +139,11 @@ export default { ...@@ -145,11 +139,11 @@ export default {
}) })
}, },
/** 步骤条上一步 */ /** 步骤条上一步 */
handleLastStep () { handleLastStep() {
this.active-- this.active--
}, },
/** 检测数据库连通性 */ /** 检测数据库连通性 */
handleCheckConnection () { handleCheckConnection() {
checkConnection(this.form).then(response => { checkConnection(this.form).then(response => {
if (response.success) { if (response.success) {
this.$message.success('连接成功') this.$message.success('连接成功')
...@@ -157,7 +151,7 @@ export default { ...@@ -157,7 +151,7 @@ export default {
}) })
}, },
/** 元数据同步 */ /** 元数据同步 */
handleSync () { handleSync() {
sync(this.data.id).then(response => { sync(this.data.id).then(response => {
if (response.success) { if (response.success) {
this.$message.success('元数据正在后台同步中,请到元数据管理中查看结果') this.$message.success('元数据正在后台同步中,请到元数据管理中查看结果')
...@@ -165,7 +159,7 @@ export default { ...@@ -165,7 +159,7 @@ export default {
}) })
}, },
/** 数据库文档 */ /** 数据库文档 */
handleWord () { handleWord() {
word(this.data.id).then(response => { word(this.data.id).then(response => {
const blob = new Blob([response]) const blob = new Blob([response])
const fileName = '数据库设计文档.doc' const fileName = '数据库设计文档.doc'
...@@ -191,5 +185,8 @@ export default { ...@@ -191,5 +185,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 230px);
overflow-y: auto;
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<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-plus" v-if="active == 2" round @click="submitForm" :loading="loadingOptions.loading" :disabled="loadingOptions.isDisabled">{{loadingOptions.loadingText}}</el-button> <el-button v-if="active == 2" size="mini" icon="el-icon-plus" round :loading="loadingOptions.loading" :disabled="loadingOptions.isDisabled" @click="submitForm">{{ loadingOptions.loadingText }}</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>
<div :style="classCardbody"> <div class="body-wrapper">
<el-steps :active="active" finish-status="success" align-center> <el-steps :active="active" finish-status="success" align-center>
<el-step title="数据源信息"></el-step> <el-step title="数据源信息" />
<el-step title="连接信息"></el-step> <el-step title="连接信息" />
</el-steps> </el-steps>
<el-form ref="form" :model="form" :rules="rules" label-width="80px" v-if="active == 1"> <el-form v-if="active == 1" ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="数据源类型" prop="dbType"> <el-form-item label="数据源类型" prop="dbType">
<el-select v-model="form.dbType"> <el-select v-model="form.dbType">
<el-option <el-option
...@@ -21,7 +20,7 @@ ...@@ -21,7 +20,7 @@
:key="item.id" :key="item.id"
:label="item.itemValue" :label="item.itemValue"
:value="item.itemText" :value="item.itemText"
></el-option> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="数据源名称" prop="sourceName"> <el-form-item label="数据源名称" prop="sourceName">
...@@ -33,24 +32,24 @@ ...@@ -33,24 +32,24 @@
v-for="dict in statusOptions" v-for="dict in statusOptions"
:key="dict.id" :key="dict.id"
:label="dict.itemText" :label="dict.itemText"
>{{dict.itemValue}}</el-radio> >{{ dict.itemValue }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> <el-input v-model="form.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"> <el-form v-if="active == 2" ref="form2" :model="form2" :rules="rules2" label-width="80px">
<el-form-item label="主机" prop="host"> <el-form-item label="主机" prop="host">
<el-input v-model="form2.host" placeholder="请输入主机" /> <el-input v-model="form2.host" placeholder="请输入主机" />
</el-form-item> </el-form-item>
<el-form-item label="端口" prop="port"> <el-form-item label="端口" prop="port">
<el-input v-model="form2.port" placeholder="请输入端口" /> <el-input v-model="form2.port" placeholder="请输入端口" />
</el-form-item> </el-form-item>
<el-form-item label="服务名" prop="sid" v-if="form.dbType === '3' || form.dbType === '4'"> <el-form-item v-if="form.dbType === '3' || form.dbType === '4'" label="服务名" prop="sid">
<el-input v-model="form2.sid" placeholder="请输入服务名" /> <el-input v-model="form2.sid" placeholder="请输入服务名" />
</el-form-item> </el-form-item>
<el-form-item label="数据库" prop="dbName" v-if="form.dbType !== '3' && form.dbType !== '4'"> <el-form-item v-if="form.dbType !== '3' && form.dbType !== '4'" label="数据库" prop="dbName">
<el-input v-model="form2.dbName" placeholder="请输入数据库" /> <el-input v-model="form2.dbName" placeholder="请输入数据库" />
</el-form-item> </el-form-item>
<el-form-item label="用户名" prop="username"> <el-form-item label="用户名" prop="username">
...@@ -63,11 +62,10 @@ ...@@ -63,11 +62,10 @@
<el-button size="mini" type="primary" @click="handleCheckConnection">连通性检测</el-button> <el-button size="mini" type="primary" @click="handleCheckConnection">连通性检测</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-button style="margin-top: 12px;" @click="handleNextStep" v-if="active == 1">下一步</el-button> <el-button v-if="active == 1" style="margin-top: 12px;" @click="handleNextStep">下一步</el-button>
<el-button style="margin-top: 12px;" @click="handleLastStep" v-if="active == 2">上一步</el-button> <el-button v-if="active == 2" style="margin-top: 12px;" @click="handleLastStep">上一步</el-button>
</div> </div>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -78,17 +76,13 @@ export default { ...@@ -78,17 +76,13 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function () { default: function() {
return {} return {}
} }
} }
}, },
data () { data() {
return { return {
classCardbody: {
overflow: 'auto',
height: document.body.offsetHeight - 240 + 'px'
},
title: '数据源编辑', title: '数据源编辑',
// 展示切换 // 展示切换
showOptions: { showOptions: {
...@@ -143,7 +137,7 @@ export default { ...@@ -143,7 +137,7 @@ export default {
dbTypeOptions: [] dbTypeOptions: []
} }
}, },
created () { created() {
console.log('id:' + this.data.id) console.log('id:' + this.data.id)
this.getDicts('sys_common_status').then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
...@@ -156,15 +150,15 @@ export default { ...@@ -156,15 +150,15 @@ export default {
} }
}) })
}, },
mounted () { mounted() {
this.getDataSource(this.data.id) this.getDataSource(this.data.id)
}, },
methods: { methods: {
showCard () { showCard() {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 获取详情 */ /** 获取详情 */
getDataSource: function (id) { getDataSource: function(id) {
getDataSource(id).then(response => { getDataSource(id).then(response => {
if (response.success) { if (response.success) {
this.form = response.data this.form = response.data
...@@ -173,7 +167,7 @@ export default { ...@@ -173,7 +167,7 @@ export default {
}) })
}, },
/** 步骤条下一步 */ /** 步骤条下一步 */
handleNextStep () { handleNextStep() {
this.$refs['form'].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
this.active++ this.active++
...@@ -181,11 +175,11 @@ export default { ...@@ -181,11 +175,11 @@ export default {
}) })
}, },
/** 步骤条上一步 */ /** 步骤条上一步 */
handleLastStep () { handleLastStep() {
this.active-- this.active--
}, },
/** 检测数据库连通性 */ /** 检测数据库连通性 */
handleCheckConnection () { handleCheckConnection() {
this.$refs['form2'].validate(valid => { this.$refs['form2'].validate(valid => {
if (valid) { if (valid) {
this.form.dbSchema = this.form2 this.form.dbSchema = this.form2
...@@ -198,7 +192,7 @@ export default { ...@@ -198,7 +192,7 @@ export default {
}) })
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function () { submitForm: function() {
this.$refs['form2'].validate(valid => { this.$refs['form2'].validate(valid => {
if (valid) { if (valid) {
this.form.dbSchema = this.form2 this.form.dbSchema = this.form2
...@@ -227,5 +221,8 @@ export default { ...@@ -227,5 +221,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 230px);
overflow-y: auto;
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<el-form ref="queryForm" :model="queryParams" :inline="true"> <el-form ref="queryForm" :model="queryParams" :inline="true">
<el-form-item label="数据源名称" prop="sourceName"> <el-form-item label="数据源名称" prop="sourceName">
...@@ -161,7 +160,6 @@ ...@@ -161,7 +160,6 @@
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
/> />
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -171,7 +169,7 @@ export default { ...@@ -171,7 +169,7 @@ export default {
name: 'DataSourceList', name: 'DataSourceList',
data() { data() {
return { return {
tableHeight: document.body.offsetHeight - 340 + 'px', tableHeight: document.body.offsetHeight - 310 + 'px',
// 展示切换 // 展示切换
showOptions: { showOptions: {
data: {}, data: {},
...@@ -362,4 +360,7 @@ export default { ...@@ -362,4 +360,7 @@ export default {
.right-toolbar { .right-toolbar {
float: right; float: right;
} }
.el-card ::v-deep .el-card__body {
height: calc(100vh - 170px);
}
</style> </style>
...@@ -12,14 +12,14 @@ ...@@ -12,14 +12,14 @@
:label="source.sourceName" :label="source.sourceName"
:value="source.id" :value="source.id"
:disabled="source.status === '0'" :disabled="source.status === '0'"
></el-option> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button size="mini" round @click="runData" :disabled="sqlExecuting">运行</el-button> <el-button size="mini" round :disabled="sqlExecuting" @click="runData">运行</el-button>
<el-button size="mini" round @click="stopData" :disabled="!sqlExecuting">停止</el-button> <el-button size="mini" round :disabled="!sqlExecuting" @click="stopData">停止</el-button>
<el-button size="mini" round @click="formaterSql" :disabled="sqlExecuting">格式化</el-button> <el-button size="mini" round :disabled="sqlExecuting" @click="formaterSql">格式化</el-button>
<el-button size="mini" round @click="refreshData" :disabled="sqlExecuting">重置</el-button> <el-button size="mini" round :disabled="sqlExecuting" @click="refreshData">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-col> </el-col>
...@@ -29,9 +29,9 @@ ...@@ -29,9 +29,9 @@
<sql-editor <sql-editor
ref="sqleditor" ref="sqleditor"
:value="sqlText" :value="sqlText"
@changeTextarea="changeTextarea($event)"
style="height: 300px;margin: 20px 0;" style="height: 300px;margin: 20px 0;"
></sql-editor> @changeTextarea="changeTextarea($event)"
/>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
...@@ -39,14 +39,18 @@ ...@@ -39,14 +39,18 @@
<div v-if="sqlExecuting" v-loading="sqlExecuting">数据加载中...</div> <div v-if="sqlExecuting" v-loading="sqlExecuting">数据加载中...</div>
<div v-else> <div v-else>
<div v-if="sqlConsole.length > 0"> <div v-if="sqlConsole.length > 0">
<el-tabs type="border-card" v-model="activeTabName"> <el-tabs v-model="activeTabName" type="border-card">
<el-tab-pane label="信息" name="table0"> <el-tab-pane label="信息" name="table0">
<pre>{{executeResultInfo}}</pre> <pre>{{ executeResultInfo }}</pre>
</el-tab-pane> </el-tab-pane>
<el-tab-pane v-for="(item,index) in sqlConsole" :key="(index+1)" :name="'table'+(index+1)" :label="'结果'+(index+1)"> <el-tab-pane v-for="(item,index) in sqlConsole" :key="(index+1)" :name="'table'+(index+1)" :label="'结果'+(index+1)">
<el-table :data="item.dataList" stripe border <el-table
:data="item.dataList"
stripe
border
:max-height="300" :max-height="300"
style="width: 100%; margin: 15px 0;"> style="width: 100%; margin: 15px 0;"
>
<el-table-column label="序号" width="55" align="center"> <el-table-column label="序号" width="55" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.$index + 1 }}</span> <span>{{ scope.$index + 1 }}</span>
...@@ -54,9 +58,9 @@ ...@@ -54,9 +58,9 @@
</el-table-column> </el-table-column>
<template v-for="(column, index) in item.columnList"> <template v-for="(column, index) in item.columnList">
<el-table-column <el-table-column
:key="index"
:prop="column" :prop="column"
:label="column" :label="column"
:key="index"
align="center" align="center"
show-overflow-tooltip show-overflow-tooltip
/> />
...@@ -83,7 +87,7 @@ export default { ...@@ -83,7 +87,7 @@ export default {
components: { components: {
SqlEditor SqlEditor
}, },
data () { data() {
return { return {
// 数据源数据字典 // 数据源数据字典
sourceOptions: [], sourceOptions: [],
...@@ -96,18 +100,18 @@ export default { ...@@ -96,18 +100,18 @@ export default {
executeResultInfo: undefined executeResultInfo: undefined
} }
}, },
created () { created() {
this.getDataSourceList() this.getDataSourceList()
}, },
methods: { methods: {
getDataSourceList () { getDataSourceList() {
listDataSource().then(response => { listDataSource().then(response => {
if (response.success) { if (response.success) {
this.sourceOptions = response.data this.sourceOptions = response.data
} }
}) })
}, },
runData () { runData() {
if (!this.sqlDataSource) { if (!this.sqlDataSource) {
this.$message.error('数据源不能为空') this.$message.error('数据源不能为空')
return return
...@@ -119,7 +123,7 @@ export default { ...@@ -119,7 +123,7 @@ export default {
this.sqlExecuting = true this.sqlExecuting = true
this.sqlExecutorId = (new Date()).getTime() + Math.ceil(Math.random() * 1000) this.sqlExecutorId = (new Date()).getTime() + Math.ceil(Math.random() * 1000)
this.sqlConsole = [] this.sqlConsole = []
let data = {} const data = {}
data.sqlKey = this.sqlExecutorId data.sqlKey = this.sqlExecutorId
data.sourceId = this.sqlDataSource data.sourceId = this.sqlDataSource
data.sqlText = this.sqlText data.sqlText = this.sqlText
...@@ -128,7 +132,7 @@ export default { ...@@ -128,7 +132,7 @@ export default {
const { data } = response const { data } = response
let resultStr = '' let resultStr = ''
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
let item = data[i] const item = data[i]
resultStr += item.sql resultStr += item.sql
resultStr += '\n> 状态:' + ((item.success) ? '成功' : '失败') resultStr += '\n> 状态:' + ((item.success) ? '成功' : '失败')
if (item.count && item.count >= 0) { if (item.count && item.count >= 0) {
...@@ -143,8 +147,8 @@ export default { ...@@ -143,8 +147,8 @@ export default {
this.sqlExecuting = false this.sqlExecuting = false
}) })
}, },
stopData () { stopData() {
let data = {} const data = {}
data.sqlKey = this.sqlExecutorId data.sqlKey = this.sqlExecutorId
stopSql(data).then(response => { stopSql(data).then(response => {
if (response.success) { if (response.success) {
...@@ -153,16 +157,16 @@ export default { ...@@ -153,16 +157,16 @@ export default {
this.sqlExecuting = false this.sqlExecuting = false
}) })
}, },
changeTextarea (val) { changeTextarea(val) {
this.sqlText = val this.sqlText = val
}, },
formaterSql () { formaterSql() {
if (!this.sqlText) { if (!this.sqlText) {
return return
} }
this.$refs.sqleditor.editor.setValue(sqlFormatter.format(this.$refs.sqleditor.editor.getValue())) this.$refs.sqleditor.editor.setValue(sqlFormatter.format(this.$refs.sqleditor.editor.getValue()))
}, },
refreshData () { refreshData() {
if (!this.sqlText) { if (!this.sqlText) {
return return
} }
......
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>{{ title }}</span> <span>{{ title }}</span>
...@@ -7,7 +6,7 @@ ...@@ -7,7 +6,7 @@
<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>
<div :style="classCardbody"> <div class="body-wrapper">
<el-form ref="form" :model="form" label-width="80px" disabled> <el-form ref="form" :model="form" label-width="80px" disabled>
<el-form-item label="登录用户" prop="userName"> <el-form-item label="登录用户" prop="userName">
<el-input v-model="form.userName" /> <el-input v-model="form.userName" />
...@@ -27,7 +26,6 @@ ...@@ -27,7 +26,6 @@
</el-form> </el-form>
</div> </div>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -38,17 +36,13 @@ export default { ...@@ -38,17 +36,13 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function () { default: function() {
return {} return {}
} }
} }
}, },
data () { data() {
return { return {
classCardbody: {
overflow: 'auto',
height: document.body.offsetHeight - 240 + 'px'
},
title: '登录日志详情', title: '登录日志详情',
// 展示切换 // 展示切换
showOptions: { showOptions: {
...@@ -60,18 +54,18 @@ export default { ...@@ -60,18 +54,18 @@ export default {
form: {} form: {}
} }
}, },
created () { created() {
console.log('id:' + this.data.id) console.log('id:' + this.data.id)
}, },
mounted () { mounted() {
this.getLog(this.data.id) this.getLog(this.data.id)
}, },
methods: { methods: {
showCard () { showCard() {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 获取详情 */ /** 获取详情 */
getLog: function (id) { getLog: function(id) {
getLog(id).then(response => { getLog(id).then(response => {
if (response.success) { if (response.success) {
this.form = response.data this.form = response.data
...@@ -83,5 +77,8 @@ export default { ...@@ -83,5 +77,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 230px);
overflow-y: auto;
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<el-form :model="queryParams" ref="queryForm" :inline="true"> <el-form ref="queryForm" :model="queryParams" :inline="true">
<el-form-item label="用户名称" prop="userName"> <el-form-item label="用户名称" prop="userName">
<el-input <el-input
v-model="queryParams.userName" v-model="queryParams.userName"
...@@ -21,20 +20,20 @@ ...@@ -21,20 +20,20 @@
<el-col :span="12"> <el-col :span="12">
<el-button-group> <el-button-group>
<el-button <el-button
v-hasPerm="['monitor:loginlog:detail']"
type="info" type="info"
icon="el-icon-view" icon="el-icon-view"
size="mini" size="mini"
:disabled="single" :disabled="single"
@click="handleDetail" @click="handleDetail"
v-hasPerm="['monitor:loginlog:detail']"
>详情</el-button> >详情</el-button>
<el-button <el-button
v-hasPerm="['monitor:loginlog:remove']"
type="danger" type="danger"
icon="el-icon-delete" icon="el-icon-delete"
size="mini" size="mini"
:disabled="multiple" :disabled="multiple"
@click="handleBatchDelete" @click="handleBatchDelete"
v-hasPerm="['monitor:loginlog:remove']"
>删除</el-button> >删除</el-button>
</el-button-group> </el-button-group>
</el-col> </el-col>
...@@ -80,12 +79,12 @@ ...@@ -80,12 +79,12 @@
<el-table <el-table
v-loading="loading" v-loading="loading"
:data="logList" :data="logList"
@selection-change="handleSelectionChange"
border border
tooltip-effect="dark" tooltip-effect="dark"
:size="tableSize" :size="tableSize"
:height="tableHeight" :height="tableHeight"
style="width: 100%;margin: 15px 0;" style="width: 100%;margin: 15px 0;"
@selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" width="55" align="center"> <el-table-column label="序号" width="55" align="center">
...@@ -96,9 +95,9 @@ ...@@ -96,9 +95,9 @@
<template v-for="(item, index) in tableColumns"> <template v-for="(item, index) in tableColumns">
<el-table-column <el-table-column
v-if="item.show" v-if="item.show"
:key="index"
:prop="item.prop" :prop="item.prop"
:label="item.label" :label="item.label"
:key="index"
:formatter="item.formatter" :formatter="item.formatter"
align="center" align="center"
show-overflow-tooltip show-overflow-tooltip
...@@ -108,20 +107,21 @@ ...@@ -108,20 +107,21 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-popover <el-popover
placement="left" placement="left"
trigger="click"> trigger="click"
>
<el-button <el-button
v-hasPerm="['monitor:loginlog:detail']"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-view" icon="el-icon-view"
@click="handleDetail(scope.row)" @click="handleDetail(scope.row)"
v-hasPerm="['monitor:loginlog:detail']"
>详情</el-button> >详情</el-button>
<el-button <el-button
v-hasPerm="['monitor:loginlog:remove']"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPerm="['monitor:loginlog:remove']"
>删除</el-button> >删除</el-button>
<el-button slot="reference">操作</el-button> <el-button slot="reference">操作</el-button>
</el-popover> </el-popover>
...@@ -132,14 +132,13 @@ ...@@ -132,14 +132,13 @@
<el-pagination <el-pagination
:page-sizes="[10, 20, 50, 100]" :page-sizes="[10, 20, 50, 100]"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="queryParams.pageNum" :current-page.sync="queryParams.pageNum"
:page-size.sync="queryParams.pageSize" :page-size.sync="queryParams.pageSize"
:total="total" :total="total"
></el-pagination> @size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -147,9 +146,9 @@ import { pageLog, delLog, delLogs } from '@/api/monitor/loginlog' ...@@ -147,9 +146,9 @@ import { pageLog, delLog, delLogs } from '@/api/monitor/loginlog'
export default { export default {
name: 'LoginLogList', name: 'LoginLogList',
data () { data() {
return { return {
tableHeight: document.body.offsetHeight - 340 + 'px', tableHeight: document.body.offsetHeight - 310 + 'px',
// 展示切换 // 展示切换
showOptions: { showOptions: {
data: {}, data: {},
...@@ -187,15 +186,15 @@ export default { ...@@ -187,15 +186,15 @@ export default {
} }
} }
}, },
created () { created() {
this.getList() this.getList()
}, },
mounted () { mounted() {
this.initCols() this.initCols()
}, },
methods: { methods: {
/** 查询日志列表 */ /** 查询日志列表 */
getList () { getList() {
this.loading = true this.loading = true
pageLog(this.queryParams).then(response => { pageLog(this.queryParams).then(response => {
this.loading = false this.loading = false
...@@ -206,10 +205,10 @@ export default { ...@@ -206,10 +205,10 @@ export default {
} }
}) })
}, },
initCols () { initCols() {
this.checkedTableColumns = this.tableColumns.map(col => col.prop) this.checkedTableColumns = this.tableColumns.map(col => col.prop)
}, },
handleCheckedColsChange (val) { handleCheckedColsChange(val) {
this.tableColumns.forEach(col => { this.tableColumns.forEach(col => {
if (!this.checkedTableColumns.includes(col.prop)) { if (!this.checkedTableColumns.includes(col.prop)) {
col.show = false col.show = false
...@@ -218,38 +217,38 @@ export default { ...@@ -218,38 +217,38 @@ export default {
} }
}) })
}, },
handleCommand (command) { handleCommand(command) {
this.tableSize = command this.tableSize = command
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery () { handleQuery() {
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
this.getList() this.getList()
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery () { resetQuery() {
this.$refs['queryForm'].resetFields() this.$refs['queryForm'].resetFields()
this.handleQuery() this.handleQuery()
}, },
/** 刷新列表 */ /** 刷新列表 */
handleRefresh () { handleRefresh() {
this.getList() this.getList()
}, },
/** 多选框选中数据 */ /** 多选框选中数据 */
handleSelectionChange (selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id) this.ids = selection.map(item => item.id)
this.single = selection.length !== 1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 详情按钮操作 */ /** 详情按钮操作 */
handleDetail (row) { handleDetail(row) {
this.showOptions.data.id = row.id || this.ids[0] this.showOptions.data.id = row.id || this.ids[0]
this.showOptions.showList = false this.showOptions.showList = false
this.showOptions.showDetail = true this.showOptions.showDetail = true
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete (row) { handleDelete(row) {
this.$confirm('选中数据将被永久删除, 是否继续?', '提示', { this.$confirm('选中数据将被永久删除, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
...@@ -262,7 +261,7 @@ export default { ...@@ -262,7 +261,7 @@ export default {
}) })
}, },
/** 批量删除按钮操作 */ /** 批量删除按钮操作 */
handleBatchDelete () { handleBatchDelete() {
if (!this.ids.length) { if (!this.ids.length) {
this.$message({ this.$message({
message: '请先选择需要操作的数据', message: '请先选择需要操作的数据',
...@@ -271,13 +270,13 @@ export default { ...@@ -271,13 +270,13 @@ export default {
} }
this.$message.warning('不支持批量删除') this.$message.warning('不支持批量删除')
}, },
handleSizeChange (val) { handleSizeChange(val) {
console.log(`每页 ${val} 条`) console.log(`每页 ${val} 条`)
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
this.queryParams.pageSize = val this.queryParams.pageSize = val
this.getList() this.getList()
}, },
handleCurrentChange (val) { handleCurrentChange(val) {
console.log(`当前页: ${val}`) console.log(`当前页: ${val}`)
this.queryParams.pageNum = val this.queryParams.pageNum = val
this.getList() this.getList()
...@@ -290,4 +289,7 @@ export default { ...@@ -290,4 +289,7 @@ export default {
.right-toolbar { .right-toolbar {
float: right; float: right;
} }
.el-card ::v-deep .el-card__body {
height: calc(100vh - 170px);
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>{{ title }}</span> <span>{{ title }}</span>
...@@ -7,7 +6,7 @@ ...@@ -7,7 +6,7 @@
<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>
<div :style="classCardbody"> <div class="body-wrapper">
<el-form ref="form" :model="form" label-width="80px" disabled> <el-form ref="form" :model="form" label-width="80px" disabled>
<el-form-item label="所属模块" prop="module"> <el-form-item label="所属模块" prop="module">
<el-input v-model="form.module" /> <el-input v-model="form.module" />
...@@ -54,7 +53,6 @@ ...@@ -54,7 +53,6 @@
</el-form> </el-form>
</div> </div>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -65,17 +63,13 @@ export default { ...@@ -65,17 +63,13 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function () { default: function() {
return {} return {}
} }
} }
}, },
data () { data() {
return { return {
classCardbody: {
overflow: 'auto',
height: document.body.offsetHeight - 240 + 'px'
},
title: '操作日志详情', title: '操作日志详情',
// 展示切换 // 展示切换
showOptions: { showOptions: {
...@@ -87,18 +81,18 @@ export default { ...@@ -87,18 +81,18 @@ export default {
form: {} form: {}
} }
}, },
created () { created() {
console.log('id:' + this.data.id) console.log('id:' + this.data.id)
}, },
mounted () { mounted() {
this.getLog(this.data.id) this.getLog(this.data.id)
}, },
methods: { methods: {
showCard () { showCard() {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 获取详情 */ /** 获取详情 */
getLog: function (id) { getLog: function(id) {
getLog(id).then(response => { getLog(id).then(response => {
if (response.success) { if (response.success) {
this.form = response.data this.form = response.data
...@@ -110,5 +104,8 @@ export default { ...@@ -110,5 +104,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 230px);
overflow-y: auto;
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<el-form :model="queryParams" ref="queryForm" :inline="true"> <el-form ref="queryForm" :model="queryParams" :inline="true">
<el-form-item label="模块名称" prop="module"> <el-form-item label="模块名称" prop="module">
<el-input <el-input
v-model="queryParams.module" v-model="queryParams.module"
...@@ -36,20 +35,20 @@ ...@@ -36,20 +35,20 @@
<el-col :span="12"> <el-col :span="12">
<el-button-group> <el-button-group>
<el-button <el-button
v-hasPerm="['monitor:operlog:detail']"
type="info" type="info"
icon="el-icon-view" icon="el-icon-view"
size="mini" size="mini"
:disabled="single" :disabled="single"
@click="handleDetail" @click="handleDetail"
v-hasPerm="['monitor:operlog:detail']"
>详情</el-button> >详情</el-button>
<el-button <el-button
v-hasPerm="['monitor:operlog:remove']"
type="danger" type="danger"
icon="el-icon-delete" icon="el-icon-delete"
size="mini" size="mini"
:disabled="multiple" :disabled="multiple"
@click="handleBatchDelete" @click="handleBatchDelete"
v-hasPerm="['monitor:operlog:remove']"
>删除</el-button> >删除</el-button>
</el-button-group> </el-button-group>
</el-col> </el-col>
...@@ -95,12 +94,12 @@ ...@@ -95,12 +94,12 @@
<el-table <el-table
v-loading="loading" v-loading="loading"
:data="logList" :data="logList"
@selection-change="handleSelectionChange"
border border
tooltip-effect="dark" tooltip-effect="dark"
:size="tableSize" :size="tableSize"
:height="tableHeight" :height="tableHeight"
style="width: 100%;margin: 15px 0;" style="width: 100%;margin: 15px 0;"
@selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" width="55" align="center"> <el-table-column label="序号" width="55" align="center">
...@@ -111,9 +110,9 @@ ...@@ -111,9 +110,9 @@
<template v-for="(item, index) in tableColumns"> <template v-for="(item, index) in tableColumns">
<el-table-column <el-table-column
v-if="item.show" v-if="item.show"
:key="index"
:prop="item.prop" :prop="item.prop"
:label="item.label" :label="item.label"
:key="index"
:formatter="item.formatter" :formatter="item.formatter"
align="center" align="center"
show-overflow-tooltip show-overflow-tooltip
...@@ -123,20 +122,21 @@ ...@@ -123,20 +122,21 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-popover <el-popover
placement="left" placement="left"
trigger="click"> trigger="click"
>
<el-button <el-button
v-hasPerm="['monitor:operlog:detail']"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-view" icon="el-icon-view"
@click="handleDetail(scope.row)" @click="handleDetail(scope.row)"
v-hasPerm="['monitor:operlog:detail']"
>详情</el-button> >详情</el-button>
<el-button <el-button
v-hasPerm="['monitor:operlog:remove']"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPerm="['monitor:operlog:remove']"
>删除</el-button> >删除</el-button>
<el-button slot="reference">操作</el-button> <el-button slot="reference">操作</el-button>
</el-popover> </el-popover>
...@@ -147,14 +147,13 @@ ...@@ -147,14 +147,13 @@
<el-pagination <el-pagination
:page-sizes="[10, 20, 50, 100]" :page-sizes="[10, 20, 50, 100]"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="queryParams.pageNum" :current-page.sync="queryParams.pageNum"
:page-size.sync="queryParams.pageSize" :page-size.sync="queryParams.pageSize"
:total="total" :total="total"
></el-pagination> @size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -162,9 +161,9 @@ import { pageLog, delLog, delLogs } from '@/api/monitor/operlog' ...@@ -162,9 +161,9 @@ import { pageLog, delLog, delLogs } from '@/api/monitor/operlog'
export default { export default {
name: 'OperLogList', name: 'OperLogList',
data () { data() {
return { return {
tableHeight: document.body.offsetHeight - 340 + 'px', tableHeight: document.body.offsetHeight - 310 + 'px',
// 展示切换 // 展示切换
showOptions: { showOptions: {
data: {}, data: {},
...@@ -205,15 +204,15 @@ export default { ...@@ -205,15 +204,15 @@ export default {
} }
} }
}, },
created () { created() {
this.getList() this.getList()
}, },
mounted () { mounted() {
this.initCols() this.initCols()
}, },
methods: { methods: {
/** 查询日志列表 */ /** 查询日志列表 */
getList () { getList() {
this.loading = true this.loading = true
pageLog(this.queryParams).then(response => { pageLog(this.queryParams).then(response => {
this.loading = false this.loading = false
...@@ -224,10 +223,10 @@ export default { ...@@ -224,10 +223,10 @@ export default {
} }
}) })
}, },
initCols () { initCols() {
this.checkedTableColumns = this.tableColumns.map(col => col.prop) this.checkedTableColumns = this.tableColumns.map(col => col.prop)
}, },
handleCheckedColsChange (val) { handleCheckedColsChange(val) {
this.tableColumns.forEach(col => { this.tableColumns.forEach(col => {
if (!this.checkedTableColumns.includes(col.prop)) { if (!this.checkedTableColumns.includes(col.prop)) {
col.show = false col.show = false
...@@ -236,38 +235,38 @@ export default { ...@@ -236,38 +235,38 @@ export default {
} }
}) })
}, },
handleCommand (command) { handleCommand(command) {
this.tableSize = command this.tableSize = command
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery () { handleQuery() {
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
this.getList() this.getList()
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery () { resetQuery() {
this.$refs['queryForm'].resetFields() this.$refs['queryForm'].resetFields()
this.handleQuery() this.handleQuery()
}, },
/** 刷新列表 */ /** 刷新列表 */
handleRefresh () { handleRefresh() {
this.getList() this.getList()
}, },
/** 多选框选中数据 */ /** 多选框选中数据 */
handleSelectionChange (selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id) this.ids = selection.map(item => item.id)
this.single = selection.length !== 1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 详情按钮操作 */ /** 详情按钮操作 */
handleDetail (row) { handleDetail(row) {
this.showOptions.data.id = row.id || this.ids[0] this.showOptions.data.id = row.id || this.ids[0]
this.showOptions.showList = false this.showOptions.showList = false
this.showOptions.showDetail = true this.showOptions.showDetail = true
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete (row) { handleDelete(row) {
this.$confirm('选中数据将被永久删除, 是否继续?', '提示', { this.$confirm('选中数据将被永久删除, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
...@@ -280,7 +279,7 @@ export default { ...@@ -280,7 +279,7 @@ export default {
}) })
}, },
/** 批量删除按钮操作 */ /** 批量删除按钮操作 */
handleBatchDelete () { handleBatchDelete() {
if (!this.ids.length) { if (!this.ids.length) {
this.$message({ this.$message({
message: '请先选择需要操作的数据', message: '请先选择需要操作的数据',
...@@ -289,13 +288,13 @@ export default { ...@@ -289,13 +288,13 @@ export default {
} }
this.$message.warning('不支持批量删除') this.$message.warning('不支持批量删除')
}, },
handleSizeChange (val) { handleSizeChange(val) {
console.log(`每页 ${val} 条`) console.log(`每页 ${val} 条`)
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
this.queryParams.pageSize = val this.queryParams.pageSize = val
this.getList() this.getList()
}, },
handleCurrentChange (val) { handleCurrentChange(val) {
console.log(`当前页: ${val}`) console.log(`当前页: ${val}`)
this.queryParams.pageNum = val this.queryParams.pageNum = val
this.getList() this.getList()
...@@ -308,4 +307,7 @@ export default { ...@@ -308,4 +307,7 @@ export default {
.right-toolbar { .right-toolbar {
float: right; float: right;
} }
.el-card ::v-deep .el-card__body {
height: calc(100vh - 170px);
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<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-plus" round @click="submitForm" :loading="loadingOptions.loading" :disabled="loadingOptions.isDisabled">{{loadingOptions.loadingText}}</el-button> <el-button size="mini" icon="el-icon-plus" round :loading="loadingOptions.loading" :disabled="loadingOptions.isDisabled" @click="submitForm">{{ loadingOptions.loadingText }}</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>
<div :style="classCardbody"> <div class="body-wrapper">
<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="任务名称" prop="jobName"> <el-form-item label="任务名称" prop="jobName">
<el-input v-model="form.jobName" placeholder="请输入任务名称" /> <el-input v-model="form.jobName" placeholder="请输入任务名称" />
...@@ -31,7 +30,7 @@ ...@@ -31,7 +30,7 @@
v-for="dict in statusOptions" v-for="dict in statusOptions"
:key="dict.id" :key="dict.id"
:label="dict.itemText" :label="dict.itemText"
>{{dict.itemValue}}</el-radio> >{{ dict.itemValue }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
...@@ -40,7 +39,6 @@ ...@@ -40,7 +39,6 @@
</el-form> </el-form>
</div> </div>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -51,17 +49,13 @@ export default { ...@@ -51,17 +49,13 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function () { default: function() {
return {} return {}
} }
} }
}, },
data () { data() {
return { return {
classCardbody: {
overflow: 'auto',
height: document.body.offsetHeight - 240 + 'px'
},
title: '任务新增', title: '任务新增',
// 展示切换 // 展示切换
showOptions: { showOptions: {
...@@ -100,7 +94,7 @@ export default { ...@@ -100,7 +94,7 @@ export default {
statusOptions: [] statusOptions: []
} }
}, },
created () { created() {
this.getDicts('sys_job_status').then(response => { this.getDicts('sys_job_status').then(response => {
if (response.success) { if (response.success) {
this.statusOptions = response.data this.statusOptions = response.data
...@@ -108,11 +102,11 @@ export default { ...@@ -108,11 +102,11 @@ export default {
}) })
}, },
methods: { methods: {
showCard () { showCard() {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function () { submitForm: function() {
this.$refs['form'].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
this.loadingOptions.loading = true this.loadingOptions.loading = true
...@@ -140,5 +134,8 @@ export default { ...@@ -140,5 +134,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 230px);
overflow-y: auto;
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>{{ title }}</span> <span>{{ title }}</span>
...@@ -7,7 +6,7 @@ ...@@ -7,7 +6,7 @@
<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>
<div :style="classCardbody"> <div class="body-wrapper">
<el-form ref="form" :model="form" label-width="80px" disabled> <el-form ref="form" :model="form" label-width="80px" disabled>
<el-form-item label="任务名称" prop="jobName"> <el-form-item label="任务名称" prop="jobName">
<el-input v-model="form.jobName" placeholder="请输入任务名称" /> <el-input v-model="form.jobName" placeholder="请输入任务名称" />
...@@ -30,7 +29,7 @@ ...@@ -30,7 +29,7 @@
v-for="dict in statusOptions" v-for="dict in statusOptions"
:key="dict.id" :key="dict.id"
:label="dict.itemText" :label="dict.itemText"
>{{dict.itemValue}}</el-radio> >{{ dict.itemValue }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
...@@ -39,7 +38,6 @@ ...@@ -39,7 +38,6 @@
</el-form> </el-form>
</div> </div>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -50,17 +48,13 @@ export default { ...@@ -50,17 +48,13 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function () { default: function() {
return {} return {}
} }
} }
}, },
data () { data() {
return { return {
classCardbody: {
overflow: 'auto',
height: document.body.offsetHeight - 240 + 'px'
},
title: '任务详情', title: '任务详情',
// 展示切换 // 展示切换
showOptions: { showOptions: {
...@@ -76,7 +70,7 @@ export default { ...@@ -76,7 +70,7 @@ export default {
statusOptions: [] statusOptions: []
} }
}, },
created () { created() {
console.log('id:' + this.data.id) console.log('id:' + this.data.id)
this.getDicts('sys_job_status').then(response => { this.getDicts('sys_job_status').then(response => {
if (response.success) { if (response.success) {
...@@ -84,15 +78,15 @@ export default { ...@@ -84,15 +78,15 @@ export default {
} }
}) })
}, },
mounted () { mounted() {
this.getJob(this.data.id) this.getJob(this.data.id)
}, },
methods: { methods: {
showCard () { showCard() {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 获取详情 */ /** 获取详情 */
getJob: function (id) { getJob: function(id) {
getJob(id).then(response => { getJob(id).then(response => {
if (response.success) { if (response.success) {
this.form = response.data this.form = response.data
...@@ -104,5 +98,8 @@ export default { ...@@ -104,5 +98,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 230px);
overflow-y: auto;
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<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-plus" round @click="submitForm" :loading="loadingOptions.loading" :disabled="loadingOptions.isDisabled">{{loadingOptions.loadingText}}</el-button> <el-button size="mini" icon="el-icon-plus" round :loading="loadingOptions.loading" :disabled="loadingOptions.isDisabled" @click="submitForm">{{ loadingOptions.loadingText }}</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>
<div :style="classCardbody"> <div class="body-wrapper">
<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="任务名称" prop="jobName"> <el-form-item label="任务名称" prop="jobName">
<el-input v-model="form.jobName" placeholder="请输入任务名称" /> <el-input v-model="form.jobName" placeholder="请输入任务名称" />
...@@ -31,7 +30,7 @@ ...@@ -31,7 +30,7 @@
v-for="dict in statusOptions" v-for="dict in statusOptions"
:key="dict.id" :key="dict.id"
:label="dict.itemText" :label="dict.itemText"
>{{dict.itemValue}}</el-radio> >{{ dict.itemValue }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
...@@ -40,7 +39,6 @@ ...@@ -40,7 +39,6 @@
</el-form> </el-form>
</div> </div>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -51,17 +49,13 @@ export default { ...@@ -51,17 +49,13 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function () { default: function() {
return {} return {}
} }
} }
}, },
data () { data() {
return { return {
classCardbody: {
overflow: 'auto',
height: document.body.offsetHeight - 240 + 'px'
},
title: '任务编辑', title: '任务编辑',
// 展示切换 // 展示切换
showOptions: { showOptions: {
...@@ -98,7 +92,7 @@ export default { ...@@ -98,7 +92,7 @@ export default {
statusOptions: [] statusOptions: []
} }
}, },
created () { created() {
console.log('id:' + this.data.id) console.log('id:' + this.data.id)
this.getDicts('sys_job_status').then(response => { this.getDicts('sys_job_status').then(response => {
if (response.success) { if (response.success) {
...@@ -106,15 +100,15 @@ export default { ...@@ -106,15 +100,15 @@ export default {
} }
}) })
}, },
mounted () { mounted() {
this.getJob(this.data.id) this.getJob(this.data.id)
}, },
methods: { methods: {
showCard () { showCard() {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 获取详情 */ /** 获取详情 */
getJob: function (id) { getJob: function(id) {
getJob(id).then(response => { getJob(id).then(response => {
if (response.success) { if (response.success) {
this.form = response.data this.form = response.data
...@@ -122,7 +116,7 @@ export default { ...@@ -122,7 +116,7 @@ export default {
}) })
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function () { submitForm: function() {
this.$refs['form'].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
this.loadingOptions.loading = true this.loadingOptions.loading = true
...@@ -150,5 +144,8 @@ export default { ...@@ -150,5 +144,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 230px);
overflow-y: auto;
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<el-form ref="queryForm" :model="queryParams" :inline="true"> <el-form ref="queryForm" :model="queryParams" :inline="true">
<el-form-item label="任务名称" prop="jobName"> <el-form-item label="任务名称" prop="jobName">
...@@ -185,7 +184,6 @@ ...@@ -185,7 +184,6 @@
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
/> />
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -195,7 +193,7 @@ export default { ...@@ -195,7 +193,7 @@ export default {
name: 'JobList', name: 'JobList',
data() { data() {
return { return {
tableHeight: document.body.offsetHeight - 340 + 'px', tableHeight: document.body.offsetHeight - 310 + 'px',
// 展示切换 // 展示切换
showOptions: { showOptions: {
data: {}, data: {},
...@@ -419,4 +417,7 @@ export default { ...@@ -419,4 +417,7 @@ export default {
.right-toolbar { .right-toolbar {
float: right; float: right;
} }
.el-card ::v-deep .el-card__body {
height: calc(100vh - 170px);
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>{{ title }}</span> <span>{{ title }}</span>
...@@ -7,7 +6,7 @@ ...@@ -7,7 +6,7 @@
<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>
<div :style="classCardbody"> <div class="body-wrapper">
<el-form ref="form" :model="form" label-width="80px" disabled> <el-form ref="form" :model="form" label-width="80px" disabled>
<el-form-item label="信息记录" prop="msg"> <el-form-item label="信息记录" prop="msg">
<el-input v-model="form.msg" placeholder="请输入信息记录" /> <el-input v-model="form.msg" placeholder="请输入信息记录" />
...@@ -21,13 +20,12 @@ ...@@ -21,13 +20,12 @@
v-for="dict in statusOptions" v-for="dict in statusOptions"
:key="dict.id" :key="dict.id"
:label="dict.itemText" :label="dict.itemText"
>{{dict.itemValue}}</el-radio> >{{ dict.itemValue }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -38,17 +36,13 @@ export default { ...@@ -38,17 +36,13 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function () { default: function() {
return {} return {}
} }
} }
}, },
data () { data() {
return { return {
classCardbody: {
overflow: 'auto',
height: document.body.offsetHeight - 240 + 'px'
},
title: '任务日志详情', title: '任务日志详情',
// 展示切换 // 展示切换
showOptions: { showOptions: {
...@@ -62,7 +56,7 @@ export default { ...@@ -62,7 +56,7 @@ export default {
statusOptions: [] statusOptions: []
} }
}, },
created () { created() {
console.log('id:' + this.data.id) console.log('id:' + this.data.id)
this.getDicts('sys_normal_status').then(response => { this.getDicts('sys_normal_status').then(response => {
if (response.success) { if (response.success) {
...@@ -70,15 +64,15 @@ export default { ...@@ -70,15 +64,15 @@ export default {
} }
}) })
}, },
mounted () { mounted() {
this.getLog(this.data.id) this.getLog(this.data.id)
}, },
methods: { methods: {
showCard () { showCard() {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 获取详情 */ /** 获取详情 */
getLog: function (id) { getLog: function(id) {
getLog(id).then(response => { getLog(id).then(response => {
if (response.success) { if (response.success) {
this.form = response.data this.form = response.data
...@@ -90,5 +84,8 @@ export default { ...@@ -90,5 +84,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 230px);
overflow-y: auto;
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<el-form ref="queryForm" :model="queryParams" :inline="true"> <el-form ref="queryForm" :model="queryParams" :inline="true">
<el-form-item label="定时任务" prop="jobId"> <el-form-item label="定时任务" prop="jobId">
...@@ -147,7 +146,6 @@ ...@@ -147,7 +146,6 @@
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
/> />
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -158,7 +156,7 @@ export default { ...@@ -158,7 +156,7 @@ export default {
name: 'JobLogList', name: 'JobLogList',
data() { data() {
return { return {
tableHeight: document.body.offsetHeight - 340 + 'px', tableHeight: document.body.offsetHeight - 310 + 'px',
// 展示切换 // 展示切换
showOptions: { showOptions: {
data: {}, data: {},
...@@ -327,4 +325,7 @@ export default { ...@@ -327,4 +325,7 @@ export default {
.right-toolbar { .right-toolbar {
float: right; float: right;
} }
.el-card ::v-deep .el-card__body {
height: calc(100vh - 170px);
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>{{ title }}</span> <span>{{ title }}</span>
...@@ -8,7 +7,7 @@ ...@@ -8,7 +7,7 @@
<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>
<div :style="classCardbody"> <div class="body-wrapper">
<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="标准编码" prop="gbCode"> <el-form-item label="标准编码" prop="gbCode">
<el-input v-model="form.gbCode" placeholder="请输入标准编码" /> <el-input v-model="form.gbCode" placeholder="请输入标准编码" />
...@@ -31,7 +30,6 @@ ...@@ -31,7 +30,6 @@
</el-form> </el-form>
</div> </div>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -49,10 +47,6 @@ export default { ...@@ -49,10 +47,6 @@ export default {
}, },
data() { data() {
return { return {
classCardbody: {
overflow: 'auto',
height: document.body.offsetHeight - 240 + 'px'
},
title: '标准字典新增', title: '标准字典新增',
// 展示切换 // 展示切换
showOptions: { showOptions: {
...@@ -130,5 +124,8 @@ export default { ...@@ -130,5 +124,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 230px);
overflow-y: auto;
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>{{ title }}</span> <span>{{ title }}</span>
...@@ -7,7 +6,7 @@ ...@@ -7,7 +6,7 @@
<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>
<div :style="classCardbody"> <div class="body-wrapper">
<el-form ref="form" :model="form" label-width="80px" disabled> <el-form ref="form" :model="form" label-width="80px" disabled>
<el-form-item label="标准类别编码"> <el-form-item label="标准类别编码">
<el-input v-model="form.gbTypeCode" placeholder="请输入标准类别编码" /> <el-input v-model="form.gbTypeCode" placeholder="请输入标准类别编码" />
...@@ -36,7 +35,6 @@ ...@@ -36,7 +35,6 @@
</el-form> </el-form>
</div> </div>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -54,10 +52,6 @@ export default { ...@@ -54,10 +52,6 @@ export default {
}, },
data() { data() {
return { return {
classCardbody: {
overflow: 'auto',
height: document.body.offsetHeight - 240 + 'px'
},
title: '标准字典详情', title: '标准字典详情',
// 展示切换 // 展示切换
showOptions: { showOptions: {
...@@ -101,5 +95,8 @@ export default { ...@@ -101,5 +95,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 230px);
overflow-y: auto;
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>{{ title }}</span> <span>{{ title }}</span>
...@@ -8,7 +7,7 @@ ...@@ -8,7 +7,7 @@
<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>
<div :style="classCardbody"> <div class="body-wrapper">
<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="标准类别编码"> <el-form-item label="标准类别编码">
<el-input v-model="form.gbTypeCode" placeholder="请输入标准类别编码" :disabled="true" /> <el-input v-model="form.gbTypeCode" placeholder="请输入标准类别编码" :disabled="true" />
...@@ -37,7 +36,6 @@ ...@@ -37,7 +36,6 @@
</el-form> </el-form>
</div> </div>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -55,10 +53,6 @@ export default { ...@@ -55,10 +53,6 @@ export default {
}, },
data() { data() {
return { return {
classCardbody: {
overflow: 'auto',
height: document.body.offsetHeight - 240 + 'px'
},
title: '标准字典编辑', title: '标准字典编辑',
// 展示切换 // 展示切换
showOptions: { showOptions: {
...@@ -141,5 +135,8 @@ export default { ...@@ -141,5 +135,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 230px);
overflow-y: auto;
}
</style> </style>
<template> <template>
<div>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="4"> <el-col :span="4">
<el-card class="box-card tree-wrapper" shadow="always"> <el-card class="box-card tree-wrapper" shadow="always">
...@@ -119,7 +118,7 @@ ...@@ -119,7 +118,7 @@
border border
tooltip-effect="dark" tooltip-effect="dark"
:size="tableSize" :size="tableSize"
height="calc(100vh - 50%)" :height="tableHeight"
style="width: 100%;margin: 15px 0;" style="width: 100%;margin: 15px 0;"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
...@@ -182,7 +181,6 @@ ...@@ -182,7 +181,6 @@
</el-card> </el-card>
</el-col> </el-col>
</el-row> </el-row>
</div>
</template> </template>
<script> <script>
...@@ -192,7 +190,7 @@ export default { ...@@ -192,7 +190,7 @@ export default {
name: 'DataDictList', name: 'DataDictList',
data() { data() {
return { return {
tableHeight: document.body.offsetHeight - 340 + 'px', tableHeight: document.body.offsetHeight - 310 + 'px',
// 展示切换 // 展示切换
showOptions: { showOptions: {
data: {}, data: {},
...@@ -409,4 +407,7 @@ export default { ...@@ -409,4 +407,7 @@ export default {
.el-card ::v-deep .el-card__body { .el-card ::v-deep .el-card__body {
height: calc(100vh - 170px); height: calc(100vh - 170px);
} }
.tree-wrapper {
overflow-y: auto;
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<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-plus" round @click="submitForm" :loading="loadingOptions.loading" :disabled="loadingOptions.isDisabled">{{loadingOptions.loadingText}}</el-button> <el-button size="mini" icon="el-icon-plus" round :loading="loadingOptions.loading" :disabled="loadingOptions.isDisabled" @click="submitForm">{{ loadingOptions.loadingText }}</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>
<div :style="classCardbody"> <div class="body-wrapper">
<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="参数名称" prop="configName"> <el-form-item label="参数名称" prop="configName">
<el-input v-model="form.configName" placeholder="请输入参数名称" /> <el-input v-model="form.configName" placeholder="请输入参数名称" />
...@@ -25,7 +24,7 @@ ...@@ -25,7 +24,7 @@
v-for="dict in statusOptions" v-for="dict in statusOptions"
:key="dict.id" :key="dict.id"
:label="dict.itemText" :label="dict.itemText"
>{{dict.itemValue}}</el-radio> >{{ dict.itemValue }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
...@@ -34,7 +33,6 @@ ...@@ -34,7 +33,6 @@
</el-form> </el-form>
</div> </div>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -45,17 +43,13 @@ export default { ...@@ -45,17 +43,13 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function () { default: function() {
return {} return {}
} }
} }
}, },
data () { data() {
return { return {
classCardbody: {
overflow: 'auto',
height: document.body.offsetHeight - 240 + 'px'
},
title: '参数新增', title: '参数新增',
// 展示切换 // 展示切换
showOptions: { showOptions: {
...@@ -91,7 +85,7 @@ export default { ...@@ -91,7 +85,7 @@ export default {
statusOptions: [] statusOptions: []
} }
}, },
created () { created() {
this.getDicts('sys_common_status').then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
this.statusOptions = response.data this.statusOptions = response.data
...@@ -99,11 +93,11 @@ export default { ...@@ -99,11 +93,11 @@ export default {
}) })
}, },
methods: { methods: {
showCard () { showCard() {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function () { submitForm: function() {
this.$refs['form'].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
this.loadingOptions.loading = true this.loadingOptions.loading = true
...@@ -131,5 +125,8 @@ export default { ...@@ -131,5 +125,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 230px);
overflow-y: auto;
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>{{ title }}</span> <span>{{ title }}</span>
...@@ -7,7 +6,7 @@ ...@@ -7,7 +6,7 @@
<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>
<div :style="classCardbody"> <div class="body-wrapper">
<el-form ref="form" :model="form" label-width="80px" disabled> <el-form ref="form" :model="form" label-width="80px" disabled>
<el-form-item label="参数名称" prop="configName"> <el-form-item label="参数名称" prop="configName">
<el-input v-model="form.configName" placeholder="请输入参数名称" /> <el-input v-model="form.configName" placeholder="请输入参数名称" />
...@@ -24,7 +23,7 @@ ...@@ -24,7 +23,7 @@
v-for="dict in statusOptions" v-for="dict in statusOptions"
:key="dict.id" :key="dict.id"
:label="dict.itemText" :label="dict.itemText"
>{{dict.itemValue}}</el-radio> >{{ dict.itemValue }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
...@@ -33,7 +32,6 @@ ...@@ -33,7 +32,6 @@
</el-form> </el-form>
</div> </div>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -44,17 +42,13 @@ export default { ...@@ -44,17 +42,13 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function () { default: function() {
return {} return {}
} }
} }
}, },
data () { data() {
return { return {
classCardbody: {
overflow: 'auto',
height: document.body.offsetHeight - 240 + 'px'
},
title: '参数详情', title: '参数详情',
// 展示切换 // 展示切换
showOptions: { showOptions: {
...@@ -70,7 +64,7 @@ export default { ...@@ -70,7 +64,7 @@ export default {
statusOptions: [] statusOptions: []
} }
}, },
created () { created() {
console.log('id:' + this.data.id) console.log('id:' + this.data.id)
this.getDicts('sys_common_status').then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
...@@ -78,15 +72,15 @@ export default { ...@@ -78,15 +72,15 @@ export default {
} }
}) })
}, },
mounted () { mounted() {
this.getConfig(this.data.id) this.getConfig(this.data.id)
}, },
methods: { methods: {
showCard () { showCard() {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 获取详情 */ /** 获取详情 */
getConfig: function (id) { getConfig: function(id) {
getConfig(id).then(response => { getConfig(id).then(response => {
if (response.success) { if (response.success) {
this.form = response.data this.form = response.data
...@@ -98,5 +92,8 @@ export default { ...@@ -98,5 +92,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 230px);
overflow-y: auto;
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<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-plus" round @click="submitForm" :loading="loadingOptions.loading" :disabled="loadingOptions.isDisabled">{{loadingOptions.loadingText}}</el-button> <el-button size="mini" icon="el-icon-plus" round :loading="loadingOptions.loading" :disabled="loadingOptions.isDisabled" @click="submitForm">{{ loadingOptions.loadingText }}</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>
<div :style="classCardbody"> <div class="body-wrapper">
<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="参数名称" prop="configName"> <el-form-item label="参数名称" prop="configName">
<el-input v-model="form.configName" placeholder="请输入参数名称" /> <el-input v-model="form.configName" placeholder="请输入参数名称" />
...@@ -25,7 +24,7 @@ ...@@ -25,7 +24,7 @@
v-for="dict in statusOptions" v-for="dict in statusOptions"
:key="dict.id" :key="dict.id"
:label="dict.itemText" :label="dict.itemText"
>{{dict.itemValue}}</el-radio> >{{ dict.itemValue }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
...@@ -34,7 +33,6 @@ ...@@ -34,7 +33,6 @@
</el-form> </el-form>
</div> </div>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -45,17 +43,13 @@ export default { ...@@ -45,17 +43,13 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function () { default: function() {
return {} return {}
} }
} }
}, },
data () { data() {
return { return {
classCardbody: {
overflow: 'auto',
height: document.body.offsetHeight - 240 + 'px'
},
title: '参数编辑', title: '参数编辑',
// 展示切换 // 展示切换
showOptions: { showOptions: {
...@@ -89,7 +83,7 @@ export default { ...@@ -89,7 +83,7 @@ export default {
statusOptions: [] statusOptions: []
} }
}, },
created () { created() {
console.log('id:' + this.data.id) console.log('id:' + this.data.id)
this.getDicts('sys_common_status').then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
...@@ -97,15 +91,15 @@ export default { ...@@ -97,15 +91,15 @@ export default {
} }
}) })
}, },
mounted () { mounted() {
this.getConfig(this.data.id) this.getConfig(this.data.id)
}, },
methods: { methods: {
showCard () { showCard() {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 获取详情 */ /** 获取详情 */
getConfig: function (id) { getConfig: function(id) {
getConfig(id).then(response => { getConfig(id).then(response => {
if (response.success) { if (response.success) {
this.form = response.data this.form = response.data
...@@ -113,7 +107,7 @@ export default { ...@@ -113,7 +107,7 @@ export default {
}) })
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function () { submitForm: function() {
this.$refs['form'].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
this.loadingOptions.loading = true this.loadingOptions.loading = true
...@@ -141,5 +135,8 @@ export default { ...@@ -141,5 +135,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 230px);
overflow-y: auto;
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<el-form ref="queryForm" :model="queryParams" :inline="true"> <el-form ref="queryForm" :model="queryParams" :inline="true">
<el-form-item label="参数名称" prop="configName"> <el-form-item label="参数名称" prop="configName">
...@@ -169,7 +168,6 @@ ...@@ -169,7 +168,6 @@
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
/> />
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -179,7 +177,7 @@ export default { ...@@ -179,7 +177,7 @@ export default {
name: 'ConfigList', name: 'ConfigList',
data() { data() {
return { return {
tableHeight: document.body.offsetHeight - 340 + 'px', tableHeight: document.body.offsetHeight - 310 + 'px',
// 展示切换 // 展示切换
showOptions: { showOptions: {
data: {}, data: {},
...@@ -365,4 +363,7 @@ export default { ...@@ -365,4 +363,7 @@ export default {
.right-toolbar { .right-toolbar {
float: right; float: right;
} }
.el-card ::v-deep .el-card__body {
height: calc(100vh - 170px);
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<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-plus" round @click="submitForm" :loading="loadingOptions.loading" :disabled="loadingOptions.isDisabled">{{loadingOptions.loadingText}}</el-button> <el-button size="mini" icon="el-icon-plus" round :loading="loadingOptions.loading" :disabled="loadingOptions.isDisabled" @click="submitForm">{{ loadingOptions.loadingText }}</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>
<div :style="classCardbody"> <div class="body-wrapper">
<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="上级部门" prop="parentId"> <el-form-item label="上级部门" prop="parentId">
<treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="请选择上级部门" /> <treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="请选择上级部门" />
...@@ -25,7 +24,7 @@ ...@@ -25,7 +24,7 @@
v-for="dict in statusOptions" v-for="dict in statusOptions"
:key="dict.id" :key="dict.id"
:label="dict.itemText" :label="dict.itemText"
>{{dict.itemValue}}</el-radio> >{{ dict.itemValue }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
...@@ -34,7 +33,6 @@ ...@@ -34,7 +33,6 @@
</el-form> </el-form>
</div> </div>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -49,17 +47,13 @@ export default { ...@@ -49,17 +47,13 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function () { default: function() {
return {} return {}
} }
} }
}, },
data () { data() {
return { return {
classCardbody: {
overflow: 'auto',
height: document.body.offsetHeight - 240 + 'px'
},
title: '部门新增', title: '部门新增',
// 展示切换 // 展示切换
showOptions: { showOptions: {
...@@ -98,7 +92,7 @@ export default { ...@@ -98,7 +92,7 @@ export default {
deptOptions: [] deptOptions: []
} }
}, },
created () { created() {
console.log('data:' + JSON.stringify(this.data)) console.log('data:' + JSON.stringify(this.data))
this.getDicts('sys_common_status').then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
...@@ -108,10 +102,10 @@ export default { ...@@ -108,10 +102,10 @@ export default {
this.getDeptTreeSelect() this.getDeptTreeSelect()
}, },
methods: { methods: {
showCard () { showCard() {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
getDeptTreeSelect: function () { getDeptTreeSelect: function() {
listDept().then(response => { listDept().then(response => {
if (response.success) { if (response.success) {
const { data } = response const { data } = response
...@@ -127,7 +121,7 @@ export default { ...@@ -127,7 +121,7 @@ export default {
}) })
}, },
/** 转换部门数据结构 */ /** 转换部门数据结构 */
normalizer (node) { normalizer(node) {
if (node.children && !node.children.length) { if (node.children && !node.children.length) {
delete node.children delete node.children
} }
...@@ -138,7 +132,7 @@ export default { ...@@ -138,7 +132,7 @@ export default {
} }
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm: function () { submitForm: function() {
this.$refs['form'].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
this.loadingOptions.loading = true this.loadingOptions.loading = true
...@@ -166,5 +160,8 @@ export default { ...@@ -166,5 +160,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 230px);
overflow-y: auto;
}
</style> </style>
<template> <template>
<div>
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>{{ title }}</span> <span>{{ title }}</span>
...@@ -7,10 +6,10 @@ ...@@ -7,10 +6,10 @@
<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>
<div :style="classCardbody"> <div class="body-wrapper">
<el-form ref="form" :model="form" label-width="80px" disabled> <el-form ref="form" :model="form" label-width="80px" disabled>
<el-form-item label="上级部门" prop="parentId"> <el-form-item label="上级部门" prop="parentId">
<treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" disabled/> <treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" disabled />
</el-form-item> </el-form-item>
<el-form-item label="部门名称" prop="deptName"> <el-form-item label="部门名称" prop="deptName">
<el-input v-model="form.deptName" /> <el-input v-model="form.deptName" />
...@@ -24,7 +23,7 @@ ...@@ -24,7 +23,7 @@
v-for="dict in statusOptions" v-for="dict in statusOptions"
:key="dict.id" :key="dict.id"
:label="dict.itemText" :label="dict.itemText"
>{{dict.itemValue}}</el-radio> >{{ dict.itemValue }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
...@@ -33,7 +32,6 @@ ...@@ -33,7 +32,6 @@
</el-form> </el-form>
</div> </div>
</el-card> </el-card>
</div>
</template> </template>
<script> <script>
...@@ -48,17 +46,13 @@ export default { ...@@ -48,17 +46,13 @@ export default {
props: { props: {
data: { data: {
type: Object, type: Object,
default: function () { default: function() {
return {} return {}
} }
} }
}, },
data () { data() {
return { return {
classCardbody: {
overflow: 'auto',
height: document.body.offsetHeight - 240 + 'px'
},
title: '部门详情', title: '部门详情',
// 展示切换 // 展示切换
showOptions: { showOptions: {
...@@ -76,7 +70,7 @@ export default { ...@@ -76,7 +70,7 @@ export default {
deptOptions: [] deptOptions: []
} }
}, },
created () { created() {
console.log('id:' + this.data.id) console.log('id:' + this.data.id)
this.getDicts('sys_common_status').then(response => { this.getDicts('sys_common_status').then(response => {
if (response.success) { if (response.success) {
...@@ -85,14 +79,14 @@ export default { ...@@ -85,14 +79,14 @@ export default {
}) })
this.getDeptTreeSelect() this.getDeptTreeSelect()
}, },
mounted () { mounted() {
this.getDept(this.data.id) this.getDept(this.data.id)
}, },
methods: { methods: {
showCard () { showCard() {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
getDeptTreeSelect: function () { getDeptTreeSelect: function() {
listDept().then(response => { listDept().then(response => {
if (response.success) { if (response.success) {
const { data } = response const { data } = response
...@@ -108,7 +102,7 @@ export default { ...@@ -108,7 +102,7 @@ export default {
}) })
}, },
/** 转换部门数据结构 */ /** 转换部门数据结构 */
normalizer (node) { normalizer(node) {
if (node.children && !node.children.length) { if (node.children && !node.children.length) {
delete node.children delete node.children
} }
...@@ -119,7 +113,7 @@ export default { ...@@ -119,7 +113,7 @@ export default {
} }
}, },
/** 获取详情 */ /** 获取详情 */
getDept: function (id) { getDept: function(id) {
getDept(id).then(response => { getDept(id).then(response => {
if (response.success) { if (response.success) {
this.form = response.data this.form = response.data
...@@ -131,5 +125,8 @@ export default { ...@@ -131,5 +125,8 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-card ::v-deep .el-card__body {
height: calc(100vh - 230px);
overflow-y: auto;
}
</style> </style>
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