feat(frontend): 数据集

This commit is contained in:
junjie 2021-02-22 18:22:27 +08:00
parent daf441a0c9
commit edeba4bb6a
7 changed files with 204 additions and 80 deletions

View File

@ -0,0 +1,25 @@
<template>
<el-col>
<el-row>
111111
</el-row>
</el-col>
</template>
<script>
export default {
name: "AddDB",
data() {
return {}
},
mounted() {
},
activated() {
},
methods: {}
}
</script>
<style scoped>
</style>

View File

@ -0,0 +1,25 @@
<template>
<el-col style="height: 100%;">
<el-row style="height: 100%;" class="custom-position">
{{$t('dataset.pls_slc_tbl_left')}}
</el-row>
</el-col>
</template>
<script>
export default {
name: "DataHome"
}
</script>
<style scoped>
.custom-position {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
flex-flow: row nowrap;
color: #9ea6b2;
}
</style>

View File

@ -1,5 +1,6 @@
<template xmlns:el-col="http://www.w3.org/1999/html">
<el-col>
<!-- group -->
<el-col v-if="!sceneMode">
<span>
{{ $t('dataset.datalist') }}
@ -49,7 +50,7 @@
</span>
<span>
<span @click.stop v-if="data.type ==='group'">
<el-dropdown trigger="click" @command="clickAdd">
<el-dropdown trigger="click" @command="clickAdd" size="small">
<span class="el-dropdown-link">
<el-button
icon="el-icon-plus"
@ -68,7 +69,7 @@
</el-dropdown>
</span>
<span @click.stop style="margin-left: 12px;">
<el-dropdown trigger="click" @command="clickMore">
<el-dropdown trigger="click" @command="clickMore" size="small">
<span class="el-dropdown-link">
<el-button
icon="el-icon-more"
@ -95,33 +96,50 @@
</div>
</el-col>
<el-dialog :title="dialogTitle" :visible="editGroup" :show-close="false">
<el-dialog :title="dialogTitle" :visible="editGroup" :show-close="false" width="30%">
<el-form :model="groupForm" :rules="groupFormRules" ref="groupForm">
<el-form-item :label="$t('commons.name')" prop="name">
<el-input v-model="groupForm.name"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="close()">{{$t('dataset.cancel')}}</el-button>
<el-button type="primary" @click="saveGroup(groupForm)">{{$t('dataset.confirm')}}</el-button>
<el-button @click="close()" size="mini">{{$t('dataset.cancel')}}</el-button>
<el-button type="primary" @click="saveGroup(groupForm)" size="mini">{{$t('dataset.confirm')}}</el-button>
</div>
</el-dialog>
</el-col>
<!--scene-->
<el-col v-if="sceneMode">
<el-row>
<span>
{{ $t('dataset.scene') }}
{{currGroup.name}}
</span>
<el-button icon="el-icon-back" size="mini" @click="sceneMode = false" style="float: right">
<el-button icon="el-icon-back" size="mini" @click="back" style="float: right">
{{$t('dataset.back')}}
</el-button>
</el-row>
<el-divider/>
<el-row>
<el-dropdown style="margin-right: 10px;" size="small" @command="clickAddData">
<el-button type="primary" size="mini" plain>
{{$t('dataset.add_table')}}
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="beforeClickAddData('db')">
{{$t('dataset.db_data')}}
</el-dropdown-item>
<el-dropdown-item :command="beforeClickAddData('sql')">
{{$t('dataset.sql_data')}}
</el-dropdown-item>
<el-dropdown-item :command="beforeClickAddData('excel')">
{{$t('dataset.excel_data')}}
</el-dropdown-item>
<el-dropdown-item :command="beforeClickAddData('custom')">
{{$t('dataset.custom_data')}}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button type="primary" size="mini" plain>
{{$t('dataset.update')}}
</el-button>
@ -200,6 +218,7 @@ export default {
search: '',
editGroup: false,
data: null,
currGroup: null,
expandedArray: [],
groupForm: {
name: '',
@ -346,6 +365,7 @@ export default {
// console.log(node);
if (data.type === 'scene') {
this.sceneMode = true;
this.currGroup = data;
}
if (node.expanded) {
this.expandedArray.push(data.id);
@ -357,6 +377,39 @@ export default {
}
// console.log(this.expandedArray);
},
back() {
this.sceneMode = false;
this.$router.push('/dataset/home');
},
clickAddData(param) {
console.log(param);
switch (param.type) {
case 'db':
this.addDB();
break;
case 'sql':
break;
case 'excel':
break;
case 'custom':
break;
}
},
beforeClickAddData(type) {
return {
'type': type
}
},
addDB() {
this.$router.push('/dataset/add_db');
}
}
}
</script>

View File

@ -1,5 +1,6 @@
const DataSet = () => import('@/business/components/dataset/DataSet');
const DataSetHome = () => import('@/business/components/dataset/data/DataHome');
const DataSetAddDB = () => import('@/business/components/dataset/data/AddDB');
// const PerformanceTestHome = () => import('@/business/components/performance/home/PerformanceTestHome')
// const EditPerformanceTest = () => import('@/business/components/performance/test/EditPerformanceTest')
// const PerformanceTestList = () => import('@/business/components/performance/test/PerformanceTestList')
@ -10,16 +11,21 @@ const DataSet = () => import('@/business/components/dataset/DataSet');
export default {
path: "/dataset",
name: "dataset",
// redirect: "/dataset/home",
redirect: "/dataset/home",
components: {
content: DataSet
},
children: [
// {
// path: 'home',
// name: 'datasetHome',
// component: PerformanceTestHome,
// },
{
path: 'home',
name: 'DataSetHome',
component: DataSetHome,
},
{
path: 'add_db',
name: 'DataSetAddDB',
component: DataSetAddDB,
},
// {
// path: 'test/create',
// name: "createPerTest",

View File

@ -1537,6 +1537,11 @@ export default {
back: 'Back',
add_table: 'Add Table',
process: 'Process',
update:'Update'
update: 'Update',
db_data: 'DB Table',
sql_data: 'SQL Data',
excel_data: 'Excel Data',
custom_data: 'Custom Data',
pls_slc_tbl_left:'Please select table from left'
}
};

View File

@ -1541,7 +1541,12 @@ export default {
back: '返回',
add_table: '添加表',
process: '进度',
update:'更新'
update: '更新',
db_data: '数据库表',
sql_data: 'SQL数据集',
excel_data: 'Excel数据集',
custom_data: '自助数据集',
pls_slc_tbl_left:'请从左侧选择表'
},
datasource: {
create: '新建数据连接',

View File

@ -1538,6 +1538,11 @@ export default {
back: '返回',
add_table: '添加表',
process: '進度',
update:'更新'
update: '更新',
db_data: '數據庫表',
sql_data: 'SQL數據集',
excel_data: 'Excel數據集',
custom_data: '自助數據集',
pls_slc_tbl_left:'請從左側選擇表'
}
};