peng.peng
1 year ago
20 changed files with 636 additions and 557 deletions
@ -0,0 +1,97 @@ |
|||
/* eslint-disable*/ |
|||
|
|||
'use strict'; |
|||
|
|||
module.exports = dc => { |
|||
const DataTypes = dc.ORM; |
|||
const sequelize = dc.orm; |
|||
const EmergencyEquipmentRegistration = sequelize.define("emergencyEquipmentRegistration", { |
|||
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: "名称", |
|||
primaryKey: false, |
|||
field: "name", |
|||
autoIncrement: false |
|||
}, |
|||
type: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "类别", |
|||
primaryKey: false, |
|||
field: "type", |
|||
autoIncrement: false |
|||
}, |
|||
unit: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "计量单位", |
|||
primaryKey: false, |
|||
field: "unit", |
|||
autoIncrement: false |
|||
}, |
|||
count: { |
|||
type: DataTypes.INTEGER, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "数量", |
|||
primaryKey: false, |
|||
field: "count", |
|||
autoIncrement: false |
|||
}, |
|||
function: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "主要性能", |
|||
primaryKey: false, |
|||
field: "function", |
|||
autoIncrement: false |
|||
}, |
|||
purpose: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "用途", |
|||
primaryKey: false, |
|||
field: "purpose", |
|||
autoIncrement: false |
|||
}, |
|||
status: { |
|||
type: DataTypes.STRING, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "技术状况", |
|||
primaryKey: false, |
|||
field: "status", |
|||
autoIncrement: false |
|||
}, |
|||
inTime: { |
|||
type: DataTypes.DATEONLY, |
|||
allowNull: true, |
|||
defaultValue: null, |
|||
comment: "入库日期", |
|||
primaryKey: false, |
|||
field: "in_time", |
|||
autoIncrement: false |
|||
} |
|||
}, { |
|||
tableName: "emergency_equipment_registration", |
|||
comment: "", |
|||
indexes: [] |
|||
}); |
|||
dc.models.EmergencyEquipmentRegistration = EmergencyEquipmentRegistration; |
|||
return EmergencyEquipmentRegistration; |
|||
}; |
@ -0,0 +1,33 @@ |
|||
DROP TABLE IF EXISTS "public"."emergency_equipment_registration"; |
|||
CREATE TABLE "public"."emergency_equipment_registration" ( |
|||
"id" serial PRIMARY KEY, |
|||
"name" varchar(255) COLLATE "pg_catalog"."default" NOT NULL, |
|||
"type" varchar(255) COLLATE "pg_catalog"."default", |
|||
"unit" varchar(255) COLLATE "pg_catalog"."default", |
|||
"count" int4, |
|||
"function" varchar(255) COLLATE "pg_catalog"."default", |
|||
"purpose" varchar(255) COLLATE "pg_catalog"."default", |
|||
"status" varchar(255) COLLATE "pg_catalog"."default", |
|||
"in_time" date |
|||
) |
|||
; |
|||
COMMENT ON COLUMN "public"."emergency_equipment_registration"."name" IS '名称'; |
|||
COMMENT ON COLUMN "public"."emergency_equipment_registration"."type" IS '类别'; |
|||
COMMENT ON COLUMN "public"."emergency_equipment_registration"."unit" IS '计量单位'; |
|||
COMMENT ON COLUMN "public"."emergency_equipment_registration"."count" IS '数量'; |
|||
COMMENT ON COLUMN "public"."emergency_equipment_registration"."function" IS '主要性能'; |
|||
COMMENT ON COLUMN "public"."emergency_equipment_registration"."purpose" IS '用途'; |
|||
COMMENT ON COLUMN "public"."emergency_equipment_registration"."status" IS '技术状况'; |
|||
COMMENT ON COLUMN "public"."emergency_equipment_registration"."in_time" IS '入库日期'; |
|||
|
|||
-- ---------------------------- |
|||
-- Records of emergency_equipment_registration |
|||
-- ---------------------------- |
|||
INSERT INTO "public"."emergency_equipment_registration" VALUES (1, '地震应急包', '地震救援', '个', 250, '应急救援', '救援', '堪用', '2021-12-01'); |
|||
INSERT INTO "public"."emergency_equipment_registration" VALUES (2, '运兵车', '森林灭火', '辆', 1, '运输', '灭火', '堪用', '2018-12-31'); |
|||
INSERT INTO "public"."emergency_equipment_registration" VALUES (3, '对讲机', '森林灭火', '台', 42, '通信联络', '灭火', '堪用', '2018-12-31'); |
|||
INSERT INTO "public"."emergency_equipment_registration" VALUES (4, 'GPS', '森林灭火', '个', 4, '灭火救援', '灭火', '堪用', '2018-12-31'); |
|||
INSERT INTO "public"."emergency_equipment_registration" VALUES (5, '风力灭火机', '森林灭火', '台', 16, '灭火救援', '灭火', '堪用', '2018-12-31'); |
|||
INSERT INTO "public"."emergency_equipment_registration" VALUES (6, '细水雾灭火机', '森林灭火', '台', 2, '灭火救援', '灭火', '堪用', '2018-12-31'); |
|||
INSERT INTO "public"."emergency_equipment_registration" VALUES (7, '背负式高压水雾喷射器', '森林灭火', '台', 6, '灭火救援', '灭火', '堪用', '2018-12-31'); |
|||
|
After Width: | Height: | Size: 772 KiB |
After Width: | Height: | Size: 4.5 KiB |
After Width: | Height: | Size: 10 KiB |
@ -0,0 +1,57 @@ |
|||
import React, { useState, useEffect } from 'react' |
|||
import moment from 'moment' |
|||
function TimeComponent(props) { |
|||
const { createTime } = props; |
|||
const [timeState, setTimeState] = useState(moment().valueOf() - moment(createTime).valueOf()) |
|||
|
|||
|
|||
useEffect(() => { |
|||
const timeUpdate = setInterval(() => { |
|||
let seconds = moment().valueOf() - moment(createTime).valueOf() |
|||
setTimeState(seconds); |
|||
}, 1000); |
|||
return () => { |
|||
clearInterval(timeUpdate); |
|||
}; |
|||
}, []); |
|||
return formatSeconds(timeState / 1000) |
|||
|
|||
} |
|||
|
|||
export default TimeComponent; |
|||
|
|||
|
|||
//秒数转化为天时分秒
|
|||
export const formatSeconds = (value) => { |
|||
var secondTime = parseInt(value);// 秒
|
|||
var minuteTime = 0;// 分
|
|||
var hourTime = 0;// 小时
|
|||
var dayTime = 0;// 天
|
|||
if (secondTime > 60) {//如果秒数大于60,将秒数转换成整数
|
|||
//获取分钟,除以60取整数,得到整数分钟
|
|||
minuteTime = parseInt(secondTime / 60); |
|||
//获取秒数,秒数取余,得到整数秒数
|
|||
secondTime = parseInt(secondTime % 60); |
|||
//如果分钟大于60,将分钟转换成小时
|
|||
if (minuteTime > 60) { |
|||
//获取小时,获取分钟除以60,得到整数小时
|
|||
hourTime = parseInt(minuteTime / 60); |
|||
//获取小时后取余的分,获取分钟除以60取余的分
|
|||
minuteTime = parseInt(minuteTime % 60); |
|||
|
|||
if (hourTime > 24) { |
|||
dayTime = parseInt(hourTime / 24); |
|||
//获取小时后取余的分,获取分钟除以60取余的分
|
|||
hourTime = parseInt(hourTime % 24); |
|||
} |
|||
} |
|||
} |
|||
var result = "" + (parseInt(secondTime) < 10 ? '0' + parseInt(secondTime) : parseInt(secondTime)); |
|||
result = "" + (parseInt(minuteTime) < 10 ? '0' + parseInt(minuteTime) : parseInt(minuteTime)) + ":" + result; |
|||
result = "" + (parseInt(hourTime) < 10 ? '0' + parseInt(hourTime) : parseInt(hourTime)) + ":" + result; |
|||
if (dayTime > 0) { |
|||
result = "" + parseInt(dayTime) + "天 " + result; |
|||
} |
|||
// console.log('result', result);
|
|||
return result; |
|||
} |
@ -1,130 +0,0 @@ |
|||
115.921049, 28.559176 |
|||
115.926542, 28.559327 |
|||
115.921218, 28.555168 |
|||
115.926311, 28.55532 |
|||
export const heatmapData = { |
|||
"type": "FeatureCollection", |
|||
"features": [ |
|||
{ |
|||
"type": "Feature", |
|||
"properties": { |
|||
"count": 6 |
|||
}, |
|||
"geometry": { |
|||
"type": "Point", |
|||
"coordinates": [ |
|||
115.921049, 28.559176 |
|||
] |
|||
} |
|||
}, |
|||
{ |
|||
"type": "Feature", |
|||
"properties": { |
|||
"count": 3 |
|||
}, |
|||
"geometry": { |
|||
"type": "Point", |
|||
"coordinates": [ |
|||
115.922049, 28.556176 |
|||
] |
|||
} |
|||
}, |
|||
{ |
|||
"type": "Feature", |
|||
"properties": { |
|||
"count": 2 |
|||
}, |
|||
"geometry": { |
|||
"type": "Point", |
|||
"coordinates": [ |
|||
115.923049, 28.556176 |
|||
] |
|||
} |
|||
}, |
|||
{ |
|||
"type": "Feature", |
|||
"properties": { |
|||
"count": 2 |
|||
}, |
|||
"geometry": { |
|||
"type": "Point", |
|||
"coordinates": [ |
|||
115.924049, 28.557176 |
|||
] |
|||
} |
|||
}, |
|||
{ |
|||
"type": "Feature", |
|||
"properties": { |
|||
"count": 5 |
|||
}, |
|||
"geometry": { |
|||
"type": "Point", |
|||
"coordinates": [ |
|||
115.925049, 28.558176 |
|||
] |
|||
} |
|||
}, |
|||
{ |
|||
"type": "Feature", |
|||
"properties": { |
|||
"count": 7 |
|||
}, |
|||
"geometry": { |
|||
"type": "Point", |
|||
"coordinates": [ |
|||
115.926049, 28.556176 |
|||
] |
|||
} |
|||
}, |
|||
{ |
|||
"type": "Feature", |
|||
"properties": { |
|||
"count": 8 |
|||
}, |
|||
"geometry": { |
|||
"type": "Point", |
|||
"coordinates": [ |
|||
115.92365, 28.557404 |
|||
] |
|||
} |
|||
}, |
|||
{ |
|||
"type": "Feature", |
|||
"properties": { |
|||
"count": 8 |
|||
}, |
|||
"geometry": { |
|||
"type": "Point", |
|||
"coordinates": [ |
|||
115.92465, 28.555404 |
|||
] |
|||
} |
|||
}, |
|||
{ |
|||
"type": "Feature", |
|||
"properties": { |
|||
"count": 8 |
|||
}, |
|||
"geometry": { |
|||
"type": "Point", |
|||
"coordinates": [ |
|||
115.92465, 28.556404 |
|||
] |
|||
} |
|||
}, |
|||
{ |
|||
"type": "Feature", |
|||
"properties": { |
|||
"count": 8 |
|||
}, |
|||
"geometry": { |
|||
"type": "Point", |
|||
"coordinates": [ |
|||
115.92565, 28.557404 |
|||
] |
|||
} |
|||
}, |
|||
] |
|||
} |
|||
|
Loading…
Reference in new issue