diff --git a/api/app/lib/controllers/equipment/index.js b/api/app/lib/controllers/equipment/index.js
new file mode 100644
index 0000000..310b722
--- /dev/null
+++ b/api/app/lib/controllers/equipment/index.js
@@ -0,0 +1,203 @@
+'use strict';
+const moment = require('moment');
+
+//设备维护记录
+async function getEquipment(ctx) {
+ try {
+ const { models } = ctx.fs.dc
+ const sequelize = ctx.fs.dc.ORM
+ const { clickHouse } = ctx.app.fs
+ const { startTime, endTime, pageSize, pageIndex, projectId } = ctx.query
+ //console.log('ressss', ctx.query)
+ let whereOption = {}
+ if (projectId) {
+ whereOption.projectId = projectId
+ } else {
+ whereOption = undefined
+ }
+
+ //console.log('6666', ctx.query)
+ let resCount = await models.EquipmentMaintenanceRecord.count({
+ include: [{
+ model: models.EquipmentMaintenanceRecordProject,
+ where: whereOption
+ }],
+ where: {
+ $and: [
+ sequelize.where(sequelize.fn('date', sequelize.col('report_time')), '>=', moment(startTime).format('YYYY-MM-DD HH:mm:ss')),
+ sequelize.where(sequelize.fn('date', sequelize.col('report_time')), '<=', moment(endTime).format('YYYY-MM-DD HH:mm:ss')),
+ ],
+
+
+ }
+ })
+ const res = await models.EquipmentMaintenanceRecord.findAll({
+ order: [['id', 'DESC']],
+ attributes: ['id', 'equipmentType', 'equipmentCategory', 'maintenanceReason', 'solution', 'reportTime', 'completedTime', 'status'],
+ offset: (pageIndex - 1) * pageSize,
+ limit: pageSize,
+ include: [{
+ attributes: ['id', 'equipmentMaintenanceRecordId', 'projectId'],
+ model: models.EquipmentMaintenanceRecordProject,
+ where: whereOption
+
+ },
+ {
+ attributes: ['id', 'equipmentMaintenanceRecordId', 'pepUserId'],
+ model: models.EquipmentMaintenanceRecordExecuteUser
+ }
+ ],
+ where: {
+ $and: [
+ sequelize.where(sequelize.fn('date', sequelize.col('report_time')), '>=', moment(startTime).format('YYYY-MM-DD HH:mm:ss')),
+ sequelize.where(sequelize.fn('date', sequelize.col('report_time')), '<=', moment(endTime).format('YYYY-MM-DD HH:mm:ss')),
+ ],
+
+ }
+ })
+ //用户id
+ const arrayUserId = []
+
+ res.forEach((item) => { item.equipmentMaintenanceRecordExecuteUsers.forEach((item1) => { arrayUserId.push(item1.pepUserId) }) })
+ const arrayUserIdCopy = [...new Set(arrayUserId)]
+ // (${[...pepProjectIds].join(',')}, -1)
+ let userRes = []
+ if (arrayUserIdCopy.length > 0) {
+ userRes = await clickHouse.pepEmis.query(`
+ SELECT * FROM user
+ WHERE id IN (${[...arrayUserIdCopy].join(',')},-1)
+ `).toPromise()
+ }
+ const lastRes = res.map((item) => {
+ return {
+ reportTime: item.reportTime,
+ completedTime: item.completedTime,
+ equipmentCategory: item.equipmentCategory,
+ equipmentType: item.equipmentType,
+ id: item.id,
+ maintenanceReason: item.maintenanceReason,
+ solution: item.solution,
+ status: item.status,
+ equipmentMaintenanceRecordExecuteUsers:
+ item.equipmentMaintenanceRecordExecuteUsers.map((item1) => {
+ const userArr = userRes.find((ac) => { return ac.id == item1.pepUserId })
+ return {
+ id: item1.id,
+ pepUserId: item1.pepUserId,
+ name: userArr ? userArr.name : ''
+ }
+ }),
+ equipmentMaintenanceRecordProjects: item.equipmentMaintenanceRecordProjects
+ }
+ })
+ //console.log('res111', lastRes, resCount)
+ // console.log('res11', arrayUserIdCopy)
+ ctx.body = { result: lastRes, resCount }
+ ctx.status = 200
+ } catch (error) {
+ ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`)
+ ctx.status = 400
+ ctx.body = {
+ message: `查询设备维护记录失败`
+ }
+ }
+}
+//编辑和新增
+async function editEquipment(ctx) {
+ const transaction = await ctx.fs.dc.orm.transaction();
+ const query = ctx.request.body
+ try {
+ const { models } = ctx.fs.dc
+ const sequelize = ctx.fs.dc.ORM
+ console.log('query1111', query)
+ const { id, completedTime, deviceType, model, reason, reportTime, solution, status, solver, projectId } = query
+ if (id) {
+ await models.EquipmentMaintenanceRecord.update({
+ equipmentType: model,
+ equipmentCategory: deviceType,
+ maintenanceReason: reason,
+ solution: solution,
+ reportTime,
+ completedTime,
+ status
+ }, { where: { id } })
+ await models.EquipmentMaintenanceRecordExecuteUser.destroy({ where: { equipmentMaintenanceRecordId: id } })
+ await models.EquipmentMaintenanceRecordProject.destroy({ where: { equipmentMaintenanceRecordId: id } })
+ if (solver) {
+ const insertUserVal = solver.map((item) => {
+ return {
+ equipmentMaintenanceRecordId: id, pepUserId: item
+ }
+ })
+ await models.EquipmentMaintenanceRecordExecuteUser.bulkCreate(insertUserVal)
+ }
+
+ await models.EquipmentMaintenanceRecordProject.create({
+ equipmentMaintenanceRecordId: id, projectId
+ })
+
+
+ } else {
+ const equipment = await models.EquipmentMaintenanceRecord.create({
+ equipmentType: model,
+ equipmentCategory: deviceType,
+ maintenanceReason: reason,
+ solution: solution,
+ reportTime,
+ completedTime,
+ status
+ })
+ await models.EquipmentMaintenanceRecordProject.create({
+ equipmentMaintenanceRecordId: equipment.id, projectId
+ })
+ if (solver) {
+ const insertUserVal = solver.map((item) => {
+ return {
+ equipmentMaintenanceRecordId: equipment.id, pepUserId: item
+ }
+ })
+ await models.EquipmentMaintenanceRecordExecuteUser.bulkCreate(insertUserVal)
+ }
+ }
+
+
+
+ await transaction.commit();
+ ctx.status = 204
+ } catch (error) {
+ await transaction.rollback();
+ ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`)
+ ctx.status = 400
+ ctx.body = {
+ message: `${query.msg}失败`
+ }
+ }
+}
+//删除
+async function delEquipment(ctx) {
+ const transaction = await ctx.fs.dc.orm.transaction();
+ try {
+ const params = ctx.params
+ const { models } = ctx.fs.dc
+ await models.EquipmentMaintenanceRecordExecuteUser.destroy({ where: { equipmentMaintenanceRecordId: params.id } })
+ await models.EquipmentMaintenanceRecordProject.destroy({ where: { equipmentMaintenanceRecordId: params.id } })
+ await models.EquipmentMaintenanceRecord.destroy({ where: { id: params.id } })
+ ctx.status = 204
+ await transaction.commit();
+ } catch (error) {
+ await transaction.rollback();
+ ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`)
+ ctx.status = 400
+ ctx.body = {
+ message: `删除维护记录失败`
+ }
+ }
+}
+
+
+
+
+
+module.exports = {
+ getEquipment, editEquipment, delEquipment
+};
\ No newline at end of file
diff --git a/api/app/lib/index.js b/api/app/lib/index.js
index 12b6f78..a4fe472 100644
--- a/api/app/lib/index.js
+++ b/api/app/lib/index.js
@@ -59,7 +59,9 @@ module.exports.models = function (dc) { // dc = { orm: Sequelize对象, ORM: Seq
const {
AppInspection, ProjectApp, ProjectCorrelation, AppAlarm, App, AlarmAppearRecord, AlarmConfirmLog, EmailSendLog, LatestDynamicList, AlarmPushConfig,
- MaintenanceRecord, MaintenanceRecordExecuteUser, MaintenancePlanExecuteUser, MaintenancePlan } = dc.models;
+ MaintenanceRecord, MaintenanceRecordExecuteUser, MaintenancePlanExecuteUser, MaintenancePlan, EquipmentMaintenanceRecord, EquipmentMaintenanceRecordProject,
+ EquipmentMaintenanceRecordExecuteUser, ServerMaintenanceRecordRepairman, ServerMaintenanceRecord
+ } = dc.models;
AppInspection.belongsTo(App, { foreignKey: 'projectAppId', targetKey: 'id' });
App.hasMany(AppInspection, { foreignKey: 'projectAppId', sourceKey: 'id' });
@@ -109,4 +111,16 @@ module.exports.models = function (dc) { // dc = { orm: Sequelize对象, ORM: Seq
MaintenancePlanExecuteUser.belongsTo(MaintenancePlan, { foreignKey: 'maintenancePlanId', targetKey: 'id' })
MaintenancePlan.hasMany(MaintenancePlanExecuteUser, { foreignKey: 'maintenancePlanId', targetKey: 'id' })
+
+
+ EquipmentMaintenanceRecordProject.belongsTo(EquipmentMaintenanceRecord, { foreignKey: 'equipmentMaintenanceRecordId', targetKey: 'id' })
+ EquipmentMaintenanceRecord.hasMany(EquipmentMaintenanceRecordProject, { foreignKey: 'equipmentMaintenanceRecordId', targetKey: 'id' })
+
+ EquipmentMaintenanceRecordExecuteUser.belongsTo(EquipmentMaintenanceRecord, { foreignKey: 'equipmentMaintenanceRecordId', targetKey: 'id' })
+ EquipmentMaintenanceRecord.hasMany(EquipmentMaintenanceRecordExecuteUser, { foreignKey: 'equipmentMaintenanceRecordId', targetKey: 'id' })
+
+ ServerMaintenanceRecordRepairman.belongsTo(ServerMaintenanceRecord, { foreignKey: 'serverMaintenanceRecordId', targetKey: 'id' })
+ ServerMaintenanceRecord.hasMany(ServerMaintenanceRecordRepairman, { foreignKey: 'serverMaintenanceRecordId', targetKey: 'id' })
+
+
};
diff --git a/api/app/lib/models/equipment_maintenance_record.js b/api/app/lib/models/equipment_maintenance_record.js
new file mode 100644
index 0000000..61185d9
--- /dev/null
+++ b/api/app/lib/models/equipment_maintenance_record.js
@@ -0,0 +1,88 @@
+/* eslint-disable*/
+
+'use strict';
+
+module.exports = dc => {
+ const DataTypes = dc.ORM;
+ const sequelize = dc.orm;
+ const EquipmentMaintenanceRecord = sequelize.define("equipmentMaintenanceRecord", {
+ id: {
+ type: DataTypes.INTEGER,
+ allowNull: false,
+ defaultValue: null,
+ comment: null,
+ primaryKey: true,
+ field: "id",
+ autoIncrement: true
+ },
+ equipmentType: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: null,
+ comment: null,
+ primaryKey: false,
+ field: "equipment_type",
+ autoIncrement: false
+ },
+ equipmentCategory: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: null,
+ comment: null,
+ primaryKey: false,
+ field: "equipment_category",
+ autoIncrement: false
+ },
+ maintenanceReason: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: null,
+ comment: null,
+ primaryKey: false,
+ field: "maintenance_reason",
+ autoIncrement: false
+ },
+ solution: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: null,
+ comment: null,
+ primaryKey: false,
+ field: "solution",
+ autoIncrement: false
+ },
+ reportTime: {
+ type: DataTypes.DATE,
+ allowNull: true,
+ defaultValue: null,
+ comment: null,
+ primaryKey: false,
+ field: "report_time",
+ autoIncrement: false
+ },
+ completedTime: {
+ type: DataTypes.DATE,
+ allowNull: true,
+ defaultValue: null,
+ comment: null,
+ primaryKey: false,
+ field: "completed_time",
+ autoIncrement: false
+ },
+ status: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: null,
+ comment: null,
+ primaryKey: false,
+ field: "status",
+ autoIncrement: false
+ }
+ }, {
+ tableName: "equipment_maintenance_record",
+ comment: "",
+ indexes: []
+ });
+ dc.models.EquipmentMaintenanceRecord = EquipmentMaintenanceRecord;
+ return EquipmentMaintenanceRecord;
+};
\ No newline at end of file
diff --git a/api/app/lib/models/equipment_maintenance_record_execute_user.js b/api/app/lib/models/equipment_maintenance_record_execute_user.js
new file mode 100644
index 0000000..812ed78
--- /dev/null
+++ b/api/app/lib/models/equipment_maintenance_record_execute_user.js
@@ -0,0 +1,47 @@
+/* eslint-disable*/
+
+'use strict';
+
+module.exports = dc => {
+ const DataTypes = dc.ORM;
+ const sequelize = dc.orm;
+ const EquipmentMaintenanceRecordExecuteUser = sequelize.define("equipmentMaintenanceRecordExecuteUser", {
+ id: {
+ type: DataTypes.INTEGER,
+ allowNull: false,
+ defaultValue: null,
+ comment: null,
+ primaryKey: true,
+ field: "id",
+ autoIncrement: true
+ },
+ equipmentMaintenanceRecordId: {
+ type: DataTypes.INTEGER,
+ allowNull: true,
+ defaultValue: null,
+ comment: null,
+ primaryKey: false,
+ field: "equipment_maintenance_record_id",
+ autoIncrement: false,
+ references: {
+ key: "id",
+ model: "equipmentMaintenanceRecord"
+ }
+ },
+ pepUserId: {
+ type: DataTypes.INTEGER,
+ allowNull: true,
+ defaultValue: null,
+ comment: null,
+ primaryKey: false,
+ field: "pep_user_id",
+ autoIncrement: false
+ }
+ }, {
+ tableName: "equipment_maintenance_record_execute_user",
+ comment: "",
+ indexes: []
+ });
+ dc.models.EquipmentMaintenanceRecordExecuteUser = EquipmentMaintenanceRecordExecuteUser;
+ return EquipmentMaintenanceRecordExecuteUser;
+};
\ No newline at end of file
diff --git a/api/app/lib/models/equipment_maintenance_record_project.js b/api/app/lib/models/equipment_maintenance_record_project.js
new file mode 100644
index 0000000..8b9b6b4
--- /dev/null
+++ b/api/app/lib/models/equipment_maintenance_record_project.js
@@ -0,0 +1,47 @@
+/* eslint-disable*/
+
+'use strict';
+
+module.exports = dc => {
+ const DataTypes = dc.ORM;
+ const sequelize = dc.orm;
+ const EquipmentMaintenanceRecordProject = sequelize.define("equipmentMaintenanceRecordProject", {
+ id: {
+ type: DataTypes.INTEGER,
+ allowNull: false,
+ defaultValue: null,
+ comment: null,
+ primaryKey: true,
+ field: "id",
+ autoIncrement: true
+ },
+ equipmentMaintenanceRecordId: {
+ type: DataTypes.INTEGER,
+ allowNull: true,
+ defaultValue: null,
+ comment: null,
+ primaryKey: false,
+ field: "equipment_maintenance_record_id",
+ autoIncrement: false,
+ references: {
+ key: "id",
+ model: "equipmentMaintenanceRecord"
+ }
+ },
+ projectId: {
+ type: DataTypes.INTEGER,
+ allowNull: true,
+ defaultValue: null,
+ comment: null,
+ primaryKey: false,
+ field: "project_id",
+ autoIncrement: false
+ }
+ }, {
+ tableName: "equipment_maintenance_record_project",
+ comment: "",
+ indexes: []
+ });
+ dc.models.EquipmentMaintenanceRecordProject = EquipmentMaintenanceRecordProject;
+ return EquipmentMaintenanceRecordProject;
+};
\ No newline at end of file
diff --git a/api/app/lib/models/server_maintenance_record.js b/api/app/lib/models/server_maintenance_record.js
new file mode 100644
index 0000000..37d2994
--- /dev/null
+++ b/api/app/lib/models/server_maintenance_record.js
@@ -0,0 +1,79 @@
+/* eslint-disable*/
+
+'use strict';
+
+module.exports = dc => {
+ const DataTypes = dc.ORM;
+ const sequelize = dc.orm;
+ const ServerMaintenanceRecord = sequelize.define("serverMaintenanceRecord", {
+ id: {
+ type: DataTypes.INTEGER,
+ allowNull: false,
+ defaultValue: null,
+ comment: null,
+ primaryKey: true,
+ field: "id",
+ autoIncrement: true
+ },
+ sketch: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: null,
+ comment: "简述",
+ primaryKey: false,
+ field: "sketch",
+ autoIncrement: false
+ },
+ reason: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: null,
+ comment: "维修原因",
+ primaryKey: false,
+ field: "reason",
+ autoIncrement: false
+ },
+ remark: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: null,
+ comment: "备注",
+ primaryKey: false,
+ field: "remark",
+ autoIncrement: false
+ },
+ maintenanceStartTime: {
+ type: DataTypes.DATE,
+ allowNull: true,
+ defaultValue: null,
+ comment: "维护开始时间",
+ primaryKey: false,
+ field: "maintenance_start_time",
+ autoIncrement: false
+ },
+ maintenanceFinishTime: {
+ type: DataTypes.DATE,
+ allowNull: true,
+ defaultValue: null,
+ comment: "维护结束时间",
+ primaryKey: false,
+ field: "maintenance_finish_time",
+ autoIncrement: false
+ },
+ state: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: null,
+ comment: "完成状态 wait 待维修 / underway 维修中 / completed 维修完成 ",
+ primaryKey: false,
+ field: "state",
+ autoIncrement: false
+ }
+ }, {
+ tableName: "server_maintenance_record",
+ comment: "",
+ indexes: []
+ });
+ dc.models.ServerMaintenanceRecord = ServerMaintenanceRecord;
+ return ServerMaintenanceRecord;
+};
\ No newline at end of file
diff --git a/api/app/lib/models/server_maintenance_record_repairman.js b/api/app/lib/models/server_maintenance_record_repairman.js
new file mode 100644
index 0000000..5c617eb
--- /dev/null
+++ b/api/app/lib/models/server_maintenance_record_repairman.js
@@ -0,0 +1,47 @@
+/* eslint-disable*/
+
+'use strict';
+
+module.exports = dc => {
+ const DataTypes = dc.ORM;
+ const sequelize = dc.orm;
+ const ServerMaintenanceRecordRepairman = sequelize.define("serverMaintenanceRecordRepairman", {
+ id: {
+ type: DataTypes.INTEGER,
+ allowNull: false,
+ defaultValue: null,
+ comment: null,
+ primaryKey: true,
+ field: "id",
+ autoIncrement: true
+ },
+ serverMaintenanceRecordId: {
+ type: DataTypes.INTEGER,
+ allowNull: true,
+ defaultValue: null,
+ comment: null,
+ primaryKey: false,
+ field: "server_maintenance_record_id",
+ autoIncrement: false,
+ references: {
+ key: "id",
+ model: "serverMaintenanceRecord"
+ }
+ },
+ pepUserId: {
+ type: DataTypes.INTEGER,
+ allowNull: true,
+ defaultValue: null,
+ comment: null,
+ primaryKey: false,
+ field: "pep_user_id",
+ autoIncrement: false
+ }
+ }, {
+ tableName: "server_maintenance_record_repairman",
+ comment: "",
+ indexes: []
+ });
+ dc.models.ServerMaintenanceRecordRepairman = ServerMaintenanceRecordRepairman;
+ return ServerMaintenanceRecordRepairman;
+};
\ No newline at end of file
diff --git a/api/app/lib/routes/equipment/index.js b/api/app/lib/routes/equipment/index.js
new file mode 100644
index 0000000..ddfffe2
--- /dev/null
+++ b/api/app/lib/routes/equipment/index.js
@@ -0,0 +1,15 @@
+'use strict';
+
+const equipment = require('../../controllers/equipment');
+
+module.exports = function (app, router, opts) {
+ app.fs.api.logAttr['GET/equipment'] = { content: '获取设备维护记录', visible: true };
+ router.get('/equipment', equipment.getEquipment);
+
+ app.fs.api.logAttr['POST/equipment'] = { content: '编辑或者新增设备维护记录', visible: true };
+ router.post('/equipment', equipment.editEquipment);
+
+ app.fs.api.logAttr['DEL/equipment/:id'] = { content: '删除设备维护记录', visible: true };
+ router.delete('/equipment/:id', equipment.delEquipment);
+
+}
\ No newline at end of file
diff --git a/api/app/lib/routes/serverInfoMaintenance/index.js b/api/app/lib/routes/serverInfoMaintenance/index.js
new file mode 100644
index 0000000..66a7607
--- /dev/null
+++ b/api/app/lib/routes/serverInfoMaintenance/index.js
@@ -0,0 +1,17 @@
+'use strict';
+
+const serverInfoMaintenanceRecord = require('../../controllers/serverInfoMaintenanceRecord');
+
+module.exports = function (app, router, opts) {
+ app.fs.api.logAttr['GET/serverInfoMaintenanceRecord'] = { content: '获取服务器维护记录列表', visible: true };
+ router.get('/serverInfoMaintenanceRecord', serverInfoMaintenanceRecord.getServerInfoMaintenanceRecord)
+
+ app.fs.api.logAttr['POST/serverInfoMaintenanceRecord'] = { content: '编辑服务器维护记录列表', visible: true };
+ router.post('/serverInfoMaintenanceRecord', serverInfoMaintenanceRecord.editServerInfoMaintenanceRecord)
+
+ app.fs.api.logAttr['DEL/serverInfoMaintenanceRecord/:id'] = { content: '删除服务器维护记录列表', visible: true };
+ router.del('/serverInfoMaintenanceRecord/:id', serverInfoMaintenanceRecord.delServerInfoMaintenanceRecord)
+}
+
+
+
diff --git a/script/0.27/schema/create_server_maintenance_record.sql b/script/0.27/schema/create_server_maintenance_record.sql
new file mode 100644
index 0000000..3adf6bd
--- /dev/null
+++ b/script/0.27/schema/create_server_maintenance_record.sql
@@ -0,0 +1,16 @@
+create table server_maintenance_record(
+ id serial primary key,
+ sketch varchar(512),
+ reason varchar(512),
+ remark varchar(1024),
+ maintenance_start_time timestamp with time zone,
+ maintenance_finish_time timestamp with time zone,
+ state varchar(32)
+ );
+comment on column public.server_maintenance_record.sketch is '简述';
+comment on column public.server_maintenance_record.reason is '维修原因';
+comment on column public.server_maintenance_record.remark is '备注';
+comment on column public.server_maintenance_record.maintenance_start_time is '维护开始时间';
+comment on column public.server_maintenance_record.maintenance_finish_time is '维护结束时间';
+comment on column public.server_maintenance_record.state is '维护结束时间';
+comment on column public.server_maintenance_record.state is '完成状态 wait 待维修 / underway 维修中 / completed 维修完成 ';
diff --git a/script/0.27/schema/create_server_maintenance_record_repairman.sql b/script/0.27/schema/create_server_maintenance_record_repairman.sql
new file mode 100644
index 0000000..2ac702e
--- /dev/null
+++ b/script/0.27/schema/create_server_maintenance_record_repairman.sql
@@ -0,0 +1,5 @@
+create table server_maintenance_record_repairman(
+ id serial primary key,
+ server_maintenance_record_id integer references server_maintenance_record(id),
+ pep_user_id integer
+)
\ No newline at end of file
diff --git a/web/client/src/sections/facility/actions/index.js b/web/client/src/sections/facility/actions/index.js
index eb109ab..3d0dd1e 100644
--- a/web/client/src/sections/facility/actions/index.js
+++ b/web/client/src/sections/facility/actions/index.js
@@ -1,2 +1,5 @@
'use strict';
-
+import * as serverInfoMaintenanceRecord from '../actions/serverInfo'
+export default {
+ ...serverInfoMaintenanceRecord
+}
\ No newline at end of file
diff --git a/web/client/src/sections/facility/actions/serverInfo.js b/web/client/src/sections/facility/actions/serverInfo.js
new file mode 100644
index 0000000..cd6ae90
--- /dev/null
+++ b/web/client/src/sections/facility/actions/serverInfo.js
@@ -0,0 +1,45 @@
+import { ApiTable, basicAction } from '$utils'
+
+export function getServerInfoMaintenanceRecord(query) { //获取服务器维护记录
+ return dispatch => basicAction({
+ type: 'get',
+ dispatch: dispatch,
+ query: query,
+ actionType: 'GET_SERVER_INFO_MAINTENANCE_RECORD',
+ url: `${ApiTable.getServerInfoMaintenanceRecord}`,
+ msg: { option: '获取服务器维护记录' },
+ reducer: {
+ name: "getServerInfoMaintenanceRecord",
+ params: { noClear: true }
+ }
+ });
+}
+
+
+export function editServerInfoMaintenanceRecord(data) {//添加/编辑服务器信息维护记录
+ let msg = ''
+ if (data) {
+ msg = data.msg
+ }
+ return (dispatch) =>
+ basicAction({
+ type: "post",
+ dispatch: dispatch,
+ data,
+ actionType: "POST_SERVER_INFO_MAINTENANCE_RECORD",
+ url: `${ApiTable.editServerInfoMaintenanceRecord}`,
+ msg: { option: msg },//添加/编辑服务器信息维护记录
+ });
+}
+
+export function delServerInfoMaintenanceRecord(id) {//删除服务器信息维护记录
+ return (dispatch) =>
+ basicAction({
+ type: "del",
+ dispatch: dispatch,
+ actionType: "DEL_SERVER_INFO_MAINTENANCE_RECORD",
+ url: `${ApiTable.delServerInfoMaintenanceRecord.replace('{id}', id)}`,
+ msg: { option: '删除服务器信息维护记录' },
+ });
+}
+
diff --git a/web/client/src/sections/facility/components/serverInfoModal.jsx b/web/client/src/sections/facility/components/serverInfoModal.jsx
new file mode 100644
index 0000000..56e61d6
--- /dev/null
+++ b/web/client/src/sections/facility/components/serverInfoModal.jsx
@@ -0,0 +1,105 @@
+'use strict';
+
+import React, { useEffect, useState, useRef } from 'react';
+import { Modal, Form, DatePicker, useFormApi, actions, Button } from '@douyinfe/semi-ui';
+import { connect } from 'react-redux';
+import moment from 'moment';
+
+const ServerInfoModal = (props) => {
+ const { visible, onClose, dispatch, recordRow, pepList, actions, projectList } = props;
+ const [startTime, setStartTime] = useState('');
+ const [endTime, setEndTime] = useState('');
+ const { service,facility } = actions;
+
+ // console.log('endTimex',endTime)
+ const api = useRef();
+
+ useEffect(() => {
+ //console.log('recordRow', recordRow)
+ }, [recordRow]);
+ const cancelHandler = () => {
+ onClose()
+ }
+ const okHandler = () => {
+ api.current.validate().then((res) => {
+ //console.log('res1', res)
+ const query = {
+ id: recordRow?.id,
+ sketch:res.sketch,
+ reason:res.reason,
+ repairman:res.repairman,
+ remark:res.remark,
+ maintenanceStartTime:res.maintenanceStartTime,
+ maintenanceFinishTime:res.maintenanceFinishTime,
+ state:res.state,
+ msg: recordRow ? '编辑服务器信息维护记录' : '添加服务器信息维护记录'
+ }
+ dispatch(facility.editServerInfoMaintenanceRecord(query)).then((res)=>{
+ if(res.success) onClose() ; api.current.reset()
+ })
+
+ })
+ }
+ return (
+