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: 修复体验问题 #20

Merged
merged 1 commit into from
Mar 20, 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 @@ -1099,6 +1099,9 @@ watch(
}
}
.apigw-access-manager-slider-cls {
:deep(.bk-modal-content) {
overflow-y: auto;
}
.tips {
line-height: 24px;
font-size: 12px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@
@page-limit-change="handlePageLimitChange"
@select-all="handleSelectAll"
@selection-change="handleResourceSelect">
<!-- <div slot="empty">
<table-empty
:keyword="tableEmptyConf.keyword"
@clear-filter="clearFilterKey"
/>
</div> -->
<bk-table-column align="center" width="40">
<template #default="{ row }">
<div :class="['play-shape', row.isIconView ? 'icon-view' : 'icon-conceal']" v-if="row.dimension !== 'api'">
Expand Down Expand Up @@ -128,13 +122,21 @@
</bk-pop-confirm>
</template>
</bk-table-column>
<template #empty>
<TableEmpty
:keyword="tableEmptyConf.keyword"
:abnormal="tableEmptyConf.isAbnormal"
@reacquire="getTableData"
@clear-filter="handleClearFilterKey"
/>
</template>
</bk-table>
</bk-loading>

<bk-sideslider
:title="resourceSliderConf.title"
:width="800"
:is-show="resourceSliderConf.isShow"
v-model:isShow="resourceSliderConf.isShow"
:quick-close="true"
:before-close="handleBeforeClose"
@hidden="sidesliderHidden">
Expand Down Expand Up @@ -237,6 +239,7 @@ import { useI18n } from 'vue-i18n';
import { Message, InfoBox } from 'bkui-vue';
import { useSidebar } from '@/hooks';
import { getResources } from '@/http';
import TableEmpty from '@/components/table-empty.vue';

const { initSidebarFormData, isSidebarClosed/* , isBackDialogShow */ } = useSidebar();

Expand Down Expand Up @@ -311,8 +314,9 @@ const rules = reactive<any>({
},
],
});
const tableEmptyConf = reactive<any>({
const tableEmptyConf = ref<{ keyword: string; isAbnormal: boolean }>({
keyword: '',
isAbnormal: false,
});
const sourceEl = ref<any>(null);

Expand Down Expand Up @@ -340,13 +344,16 @@ const handleBeforeClose = async () => {
// 添加
const initData: any = {
...curResource,
manner,
manner: manner.value,
};
// 编辑
if (resourceSliderConf.type === 'edit') {
initData.resourceIds = resourceIds;
initData.resourceIds = resourceIds.value;
}
return isSidebarClosed(JSON.stringify(initData));

isSidebarClosed(JSON.stringify(initData)).then((close) => {
resourceSliderConf.isShow = !close;
});
};

const removeResourceScroll = () => {
Expand All @@ -372,16 +379,23 @@ const handleResourceScroll = async () => {
};

const updateTableEmptyConfig = () => {
tableEmptyConf.keyword = searchFilters.value.length ? 'placeholder' : '';
tableEmptyConf.value.isAbnormal = pagination.abnormal;
if (searchFilters.value?.length || !pagingList.value.length) {
tableEmptyConf.value.keyword = 'placeholder';
return;
}
if (searchFilters.value?.length) {
tableEmptyConf.value.keyword = '$CONSTANT';
return;
}
tableEmptyConf.value.keyword = '';
};

// const clearFilterKey = () => {
// searchFilters.value = [];
// searchParams.value = {
// bk_app_code: '',
// resource_id: '',
// };
// };
const handleClearFilterKey = () => {
searchFilters.value = [];
getTableData();
updateTableEmptyConfig();
};

const getResourcesViewWidth = () => {
nextTick(() => {
Expand Down Expand Up @@ -583,6 +597,10 @@ const handlerDeletePolicy = (data: any) => {
}
getSearchDataList();
getTableData();
Message({
theme: 'success',
message: t('删除成功'),
});
};

const handlerUpdatePolicy = () => {
Expand All @@ -596,6 +614,10 @@ const handlerUpdatePolicy = () => {
});
handleHideResourceSlider();
getTableData();
Message({
theme: 'success',
message: t('编辑成功'),
});
confirmLoading.value = false;
};

Expand All @@ -611,6 +633,10 @@ const handlerAddPolicy = () => {
});
handleHideResourceSlider();
getTableData();
Message({
theme: 'success',
message: t('新增成功'),
});
confirmLoading.value = false;
};

Expand Down Expand Up @@ -719,7 +745,7 @@ const handleAddResource = () => {
// 添加
const initData = {
...curResource,
manner,
manner: manner.value,
};
initSidebarFormData(initData);
};
Expand All @@ -738,8 +764,8 @@ const handleEditResource = (data: any) => {
// 编辑需要添加资源选择对比
const initData = {
...curResource,
manner,
resourceIds,
manner: manner.value,
resourceIds: resourceIds.value,
};
initSidebarFormData(initData);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ watch(
}
.sideslider-lf-ul {
height: calc(100% - 94px);
overflow-y: scroll;
overflow-y: auto;
.search-empty-tips {
font-size: 12px;
margin-top: 8px;
Expand Down Expand Up @@ -541,7 +541,7 @@ watch(
padding: 24px 24px 0px;
box-sizing: border-box;
height: calc(100vh - 52px);
overflow-y: scroll;
overflow-y: auto;
.log-name {
font-size: 12px;
color: #63656e;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ defineExpose({
padding: 24px 24px 0px;
box-sizing: border-box;
height: calc(100vh - 52px);
overflow-y: scroll;
overflow-y: auto;
.log-name {
font-size: 12px;
color: #63656e;
Expand Down