diff --git a/api/app/lib/controllers/bigScreen/index .js b/api/app/lib/controllers/bigScreen/index .js
index d21f3ae..cdb4992 100644
--- a/api/app/lib/controllers/bigScreen/index .js
+++ b/api/app/lib/controllers/bigScreen/index .js
@@ -54,8 +54,25 @@ async function axyData (ctx, next) {
}
+const pumpInformation = async function (ctx) {
+ let errMsg = { message: '获取泵站信息失败' }
+ try {
+ const models = ctx.fs.dc.models;
+ const { page, limit, name } = ctx.query;
+ const res = await models.PumpInformation.findAll();
+
+ ctx.status = 200;
+ ctx.body = res;
+ } catch (error) {
+ ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
+ ctx.status = 400;
+ ctx.body = errMsg
+
+ }
+}
+
@@ -64,4 +81,5 @@ async function axyData (ctx, next) {
module.exports = {
axyData,
+ pumpInformation
}
\ No newline at end of file
diff --git a/api/app/lib/models/pump_information.js b/api/app/lib/models/pump_information.js
new file mode 100644
index 0000000..e68c141
--- /dev/null
+++ b/api/app/lib/models/pump_information.js
@@ -0,0 +1,117 @@
+/* eslint-disable*/
+'use strict';
+
+module.exports = dc => {
+ const DataTypes = dc.ORM;
+ const sequelize = dc.orm;
+ const PumpInformation = sequelize.define("pumpInformation", {
+ id: {
+ type: DataTypes.INTEGER,
+ allowNull: false,
+ defaultValue: null,
+ comment: null,
+ primaryKey: true,
+ field: "id",
+ autoIncrement: true,
+ unique: "t_pump_information_id_uindex"
+ },
+ structureId: {
+ type: DataTypes.INTEGER,
+ allowNull: false,
+ defaultValue: null,
+ comment: null,
+ primaryKey: false,
+ field: "structure_id",
+ autoIncrement: false
+ },
+ area: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: null,
+ comment: null,
+ primaryKey: false,
+ field: "area",
+ autoIncrement: false
+ },
+ scale: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: null,
+ comment: null,
+ primaryKey: false,
+ field: "scale",
+ autoIncrement: false
+ },
+ waterType: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: null,
+ comment: null,
+ primaryKey: false,
+ field: "water_type",
+ autoIncrement: false
+ },
+ elcType: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: null,
+ comment: null,
+ primaryKey: false,
+ field: "elc_type",
+ autoIncrement: false
+ },
+ byType: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: null,
+ comment: null,
+ primaryKey: false,
+ field: "by_type",
+ autoIncrement: false
+ },
+ num: {
+ type: DataTypes.INTEGER,
+ allowNull: true,
+ defaultValue: null,
+ comment: null,
+ primaryKey: false,
+ field: "num",
+ autoIncrement: false
+ },
+ startTime: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: null,
+ comment: null,
+ primaryKey: false,
+ field: "start_time",
+ autoIncrement: false
+ },
+ reinforceTime: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: null,
+ comment: null,
+ primaryKey: false,
+ field: "reinforce_time",
+ autoIncrement: false
+ },
+ func: {
+ type: DataTypes.STRING,
+ allowNull: true,
+ defaultValue: null,
+ comment: null,
+ primaryKey: false,
+ field: "func",
+ autoIncrement: false
+ },
+
+ }, {
+ tableName: "t_pump_information",
+ comment: "",
+ indexes: []
+ });
+
+ dc.models.PumpInformation = PumpInformation;
+ return PumpInformation;
+};
diff --git a/api/app/lib/routes/organization/index.js b/api/app/lib/routes/organization/index.js
index 2d6c26f..5b20a1e 100644
--- a/api/app/lib/routes/organization/index.js
+++ b/api/app/lib/routes/organization/index.js
@@ -6,4 +6,7 @@ module.exports = function (app, router, opts) {
app.fs.api.logAttr['POST/axyData'] = { content: '获取安心云数据', visible: true };
router.post('/axyData', data.axyData);
+
+ app.fs.api.logAttr['GET/pumpInformation'] = { content: '获取泵站信息', visible: true };
+ router.get('/pumpInformation', data.pumpInformation);
};
\ No newline at end of file
diff --git a/scripts/0.1/data/pump_information.sql b/scripts/0.1/data/pump_information.sql
new file mode 100644
index 0000000..d182706
--- /dev/null
+++ b/scripts/0.1/data/pump_information.sql
@@ -0,0 +1,25 @@
+INSERT INTO public.t_pump_information (id, structure_id, area, scale, water_type, elc_type, by_type, func, num, start_time, reinforce_time) VALUES (DEFAULT,
+ 3569, '东新乡', 840,'1000ZLB—4轴流泵','JSL12—14','S91000KVA','排灌结合',4,'1974年','2009年');
+
+ INSERT INTO public.t_pump_information (id, structure_id, area, scale, water_type, elc_type, by_type, func, num, start_time, reinforce_time) VALUES (DEFAULT,
+ 3592, '富山乡', 2010,'空','6台180、6台155','1250、1650','排涝',12,'1983年','2008年');
+
+ INSERT INTO public.t_pump_information (id, structure_id, area, scale, water_type, elc_type, by_type, func, num, start_time, reinforce_time) VALUES (DEFAULT,
+ 3594, '东新乡', 60 ,'ZLB28—70轴流泵','Y—200T—4','80KVA箱式变压器','纯排',2,'2013年','空');
+
+ INSERT INTO public.t_pump_information (id, structure_id, area, scale, water_type, elc_type, by_type, func, num, start_time, reinforce_time) VALUES (DEFAULT,
+ 3595, '东新乡',260,'20ZLB—70轴流泵','Y67—130kw','315KVA箱式变压器','纯排',2,'2014年','空');
+
+ INSERT INTO public.t_pump_information (id, structure_id, area, scale, water_type, elc_type, by_type, func, num, start_time, reinforce_time) VALUES (DEFAULT,
+ 3593, '东新乡',240, 'ZLB28—70轴流泵','Y—200T—4','S9315KVA','排灌结合',3,'1974年','1992年');
+
+ INSERT INTO public.t_pump_information (id, structure_id, area, scale, water_type, elc_type, by_type, func, num, start_time, reinforce_time) VALUES (DEFAULT,
+ 3598, '东新乡', 340,'ZLB28—70轴流泵','Y—200T—4','S9315KVA','排灌结合',3,'1974年','1988年');
+
+ INSERT INTO public.t_pump_information (id, structure_id, area, scale, water_type, elc_type, by_type, func, num, start_time, reinforce_time) VALUES (DEFAULT,
+ 3597, '东新乡',260,'20ZLB—70轴流泵','Y67—130kw','S9_315KVA变压器','灌溉',2,'2014年','空');
+
+ INSERT INTO public.t_pump_information (id, structure_id, area, scale, water_type, elc_type, by_type, func, num, start_time, reinforce_time) VALUES (DEFAULT,
+ 3599, '富山乡',390, '空','空','空','排涝',3,'1973年','2008年');
+
+
diff --git a/web/client/src/sections/bigScreen/actions/bigScreen.js b/web/client/src/sections/bigScreen/actions/bigScreen.js
index 3f6ff74..d7cf19f 100644
--- a/web/client/src/sections/bigScreen/actions/bigScreen.js
+++ b/web/client/src/sections/bigScreen/actions/bigScreen.js
@@ -14,6 +14,17 @@ export function axyData (data = {}) {
});
}
+export function pumpInformation (query = {}) {
+ return dispatch => basicAction({
+ type: 'get',
+ dispatch: dispatch,
+ actionType: 'GET_PUMP_INFORMATION',
+ url: `${ApiTable.pumpInformation}`,
+ query,
+ msg: { error: '获取泵站基本信息失败' }
+ });
+}
+
export default {
axyData
}
\ No newline at end of file
diff --git a/web/client/src/sections/bigScreen/components/basis.js b/web/client/src/sections/bigScreen/components/basis.js
index c4411ad..db30977 100644
--- a/web/client/src/sections/bigScreen/components/basis.js
+++ b/web/client/src/sections/bigScreen/components/basis.js
@@ -21,20 +21,33 @@ const Basis = ({ actions, dispatch, setshowData, siteList, siteData }) => {
const [pageRefresh3, setPageRefresh3] = useState(0)
const [depthWater, setDepthWater] = useState([])
const [information, setInformation] = useState({})
+ const [pumpInformation, setPumpInformation] = useState([])
const left1Data = useRef([])
const left2Data = useRef([])
const pumpNumber = useRef(0)
+
+
+ useEffect(() => {
+ dispatch(bigScreen.pumpInformation({})).then(res => {
+ if (res.success) {
+ setPumpInformation(res.payload.data || [])
+ }
+ })
+ }, [])
+ useEffect(() => {
+ if (pumpInformation?.length && strucId) {
+ setInformation(pumpInformation?.find(v => v.structureId == strucId) || {})
+ }
+ }, [pumpInformation, strucId])
+
+
useEffect(async () => {
if (siteData) {
setStrucId(siteData[0]?.id)
- for (let key in POWER_STATIONS) {
- if (POWER_STATIONS[key]?.name == siteData[0]?.name) {
- setInformation(POWER_STATIONS[key])
- }
- }
+
//获取所有泵站的集水池液位
siteData?.map(async v => {
await dispatch(bigScreen.axyData({ type: 'get', url: `structures/${v.id}/factors` })).then(async r => {
@@ -131,7 +144,7 @@ const Basis = ({ actions, dispatch, setshowData, siteList, siteData }) => {
type: 'get', url: `stations/theme/data`, params: {
query: {
stations: p.payload.data[0]?.groups[0]?.stations[0]?.id,
- startTime: moment().add(-12, 'hours').format('YYYY-MM-DD HH:mm:ss'),
+ startTime: moment().add(-6, 'hours').format('YYYY-MM-DD HH:mm:ss'),
endTime: moment().format('YYYY-MM-DD HH:mm:ss'),
limit: 1440
}
@@ -193,7 +206,7 @@ const Basis = ({ actions, dispatch, setshowData, siteList, siteData }) => {
-
+
diff --git a/web/client/src/sections/bigScreen/components/basis/right_1.js b/web/client/src/sections/bigScreen/components/basis/right_1.js
index db76ee7..c93f11c 100644
--- a/web/client/src/sections/bigScreen/components/basis/right_1.js
+++ b/web/client/src/sections/bigScreen/components/basis/right_1.js
@@ -4,7 +4,7 @@ import { Select } from 'antd';
import '../basis.less';
import './right_1.less';
-export default function Right_1 ({ data, siteList, strucId, setStrucId, POWER_STATIONS, setInformation }) {
+export default function Right_1 ({ data, siteList, pumpInformation, setPumpInformation, strucId, setStrucId, POWER_STATIONS, setInformation }) {
const renderSelect = () => {
return
diff --git a/web/client/src/sections/bigScreen/components/electrity/voltageTrend.js b/web/client/src/sections/bigScreen/components/electrity/voltageTrend.js
index e3d4fc4..35136ab 100644
--- a/web/client/src/sections/bigScreen/components/electrity/voltageTrend.js
+++ b/web/client/src/sections/bigScreen/components/electrity/voltageTrend.js
@@ -62,11 +62,11 @@ const VoltageTrend = ({ user, voltagePumpId, pumpList, setVoltagePumpId, data })
dataZoom: [
{
type: 'slider',
- // startValue: depthWater?.map(v=>v.time)
+ showDetail:false
},
{
type: 'inside',
- showDetail:false
+
},
],
tooltip: {
@@ -83,7 +83,7 @@ const VoltageTrend = ({ user, voltagePumpId, pumpList, setVoltagePumpId, data })
type: 'category',
// name: "时间",
boundaryGap: false,
- data: time?.map(v => moment(v.time).format('MM-DD HH:mm')) || []
+ data: time?.map(v => moment(v).format('MM-DD HH:mm')) || []
},
yAxis: {
type: 'value',
diff --git a/web/client/src/sections/bigScreen/components/realTime/below.js b/web/client/src/sections/bigScreen/components/realTime/below.js
index 2c81ea1..a4216d4 100644
--- a/web/client/src/sections/bigScreen/components/realTime/below.js
+++ b/web/client/src/sections/bigScreen/components/realTime/below.js
@@ -225,11 +225,11 @@ const Below = ({ dispatch, actions, stations, level }) => {
dataZoom: [
{
type: 'slider',
- // startValue: depthWater?.map(v=>v.time)
+ showDetail: false
},
{
type: 'inside',
- showDetail: false
+
},
],
tooltip: {
@@ -424,7 +424,7 @@ const Below = ({ dispatch, actions, stations, level }) => {
},
yAxis: {
type: 'value',
- name: "单位:kwh",
+ name: "单位:kWh",
areaStyle: {
color: '#FFF',
},
diff --git a/web/client/src/sections/bigScreen/components/realTime/general.js b/web/client/src/sections/bigScreen/components/realTime/general.js
index ea6fbe0..eca32b8 100644
--- a/web/client/src/sections/bigScreen/components/realTime/general.js
+++ b/web/client/src/sections/bigScreen/components/realTime/general.js
@@ -187,7 +187,7 @@ const General = ({ dispatch, actions, stations }) => {
用电概况
{['本日', "本月", '本年'].map(v =>
{
setInterval(v)
@@ -206,7 +206,7 @@ const General = ({ dispatch, actions, stations }) => {
"当日用电" : interval == '本月' ?
"当月用电" : interval == '本年' ?
"当年用电" : ""}
-
{electro?.now.toFixed(2)} kwh
+
{electro?.now.toFixed(2)} kWh
@@ -216,7 +216,7 @@ const General = ({ dispatch, actions, stations }) => {
"昨日用电" : interval == '本月' ?
"上月用电" : interval == '本年' ?
"上年用电" : ""}
- {electro?.before?.toFixed(2)} kwh
+ {electro?.before?.toFixed(2)} kWh
diff --git a/web/client/src/sections/bigScreen/components/realTime/softStart.js b/web/client/src/sections/bigScreen/components/realTime/softStart.js
index f3d8a50..1ebc69a 100644
--- a/web/client/src/sections/bigScreen/components/realTime/softStart.js
+++ b/web/client/src/sections/bigScreen/components/realTime/softStart.js
@@ -23,7 +23,7 @@ const SoftStart = ({ user, softStartData }) => {
软启动总用电量
-
单位:kwh
+
单位:kWh
{softStartData?.length > 0 && <>