mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
feat-wip(projects): 新增我的待办列表
This commit is contained in:
@ -11,18 +11,15 @@ interface Props {
|
||||
loading?: boolean;
|
||||
/** 抽屉宽度 */
|
||||
width?: number;
|
||||
/** 是否为只读模式 */
|
||||
readonly?: boolean;
|
||||
/** 是否显示暂存按钮 */
|
||||
showDraft?: boolean;
|
||||
operateType: CommonType.WorkflowTableOperateType;
|
||||
status?: string | null;
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
visible: false,
|
||||
loading: false,
|
||||
width: 1200,
|
||||
readonly: false,
|
||||
showDraft: true
|
||||
status: null
|
||||
});
|
||||
|
||||
interface Emits {
|
||||
@ -30,6 +27,7 @@ interface Emits {
|
||||
(e: 'close'): void;
|
||||
(e: 'saveDraft'): void;
|
||||
(e: 'submit'): void;
|
||||
(e: 'approval'): void;
|
||||
}
|
||||
|
||||
const emit = defineEmits<Emits>();
|
||||
@ -41,6 +39,15 @@ const visibleValue = computed({
|
||||
}
|
||||
});
|
||||
|
||||
const showSubmit = computed(
|
||||
() =>
|
||||
props.operateType === 'add' ||
|
||||
(props.operateType === 'edit' &&
|
||||
props.status &&
|
||||
(props.status === 'draft' || props.status === 'cancel' || props.status === 'back'))
|
||||
);
|
||||
const showApproval = computed(() => props.operateType === 'approval' && props.status && props.status === 'waiting');
|
||||
|
||||
function handleClose() {
|
||||
emit('close');
|
||||
}
|
||||
@ -52,11 +59,15 @@ function handleSaveDraft() {
|
||||
function handleSubmit() {
|
||||
emit('submit');
|
||||
}
|
||||
function handleApproval() {
|
||||
emit('approval');
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
handleClose,
|
||||
handleSaveDraft,
|
||||
handleSubmit
|
||||
handleSubmit,
|
||||
handleApproval
|
||||
});
|
||||
</script>
|
||||
|
||||
@ -68,11 +79,12 @@ defineExpose({
|
||||
</NSpin>
|
||||
<template #footer>
|
||||
<slot name="footer">
|
||||
<div v-if="!readonly">
|
||||
<div>
|
||||
<NSpace :size="16">
|
||||
<NButton @click="handleClose">{{ $t('common.cancel') }}</NButton>
|
||||
<NButton v-if="showDraft" type="warning" @click="handleSaveDraft">暂存</NButton>
|
||||
<NButton type="primary" @click="handleSubmit">{{ $t('common.confirm') }}</NButton>
|
||||
<NButton v-if="showSubmit || showApproval" @click="handleClose">{{ $t('common.cancel') }}</NButton>
|
||||
<NButton v-if="showSubmit" type="warning" @click="handleSaveDraft">暂存</NButton>
|
||||
<NButton v-if="showSubmit" type="primary" @click="handleSubmit">{{ $t('common.confirm') }}</NButton>
|
||||
<NButton v-if="showApproval" type="warning" @click="handleApproval">办理</NButton>
|
||||
</NSpace>
|
||||
</div>
|
||||
</slot>
|
||||
|
@ -217,6 +217,10 @@ function handleTaskFinished() {
|
||||
emit('submitted');
|
||||
}
|
||||
|
||||
function handleApproval() {
|
||||
setTaskApplyVisible();
|
||||
}
|
||||
|
||||
async function initializeData() {
|
||||
if (visible.value) {
|
||||
startLoading();
|
||||
@ -238,10 +242,12 @@ watch(visible, initializeData, { immediate: true });
|
||||
v-model:visible="visible"
|
||||
:title="title"
|
||||
:loading="loading"
|
||||
:readonly="readonly"
|
||||
:operate-type="operateType"
|
||||
:status="modelDetail.status"
|
||||
@close="closeDrawer"
|
||||
@save-draft="handleSaveDraft"
|
||||
@submit="handleSubmit"
|
||||
@approval="handleApproval"
|
||||
>
|
||||
<div :class="loading ? 'hidden' : ''">
|
||||
<div v-if="!readonly" class="h-full">
|
||||
|
Reference in New Issue
Block a user