From dc9e62b2bdf2d41c7ec6f4f94a9ca26fccc1534c Mon Sep 17 00:00:00 2001 From: wuqun Date: Mon, 6 Mar 2023 10:33:48 +0800 Subject: [PATCH] =?UTF-8?q?(*)=E7=82=B9=E4=BD=8D=E6=96=B0=E5=A2=9E"?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=BC=96=E5=8F=B7"=E3=80=81=E2=80=9C?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=9E=8B=E5=8F=B7=E2=80=9D=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../projectRegime/projectSituation.js | 4 ++-- api/app/lib/models/point.js | 18 ++++++++++++++++++ script/1.0.5/schema/1.point_add.sql | 7 +++++++ .../projectRegime/components/pointModel.js | 10 +++++++++- 4 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 script/1.0.5/schema/1.point_add.sql diff --git a/api/app/lib/controllers/projectRegime/projectSituation.js b/api/app/lib/controllers/projectRegime/projectSituation.js index 710c1f4..dc67138 100644 --- a/api/app/lib/controllers/projectRegime/projectSituation.js +++ b/api/app/lib/controllers/projectRegime/projectSituation.js @@ -164,10 +164,10 @@ async function addPosition(ctx, next) { const models = ctx.fs.dc.models; let userInfo = ctx.fs.api.userInfo; const data = ctx.request.body; - const { longitude, latitude, name, describe, qrCode, projectId, img } = data; + const { longitude, latitude, name, describe, qrCode, projectId, img, equipmentNo, equipmentModel } = data; let errMsg = data.id ? '点位编辑失败' : '点位新增失败' - let pointData = { longitude, latitude, name, describe, qrCode, projectId, img } + let pointData = { longitude, latitude, name, describe, qrCode, projectId, img, equipmentNo, equipmentModel } const alikeProject = await models.Point.findOne({ where: { diff --git a/api/app/lib/models/point.js b/api/app/lib/models/point.js index 34ec3e0..b59312d 100644 --- a/api/app/lib/models/point.js +++ b/api/app/lib/models/point.js @@ -78,6 +78,24 @@ module.exports = dc => { field: "img", autoIncrement: false }, + equipmentNo: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: null, + primaryKey: false, + field: "equipment_no", + autoIncrement: false + }, + equipmentModel: { + type: DataTypes.STRING, + allowNull: true, + defaultValue: null, + comment: null, + primaryKey: false, + field: "equipment_model", + autoIncrement: false + } }, { tableName: "point", comment: "", diff --git a/script/1.0.5/schema/1.point_add.sql b/script/1.0.5/schema/1.point_add.sql new file mode 100644 index 0000000..afa490d --- /dev/null +++ b/script/1.0.5/schema/1.point_add.sql @@ -0,0 +1,7 @@ + + +alter table point + add equipment_no varchar(255); + +alter table point + add equipment_model varchar(255); \ No newline at end of file diff --git a/web/client/src/sections/projectRegime/components/pointModel.js b/web/client/src/sections/projectRegime/components/pointModel.js index 5fc2bf1..da2aa37 100644 --- a/web/client/src/sections/projectRegime/components/pointModel.js +++ b/web/client/src/sections/projectRegime/components/pointModel.js @@ -164,8 +164,16 @@ const ProjectAddModel = ({ dispatch, actions, user, modelData, close, success, q rules={[{ required: true, message: '请输入描述内容', },]}>