Skip to content

Commit ddf4f2e

Browse files
committed
Merge remote-tracking branch 'origin/main'
# Conflicts: # frontend/src/views/dashboard/canvas/DsCanvasCore.vue
2 parents 693723c + a5ec56d commit ddf4f2e

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

frontend/src/views/ds/form.vue

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,18 @@
4747
</el-form>
4848
</div>
4949
<div v-show="active === 2" class="container">
50-
222
50+
<el-scrollbar height="480px">
51+
<el-checkbox-group v-model="checkList">
52+
<el-row :gutter="10">
53+
<el-col v-for="item in tableList" :key="item.value" :span="12">
54+
<el-checkbox :label="item.tableName">{{ item.tableName }}</el-checkbox>
55+
</el-col>
56+
</el-row>
57+
</el-checkbox-group>
58+
</el-scrollbar>
59+
<span>Selected: {{ checkList.length }}/{{ tableList.length }}</span>
5160
</div>
52-
<div style="display: flex;justify-content: flex-end;">
61+
<div style="display: flex;justify-content: flex-end;margin-top: 20px;">
5362
<el-button @click="close">Cancel</el-button>
5463
<el-button v-show="!isCreate && !isEditTable" @click="check">Test Connect</el-button>
5564
<el-button v-show="active === 1 && isCreate" type="primary" @click="next">Next</el-button>
@@ -70,6 +79,8 @@ const emit = defineEmits(['refresh'])
7079
const active = ref(1)
7180
const isCreate = ref(true)
7281
const isEditTable = ref(false)
82+
const checkList = ref<any>([])
83+
const tableList = ref<any>([])
7384
7485
const rules = reactive<FormRules>({
7586
name: [
@@ -109,6 +120,7 @@ const open = (item: any, editTable: boolean = false) => {
109120
active.value = 2
110121
isEditTable.value = true
111122
isCreate.value = false
123+
// request tables
112124
} else {
113125
isEditTable.value = false
114126
if (item) {
@@ -193,7 +205,6 @@ const buildConf = () => {
193205
const check = () => {
194206
buildConf()
195207
datasourceApi.check(form.value).then((res: any) => {
196-
console.log(res)
197208
if(res) {
198209
ElMessage({
199210
message: 'Connect success',
@@ -207,13 +218,12 @@ const check = () => {
207218
const next = () => {
208219
// check status if success do next
209220
buildConf()
210-
datasourceApi.check(form.value).then((res: any) => {
211-
console.log(res)
221+
datasourceApi.check(form.value).then((res: boolean) => {
212222
if(res) {
213223
active.value++
214224
// request tables
215225
datasourceApi.getTablesByConf(form.value).then((res) => {
216-
console.log(res)
226+
tableList.value = res
217227
})
218228
}
219229
})

0 commit comments

Comments
 (0)