mirror of https://github.com/certd/certd
parent
f7fc06e657
commit
a2c43b50a6
|
@ -0,0 +1,19 @@
|
||||||
|
import _ from "lodash-es";
|
||||||
|
import { compute } from "@fast-crud/fast-crud";
|
||||||
|
|
||||||
|
export function useReference(form: any) {
|
||||||
|
if (!form.reference) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (const reference of form.reference) {
|
||||||
|
debugger;
|
||||||
|
_.set(
|
||||||
|
form,
|
||||||
|
reference.dest,
|
||||||
|
compute<any>((scope) => {
|
||||||
|
debugger;
|
||||||
|
return _.get(scope, reference.src);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,5 +1,7 @@
|
||||||
import { compute, CreateCrudOptionsRet, dict } from "@fast-crud/fast-crud";
|
import { compute, CreateCrudOptionsRet, dict } from "@fast-crud/fast-crud";
|
||||||
import { PluginGroup } from "@certd/pipeline";
|
import { PluginGroup } from "@certd/pipeline";
|
||||||
|
import { useReference } from "/@/use/use-refrence";
|
||||||
|
import _ from "lodash-es";
|
||||||
|
|
||||||
export default function (certPluginGroup: PluginGroup, formWrapperRef: any): CreateCrudOptionsRet {
|
export default function (certPluginGroup: PluginGroup, formWrapperRef: any): CreateCrudOptionsRet {
|
||||||
const inputs: any = {};
|
const inputs: any = {};
|
||||||
|
@ -10,10 +12,11 @@ export default function (certPluginGroup: PluginGroup, formWrapperRef: any): Cre
|
||||||
inputs[inputKey].form.show = true;
|
inputs[inputKey].form.show = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const inputDefine = plugin.input[inputKey];
|
const inputDefine = _.cloneDeep(plugin.input[inputKey]);
|
||||||
if (!inputDefine.required && !inputDefine.maybeNeed) {
|
if (!inputDefine.required && !inputDefine.maybeNeed) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
useReference(inputDefine);
|
||||||
inputs[inputKey] = {
|
inputs[inputKey] = {
|
||||||
title: inputDefine.title,
|
title: inputDefine.title,
|
||||||
form: {
|
form: {
|
||||||
|
|
|
@ -59,7 +59,7 @@ const development = {
|
||||||
type: 'better-sqlite3',
|
type: 'better-sqlite3',
|
||||||
database: './data/db.sqlite',
|
database: './data/db.sqlite',
|
||||||
synchronize: false, // 如果第一次使用,不存在表,有同步的需求可以写 true
|
synchronize: false, // 如果第一次使用,不存在表,有同步的需求可以写 true
|
||||||
logging: true,
|
logging: false,
|
||||||
|
|
||||||
// 配置实体模型 或者 entities: '/entity',
|
// 配置实体模型 或者 entities: '/entity',
|
||||||
entities: ['**/modules/*/entity/*.ts', '**/entity/*.js', '**/entity/*.d.ts', PipelineEntity, FlywayHistory, UserEntity],
|
entities: ['**/modules/*/entity/*.ts', '**/entity/*.js', '**/entity/*.d.ts', PipelineEntity, FlywayHistory, UserEntity],
|
||||||
|
|
|
@ -8,6 +8,13 @@ const preview = {
|
||||||
preview: {
|
preview: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
},
|
},
|
||||||
|
typeorm: {
|
||||||
|
dataSource: {
|
||||||
|
default: {
|
||||||
|
logging: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
} as MidwayConfig;
|
} as MidwayConfig;
|
||||||
|
|
||||||
mergeConfig(preview, 'preview');
|
mergeConfig(preview, 'preview');
|
||||||
|
|
|
@ -8,6 +8,13 @@ const production = {
|
||||||
preview: {
|
preview: {
|
||||||
enabled: false,
|
enabled: false,
|
||||||
},
|
},
|
||||||
|
typeorm: {
|
||||||
|
dataSource: {
|
||||||
|
default: {
|
||||||
|
logging: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
} as MidwayConfig;
|
} as MidwayConfig;
|
||||||
|
|
||||||
mergeConfig(production, 'production');
|
mergeConfig(production, 'production');
|
||||||
|
|
Loading…
Reference in New Issue