diff --git a/api/app/lib/controllers/adapter/index.js b/api/app/lib/controllers/metadataAcquisition/adapter.js
similarity index 60%
rename from api/app/lib/controllers/adapter/index.js
rename to api/app/lib/controllers/metadataAcquisition/adapter.js
index a631665..7430cfa 100644
--- a/api/app/lib/controllers/adapter/index.js
+++ b/api/app/lib/controllers/metadataAcquisition/adapter.js
@@ -26,8 +26,26 @@ function checkConnect(opts) {
}
}
+// 新增适配器
+function addAdapter(opts) {
+ return async function (ctx, next) {
+
+ const models = ctx.fs.dc.models;
+ try {
+ let rslt = ctx.request.body;
+ await models.Adapter.create(Object.assign({}, rslt))
+ ctx.status = 204;
+ ctx.body = { message: '新建适配器成功' }
+ } catch (error) {
+ ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
+ ctx.status = 400;
+ ctx.body = { message: '新建适配器失败' }
+ }
+ }
+}
+
module.exports = {
checkConnect,
-
+ addAdapter
}
\ No newline at end of file
diff --git a/api/app/lib/controllers/metadataAcquisition/dataSource.js b/api/app/lib/controllers/metadataAcquisition/dataSource.js
new file mode 100644
index 0000000..40dabae
--- /dev/null
+++ b/api/app/lib/controllers/metadataAcquisition/dataSource.js
@@ -0,0 +1,24 @@
+'use strict';
+
+// 新增数据源
+function addDataSource(opts) {
+ return async function (ctx, next) {
+
+ const models = ctx.fs.dc.models;
+ try {
+ let rslt = ctx.request.body;
+ await models.DataSource.create(Object.assign({}, rslt))
+ ctx.status = 204;
+ ctx.body = { message: '新建数据源成功' }
+ } catch (error) {
+ ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
+ ctx.status = 400;
+ ctx.body = { message: '新建数据源失败' }
+ }
+ }
+}
+
+
+module.exports = {
+ addDataSource,
+}
\ No newline at end of file
diff --git a/api/app/lib/controllers/metadataAcquisition/log.js b/api/app/lib/controllers/metadataAcquisition/log.js
new file mode 100644
index 0000000..e69de29
diff --git a/api/app/lib/controllers/metadataAcquisition/plan.js b/api/app/lib/controllers/metadataAcquisition/plan.js
new file mode 100644
index 0000000..e69de29
diff --git a/api/app/lib/routes/adapter/index.js b/api/app/lib/routes/adapter/index.js
deleted file mode 100644
index a98eac8..0000000
--- a/api/app/lib/routes/adapter/index.js
+++ /dev/null
@@ -1,12 +0,0 @@
-'use strict';
-
-const model = require('../../controllers/adapter/index');
-
-module.exports = function (app, router, opts, AuthCode) {
-
- app.fs.api.logAttr['POST/adapter/check/connect'] = { content: '增加模型信息', visible: true };
- router.post('/adapter/check/connect', model.checkConnect(opts))
-
-
-
-};
diff --git a/api/app/lib/routes/metadataAcquisition/adapter.js b/api/app/lib/routes/metadataAcquisition/adapter.js
new file mode 100644
index 0000000..db3184e
--- /dev/null
+++ b/api/app/lib/routes/metadataAcquisition/adapter.js
@@ -0,0 +1,14 @@
+'use strict';
+
+const adapter = require('../../controllers/metadataAcquisition/adapter');
+
+module.exports = function (app, router, opts, AuthCode) {
+
+ app.fs.api.logAttr['POST/adapter/check/connect'] = { content: '测试适配器连接', visible: true };
+ router.post('/adapter/check/connect', adapter.checkConnect(opts))
+
+ app.fs.api.logAttr['POST/adapter'] = { content: '增加适配器', visible: true };
+ router.post('/adapter', adapter.addAdapter(opts))
+
+
+};
diff --git a/api/app/lib/routes/metadataAcquisition/dataSource.js b/api/app/lib/routes/metadataAcquisition/dataSource.js
new file mode 100644
index 0000000..13d23d2
--- /dev/null
+++ b/api/app/lib/routes/metadataAcquisition/dataSource.js
@@ -0,0 +1,12 @@
+'use strict';
+
+const dataSource = require('../../controllers/metadataAcquisition/dataSource');
+
+module.exports = function (app, router, opts, AuthCode) {
+
+ app.fs.api.logAttr['POST/meta/acq/dataSource'] = { content: '增加模型信息', visible: true };
+ router.post('/meta/acq/dataSource', dataSource.addDataSource(opts))
+
+
+
+};
diff --git a/web/client/src/sections/metadataAcquisition/components/adapterStep.js b/web/client/src/sections/metadataAcquisition/components/adapterStep.js
index 39142b8..2bf67a5 100644
--- a/web/client/src/sections/metadataAcquisition/components/adapterStep.js
+++ b/web/client/src/sections/metadataAcquisition/components/adapterStep.js
@@ -6,7 +6,8 @@ import { STEP_CONFIG } from './steps/index';
const AdapterStep = (props) => {
const { type } = props;
const [current, setCurrent] = useState(0);
- const [stepOneValues, setStepOneValues] = useState(0);
+ const [stepOneValues, setStepOneValues] = useState();
+ const [stepTwoValues, setStepTwoValues] = useState({});
const { StepOne, StepTwo, StepThree } = STEP_CONFIG[type]; //记录第一页表单数据用于切换步骤时展示上一次填写的值
const next = () => {
@@ -19,6 +20,9 @@ const AdapterStep = (props) => {
const stepOneValuesFinish = (values) => {
setStepOneValues(values)
}
+ const stepTwoValuesFinish = (values) => {
+ setStepTwoValues(values)
+ }
const steps = [
{
@@ -27,7 +31,7 @@ const AdapterStep = (props) => {
},
{
title: '数据源参数配置',
- content: