mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
fix: bug fix
This commit is contained in:
@@ -74,5 +74,9 @@ const routerList = computed(() => {
|
||||
color: #1cba90 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.ed-sub-menu .ed-icon {
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -76,7 +76,9 @@ onMounted(async () => {
|
||||
<el-icon size="16">
|
||||
<icon_moments_categories_outlined></icon_moments_categories_outlined>
|
||||
</el-icon>
|
||||
<span v-if="!collapse" class="name">{{ currentWorkspace.name }}</span>
|
||||
<span v-if="!collapse" :title="currentWorkspace.name" class="name ellipsis">{{
|
||||
currentWorkspace.name
|
||||
}}</span>
|
||||
<el-icon v-if="!collapse" style="transform: scale(0.5)" class="expand" size="24">
|
||||
<icon_expand_down_filled></icon_expand_down_filled>
|
||||
</el-icon></button
|
||||
@@ -105,13 +107,17 @@ onMounted(async () => {
|
||||
<el-icon size="16">
|
||||
<icon_moments_categories_outlined></icon_moments_categories_outlined>
|
||||
</el-icon>
|
||||
<div class="datasource-name" v-html="formatKeywords(ele.name)"></div>
|
||||
<div
|
||||
:title="ele.name"
|
||||
class="datasource-name ellipsis"
|
||||
v-html="formatKeywords(ele.name)"
|
||||
></div>
|
||||
<el-icon size="16" class="done">
|
||||
<icon_done_outlined></icon_done_outlined>
|
||||
</el-icon>
|
||||
</div>
|
||||
<div v-if="!defaultWorkspaceListWithSearch.length" class="popover-item empty">
|
||||
没有找到相关结果
|
||||
{{ $t('model.relevant_results_found') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -142,6 +148,7 @@ onMounted(async () => {
|
||||
font-size: 14px;
|
||||
line-height: 22px;
|
||||
margin-left: 8px;
|
||||
max-width: 120px;
|
||||
}
|
||||
|
||||
.expand {
|
||||
@@ -203,6 +210,7 @@ onMounted(async () => {
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
line-height: 22px;
|
||||
max-width: 180px;
|
||||
}
|
||||
|
||||
.done {
|
||||
|
||||
@@ -312,6 +312,7 @@
|
||||
"old_password": "Old password"
|
||||
},
|
||||
"workspace": {
|
||||
"relevant_content_found": "No relevant content found",
|
||||
"add_workspace": "Add workspace",
|
||||
"administrator": "Administrator",
|
||||
"ordinary_member": "Ordinary member",
|
||||
|
||||
@@ -325,6 +325,7 @@
|
||||
}
|
||||
},
|
||||
"workspace": {
|
||||
"relevant_content_found": "找不到相关内容",
|
||||
"add_workspace": "添加工作空间",
|
||||
"administrator": "管理员",
|
||||
"ordinary_member": "普通成员",
|
||||
|
||||
@@ -8,7 +8,6 @@ import EmptyBackground from '@/views/dashboard/common/EmptyBackground.vue'
|
||||
import edit from '@/assets/svg/icon_edit_outlined.svg'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import ParamsForm from './ParamsForm.vue'
|
||||
import icon_add_outlined from '@/assets/svg/icon_add_outlined.svg'
|
||||
|
||||
interface Table {
|
||||
name: string
|
||||
|
||||
@@ -275,6 +275,7 @@ const back = () => {
|
||||
<EmptyBackground
|
||||
v-if="!!keywords && !datasourceListWithSearch.length"
|
||||
:description="$t('datasource.relevant_content_found')"
|
||||
class="datasource-yet"
|
||||
img-type="tree"
|
||||
/>
|
||||
|
||||
|
||||
@@ -463,10 +463,7 @@ defineExpose({
|
||||
>
|
||||
<div v-if="isCreate && activeStep !== 2" class="model-name">
|
||||
{{ activeName }}
|
||||
<span
|
||||
v-if="form.type !== 'excel'"
|
||||
style="margin-left: 8px; color: #8f959e; font-size: 12px; margin-top: 7px"
|
||||
>
|
||||
<span v-if="form.type !== 'excel'" style="margin-left: 8px; color: #8f959e; font-size: 12px">
|
||||
<span>{{ t('ds.form.support_version') }}: </span>
|
||||
<span v-if="form.type === 'sqlServer'">2012+</span>
|
||||
<span v-else-if="form.type === 'oracle'">12+</span>
|
||||
|
||||
@@ -440,8 +440,11 @@ const handleCurrentChange = (val: number) => {
|
||||
bottom: 0;
|
||||
border-top: 1px solid #1f232926;
|
||||
display: flex;
|
||||
background-color: #fff;
|
||||
align-items: center;
|
||||
padding-left: 24px;
|
||||
background-color: #fff;
|
||||
z-index: 10;
|
||||
|
||||
.danger-button {
|
||||
border: 1px solid var(--ed-color-danger);
|
||||
|
||||
@@ -442,9 +442,10 @@ const savePermission = () => {
|
||||
id,
|
||||
name,
|
||||
permissions: permissionsObj,
|
||||
users: isCreate.value
|
||||
? selectPermissionRef.value.checkedWorkspace.map((ele: any) => ele.id)
|
||||
: users,
|
||||
users:
|
||||
isCreate.value || activeStep.value === 1
|
||||
? selectPermissionRef.value.checkedWorkspace.map((ele: any) => ele.id)
|
||||
: users,
|
||||
}
|
||||
if (!id) {
|
||||
delete obj.id
|
||||
@@ -764,6 +765,7 @@ const columnRules = {
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('permission.set_rule')">
|
||||
<el-input
|
||||
v-if="ruleType !== 1"
|
||||
v-model="searchColumn"
|
||||
:placeholder="$t('permission.search_rule_group')"
|
||||
autocomplete="off"
|
||||
@@ -775,7 +777,9 @@ const columnRules = {
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<AuthTree v-if="ruleType === 1" ref="authTreeRef" @save="saveAuthTree"></AuthTree>
|
||||
<div v-if="ruleType === 1" class="auth-tree_content">
|
||||
<AuthTree ref="authTreeRef" @save="saveAuthTree"></AuthTree>
|
||||
</div>
|
||||
<div v-else class="table-content">
|
||||
<el-table
|
||||
:empty-text="$t('permission.no_fields_yet')"
|
||||
@@ -931,6 +935,17 @@ const columnRules = {
|
||||
padding-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.auth-tree_content {
|
||||
padding: 16px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid #dee0e3;
|
||||
min-height: 64px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
overflow-y: auto;
|
||||
margin-top: -16px;
|
||||
}
|
||||
}
|
||||
|
||||
.system-permission_user.system-permission_user {
|
||||
|
||||
@@ -131,19 +131,18 @@
|
||||
/>
|
||||
</template>
|
||||
</el-table>
|
||||
|
||||
<div class="pagination-container">
|
||||
<el-pagination
|
||||
v-model:current-page="state.pageInfo.currentPage"
|
||||
v-model:page-size="state.pageInfo.pageSize"
|
||||
:page-sizes="[10, 20, 30]"
|
||||
:background="true"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="state.pageInfo.total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pagination-container">
|
||||
<el-pagination
|
||||
v-model:current-page="state.pageInfo.currentPage"
|
||||
v-model:page-size="state.pageInfo.pageSize"
|
||||
:page-sizes="[10, 20, 30]"
|
||||
:background="true"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="state.pageInfo.total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div v-if="multipleSelectionAll.length" class="bottom-select">
|
||||
@@ -193,6 +192,7 @@
|
||||
<el-form-item prop="account" :label="t('user.account')">
|
||||
<el-input
|
||||
v-model="state.form.account"
|
||||
:disabled="!!state.form.id"
|
||||
:placeholder="$t('datasource.please_enter') + $t('common.empty') + $t('user.account')"
|
||||
autocomplete="off"
|
||||
/>
|
||||
@@ -316,6 +316,7 @@ const dialogVisiblePassword = ref(false)
|
||||
const isIndeterminate = ref(true)
|
||||
const drawerMainRef = ref()
|
||||
const userImportRef = ref()
|
||||
const selectionLoading = ref(false)
|
||||
const filterOption = ref<any[]>([
|
||||
{
|
||||
type: 'enum',
|
||||
@@ -359,7 +360,7 @@ const defaultForm = {
|
||||
account: '',
|
||||
oid: 0,
|
||||
email: '',
|
||||
status: '',
|
||||
status: 1,
|
||||
phoneNumber: '',
|
||||
oid_list: [],
|
||||
}
|
||||
@@ -451,7 +452,9 @@ const handleConfirmPassword = () => {
|
||||
})
|
||||
dialogVisiblePassword.value = false
|
||||
}
|
||||
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
if (selectionLoading.value) return
|
||||
const ids = state.tableData.map((ele: any) => ele.id)
|
||||
multipleSelectionAll.value = [
|
||||
...multipleSelectionAll.value.filter((ele) => !ids.includes(ele.id)),
|
||||
@@ -481,6 +484,7 @@ const handleToggleRowSelection = (check: boolean = true) => {
|
||||
}
|
||||
checkAll.value = i === state.tableData.length
|
||||
isIndeterminate.value = !(i === 0 || i === state.tableData.length)
|
||||
selectionLoading.value = false
|
||||
}
|
||||
const handleSearch = () => {
|
||||
search()
|
||||
@@ -541,6 +545,7 @@ const deleteBatchUser = () => {
|
||||
autofocus: false,
|
||||
}).then(() => {
|
||||
userApi.deleteBatch(multipleSelectionAll.value.map((ele) => ele.id)).then(() => {
|
||||
multipleSelectionAll.value = []
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: t('dashboard.delete_success'),
|
||||
@@ -557,13 +562,20 @@ const deleteHandler = (row: any) => {
|
||||
customClass: 'confirm-no_icon',
|
||||
autofocus: false,
|
||||
}).then(() => {
|
||||
userApi.delete(row.id).then(() => {
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: t('dashboard.delete_success'),
|
||||
})
|
||||
search()
|
||||
multipleSelectionAll.value = multipleSelectionAll.value.filter((ele) => ele.id !== row.id)
|
||||
ElMessage({
|
||||
type: 'success',
|
||||
message: t('dashboard.delete_success'),
|
||||
})
|
||||
search()
|
||||
// userApi.delete(row.id).then(() => {
|
||||
// multipleSelectionAll.value = multipleSelectionAll.value.filter((ele) => ele.id !== row.id)
|
||||
// ElMessage({
|
||||
// type: 'success',
|
||||
// message: t('dashboard.delete_success'),
|
||||
// })
|
||||
// search()
|
||||
// })
|
||||
})
|
||||
}
|
||||
|
||||
@@ -613,7 +625,7 @@ const search = () => {
|
||||
.then((res: any) => {
|
||||
state.tableData = res.items
|
||||
state.pageInfo.total = res.total
|
||||
|
||||
selectionLoading.value = true
|
||||
nextTick(() => {
|
||||
handleToggleRowSelection()
|
||||
})
|
||||
@@ -692,11 +704,13 @@ onMounted(() => {
|
||||
height: 64px;
|
||||
width: calc(100% + 48px);
|
||||
left: -24px;
|
||||
background-color: #fff;
|
||||
bottom: 0;
|
||||
border-top: 1px solid #1f232926;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-left: 24px;
|
||||
z-index: 10;
|
||||
|
||||
.danger-button {
|
||||
border: 1px solid var(--ed-color-danger);
|
||||
@@ -734,12 +748,8 @@ onMounted(() => {
|
||||
.sqlbot-table {
|
||||
border-radius: 6px;
|
||||
width: 100%;
|
||||
max-height: calc(100vh - 100px);
|
||||
max-height: calc(100vh - 150px);
|
||||
overflow-y: auto;
|
||||
|
||||
&.is-filter {
|
||||
max-height: calc(100vh - 256px);
|
||||
}
|
||||
:deep(.ed-table) {
|
||||
--el-table-header-bg-color: #f5f7fa;
|
||||
--el-table-border-color: #ebeef5;
|
||||
@@ -795,12 +805,13 @@ onMounted(() => {
|
||||
}
|
||||
}
|
||||
}
|
||||
.pagination-container {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
align-items: center;
|
||||
margin-top: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.pagination-container {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
align-items: center;
|
||||
margin-top: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ const open = async (id: any) => {
|
||||
checkAll.value = false
|
||||
isIndeterminate.value = false
|
||||
const systemWorkspaceList = await workspaceOptionUserList({ oid }, 1, 1000)
|
||||
workspace.value = systemWorkspaceList.items as any
|
||||
workspace.value = systemWorkspaceList.items.filter((ele: any) => +ele.id !== 1) as any
|
||||
loading.value = false
|
||||
centerDialogVisible.value = true
|
||||
}
|
||||
@@ -203,7 +203,8 @@ defineExpose({
|
||||
}
|
||||
|
||||
.w-full {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
width: 50%;
|
||||
overflow-y: auto;
|
||||
|
||||
.flex-between {
|
||||
@@ -239,6 +240,8 @@ defineExpose({
|
||||
|
||||
.border-r {
|
||||
border-right: 1px solid #dee0e3;
|
||||
width: 50%;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -30,6 +30,7 @@ const multipleSelectionAll = ref<any[]>([])
|
||||
const tableList = ref([] as any[])
|
||||
const keyword = ref('')
|
||||
const keywordsMember = ref('')
|
||||
const oldKeywordsMember = ref('')
|
||||
const workspaceFormRef = ref()
|
||||
const authorizedWorkspaceDialog = ref()
|
||||
const tableListWithSearch = computed(() => {
|
||||
@@ -210,8 +211,9 @@ const search = () => {
|
||||
pageInfo.currentPage,
|
||||
pageInfo.pageSize
|
||||
).then((res) => {
|
||||
fieldList.value = res.items
|
||||
fieldList.value = res.items.sort((a: any, b: any) => b.weight - a.weight)
|
||||
pageInfo.total = res.total
|
||||
oldKeywordsMember.value = keywordsMember.value
|
||||
})
|
||||
}
|
||||
|
||||
@@ -342,7 +344,7 @@ const handleCurrentChange = (val: number) => {
|
||||
</el-popover>
|
||||
</div>
|
||||
<div v-if="!!keyword && !tableListWithSearch.length" class="no-result">
|
||||
{{ $t('workspace.historical_dialogue') }}
|
||||
{{ $t('workspace.relevant_content_found') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -463,31 +465,31 @@ const handleCurrentChange = (val: number) => {
|
||||
</el-table-column>
|
||||
<template #empty>
|
||||
<EmptyBackground
|
||||
v-if="!keywordsMember && !fieldListWithSearch.length"
|
||||
v-if="!oldKeywordsMember && !fieldListWithSearch.length"
|
||||
:description="$t('workspace.no_user')"
|
||||
img-type="noneWhite"
|
||||
/>
|
||||
|
||||
<EmptyBackground
|
||||
v-if="!!keywordsMember && !fieldListWithSearch.length"
|
||||
v-if="!!oldKeywordsMember && !fieldListWithSearch.length"
|
||||
:description="$t('datasource.relevant_content_found')"
|
||||
img-type="tree"
|
||||
/>
|
||||
</template>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="pagination-container">
|
||||
<el-pagination
|
||||
v-model:current-page="pageInfo.currentPage"
|
||||
v-model:page-size="pageInfo.pageSize"
|
||||
:page-sizes="[10, 20, 30]"
|
||||
:background="true"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="pageInfo.total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pagination-container">
|
||||
<el-pagination
|
||||
v-model:current-page="pageInfo.currentPage"
|
||||
v-model:page-size="pageInfo.pageSize"
|
||||
:page-sizes="[10, 20, 30]"
|
||||
:background="true"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="pageInfo.total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
</div>
|
||||
<div v-if="multipleSelectionAll.length" class="bottom-select">
|
||||
<el-checkbox
|
||||
@@ -700,16 +702,17 @@ const handleCurrentChange = (val: number) => {
|
||||
}
|
||||
}
|
||||
|
||||
.pagination-container {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
align-items: center;
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.table-content {
|
||||
padding: 0 24px 16px 24px;
|
||||
height: calc(100% - 104px);
|
||||
|
||||
.pagination-container {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
align-items: center;
|
||||
margin-top: 16px;
|
||||
}
|
||||
height: calc(100% - 168px);
|
||||
overflow-y: auto;
|
||||
|
||||
.preview-or-schema {
|
||||
:deep(.user-source) {
|
||||
@@ -779,7 +782,9 @@ const handleCurrentChange = (val: number) => {
|
||||
border-top: 1px solid #1f232926;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #fff;
|
||||
padding-left: 24px;
|
||||
z-index: 10;
|
||||
|
||||
.danger-button {
|
||||
border: 1px solid var(--ed-color-danger);
|
||||
|
||||
Reference in New Issue
Block a user