Skip to content

Commit 1488c4e

Browse files
committed
fix: bug fix
1 parent a7a9c10 commit 1488c4e

File tree

9 files changed

+78
-32
lines changed

9 files changed

+78
-32
lines changed

frontend/src/i18n/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@
341341
"there_are": "There are",
342342
"2_dashboards": "{msg} dashboards",
343343
"smart_data_centers": "{msg} smart data centers",
344-
"confirm_to_delete": "This data source is in use. Deleting it will cause these resources to not work properly. Confirm to delete?",
344+
"confirm_to_delete": "After the data source is deleted, the related questions can no longer be asked and the charts in the dashboard cannot be displayed normally. Please operate with caution!",
345345
"id_account_to_add": "Search user ID/account to add",
346346
"find_user": "Find user",
347347
"add_successfully": "Add successfully",

frontend/src/i18n/zh-CN.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@
354354
"there_are": "",
355355
"2_dashboards": "{msg} 个仪表板",
356356
"smart_data_centers": "{msg} 个智能问数",
357-
"confirm_to_delete": "正在使用此数据源,删除后会导致这些资源无法正常使用,确认删除?",
357+
"confirm_to_delete": "数据源删除后,相关的问数不可继续提问,仪表板中的图表无法正常显示,请谨慎操作!",
358358
"id_account_to_add": "搜索用户ID/账号添加",
359359
"find_user": "查找用户",
360360
"add_successfully": "添加成功",

frontend/src/views/ds/DataTable.vue

Lines changed: 60 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const keywords = ref('')
5858
const tableListWithSearch = computed(() => {
5959
if (!keywords.value) return tableList.value
6060
return tableList.value.filter((ele) =>
61-
ele.name.toLowerCase().includes(keywords.value.toLowerCase())
61+
ele.table_name.toLowerCase().includes(keywords.value.toLowerCase())
6262
)
6363
})
6464
const total = ref(1000)
@@ -181,6 +181,31 @@ const emits = defineEmits(['back', 'refresh'])
181181
const back = () => {
182182
emits('back')
183183
}
184+
185+
const btnSelectClick = (val: any) => {
186+
btnSelect.value = val
187+
loading.value = true
188+
189+
if (val === 'd') {
190+
datasourceApi
191+
.fieldList(currentTable.value.id)
192+
.then((res) => {
193+
fieldList.value = res
194+
})
195+
.finally(() => {
196+
loading.value = false
197+
})
198+
} else {
199+
datasourceApi
200+
.previewData(props.info.id, buildData())
201+
.then((res) => {
202+
previewData.value = res
203+
})
204+
.finally(() => {
205+
loading.value = false
206+
})
207+
}
208+
}
184209
</script>
185210

