Merge branch 'dev' into dev-cjw
This commit is contained in:
@ -22,6 +22,7 @@ enum Api {
|
|||||||
App = '/system/generator/generator-app-code',
|
App = '/system/generator/generator-app-code',
|
||||||
Master = '/system/databaselink/master-info',
|
Master = '/system/databaselink/master-info',
|
||||||
Batch = '/system/generator/generator-code/batch',
|
Batch = '/system/generator/generator-code/batch',
|
||||||
|
DownloadCodes='/system/generator/downloadCodes',
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -251,3 +252,23 @@ export async function batchGeneratorCode(data: GeneratorModel, mode: ErrorMessag
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 根据uuid(目录名称)下载代码
|
||||||
|
*/
|
||||||
|
export async function downloadCodes(
|
||||||
|
params?: object,
|
||||||
|
mode: ErrorMessageMode = 'modal'
|
||||||
|
) {
|
||||||
|
return defHttp.download(
|
||||||
|
{
|
||||||
|
url: Api.DownloadCodes+"/"+params.uuid,
|
||||||
|
method: 'GET',
|
||||||
|
responseType: 'blob',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorMessageMode: mode,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import { TableStructureConfig } from '/@/model/generator/tableStructureConfig';
|
|||||||
export interface GeneratorModel extends GeneratorConfig {
|
export interface GeneratorModel extends GeneratorConfig {
|
||||||
frontCode: FrontCode;
|
frontCode: FrontCode;
|
||||||
id?: string;
|
id?: string;
|
||||||
|
actionType?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GeneratorAppModel extends FrontCode {
|
export interface GeneratorAppModel extends FrontCode {
|
||||||
|
|||||||
@ -74,12 +74,14 @@ export async function postDraft(
|
|||||||
schemaId: string,
|
schemaId: string,
|
||||||
formData: Array<Recordable>,
|
formData: Array<Recordable>,
|
||||||
dataId?: string,
|
dataId?: string,
|
||||||
|
processId='',
|
||||||
|
taskId='',
|
||||||
mode: ErrorMessageMode = 'modal',
|
mode: ErrorMessageMode = 'modal',
|
||||||
) {
|
) {
|
||||||
return defHttp.post<boolean>(
|
return defHttp.post<boolean>(
|
||||||
{
|
{
|
||||||
url: Api.Draft,
|
url: Api.Draft,
|
||||||
params: { formData, schemaId, dataId },
|
params: { formData, schemaId, dataId, processId, taskId },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
errorMessageMode: mode,
|
errorMessageMode: mode,
|
||||||
@ -109,12 +111,14 @@ export async function putDraft(
|
|||||||
formData: Array<Recordable>,
|
formData: Array<Recordable>,
|
||||||
id: string,
|
id: string,
|
||||||
dataId?: string,
|
dataId?: string,
|
||||||
|
processId='',
|
||||||
|
taskId='',
|
||||||
mode: ErrorMessageMode = 'modal',
|
mode: ErrorMessageMode = 'modal',
|
||||||
) {
|
) {
|
||||||
return defHttp.put<boolean>(
|
return defHttp.put<boolean>(
|
||||||
{
|
{
|
||||||
url: Api.Draft,
|
url: Api.Draft,
|
||||||
params: { formData, schemaId, id, dataId },
|
params: { formData, schemaId, id, dataId, processId, taskId },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
errorMessageMode: mode,
|
errorMessageMode: mode,
|
||||||
@ -139,7 +143,7 @@ export async function deleteDraft(ids: string[], mode: ErrorMessageMode = 'modal
|
|||||||
/**
|
/**
|
||||||
* @description: 获取草稿详情
|
* @description: 获取草稿详情
|
||||||
*/
|
*/
|
||||||
export async function getDraftInfo(id: string, mode: ErrorMessageMode = 'modal') {
|
export async function getDraftInfo(id: string, taskId, userId, mode: ErrorMessageMode = 'modal') {
|
||||||
return defHttp.get<{
|
return defHttp.get<{
|
||||||
formData: string;
|
formData: string;
|
||||||
name: string;
|
name: string;
|
||||||
@ -148,7 +152,7 @@ export async function getDraftInfo(id: string, mode: ErrorMessageMode = 'modal')
|
|||||||
}>(
|
}>(
|
||||||
{
|
{
|
||||||
url: Api.DraftInfo,
|
url: Api.DraftInfo,
|
||||||
params: { id },
|
params: { id, taskId, userId },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
errorMessageMode: mode,
|
errorMessageMode: mode,
|
||||||
|
|||||||
@ -150,6 +150,8 @@
|
|||||||
});
|
});
|
||||||
folderId.value = fileList.value[0].folderId;
|
folderId.value = fileList.value[0].folderId;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
folderId.value = '';
|
||||||
}
|
}
|
||||||
if (!val) {
|
if (!val) {
|
||||||
fileList.value = [];
|
fileList.value = [];
|
||||||
|
|||||||
@ -34,10 +34,15 @@
|
|||||||
const columns: BasicColumn[] = [
|
const columns: BasicColumn[] = [
|
||||||
{
|
{
|
||||||
dataIndex: 'activityFlag',
|
dataIndex: 'activityFlag',
|
||||||
title: t('版本'),
|
title: t('状态'),
|
||||||
customRender: ({ record }) =>
|
customRender: ({ record }) =>
|
||||||
`${record.activityFlag === 1 ? t('当前版本') : t('非当前版本')}`, //1-当前版本 0-非当前版本
|
`${record.activityFlag === 1 ? t('当前版本') : t('非当前版本')}`, //1-当前版本 0-非当前版本
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
dataIndex: 'version',
|
||||||
|
title: t('版本'),
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
dataIndex: 'createUserName',
|
dataIndex: 'createUserName',
|
||||||
title: t('创建人'),
|
title: t('创建人'),
|
||||||
|
|||||||
@ -25,9 +25,21 @@
|
|||||||
<a-button type="primary" @click="handleStepNext" v-show="current < 5">
|
<a-button type="primary" @click="handleStepNext" v-show="current < 5">
|
||||||
{{ t('下一步') }}
|
{{ t('下一步') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button type="primary" @click="handleCodeGenerator" v-show="current === 5">
|
<a-dropdown placement="bottom" :arrow="{ pointAtCenter: true }">
|
||||||
|
<a-button type="primary" v-show="current === 5">
|
||||||
{{ t('完成') }}
|
{{ t('完成') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
|
<template #overlay>
|
||||||
|
<a-menu>
|
||||||
|
<a-menu-item>
|
||||||
|
<a href="javascript:;" @click="handleCodeGenerator('packAndDownload')">打包下载</a>
|
||||||
|
</a-menu-item>
|
||||||
|
<a-menu-item>
|
||||||
|
<a href="javascript:;" @click="handleCodeGenerator('genCodeToProject')">生成到项目中</a>
|
||||||
|
</a-menu-item>
|
||||||
|
</a-menu>
|
||||||
|
</template>
|
||||||
|
</a-dropdown>
|
||||||
<a-button type="primary" danger @click="handleClose">{{ t('关闭') }}</a-button>
|
<a-button type="primary" danger @click="handleClose">{{ t('关闭') }}</a-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -57,6 +69,7 @@
|
|||||||
getCodeTemplateInfo,
|
getCodeTemplateInfo,
|
||||||
saveDraftGeneratorCode,
|
saveDraftGeneratorCode,
|
||||||
updateDraftGeneratorCode,
|
updateDraftGeneratorCode,
|
||||||
|
downloadCodes,
|
||||||
} from '/@/api/system/generator';
|
} from '/@/api/system/generator';
|
||||||
import { FormProps } from '/@/components/Form';
|
import { FormProps } from '/@/components/Form';
|
||||||
import { buildOption } from '/@/utils/helper/designHelper';
|
import { buildOption } from '/@/utils/helper/designHelper';
|
||||||
@ -73,6 +86,9 @@
|
|||||||
import DesignLogo from '/@/components/ModalPanel/src/DesignLogo.vue';
|
import DesignLogo from '/@/components/ModalPanel/src/DesignLogo.vue';
|
||||||
import AjaxErrorIcon from '/@/components/SecondDev/AjaxErrorIcon.vue';
|
import AjaxErrorIcon from '/@/components/SecondDev/AjaxErrorIcon.vue';
|
||||||
import useGlobalFlag from '/@/hooks/core/useGlobalFlag';
|
import useGlobalFlag from '/@/hooks/core/useGlobalFlag';
|
||||||
|
import { downloadByData } from '/@/utils/file/download';
|
||||||
|
import { dateUtil } from '/@/utils/dateUtil';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const StructureConfigStep = defineAsyncComponent({
|
const StructureConfigStep = defineAsyncComponent({
|
||||||
loader: () => import('/@/components/CreateCodeStep/src/StructureConfigStep.vue'),
|
loader: () => import('/@/components/CreateCodeStep/src/StructureConfigStep.vue'),
|
||||||
@ -114,7 +130,6 @@
|
|||||||
const widgetForm = ref(JSON.parse(JSON.stringify(antd.widgetForm))); //FormDesignStep -> designer和StructureConfigStep页面使用
|
const widgetForm = ref(JSON.parse(JSON.stringify(antd.widgetForm))); //FormDesignStep -> designer和StructureConfigStep页面使用
|
||||||
const mainTableName = ref('table_' + random(10000, 99999));
|
const mainTableName = ref('table_' + random(10000, 99999));
|
||||||
const emit = defineEmits(['close', 'register', 'success']);
|
const emit = defineEmits(['close', 'register', 'success']);
|
||||||
|
|
||||||
watch(current, () => {
|
watch(current, () => {
|
||||||
isEditorOpen.value = current.value === 0;
|
isEditorOpen.value = current.value === 0;
|
||||||
});
|
});
|
||||||
@ -245,7 +260,7 @@
|
|||||||
handleClose();
|
handleClose();
|
||||||
emit('success');
|
emit('success');
|
||||||
}
|
}
|
||||||
async function handleCodeGenerator() {
|
async function handleCodeGenerator(actionType:String) {
|
||||||
const isOk = await stepValidate[5]();
|
const isOk = await stepValidate[5]();
|
||||||
if (
|
if (
|
||||||
generatorConfig.formJson?.hiddenComponent &&
|
generatorConfig.formJson?.hiddenComponent &&
|
||||||
@ -268,9 +283,16 @@
|
|||||||
// await appGeneratorCode(
|
// await appGeneratorCode(
|
||||||
// buildAppCode(generatorConfig, buildAppFormProps(generatorConfig.formJson)),
|
// buildAppCode(generatorConfig, buildAppFormProps(generatorConfig.formJson)),
|
||||||
// );
|
// );
|
||||||
|
data.actionType=actionType;
|
||||||
await codeFirstGeneratorCode(data);
|
const result =await codeFirstGeneratorCode(data);
|
||||||
|
if(data.actionType=="packAndDownload"&&result){
|
||||||
|
const fileName=data.outputConfig.className+'_'+dateUtil(new Date()).format('YYYY-MM-DD_HH_mm_ss');
|
||||||
|
const res = await downloadCodes({uuid:result});
|
||||||
|
downloadByData(
|
||||||
|
res.data,
|
||||||
|
fileName+".zip"
|
||||||
|
);
|
||||||
|
}
|
||||||
handleClose();
|
handleClose();
|
||||||
emit('success');
|
emit('success');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,9 +24,22 @@
|
|||||||
<a-button type="primary" @click="handleStepNext" v-show="current < 5">
|
<a-button type="primary" @click="handleStepNext" v-show="current < 5">
|
||||||
{{ t('下一步') }}
|
{{ t('下一步') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button type="primary" @click="handleCodeGenerator" v-show="current === 5">
|
<a-dropdown placement="bottom" :arrow="{ pointAtCenter: true }">
|
||||||
|
<a-button type="primary" v-show="current === 5">
|
||||||
{{ t('完成') }}
|
{{ t('完成') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
|
<template #overlay>
|
||||||
|
<a-menu>
|
||||||
|
<a-menu-item>
|
||||||
|
<a href="javascript:;" @click="handleCodeGenerator('packAndDownload')">打包下载</a>
|
||||||
|
</a-menu-item>
|
||||||
|
<a-menu-item>
|
||||||
|
<a href="javascript:;" @click="handleCodeGenerator('genCodeToProject')">生成到项目中</a>
|
||||||
|
</a-menu-item>
|
||||||
|
|
||||||
|
</a-menu>
|
||||||
|
</template>
|
||||||
|
</a-dropdown>
|
||||||
<a-button type="primary" danger @click="handleClose">{{ t('关闭') }}</a-button>
|
<a-button type="primary" danger @click="handleClose">{{ t('关闭') }}</a-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -51,6 +64,7 @@
|
|||||||
getCodeTemplateInfo,
|
getCodeTemplateInfo,
|
||||||
saveDraftGeneratorCode,
|
saveDraftGeneratorCode,
|
||||||
updateDraftGeneratorCode,
|
updateDraftGeneratorCode,
|
||||||
|
downloadCodes,
|
||||||
} from '/@/api/system/generator';
|
} from '/@/api/system/generator';
|
||||||
import { FormProps } from '/@/components/Form';
|
import { FormProps } from '/@/components/Form';
|
||||||
import { buildOption } from '/@/utils/helper/designHelper';
|
import { buildOption } from '/@/utils/helper/designHelper';
|
||||||
@ -66,6 +80,8 @@
|
|||||||
import DesignLogo from '/@/components/ModalPanel/src/DesignLogo.vue';
|
import DesignLogo from '/@/components/ModalPanel/src/DesignLogo.vue';
|
||||||
import useGlobalFlag from '/@/hooks/core/useGlobalFlag';
|
import useGlobalFlag from '/@/hooks/core/useGlobalFlag';
|
||||||
import AjaxErrorIcon from '/@/components/SecondDev/AjaxErrorIcon.vue';
|
import AjaxErrorIcon from '/@/components/SecondDev/AjaxErrorIcon.vue';
|
||||||
|
import { downloadByData } from '/@/utils/file/download';
|
||||||
|
import { dateUtil } from '/@/utils/dateUtil';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const TableConfigStep = defineAsyncComponent({
|
const TableConfigStep = defineAsyncComponent({
|
||||||
@ -240,7 +256,7 @@
|
|||||||
handleClose();
|
handleClose();
|
||||||
emit('success');
|
emit('success');
|
||||||
}
|
}
|
||||||
async function handleCodeGenerator() {
|
async function handleCodeGenerator(actionType:String) {
|
||||||
const isOk = await stepValidate[5]();
|
const isOk = await stepValidate[5]();
|
||||||
if (
|
if (
|
||||||
generatorConfig.formJson?.hiddenComponent &&
|
generatorConfig.formJson?.hiddenComponent &&
|
||||||
@ -259,7 +275,16 @@
|
|||||||
buildOption(generatorConfig.formJson) as FormProps,
|
buildOption(generatorConfig.formJson) as FormProps,
|
||||||
);
|
);
|
||||||
if (templateId.value) data.id = templateId.value;
|
if (templateId.value) data.id = templateId.value;
|
||||||
await dataFirstGeneratorCode(data);
|
data.actionType=actionType;
|
||||||
|
const result = await dataFirstGeneratorCode(data);
|
||||||
|
if(data.actionType=="packAndDownload"&&result){
|
||||||
|
const fileName=data.outputConfig.className+'_'+dateUtil(new Date()).format('YYYY-MM-DD_HH_mm_ss');
|
||||||
|
const res = await downloadCodes({uuid:result});
|
||||||
|
downloadByData(
|
||||||
|
res.data,
|
||||||
|
fileName+".zip"
|
||||||
|
);
|
||||||
|
}
|
||||||
handleClose();
|
handleClose();
|
||||||
emit('success');
|
emit('success');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,9 +24,21 @@
|
|||||||
<a-button type="primary" @click="handleStepNext" v-show="current < 5">
|
<a-button type="primary" @click="handleStepNext" v-show="current < 5">
|
||||||
{{ t('下一步') }}
|
{{ t('下一步') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button type="primary" @click="handleCodeGenerator" v-show="current === 5">
|
<a-dropdown placement="bottom" :arrow="{ pointAtCenter: true }">
|
||||||
|
<a-button type="primary" v-show="current === 5">
|
||||||
{{ t('完成') }}
|
{{ t('完成') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
|
<template #overlay>
|
||||||
|
<a-menu>
|
||||||
|
<a-menu-item>
|
||||||
|
<a href="javascript:;" @click="handleCodeGenerator('packAndDownload')">打包下载</a>
|
||||||
|
</a-menu-item>
|
||||||
|
<a-menu-item>
|
||||||
|
<a href="javascript:;" @click="handleCodeGenerator('genCodeToProject')">生成到项目中</a>
|
||||||
|
</a-menu-item>
|
||||||
|
</a-menu>
|
||||||
|
</template>
|
||||||
|
</a-dropdown>
|
||||||
<a-button type="primary" danger @click="handleClose">{{ t('关闭') }}</a-button>
|
<a-button type="primary" danger @click="handleClose">{{ t('关闭') }}</a-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -57,6 +69,7 @@
|
|||||||
saveDraftGeneratorCode,
|
saveDraftGeneratorCode,
|
||||||
updateDraftGeneratorCode,
|
updateDraftGeneratorCode,
|
||||||
getMasterInfo,
|
getMasterInfo,
|
||||||
|
downloadCodes,
|
||||||
} from '/@/api/system/generator';
|
} from '/@/api/system/generator';
|
||||||
import { FormProps } from '/@/components/Form';
|
import { FormProps } from '/@/components/Form';
|
||||||
import { buildOption } from '/@/utils/helper/designHelper';
|
import { buildOption } from '/@/utils/helper/designHelper';
|
||||||
@ -71,6 +84,8 @@
|
|||||||
import { MenuConfig } from '/@/model/generator/menuConfig';
|
import { MenuConfig } from '/@/model/generator/menuConfig';
|
||||||
import { FormEventColumnConfig } from '/@/model/generator/formEventConfig';
|
import { FormEventColumnConfig } from '/@/model/generator/formEventConfig';
|
||||||
import DesignLogo from '/@/components/ModalPanel/src/DesignLogo.vue';
|
import DesignLogo from '/@/components/ModalPanel/src/DesignLogo.vue';
|
||||||
|
import { downloadByData } from '/@/utils/file/download';
|
||||||
|
import { dateUtil } from '/@/utils/dateUtil';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const StructureConfigStep = defineAsyncComponent({
|
const StructureConfigStep = defineAsyncComponent({
|
||||||
@ -244,7 +259,7 @@
|
|||||||
handleClose();
|
handleClose();
|
||||||
emit('success');
|
emit('success');
|
||||||
}
|
}
|
||||||
async function handleCodeGenerator() {
|
async function handleCodeGenerator(actionType:String) {
|
||||||
const isOk = await stepValidate[5]();
|
const isOk = await stepValidate[5]();
|
||||||
if (
|
if (
|
||||||
generatorConfig.formJson?.hiddenComponent &&
|
generatorConfig.formJson?.hiddenComponent &&
|
||||||
@ -263,7 +278,16 @@
|
|||||||
buildOption(generatorConfig.formJson) as FormProps,
|
buildOption(generatorConfig.formJson) as FormProps,
|
||||||
);
|
);
|
||||||
if (templateId.value) data.id = templateId.value;
|
if (templateId.value) data.id = templateId.value;
|
||||||
await codeFirstGeneratorCode(data);
|
data.actionType=actionType;
|
||||||
|
const result =await codeFirstGeneratorCode(data);
|
||||||
|
if(data.actionType=="packAndDownload"&&result){
|
||||||
|
const fileName=data.outputConfig.className+'_'+dateUtil(new Date()).format('YYYY-MM-DD_HH_mm_ss');
|
||||||
|
const res = await downloadCodes({uuid:result});
|
||||||
|
downloadByData(
|
||||||
|
res.data,
|
||||||
|
fileName+".zip"
|
||||||
|
);
|
||||||
|
}
|
||||||
handleClose();
|
handleClose();
|
||||||
emit('success');
|
emit('success');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,6 +10,12 @@
|
|||||||
</slot>
|
</slot>
|
||||||
关闭
|
关闭
|
||||||
</a-button>
|
</a-button>
|
||||||
|
<a-button @click="saveDraft" v-if="!readonly">
|
||||||
|
暂存
|
||||||
|
</a-button>
|
||||||
|
<a-button @click="setDraft" v-if="rDraftsId && !readonly">
|
||||||
|
从草稿导入
|
||||||
|
</a-button>
|
||||||
<a-button v-if="!readonly && hasBtnApprove" type="primary" @click="onApproveClick()">
|
<a-button v-if="!readonly && hasBtnApprove" type="primary" @click="onApproveClick()">
|
||||||
<slot name="icon">
|
<slot name="icon">
|
||||||
<check-circle-outlined />
|
<check-circle-outlined />
|
||||||
@ -86,6 +92,9 @@
|
|||||||
import { useI18n } from '/@/hooks/web/useI18n';
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
import { useUserStore } from '/@/store/modules/user';
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
|
import { deleteDraft, postDraft, putDraft, getDraftInfo } from '/@/api/workflow/process';
|
||||||
|
import { TaskTypeUrl } from '/@/enums/workflowEnum';
|
||||||
|
|
||||||
|
|
||||||
const spinning = ref(false);
|
const spinning = ref(false);
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
@ -105,6 +114,7 @@
|
|||||||
const taskId = ref(rQuery.taskId);
|
const taskId = ref(rQuery.taskId);
|
||||||
const processId = ref(rParams.arg2);
|
const processId = ref(rParams.arg2);
|
||||||
const readonly = ref(!!rQuery.readonly); // 查看流程会触发只读模式
|
const readonly = ref(!!rQuery.readonly); // 查看流程会触发只读模式
|
||||||
|
const rDraftsId = ref(rQuery.draftId || '')
|
||||||
const renderKey = ref('');
|
const renderKey = ref('');
|
||||||
const formConfigs = ref();
|
const formConfigs = ref();
|
||||||
const opinionDlg = ref();
|
const opinionDlg = ref();
|
||||||
@ -115,7 +125,13 @@
|
|||||||
const hasBtnApprove = ref(true);
|
const hasBtnApprove = ref(true);
|
||||||
const hasBtnReject = ref(false);
|
const hasBtnReject = ref(false);
|
||||||
const hasBtnFinish = ref(false);
|
const hasBtnFinish = ref(false);
|
||||||
|
let draftData = {}
|
||||||
const drawNode = ref('');
|
const drawNode = ref('');
|
||||||
|
const props = defineProps({
|
||||||
|
rowKeyData: {
|
||||||
|
type: String
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
let approvalData = reactive({
|
let approvalData = reactive({
|
||||||
isCountersign: false,
|
isCountersign: false,
|
||||||
@ -135,7 +151,6 @@
|
|||||||
nextTaskUser: {} // 格式为taskKey: 用户id(逗号分隔)
|
nextTaskUser: {} // 格式为taskKey: 用户id(逗号分隔)
|
||||||
});
|
});
|
||||||
let approvedType = ref(ApproveType.AGREE);
|
let approvedType = ref(ApproveType.AGREE);
|
||||||
|
|
||||||
function onMoreClick(e) {
|
function onMoreClick(e) {
|
||||||
const key = e.key;
|
const key = e.key;
|
||||||
if (key === 'flowchart') {
|
if (key === 'flowchart') {
|
||||||
@ -194,6 +209,56 @@
|
|||||||
function close() {
|
function close() {
|
||||||
tabStore.closeTab(currentRoute, router);
|
tabStore.closeTab(currentRoute, router);
|
||||||
}
|
}
|
||||||
|
async function setDraft(needModal = true) {
|
||||||
|
let formData = [];
|
||||||
|
let params = {
|
||||||
|
taskId: taskId.value,
|
||||||
|
userId: userStore.getUserInfo.id,
|
||||||
|
}
|
||||||
|
let res = await getDraftInfo('', taskId.value, userStore.getUserInfo.id)
|
||||||
|
if(res) {
|
||||||
|
draftData = JSON.parse(res.formData)
|
||||||
|
rDraftsId.value = res.id
|
||||||
|
if(!needModal) return
|
||||||
|
Modal.confirm({
|
||||||
|
title: () => '提示',
|
||||||
|
content: () => '确认使用草稿覆盖当前数据?',
|
||||||
|
onOk: async () => {
|
||||||
|
data.formInfos.forEach((item) => {
|
||||||
|
if (draftData && item.formConfig && item.formConfig.key && draftData[item.formConfig.key]) {
|
||||||
|
formData.push(item.formConfig.key ? draftData[item.formConfig.key] : {});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
await formInformation.value.setFormData(formData);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function saveDraft() {
|
||||||
|
try {
|
||||||
|
spinning.value = true;
|
||||||
|
let formModels = await formInformation.value.saveDraftData();
|
||||||
|
if (rDraftsId.value) {
|
||||||
|
let res = await putDraft(schemaId.value, formModels, rDraftsId.value, props.rowKeyData, processId.value, taskId.value);
|
||||||
|
showResult(res, '保存草稿');
|
||||||
|
} else {
|
||||||
|
let res = await postDraft(schemaId.value, formModels, props.rowKeyData, processId.value, taskId.value );
|
||||||
|
showResult(res, '保存草稿');
|
||||||
|
}
|
||||||
|
setDraft(false)
|
||||||
|
spinning.value = false;
|
||||||
|
} catch (error) {
|
||||||
|
spinning.value = false;
|
||||||
|
notificationError('保存草稿');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function showResult(res, title) {
|
||||||
|
if (res) {
|
||||||
|
notificationSuccess(title);
|
||||||
|
} else {
|
||||||
|
notificationError(title);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function onApproveClick(isAutoAgreeBreak = false) {
|
async function onApproveClick(isAutoAgreeBreak = false) {
|
||||||
openSpinning();
|
openSpinning();
|
||||||
@ -360,6 +425,7 @@
|
|||||||
}
|
}
|
||||||
renderKey.value = Math.random() + '';
|
renderKey.value = Math.random() + '';
|
||||||
getBackNode();
|
getBackNode();
|
||||||
|
setDraft()
|
||||||
} catch (error) {}
|
} catch (error) {}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -707,6 +707,9 @@ const columns = ref([
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
const addGlobalStartEvent = () => {
|
const addGlobalStartEvent = () => {
|
||||||
|
if(!processInfo.value.globalStartEventConfigs) {
|
||||||
|
processInfo.value.globalStartEventConfigs = [];
|
||||||
|
}
|
||||||
processInfo.value.globalStartEventConfigs.push({
|
processInfo.value.globalStartEventConfigs.push({
|
||||||
type: NodeEventExType.API,
|
type: NodeEventExType.API,
|
||||||
apiConfig: {},
|
apiConfig: {},
|
||||||
@ -717,6 +720,9 @@ const deleteStartEvent = (index) => {
|
|||||||
processInfo.value.globalStartEventConfigs.splice(index, 1);
|
processInfo.value.globalStartEventConfigs.splice(index, 1);
|
||||||
};
|
};
|
||||||
const addGlobalEndEvent = () => {
|
const addGlobalEndEvent = () => {
|
||||||
|
if(!processInfo.value.globalEndEventConfigs) {
|
||||||
|
processInfo.value.globalEndEventConfigs = [];
|
||||||
|
}
|
||||||
processInfo.value.globalEndEventConfigs.push({
|
processInfo.value.globalEndEventConfigs.push({
|
||||||
type: NodeEventExType.API,
|
type: NodeEventExType.API,
|
||||||
apiConfig: {},
|
apiConfig: {},
|
||||||
@ -728,6 +734,9 @@ const deleteEndEvent = (index) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const addGlobalPrequalifyBeforeEvent = () => {
|
const addGlobalPrequalifyBeforeEvent = () => {
|
||||||
|
if(!processInfo.value.globalPrequalifyBeforeEventConfigs) {
|
||||||
|
processInfo.value.globalPrequalifyBeforeEventConfigs = [];
|
||||||
|
}
|
||||||
processInfo.value.globalPrequalifyBeforeEventConfigs.push({
|
processInfo.value.globalPrequalifyBeforeEventConfigs.push({
|
||||||
type: NodeEventExType.API,
|
type: NodeEventExType.API,
|
||||||
apiConfig: {},
|
apiConfig: {},
|
||||||
@ -739,6 +748,9 @@ const deletePrequalifyBeforeEvent = (index) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const addGlobalPrequalifyAfterEvent = () => {
|
const addGlobalPrequalifyAfterEvent = () => {
|
||||||
|
if(!processInfo.value.globalPrequalifyAfterEventConfigs) {
|
||||||
|
processInfo.value.globalPrequalifyAfterEventConfigs = [];
|
||||||
|
}
|
||||||
processInfo.value.globalPrequalifyAfterEventConfigs.push({
|
processInfo.value.globalPrequalifyAfterEventConfigs.push({
|
||||||
type: NodeEventExType.API,
|
type: NodeEventExType.API,
|
||||||
apiConfig: {},
|
apiConfig: {},
|
||||||
@ -750,6 +762,9 @@ const deletePrequalifyAfterEvent = (index) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const addGlobalFinishBeforeEvent = () => {
|
const addGlobalFinishBeforeEvent = () => {
|
||||||
|
if(!processInfo.value.globalFinishBeforeEventConfigs) {
|
||||||
|
processInfo.value.globalFinishBeforeEventConfigs = [];
|
||||||
|
}
|
||||||
processInfo.value.globalFinishBeforeEventConfigs.push({
|
processInfo.value.globalFinishBeforeEventConfigs.push({
|
||||||
type: NodeEventExType.API,
|
type: NodeEventExType.API,
|
||||||
apiConfig: {},
|
apiConfig: {},
|
||||||
@ -761,6 +776,9 @@ const deleteFinishBeforeEvent = (index) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const addGlobalRejectAfterEvent = () => {
|
const addGlobalRejectAfterEvent = () => {
|
||||||
|
if(!processInfo.value.globalRejectAfterEventConfigs) {
|
||||||
|
processInfo.value.globalRejectAfterEventConfigs = [];
|
||||||
|
}
|
||||||
processInfo.value.globalRejectAfterEventConfigs.push({
|
processInfo.value.globalRejectAfterEventConfigs.push({
|
||||||
type: NodeEventExType.API,
|
type: NodeEventExType.API,
|
||||||
apiConfig: {},
|
apiConfig: {},
|
||||||
@ -772,6 +790,9 @@ const deleteRejectAfterEvent = (index) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const addGlobalAgreeAfterEvent = () => {
|
const addGlobalAgreeAfterEvent = () => {
|
||||||
|
if(!processInfo.value.globalAgreeAfterEventConfigs) {
|
||||||
|
processInfo.value.globalAgreeAfterEventConfigs = [];
|
||||||
|
}
|
||||||
processInfo.value.globalAgreeAfterEventConfigs.push({
|
processInfo.value.globalAgreeAfterEventConfigs.push({
|
||||||
type: NodeEventExType.API,
|
type: NodeEventExType.API,
|
||||||
apiConfig: {},
|
apiConfig: {},
|
||||||
@ -783,6 +804,9 @@ const deleteAgreeAfterEvent = (index) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const addGlobalSuspendedBeforeEvent = () => {
|
const addGlobalSuspendedBeforeEvent = () => {
|
||||||
|
if(!processInfo.value.globalSuspendedBeforeEventConfigs) {
|
||||||
|
processInfo.value.globalSuspendedBeforeEventConfigs = [];
|
||||||
|
}
|
||||||
processInfo.value.globalSuspendedBeforeEventConfigs.push({
|
processInfo.value.globalSuspendedBeforeEventConfigs.push({
|
||||||
type: NodeEventExType.API,
|
type: NodeEventExType.API,
|
||||||
apiConfig: {},
|
apiConfig: {},
|
||||||
@ -794,6 +818,9 @@ const deleteSuspendedBeforeEvent = (index) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const addGlobalRestoreAfterEvent = () => {
|
const addGlobalRestoreAfterEvent = () => {
|
||||||
|
if(!processInfo.value.globalRestoreAfterEventConfigs) {
|
||||||
|
processInfo.value.globalRestoreAfterEventConfigs = [];
|
||||||
|
}
|
||||||
processInfo.value.globalRestoreAfterEventConfigs.push({
|
processInfo.value.globalRestoreAfterEventConfigs.push({
|
||||||
type: NodeEventExType.API,
|
type: NodeEventExType.API,
|
||||||
apiConfig: {},
|
apiConfig: {},
|
||||||
@ -805,6 +832,9 @@ const deleteRestoreAfterEvent = (index) => {
|
|||||||
};
|
};
|
||||||
// 全局会签事件添加
|
// 全局会签事件添加
|
||||||
const addGlobalSetSignAfterEvent = () => {
|
const addGlobalSetSignAfterEvent = () => {
|
||||||
|
if(!processInfo.value.globalSetSignAfterEventConfigs) {
|
||||||
|
processInfo.value.globalSetSignAfterEventConfigs = [];
|
||||||
|
}
|
||||||
processInfo.value.globalSetSignAfterEventConfigs.push({
|
processInfo.value.globalSetSignAfterEventConfigs.push({
|
||||||
type: NodeEventExType.API,
|
type: NodeEventExType.API,
|
||||||
apiConfig: {},
|
apiConfig: {},
|
||||||
|
|||||||
@ -97,18 +97,29 @@ function tableActions(record) {
|
|||||||
|
|
||||||
async function handleEdit(record) {
|
async function handleEdit(record) {
|
||||||
try {
|
try {
|
||||||
let res = await getDraftInfo(record.id);
|
|
||||||
/*processData.draftsId = record.id;
|
/*processData.draftsId = record.id;
|
||||||
processData.schemaId = res.schemaId;
|
processData.schemaId = res.schemaId;
|
||||||
processData.draftsJsonStr = res.formData;
|
processData.draftsJsonStr = res.formData;
|
||||||
processData.visible = true;*/
|
processData.visible = true;*/
|
||||||
|
const { schemaId, processId, taskId, id } = record;
|
||||||
|
if(taskId){
|
||||||
|
router.push({
|
||||||
|
path: '/flow/' + schemaId + '/' + (processId || '') + '/approveFlow',
|
||||||
|
query: {
|
||||||
|
taskId: taskId,
|
||||||
|
draftId: id,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
let res = await getDraftInfo(record.id);
|
||||||
localStorage.setItem('draftsJsonStr', res.formData);
|
localStorage.setItem('draftsJsonStr', res.formData);
|
||||||
router.push({
|
router.push({
|
||||||
path: `/flow/${res.schemaId}/${record.id}/createFlow`,
|
path: `/flow/${schemaId}/${id}/createFlow`,
|
||||||
query: {
|
query: {
|
||||||
createType: 'drafts'
|
createType: 'drafts'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
} catch (error) { }
|
} catch (error) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user