Archer_cdm
2 years ago
52 changed files with 1038 additions and 2537 deletions
@ -0,0 +1,113 @@ |
|||
'use strict'; |
|||
|
|||
async function getPatrolPlan(ctx, next) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { limit, page } = ctx.query; |
|||
let options = { |
|||
include: [{ |
|||
required: true, |
|||
model: models.User, |
|||
attributes: ['id', 'name'], |
|||
include: [{ |
|||
required: true, |
|||
model: models.Department, |
|||
attributes: ['id', 'name'], |
|||
}] |
|||
}, { |
|||
required: true, |
|||
model: models.Project, |
|||
attributes: ['id', 'name'], |
|||
}] |
|||
}; |
|||
if (limit) { |
|||
options.limit = Number(limit); |
|||
} |
|||
if (page && limit) { |
|||
options.offset = Number(page) * Number(limit); |
|||
} |
|||
let res = await models.PatrolPlan.findAndCountAll(options); |
|||
ctx.status = 200; |
|||
ctx.body = res; |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
"message": "获取巡检计划失败" |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function createPatrolPlan(ctx, next) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const data = ctx.request.body; |
|||
const { name, way, structureId, startTime, endTime, frequency, points, userId } = data; |
|||
|
|||
let plan = { name, way, structureId, startTime, endTime, frequency, points, userId }; |
|||
|
|||
await models.PatrolPlan.create(plan); |
|||
|
|||
ctx.status = 204; |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
"message": '新增巡检计划失败' |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function updatePatrolPlan(ctx, next) { |
|||
try { |
|||
let errMsg = '修改巡检计划失败'; |
|||
const models = ctx.fs.dc.models; |
|||
const data = ctx.request.body; |
|||
const { name, way, structureId, startTime, endTime, frequency, points, userId } = data; |
|||
|
|||
let plan = { name, way, structureId, startTime, endTime, frequency, points, userId }; |
|||
|
|||
if (data && data.id) { |
|||
await models.PatrolPlan.update(plan, { |
|||
where: { id: data.id } |
|||
}) |
|||
} else { |
|||
errMsg = '请传入巡检计划id'; |
|||
throw errMsg; |
|||
} |
|||
|
|||
ctx.status = 204; |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
"message": errMsg |
|||
} |
|||
} |
|||
} |
|||
|
|||
async function delPatrolPlan(ctx, next) { |
|||
try { |
|||
const models = ctx.fs.dc.models; |
|||
const { id } = ctx.params; |
|||
|
|||
await models.PatrolPlan.destroy({ |
|||
where: { id } |
|||
}) |
|||
|
|||
ctx.status = 204; |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = { |
|||
"message": '删除巡检计划失败' |
|||
} |
|||
} |
|||
} |
|||
|
|||
module.exports = { |
|||
getPatrolPlan, |
|||
createPatrolPlan, |
|||
updatePatrolPlan, |
|||
delPatrolPlan, |
|||
} |
@ -1,98 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const Camera = sequelize.define("camera", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "camera_id_uindex" |
|||
}, |
|||
siteId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "工地id", |
|||
primaryKey: false, |
|||
field: "site_id", |
|||
autoIncrement: false, |
|||
}, |
|||
userId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "工地id", |
|||
primaryKey: false, |
|||
field: "user_id", |
|||
autoIncrement: false, |
|||
}, |
|||
name: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "name", |
|||
autoIncrement: false |
|||
}, |
|||
type: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "type", |
|||
autoIncrement: false |
|||
}, |
|||
online: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "online", |
|||
autoIncrement: false |
|||
}, |
|||
channelNo: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "channelNo", |
|||
autoIncrement: false |
|||
}, |
|||
serialNo: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "serialNo", |
|||
autoIncrement: false |
|||
}, |
|||
vender: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "vender", |
|||
autoIncrement: false |
|||
}, |
|||
|
|||
}, { |
|||
tableName: "camera", |
|||
comment: "摄像头", |
|||
indexes: [] |
|||
}); |
|||
dc.models.Camera = Camera; |
|||
return Camera; |
|||
}; |
@ -1,52 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const Company = sequelize.define("company", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "company_id_uindex" |
|||
}, |
|||
name: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "name", |
|||
autoIncrement: false |
|||
}, |
|||
relateSites: { |
|||
type: DataTypes.ARRAY(DataTypes.INTEGER), |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "relate_sites", |
|||
autoIncrement: false |
|||
}, |
|||
del: { |
|||
type: DataTypes.BOOLEAN, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "del", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "company", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.Company = Company; |
|||
return Company; |
|||
}; |
@ -1,130 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
|
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const Coordinate = sequelize.define("coordinate", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
}, |
|||
siteId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: '工地id', |
|||
primaryKey: false, |
|||
field: "site_id", |
|||
autoIncrement: false |
|||
}, |
|||
title: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: '申请协调标题', |
|||
primaryKey: false, |
|||
field: "title", |
|||
}, |
|||
emergencyDegree: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: '紧急程度', |
|||
primaryKey: false, |
|||
field: "emergency_degree", |
|||
}, |
|||
status: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: '协调状态', |
|||
primaryKey: false, |
|||
field: "status", |
|||
}, |
|||
time: { |
|||
type: DataTypes.DATE, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: '申请时间', |
|||
primaryKey: false, |
|||
field: "time", |
|||
}, |
|||
describe: { |
|||
type: DataTypes.TEXT, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: '申请描述', |
|||
primaryKey: false, |
|||
field: "describe", |
|||
}, |
|||
accessory: { |
|||
type: DataTypes.JSON, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: '附件', |
|||
primaryKey: false, |
|||
field: "accessory", |
|||
}, |
|||
name: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: '申请人', |
|||
primaryKey: false, |
|||
field: "name", |
|||
}, |
|||
applySite: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: '申请工地', |
|||
primaryKey: false, |
|||
field: "apply_site", |
|||
}, |
|||
coordinateTime: { |
|||
type: DataTypes.DATE, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: '协调时间', |
|||
primaryKey: false, |
|||
field: "coordinate_time", |
|||
}, |
|||
coordinator: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: '协调人', |
|||
primaryKey: false, |
|||
field: "coordinator", |
|||
}, |
|||
coordinateDescribe: { |
|||
type: DataTypes.TEXT, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: '协调描述', |
|||
primaryKey: false, |
|||
field: "coordinate_describe", |
|||
}, |
|||
coordinateFile: { |
|||
type: DataTypes.JSON, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: '协调附件', |
|||
primaryKey: false, |
|||
field: "coordinate_file", |
|||
}, |
|||
}, { |
|||
tableName: "coordinate", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.Coordinate = Coordinate; |
|||
return Coordinate; |
|||
}; |
@ -1,89 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
|
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const HideDangerDispose = sequelize.define("hideDangerDispose", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "hide_danger_dispose_id_uindex" |
|||
}, |
|||
rectifySiteId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "rectify_site_id", |
|||
autoIncrement: false |
|||
}, |
|||
disposeUser: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "dispose_user", |
|||
autoIncrement: false |
|||
}, |
|||
disposeTime: { |
|||
type: DataTypes.DATE, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "dispose_time", |
|||
autoIncrement: false |
|||
}, |
|||
describe: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "describe", |
|||
autoIncrement: false |
|||
}, |
|||
file: { |
|||
type: DataTypes.ARRAY(DataTypes.STRING), |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "file", |
|||
autoIncrement: false |
|||
}, |
|||
type: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "1:整改 2:审核 3:复审", |
|||
primaryKey: false, |
|||
field: "type", |
|||
autoIncrement: false |
|||
}, |
|||
admit: { |
|||
type: DataTypes.BOOLEAN, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "是否通过审核", |
|||
primaryKey: false, |
|||
field: "admit", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "hide_danger_dispose", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.HideDangerDispose = HideDangerDispose; |
|||
return HideDangerDispose; |
|||
}; |
@ -1,107 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
|
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const HideDangerRectify = sequelize.define("hideDangerRectify", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "hide_danger_rectify_id_uindex" |
|||
}, |
|||
name: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "name", |
|||
autoIncrement: false |
|||
}, |
|||
places: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "places", |
|||
autoIncrement: false |
|||
}, |
|||
type: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "type", |
|||
autoIncrement: false |
|||
}, |
|||
level: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "level", |
|||
autoIncrement: false |
|||
}, |
|||
desc: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "desc", |
|||
autoIncrement: false |
|||
}, |
|||
deadline: { |
|||
type: DataTypes.DATE, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "deadline", |
|||
autoIncrement: false |
|||
}, |
|||
user: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "user", |
|||
autoIncrement: false |
|||
}, |
|||
createTime: { |
|||
type: DataTypes.DATE, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "create_time", |
|||
autoIncrement: false |
|||
}, |
|||
from: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "1:集团 2:公司 3:项目", |
|||
primaryKey: false, |
|||
field: "from", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "hide_danger_rectify", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.HideDangerRectify = HideDangerRectify; |
|||
return HideDangerRectify; |
|||
}; |
@ -1,62 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
|
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const HideDangerRectifySites = sequelize.define("hideDangerRectifySites", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "hide_danger_rectify_sites_id_uindex" |
|||
}, |
|||
rectifyId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "rectify_id", |
|||
autoIncrement: false |
|||
}, |
|||
siteId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "site_id", |
|||
autoIncrement: false |
|||
}, |
|||
status: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "0: 已下发, 待整改,\n1: 已整改, 待审核,\n2: 审核通过, 待复审,\n3: 审核未通过, 待重新整改,\n4: 复审未通过, 待重新整改,\n5: 整改完成", |
|||
primaryKey: false, |
|||
field: "status", |
|||
autoIncrement: false |
|||
}, |
|||
lastDisposeTime: { |
|||
type: DataTypes.DATE, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "last_dispose_time", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "hide_danger_rectify_sites", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.HideDangerRectifySites = HideDangerRectifySites; |
|||
return HideDangerRectifySites; |
|||
}; |
@ -1,88 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const HideDangerReport = sequelize.define("hideDangerReport", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "hide_danger_report_id_uindex" |
|||
}, |
|||
siteCount: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: "0", |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "site_count", |
|||
autoIncrement: false |
|||
}, |
|||
rectifyCount: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: "0", |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "rectify_count", |
|||
autoIncrement: false |
|||
}, |
|||
completedRectifyCount: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: "0", |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "completed_rectify_count", |
|||
autoIncrement: false |
|||
}, |
|||
uncompletedRectifyCount: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: "0", |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "uncompleted_rectify_count", |
|||
autoIncrement: false |
|||
}, |
|||
report: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "report", |
|||
autoIncrement: false |
|||
}, |
|||
type: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "month 月 / quarter 季度 / year 年", |
|||
primaryKey: false, |
|||
field: "type", |
|||
autoIncrement: false |
|||
}, |
|||
time: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "time", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "hide_danger_report", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.HideDangerReport = HideDangerReport; |
|||
return HideDangerReport; |
|||
}; |
@ -1,115 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const Metting = sequelize.define("metting", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "metting_id_uindex" |
|||
}, |
|||
siteId: { |
|||
type: DataTypes.INTEGER, |
|||
//allowNull: false,
|
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "site_id", |
|||
autoIncrement: false |
|||
}, |
|||
name: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "name", |
|||
autoIncrement: false |
|||
}, |
|||
type: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "type", |
|||
autoIncrement: false |
|||
}, |
|||
desc: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "desc", |
|||
autoIncrement: false |
|||
}, |
|||
signFile: { |
|||
type: DataTypes.ARRAY(DataTypes.STRING), |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "sign_file", |
|||
autoIncrement: false |
|||
}, |
|||
recordingVideo: { |
|||
type: DataTypes.ARRAY(DataTypes.STRING), |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "recording_video", |
|||
autoIncrement: false |
|||
}, |
|||
attachments: { |
|||
type: DataTypes.ARRAY(DataTypes.STRING), |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "attachments", |
|||
autoIncrement: false |
|||
}, |
|||
submitUser: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "submit_user", |
|||
autoIncrement: false |
|||
}, |
|||
submitTime: { |
|||
type: DataTypes.DATE, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "submit_time", |
|||
autoIncrement: false |
|||
}, |
|||
date: { |
|||
type: DataTypes.DATEONLY, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "date", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "metting", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.Metting = Metting; |
|||
return Metting; |
|||
}; |
@ -1,60 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const PhoneValidateCode = sequelize.define("phoneValidateCode", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true |
|||
}, |
|||
phone: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "phone", |
|||
autoIncrement: false |
|||
}, |
|||
code: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "code", |
|||
autoIncrement: false |
|||
}, |
|||
sig: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "sig", |
|||
autoIncrement: false |
|||
}, |
|||
expired: { |
|||
type: DataTypes.DATE, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "expired", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "phone_validate_code", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.PhoneValidateCode = PhoneValidateCode; |
|||
return PhoneValidateCode; |
|||
}; |
@ -1,69 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const Post = sequelize.define("post", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "post_id_uindex" |
|||
}, |
|||
name: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "name", |
|||
autoIncrement: false |
|||
}, |
|||
companyId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "company_id", |
|||
autoIncrement: false, |
|||
references: { |
|||
key: "id", |
|||
model: "tCompany" |
|||
} |
|||
}, |
|||
departmentId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "department_id", |
|||
autoIncrement: false, |
|||
references: { |
|||
key: "id", |
|||
model: "tDepartment" |
|||
} |
|||
}, |
|||
del: { |
|||
type: DataTypes.BOOLEAN, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "del", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "post", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.Post = Post; |
|||
return Post; |
|||
}; |
@ -1,59 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
|
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const ProblemReportConsult = sequelize.define("problemReportConsult", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
}, |
|||
siteId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: '工地id', |
|||
primaryKey: false, |
|||
field: "site_id", |
|||
autoIncrement: false |
|||
}, |
|||
problemId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: '问题id', |
|||
primaryKey: false, |
|||
field: "problem_id", |
|||
}, |
|||
name: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: '查阅人员', |
|||
primaryKey: false, |
|||
field: "name", |
|||
}, |
|||
time: { |
|||
type: DataTypes.DATE, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: '查阅时间', |
|||
primaryKey: false, |
|||
field: "time", |
|||
}, |
|||
|
|||
}, { |
|||
tableName: "problem_report_consult", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.ProblemReportConsult = ProblemReportConsult; |
|||
return ProblemReportConsult; |
|||
}; |
@ -1,64 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const ProblemReportFile = sequelize.define("problemReportFile", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true |
|||
}, |
|||
reportId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "reportId", |
|||
autoIncrement: false, |
|||
references: { |
|||
key: "id", |
|||
model: "tProblemReport" |
|||
} |
|||
}, |
|||
filePath: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "filePath", |
|||
autoIncrement: false |
|||
}, |
|||
fileSize: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "fileSize", |
|||
autoIncrement: false |
|||
}, |
|||
fileName: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "fileName", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "problem_report_file", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.ProblemReportFile = ProblemReportFile; |
|||
return ProblemReportFile; |
|||
}; |
@ -1,70 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const ProjectDisclosure = sequelize.define("projectDisclosure", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "project_disclosure_id_uindex" |
|||
}, |
|||
siteId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "site_id", |
|||
autoIncrement: false |
|||
}, |
|||
type: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "type", |
|||
autoIncrement: false |
|||
}, |
|||
desc: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "desc", |
|||
autoIncrement: false |
|||
}, |
|||
submiter: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "submiter", |
|||
autoIncrement: false |
|||
}, |
|||
submitTime: { |
|||
type: DataTypes.DATE, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "submit_time", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "project_disclosure", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.ProjectDisclosure = ProjectDisclosure; |
|||
return ProjectDisclosure; |
|||
}; |
@ -1,65 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const ProjectDisclosureFiles = sequelize.define("projectDisclosureFiles", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "project_disclosure_files_id_uindex" |
|||
}, |
|||
projectDisclosureId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "project_disclosure_id", |
|||
autoIncrement: false, |
|||
references: { |
|||
key: "id", |
|||
model: "projectDisclosure" |
|||
} |
|||
}, |
|||
fileName: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "file_name", |
|||
autoIncrement: false |
|||
}, |
|||
fileSize: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "file_size", |
|||
autoIncrement: false |
|||
}, |
|||
fileLink: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "file_link", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "project_disclosure_files", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.ProjectDisclosureFiles = ProjectDisclosureFiles; |
|||
return ProjectDisclosureFiles; |
|||
}; |
@ -1,170 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
|
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const RiskReport = sequelize.define("riskReport", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "table_name_id_uindex" |
|||
}, |
|||
siteId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "site_id", |
|||
autoIncrement: false |
|||
}, |
|||
name: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "name", |
|||
autoIncrement: false |
|||
}, |
|||
riskLevel: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "风险等级", |
|||
primaryKey: false, |
|||
field: "risk_level", |
|||
autoIncrement: false |
|||
}, |
|||
specialType: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "特种作业类型", |
|||
primaryKey: false, |
|||
field: "special_type", |
|||
autoIncrement: false |
|||
}, |
|||
contentFiles: { |
|||
type: DataTypes.JSON, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "content_files", |
|||
autoIncrement: false |
|||
}, |
|||
content: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "施工内容描述", |
|||
primaryKey: false, |
|||
field: "content", |
|||
autoIncrement: false |
|||
}, |
|||
phone: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "联系方式", |
|||
primaryKey: false, |
|||
field: "phone", |
|||
autoIncrement: false |
|||
}, |
|||
guardian: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "现场监护人", |
|||
primaryKey: false, |
|||
field: "guardian", |
|||
autoIncrement: false |
|||
}, |
|||
controlMeasuresFiles: { |
|||
type: DataTypes.JSON, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "管控措施附件", |
|||
primaryKey: false, |
|||
field: "control_measures_files", |
|||
autoIncrement: false |
|||
}, |
|||
saftyMeasuresFiles: { |
|||
type: DataTypes.JSON, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "安全措施附件", |
|||
primaryKey: false, |
|||
field: "safty_measures_files", |
|||
autoIncrement: false |
|||
}, |
|||
operationTicketFiles: { |
|||
type: DataTypes.JSON, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "作业票附件", |
|||
primaryKey: false, |
|||
field: "operation_ticket_files", |
|||
autoIncrement: false |
|||
}, |
|||
controlMeasures: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "管控措施描述", |
|||
primaryKey: false, |
|||
field: "control_measures", |
|||
autoIncrement: false |
|||
}, |
|||
saftyMeasures: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "安全措施描述", |
|||
primaryKey: false, |
|||
field: "safty_measures", |
|||
autoIncrement: false |
|||
}, |
|||
operationTicket: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "作业票描述", |
|||
primaryKey: false, |
|||
field: "operation_ticket", |
|||
autoIncrement: false |
|||
}, |
|||
state: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "登记状态", |
|||
primaryKey: false, |
|||
field: "state", |
|||
autoIncrement: false |
|||
}, |
|||
createTime: { |
|||
type: DataTypes.DATE, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "create_time", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "risk_report", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.RiskReport = RiskReport; |
|||
return RiskReport; |
|||
}; |
@ -1,74 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const Role = sequelize.define("role", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "role_id_uindex" |
|||
}, |
|||
name: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "name", |
|||
autoIncrement: false |
|||
}, |
|||
roleGroupId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "role_group_id", |
|||
autoIncrement: false, |
|||
references: { |
|||
key: "id", |
|||
model: "tRoleGroup" |
|||
} |
|||
}, |
|||
type: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: "1:集团 2:公司 3:项目", |
|||
primaryKey: false, |
|||
field: "type", |
|||
autoIncrement: false |
|||
}, |
|||
dataRange: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "1:全公司 2:本人 3:本部门 ", |
|||
primaryKey: false, |
|||
field: "data_range", |
|||
autoIncrement: false |
|||
}, |
|||
del: { |
|||
type: DataTypes.BOOLEAN, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "del", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "role", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.Role = Role; |
|||
return Role; |
|||
}; |
@ -1,43 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const RoleGroup = sequelize.define("roleGroup", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "role_group_id_uindex" |
|||
}, |
|||
name: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "name", |
|||
autoIncrement: false |
|||
}, |
|||
del: { |
|||
type: DataTypes.BOOLEAN, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "del", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "role_group", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.RoleGroup = RoleGroup; |
|||
return RoleGroup; |
|||
}; |
@ -1,47 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const RoleResource = sequelize.define("roleResource", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "role_resource_id_uindex" |
|||
}, |
|||
roleId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "role_id", |
|||
autoIncrement: false, |
|||
references: { |
|||
key: "id", |
|||
model: "tRole" |
|||
} |
|||
}, |
|||
resourceCode: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "resource_code", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "role_resource", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.RoleResource = RoleResource; |
|||
return RoleResource; |
|||
}; |
@ -1,69 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const SafetyCultivate = sequelize.define("safety_cultivate", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
}, |
|||
name: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "name", |
|||
autoIncrement: false |
|||
}, |
|||
interlinkage: { |
|||
type: DataTypes.JSON, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "interlinkage", |
|||
autoIncrement: false |
|||
} , |
|||
type: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "type", |
|||
autoIncrement: false |
|||
}, |
|||
time: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "time", |
|||
autoIncrement: false |
|||
}, |
|||
siteId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "site_id", |
|||
autoIncrement: false |
|||
}, |
|||
}, { |
|||
tableName: "safety_cultivate", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.SafetyCultivate = SafetyCultivate; |
|||
return SafetyCultivate; |
|||
}; |
@ -1,53 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
|
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const UserDealTodo = sequelize.define("userDealTodo", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "user_deal_todo_id_uindex" |
|||
}, |
|||
userId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "user_id", |
|||
autoIncrement: false |
|||
}, |
|||
moduleId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "module_id", |
|||
autoIncrement: false |
|||
}, |
|||
module: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "module", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "user_deal_todo", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.UserDealTodo = UserDealTodo; |
|||
return UserDealTodo; |
|||
}; |
@ -1,51 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const UserDepartment = sequelize.define("userDepartment", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "user_department_id_uindex" |
|||
}, |
|||
userId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "user_id", |
|||
autoIncrement: false, |
|||
references: { |
|||
key: "id", |
|||
model: "tUser" |
|||
} |
|||
}, |
|||
departmentId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "department_id", |
|||
autoIncrement: false, |
|||
references: { |
|||
key: "id", |
|||
model: "tDepartment" |
|||
} |
|||
} |
|||
}, { |
|||
tableName: "user_department", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.UserDepartment = UserDepartment; |
|||
return UserDepartment; |
|||
}; |
@ -1,51 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const UserPost = sequelize.define("userPost", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "user_post_id_uindex" |
|||
}, |
|||
userId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "user_id", |
|||
autoIncrement: false, |
|||
references: { |
|||
key: "id", |
|||
model: "tUser" |
|||
} |
|||
}, |
|||
postId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "post_id", |
|||
autoIncrement: false, |
|||
references: { |
|||
key: "id", |
|||
model: "tPost" |
|||
} |
|||
} |
|||
}, { |
|||
tableName: "user_post", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.UserPost = UserPost; |
|||
return UserPost; |
|||
}; |
@ -1,134 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
|
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const Worker = sequelize.define("worker", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
unique: "worker_id_uindex" |
|||
}, |
|||
siteId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "site_id", |
|||
autoIncrement: false |
|||
}, |
|||
name: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "name", |
|||
autoIncrement: false |
|||
}, |
|||
gender: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "gender", |
|||
autoIncrement: false |
|||
}, |
|||
photo: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "photo", |
|||
autoIncrement: false |
|||
}, |
|||
nation: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "nation", |
|||
autoIncrement: false |
|||
}, |
|||
nativePlace: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "native_place", |
|||
autoIncrement: false |
|||
}, |
|||
idCard: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "id_card", |
|||
autoIncrement: false |
|||
}, |
|||
tel: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "tel", |
|||
autoIncrement: false |
|||
}, |
|||
groupId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "group_id", |
|||
autoIncrement: false |
|||
}, |
|||
workTypeId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "work_type_id", |
|||
autoIncrement: false |
|||
}, |
|||
isLeader: { |
|||
type: DataTypes.BOOLEAN, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "is_leader", |
|||
autoIncrement: false |
|||
}, |
|||
status: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "1:在册,0:已退场", |
|||
primaryKey: false, |
|||
field: "status", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "worker", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.Worker = Worker; |
|||
return Worker; |
|||
}; |
@ -1,74 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
|
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const WorkerAttendance = sequelize.define("workerAttendance", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true, |
|||
}, |
|||
siteId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: '工地id', |
|||
primaryKey: false, |
|||
field: "site_id", |
|||
autoIncrement: false |
|||
}, |
|||
workerId: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: '工人id', |
|||
primaryKey: false, |
|||
field: "worker_id", |
|||
}, |
|||
temperature: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: '体温', |
|||
primaryKey: false, |
|||
field: "temperature", |
|||
}, |
|||
code: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: '健康码', |
|||
primaryKey: false, |
|||
field: "code", |
|||
}, |
|||
type: { |
|||
type: DataTypes.STRING, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: '进出类型', |
|||
primaryKey: false, |
|||
field: "type", |
|||
}, |
|||
time: { |
|||
type: DataTypes.DATE, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: '通行时间', |
|||
primaryKey: false, |
|||
field: "time", |
|||
} |
|||
}, { |
|||
tableName: "worker_attendance", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.WorkerAttendance = WorkerAttendance; |
|||
return WorkerAttendance; |
|||
}; |
@ -1,124 +0,0 @@ |
|||
/* eslint-disable*/ |
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const xunCheckTask = sequelize.define("xuncheckTask", { |
|||
id: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: false, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: true, |
|||
field: "id", |
|||
autoIncrement: true |
|||
}, |
|||
inspectiontaskname: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "inspectiontaskname", |
|||
comment: "巡检任务名", |
|||
autoIncrement: false |
|||
}, |
|||
inspectionnum: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "inspectionnum", |
|||
comment: "巡检频次", |
|||
autoIncrement: false |
|||
}, |
|||
taskperiod: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "taskperiod", |
|||
comment: "任务周期", |
|||
autoIncrement: false |
|||
}, |
|||
checkContent: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "checkContent", |
|||
comment: "巡检点", |
|||
autoIncrement: false |
|||
}, |
|||
contentList: { |
|||
type: DataTypes.JSONB, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
comment: "巡检点列表", |
|||
field: "contentList", |
|||
autoIncrement: false |
|||
}, |
|||
insectionuser: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "insectionuser", |
|||
comment: "巡检人员", |
|||
autoIncrement: false |
|||
}, |
|||
status: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "status", |
|||
comment: "巡检状态", |
|||
autoIncrement: false |
|||
}, |
|||
starTime: { |
|||
type: DataTypes.DATE, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
comment: "巡检开始时间", |
|||
primaryKey: false, |
|||
field: "star_time", |
|||
autoIncrement: false |
|||
}, |
|||
endTime: { |
|||
type: DataTypes.DATE, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "end_time", |
|||
comment: "巡检结束时间", |
|||
autoIncrement: false |
|||
}, |
|||
path: { |
|||
type: DataTypes.JSONB, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: null, |
|||
primaryKey: false, |
|||
field: "path", |
|||
comment: "文件路径", |
|||
autoIncrement: false |
|||
}, |
|||
}, { |
|||
tableName: "t_xuncheck_tasks", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.xunCheckTask = xunCheckTask; |
|||
return xunCheckTask; |
|||
}; |
@ -0,0 +1,17 @@ |
|||
'use strict'; |
|||
|
|||
const patrolPlan = require('../../controllers/patrolPlan/patrolPlan'); |
|||
|
|||
module.exports = function (app, router, opts) { |
|||
app.fs.api.logAttr['GET/patrolPlan'] = { content: '获取巡检计划', visible: false }; |
|||
router.get('/patrolPlan', patrolPlan.getPatrolPlan); |
|||
|
|||
app.fs.api.logAttr['POST/patrolPlan'] = { content: '新增巡检计划', visible: true }; |
|||
router.post('/patrolPlan', patrolPlan.createPatrolPlan); |
|||
|
|||
app.fs.api.logAttr['PUT/patrolPlan'] = { content: '修改巡检计划', visible: true }; |
|||
router.put('/patrolPlan', patrolPlan.updatePatrolPlan); |
|||
|
|||
app.fs.api.logAttr['DELETE/patrolPlan/:id'] = { content: '删除巡检计划', visible: true }; |
|||
router.del('/patrolPlan/:id', patrolPlan.delPatrolPlan); |
|||
}; |
@ -0,0 +1,20 @@ |
|||
DROP SEQUENCE if EXISTS "public"."patrol_plan_id_seq"; |
|||
CREATE SEQUENCE "public"."patrol_plan_id_seq" |
|||
INCREMENT 1 |
|||
MINVALUE 1 |
|||
MAXVALUE 9223372036854775807 |
|||
START 1 |
|||
CACHE 1; |
|||
DROP TABLE IF EXISTS "public"."patrol_plan"; |
|||
CREATE TABLE "public"."patrol_plan" ( |
|||
"id" int4 NOT NULL PRIMARY KEY DEFAULT nextval('patrol_plan_id_seq'::regclass), |
|||
"name" varchar(128) NOT NULL, |
|||
"way" varchar(128), |
|||
"structure_id" int4, |
|||
"start_time" timestamp(6), |
|||
"end_time" timestamp(6), |
|||
"frequency" varchar(64), |
|||
"points" jsonb, |
|||
"user_id" int4, |
|||
"patrol_count" int4 NOT NULL DEFAULT 0 |
|||
); |
@ -1,21 +1,56 @@ |
|||
#FROM repository.anxinyun.cn/base-images/nodejs12:20.10.12.2 |
|||
FROM repository.anxinyun.cn/base-images/nodejs12:20.10.12.2 |
|||
|
|||
COPY . /var/app |
|||
|
|||
WORKDIR /var/app |
|||
|
|||
EXPOSE 8080 |
|||
|
|||
RUN apk update && apk add --no-cache \ |
|||
sudo \ |
|||
curl \ |
|||
build-base \ |
|||
g++ \ |
|||
libpng \ |
|||
libpng-dev \ |
|||
jpeg-dev \ |
|||
pango-dev \ |
|||
cairo-dev \ |
|||
giflib-dev \ |
|||
python \ |
|||
; |
|||
RUN npm config set registry=http://10.8.30.22:7000 |
|||
RUN npm cache clean -f |
|||
|
|||
RUN npm install --registry http://10.8.30.22:7000 --legacy-peer-deps |
|||
RUN export NODE_OPTIONS=--max_old_space_size=4096&&npm run build |
|||
#RUN npm install -g node-gyp |
|||
RUN rm -rf package-lock.json |
|||
RUN npm install --registry http://10.8.30.22:7000 |
|||
RUN npm run build |
|||
RUN rm -rf client/src |
|||
RUN rm -rf node_modules |
|||
|
|||
RUN npm install --production --registry http://10.8.30.22:7000 |
|||
#RUN npm cache clean -f && npm install --production --force --registry http://10.8.30.22:7000 |
|||
|
|||
CMD ["-u", "http://localhost:8088"] |
|||
|
|||
ENTRYPOINT [ "node", "server.js" ] |
|||
|
|||
# FROM registry.cn-hangzhou.aliyuncs.com/fs-devops/node:12-dev as builder |
|||
|
|||
# COPY . /var/app |
|||
|
|||
# WORKDIR /var/app |
|||
|
|||
# EXPOSE 8080 |
|||
|
|||
# RUN npm config set registry=http://10.8.30.22:7000 |
|||
# RUN echo "{\"time\":\"$BUILD_TIMESTAMP\",\"build\": \"$BUILD_NUMBER\",\"revision\": \"$SVN_REVISION_1\",\"URL\":\"$SVN_URL_1\"}" > version.json |
|||
# RUN npm cache clean -f |
|||
# RUN rm -rf package-lock.json |
|||
# RUN npm install --registry http://10.8.30.22:7000 |
|||
# RUN npm run build |
|||
# RUN rm -rf client/src |
|||
# RUN rm -rf node_modules |
|||
# RUN npm install --production --force --registry http://10.8.30.22:7000 |
|||
# FROM registry.cn-hangzhou.aliyuncs.com/fs-devops/node:12 |
|||
|
|||
# COPY --from=builder --chown=node /var/app /home/node/app |
|||
|
|||
# WORKDIR /home/node/app |
|||
|
|||
# CMD ["node", "server.js"] |
After Width: | Height: | Size: 8.3 KiB |
After Width: | Height: | Size: 2.9 MiB |
@ -0,0 +1,202 @@ |
|||
import { Button, Form, Input, Modal, Select, DatePicker } from 'antd'; |
|||
import React, { useState, useEffect } from 'react'; |
|||
import { connect } from 'react-redux'; |
|||
import { getUserList, getProjectList, positionList } from '../actions/plan'; |
|||
import moment from 'moment'; |
|||
|
|||
const { RangePicker } = DatePicker; |
|||
|
|||
const PlanModal = ({ visible, onCreate, onCancel, dispatch, userLoading, userList, structureList, struLoading, type, curRecord }) => { |
|||
const [userOpt, setUserOpt] = useState(); |
|||
const [struOpt, setStruOpt] = useState(); |
|||
const [pointOpt, setPointOpt] = useState(); |
|||
const [points, setPoints] = useState(); |
|||
const [unit, setUnit] = useState('次/天'); |
|||
const [form] = Form.useForm(); |
|||
|
|||
useEffect(() => { |
|||
if (type === 'view') { |
|||
|
|||
} else { |
|||
dispatch(getUserList()) |
|||
dispatch(getProjectList()) |
|||
} |
|||
if (type === 'edit') { |
|||
dispatch(positionList({ projectId: curRecord?.project?.id })).then(res => { |
|||
if (res.success) { |
|||
setPoints(res.payload.data?.rows) |
|||
setPointOpt(res.payload.data?.rows[0]?.points?.map(p => ({ label: p.name, value: p.id }))) |
|||
} |
|||
}) |
|||
} |
|||
}, []) |
|||
|
|||
useEffect(() => { |
|||
if (userList.length) { |
|||
setUserOpt(userList.map(u => ({ label: u.name, value: u.id }))) |
|||
} |
|||
}, [userList]) |
|||
|
|||
useEffect(() => { |
|||
if (structureList?.rows?.length) { |
|||
setStruOpt(structureList?.rows?.map(s => ({ label: s.name, value: s.id }))) |
|||
} |
|||
}, [structureList]) |
|||
|
|||
const selectAfter = ( |
|||
<Select defaultValue="次/天" onChange={value => setUnit(value)}> |
|||
<Option value="次/天">次/天</Option> |
|||
<Option value="次/周">次/周</Option> |
|||
<Option value="次/月">次/月</Option> |
|||
</Select> |
|||
); |
|||
return ( |
|||
<Modal |
|||
visible={visible} |
|||
title="新增巡检计划" |
|||
okText="确定" |
|||
cancelText="取消" |
|||
onCancel={() => { |
|||
form.resetFields(); |
|||
onCancel(); |
|||
}} |
|||
onOk={() => { |
|||
if (type === 'view') { |
|||
form.resetFields(); |
|||
onCancel(); |
|||
return; |
|||
} |
|||
form |
|||
.validateFields() |
|||
.then((values) => { |
|||
form.resetFields(); |
|||
const params = { |
|||
...values, |
|||
frequency: values.frequency + unit, |
|||
startTime: values.time[0], |
|||
endTime: values.time[1], |
|||
points: points[0]?.points?.filter(p => values?.points?.includes(p.id)) |
|||
} |
|||
onCreate(params); |
|||
}) |
|||
.catch((info) => { |
|||
console.log('Validate Failed:', info); |
|||
}); |
|||
}} |
|||
> |
|||
<Form |
|||
form={form} |
|||
layout="vertical" |
|||
name="form_in_modal" |
|||
initialValues={{ |
|||
...curRecord, |
|||
time: [moment(curRecord?.startTime), moment(curRecord?.startTime)], |
|||
points: curRecord?.points?.map(p => p.id), |
|||
userDept: curRecord?.user?.department?.name, |
|||
frequency: curRecord?.frequency?.split('次')[0] |
|||
}} |
|||
disabled={type === 'view'} |
|||
> |
|||
<Form.Item |
|||
name="structureId" |
|||
label="结构物名称" |
|||
rules={[ |
|||
{ required: true, message: '请选择结构物' }, |
|||
]} |
|||
> |
|||
<Select disabled={type === 'view'} options={struOpt} loading={struLoading} onChange={(value) => { |
|||
dispatch(positionList({ projectId: value })).then(res => { |
|||
if (res.success) { |
|||
setPoints(res.payload.data?.rows) |
|||
setPointOpt(res.payload.data?.rows[0]?.points?.map(p => ({ label: p.name, value: p.id }))) |
|||
} |
|||
}) |
|||
}} /> |
|||
</Form.Item> |
|||
<Form.Item |
|||
name="name" |
|||
label="巡检任务名称" |
|||
rules={[ |
|||
{ required: true, message: '请输入巡检任务名称' }, |
|||
]} |
|||
> |
|||
<Input disabled={type === 'view'} /> |
|||
</Form.Item> |
|||
<Form.Item |
|||
name="way" |
|||
label="巡检方式" |
|||
rules={[ |
|||
{ required: true, message: '请选择巡检方式' }, |
|||
]} |
|||
initialValue='周期巡检' |
|||
> |
|||
<Select options={[{ |
|||
label: '周期巡检', |
|||
value: '周期巡检' |
|||
}]} disabled /> |
|||
</Form.Item> |
|||
<Form.Item |
|||
name="frequency" |
|||
label="巡检频次" |
|||
rules={[ |
|||
{ required: true, message: '请选择巡检频次' }, |
|||
]} |
|||
> |
|||
<Input addonAfter={selectAfter} disabled={type === 'view'} /> |
|||
</Form.Item> |
|||
<Form.Item |
|||
name="time" |
|||
label="任务周期" |
|||
rules={[ |
|||
{ required: true, message: '请选择任务周期' }, |
|||
]} |
|||
> |
|||
<RangePicker disabled={type === 'view'} /> |
|||
</Form.Item> |
|||
<Form.Item |
|||
name="points" |
|||
label="巡检点" |
|||
rules={[ |
|||
{ required: true, message: '请选择巡检点' }, |
|||
]} |
|||
> |
|||
<Select mode="multiple" options={pointOpt} disabled={!pointOpt || type === 'view'} /> |
|||
</Form.Item> |
|||
<Form.Item |
|||
name="userId" |
|||
label="巡检人员" |
|||
rules={[ |
|||
{ required: true, message: '请选择巡检人员' }, |
|||
]} |
|||
> |
|||
<Select disabled={type === 'view'} options={userOpt} loading={userLoading} onChange={(value) => { |
|||
const curUser = userList.filter(u => u.id == value) |
|||
if (curUser.length) { |
|||
form.setFieldsValue({ |
|||
userDept: curUser[0].department.name |
|||
}); |
|||
} |
|||
}} /> |
|||
</Form.Item> |
|||
<Form.Item |
|||
name="userDept" |
|||
label="巡检单位" |
|||
> |
|||
<Input disabled /> |
|||
</Form.Item> |
|||
</Form> |
|||
</Modal > |
|||
); |
|||
}; |
|||
|
|||
function mapStateToProps(state) { |
|||
const { auth, userList, structureList } = state |
|||
return { |
|||
user: auth.user, |
|||
userList: userList.data || [], |
|||
structureList: structureList.data || [], |
|||
userLoading: userList.isRequesting, |
|||
struLoading: structureList.isRequesting |
|||
} |
|||
} |
|||
export default connect(mapStateToProps)(PlanModal); |
@ -1,72 +0,0 @@ |
|||
import { Button, Form, Input, Modal } from 'antd'; |
|||
import React, { useState } from 'react'; |
|||
|
|||
const UserModal = ({ visible, onCreate, onCancel }) => { |
|||
const [form] = Form.useForm(); |
|||
const reg_tel = /^1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}$/; |
|||
return ( |
|||
<Modal |
|||
visible={visible} |
|||
title="新建用户" |
|||
okText="新建" |
|||
cancelText="取消" |
|||
onCancel={() => { |
|||
form.resetFields(); |
|||
onCancel(); |
|||
}} |
|||
onOk={() => { |
|||
form |
|||
.validateFields() |
|||
.then((values) => { |
|||
form.resetFields(); |
|||
onCreate(values); |
|||
}) |
|||
.catch((info) => { |
|||
console.log('Validate Failed:', info); |
|||
}); |
|||
}} |
|||
> |
|||
<Form |
|||
form={form} |
|||
layout="vertical" |
|||
name="form_in_modal" |
|||
initialValues={{ |
|||
modifier: 'public', |
|||
}} |
|||
> |
|||
<Form.Item |
|||
name="name" |
|||
label="姓名" |
|||
rules={[ |
|||
{ required: true, message: '请输入姓名' }, |
|||
{ max: 24, message: '姓名不能大于24个字符' }, |
|||
]} |
|||
> |
|||
<Input /> |
|||
</Form.Item> |
|||
<Form.Item |
|||
name="phone" |
|||
label="用户名(手机号)" |
|||
rules={[ |
|||
{ required: true, message: '请输入正确的手机号' }, |
|||
{ pattern: reg_tel, message: '请输入正确的手机号' }, |
|||
]} |
|||
> |
|||
<Input /> |
|||
</Form.Item> |
|||
<Form.Item |
|||
name="password" |
|||
label="密码" |
|||
rules={[ |
|||
{ required: true, message: '请填写密码' }, |
|||
{ min: 6, message: '请填写至少6位密码' }, |
|||
]} |
|||
> |
|||
<Input type="password" /> |
|||
</Form.Item> |
|||
</Form> |
|||
</Modal> |
|||
); |
|||
}; |
|||
|
|||
export default UserModal; |
Loading…
Reference in new issue