SQLBot
-
+
{{ t('common.system_manage') }}
-
-
-
-
+
-
+
-
+
Back
-
+
-
+
@@ -76,7 +82,7 @@
Switch Layout
Logout
-
+
@@ -84,15 +90,15 @@
-
+
+
@@ -108,9 +114,8 @@
Switch Layout
Logout
-
+
-
@@ -120,13 +125,18 @@
-
-
+
+
Thinking ...
{{ chartObject.title }}
-
-
+
+
-
+
-
+
-
-
+
+
-
+
{{ t.value }}
-
-
+
@@ -201,7 +209,7 @@ function onTypeChange() {
Inference process
SQL
@@ -230,15 +238,16 @@ function onTypeChange() {
+ v-if="message.record.id"
+ :id="message.record.id"
+ ref="chartRef"
+ :type="chartType"
+ :columns="chartObject?.columns"
+ :x="xAxis"
+ :y="yAxis"
+ :series="series"
+ :data="dataObject.data"
+ />
@@ -296,7 +305,6 @@ function onTypeChange() {
}
.inner-select {
-
position: absolute;
:deep(.ed-select__wrapper) {
@@ -313,9 +321,7 @@ function onTypeChange() {
:deep(.ed-select__selected-item) {
display: none;
}
-
}
-
}
.inner-chart-option {
@@ -326,7 +332,6 @@ function onTypeChange() {
}
.chart-choose-btn {
-
cursor: pointer;
color: var(--ed-color-primary);
font-size: 16px;
@@ -355,4 +360,4 @@ function onTypeChange() {
color: var(--ed-color-primary-light-9);
}
}
-
\ No newline at end of file
+
diff --git a/frontend/src/views/chat/ChatBlock.vue b/frontend/src/views/chat/ChatBlock.vue
index 6cbf02e0..376de9c7 100644
--- a/frontend/src/views/chat/ChatBlock.vue
+++ b/frontend/src/views/chat/ChatBlock.vue
@@ -1,11 +1,9 @@
@@ -34,11 +32,9 @@ defineProps<{
.chat-block-content {
padding: 12px;
}
-
}
.chat-block-footer {
-
}
}
-
\ No newline at end of file
+
diff --git a/frontend/src/views/chat/ChatList.vue b/frontend/src/views/chat/ChatList.vue
index a45ee71d..a6f3e5d0 100644
--- a/frontend/src/views/chat/ChatList.vue
+++ b/frontend/src/views/chat/ChatList.vue
@@ -1,123 +1,121 @@
-
+
-
-
+
+
-
-
+
+
{{ node.label }}
-
+
-
+
operation(opt,data)"
- :menu-list="state.folderMenuList"
- :icon-name="icon_more_outlined"
- placement="bottom-start"
- v-if="data.node_type !== 'leaf'"
+ v-if="data.node_type !== 'leaf'"
+ :menu-list="state.folderMenuList"
+ :icon-name="icon_more_outlined"
+ placement="bottom-start"
+ @handle-command="(opt: string) => operation(opt, data)"
>
diff --git a/frontend/src/views/dashboard/components/button-label/ComponentButtonLabel.vue b/frontend/src/views/dashboard/components/button-label/ComponentButtonLabel.vue
index cfbb46a9..43d44fbc 100644
--- a/frontend/src/views/dashboard/components/button-label/ComponentButtonLabel.vue
+++ b/frontend/src/views/dashboard/components/button-label/ComponentButtonLabel.vue
@@ -1,15 +1,15 @@
@@ -17,11 +17,11 @@ const emits = defineEmits(['customClick'])
-
+
{{ title }}
-
+
\ No newline at end of file
+
diff --git a/frontend/src/views/dashboard/components/sq-tab/CustomTab.vue b/frontend/src/views/dashboard/components/sq-tab/CustomTab.vue
index 5ccbbb95..785c3b83 100644
--- a/frontend/src/views/dashboard/components/sq-tab/CustomTab.vue
+++ b/frontend/src/views/dashboard/components/sq-tab/CustomTab.vue
@@ -5,7 +5,7 @@
-
+
+
-
@@ -158,7 +167,6 @@ onMounted(() => {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
gap: 24px;
-
}
.ds-card {
@@ -169,6 +177,4 @@ onMounted(() => {
box-shadow: 0 1px 3px var(--ed-color-primary-light-5);
border: 1px solid var(--ed-color-primary-light-5);
}
-
-
diff --git a/frontend/src/views/chat/component/BaseChart.ts b/frontend/src/views/chat/component/BaseChart.ts
index 8f1fdeff..4a24d126 100644
--- a/frontend/src/views/chat/component/BaseChart.ts
+++ b/frontend/src/views/chat/component/BaseChart.ts
@@ -1,34 +1,32 @@
export interface ChartAxis {
- name: string,
- value: string,
- type?: 'x' | 'y' | 'series'
+ name: string
+ value: string
+ type?: 'x' | 'y' | 'series'
}
export interface ChartData {
- [key: string]: any
+ [key: string]: any
}
-export type ChartTypes = "table" | "bar" | 'column' | "line" | "pie"
+export type ChartTypes = 'table' | 'bar' | 'column' | 'line' | 'pie'
export abstract class BaseChart {
- id: string;
- _name: string = 'base-chart';
- axis: Array = [];
- data: Array = [];
+ id: string
+ _name: string = 'base-chart'
+ axis: Array = []
+ data: Array = []
- constructor(id: string, name: string) {
- this.id = id;
- this._name = name;
- }
+ constructor(id: string, name: string) {
+ this.id = id
+ this._name = name
+ }
- init(axis: Array, data: Array): void {
- this.axis = axis;
- this.data = data;
- }
+ init(axis: Array, data: Array): void {
+ this.axis = axis
+ this.data = data
+ }
- abstract render(): void
+ abstract render(): void
- abstract destroy(): void
-
-
-}
\ No newline at end of file
+ abstract destroy(): void
+}
diff --git a/frontend/src/views/chat/component/BaseG2Chart.ts b/frontend/src/views/chat/component/BaseG2Chart.ts
index 6e4d7dbe..c448905e 100644
--- a/frontend/src/views/chat/component/BaseG2Chart.ts
+++ b/frontend/src/views/chat/component/BaseG2Chart.ts
@@ -1,31 +1,28 @@
-import {BaseChart} from "@/views/chat/component/BaseChart.ts";
-import {Chart} from '@antv/g2';
+import { BaseChart } from '@/views/chat/component/BaseChart.ts'
+import { Chart } from '@antv/g2'
export abstract class BaseG2Chart extends BaseChart {
+ chart: Chart
- chart: Chart;
+ constructor(id: string, name: string) {
+ super(id, name)
+ this.chart = new Chart({
+ container: id,
+ autoFit: true,
+ })
- constructor(id: string, name: string) {
- super(id, name)
- this.chart = new Chart({
- container: id,
- autoFit: true,
- })
+ this.chart.theme({
+ view: {
+ viewFill: '#FFFFFF',
+ },
+ })
+ }
- this.chart.theme({
- view: {
- viewFill: '#FFFFFF',
- },
- })
- }
+ render() {
+ this.chart?.render()
+ }
- render() {
- this.chart?.render()
- }
-
- destroy() {
- this.chart?.destroy()
- }
-
-
-}
\ No newline at end of file
+ destroy() {
+ this.chart?.destroy()
+ }
+}
diff --git a/frontend/src/views/chat/component/ChartComponent.vue b/frontend/src/views/chat/component/ChartComponent.vue
index 04aeaa43..dc9124fa 100644
--- a/frontend/src/views/chat/component/ChartComponent.vue
+++ b/frontend/src/views/chat/component/ChartComponent.vue
@@ -1,41 +1,44 @@
-
+
\ No newline at end of file
+
diff --git a/frontend/src/views/chat/component/charts/Bar.ts b/frontend/src/views/chat/component/charts/Bar.ts
index 53c9f579..c5eeaad3 100644
--- a/frontend/src/views/chat/component/charts/Bar.ts
+++ b/frontend/src/views/chat/component/charts/Bar.ts
@@ -1,34 +1,32 @@
-import {BaseG2Chart} from "@/views/chat/component/BaseG2Chart.ts";
-import type {ChartAxis, ChartData} from "@/views/chat/component/BaseChart.ts";
+import { BaseG2Chart } from '@/views/chat/component/BaseG2Chart.ts'
+import type { ChartAxis, ChartData } from '@/views/chat/component/BaseChart.ts'
export class Bar extends BaseG2Chart {
+ constructor(id: string) {
+ super(id, 'bar')
+ }
- constructor(id: string) {
- super(id, "bar");
+ init(axis: Array, data: Array) {
+ super.init(axis, data)
+ const x = this.axis.filter((item) => item.type === 'x')
+ const y = this.axis.filter((item) => item.type === 'y')
+
+ if (x.length == 0 || y.length == 0) {
+ return
}
- init(axis: Array, data: Array) {
- super.init(axis, data);
- const x = this.axis.filter(item => item.type === "x");
- const y = this.axis.filter(item => item.type === "y");
-
- if (x.length == 0 || y.length == 0) {
- return;
- }
-
- this.chart?.interval()
- .coordinate({transform: [{type: 'transpose'}]})
- .data(data)
- .encode('x', x[0].value)
- .encode('y', y[0].value)
- .scale('x', {
- nice: true,
- })
- .scale('y', {
- nice: true,
- })
- .interaction('elementHighlight', {background: true});
-
- }
-
-}
\ No newline at end of file
+ this.chart
+ ?.interval()
+ .coordinate({ transform: [{ type: 'transpose' }] })
+ .data(data)
+ .encode('x', x[0].value)
+ .encode('y', y[0].value)
+ .scale('x', {
+ nice: true,
+ })
+ .scale('y', {
+ nice: true,
+ })
+ .interaction('elementHighlight', { background: true })
+ }
+}
diff --git a/frontend/src/views/chat/component/charts/Column.ts b/frontend/src/views/chat/component/charts/Column.ts
index 30376f35..dcb0402c 100644
--- a/frontend/src/views/chat/component/charts/Column.ts
+++ b/frontend/src/views/chat/component/charts/Column.ts
@@ -1,34 +1,32 @@
-import {BaseG2Chart} from "@/views/chat/component/BaseG2Chart.ts";
-import type {ChartAxis, ChartData} from "@/views/chat/component/BaseChart.ts";
+import { BaseG2Chart } from '@/views/chat/component/BaseG2Chart.ts'
+import type { ChartAxis, ChartData } from '@/views/chat/component/BaseChart.ts'
export class Column extends BaseG2Chart {
+ constructor(id: string) {
+ super(id, 'column')
+ }
- constructor(id: string) {
- super(id, "column");
+ init(axis: Array, data: Array) {
+ super.init(axis, data)
+
+ const x = this.axis.filter((item) => item.type === 'x')
+ const y = this.axis.filter((item) => item.type === 'y')
+
+ if (x.length == 0 || y.length == 0) {
+ return
}
- init(axis: Array, data: Array) {
- super.init(axis, data);
-
- const x = this.axis.filter(item => item.type === "x");
- const y = this.axis.filter(item => item.type === "y");
-
- if (x.length == 0 || y.length == 0) {
- return;
- }
-
- this.chart?.interval()
- .data(data)
- .encode('x', x[0].value)
- .encode('y', y[0].value)
- .scale('x', {
- nice: true,
- })
- .scale('y', {
- nice: true,
- })
- .interaction('elementHighlight', {background: true});
-
- }
-
-}
\ No newline at end of file
+ this.chart
+ ?.interval()
+ .data(data)
+ .encode('x', x[0].value)
+ .encode('y', y[0].value)
+ .scale('x', {
+ nice: true,
+ })
+ .scale('y', {
+ nice: true,
+ })
+ .interaction('elementHighlight', { background: true })
+ }
+}
diff --git a/frontend/src/views/chat/component/charts/Line.ts b/frontend/src/views/chat/component/charts/Line.ts
index 42231d7c..76610722 100644
--- a/frontend/src/views/chat/component/charts/Line.ts
+++ b/frontend/src/views/chat/component/charts/Line.ts
@@ -1,44 +1,40 @@
-import {BaseG2Chart} from "@/views/chat/component/BaseG2Chart.ts";
-import type {ChartAxis, ChartData} from "@/views/chat/component/BaseChart.ts";
+import { BaseG2Chart } from '@/views/chat/component/BaseG2Chart.ts'
+import type { ChartAxis, ChartData } from '@/views/chat/component/BaseChart.ts'
export class Line extends BaseG2Chart {
+ constructor(id: string) {
+ super(id, 'line')
+ }
- constructor(id: string) {
- super(id, "line");
+ init(axis: Array, data: Array) {
+ super.init(axis, data)
+
+ const x = this.axis.filter((item) => item.type === 'x')
+ const y = this.axis.filter((item) => item.type === 'y')
+
+ if (x.length == 0 || y.length == 0) {
+ return
}
- init(axis: Array, data: Array) {
- super.init(axis, data);
+ this.chart
+ ?.data(data)
+ .encode('x', x[0].value)
+ .encode('y', y[0].value)
+ .scale('x', {
+ nice: true,
+ })
+ .scale('y', {
+ nice: true,
+ })
- const x = this.axis.filter(item => item.type === "x");
- const y = this.axis.filter(item => item.type === "y");
+ this.chart?.line().label({
+ text: 'value',
+ style: {
+ dx: -10,
+ dy: -12,
+ },
+ })
- if (x.length == 0 || y.length == 0) {
- return;
- }
-
- this.chart?.data(data)
- .encode('x', x[0].value)
- .encode('y', y[0].value)
- .scale('x', {
- nice: true,
- })
- .scale('y', {
- nice: true,
- });
-
- this.chart?.line().label({
- text: 'value',
- style: {
- dx: -10,
- dy: -12,
- },
- });
-
- this.chart?.point()
- .style('fill', 'white')
- .tooltip(false);
-
- }
-
-}
\ No newline at end of file
+ this.chart?.point().style('fill', 'white').tooltip(false)
+ }
+}
diff --git a/frontend/src/views/chat/component/charts/Pie.ts b/frontend/src/views/chat/component/charts/Pie.ts
index a09e5e5f..bd785d78 100644
--- a/frontend/src/views/chat/component/charts/Pie.ts
+++ b/frontend/src/views/chat/component/charts/Pie.ts
@@ -1,32 +1,28 @@
-import {BaseG2Chart} from "@/views/chat/component/BaseG2Chart.ts";
-import type {ChartAxis, ChartData} from "@/views/chat/component/BaseChart.ts";
+import { BaseG2Chart } from '@/views/chat/component/BaseG2Chart.ts'
+import type { ChartAxis, ChartData } from '@/views/chat/component/BaseChart.ts'
export class Pie extends BaseG2Chart {
+ constructor(id: string) {
+ super(id, 'pie')
+ }
- constructor(id: string) {
- super(id, "pie");
+ init(axis: Array, data: Array) {
+ super.init(axis, data)
+ const y = this.axis.filter((item) => item.type === 'y')
+ const series = this.axis.filter((item) => item.type === 'series')
+
+ if (series.length == 0 || y.length == 0) {
+ return
}
- init(axis: Array, data: Array) {
- super.init(axis, data);
- const y = this.axis.filter(item => item.type === "y");
- const series = this.axis.filter(item => item.type === "series");
+ this.chart.coordinate({ type: 'theta', outerRadius: 0.8 })
- if (series.length == 0 || y.length == 0) {
- return;
- }
-
- this.chart.coordinate({type: 'theta', outerRadius: 0.8});
-
- this.chart?.interval()
- .transform({type: 'stackY'})
- .data(data)
- .encode('y', y[0].value)
- .encode('color', series[0].value)
- .legend('color', {position: 'bottom', layout: {justifyContent: 'center'}})
- ;
-
-
- }
-
-}
\ No newline at end of file
+ this.chart
+ ?.interval()
+ .transform({ type: 'stackY' })
+ .data(data)
+ .encode('y', y[0].value)
+ .encode('color', series[0].value)
+ .legend('color', { position: 'bottom', layout: { justifyContent: 'center' } })
+ }
+}
diff --git a/frontend/src/views/chat/component/charts/Table.ts b/frontend/src/views/chat/component/charts/Table.ts
index e45a206c..81b50f74 100644
--- a/frontend/src/views/chat/component/charts/Table.ts
+++ b/frontend/src/views/chat/component/charts/Table.ts
@@ -1,79 +1,77 @@
-import {BaseChart, type ChartAxis, type ChartData} from "@/views/chat/component/BaseChart.ts";
-import {TableSheet, type S2Options, type S2DataConfig, type S2MountContainer} from "@antv/s2";
-import {debounce} from "lodash-es";
+import { BaseChart, type ChartAxis, type ChartData } from '@/views/chat/component/BaseChart.ts'
+import { TableSheet, type S2Options, type S2DataConfig, type S2MountContainer } from '@antv/s2'
+import { debounce } from 'lodash-es'
export class Table extends BaseChart {
+ table?: TableSheet = undefined
- table?: TableSheet = undefined
+ container: S2MountContainer | null = null
- container: S2MountContainer | null = null
+ debounceRender: any
- debounceRender: any
+ resizeObserver: ResizeObserver
- resizeObserver: ResizeObserver
+ constructor(id: string) {
+ super(id, 'table')
+ this.container = document.getElementById(id)
- constructor(id: string) {
- super(id, "table");
- this.container = document.getElementById(id);
+ this.debounceRender = debounce(async (width?: number, height?: number) => {
+ if (this.table) {
+ this.table.changeSheetSize(width, height)
+ await this.table.render(false)
+ }
+ }, 200)
- this.debounceRender = debounce(async (width?: number, height?: number) => {
- if (this.table) {
- this.table.changeSheetSize(width, height);
- await this.table.render(false);
- }
- }, 200);
+ this.resizeObserver = new ResizeObserver(([entry] = []) => {
+ const [size] = entry.borderBoxSize || []
+ this.debounceRender(size.inlineSize, size.blockSize)
+ })
- this.resizeObserver = new ResizeObserver(([entry] = []) => {
- const [size] = entry.borderBoxSize || [];
- this.debounceRender(size.inlineSize, size.blockSize);
- });
+ if (this.container?.parentElement) {
+ this.resizeObserver.observe(this.container.parentElement)
+ }
+ }
- if (this.container?.parentElement) {
- this.resizeObserver.observe(this.container.parentElement);
- }
+ init(axis: Array, data: Array) {
+ super.init(axis, data)
+
+ const s2DataConfig: S2DataConfig = {
+ fields: {
+ columns: this.axis?.map((a) => a.value) ?? [],
+ },
+ meta:
+ this.axis?.map((a) => {
+ return {
+ field: a.value,
+ name: a.name,
+ }
+ }) ?? [],
+ data: this.data,
}
- init(axis: Array, data: Array) {
- super.init(axis, data);
-
- const s2DataConfig: S2DataConfig = {
- fields: {
- columns: this.axis?.map(a => a.value) ?? [],
- },
- meta: this.axis?.map(a => {
- return {
- field: a.value,
- name: a.name
- }
- }) ?? [],
- data: this.data,
- };
-
- const s2Options: S2Options = {
- width: 600,
- height: 360,
- placeholder: {
- cell: '-',
- empty: {
- icon: 'Empty',
- description: 'No Data',
- },
- },
- };
-
- if (this.container) {
- this.table = new TableSheet(this.container, s2DataConfig, s2Options);
- }
-
+ const s2Options: S2Options = {
+ width: 600,
+ height: 360,
+ placeholder: {
+ cell: '-',
+ empty: {
+ icon: 'Empty',
+ description: 'No Data',
+ },
+ },
}
- render() {
- this.table?.render()
+ if (this.container) {
+ this.table = new TableSheet(this.container, s2DataConfig, s2Options)
}
+ }
- destroy() {
- this.table?.destroy()
- this.resizeObserver?.disconnect()
- }
+ render() {
+ this.table?.render()
+ }
-}
\ No newline at end of file
+ destroy() {
+ this.table?.destroy()
+ this.resizeObserver?.disconnect()
+ }
+}
diff --git a/frontend/src/views/chat/component/index.ts b/frontend/src/views/chat/component/index.ts
index e14c2bd8..4e10061a 100644
--- a/frontend/src/views/chat/component/index.ts
+++ b/frontend/src/views/chat/component/index.ts
@@ -1,33 +1,32 @@
-import {BaseChart} from "@/views/chat/component/BaseChart.ts";
-import {Bar} from "@/views/chat/component/charts/Bar.ts";
-import {Column} from "@/views/chat/component/charts/Column.ts";
-import {Line} from "@/views/chat/component/charts/Line.ts";
-import {Table} from "@/views/chat/component/charts/Table.ts";
-import {Pie} from "@/views/chat/component/charts/Pie.ts";
+import { BaseChart } from '@/views/chat/component/BaseChart.ts'
+import { Bar } from '@/views/chat/component/charts/Bar.ts'
+import { Column } from '@/views/chat/component/charts/Column.ts'
+import { Line } from '@/views/chat/component/charts/Line.ts'
+import { Table } from '@/views/chat/component/charts/Table.ts'
+import { Pie } from '@/views/chat/component/charts/Pie.ts'
const CHART_TYPE_MAP: { [key: string]: any } = {
- "table": Table,
- "column": Column,
- "bar": Bar,
- "line": Line,
- "pie": Pie
+ table: Table,
+ column: Column,
+ bar: Bar,
+ line: Line,
+ pie: Pie,
}
const isParent = (type: any, parentType: any) => {
- let _type = type
- while (_type) {
- if (_type === parentType) {
- return true
- }
- _type = _type.__proto__
+ let _type = type
+ while (_type) {
+ if (_type === parentType) {
+ return true
}
- return false
+ _type = _type.__proto__
+ }
+ return false
}
export function getChartInstance(type: string, id: string): BaseChart | undefined {
- if (isParent(CHART_TYPE_MAP[type], BaseChart)) {
- return new CHART_TYPE_MAP[type](id) as BaseChart;
- }
- return undefined
+ if (isParent(CHART_TYPE_MAP[type], BaseChart)) {
+ return new CHART_TYPE_MAP[type](id) as BaseChart
+ }
+ return undefined
}
-
diff --git a/frontend/src/views/chat/index.vue b/frontend/src/views/chat/index.vue
index b0582b86..62b95a02 100644
--- a/frontend/src/views/chat/index.vue
+++ b/frontend/src/views/chat/index.vue
@@ -5,19 +5,19 @@
-
+
{{ t('qa.New Conversation') }}
@@ -27,14 +27,14 @@
-
+
-
+
@@ -43,33 +43,31 @@
-
+
@@ -79,17 +77,17 @@
\ No newline at end of file
+
diff --git a/frontend/src/views/dashboard/canvas/DragHandle.vue b/frontend/src/views/dashboard/canvas/DragHandle.vue
index 58098e1b..131389f8 100644
--- a/frontend/src/views/dashboard/canvas/DragHandle.vue
+++ b/frontend/src/views/dashboard/canvas/DragHandle.vue
@@ -1,12 +1,12 @@
-
+
\ No newline at end of file
+
diff --git a/frontend/src/views/dashboard/canvas/ResizeHandle.vue b/frontend/src/views/dashboard/canvas/ResizeHandle.vue
index 1988efdf..7f2097f7 100644
--- a/frontend/src/views/dashboard/canvas/ResizeHandle.vue
+++ b/frontend/src/views/dashboard/canvas/ResizeHandle.vue
@@ -4,8 +4,8 @@ defineProps({
type: Function,
default: () => {
return {}
- }
- }
+ },
+ },
})
const cursors = {
lt: 'nw',
@@ -15,7 +15,7 @@ const cursors = {
rb: 'se',
b: 's',
lb: 'sw',
- l: 'w'
+ l: 'w',
}
function getPointStyle(point: string) {
@@ -40,7 +40,7 @@ function getPointStyle(point: string) {
// The points on both sides are centered in height
if (hasL || hasR) {
newLeft = hasL ? '0px' : '100%'
- newTop ='50%'
+ newTop = '50%'
}
}
@@ -50,7 +50,7 @@ function getPointStyle(point: string) {
left: `${newLeft}`,
top: `${newTop}`,
// @ts-expect-error
- cursor: `${cursors[point]}-resize`
+ cursor: `${cursors[point]}-resize`,
}
}
@@ -58,12 +58,15 @@ const pointList = ['lt', 't', 'rt', 'r', 'rb', 'b', 'lb', 'l']
-
+
\ No newline at end of file
+
diff --git a/frontend/src/views/dashboard/common/DashboardDetailInfo.vue b/frontend/src/views/dashboard/common/DashboardDetailInfo.vue
index 5e3816f9..90940682 100644
--- a/frontend/src/views/dashboard/common/DashboardDetailInfo.vue
+++ b/frontend/src/views/dashboard/common/DashboardDetailInfo.vue
@@ -1,8 +1,6 @@
+
-
-
+
+
-
{{ chat.brief ?? 'Untitled' }}
- handleCommand(cmd, chat)">
+ handleCommand(cmd, chat)">
-
+
@@ -135,7 +133,6 @@ function handleCommand(command: string | number | object, chat: Chat) {
\ No newline at end of file
+
diff --git a/frontend/src/views/chat/ChatRow.vue b/frontend/src/views/chat/ChatRow.vue
index 3cdf3e29..d65cd9f7 100644
--- a/frontend/src/views/chat/ChatRow.vue
+++ b/frontend/src/views/chat/ChatRow.vue
@@ -1,46 +1,46 @@
-
-
-
- SQLBot
-
+
{{ t('qa.view_more') }}
+ {{ t('qa.view_more') }}
+ SQLBot
+
-
+
-
+
-
+
@@ -68,8 +68,6 @@ const _datasource = computed({
}
.user-avatar {
- background: var(--ed-color-primary)
+ background: var(--ed-color-primary);
}
-
-
-
\ No newline at end of file
+
diff --git a/frontend/src/views/chat/WelcomeBlock.vue b/frontend/src/views/chat/WelcomeBlock.vue
index d9afc507..0e9601bd 100644
--- a/frontend/src/views/chat/WelcomeBlock.vue
+++ b/frontend/src/views/chat/WelcomeBlock.vue
@@ -1,13 +1,14 @@
@@ -87,15 +86,20 @@ onMounted(() => {
{{ t('qa.greeting') }}
{{ t('qa.description') }}
-
+
{{ t('qa.select_datasource') }}
-
-
+
@@ -108,32 +112,37 @@ onMounted(() => {
{{ t('qa.selected_datasource') }}
-
+
-
+
-
+
{{ t('ds.title') }}:{{ currentChat.datasource_name }}
-
diff --git a/frontend/src/views/dashboard/common/HandleMore.vue b/frontend/src/views/dashboard/common/HandleMore.vue
index 89f359bd..d94c8bcb 100644
--- a/frontend/src/views/dashboard/common/HandleMore.vue
+++ b/frontend/src/views/dashboard/common/HandleMore.vue
@@ -1,7 +1,7 @@
-
+
{{ name }}
@@ -268,6 +265,6 @@ defineExpose({
}
.custom-tree-folder {
- color: rgb(255, 198, 10)
+ color: rgb(255, 198, 10);
}
diff --git a/frontend/src/views/dashboard/common/ResourceTree.vue b/frontend/src/views/dashboard/common/ResourceTree.vue
index 9278c54f..90eafbf9 100644
--- a/frontend/src/views/dashboard/common/ResourceTree.vue
+++ b/frontend/src/views/dashboard/common/ResourceTree.vue
@@ -1,6 +1,6 @@
@@ -273,97 +266,90 @@ defineExpose({
-
+
-
+
-
- Dashboard ID
-
+ Dashboard ID
{{ dashboardInfo.id }}
Creator
{{ dashboardInfo.createName }}
@@ -19,12 +17,11 @@
+
-
+
,
- required: true
+ required: true,
},
disabled: {
type: Boolean,
- default: false
- }
+ default: false,
+ },
})
-const {configItem} = toRefs(props)
+const { configItem } = toRefs(props)
const tinymceId = 'vue-tinymce-' + +new Date() + ((Math.random() * 1000).toFixed(0) + '')
const init = reactive({
selector: tinymceId,
@@ -59,25 +61,25 @@ const init = reactive({
skin_url: '/tinymce-sqlbot-private/skins/ui/oxide',
content_css: '/tinymce-sqlbot-private/skins/content/default/content.css',
plugins:
- 'advlist autolink link image lists charmap media wordcount contextmenu directionality pagebreak letterspacing', // 插件
+ 'advlist autolink link image lists charmap media wordcount contextmenu directionality pagebreak letterspacing', // 插件
// 工具栏
toolbar:
- 'undo redo | fontselect fontsizeselect |forecolor backcolor bold italic letterspacing |underline strikethrough link lineheight| formatselect |' +
- 'top-align center-align bottom-align | alignleft aligncenter alignright | bullist numlist |' +
- ' blockquote subscript superscript removeformat | image ',
+ 'undo redo | fontselect fontsizeselect |forecolor backcolor bold italic letterspacing |underline strikethrough link lineheight| formatselect |' +
+ 'top-align center-align bottom-align | alignleft aligncenter alignright | bullist numlist |' +
+ ' blockquote subscript superscript removeformat | image ',
toolbar_location: '/',
font_formats:
- '微软雅黑=Microsoft YaHei;宋体=SimSun;黑体=SimHei;仿宋=FangSong;华文黑体=STHeiti;华文楷体=STKaiti;华文宋体=STSong;华文仿宋=STFangsong;Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings',
+ '微软雅黑=Microsoft YaHei;宋体=SimSun;黑体=SimHei;仿宋=FangSong;华文黑体=STHeiti;华文楷体=STKaiti;华文宋体=STSong;华文仿宋=STFangsong;Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings',
fontsize_formats:
- '12px 14px 16px 18px 20px 22px 24px 28px 32px 36px 42px 48px 56px 72px 80px 90px 100px 110px 120px 140px 150px 170px 190px 210px', // 字体大小
+ '12px 14px 16px 18px 20px 22px 24px 28px 32px 36px 42px 48px 56px 72px 80px 90px 100px 110px 120px 140px 150px 170px 190px 210px', // 字体大小
menubar: false,
placeholder: '',
inline: true,
- setup: function (editor : any) {
+ setup: function (editor: any) {
editor.on('blur', function () {
configItem.value.editing = false
- });
- }
+ })
+ },
})
const isDisabled = computed(() => props.disabled || !configItem.value.editing)
@@ -173,5 +175,4 @@ onMounted(() => {
list-style-type: decimal;
}
}
-
diff --git a/frontend/src/views/dashboard/components/sq-view/index.vue b/frontend/src/views/dashboard/components/sq-view/index.vue
index 2f86b473..3ae88d9d 100644
--- a/frontend/src/views/dashboard/components/sq-view/index.vue
+++ b/frontend/src/views/dashboard/components/sq-view/index.vue
@@ -1,11 +1,5 @@
-
-
+
-
-
-
-
-
\ No newline at end of file
+
diff --git a/frontend/src/views/dashboard/editor/DashboardEditor.vue b/frontend/src/views/dashboard/editor/DashboardEditor.vue
index de3d1905..8185a53c 100644
--- a/frontend/src/views/dashboard/editor/DashboardEditor.vue
+++ b/frontend/src/views/dashboard/editor/DashboardEditor.vue
@@ -1,7 +1,7 @@
-
+
@@ -82,4 +82,4 @@ const baseParams = computed(() => {
height: 100vh;
background: #f5f6f7;
}
-
\ No newline at end of file
+
diff --git a/frontend/src/views/dashboard/index.vue b/frontend/src/views/dashboard/index.vue
index 9d78d8ac..672f29b5 100644
--- a/frontend/src/views/dashboard/index.vue
+++ b/frontend/src/views/dashboard/index.vue
@@ -1,5 +1,5 @@
diff --git a/frontend/src/views/dashboard/preview/SQComponentWrapper.vue b/frontend/src/views/dashboard/preview/SQComponentWrapper.vue
index b4f2c53e..7ae60f39 100644
--- a/frontend/src/views/dashboard/preview/SQComponentWrapper.vue
+++ b/frontend/src/views/dashboard/preview/SQComponentWrapper.vue
@@ -1,52 +1,51 @@
-
{{ tabItem.title }}
+ >{{ tabItem.title }}
-
+
@@ -187,8 +197,8 @@ defineExpose({
copy
delete
@@ -202,26 +212,25 @@ defineExpose({
emits('parentAddItemBox',item)"
+ :ref="'tabEditorRef_' + index"
+ class="tab-dashboard-editor-main"
+ :canvas-component-data="tabItem.componentData"
+ :move-in-active="configItem.moveInActive"
+ :base-matrix-count="tabBaseMatrixCount"
+ :canvas-id="tabItem.name"
+ :parent-config-item="configItem"
+ @parent-add-item-box="(item) => emits('parentAddItemBox', item)"
>
-
\ No newline at end of file
+
diff --git a/frontend/src/views/dashboard/components/sq-text/index.vue b/frontend/src/views/dashboard/components/sq-text/index.vue
index 041a202f..93215a03 100644
--- a/frontend/src/views/dashboard/components/sq-text/index.vue
+++ b/frontend/src/views/dashboard/components/sq-text/index.vue
@@ -1,15 +1,18 @@
-
+
@@ -34,23 +37,22 @@ import 'tinymce/plugins/nonbreaking'
import 'tinymce/plugins/pagebreak'
import '@npkg/tinymce-plugins/letterspacing'
-import {computed, nextTick, type PropType, reactive, toRefs} from 'vue'
-import {onMounted} from 'vue'
-import type {CanvasItem} from "@/utils/canvas.ts";
-
+import { computed, nextTick, type PropType, reactive, toRefs } from 'vue'
+import { onMounted } from 'vue'
+import type { CanvasItem } from '@/utils/canvas.ts'
const props = defineProps({
configItem: {
type: Object as PropType
+ ref="dashboardEditorRef"
+ class="dashboard-editor-main"
+ :class="{ 'move-in-active': moveInActive }"
+ >
emits('parentAddItemBox',item)"
+ ref="canvasCoreRef"
+ :base-width="baseWidth"
+ :base-height="baseHeight"
+ :base-margin-left="baseMarginLeft"
+ :base-margin-top="baseMarginTop"
+ :canvas-component-data="canvasComponentData"
+ :canvas-style-data="canvasStyleData"
+ :dashboard-info="dashboardInfo"
+ :parent-config-item="parentConfigItem"
+ :canvas-id="canvasId"
+ @parent-add-item-box="(item) => emits('parentAddItemBox', item)"
>
-
\ No newline at end of file
+
diff --git a/frontend/src/views/dashboard/editor/index.vue b/frontend/src/views/dashboard/editor/index.vue
index 4be1147b..24be96c2 100644
--- a/frontend/src/views/dashboard/editor/index.vue
+++ b/frontend/src/views/dashboard/editor/index.vue
@@ -1,26 +1,26 @@
-
+
+
diff --git a/frontend/src/views/dashboard/preview/SQPreview.vue b/frontend/src/views/dashboard/preview/SQPreview.vue
index e0fecfc3..e6562022 100644
--- a/frontend/src/views/dashboard/preview/SQPreview.vue
+++ b/frontend/src/views/dashboard/preview/SQPreview.vue
@@ -2,57 +2,59 @@
import elementResizeDetectorMaker from 'element-resize-detector'
const dashboardStore = dashboardStoreWithOut()
-const {curComponent} = storeToRefs(dashboardStore)
+const { curComponent } = storeToRefs(dashboardStore)
-import {onMounted, toRefs, ref, computed, reactive} from 'vue'
-import {dashboardStoreWithOut} from "@/stores/dashboard/dashboard.ts";
-import {storeToRefs} from "pinia";
-import SQComponentWrapper from "@/views/dashboard/preview/SQComponentWrapper.vue";
-import type {CanvasItem} from "@/utils/canvas.ts";
+import { onMounted, toRefs, ref, computed, reactive } from 'vue'
+import { dashboardStoreWithOut } from '@/stores/dashboard/dashboard.ts'
+import { storeToRefs } from 'pinia'
+import SQComponentWrapper from '@/views/dashboard/preview/SQComponentWrapper.vue'
+import type { CanvasItem } from '@/utils/canvas.ts'
const props = defineProps({
canvasStyleData: {
type: Object,
- required: true
+ required: true,
},
componentData: {
type: Object,
- required: true
+ required: true,
},
canvasViewInfo: {
type: Object,
- required: true
+ required: true,
},
dashboardInfo: {
type: Object,
- required: true
+ required: true,
},
baseMatrixCount: {
type: Object,
- default: {
- x: 72,
- y: 36
- }
+ default: () => {
+ return {
+ x: 72,
+ y: 36,
+ }
+ },
},
canvasId: {
type: String,
required: false,
- default: 'canvas-main'
+ default: 'canvas-main',
},
showPosition: {
required: false,
type: String,
- default: 'preview'
- }
+ default: 'preview',
+ },
})
-const { canvasStyleData, componentData, showPosition, canvasId} = toRefs(props)
+const { canvasStyleData, componentData, showPosition, canvasId } = toRefs(props)
const domId = 'preview-' + canvasId.value
const previewCanvas = ref(null)
const renderReady = ref(true)
const state = reactive({
initState: true,
- scrollMain: 0
+ scrollMain: 0,
})
const cellWidth = ref(0)
@@ -62,19 +64,17 @@ const baseHeight = ref(0)
const baseMarginLeft = ref(0)
const baseMarginTop = ref(0)
const canvasStyle = computed(() => {
- return {background: '#f5f6f7'}
+ return { background: '#f5f6f7' }
})
-const restore = () => {
-
-}
+const restore = () => {}
function nowItemStyle(item: CanvasItem) {
return {
width: cellWidth.value * item.sizeX - baseMarginLeft.value + 'px',
height: cellHeight.value * item.sizeY - baseMarginTop.value + 'px',
left: cellWidth.value * (item.x - 1) + baseMarginLeft.value + 'px',
- top: cellHeight.value * (item.y - 1) + baseMarginTop.value + 'px'
+ top: cellHeight.value * (item.y - 1) + baseMarginTop.value + 'px',
}
}
@@ -86,14 +86,15 @@ const sizeInit = () => {
const screenHeight = previewCanvas.value.offsetHeight
baseMarginLeft.value = 10
baseMarginTop.value = 10
- baseWidth.value = (screenWidth - baseMarginLeft.value) / props.baseMatrixCount.x - baseMarginLeft.value
- baseHeight.value = (screenHeight - baseMarginTop.value) / props.baseMatrixCount.y - baseMarginTop.value
+ baseWidth.value =
+ (screenWidth - baseMarginLeft.value) / props.baseMatrixCount.x - baseMarginLeft.value
+ baseHeight.value =
+ (screenHeight - baseMarginTop.value) / props.baseMatrixCount.y - baseMarginTop.value
cellWidth.value = baseWidth.value + baseMarginLeft.value
cellHeight.value = baseHeight.value + baseMarginTop.value
}
}
-
onMounted(() => {
sizeInit()
//@ts-ignore
@@ -101,23 +102,29 @@ onMounted(() => {
})
defineExpose({
- restore
+ restore,
})
-
+
diff --git a/frontend/src/views/dashboard/preview/SQPreviewHead.vue b/frontend/src/views/dashboard/preview/SQPreviewHead.vue
index 09684bd0..3f7bc2a3 100644
--- a/frontend/src/views/dashboard/preview/SQPreviewHead.vue
+++ b/frontend/src/views/dashboard/preview/SQPreviewHead.vue
@@ -2,7 +2,7 @@
import dashboardInfoSvg from '@/assets/svg/dashboard-info.svg'
import icon_pc_outlined from '@/assets/svg/icon_pc_outlined.svg'
import icon_edit_outlined from '@/assets/svg/icon_edit_outlined.svg'
-import DashboardDetailInfo from "@/views/dashboard/common/DashboardDetailInfo.vue";
+import DashboardDetailInfo from '@/views/dashboard/common/DashboardDetailInfo.vue'
const emit = defineEmits(['reload', 'download', 'downloadAsAppTemplate'])
const preview = () => {
@@ -14,22 +14,23 @@ const edit = () => {
const props = defineProps({
dashboardInfo: {
type: Object,
- required: true
- }
+ required: true,
+ },
})
-
- Creator:{{ dashboardInfo.createName }}
+
+ Creator:{{ dashboardInfo.createName }}
-
+
@@ -39,7 +40,7 @@ const props = defineProps({
-
+
Preview
@@ -47,12 +48,11 @@ const props = defineProps({
-
+
Edit
-
+
diff --git a/frontend/src/views/dashboard/preview/SQPreviewShow.vue b/frontend/src/views/dashboard/preview/SQPreviewShow.vue
index 415f1cc6..cb22908e 100644
--- a/frontend/src/views/dashboard/preview/SQPreviewShow.vue
+++ b/frontend/src/views/dashboard/preview/SQPreviewShow.vue
@@ -1,13 +1,13 @@
-
-
{{ dashboardInfo.name }}
-
+
+
-
+
-
+
-
+
Create Dashboard
diff --git a/frontend/src/views/dashboard/preview/SQPreviewSingle.vue b/frontend/src/views/dashboard/preview/SQPreviewSingle.vue
index 94ebcf2a..f9ea325a 100644
--- a/frontend/src/views/dashboard/preview/SQPreviewSingle.vue
+++ b/frontend/src/views/dashboard/preview/SQPreviewSingle.vue
@@ -1,9 +1,8 @@
-
+
-
\ No newline at end of file
+ position: relative;
+ display: flex;
+ width: 100%;
+ height: 100vh;
+ overflow-x: hidden;
+ overflow-y: auto;
+ align-items: center;
+}
+
diff --git a/frontend/src/views/dashboard/preview/index.vue b/frontend/src/views/dashboard/preview/index.vue
index 2f86b473..3ae88d9d 100644
--- a/frontend/src/views/dashboard/preview/index.vue
+++ b/frontend/src/views/dashboard/preview/index.vue
@@ -1,11 +1,5 @@
-
-
+
-
-
-
-
-
\ No newline at end of file
+
diff --git a/frontend/src/views/dashboard/utils/canvasUtils.ts b/frontend/src/views/dashboard/utils/canvasUtils.ts
index 515d5d3d..7a82a7ea 100644
--- a/frontend/src/views/dashboard/utils/canvasUtils.ts
+++ b/frontend/src/views/dashboard/utils/canvasUtils.ts
@@ -1,80 +1,81 @@
-import {dashboardApi} from "@/api/dashboard.ts";
-import {dashboardStoreWithOut} from "@/stores/dashboard/dashboard.ts";
-import {storeToRefs} from "pinia";
+import { dashboardApi } from '@/api/dashboard.ts'
+import { dashboardStoreWithOut } from '@/stores/dashboard/dashboard.ts'
+import { storeToRefs } from 'pinia'
const dashboardStore = dashboardStoreWithOut()
-const {componentData, canvasStyleData} = storeToRefs(dashboardStore)
+const { componentData, canvasStyleData } = storeToRefs(dashboardStore)
const workspace_id = 'default' // temp
-export const load_resource_prepare = (params: any, callBack: Function) => {
- dashboardApi.load_resource(params).then((canvasInfo: any) => {
- const dashboardInfo = {
- id: canvasInfo.id,
- name: canvasInfo.name,
- pid: canvasInfo.pid,
- workspaceId: canvasInfo.workspace_id,
- status: canvasInfo.status,
- type: canvasInfo.type,
- createName: canvasInfo.create_name,
- updateName: canvasInfo.update_name,
- createTime: canvasInfo.create_time,
- updateTime: canvasInfo.update_time,
- contentId: canvasInfo.content_id
- }
- const canvasDataResult = JSON.parse(canvasInfo.component_data)
- const canvasStyleResult = JSON.parse(canvasInfo.canvas_style_data)
- const canvasViewInfoPreview = canvasInfo.canvas_view_Info
- callBack({dashboardInfo, canvasDataResult, canvasStyleResult, canvasViewInfoPreview})
- })
+export const load_resource_prepare = (params: any, callBack: (obj: any) => void) => {
+ dashboardApi.load_resource(params).then((canvasInfo: any) => {
+ const dashboardInfo = {
+ id: canvasInfo.id,
+ name: canvasInfo.name,
+ pid: canvasInfo.pid,
+ workspaceId: canvasInfo.workspace_id,
+ status: canvasInfo.status,
+ type: canvasInfo.type,
+ createName: canvasInfo.create_name,
+ updateName: canvasInfo.update_name,
+ createTime: canvasInfo.create_time,
+ updateTime: canvasInfo.update_time,
+ contentId: canvasInfo.content_id,
+ }
+ const canvasDataResult = JSON.parse(canvasInfo.component_data)
+ const canvasStyleResult = JSON.parse(canvasInfo.canvas_style_data)
+ const canvasViewInfoPreview = canvasInfo.canvas_view_Info
+ callBack({ dashboardInfo, canvasDataResult, canvasStyleResult, canvasViewInfoPreview })
+ })
}
-export const initCanvasData = (params: any, callBack: Function) => {
- load_resource_prepare(params, function (result: any) {
- dashboardStore.setDashboardInfo(result.dashboardInfo)
- dashboardStore.setCanvasStyleData(result.canvasStyleResult)
- dashboardStore.setComponentData(result.canvasDataResult)
- dashboardStore.setCanvasViewInfo(result.canvasViewInfoPreview)
- callBack()
- })
+export const initCanvasData = (params: any, callBack: () => void) => {
+ load_resource_prepare(params, function (result: any) {
+ dashboardStore.setDashboardInfo(result.dashboardInfo)
+ dashboardStore.setCanvasStyleData(result.canvasStyleResult)
+ dashboardStore.setComponentData(result.canvasDataResult)
+ dashboardStore.setCanvasViewInfo(result.canvasViewInfoPreview)
+ callBack()
+ })
}
export const saveDashboardResource = (params: any, callBack: Function) => {
- params['workspace_id'] = workspace_id
- dashboardApi.check_name(params).then((resCheck: any) => {
- if (resCheck) {
- if (params.opt === 'newLeaf') {// create canvas
- const reqeustParams = {
- ...params,
- component_data: JSON.stringify(componentData.value),
- canvas_style_data: JSON.stringify(canvasStyleData.value)
- }
- dashboardApi.create_canvas(reqeustParams).then((res: any) => {
- dashboardStore.updateDashboardInfo({id: res.id, dataState: 'ready'})
- callBack(res)
- })
- } else if (params.opt === 'newFolder') {
- dashboardApi.create_resource(params).then((res: any) => {
- callBack(res)
- })
- } else if (params.opt === 'rename') {
- dashboardApi.update_resource(params).then((res: any) => {
- callBack(res)
- })
- }else if (params.opt === 'updateLeaf') {
- const reqeustParams = {
- ...params,
- component_data: JSON.stringify(componentData.value),
- canvas_style_data: JSON.stringify(canvasStyleData.value)
- }
- dashboardApi.update_canvas(reqeustParams).then(() => {
- callBack()
- })
- }
- } else {
- ElMessage({
- type: 'warning',
- message: 'Name Already In Use',
- })
+ params['workspace_id'] = workspace_id
+ dashboardApi.check_name(params).then((resCheck: any) => {
+ if (resCheck) {
+ if (params.opt === 'newLeaf') {
+ // create canvas
+ const reqeustParams = {
+ ...params,
+ component_data: JSON.stringify(componentData.value),
+ canvas_style_data: JSON.stringify(canvasStyleData.value),
}
- })
-}
\ No newline at end of file
+ dashboardApi.create_canvas(reqeustParams).then((res: any) => {
+ dashboardStore.updateDashboardInfo({ id: res.id, dataState: 'ready' })
+ callBack(res)
+ })
+ } else if (params.opt === 'newFolder') {
+ dashboardApi.create_resource(params).then((res: any) => {
+ callBack(res)
+ })
+ } else if (params.opt === 'rename') {
+ dashboardApi.update_resource(params).then((res: any) => {
+ callBack(res)
+ })
+ } else if (params.opt === 'updateLeaf') {
+ const reqeustParams = {
+ ...params,
+ component_data: JSON.stringify(componentData.value),
+ canvas_style_data: JSON.stringify(canvasStyleData.value),
+ }
+ dashboardApi.update_canvas(reqeustParams).then(() => {
+ callBack()
+ })
+ }
+ } else {
+ ElMessage({
+ type: 'warning',
+ message: 'Name Already In Use',
+ })
+ }
+ })
+}
diff --git a/frontend/src/views/dashboard/utils/treeDraggableChart.ts b/frontend/src/views/dashboard/utils/treeDraggableChart.ts
index 4db24a21..9152121c 100644
--- a/frontend/src/views/dashboard/utils/treeDraggableChart.ts
+++ b/frontend/src/views/dashboard/utils/treeDraggableChart.ts
@@ -1,14 +1,14 @@
import { cloneDeep } from 'lodash-es'
-import {dashboardApi} from "@/api/dashboard.ts";
-const treeDraggableChart = (state:any, key:any, type:any) => {
+import { dashboardApi } from '@/api/dashboard.ts'
+const treeDraggableChart = (state: any, key: any, type: any) => {
let dragNodeParentId = ''
let dragNodeId = ''
let dragNodeIndex = 0
- let rawData:any[] = []
+ let rawData: any[] = []
- const dfsTreeNode = (arr:any, parentId:any) => {
- arr.forEach((element:any, index:any) => {
+ const dfsTreeNode = (arr: any, parentId: any) => {
+ arr.forEach((element: any, index: any) => {
if (element.id === dragNodeId) {
dragNodeIndex = index
dragNodeParentId = parentId
@@ -19,9 +19,9 @@ const treeDraggableChart = (state:any, key:any, type:any) => {
})
}
- const dfsTreeNodeSaveLevel = (arr:any[], idArr:any) => {
- arr.forEach((element:any) => {
- const index = idArr.findIndex((ele:any) => {
+ const dfsTreeNodeSaveLevel = (arr: any[], idArr: any) => {
+ arr.forEach((element: any) => {
+ const index = idArr.findIndex((ele: any) => {
return ele === element.id
})
if (index !== -1) {
@@ -33,8 +33,8 @@ const treeDraggableChart = (state:any, key:any, type:any) => {
})
}
- const dfsTreeNodeBack = (arr:any, parentId:any, params:any) => {
- arr.forEach((element:any) => {
+ const dfsTreeNodeBack = (arr: any, parentId: any, params: any) => {
+ arr.forEach((element: any) => {
if (element.id === params.id) {
params.pid = parentId
}
@@ -44,8 +44,8 @@ const treeDraggableChart = (state:any, key:any, type:any) => {
})
}
- const dfsTreeNodeReset = (arr:any, node:any) => {
- arr.forEach((element:any) => {
+ const dfsTreeNodeReset = (arr: any, node: any) => {
+ arr.forEach((element: any) => {
if (element.id === dragNodeParentId) {
element.children.splice(dragNodeIndex, 0, node)
}
@@ -55,8 +55,8 @@ const treeDraggableChart = (state:any, key:any, type:any) => {
})
}
- const dfsTreeNodeDel = (arr:any, node:any) => {
- arr.forEach((element:any, index:any) => {
+ const dfsTreeNodeDel = (arr: any, node: any) => {
+ arr.forEach((element: any, index: any) => {
if (element.id === node.id) {
arr.splice(index, 1)
}
@@ -66,24 +66,24 @@ const treeDraggableChart = (state:any, key:any, type:any) => {
})
}
- const handleDragStart = (node:any) => {
+ const handleDragStart = (node: any) => {
dragNodeId = node.data.id
rawData = cloneDeep(state[key])
dfsTreeNode(state[key], '0')
}
- const allowDrop = (dropNode:any) => {
+ const allowDrop = (dropNode: any) => {
return !dropNode.data?.leaf
}
- const handleDrop = async (draggingNode:any, dropNode:any, dropType:any) => {
+ const handleDrop = async (draggingNode: any, dropNode: any, dropType: any) => {
const params = {
id: draggingNode.data?.id,
name: draggingNode.data?.name,
nodeType: draggingNode.data?.leaf ? 'leaf' : 'folder',
pid: '0',
opt: 'move',
- type
+ type,
}
if (dropType !== 'inner') {
const idArr = [params.id, dropNode.data?.id]
@@ -115,7 +115,8 @@ const treeDraggableChart = (state:any, key:any, type:any) => {
dfsTreeNodeBack(state[key], '0', params)
}
- dashboardApi.move_resource(params)
+ dashboardApi
+ .move_resource(params)
.then(() => {
state.originResourceTree = cloneDeep(state[key])
})
@@ -132,7 +133,7 @@ const treeDraggableChart = (state:any, key:any, type:any) => {
return {
handleDrop,
allowDrop,
- handleDragStart
+ handleDragStart,
}
}
diff --git a/frontend/src/views/dashboard/utils/treeSortUtils.ts b/frontend/src/views/dashboard/utils/treeSortUtils.ts
index d732ae3b..83efbe3d 100644
--- a/frontend/src/views/dashboard/utils/treeSortUtils.ts
+++ b/frontend/src/views/dashboard/utils/treeSortUtils.ts
@@ -1,14 +1,14 @@
import _ from 'lodash'
-import type {SQTreeNode} from "@/views/dashboard/utils/treeNode";
+import type { SQTreeNode } from '@/views/dashboard/utils/treeNode'
-export function treeParentWeight(tree: SQTreeNode[], pWeight:any) {
+export function treeParentWeight(tree: SQTreeNode[], pWeight: any) {
const pWeightResult = {}
weightCheckCircle(tree, pWeightResult, pWeight)
return pWeightResult
}
-export function weightCheckCircle(tree: SQTreeNode[], pWeightResult:any, pWeight:any) {
- _.forEach(tree, node => {
+export function weightCheckCircle(tree: SQTreeNode[], pWeightResult: any, pWeight: any) {
+ _.forEach(tree, (node) => {
pWeightResult[node.id] = pWeight
if (node.children && node.children.length > 0) {
weightCheckCircle(node.children, pWeightResult, node.weight)
@@ -24,7 +24,7 @@ export default function treeSort(tree: SQTreeNode[], sortType: string) {
export function sortCircle(tree: SQTreeNode[], sortType: string) {
sortPer(tree, sortType)
- _.forEach(tree, node => {
+ _.forEach(tree, (node) => {
if (node.children && node.children.length > 0) {
sortCircle(node.children, sortType)
}
diff --git a/frontend/src/views/ds/DatasourceItemCard.vue b/frontend/src/views/ds/DatasourceItemCard.vue
index ee5e5698..bb9d8568 100644
--- a/frontend/src/views/ds/DatasourceItemCard.vue
+++ b/frontend/src/views/ds/DatasourceItemCard.vue
@@ -1,11 +1,10 @@
-
+
@@ -144,4 +140,4 @@ defineProps<{
background-color: #fef7e0;
color: #fbbc05;
}
-
\ No newline at end of file
+
diff --git a/frontend/src/views/ds/TableList.vue b/frontend/src/views/ds/TableList.vue
index 1eee0a80..c5aa6b99 100644
--- a/frontend/src/views/ds/TableList.vue
+++ b/frontend/src/views/ds/TableList.vue
@@ -10,15 +10,20 @@
{{ t('ds.tables') }}
-
+
- (0)
+const dsId = ref(0)
const searchValue = ref('')
const tableList = ref([])
const currentTable = ref({})
diff --git a/frontend/src/views/ds/form.vue b/frontend/src/views/ds/form.vue
index e1e8066d..f4425de0 100644
--- a/frontend/src/views/ds/form.vue
+++ b/frontend/src/views/ds/form.vue
@@ -5,8 +5,8 @@
width="600"
:destroy-on-close="true"
:close-on-click-modal="false"
- @closed="close"
modal-class="add-datasource_dialog"
+ @closed="close"
>
+
@@ -139,7 +144,7 @@ const props = defineProps({
const { t } = useI18n()
-const dsId = ref
{{ item.table_name }}
@@ -25,7 +25,7 @@
-
-
+
@@ -76,8 +76,8 @@
@@ -89,12 +89,12 @@
- Get Schema
+ Get Schema
{{ t('ds.form.support_version') }}:
@@ -106,15 +106,15 @@
+
@@ -141,8 +141,8 @@
{{ t('ds.preview') }}
diff --git a/frontend/src/views/ds/index.vue b/frontend/src/views/ds/index.vue
index d121015a..509295da 100644
--- a/frontend/src/views/ds/index.vue
+++ b/frontend/src/views/ds/index.vue
@@ -31,20 +31,20 @@
diff --git a/frontend/src/views/ds/js/aes.ts b/frontend/src/views/ds/js/aes.ts
index 94ad7eb3..d1cc6209 100644
--- a/frontend/src/views/ds/js/aes.ts
+++ b/frontend/src/views/ds/js/aes.ts
@@ -2,17 +2,17 @@ import CryptoJS from 'crypto-js'
const key = CryptoJS.enc.Utf8.parse('SQLBot1234567890')
-export const encrypted = (str:string) => {
+export const encrypted = (str: string) => {
return CryptoJS.AES.encrypt(str, key, {
mode: CryptoJS.mode.ECB,
- padding: CryptoJS.pad.Pkcs7
+ padding: CryptoJS.pad.Pkcs7,
}).toString()
}
-export const decrypted = (str:string) => {
+export const decrypted = (str: string) => {
const bytes = CryptoJS.AES.decrypt(str, key, {
mode: CryptoJS.mode.ECB,
- padding: CryptoJS.pad.Pkcs7
+ padding: CryptoJS.pad.Pkcs7,
})
return bytes.toString(CryptoJS.enc.Utf8)
-}
\ No newline at end of file
+}
diff --git a/frontend/src/views/ds/js/ds-type.ts b/frontend/src/views/ds/js/ds-type.ts
index fa1e3af9..2fb2ed86 100644
--- a/frontend/src/views/ds/js/ds-type.ts
+++ b/frontend/src/views/ds/js/ds-type.ts
@@ -1,13 +1,9 @@
export const dsType = [
- {label:"MySQL", value:"mysql"},
- {label:"PostgreSQL", value:"pg"},
- {label:"Microsoft SQL Server", value:"sqlServer"},
- {label:"Oracle", value:"oracle"},
- {label:"Excel/CSV", value:"excel"},
+ { label: 'MySQL', value: 'mysql' },
+ { label: 'PostgreSQL', value: 'pg' },
+ { label: 'Microsoft SQL Server', value: 'sqlServer' },
+ { label: 'Oracle', value: 'oracle' },
+ { label: 'Excel/CSV', value: 'excel' },
]
-export const haveSchema = [
- 'sqlServer',
- 'pg',
- 'oracle'
-]
\ No newline at end of file
+export const haveSchema = ['sqlServer', 'pg', 'oracle']
diff --git a/frontend/src/views/login/index.vue b/frontend/src/views/login/index.vue
index a1e06ece..f30afe22 100644
--- a/frontend/src/views/login/index.vue
+++ b/frontend/src/views/login/index.vue
@@ -2,32 +2,31 @@
+
-
-
- Login
+ Login
@@ -47,12 +46,12 @@ const userStore = useUserStore()
const loginForm = ref({
username: '',
- password: ''
+ password: '',
})
const rules = {
username: [{ required: true, message: 'Please input account', trigger: 'blur' }],
- password: [{ required: true, message: 'Please input password', trigger: 'blur' }]
+ password: [{ required: true, message: 'Please input password', trigger: 'blur' }],
}
const loginFormRef = ref()
@@ -72,7 +71,7 @@ const submitForm = () => {
.login-container {
height: 100vh;
width: 100vw;
- background-color: #F0F6F7;
+ background-color: #f0f6f7;
display: flex;
align-items: center;
justify-content: center;
@@ -94,7 +93,6 @@ const submitForm = () => {
flex-direction: column;
align-items: center;
-
.illustration {
flex: 1;
width: 100%;
@@ -143,4 +141,4 @@ const submitForm = () => {
:deep(.ed-input__wrapper) {
background-color: #f5f7fa;
}
-
\ No newline at end of file
+
diff --git a/frontend/src/views/setting/Professional.vue b/frontend/src/views/setting/Professional.vue
index 3b5f263d..83b9ec15 100644
--- a/frontend/src/views/setting/Professional.vue
+++ b/frontend/src/views/setting/Professional.vue
@@ -32,7 +32,7 @@
-
+
@@ -50,19 +50,27 @@
-
-
+
-
+
-
-
+
+
@@ -75,38 +83,35 @@
\ No newline at end of file
+
diff --git a/frontend/src/views/system/model/index.vue b/frontend/src/views/system/model/index.vue
index 9afa061f..a9edbd8b 100644
--- a/frontend/src/views/system/model/index.vue
+++ b/frontend/src/views/system/model/index.vue
@@ -29,26 +29,31 @@
-
+
-
-
+
-
+
-
+
{{ getModelTypeName(scope.row.type) }}
-
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
-
+
-
-
+
+
+
-
-
{{ scope.row.api_key ? 'Configured' : 'Not Configured' }}
+
-
+
{{ scope.row.status ? 'Enabled' : 'Disabled' }}
@@ -87,40 +92,57 @@
@current-change="handleCurrentChange"
/>
-