TaskDetailPreviewModal.vue
1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<template>
<div>
<BasicModal
v-bind="$attrs"
width="80rem"
:height="heightNum"
@register="register"
title="任务详细信息"
@cancel="handleCancel"
:showOkBtn="false"
style="font-size: 12px"
>
<div>
<Description :column="3" size="middle" @register="registeDesc" />
</div>
</BasicModal>
</div>
</template>
<script setup lang="ts">
import { ref, nextTick, reactive } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { personSchema } from './config.data';
import { Description } from '/@/components/Description/index';
import { useDescription } from '/@/components/Description';
import { schedueQueryCornTimeApi, schedueCheckCornApi } from '/@/api/schedue/schedueManager';
const heightNum = ref(800);
const timeData: any = ref([]);
let personData = reactive({});
const [registeDesc, { setDescProps }] = useDescription({
data: personData,
schema: personSchema,
column: 3,
});
const [register] = useModalInner(async (data) => {
const cronStr = {
cron: data.record?.cronExpression,
};
const resuCheck = await schedueCheckCornApi(cronStr);
if (resuCheck) {
const resu = await schedueQueryCornTimeApi(cronStr);
timeData.value = resu.data;
}
nextTick(() => {
//回显
for (let i in data.record) {
Reflect.set(personData, i, data.record[i]);
}
setDescProps(personData);
Reflect.set(personData, 'updateTime', timeData.value.join(','));
});
});
const handleCancel = () => {};
</script>
<style lang="less" scoped>
:deep(.vben-basic-title-normal) {
font-size: 16px;
font-weight: 500;
}
:deep(.vben-collapse-container__header) {
border-bottom: none;
}
:deep(.ant-descriptions-item-label) {
width: 30rem;
}
:deep(.ant-descriptions-item-content) {
width: 45rem;
}
</style>