diff --git a/src/dashboard-front/src/views/resource/setting/comps/table-res-to-action.vue b/src/dashboard-front/src/views/resource/setting/comps/table-res-to-action.vue index 4989a6723..15e129cfe 100644 --- a/src/dashboard-front/src/views/resource/setting/comps/table-res-to-action.vue +++ b/src/dashboard-front/src/views/resource/setting/comps/table-res-to-action.vue @@ -165,6 +165,12 @@ + @@ -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, @@ -194,12 +201,14 @@ interface IProps { tableData: ILocalImportedResource[]; showDoc: boolean; action: ActionType; + keyword: string; } const props = withDefaults(defineProps(), { tableData: () => [], showDoc: true, action: 'add', + keyword: '', }); const emit = defineEmits<{ @@ -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('tempAuthConfig', { @@ -223,6 +233,7 @@ const { tableData, showDoc, action, + keyword, } = toRefs(props); const pagination = ref({ @@ -260,6 +271,11 @@ const handleCancelAuthConfig = () => { } }; +// 点击清空搜索条件后 +const handleClearFilter = () => { + emit('clear-filter', action.value); +}; + // 批量修改公开设置确认后 const handleConfirmPublicConfig = () => { emit('confirm-pub-config', action.value); diff --git a/src/dashboard-front/src/views/resource/setting/import.vue b/src/dashboard-front/src/views/resource/setting/import.vue index ad78a3d6b..036aac299 100644 --- a/src/dashboard-front/src/views/resource/setting/import.vue +++ b/src/dashboard-front/src/views/resource/setting/import.vue @@ -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" @@ -272,6 +273,7 @@ @toggle-row-unchecked="toggleRowUnchecked" @confirm-auth-config="handleConfirmAuthConfigPopConfirm" @confirm-pub-config="handleConfirmPublicConfigPopConfirm" + @clear-filter="clearFilterInput" > @@ -317,6 +319,7 @@ @@ -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; @@ -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(null); // 编辑器全屏 const handleFullScreenClick = () => {