--添加测试模块
This commit is contained in:
@ -23,9 +23,22 @@
|
||||
<a-button type="primary" @click="handleStepNext" v-show="current < 5">
|
||||
{{ t('下一步') }}
|
||||
</a-button>
|
||||
<a-button type="primary" @click="handleCodeGenerator" v-show="current === 5">
|
||||
{{ t('完成') }}
|
||||
</a-button>
|
||||
<a-dropdown placement="bottom" :arrow="{ pointAtCenter: true }">
|
||||
<a-button type="primary" v-show="current === 5">
|
||||
{{ t('完成') }}
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
@ -59,6 +72,11 @@
|
||||
import { AppFormProps } from '/@/model/generator/appFormConfig';
|
||||
import { addMobileFunc, editMobileFuncData, getMobileFuncInfo } from '/@/api/mobileDesign';
|
||||
import DesignLogo from '/@/components/ModalPanel/src/DesignLogo.vue';
|
||||
import {
|
||||
downloadCodes,
|
||||
} from '/@/api/system/generator';
|
||||
import { downloadByData } from '/@/utils/file/download';
|
||||
import { dateUtil } from '/@/utils/dateUtil';
|
||||
|
||||
const { t } = useI18n();
|
||||
const TableConfigStep = defineAsyncComponent({
|
||||
@ -229,16 +247,16 @@
|
||||
handleClose();
|
||||
emit('success');
|
||||
}
|
||||
async function handleCodeGenerator() {
|
||||
async function handleCodeGenerator(actionType:String) {
|
||||
const isOk = await stepValidate[5]();
|
||||
if (!isOk) {
|
||||
return;
|
||||
}
|
||||
await setParams(enabledMark.value);
|
||||
await setParams(enabledMark.value, actionType);
|
||||
handleClose();
|
||||
emit('success');
|
||||
}
|
||||
async function setParams(enabledMark) {
|
||||
async function setParams(enabledMark, actionType?:String) {
|
||||
if (
|
||||
generatorConfig.formJson?.hiddenComponent &&
|
||||
generatorConfig.formJson?.hiddenComponent.length
|
||||
@ -273,12 +291,22 @@
|
||||
if (data.formType === 1) {
|
||||
data.isGeneratorCode = generatorConfig!.outputConfig!.createCode ? 1 : 0;
|
||||
}
|
||||
data.actionType=actionType;
|
||||
let result;
|
||||
if (templateId.value) {
|
||||
data.id = templateId.value;
|
||||
data.appMenuId = appMenuId.value;
|
||||
await editMobileFuncData(data);
|
||||
result = await editMobileFuncData(data);
|
||||
} else {
|
||||
await addMobileFunc(data);
|
||||
result = await addMobileFunc(data);
|
||||
}
|
||||
if(data.actionType=="packAndDownload"&&result){
|
||||
const fileName=generatorConfig!.outputConfig!.className+'_'+dateUtil(new Date()).format('YYYY-MM-DD_HH_mm_ss');
|
||||
const res = await downloadCodes({uuid:result});
|
||||
downloadByData(
|
||||
res.data,
|
||||
fileName+".zip"
|
||||
);
|
||||
}
|
||||
}
|
||||
const handleClose = () => {
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item :label="t('绑定字段')" v-if="!noHaveField.includes(data.type)">
|
||||
<a-select :value="data.bindField" size="mini" :placeholder="t('请选择表字段')" disabled>
|
||||
<a-select :value="data.bindField" size="mini" showSearch :placeholder="t('请选择表字段')" disabled>
|
||||
<a-select-option v-for="(field, idx) in fieldsInfo" :value="field.name" :key="idx">
|
||||
{{ field.name }}
|
||||
<span>
|
||||
|
||||
Reference in New Issue
Block a user