执行器展示和交互优化
This commit is contained in:
@@ -76,6 +76,10 @@ public class DbSqlExecutorController {
|
||||
List<String> resultList = new LinkedList<>();
|
||||
// 支持;分割的多个sql执行
|
||||
String[] sqlArr = sql.split(";");
|
||||
// 执行条数太多,反应慢,展示结果栏太多,也不应该在这一次执行很多条语句,应该使用导入
|
||||
if (sqlArr.length > 20) {
|
||||
return DocDbResponseJson.warn("单次执行最多支持20条语句同时执行,当前语句条数:" + sqlArr.length);
|
||||
}
|
||||
for (String sqlItem : sqlArr) {
|
||||
if (StringUtils.isBlank(sqlItem)) {
|
||||
continue;
|
||||
|
||||
@@ -33,7 +33,7 @@ public class SqlLogUtil {
|
||||
}
|
||||
|
||||
public static String parseLogSql(String sql, List<ParameterMapping> parameterMappings, List<Object> paramList) {
|
||||
StringBuilder sqlSb = new StringBuilder(sql.replaceAll("[\\s]+", " "));
|
||||
StringBuilder sqlSb = new StringBuilder(sql.replaceAll(" {2,}", " "));
|
||||
int fromIndex = 0;
|
||||
if (parameterMappings.size() > 0) {
|
||||
for (int i = 0; i < parameterMappings.size(); i++) {
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="exportConditionVisible = false">取 消</el-button>
|
||||
<el-button @click="downloadDataVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="doDownloadTableData">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<el-table-column prop="createTime" label="执行时间" width="160px"></el-table-column>
|
||||
<el-table-column prop="content" label="SQL">
|
||||
<template slot-scope="scope">
|
||||
<pre style="margin: 0;" @dblclick="inputFavoriteSql(scope.row.content)">{{scope.row.content}}</pre>
|
||||
<pre class="sql-content-line" @dblclick="inputFavoriteSql(scope.row.content)" :title="scope.row.content">{{scope.row.content}}</pre>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="160px">
|
||||
@@ -62,7 +62,7 @@
|
||||
<el-table-column prop="createTime" label="执行时间" width="160px"></el-table-column>
|
||||
<el-table-column prop="content" label="SQL">
|
||||
<template slot-scope="scope">
|
||||
<pre style="margin: 0;" @dblclick="inputFavoriteSql(scope.row.content)">{{scope.row.content}}</pre>
|
||||
<pre class="sql-content-line" @dblclick="inputFavoriteSql(scope.row.content)" :title="scope.row.content">{{scope.row.content}}</pre>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="160px">
|
||||
@@ -74,7 +74,7 @@
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="信息" name="tabInfo" v-if="!!executeResultInfo">
|
||||
<pre>{{executeResultInfo}}</pre>
|
||||
<pre style="white-space: pre-wrap;">{{executeResultInfo}}</pre>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="错误" name="tabError" v-if="!!executeError">
|
||||
<div style="color: #f00;">{{executeError}}</div>
|
||||
@@ -204,7 +204,7 @@
|
||||
this.sqlParams.push({key: item, value: this.sqlParamHistory[item] || ''});
|
||||
});
|
||||
this.sqlParamWaiting = false;
|
||||
}, 1000);
|
||||
}, 300);
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -293,6 +293,7 @@
|
||||
}).then(json => {
|
||||
this.sqlExecuting = false;
|
||||
if (json.errCode != 200) {
|
||||
this.executeShowTable = 'tabError';
|
||||
this.executeError = json.errMsg;
|
||||
return;
|
||||
}
|
||||
@@ -478,6 +479,14 @@
|
||||
padding: 0 5px;
|
||||
resize: none;
|
||||
}
|
||||
.data-executor-vue .sql-content-line{
|
||||
margin: 0;
|
||||
overflow:hidden;
|
||||
text-overflow:ellipsis;
|
||||
display:-webkit-box;
|
||||
-webkit-line-clamp:2;
|
||||
-webkit-box-orient:vertical;
|
||||
}
|
||||
.data-executor-vue .execute-use-time{
|
||||
font-size: 12px;margin-right: 10px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user