mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
refactor(projects): 移动工作流组件位置
This commit is contained in:
@ -12,7 +12,7 @@ import { useDict } from '@/hooks/business/dict';
|
||||
import { $t } from '@/locales';
|
||||
import DictTag from '@/components/custom/dict-tag.vue';
|
||||
import ButtonIcon from '@/components/custom/button-icon.vue';
|
||||
import LeaveEdit from '@/components/custom/workflow/leave-edit/index.vue';
|
||||
import LeaveEdit from '@/components/workflow/form/leave-edit/index.vue';
|
||||
import LeaveSearch from './modules/leave-search.vue';
|
||||
|
||||
defineOptions({
|
||||
|
@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, reactive, watch } from 'vue';
|
||||
import { computed, reactive, ref, watch } from 'vue';
|
||||
import type { SelectOption } from 'naive-ui';
|
||||
import { fetchCreateDefinition, fetchUpdateDefinition } from '@/service/api/workflow/definition';
|
||||
import { useFormRules, useNaiveForm } from '@/hooks/common/form';
|
||||
import { $t } from '@/locales';
|
||||
@ -38,6 +39,14 @@ const title = computed(() => {
|
||||
return titles[props.operateType];
|
||||
});
|
||||
|
||||
const formPaths = ref<SelectOption[]>([]);
|
||||
const modules = import.meta.glob('@/components/workflow/form/**/*.vue');
|
||||
Object.keys(modules).forEach(key => {
|
||||
const label = key.replace('/src/components/workflow/form/', '');
|
||||
const value = key.replace('/src/components/workflow/form', '/workflow');
|
||||
formPaths.value.push({ label, value });
|
||||
});
|
||||
|
||||
type Model = Api.Workflow.DefinitionOperateParams;
|
||||
|
||||
const model: Model = reactive(createDefaultModel());
|
||||
@ -47,7 +56,7 @@ function createDefaultModel(): Model {
|
||||
flowCode: '',
|
||||
flowName: '',
|
||||
category: '',
|
||||
formPath: ''
|
||||
formPath: undefined
|
||||
};
|
||||
}
|
||||
|
||||
@ -117,7 +126,13 @@ watch(visible, () => {
|
||||
<NInput v-model:value="model.flowName" placeholder="请输入流程名称" />
|
||||
</NFormItem>
|
||||
<NFormItem label="审批表单路径" path="formPath">
|
||||
<NInput v-model:value="model.formPath" placeholder="请输入审批表单路径" />
|
||||
<template #label>
|
||||
<div class="flex-center">
|
||||
<FormTip content="需要在 /src/components/workflow/form 路径下创建组件" />
|
||||
<span class="pl-3px">审批表单路径</span>
|
||||
</div>
|
||||
</template>
|
||||
<NSelect v-model:value="model.formPath" :options="formPaths" placeholder="请选择审批表单路径" />
|
||||
</NFormItem>
|
||||
</NForm>
|
||||
<template #footer>
|
||||
|
@ -316,7 +316,7 @@ async function handleShowVariable(id: CommonType.IdType) {
|
||||
showVariableDrawer();
|
||||
}
|
||||
|
||||
const modules = import.meta.glob('@/components/custom/workflow/**/*.vue');
|
||||
const modules = import.meta.glob('@/components/workflow/form/**/*.vue');
|
||||
const businessId = ref<CommonType.IdType>();
|
||||
|
||||
/** 流程预览,动态加载组件 */
|
||||
|
@ -208,7 +208,7 @@ function handleResetSearch() {
|
||||
resetSearchParams();
|
||||
selectedKeys.value = [];
|
||||
}
|
||||
const modules = import.meta.glob('@/components/custom/workflow/**/*.vue');
|
||||
const modules = import.meta.glob('@/components/workflow/**/*.vue');
|
||||
const businessId = ref<CommonType.IdType>();
|
||||
|
||||
async function handleView(row: Api.Workflow.TaskOrHisTask) {
|
||||
|
@ -214,7 +214,7 @@ function handleResetSearch() {
|
||||
resetSearchParams();
|
||||
selectedKeys.value = [];
|
||||
}
|
||||
const modules = import.meta.glob('@/components/custom/workflow/**/*.vue');
|
||||
const modules = import.meta.glob('@/components/workflow/**/*.vue');
|
||||
const businessId = ref<CommonType.IdType>();
|
||||
const operateType = ref<CommonType.WorkflowTableOperateType>();
|
||||
|
||||
|
@ -163,7 +163,7 @@ function handleResetSearch() {
|
||||
resetSearchParams();
|
||||
selectedKeys.value = [];
|
||||
}
|
||||
const modules = import.meta.glob('@/components/custom/workflow/**/*.vue');
|
||||
const modules = import.meta.glob('@/components/workflow/**/*.vue');
|
||||
const businessId = ref<CommonType.IdType>();
|
||||
const taskId = ref<CommonType.IdType>();
|
||||
|
||||
|
@ -176,7 +176,7 @@ function handleResetSearch() {
|
||||
resetSearchParams();
|
||||
selectedKeys.value = [];
|
||||
}
|
||||
const modules = import.meta.glob('@/components/custom/workflow/**/*.vue');
|
||||
const modules = import.meta.glob('@/components/workflow/**/*.vue');
|
||||
const businessId = ref<CommonType.IdType>();
|
||||
const taskId = ref<CommonType.IdType>();
|
||||
|
||||
|
@ -157,7 +157,7 @@ function handleResetSearch() {
|
||||
resetSearchParams();
|
||||
selectedKeys.value = [];
|
||||
}
|
||||
const modules = import.meta.glob('@/components/custom/workflow/**/*.vue');
|
||||
const modules = import.meta.glob('@/components/workflow/**/*.vue');
|
||||
const businessId = ref<CommonType.IdType>();
|
||||
const taskId = ref<CommonType.IdType>();
|
||||
|
||||
|
Reference in New Issue
Block a user