Skip to content

Commit

Permalink
fix(frontend): 单据详情轮询时取消 loading 效果 #6877
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 18182
  • Loading branch information
hLinx authored and iSecloud committed Sep 12, 2024
1 parent c7c0266 commit 48c45a9
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@
}, { immediate: true, deep: true });

watch(() => props.clusterId, () => {
fetchResources();
fetchResources();
});

const triggerChange = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
}
interface Props {
data: TicketDetails<T>;
data: TicketDetails<any>;
config: DemandInfoConfig[];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,20 +147,21 @@
),
})
}

config[2].list.splice(3, 0, {
if (nodes){
config[2].list.splice(3, 0, {
label: t('集群设置'),
isTable: true,
render: () => (
<PreviewTable
data={tableData.value}
is-show-nodes={!isFromResourcePool}
is-single-type={isSingleType}
max-height={240}
min-height={0}
nodeList={nodes[ClusterTypes.SQLSERVER_HA]} />
),
})
<PreviewTable
data={tableData.value}
is-show-nodes={!isFromResourcePool}
is-single-type={isSingleType}
max-height={240}
min-height={0}
nodeList={nodes[ClusterTypes.SQLSERVER_HA]} />
),
})
}

const cityName = ref('--');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
})
}

if (nodes){
config[2].list.splice(3, 0, {
label: t('集群设置'),
isTable: true,
Expand All @@ -142,6 +143,7 @@
nodeList={nodes[ClusterTypes.SQLSERVER_SINGLE]} />
),
})
}

const cityName = ref('--');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
:class="{ 'tickets-main-is-fullscreen': isFullscreen }"
mode="collapse"
:title="t('需求信息')">
<DemandInfo
:data="ticketData"
:is-loading="isLoading" />
<DemandInfo :data="ticketData" />
<div class="ticket-details-item">
<span class="ticket-details-item-label">{{ t('备注') }}:</span>
<span class="ticket-details-item-value">{{ ticketData.remark || '--' }}</span>
Expand Down Expand Up @@ -86,19 +84,17 @@

const isFullscreen = ref<boolean>(Boolean(route.query.isFullscreen));
const demandCollapse = ref(false);
const isLoading = ref(true);
const flowInfoRef = ref<InstanceType<typeof FlowInfo>>();

const {
run: fetchTicketDetails,
data: ticketData,
loading: isLoading,
} = useRequest(
const { run: fetchTicketDetails, data: ticketData } = useRequest(
(params: ServiceParameters<typeof getTicketDetails>) =>
getTicketDetails(params, {
permission: 'catch',
}),
{
onSuccess(_, params) {
isLoading.value = false;
if (params[0].id !== props.ticketId) {
return;
}
Expand All @@ -117,6 +113,7 @@
() => props.ticketId,
() => {
if (props.ticketId) {
isLoading.value = true;
ticketData.value = undefined;
fetchTicketDetails({
id: props.ticketId,
Expand Down

0 comments on commit 48c45a9

Please sign in to comment.