Commit b231d4d3 by yuwei

项目初始化

parent dfabd9e8
package cn.datax.service.data.factory.mapstruct;
import cn.datax.service.data.factory.api.dto.DataSetDto;
import cn.datax.service.data.factory.api.entity.DataSetEntity;
import cn.datax.service.data.factory.api.vo.DataSetVo;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
import org.springframework.stereotype.Component;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2020-04-06T12:17:20+0800",
comments = "version: 1.3.1.Final, compiler: javac, environment: Java 1.8.0_231 (Oracle Corporation)"
)
@Component
public class DataSetMapperImpl implements DataSetMapper {
@Override
public DataSetDto toDTO(DataSetEntity arg0) {
if ( arg0 == null ) {
return null;
}
DataSetDto dataSetDto = new DataSetDto();
dataSetDto.setId( arg0.getId() );
dataSetDto.setSourceId( arg0.getSourceId() );
dataSetDto.setSetName( arg0.getSetName() );
dataSetDto.setRemark( arg0.getRemark() );
dataSetDto.setSetSql( arg0.getSetSql() );
return dataSetDto;
}
@Override
public List<DataSetDto> toDTO(List<DataSetEntity> arg0) {
if ( arg0 == null ) {
return null;
}
List<DataSetDto> list = new ArrayList<DataSetDto>( arg0.size() );
for ( DataSetEntity dataSetEntity : arg0 ) {
list.add( toDTO( dataSetEntity ) );
}
return list;
}
@Override
public DataSetVo toVO(DataSetEntity arg0) {
if ( arg0 == null ) {
return null;
}
DataSetVo dataSetVo = new DataSetVo();
dataSetVo.setId( arg0.getId() );
dataSetVo.setStatus( arg0.getStatus() );
dataSetVo.setCreateTime( arg0.getCreateTime() );
dataSetVo.setSourceId( arg0.getSourceId() );
dataSetVo.setSetName( arg0.getSetName() );
dataSetVo.setRemark( arg0.getRemark() );
dataSetVo.setSetSql( arg0.getSetSql() );
return dataSetVo;
}
@Override
public List<DataSetVo> toVO(List<DataSetEntity> arg0) {
if ( arg0 == null ) {
return null;
}
List<DataSetVo> list = new ArrayList<DataSetVo>( arg0.size() );
for ( DataSetEntity dataSetEntity : arg0 ) {
list.add( toVO( dataSetEntity ) );
}
return list;
}
@Override
public DataSetEntity toEntity(DataSetDto arg0) {
if ( arg0 == null ) {
return null;
}
DataSetEntity dataSetEntity = new DataSetEntity();
dataSetEntity.setId( arg0.getId() );
dataSetEntity.setSourceId( arg0.getSourceId() );
dataSetEntity.setSetName( arg0.getSetName() );
dataSetEntity.setRemark( arg0.getRemark() );
dataSetEntity.setSetSql( arg0.getSetSql() );
return dataSetEntity;
}
@Override
public List<DataSetEntity> toEntity(List<DataSetDto> arg0) {
if ( arg0 == null ) {
return null;
}
List<DataSetEntity> list = new ArrayList<DataSetEntity>( arg0.size() );
for ( DataSetDto dataSetDto : arg0 ) {
list.add( toEntity( dataSetDto ) );
}
return list;
}
}
package cn.datax.service.data.factory.mapstruct;
import cn.datax.service.data.factory.api.dto.DataSourceDto;
import cn.datax.service.data.factory.api.entity.DataSourceEntity;
import cn.datax.service.data.factory.api.vo.DataSourceVo;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
import org.springframework.stereotype.Component;
@Generated(
value = "org.mapstruct.ap.MappingProcessor",
date = "2020-04-06T12:17:20+0800",
comments = "version: 1.3.1.Final, compiler: javac, environment: Java 1.8.0_231 (Oracle Corporation)"
)
@Component
public class DataSourceMapperImpl implements DataSourceMapper {
@Override
public DataSourceDto toDTO(DataSourceEntity arg0) {
if ( arg0 == null ) {
return null;
}
DataSourceDto dataSourceDto = new DataSourceDto();
dataSourceDto.setId( arg0.getId() );
dataSourceDto.setDbType( arg0.getDbType() );
dataSourceDto.setSourceName( arg0.getSourceName() );
dataSourceDto.setRemark( arg0.getRemark() );
dataSourceDto.setDbSchema( arg0.getDbSchema() );
return dataSourceDto;
}
@Override
public List<DataSourceDto> toDTO(List<DataSourceEntity> arg0) {
if ( arg0 == null ) {
return null;
}
List<DataSourceDto> list = new ArrayList<DataSourceDto>( arg0.size() );
for ( DataSourceEntity dataSourceEntity : arg0 ) {
list.add( toDTO( dataSourceEntity ) );
}
return list;
}
@Override
public DataSourceVo toVO(DataSourceEntity arg0) {
if ( arg0 == null ) {
return null;
}
DataSourceVo dataSourceVo = new DataSourceVo();
dataSourceVo.setId( arg0.getId() );
dataSourceVo.setStatus( arg0.getStatus() );
dataSourceVo.setCreateTime( arg0.getCreateTime() );
dataSourceVo.setDbType( arg0.getDbType() );
dataSourceVo.setSourceName( arg0.getSourceName() );
dataSourceVo.setRemark( arg0.getRemark() );
dataSourceVo.setDbSchema( arg0.getDbSchema() );
return dataSourceVo;
}
@Override
public List<DataSourceVo> toVO(List<DataSourceEntity> arg0) {
if ( arg0 == null ) {
return null;
}
List<DataSourceVo> list = new ArrayList<DataSourceVo>( arg0.size() );
for ( DataSourceEntity dataSourceEntity : arg0 ) {
list.add( toVO( dataSourceEntity ) );
}
return list;
}
@Override
public DataSourceEntity toEntity(DataSourceDto arg0) {
if ( arg0 == null ) {
return null;
}
DataSourceEntity dataSourceEntity = new DataSourceEntity();
dataSourceEntity.setId( arg0.getId() );
dataSourceEntity.setDbType( arg0.getDbType() );
dataSourceEntity.setSourceName( arg0.getSourceName() );
dataSourceEntity.setRemark( arg0.getRemark() );
dataSourceEntity.setDbSchema( arg0.getDbSchema() );
return dataSourceEntity;
}
@Override
public List<DataSourceEntity> toEntity(List<DataSourceDto> arg0) {
if ( arg0 == null ) {
return null;
}
List<DataSourceEntity> list = new ArrayList<DataSourceEntity>( arg0.size() );
for ( DataSourceDto dataSourceDto : arg0 ) {
list.add( toEntity( dataSourceDto ) );
}
return list;
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -7,6 +7,8 @@ import '@/styles/element-variables.scss'
import '@/styles/index.scss'
import "@/assets/icons/iconfont.css"
import App from './App'
import store from './store'
import router from './router'
......
<template>
<div class="chart-container">
<el-container>
<el-aside width="250px"></el-aside>
<el-aside width="250px" class="widget-field-container">
<el-card class="box-card" shadow="always" style="height: 100%;">
<div slot="header" class="clearfix">
<span>数据集</span>
<el-dropdown trigger="click" @command="handleCommand" style="float: right; color: #499df3;">
<span class="el-dropdown-link">
切换<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-for="item in datasetOptions" :command="item.id">{{item.setName}}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<div style="margin: -20px;">
<div class="field-widget-cate"><i class="icon iconfont icon-weidu"></i><span>维度列</span></div>
<draggable v-model="dimensions" tag="ul" :options="{sort: false, ghostClass: 'ghost', group: {name: 'dimensions', pull: true, put: false}}">
<li v-for="(item, index) in dimensions" :key="index" class="field-widget-label"><div>{{item.tag}}</div></li>
</draggable>
<div class="field-widget-cate"><i class="icon iconfont icon-zhibiao"></i><span>指标列</span></div>
<draggable v-model="measures" tag="ul" :options="{sort: false, ghostClass: 'ghost', group: {name: 'measures', pull: true, put: false}}">
<li v-for="(item, index) in measures" :key="index" class="field-widget-label"><div>{{item.tag}}</div></li>
</draggable>
</div>
</el-card>
</el-aside>
<el-container>
<el-header class="chart-action-bar" style="height: 40px;text-align: right;">
<el-button icon="el-icon-video-play" type="text">
预览
</el-button>
<el-button icon="el-icon-view" type="text">
查询脚本
预览
</el-button>
<el-button icon="el-icon-delete" type="text">
清空
......@@ -20,9 +41,59 @@
取消
</el-button>
</el-header>
<el-main style="border: 1px dashed #999;"></el-main>
<el-main class="widget-center-container">
<el-row>
<el-divider content-position="left">行维</el-divider>
<el-col>
<div class="draggable-wrapper">
<draggable :options="{sort: false, ghostClass: 'ghost', group: {name: 'dimensions'}}" v-model="form.rows">
<el-tag v-for="(item, index) in form.rows" :key="index" class="draggable-item">
{{ item.tag }}
</el-tag>
</draggable>
</div>
</el-col>
</el-row>
<el-row>
<el-divider content-position="left">列维</el-divider>
<el-col>
<div class="draggable-wrapper">
<draggable :options="{sort: false, ghostClass: 'ghost', group: {name: 'dimensions'}}" v-model="form.cols">
<el-tag v-for="(item, index) in form.cols" :key="index" class="draggable-item">
{{ item.tag }}
</el-tag>
</draggable>
</div>
</el-col>
</el-row>
<el-row>
<el-divider content-position="left">指标</el-divider>
<el-col>
<div class="draggable-wrapper">
<draggable :options="{sort: false, ghostClass: 'ghost', group: {name: 'measures'}}" v-model="form.vals">
<el-tag v-for="(item, index) in form.vals" :key="index" class="draggable-item">
{{ item.tag }}
</el-tag>
</draggable>
</div>
</el-col>
</el-row>
<el-row>
<el-divider>预览区</el-divider>
<el-tabs type="card">
<el-tab-pane label="预览">
<div class="data-tab-pane">预览</div>
</el-tab-pane>
<el-tab-pane label="查询脚本">
<div class="script-tab-pane">查询脚本</div>
</el-tab-pane>
</el-tabs>
<el-col>
</el-col>
</el-row>
</el-main>
</el-container>
<el-aside width="300px">
<el-aside width="300px" class="widget-config-container">
<el-container>
<el-tabs type="border-card" stretch style="width: 100%;">
<el-tab-pane label="图表属性">
......@@ -43,8 +114,49 @@
</template>
<script>
import { getDataSet, listDataSet } from '@/api/factory/dataset'
import draggable from 'vuedraggable'
export default {
name: 'ChartMake'
name: 'ChartMake',
components: {
draggable
},
data () {
return {
form: {
rows: [],
cols: [],
vals: []
},
dataset: {},
datasetOptions : [],
dimensions: [],
measures: []
}
},
created () {
this.getDataSetList()
},
methods: {
getDataSetList () {
listDataSet().then(response => {
if (response.success) {
this.datasetOptions = response.data
}
})
},
handleCommand (command) {
getDataSet(command).then(response => {
if (response.success) {
this.dataset = response.data
console.log(this.dataset)
this.dimensions = this.dataset.schemaConfig.dimensions
this.measures = this.dataset.schemaConfig.measures
}
})
}
}
}
</script>
......@@ -57,29 +169,117 @@ export default {
.el-container {
height: 100%;
width: 100%;
box-shadow: 0 0 1px 1px #ccc;
.el-header {
.widget-field-container {
color: #333;
border-bottom: 2px solid #e4e7ed;
.chart-action-bar {
height: 40px;
line-height: 40px;
padding: 0;
margin-bottom: 0;
background: #FFFFFF;
box-shadow: 0 0 1px 1px #ccc;
.el-card >>> .el-card__header {
padding: 0;
border-bottom: 1px solid #EBEEF5;
-webkit-box-sizing: border-box;
box-sizing: border-box;
font-size: 16px;
background-color: lightgrey;
}
.field-widget-cate{
padding: 0px 10px;
font-size: 13px;
background-color: #f5f7fa;
border-bottom: 1px solid #e4e7ed;
}
ul {
position: relative;
overflow: hidden;
padding: 10px 10px;
margin: 0;
min-height: 200px;
}
.field-widget-label {
font-size: 12px;
display: block;
width: 48%;
line-height: 25px;
position: relative;
float: left;
left: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin: 1%;
color: #333;
border: 1px solid #F4F6FC;
&:hover {
color: #409EFF;
border: 1px dashed #409EFF;
}
& > div {
display: block;
cursor: move;
background: #F4F6FC;
border: 1px solid #F4F6FC;
text-align: center;
.icon {
margin-right: 6px;
margin-left: 8px;
font-size: 14px;
display: inline-block;
vertical-align: middle;
}
span {
display: inline-block;
vertical-align: middle;
}
}
}
}
.el-aside {
.widget-config-container {
color: #333;
padding: 0;
margin-bottom: 0;
background: #FFFFFF;
box-shadow: 0 0 1px 1px #ccc;
.chart-tab-pane {
}
}
.el-main {
padding: 0;
}
.chart-action-bar {
height: 40px;
line-height: 40px;
height: 40px;
text-align: right;
color: #333;
border-bottom: 2px solid #e4e7ed;
}
.widget-center-container {
box-shadow: 0 0 1px 1px #ccc;
border: 1px dashed #999;
.draggable-wrapper {
height: 40px;
line-height: 40px;
border: 1px solid #d7dae2;
background: #f4f4f7;
margin: 0 10px;
.draggable-item {
cursor: move;
line-height: 30px;
height: 30px;
margin: 0 5px;
}
}
.data-tab-pane {
margin: 10px;
min-height: 200px;
}
.script-tab-pane {
margin: 10px;
border: 1px dashed rgb(153, 153, 153);
min-height: 200px;
}
}
}
}
</style>
......@@ -57,7 +57,7 @@
<el-col>
<div style="height: 90px; border: 1px dashed #999; margin: 0 10px;">
<draggable group="col" :list="dimensionList">
<el-tag v-for="(col, index) in dimensionList" :key="index" class="draggable-item" closable @close="handleDimensionTagClose(index)">
<el-tag v-for="(col, index) in dimensionList" :key="index" class="draggable-item" closable @close="handleDimensionTagClose(index, col)">
{{ col.tag }}
</el-tag>
</draggable>
......@@ -69,7 +69,7 @@
<el-col>
<div style="height: 90px; border: 1px dashed #999; margin: 0 10px;">
<draggable group="col" :list="measureList">
<el-tag v-for="(col, index) in measureList" :key="index" class="draggable-item" closable @close="handleMeasureTagClose(index)">
<el-tag v-for="(col, index) in measureList" :key="index" class="draggable-item" closable @close="handleMeasureTagClose(index, col)">
{{ col.tag }}
</el-tag>
</draggable>
......@@ -250,14 +250,18 @@ export default {
json.label = ''
return json
})
this.dimensionList = []
this.measureList = []
}
})
},
handleDimensionTagClose (index) {
handleDimensionTagClose (index, tag) {
this.dimensionList.splice(index, 1)
this.columnList.push(tag)
},
handleMeasureTagClose (index) {
handleMeasureTagClose (index, tag) {
this.measureList.splice(index, 1)
this.columnList.push(tag)
},
dataPreview () {
if (!this.form.sourceId) {
......
......@@ -44,7 +44,7 @@
<el-row style="height: 300px;padding: 0 20px;">
<el-col :span="12" style="border: 1px dashed #999;height: 100%;">
<div class="tag-group" >
<draggable v-model="columnList" :options="{sort: false, filter: '.undraggable', group: {name: 'col', pull:'clone', put: false}}">
<draggable v-model="columnList" :options="{sort: false, filter: '.undraggable', group: {name: 'col', pull: true, put: false}}">
<el-tag v-for="(col, index) in columnList" :key="index" class="draggable-item">
{{ col.tag }}
</el-tag>
......@@ -57,7 +57,7 @@
<el-col>
<div style="height: 90px; border: 1px dashed #999; margin: 0 10px;">
<draggable group="col" :list="dimensionList">
<el-tag v-for="(col, index) in dimensionList" :key="index" class="draggable-item" closable @close="handleDimensionTagClose(index)">
<el-tag v-for="(col, index) in dimensionList" :key="index" class="draggable-item" closable @close="handleDimensionTagClose(index, col)">
{{ col.tag }}
</el-tag>
</draggable>
......@@ -69,7 +69,7 @@
<el-col>
<div style="height: 90px; border: 1px dashed #999; margin: 0 10px;">
<draggable group="col" :list="measureList">
<el-tag v-for="(col, index) in measureList" :key="index" class="draggable-item" closable @close="handleMeasureTagClose(index)">
<el-tag v-for="(col, index) in measureList" :key="index" class="draggable-item" closable @close="handleMeasureTagClose(index, col)">
{{ col.tag }}
</el-tag>
</draggable>
......@@ -265,14 +265,18 @@ export default {
json.label = ''
return json
})
this.dimensionList = []
this.measureList = []
}
})
},
handleDimensionTagClose (index) {
handleDimensionTagClose (index, tag) {
this.dimensionList.splice(index, 1)
this.columnList.push(tag)
},
handleMeasureTagClose (index) {
handleMeasureTagClose (index, tag) {
this.measureList.splice(index, 1)
this.columnList.push(tag)
},
dataPreview () {
if (!this.form.sourceId) {
......
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