186211
<template>
@@ -217,24 +242,26 @@ const back = () => {
217242
</el-input>
218243

219244
<div v-loading="initLoading" class="list-content">
220-
<div
221-
v-for="ele in tableListWithSearch"
222-
:key="ele.table_name"
223-
class="model"
224-
:class="currentTable.table_name === ele.table_name && 'isActive'"
225-
:title="ele.table_name"
226-
@click="clickTable(ele)"
227-
>
228-
<el-icon size="16">
229-
<icon_form_outlined></icon_form_outlined>
230-
</el-icon>
231-
<span class="name">{{ ele.table_name }}</span>
232-
</div>
245+
<el-scrollbar v-if="tableListWithSearch.length">
246+
<div
247+
v-for="ele in tableListWithSearch"
248+
:key="ele.table_name"
249+
class="model"
250+
:class="currentTable.table_name === ele.table_name && 'isActive'"
251+
:title="ele.table_name"
252+
@click="clickTable(ele)"
253+
>
254+
<el-icon size="16">
255+
<icon_form_outlined></icon_form_outlined>
256+
</el-icon>
257+
<span class="name">{{ ele.table_name }}</span>
258+
</div>
259+
</el-scrollbar>
233260
<EmptyBackground
234261
v-if="!!keywords && !tableListWithSearch.length"
235262
:description="$t('datasource.relevant_content_found')"
236263
img-type="tree"
237-
style="width: 100%; margin-top: 100px"
264+
style="width: 100%"
238265
/>
239266
<div v-else-if="!initLoading && !tableListWithSearch.length" class="no-data">
240267
<div class="no-data-msg">
@@ -264,10 +291,18 @@ const back = () => {
264291
</div>
265292
<div class="table-content">
266293
<div class="btn-select">
267-
<el-button :class="[btnSelect === 'd' && 'is-active']" text @click="btnSelect = 'd'">
294+
<el-button
295+
:class="[btnSelect === 'd' && 'is-active']"
296+
text
297+
@click="btnSelectClick('d')"
298+
>
268299
{{ t('ds.table_schema') }}
269300
</el-button>
270-
<el-button :class="[btnSelect === 'q' && 'is-active']" text @click="btnSelect = 'q'">
301+
<el-button
302+
:class="[btnSelect === 'q' && 'is-active']"
303+
text
304+
@click="btnSelectClick('q')"
305+
>
271306
{{ t('ds.preview') }}
272307
</el-button>
273308
</div>
@@ -431,6 +466,14 @@ const back = () => {
431466
432467
.list-content {
433468
height: calc(100% - 100px);
469+
.no-result {
470+
margin-top: 72px;
471+
font-weight: 400;
472+
font-size: 14px;
473+
line-height: 22px;
474+
text-align: center;
475+
color: #646a73;
476+
}
434477
.model {
435478
width: 100%;
436479
height: 32px;

frontend/src/views/ds/DelMessageBox.vue

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,6 @@ defineProps({
1919
})
2020
2121
const emits = defineEmits(['panelClick', 'smartClick'])
22-
const panelClick = () => {
23-
emits('panelClick')
24-
}
25-
26-
const smartClick = () => {
27-
emits('smartClick')
28-
}
2922
</script>
3023

3124
<template>
@@ -34,9 +27,6 @@ const smartClick = () => {
3427
{{ t('datasource.data_source', { msg: name }) }}
3528
</div>
3629
<div class="use-panel">
37-
{{ t('workspace.there_are') }}
38-
<span @click="panelClick">{{ t('workspace.2_dashboards', { msg: panelNum }) }}</span
39-
>、<span @click="smartClick">{{ t('workspace.smart_data_centers', { msg: smartNum }) }}</span>
4030
{{ t('workspace.confirm_to_delete') }}
4131
</div>
4232
</div>

frontend/src/views/system/member/index.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const deleteBatchUser = () => {
7070
})
7171
}
7272
const deleteHandler = (row: any) => {
73-
if (row.weight === 1) return
73+
if (row.weight === 1 && +userStore.getUid !== 1) return
7474
ElMessageBox.confirm(t('workspace.member_feng_yibudao', { msg: row.name }), {
7575
confirmButtonType: 'danger',
7676
confirmButtonText: t('dashboard.delete'),
@@ -177,6 +177,7 @@ const addWorkspace = () => {
177177
}
178178
179179
const handleSizeChange = (val: number) => {
180+
pageInfo.currentPage = 1
180181
pageInfo.pageSize = val
181182
search()
182183
}
@@ -261,7 +262,7 @@ const handleCurrentChange = (val: number) => {
261262
>
262263
<el-icon
263264
class="action-btn"
264-
:class="scope.row.weight === 1 && 'not-allow'"
265+
:class="+userStore.getUid !== 1 && scope.row.weight === 1 && 'not-allow'"
265266
size="16"
266267
@click="deleteHandler(scope.row)"
267268
>

frontend/src/views/system/user/User.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,12 @@
6666
<el-table-column prop="email" show-overflow-tooltip :label="$t('user.email')" />
6767
<!-- <el-table-column prop="phone" :label="$t('user.phone_number')" width="280" /> -->
6868
<!-- <el-table-column prop="user_source" :label="$t('user.user_source')" width="280" /> -->
69-
<el-table-column prop="oid_list" :label="$t('user.workspace')" width="280">
69+
<el-table-column
70+
show-overflow-tooltip
71+
prop="oid_list"
72+
:label="$t('user.workspace')"
73+
width="280"
74+
>
7075
<template #default="scope">
7176
<span>{{ formatSpaceName(scope.row.oid_list) }}</span>
7277
</template>
@@ -671,6 +676,7 @@ const saveHandler = () => {
671676
}
672677
const handleSizeChange = (val: number) => {
673678
state.pageInfo.pageSize = val
679+
state.pageInfo.currentPage = 1
674680
search()
675681
}
676682
const handleCurrentChange = (val: number) => {

frontend/src/views/system/user/index.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ const saveHandler = () => {
238238
}
239239
}
240240
const handleSizeChange = (val: number) => {
241+
state.pageInfo.currentPage = 1
241242
state.pageInfo.pageSize = val
242243
search()
243244
}

frontend/src/views/system/workspace/AuthorizedWorkspaceDialog.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,10 @@ defineExpose({
171171
margin-bottom: 8px;
172172
}
173173
174+
.ed-checkbox {
175+
margin-right: 0;
176+
}
177+
174178
.mt-16 {
175179
margin-top: 16px;
176180
}

frontend/src/views/system/workspace/index.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ const addWorkspace = (row: any) => {
269269
270270
const handleSizeChange = (val: number) => {
271271
pageInfo.pageSize = val
272+
pageInfo.currentPage = 1
272273
search()
273274
}
274275
const handleCurrentChange = (val: number) => {

0 commit comments

Comments
 (0)