mirror of https://github.com/certd/certd
perf: 历史记录查看详情,可以切换到对应的历史记录日志上去
parent
efa9c748c5
commit
082802e119
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<fs-page class="fs-pipeline-detail">
|
<fs-page class="fs-pipeline-detail">
|
||||||
<pipeline-edit v-model:edit-mode="editMode" :pipeline-id="pipelineId" :options="pipelineOptionsRef"></pipeline-edit>
|
<pipeline-edit v-model:edit-mode="editMode" :pipeline-id="pipelineId" :history-id="historyId" :options="pipelineOptionsRef"></pipeline-edit>
|
||||||
<a-tour v-bind="tour" v-model:current="tour.current" />
|
<a-tour v-bind="tour" v-model:current="tour.current" />
|
||||||
</fs-page>
|
</fs-page>
|
||||||
</template>
|
</template>
|
||||||
|
@ -22,7 +22,7 @@ defineOptions({
|
||||||
});
|
});
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const pipelineId: Ref = ref(route.query.id);
|
const pipelineId: Ref = ref(route.query.id);
|
||||||
|
const historyId = ref(route.query.historyId);
|
||||||
const pipelineOptions: PipelineOptions = {
|
const pipelineOptions: PipelineOptions = {
|
||||||
async getPipelineDetail({ pipelineId }) {
|
async getPipelineDetail({ pipelineId }) {
|
||||||
const detail = await api.GetDetail(pipelineId);
|
const detail = await api.GetDetail(pipelineId);
|
||||||
|
|
|
@ -274,6 +274,10 @@ export default defineComponent({
|
||||||
type: [Number, String],
|
type: [Number, String],
|
||||||
default: 0
|
default: 0
|
||||||
},
|
},
|
||||||
|
historyId: {
|
||||||
|
type: [Number, String],
|
||||||
|
default: 0
|
||||||
|
},
|
||||||
editMode: {
|
editMode: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
|
@ -333,6 +337,16 @@ export default defineComponent({
|
||||||
histories.value = historyList;
|
histories.value = historyList;
|
||||||
|
|
||||||
if (historyList.length > 0) {
|
if (historyList.length > 0) {
|
||||||
|
if (props.historyId > 0) {
|
||||||
|
const found = historyList.find((item) => {
|
||||||
|
//字符串==int
|
||||||
|
return item.id == props.historyId;
|
||||||
|
});
|
||||||
|
if (found) {
|
||||||
|
await changeCurrentHistory(found);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (historyList[0].pipeline?.version === pipeline.value.version) {
|
if (historyList[0].pipeline?.version === pipeline.value.version) {
|
||||||
await changeCurrentHistory(historyList[0]);
|
await changeCurrentHistory(historyList[0]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,7 @@ export class HistoryController extends CrudController<HistoryService> {
|
||||||
return this.ok([]);
|
return this.ok([]);
|
||||||
}
|
}
|
||||||
const buildQuery = qb => {
|
const buildQuery = qb => {
|
||||||
qb.limit(10);
|
qb.limit(20);
|
||||||
};
|
};
|
||||||
const listRet = await this.getService().list({
|
const listRet = await this.getService().list({
|
||||||
query: body,
|
query: body,
|
||||||
|
|
Loading…
Reference in New Issue