77 lines
2.3 KiB
Vue
77 lines
2.3 KiB
Vue
![]() |
<template>
|
||
|
<div class="detail-popup">
|
||
|
<popup ref="popupRef" title="日程安排详情" :async="true" width="550px" @confirm="handleSubmit" @close="handleClose">
|
||
|
<el-descriptions :column="1" border>
|
||
|
<el-descriptions-item label="工作安排主题" label-align="left" align="left" label-class-name="my-label">
|
||
|
{{ formData.title }}
|
||
|
</el-descriptions-item>
|
||
|
<el-descriptions-item label="日程优先级" label-align="left" align="left" label-class-name="my-label">
|
||
|
{{ formData.type_text }}
|
||
|
</el-descriptions-item>
|
||
|
<el-descriptions-item label="开始时间" label-align="left" align="left" label-class-name="my-label">
|
||
|
{{ formData.start_time }}
|
||
|
</el-descriptions-item>
|
||
|
<el-descriptions-item label="结束时间" label-align="left" align="left" label-class-name="my-label">
|
||
|
{{ formData.end_time }}
|
||
|
</el-descriptions-item>
|
||
|
<el-descriptions-item label="提醒类型" label-align="left" align="left" label-class-name="my-label">
|
||
|
{{ formData.remind_type_text }}
|
||
|
</el-descriptions-item>
|
||
|
<el-descriptions-item label="描述" label-align="left" align="left" label-class-name="my-label">
|
||
|
{{ formData.remark }}
|
||
|
</el-descriptions-item>
|
||
|
</el-descriptions>
|
||
|
</popup>
|
||
|
</div>
|
||
|
</template>
|
||
|
|
||
|
<script lang="ts" setup name="customdetail">
|
||
|
import Popup from '@/components/popup/index.vue'
|
||
|
import type { PropType } from 'vue'
|
||
|
|
||
|
const emit = defineEmits(['close'])
|
||
|
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||
|
|
||
|
// 表单数据
|
||
|
const formData = reactive({
|
||
|
|
||
|
})
|
||
|
|
||
|
// 获取详情
|
||
|
const setFormData = async (data: Record<any, any>) => {
|
||
|
for (const key in data) {
|
||
|
if (data[key] != null && data[key] != undefined) {
|
||
|
//@ts-ignore
|
||
|
formData[key] = data[key]
|
||
|
}
|
||
|
}
|
||
|
console.log(formData, 'formData')
|
||
|
}
|
||
|
|
||
|
|
||
|
// 提交按钮
|
||
|
const handleSubmit = async () => {
|
||
|
popupRef.value?.close()
|
||
|
|
||
|
}
|
||
|
|
||
|
//打开弹窗
|
||
|
const open = () => {
|
||
|
popupRef.value?.open()
|
||
|
}
|
||
|
|
||
|
// 关闭回调
|
||
|
const handleClose = () => {
|
||
|
emit('close')
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
defineExpose({
|
||
|
open,
|
||
|
setFormData,
|
||
|
})
|
||
|
</script>
|
||
|
|