mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-05-27 11:10:13 +08:00
add the pivot select radio for diff table
This commit is contained in:
@@ -9,7 +9,10 @@
|
||||
:label="item.label"
|
||||
>
|
||||
<template #header>
|
||||
{{ dayjs(item.value).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
<div class="diff-table-header">
|
||||
{{ dayjs(item.value).format('YYYY-MM-DD HH:mm:ss') }}
|
||||
<el-radio v-model="diffPivot" :label="index">作为diff基准</el-radio>
|
||||
</div>
|
||||
</template>
|
||||
<template #default="{ row }">
|
||||
<div class="of-auto">
|
||||
@@ -22,7 +25,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { PropType, computed } from 'vue'
|
||||
import { PropType, computed, ref, watch } from 'vue'
|
||||
import { type VChatStartupLog } from '@geekgeekrun/sqlite-plugin/src/entity/VChatStartupLog'
|
||||
import { JobInfoChangeLog } from '@geekgeekrun/sqlite-plugin/src/entity/JobInfoChangeLog'
|
||||
import { ElTable, ElTableColumn } from 'element-plus'
|
||||
@@ -75,6 +78,18 @@ const dataForRender = computed(() => {
|
||||
})
|
||||
return newArr
|
||||
})
|
||||
|
||||
const diffPivot = ref(0)
|
||||
watch(
|
||||
() => props.jobInfoHistoryList,
|
||||
() => {
|
||||
if (!props.jobInfoHistoryList.length) {
|
||||
diffPivot.value = 0
|
||||
return
|
||||
}
|
||||
diffPivot.value = props.jobInfoHistoryList.length - 1
|
||||
}
|
||||
)
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@@ -83,5 +98,11 @@ const dataForRender = computed(() => {
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
.diff-table-header {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
<style lang="scss"></style>
|
||||
|
||||
@@ -187,7 +187,7 @@ async function handleViewJobHistoryButtonClick(record: VChatStartupLog) {
|
||||
// return {}
|
||||
// }
|
||||
// })(),
|
||||
// __ggr_updateTime: new Date(it.updateTime)
|
||||
// __ggr_updateTime: it.updateTime
|
||||
// }))
|
||||
const { data: historyList } = await Promise.resolve({
|
||||
data: [
|
||||
@@ -221,7 +221,7 @@ async function handleViewJobHistoryButtonClick(record: VChatStartupLog) {
|
||||
return {}
|
||||
}
|
||||
})(),
|
||||
__ggr_updateTime: new Date(it.updateTime)
|
||||
__ggr_updateTime: it.updateTime
|
||||
}))
|
||||
})
|
||||
historyDialogVisibleModelValue.value = true
|
||||
|
||||
Reference in New Issue
Block a user