From 043c9ad35a9caf6269b3abc4b372121433283e7f Mon Sep 17 00:00:00 2001 From: wenlele Date: Wed, 16 Nov 2022 11:05:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=A0=E5=B0=84=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/.vscode/launch.json | 4 ++-- api/app/lib/controllers/project/bind.js | 5 ++-- api/app/lib/models/project_correlation.js | 9 ++++++++ .../schema/1.alter_project_correlation.sql | 4 ++++ .../install/components/systemModal.jsx | 23 +++++++++++++++++++ 5 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 script/0.0.9/schema/1.alter_project_correlation.sql diff --git a/api/.vscode/launch.json b/api/.vscode/launch.json index 7f1fd17..5e3848a 100644 --- a/api/.vscode/launch.json +++ b/api/.vscode/launch.json @@ -16,9 +16,9 @@ "-p 4600", "-f http://localhost:4600", // 研发 - // "-g postgres://postgres:123@10.8.30.32:5432/orational_service", + "-g postgres://postgres:123@10.8.30.32:5432/orational_service", // 测试 - "-g postgres://FashionAdmin:123456@10.8.30.156:5432/POMS", + // "-g postgres://FashionAdmin:123456@10.8.30.156:5432/POMS", "-k 10.8.30.72:29092,10.8.30.73:29092,10.8.30.74:29092", "--iotaProxy http://10.8.30.157:17007", "--redisHost 10.8.30.112", diff --git a/api/app/lib/controllers/project/bind.js b/api/app/lib/controllers/project/bind.js index b93a1e0..06d25c2 100644 --- a/api/app/lib/controllers/project/bind.js +++ b/api/app/lib/controllers/project/bind.js @@ -7,7 +7,7 @@ async function bindAnxin2pep (ctx) { const models = ctx.fs.dc.models; const { clickHouse } = ctx.app.fs const { userId, pepUserId } = ctx.fs.api - const { bindId, name, pepProjectId, anxinProjectId = [], appId = [] } = ctx.request.body + const { bindId, name, pepProjectId, anxinProjectId = [], appId = [], mappingClass } = ctx.request.body if (name && pepProjectId) { throw '项企项目与自定义项目名称仅可选择一项' @@ -18,7 +18,7 @@ async function bindAnxin2pep (ctx) { let storageData = { name, pepProjectId, anxinProjectId, - updateTime: now, + updateTime: now, mappingClass, del: false, } @@ -111,6 +111,7 @@ async function bindAnxin2pep (ctx) { }, transaction }) + bindId_ = existRes.id } else { // 没有删除 重复添加 throw '当前项企项目已绑定' diff --git a/api/app/lib/models/project_correlation.js b/api/app/lib/models/project_correlation.js index b0ae1be..b1b5990 100644 --- a/api/app/lib/models/project_correlation.js +++ b/api/app/lib/models/project_correlation.js @@ -78,6 +78,15 @@ module.exports = dc => { field: "update_time", autoIncrement: false }, + mappingClass: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: null, + primaryKey: false, + field: "mapping_class", + autoIncrement: false + }, }, { tableName: "project_correlation", comment: "", diff --git a/script/0.0.9/schema/1.alter_project_correlation.sql b/script/0.0.9/schema/1.alter_project_correlation.sql new file mode 100644 index 0000000..37edd7b --- /dev/null +++ b/script/0.0.9/schema/1.alter_project_correlation.sql @@ -0,0 +1,4 @@ +alter table project_correlation + add mapping_class varchar(32); + +comment on column project_correlation.mapping_class is '映射分类参数 例如:智慧类:wisdom,监测类:monitor,其他:other'; diff --git a/web/client/src/sections/install/components/systemModal.jsx b/web/client/src/sections/install/components/systemModal.jsx index b485c8f..48943f9 100644 --- a/web/client/src/sections/install/components/systemModal.jsx +++ b/web/client/src/sections/install/components/systemModal.jsx @@ -235,6 +235,29 @@ function adminModal (props) { }) } + + { + [ + { name: '智慧类', value: 'wisdom' }, + { name: '监测类', value: 'monitor' }, + { name: '其他', value: 'other' } + ].map(item => { + return + {item.name} + + }) + } +