diff --git a/api/app/lib/controllers/organization/user.js b/api/app/lib/controllers/organization/user.js index aa7e2e9..8aaf88b 100644 --- a/api/app/lib/controllers/organization/user.js +++ b/api/app/lib/controllers/organization/user.js @@ -170,15 +170,31 @@ async function delDept(ctx, next) { async function getUser(ctx, next) { try { const models = ctx.fs.dc.models; - const { depId } = ctx.params - const userRes = await models.User.findAll({ - where: { - departmentId: parseInt(depId), - delete: false - }, - attributes: { exclude: ['password'] }, - order: [['id', 'asc']], - }) + const { depId } = ctx.params; + let userRes = null; + if (depId !== 'null') { + userRes = await models.User.findAll({ + where: { + departmentId: parseInt(depId), + delete: false + }, + attributes: { exclude: ['password'] }, + order: [['id', 'asc']], + }) + } else { + userRes = await models.User.findAll({ + where: { + delete: false + }, + attributes: { exclude: ['password'] }, + order: [['id', 'asc']], + include: [{ + required: true, + model: models.Department, + attributes: ['id', 'name'], + }] + }) + } ctx.status = 200; ctx.body = userRes diff --git a/api/app/lib/controllers/patrolPlan/patrolPlan.js b/api/app/lib/controllers/patrolPlan/patrolPlan.js new file mode 100644 index 0000000..cb72752 --- /dev/null +++ b/api/app/lib/controllers/patrolPlan/patrolPlan.js @@ -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, +} \ No newline at end of file diff --git a/api/app/lib/controllers/projectRegime/projectSituation.js b/api/app/lib/controllers/projectRegime/projectSituation.js index c666f16..1069f83 100644 --- a/api/app/lib/controllers/projectRegime/projectSituation.js +++ b/api/app/lib/controllers/projectRegime/projectSituation.js @@ -242,6 +242,81 @@ async function qrCodeShow (ctx, next) { } +async function q(ctx) { + // let error = { + // name: 'FindError', + // message: "获取失败!" + // }; + // const models = ctx.fs.dc.models; + // const { devices } = ctx.request.body + // const attachment = ctx.app.fs.qn_attachment + + // try { + + // if (!Array.isArray(devices)) { + // error = { name: 'paramsError', message: '参数不能为空' }; + // ctx.throw(400); + // } + // const devicesArr = await models.Device.findAll({ + // attributes: ['deviceNo', 'periodCode', 'qrSrc'], + // where: { deviceNo: { $in: devices } } + // }) + + // let ids = [], idsMap = {}, qnImages = [] + // devicesArr.forEach(d => { + // const qrSrc = d.qrSrc + // const deviceNo = d.deviceNo + // const periodCode = d.periodCode + // if (qrSrc) { + // if (/^\d+$/.test(qrSrc)) { + // ids.push(qrSrc) + // idsMap[qrSrc] = { deviceNo, periodCode } + // } else { + // let domain = globalCache.getQnDomain() + // let imgUrl = `${domain}/${qrSrc}` + // qnImages.push({ src: imgUrl, deviceNo, periodCode }) + // } + // } + // }) + + // const docs = await models.QrcodePng.findAll({ + // where: { + // id: { $in: ids } + // }, + // attributes: ["id", "base64"] + // }) + + // let pics = [] + + // if (docs.length > 0) { + // pics = docs.map((d) => { + // let { deviceNo, periodCode } = idsMap[d.id] || {} + // let base64 = d.base64.replace(/^data:image\/\w+;base64,/, '') + // return { + // url: Buffer.from(base64, 'base64'), + // name: deviceNo, + // periodCode + // } + // }) + // } + + // if (qnImages.length > 0) { + // let qns = await downloadImgsAsBase64(qnImages) + // pics = pics.concat(qns) + // } + + // let fileUrl = await downLoadImageBiz(pics, { zipName: "二维码_" + moment().format("YYYY-MM-DD-HH-mm-ss"), attachment }) + // add2CleanCache(fileUrl, attachment) + // ctx.status = 200 + // ctx.body = { fileUrl } + + // } catch (err) { + // ctx.fs.logger.error(err); + // ctx.status = 400; + // ctx.body = error; + // } +} + module.exports = { projectList, postAddProject, @@ -249,5 +324,6 @@ module.exports = { addPosition, position, delPosition, - qrCodeShow + qrCodeShow, + q } \ No newline at end of file diff --git a/api/app/lib/index.js b/api/app/lib/index.js index 2cc3d93..5cb7374 100644 --- a/api/app/lib/index.js +++ b/api/app/lib/index.js @@ -53,8 +53,7 @@ module.exports.models = function (dc) { // dc = { orm: Sequelize对象, ORM: Seq require(`./models/${filename}`)(dc) }); - const { Camera, Company, Department, Post, RoleGroup, Role, RoleResource, User, UserDepartment, UserPost, Site, ProjectDisclosure, ProjectDisclosureFiles, Coordinate, ProblemReport, ProblemReportFile, Worker, WorkerAttendance, - RiskReport, Metting, HideDangerRectify, HideDangerRectifySites, HideDangerDispose, UserResource, Resource, Project, Point + const { Department, User, UserResource, Resource, Project, Point, PatrolPlan } = dc.models; UserResource.belongsTo(User, { foreignKey: 'userId', targetKey: 'id' }); @@ -69,4 +68,10 @@ module.exports.models = function (dc) { // dc = { orm: Sequelize对象, ORM: Seq Point.belongsTo(Project, { foreignKey: 'projectId', targetKey: 'id' }); Project.hasMany(Point, { foreignKey: 'projectId', sourceKey: 'id' }); + + PatrolPlan.belongsTo(Project, { foreignKey: 'structureId', targetKey: 'id' }); + Project.hasMany(PatrolPlan, { foreignKey: 'structureId', sourceKey: 'id' }); + + PatrolPlan.belongsTo(User, { foreignKey: 'userId', targetKey: 'id' }); + User.hasMany(PatrolPlan, { foreignKey: 'userId', sourceKey: 'id' }); }; diff --git a/api/app/lib/models/camera.js b/api/app/lib/models/camera.js deleted file mode 100644 index d7d5f18..0000000 --- a/api/app/lib/models/camera.js +++ /dev/null @@ -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; -}; \ No newline at end of file diff --git a/api/app/lib/models/company.js b/api/app/lib/models/company.js deleted file mode 100644 index fe1df05..0000000 --- a/api/app/lib/models/company.js +++ /dev/null @@ -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; -}; \ No newline at end of file diff --git a/api/app/lib/models/coordinate.js b/api/app/lib/models/coordinate.js deleted file mode 100644 index 9d210c5..0000000 --- a/api/app/lib/models/coordinate.js +++ /dev/null @@ -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; -}; \ No newline at end of file diff --git a/api/app/lib/models/hide_danger_dispose.js b/api/app/lib/models/hide_danger_dispose.js deleted file mode 100644 index 64e96d1..0000000 --- a/api/app/lib/models/hide_danger_dispose.js +++ /dev/null @@ -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; -}; \ No newline at end of file diff --git a/api/app/lib/models/hide_danger_rectify.js b/api/app/lib/models/hide_danger_rectify.js deleted file mode 100644 index b3f9851..0000000 --- a/api/app/lib/models/hide_danger_rectify.js +++ /dev/null @@ -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; -}; \ No newline at end of file diff --git a/api/app/lib/models/hide_danger_rectify_sites.js b/api/app/lib/models/hide_danger_rectify_sites.js deleted file mode 100644 index 62b7f85..0000000 --- a/api/app/lib/models/hide_danger_rectify_sites.js +++ /dev/null @@ -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; -}; \ No newline at end of file diff --git a/api/app/lib/models/hide_danger_report.js b/api/app/lib/models/hide_danger_report.js deleted file mode 100644 index b93a3cb..0000000 --- a/api/app/lib/models/hide_danger_report.js +++ /dev/null @@ -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; -}; \ No newline at end of file diff --git a/api/app/lib/models/metting.js b/api/app/lib/models/metting.js deleted file mode 100644 index 59df3ba..0000000 --- a/api/app/lib/models/metting.js +++ /dev/null @@ -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; -}; \ No newline at end of file diff --git a/api/app/lib/models/problem_report.js b/api/app/lib/models/patrol_plan.js similarity index 67% rename from api/app/lib/models/problem_report.js rename to api/app/lib/models/patrol_plan.js index 4ee41e4..91e5ddd 100644 --- a/api/app/lib/models/problem_report.js +++ b/api/app/lib/models/patrol_plan.js @@ -4,7 +4,7 @@ module.exports = dc => { const DataTypes = dc.ORM; const sequelize = dc.orm; - const ProblemReport = sequelize.define("problemReport", { + const PatrolPlan = sequelize.define("PatrolPlan", { id: { type: DataTypes.INTEGER, allowNull: false, @@ -12,98 +12,94 @@ module.exports = dc => { comment: null, primaryKey: true, field: "id", - autoIncrement: true + autoIncrement: true, + unique: "patrol_plan_id_uindex" }, - siteId: { - type: DataTypes.INTEGER, - allowNull: true, + name: { + type: DataTypes.STRING, + allowNull: false, defaultValue: null, comment: null, primaryKey: false, - field: "siteId", + field: "name", autoIncrement: false }, - type: { - type: DataTypes.INTEGER, + way: { + type: DataTypes.STRING, allowNull: true, defaultValue: null, comment: null, primaryKey: false, - field: "type", + field: "way", autoIncrement: false }, - title: { - type: DataTypes.STRING, + structureId: { + type: DataTypes.INTEGER, allowNull: true, defaultValue: null, comment: null, primaryKey: false, - field: "title", + field: "structure_id", autoIncrement: false }, - describe: { - type: DataTypes.STRING, + startTime: { + type: DataTypes.DATE, allowNull: true, defaultValue: null, comment: null, primaryKey: false, - field: "describe", + field: "start_time", autoIncrement: false }, - urgencyDegree: { - type: DataTypes.STRING, + endTime: { + type: DataTypes.DATE, allowNull: true, defaultValue: null, comment: null, primaryKey: false, - field: "urgency_degree", + field: "end_time", autoIncrement: false }, - isReaded: { - type: DataTypes.BOOLEAN, + frequency: { + type: DataTypes.STRING, allowNull: true, defaultValue: null, comment: null, primaryKey: false, - field: "isReaded", + field: "frequency", autoIncrement: false }, - reportTime: { - type: DataTypes.DATE, + points: { + type: DataTypes.JSONB, allowNull: true, defaultValue: null, comment: null, primaryKey: false, - field: "report_time", + field: "points", autoIncrement: false }, - reporter: { + userId: { type: DataTypes.INTEGER, allowNull: true, - defaultValue: null, comment: null, primaryKey: false, - field: "reporter", + field: "user_id", autoIncrement: false, - references: { - key: "id", - model: "tUser" - } }, - source: { - type: DataTypes.STRING, - allowNull: true, - defaultValue: null, + patrolCount: { + type: DataTypes.INTEGER, + allowNull: false, + defaultValue: 0, comment: null, primaryKey: false, - field: "source", + field: "patrol_count", autoIncrement: false }, }, { - tableName: "problem_report", + tableName: "patrol_plan", comment: "", indexes: [] }); - dc.models.ProblemReport = ProblemReport; - return ProblemReport; + dc.models.PatrolPlan = PatrolPlan; + return PatrolPlan; }; \ No newline at end of file diff --git a/api/app/lib/models/phone_validate_code.js b/api/app/lib/models/phone_validate_code.js deleted file mode 100644 index eb57602..0000000 --- a/api/app/lib/models/phone_validate_code.js +++ /dev/null @@ -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; -}; \ No newline at end of file diff --git a/api/app/lib/models/post.js b/api/app/lib/models/post.js deleted file mode 100644 index a0a476e..0000000 --- a/api/app/lib/models/post.js +++ /dev/null @@ -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; -}; \ No newline at end of file diff --git a/api/app/lib/models/problem_report_consult.js b/api/app/lib/models/problem_report_consult.js deleted file mode 100644 index 983d68d..0000000 --- a/api/app/lib/models/problem_report_consult.js +++ /dev/null @@ -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; -}; \ No newline at end of file diff --git a/api/app/lib/models/problem_report_file.js b/api/app/lib/models/problem_report_file.js deleted file mode 100644 index b648846..0000000 --- a/api/app/lib/models/problem_report_file.js +++ /dev/null @@ -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; -}; \ No newline at end of file diff --git a/api/app/lib/models/project_disclosure.js b/api/app/lib/models/project_disclosure.js deleted file mode 100644 index e68a06e..0000000 --- a/api/app/lib/models/project_disclosure.js +++ /dev/null @@ -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; -}; \ No newline at end of file diff --git a/api/app/lib/models/project_disclosure_files.js b/api/app/lib/models/project_disclosure_files.js deleted file mode 100644 index 10073bc..0000000 --- a/api/app/lib/models/project_disclosure_files.js +++ /dev/null @@ -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; -}; \ No newline at end of file diff --git a/api/app/lib/models/risk_report.js b/api/app/lib/models/risk_report.js deleted file mode 100644 index be58b35..0000000 --- a/api/app/lib/models/risk_report.js +++ /dev/null @@ -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; -}; \ No newline at end of file diff --git a/api/app/lib/models/role.js b/api/app/lib/models/role.js deleted file mode 100644 index 07cf75a..0000000 --- a/api/app/lib/models/role.js +++ /dev/null @@ -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; -}; \ No newline at end of file diff --git a/api/app/lib/models/role_group.js b/api/app/lib/models/role_group.js deleted file mode 100644 index c7c65d7..0000000 --- a/api/app/lib/models/role_group.js +++ /dev/null @@ -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; -}; \ No newline at end of file diff --git a/api/app/lib/models/role_resource.js b/api/app/lib/models/role_resource.js deleted file mode 100644 index 26ba988..0000000 --- a/api/app/lib/models/role_resource.js +++ /dev/null @@ -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; -}; \ No newline at end of file diff --git a/api/app/lib/models/safety_cultivate.js b/api/app/lib/models/safety_cultivate.js deleted file mode 100644 index 8137028..0000000 --- a/api/app/lib/models/safety_cultivate.js +++ /dev/null @@ -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; -}; \ No newline at end of file diff --git a/api/app/lib/models/user_deal_todo.js b/api/app/lib/models/user_deal_todo.js deleted file mode 100644 index b271642..0000000 --- a/api/app/lib/models/user_deal_todo.js +++ /dev/null @@ -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; -}; \ No newline at end of file diff --git a/api/app/lib/models/user_department.js b/api/app/lib/models/user_department.js deleted file mode 100644 index 579cba6..0000000 --- a/api/app/lib/models/user_department.js +++ /dev/null @@ -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; -}; \ No newline at end of file diff --git a/api/app/lib/models/user_post.js b/api/app/lib/models/user_post.js deleted file mode 100644 index d18697b..0000000 --- a/api/app/lib/models/user_post.js +++ /dev/null @@ -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; -}; \ No newline at end of file diff --git a/api/app/lib/models/worker.js b/api/app/lib/models/worker.js deleted file mode 100644 index 78d0535..0000000 --- a/api/app/lib/models/worker.js +++ /dev/null @@ -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; -}; \ No newline at end of file diff --git a/api/app/lib/models/worker_attendance.js b/api/app/lib/models/worker_attendance.js deleted file mode 100644 index b60e3e1..0000000 --- a/api/app/lib/models/worker_attendance.js +++ /dev/null @@ -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; -}; \ No newline at end of file diff --git a/api/app/lib/models/xuncheck_task.js b/api/app/lib/models/xuncheck_task.js deleted file mode 100644 index 6fb7bdf..0000000 --- a/api/app/lib/models/xuncheck_task.js +++ /dev/null @@ -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; -}; \ No newline at end of file diff --git a/api/app/lib/routes/patrolPlan/patrolPlan.js b/api/app/lib/routes/patrolPlan/patrolPlan.js new file mode 100644 index 0000000..5f0e455 --- /dev/null +++ b/api/app/lib/routes/patrolPlan/patrolPlan.js @@ -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); +}; \ No newline at end of file diff --git a/api/app/lib/routes/projectRegime/index.js b/api/app/lib/routes/projectRegime/index.js index f1db955..a81a805 100644 --- a/api/app/lib/routes/projectRegime/index.js +++ b/api/app/lib/routes/projectRegime/index.js @@ -25,4 +25,7 @@ module.exports = function (app, router, opts) { app.fs.api.logAttr['GET/qrCodeShow'] = { content: '获取二维码列表', visible: false }; router.get('/qrCodeShow', projectSituation.qrCodeShow); + app.fs.api.logAttr['GET/q'] = { content: '获取二维码列表', visible: false }; + router.get('/q', projectSituation.q); + } \ No newline at end of file diff --git a/api/config.js b/api/config.js index dd0a93b..6550c23 100644 --- a/api/config.js +++ b/api/config.js @@ -23,7 +23,7 @@ args.option('aliOssRegion', '阿里OSS Region'); const flags = args.parse(process.argv); -const ZHONGDING_DB = process.env.ZHONGDING_DB || flags.pg; +const XUNJIAN_DB = process.env.XUNJIAN_DB || flags.pg; // 七牛云存储参数 const QINIU_DOMAIN_QNDMN_RESOURCE = process.env.ANXINCLOUD_QINIU_DOMAIN_QNDMN_RESOURCE || flags.qndmn; @@ -37,118 +37,119 @@ const ALI_OSS_SECRETKET = process.env.ALI_OSS_SECRETKET || flags.aliOssSecretKey const ALI_OSS_BUCKET = process.env.ALI_OSS_BUCKET || flags.aliOssBucket; const ALI_OSS_REGION = process.env.ALI_OSS_REGION || flags.aliOssRegion; -if (!ZHONGDING_DB || !QINIU_DOMAIN_QNDMN_RESOURCE || !QINIU_BUCKET_RESOURCE || !QINIU_AK || !QINIU_SK) { - console.log('缺少启动参数,异常退出'); - args.showHelp(); - process.exit(-1); + +if (!XUNJIAN_DB || !QINIU_DOMAIN_QNDMN_RESOURCE || !QINIU_BUCKET_RESOURCE || !QINIU_AK || !QINIU_SK) { + console.log('缺少启动参数,异常退出'); + args.showHelp(); + process.exit(-1); } const product = { - port: flags.port || 8080, - staticDirs: ['static'], - mws: [ - { - entry: require('@fs/attachment').entry, - opts: { - qiniu: { - domain: QINIU_DOMAIN_QNDMN_RESOURCE, - bucket: QINIU_BUCKET_RESOURCE, - accessKey: QINIU_AK, - secretKey: QINIU_SK - }, - maxSize: 104857600, // 100M - } - }, { - entry: require('./app').entry, - opts: { - dev, - exclude: [ - // "*" - ], // 不做认证的路由,也可以使用 exclude: ["*"] 跳过所有路由 - qiniu: { - domain: QINIU_DOMAIN_QNDMN_RESOURCE, - bucket: QINIU_BUCKET_RESOURCE, - accessKey: QINIU_AK, - secretKey: QINIU_SK - }, - aliOss: { - accessKey: ALI_OSS_ACCESSKEY, - secretKey: ALI_OSS_SECRETKET, - bucket: ALI_OSS_BUCKET, - region: ALI_OSS_REGION - }, - sms: { - ///阿里云-安心云 - accessKey: 'LTAI5tAFdjz7j38aNF2C9Qe8', - accessSecret: '1trYkmiqfBtvZL6BxkNH2uQcQQPs0S' - }, - email: { - enabled: true, - host: 'smtp.exmail.qq.com', - port: 465, - sender: { - name: '中鼎服务', - address: 'fsiot@free-sun.com.cn', - password: 'Fs2689' - } - }, - } - } - ], - dc: { - url: ZHONGDING_DB, - opts: { - pool: { - max: 80, - min: 10, - idle: 10000 + port: flags.port || 8080, + staticDirs: ['static'], + mws: [ + { + entry: require('@fs/attachment').entry, + opts: { + qiniu: { + domain: QINIU_DOMAIN_QNDMN_RESOURCE, + bucket: QINIU_BUCKET_RESOURCE, + accessKey: QINIU_AK, + secretKey: QINIU_SK + }, + maxSize: 104857600, // 100M + } + }, { + entry: require('./app').entry, + opts: { + dev, + exclude: [ + // "*" + ], // 不做认证的路由,也可以使用 exclude: ["*"] 跳过所有路由 + qiniu: { + domain: QINIU_DOMAIN_QNDMN_RESOURCE, + bucket: QINIU_BUCKET_RESOURCE, + accessKey: QINIU_AK, + secretKey: QINIU_SK + }, + aliOss: { + accessKey: ALI_OSS_ACCESSKEY, + secretKey: ALI_OSS_SECRETKET, + bucket: ALI_OSS_BUCKET, + region: ALI_OSS_REGION + }, + sms: { + ///阿里云-安心云 + accessKey: 'LTAI5tAFdjz7j38aNF2C9Qe8', + accessSecret: '1trYkmiqfBtvZL6BxkNH2uQcQQPs0S' }, - define: { - freezeTableName: true, // 固定表名 - timestamps: false // 不含列 "createAt"/"updateAt"/"DeleteAt" + email: { + enabled: true, + host: 'smtp.exmail.qq.com', + port: 465, + sender: { + name: '中鼎服务', + address: 'fsiot@free-sun.com.cn', + password: 'Fs2689' + } }, - timezone: '+08:00', - logging: false - }, - models: [require('./app').models] - }, - logger: { - level: 'info', - json: false, - filename: path.join(__dirname, 'log', 'runtime.log'), - colorize: false, - maxsize: 1024 * 1024 * 5, - rotationFormat: false, - zippedArchive: true, - maxFiles: 10, - prettyPrint: true, - label: '', - timestamp: () => moment().format('YYYY-MM-DD HH:mm:ss.SSS'), - eol: os.EOL, - tailable: true, - depth: null, - showLevel: true, - maxRetries: 1 - } + } + } + ], + dc: { + url: XUNJIAN_DB, + opts: { + pool: { + max: 80, + min: 10, + idle: 10000 + }, + define: { + freezeTableName: true, // 固定表名 + timestamps: false // 不含列 "createAt"/"updateAt"/"DeleteAt" + }, + timezone: '+08:00', + logging: false + }, + models: [require('./app').models] + }, + logger: { + level: 'info', + json: false, + filename: path.join(__dirname, 'log', 'runtime.log'), + colorize: false, + maxsize: 1024 * 1024 * 5, + rotationFormat: false, + zippedArchive: true, + maxFiles: 10, + prettyPrint: true, + label: '', + timestamp: () => moment().format('YYYY-MM-DD HH:mm:ss.SSS'), + eol: os.EOL, + tailable: true, + depth: null, + showLevel: true, + maxRetries: 1 + } }; const development = { - port: product.port, - staticDirs: product.staticDirs, - mws: product.mws, - dc: product.dc, - logger: product.logger + port: product.port, + staticDirs: product.staticDirs, + mws: product.mws, + dc: product.dc, + logger: product.logger }; if (dev) { - // mws - for (let mw of development.mws) { - // if (mw.opts.exclude) mw.opts.exclude = ['*']; // 使用 ['*'] 跳过所有路由 - } - // logger - development.logger.filename = path.join(__dirname, 'log', 'development.log'); - development.logger.level = 'debug'; - development.dc.opts.logging = console.log; + // mws + for (let mw of development.mws) { + // if (mw.opts.exclude) mw.opts.exclude = ['*']; // 使用 ['*'] 跳过所有路由 + } + // logger + development.logger.filename = path.join(__dirname, 'log', 'development.log'); + development.logger.level = 'debug'; + development.dc.opts.logging = console.log; } module.exports = dev ? development : product; diff --git a/api/log/development.log b/api/log/development.log index 46f17c3..2033b4b 100644 --- a/api/log/development.log +++ b/api/log/development.log @@ -3865,3 +3865,35 @@ notNull Violation: project.describe cannot be null 2023-01-17 11:00:49.835 - debug: [FS-LOGGER] Init. 2023-01-17 11:00:50.799 - info: [FS-ATTACHMENT] Inject attachment mw into router. 2023-01-17 11:00:50.799 - info: [FS-AUTH] Inject auth and api mv into router. +2023-01-17 16:24:18.099 - debug: [FS-LOGGER] Init. +2023-01-17 16:24:19.169 - info: [FS-ATTACHMENT] Inject attachment mw into router. +2023-01-17 16:24:19.169 - info: [FS-AUTH] Inject auth and api mv into router. +2023-01-17 16:29:24.545 - error: path: /patrolPlan, error: SequelizeDatabaseError: relation "patrol_plan" does not exist +2023-01-17 16:30:55.708 - error: path: /patrolPlan, error: SequelizeDatabaseError: relation "patrol_plan" does not exist +2023-01-17 17:04:11.489 - error: path: /patrolPlan, error: SequelizeDatabaseError: relation "patrol_plan" does not exist +2023-01-17 17:34:08.720 - debug: [FS-LOGGER] Init. +2023-01-17 17:34:09.424 - info: [FS-ATTACHMENT] Inject attachment mw into router. +2023-01-17 17:34:09.425 - info: [FS-AUTH] Inject auth and api mv into router. +2023-01-17 17:54:21.406 - error: [FS-ERRHD] +{ + message: 'transaction is not defined', + stack: 'ReferenceError: transaction is not defined\n' + + ' at login (C:\\Users\\方式、\\Desktop\\Inspection\\api\\app\\lib\\controllers\\auth\\index.js:78:9)\n' + + ' at async auth (C:\\Users\\方式、\\Desktop\\Inspection\\api\\app\\lib\\middlewares\\authenticator.js:144:13)' +} +2023-01-17 17:54:32.256 - error: [FS-ERRHD] +{ + message: 'transaction is not defined', + stack: 'ReferenceError: transaction is not defined\n' + + ' at login (C:\\Users\\方式、\\Desktop\\Inspection\\api\\app\\lib\\controllers\\auth\\index.js:78:9)\n' + + ' at async auth (C:\\Users\\方式、\\Desktop\\Inspection\\api\\app\\lib\\middlewares\\authenticator.js:144:13)' +} +2023-01-17 17:54:56.524 - debug: [FS-LOGGER] Init. +2023-01-17 17:54:57.554 - info: [FS-ATTACHMENT] Inject attachment mw into router. +2023-01-17 17:54:57.555 - info: [FS-AUTH] Inject auth and api mv into router. +2023-01-17 17:55:16.799 - debug: [FS-LOGGER] Init. +2023-01-17 17:55:16.964 - info: [FS-ATTACHMENT] Inject attachment mw into router. +2023-01-17 17:55:16.965 - info: [FS-AUTH] Inject auth and api mv into router. +2023-01-17 18:19:08.094 - debug: [FS-LOGGER] Init. +2023-01-17 18:19:08.273 - info: [FS-ATTACHMENT] Inject attachment mw into router. +2023-01-17 18:19:08.273 - info: [FS-AUTH] Inject auth and api mv into router. diff --git a/script/1.0.0/schema/2.create.project.sql b/script/1.0.0/schema/2.create.project.sql index fcc2f66..eec307e 100644 --- a/script/1.0.0/schema/2.create.project.sql +++ b/script/1.0.0/schema/2.create.project.sql @@ -10,7 +10,7 @@ create table project describe varchar(255), user_id integer, img character varying[], - qr_code varchar(255) + qr_code varchar ); create table point @@ -22,6 +22,6 @@ create table point longitude integer, latitude integer, describe varchar(255), - qr_code varchar(255), + qr_code varchar, project_id integer -); \ No newline at end of file +) \ No newline at end of file diff --git a/script/1.0.0/schema/3.create_patrol_plan.sql b/script/1.0.0/schema/3.create_patrol_plan.sql new file mode 100644 index 0000000..044750e --- /dev/null +++ b/script/1.0.0/schema/3.create_patrol_plan.sql @@ -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 +); \ No newline at end of file diff --git a/web/Dockerfile b/web/Dockerfile index 1b44544..0755295 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -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 -ENTRYPOINT [ "node", "server.js" ] \ No newline at end of file +# CMD ["node", "server.js"] \ No newline at end of file diff --git a/web/client/assets/images/login/login_a.png b/web/client/assets/images/login/login_a.png new file mode 100644 index 0000000..4c8a97e Binary files /dev/null and b/web/client/assets/images/login/login_a.png differ diff --git a/web/client/assets/images/login/login_b.png b/web/client/assets/images/login/login_b.png new file mode 100644 index 0000000..9e04927 Binary files /dev/null and b/web/client/assets/images/login/login_b.png differ diff --git a/web/client/src/index.js b/web/client/src/index.js index aba3f6d..dac0415 100644 --- a/web/client/src/index.js +++ b/web/client/src/index.js @@ -4,4 +4,4 @@ import React from 'react'; import { render } from 'react-dom'; import App from './app'; -render((), document.getElementById('App')); \ No newline at end of file +render((), document.getElementById('App')); \ No newline at end of file diff --git a/web/client/src/layout/components/header/index.js b/web/client/src/layout/components/header/index.js index c1df51f..3e088ae 100644 --- a/web/client/src/layout/components/header/index.js +++ b/web/client/src/layout/components/header/index.js @@ -38,7 +38,7 @@ const Header = props => {
{/* */} - 巡检WEB + 运维巡检平台