Skip to content

Commit

Permalink
Merge pull request #280 from caofengbin/feature/optimizationPublicSte…
Browse files Browse the repository at this point in the history
…pPage

【feat】优化公共步骤页面的打开速度
  • Loading branch information
ZhouYixun authored Jun 4, 2024
2 parents bc72aa4 + 3b40695 commit d13e983
Showing 1 changed file with 21 additions and 2 deletions.
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

0 comments on commit d13e983

Please sign in to comment.