2024-02-05 09:15:37 +08:00
|
|
|
<template>
|
|
|
|
|
<span @click.stop="look"
|
|
|
|
|
><slot></slot>
|
|
|
|
|
<LoadingBox v-if="showLoading" />
|
|
|
|
|
<ProcessLayout class="wrap" v-if="visible" @click.stop="">
|
|
|
|
|
<template #title> {{ t('查看流程') }} </template>
|
|
|
|
|
<template #close>
|
|
|
|
|
<a-button type="primary" class="clean-icon" @click.stop="close">{{ t('关闭') }}</a-button>
|
|
|
|
|
</template>
|
|
|
|
|
<template #full>
|
2025-04-16 15:22:44 +08:00
|
|
|
<LookTask v-if="visible" :taskId="props.taskId" :processId="props.processId" :schemaId="props.schemaId"/>
|
2024-02-05 09:15:37 +08:00
|
|
|
</template>
|
|
|
|
|
</ProcessLayout>
|
|
|
|
|
</span>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import ProcessLayout from './flow/Layout.vue';
|
|
|
|
|
import LookTask from './flow/LookTask.vue';
|
|
|
|
|
import { LoadingBox } from '/@/components/ModalPanel/index';
|
|
|
|
|
import { notification } from 'ant-design-vue';
|
2025-02-25 18:42:40 +08:00
|
|
|
import { onActivated, onMounted, ref } from 'vue';
|
2024-02-05 09:15:37 +08:00
|
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
|
|
const { t } = useI18n();
|
2025-04-16 15:22:44 +08:00
|
|
|
const props = withDefaults(
|
|
|
|
|
defineProps<{
|
|
|
|
|
processId: string;
|
|
|
|
|
taskId: string;
|
|
|
|
|
schemaId: string;
|
|
|
|
|
visible?: boolean;
|
|
|
|
|
}>(),
|
|
|
|
|
{
|
|
|
|
|
processId: '',
|
|
|
|
|
taskId: '',
|
|
|
|
|
schemaId: '',
|
|
|
|
|
visible: false,
|
|
|
|
|
},
|
|
|
|
|
);
|
2024-02-05 09:15:37 +08:00
|
|
|
let emits = defineEmits(['close']);
|
|
|
|
|
let visible = ref(false);
|
|
|
|
|
let showLoading = ref(false);
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
if (props.visible) {
|
|
|
|
|
look();
|
|
|
|
|
}
|
|
|
|
|
});
|
2025-02-25 18:42:40 +08:00
|
|
|
function look() {
|
2024-02-05 09:15:37 +08:00
|
|
|
if (props.processId) {
|
|
|
|
|
showLoading.value = false;
|
|
|
|
|
visible.value = true;
|
|
|
|
|
} else {
|
|
|
|
|
showLoading.value = false;
|
|
|
|
|
notification.open({
|
|
|
|
|
type: 'error',
|
|
|
|
|
message: t('查看'),
|
|
|
|
|
description: t('请选择一个流程进行查看'),
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function close() {
|
|
|
|
|
visible.value = false;
|
|
|
|
|
emits('close');
|
|
|
|
|
}
|
2025-02-25 18:42:40 +08:00
|
|
|
defineExpose({
|
2025-02-26 10:31:39 +08:00
|
|
|
look,
|
2025-02-25 18:42:40 +08:00
|
|
|
});
|
2024-02-05 09:15:37 +08:00
|
|
|
</script>
|