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: '请输入描述内容', },]}> +