diff --git a/web/src/views/db-cli/components/QueryHistoryPanel.vue b/web/src/views/db-cli/components/QueryHistoryPanel.vue new file mode 100644 index 0000000..a07ab85 --- /dev/null +++ b/web/src/views/db-cli/components/QueryHistoryPanel.vue @@ -0,0 +1,247 @@ + + + + 查询历史 + + + + + + + 清空 + + + + + + + + + + + + {{ item.dbType.toUpperCase() }} + + {{ formatTime(item.timestamp) }} + + + {{ item.queryPreview }} + + + + + + + + 使用 + + + + + + + + + + + + + + + + + + + diff --git a/web/src/views/db-cli/components/QueryTemplatesPanel.vue b/web/src/views/db-cli/components/QueryTemplatesPanel.vue new file mode 100644 index 0000000..083cf43 --- /dev/null +++ b/web/src/views/db-cli/components/QueryTemplatesPanel.vue @@ -0,0 +1,330 @@ + + + + 查询模板 + + + + + + 新建模板 + + + + + + + + + {{ categoryTemplates.length }} + + + + + + {{ template.name }} + + + + + + + + 编辑 + + + + 删除 + + + + + + {{ template.description || '无描述' }} + + + {{ template.query.substring(0, 80) }}{{ template.query.length > 80 ? '...' : '' }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/src/views/db-cli/components/SQLEditorToolbar.vue b/web/src/views/db-cli/components/SQLEditorToolbar.vue new file mode 100644 index 0000000..0d10365 --- /dev/null +++ b/web/src/views/db-cli/components/SQLEditorToolbar.vue @@ -0,0 +1,267 @@ + + + + + + + + + {{ executeButtonText }} (F5) + + + + + + 执行选中 (Ctrl+Enter) + + + + + + + + + + + + 格式化 + + + + + + 历史 + + + + + + 模板 + + + + + + + + + 导出 + + + + + + CSV 格式 + + + + JSON 格式 + + + + Excel 格式 + + + + Markdown 表格 + + + + + + + + + + + + + {{ currentConnection.name }} + + + {{ currentConnection.host }}:{{ currentConnection.port }} + + / {{ currentConnection.database }} + + + + + + + + + {{ executionTime }}ms + + + + 未选择连接 + + + + + + + + + + + + + + + + + + diff --git a/web/src/views/db-cli/components/SqlEditor.vue b/web/src/views/db-cli/components/SqlEditor.vue index 95dd69c..c69db45 100644 --- a/web/src/views/db-cli/components/SqlEditor.vue +++ b/web/src/views/db-cli/components/SqlEditor.vue @@ -1,38 +1,16 @@ - - - - - - - {{ getExecuteButtonText() }} (F5) - - - - - - 执行选中 (Ctrl+Enter) - - - - - - - - {{ currentConnection.name }} - - - {{ currentConnection.host }}:{{ currentConnection.port }} - - / {{ currentConnection.database }} - - - - - 未选择连接 - - + + + @@ -42,7 +20,6 @@
{{ template.query.substring(0, 80) }}{{ template.query.length > 80 ? '...' : '' }}