Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 更改资源配置确认页表格空状态 #859

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,12 @@
</bk-button>
</template>
</bk-table-column>
<template #empty>
<TableEmpty
:keyword="keyword"
@clear-filter="handleClearFilter"
/>
</template>
</bk-table>
</template>

Expand All @@ -179,6 +185,7 @@ import { ref, toRefs } from 'vue';
import { useI18n } from 'vue-i18n';
import { MethodsEnum } from '@/types';
import useTextGetter from '@/views/resource/setting/hooks/useTextGetter';
import TableEmpty from '@/components/table-empty.vue';

const {
getAuthConfigText,
Expand All @@ -194,12 +201,14 @@ interface IProps {
tableData: ILocalImportedResource[];
showDoc: boolean;
action: ActionType;
keyword: string;
}

const props = withDefaults(defineProps<IProps>(), {
tableData: () => [],
showDoc: true,
action: 'add',
keyword: '',
});

const emit = defineEmits<{
Expand All @@ -209,6 +218,7 @@ const emit = defineEmits<{
'toggle-row-unchecked': [row: ILocalImportedResource]
'confirm-auth-config': [action: ActionType]
'confirm-pub-config': [action: ActionType]
'clear-filter': [action: ActionType]
}>();

const tempAuthConfig = defineModel<IAuthConfig>('tempAuthConfig', {
Expand All @@ -223,6 +233,7 @@ const {
tableData,
showDoc,
action,
keyword,
} = toRefs(props);

const pagination = ref({
Expand Down Expand Up @@ -260,6 +271,11 @@ const handleCancelAuthConfig = () => {
}
};

// 点击清空搜索条件后
const handleClearFilter = () => {
emit('clear-filter', action.value);
};

// 批量修改公开设置确认后
const handleConfirmPublicConfig = () => {
emit('confirm-pub-config', action.value);
Expand Down
17 changes: 17 additions & 0 deletions src/dashboard-front/src/views/resource/setting/import.vue
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@
action="add"
:table-data="tableDataToAdd"
:show-doc="showDoc"
:keyword="filterInputAddClone"
v-model:tempAuthConfig="tempAuthConfig"
v-model:tempPublicConfig="tempPublicConfig"
@show-row-doc="handleShowResourceDoc"
Expand All @@ -272,6 +273,7 @@
@toggle-row-unchecked="toggleRowUnchecked"
@confirm-auth-config="handleConfirmAuthConfigPopConfirm"
@confirm-pub-config="handleConfirmPublicConfigPopConfirm"
@clear-filter="clearFilterInput"
></TableResToAction>
</div>
</template>
Expand Down Expand Up @@ -317,6 +319,7 @@
<TableResToAction
action="update"
:table-data="tableDataToUpdate"
:keyword="filterInputUpdateClone"
v-model:tempAuthConfig="tempAuthConfig"
v-model:tempPublicConfig="tempPublicConfig"
@show-row-doc="handleShowResourceDoc"
Expand All @@ -325,6 +328,7 @@
@toggle-row-unchecked="toggleRowUnchecked"
@confirm-auth-config="handleConfirmAuthConfigPopConfirm"
@confirm-pub-config="handleConfirmPublicConfigPopConfirm"
@clear-filter="clearFilterInput"
></TableResToAction>
</div>
</template>
Expand Down Expand Up @@ -1216,6 +1220,7 @@ const filterInputAdd = ref('');
const filterInputAddClone = ref('');
const filterInputUpdate = ref('');
const filterInputUpdateClone = ref('');

const filterData = (action: ActionType) => {
if (action === 'add') {
filterInputAdd.value = filterInputAddClone.value;
Expand All @@ -1226,6 +1231,18 @@ const filterData = (action: ActionType) => {
}
};

const clearFilterInput = (action: ActionType) => {
if (action === 'add') {
filterInputAdd.value = '';
filterInputAddClone.value = '';
}

if (action === 'update') {
filterInputUpdate.value = '';
filterInputUpdateClone.value = '';
}
};

const editorWrapRef = ref<HTMLElement | null>(null);
// 编辑器全屏
const handleFullScreenClick = () => {
Expand Down
Loading