Browse Source

(*)点位新增"设备编号"、“设备型号”字段

master
wuqun 2 years ago
parent
commit
dc9e62b2bd
  1. 4
      api/app/lib/controllers/projectRegime/projectSituation.js
  2. 18
      api/app/lib/models/point.js
  3. 7
      script/1.0.5/schema/1.point_add.sql
  4. 10
      web/client/src/sections/projectRegime/components/pointModel.js

4
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: {

18
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: "",

7
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);

10
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: '请输入描述内容', },]}>
<TextArea />
</Form.Item>
<Form.Item label='设备编号' name="equipmentNo" style={{}}
initialValue={modelData?.equipmentNo}>
<Input placeholder="请输入设备编号" allowClear />
</Form.Item>
<Form.Item label='设备型号' name="equipmentModel" style={{}}
initialValue={modelData?.equipmentModel}>
<Input placeholder="请输入设备型号" allowClear />
</Form.Item>
<Form.Item
label="结构物图片"
label="点位图片"
name='img'
help={<div style={{ fontSize: 12 }}>说明请上传pngjpg格式图片图片大小不超过10M</div>}
>

Loading…
Cancel
Save