parent
358914b488
commit
e8e71448b1
3 changed files with 67 additions and 88 deletions
@ -1,65 +0,0 @@ |
|||||||
<script setup> |
|
||||||
import {onBeforeMount, ref, computed} from "vue"; |
|
||||||
import {useStore} from "vuex"; |
|
||||||
import {prd_history} from '@/apis/product.js'; |
|
||||||
|
|
||||||
// 定义数据源 |
|
||||||
const history_data = ref([]) |
|
||||||
|
|
||||||
// 注册store |
|
||||||
const store = useStore() |
|
||||||
|
|
||||||
// 注册props |
|
||||||
const props = defineProps({ |
|
||||||
id: { |
|
||||||
type: Number, |
|
||||||
required: true, |
|
||||||
default: 1 |
|
||||||
} |
|
||||||
}) |
|
||||||
|
|
||||||
const handleOpen = () => { |
|
||||||
get_history(props.id); |
|
||||||
} |
|
||||||
|
|
||||||
const handleClose = () => { |
|
||||||
store.state.updateModule.update_dialog_show = false |
|
||||||
} |
|
||||||
|
|
||||||
// 通过接口获取历史数据 |
|
||||||
async function get_history(id) { |
|
||||||
await prd_history(id).then(res => { |
|
||||||
console.log('get_history') |
|
||||||
if (Array.isArray(res)) { |
|
||||||
history_data.value = [...res] |
|
||||||
} |
|
||||||
}).catch(err => { |
|
||||||
console.log(err) |
|
||||||
}); |
|
||||||
} |
|
||||||
|
|
||||||
// onBeforeMount( |
|
||||||
// async () => { |
|
||||||
// await get_history(props.id); |
|
||||||
// } |
|
||||||
// ) |
|
||||||
|
|
||||||
</script> |
|
||||||
|
|
||||||
<template> |
|
||||||
<el-dialog v-model="store.state.prdModule.history_dialog_show" title="历史记录" :modal="true" width="720px" |
|
||||||
:close-on-click-modal="false" @open="handleOpen" @close="handleClose"> |
|
||||||
<el-table> |
|
||||||
<el-table-column prop="update_at" label="版本发布日期"> |
|
||||||
|
|
||||||
</el-table-column> |
|
||||||
<el-table-column prop="history_doc_link" label="产品原型链接"> |
|
||||||
|
|
||||||
</el-table-column> |
|
||||||
</el-table> |
|
||||||
</el-dialog> |
|
||||||
</template> |
|
||||||
|
|
||||||
<style scoped> |
|
||||||
|
|
||||||
</style> |
|
Loading…
Reference in new issue