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

【feat】优化公共步骤页面的打开速度 #280

Merged
Merged
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
23 changes: 21 additions & 2 deletions src/views/PublicStep.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,25 @@ const deletePublicStep = (id) => {
}
});
};
const curShowPublicStep = ref({
id: null,
projectId: route.params.projectId,
platform: 0,
name: '',
steps: [],
});
/**
* 点击列表上的某个公共元素信息之后,再拉取单个公共步骤的子步骤信息
* @param id 公共步骤id
*/
const getPublicStepInfo = (id) => {
curShowPublicStep.value.steps = [];
axios.get('/controller/publicSteps', { params: { id } }).then((resp) => {
if (resp.code === 2000) {
curShowPublicStep.value = resp.data;
}
});
};
onMounted(() => {
getPublicStepList();
});
Expand Down Expand Up @@ -124,9 +143,9 @@ onMounted(() => {
>
<template #default="scope">
<el-popover placement="left" :width="700" trigger="click">
<child-step-list-view :steps="scope.row.steps" />
<child-step-list-view :steps="curShowPublicStep.steps" />
<template #reference>
<el-button size="mini">{{
<el-button size="mini" @click="getPublicStepInfo(scope.row.id)">{{
$t('publicStepTS.viewSteps')
}}</el-button>
</template>
Expand Down