ER图测试,域账号登录测试,修改数据查询的展示问题
This commit is contained in:
@@ -177,6 +177,7 @@
|
||||
},
|
||||
executorSource: {},
|
||||
columnMap: {},
|
||||
primaryKeyColumn: {}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -200,9 +201,13 @@
|
||||
}
|
||||
this.pageParam = param;
|
||||
this.executorSource = {sourceId: param.sourceId, dbName: param.dbName, tableName: param.tableName};
|
||||
let columnMap = {};
|
||||
columnList.forEach(item => columnMap[item.name] = item);
|
||||
this.columnMap = columnMap;
|
||||
this.columnMap = {};
|
||||
columnList.forEach(item => {
|
||||
this.columnMap[item.name] = item;
|
||||
if (item.primaryKey == 1) {
|
||||
this.primaryKeyColumn = item;
|
||||
}
|
||||
});
|
||||
this.doExecutorSqlCommon();
|
||||
// this.vueQueryParam = to.query;
|
||||
// let newName = {key: this.$route.fullPath, val: '数据-'+this.vueQueryParam.tableName};
|
||||
@@ -267,6 +272,7 @@
|
||||
conditionSql = conditionSql || "";
|
||||
this.executeError = "";
|
||||
this.executeUseTime = "";
|
||||
this.choiceResultObj = {};
|
||||
this.executeResultList = [];
|
||||
this.tableMaxHeight = document.body.clientHeight - 420;
|
||||
this.nowExecutorId = (new Date()).getTime() + Math.ceil(Math.random() * 1000);
|
||||
@@ -368,14 +374,19 @@
|
||||
handleCopyCheckLineCommand(type) {
|
||||
let choiceData = this.choiceResultObj[this.executeShowTable] || [];
|
||||
if (choiceData.length > 0) {
|
||||
this.conditionDataColsChoice = [];
|
||||
let dataCols = this.executeResultList.find(item => item.name === this.executeShowTable).dataCols;
|
||||
if (type === 'update') {
|
||||
// 选择更新的条件列
|
||||
this.conditionDataCols = dataCols;
|
||||
this.exportConditionVisible = true;
|
||||
return;
|
||||
if (!!this.primaryKeyColumn.name) {
|
||||
this.conditionDataColsChoice = [this.primaryKeyColumn.name];
|
||||
} else {
|
||||
// 没有主键的时候,选择更新的条件列
|
||||
this.conditionDataCols = dataCols;
|
||||
this.exportConditionVisible = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
let copyData = copyFormatter.format(type, this.pageParam.dbType, dataCols, choiceData, '', this.pageParam.dbName, this.pageParam.tableName);
|
||||
let copyData = copyFormatter.format(type, this.pageParam.dbType, dataCols, choiceData, this.conditionDataColsChoice, this.pageParam.dbName, this.pageParam.tableName);
|
||||
this.$copyText(copyData).then(
|
||||
res => this.$message.success("内容已复制到剪切板!"),
|
||||
err => this.$message.error("抱歉,复制失败!")
|
||||
@@ -403,9 +414,15 @@
|
||||
this.downloadDataVisible = false;
|
||||
},
|
||||
downloadTableData() {
|
||||
let dataRes = this.executeResultList.find(item => item.name === this.executeShowTable);
|
||||
if (!dataRes || !dataRes.dataList || dataRes.dataList.length <= 0) {
|
||||
this.$message.warning("当前筛选条件下无数据,请重新筛选后再操作导出");
|
||||
return;
|
||||
}
|
||||
this.downloadDataParam.conditionArr = [];
|
||||
this.conditionDataCols = this.executeResultList.find(item => item.name === this.executeShowTable).dataCols;
|
||||
this.conditionDataCols = dataRes.dataCols;
|
||||
this.downloadDataVisible = true;
|
||||
|
||||
},
|
||||
dropTableFlagChange() {
|
||||
if (this.downloadDataParam.dropTableFlag === 1) {
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
*/
|
||||
export default {
|
||||
insert(dataCols, choiceData, dbName, tableName) {
|
||||
let tableNameRes = (!!dbName) ? '`' + dbName + '`.`' : '';
|
||||
tableNameRes += (!!tableName) ? tableName : '`table`';
|
||||
let tableNameRes = (!!dbName) ? dbName + '.' : '';
|
||||
tableNameRes += (!!tableName) ? tableName : 'table';
|
||||
// 复制为insert语句
|
||||
let copyData = '';
|
||||
let names = '';
|
||||
@@ -31,8 +31,8 @@ export default {
|
||||
return copyData;
|
||||
},
|
||||
update(dataCols, choiceData, condition=[], dbName, tableName) {
|
||||
let tableNameRes = (!!dbName) ? '`' + dbName + '`.`' : '';
|
||||
tableNameRes += (!!tableName) ? tableName : '`table`';
|
||||
let tableNameRes = (!!dbName) ? dbName + '.' : '';
|
||||
tableNameRes += (!!tableName) ? tableName : 'table';
|
||||
// 复制为update语句
|
||||
let copyData = '';
|
||||
choiceData.forEach(item => {
|
||||
|
||||
20
zyplayer-doc-ui/db-ui/src/views/home/Er.vue
Normal file
20
zyplayer-doc-ui/db-ui/src/views/home/Er.vue
Normal file
@@ -0,0 +1,20 @@
|
||||
<template>
|
||||
<div style="padding: 10px;">
|
||||
<er-graph></er-graph>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import erGraph from '../../components/er/index'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
components: {erGraph},
|
||||
mounted() {
|
||||
},
|
||||
methods: {}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
<template>
|
||||
<div style="padding: 10px;">
|
||||
<div style="max-width: 1200px;margin: 20px auto;">
|
||||
<div style="text-align: center;">欢迎使用ヾ(๑╹◡╹)ノ" - 在左上角选择一个数据源吧~</div>
|
||||
<div style="text-align: center;">欢迎使用<span @dblclick="showErGraph">ヾ(๑╹◡╹)ノ"</span> - 在左上角选择一个数据源吧~</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
var app;
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
};
|
||||
},
|
||||
mounted: function () {
|
||||
app = this;
|
||||
mounted () {
|
||||
},
|
||||
methods: {
|
||||
showErGraph() {
|
||||
// this.$router.push({path: '/home/er'});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user