Browse Source

Merge branch 'develop' of http://120.27.195.166:3000/chenglb/PMS_Frontend_v1.0.0.git into develop

tags/PMS_V1.0.0_Alpha5
chenglb 1 year ago
parent
commit
b128f18762
  1. 4
      src/components/layout/Header/downloadModal.jsx
  2. 24
      src/pages/NewEnergy/ChargeStationMgm/loadable.jsx
  3. 14
      src/pages/NewEnergy/RealtimeMonitor/ChargerMonitor/loadable.jsx
  4. 19
      src/pages/NewEnergy/RealtimeMonitor/PileMonitor/index.scss
  5. 34
      src/pages/NewEnergy/RealtimeMonitor/PileMonitor/loadable.jsx
  6. 24
      src/pages/OperationCenter/OperationSales/CreditScoreMgm/loadable.jsx
  7. 2
      src/services/NewEnergy/realtimeMonitor.js

4
src/components/layout/Header/downloadModal.jsx

@ -33,7 +33,7 @@ function DownloadModal (props) {
width: 200, width: 200,
align: 'center', align: 'center',
dataIndex: 'progress', dataIndex: 'progress',
render: (progress) => ((progress || 0) * 100) + '%'
render: (progress) => ((progress || 0)) + '%'
}, },
{ {
title: '文件大小', title: '文件大小',
@ -83,7 +83,7 @@ function DownloadModal (props) {
<div className='download-list-action'> <div className='download-list-action'>
{ {
record.status == 2 ? ( record.status == 2 ? (
<div className="download-btn-download" style={{color: '#3AA9FF'}} onClick={() => handleDownload(record.url)}>下载</div>
<div className="download-btn-download" style={{color: '#3AA9FF'}} onClick={() => handleDownload(record.file_url)}>下载</div>
) : null ) : null
} }
<div className="download-btn-del" style={{color: '#EC5761'}} onClick={() => handleDel(record)}>删除</div> <div className="download-btn-del" style={{color: '#EC5761'}} onClick={() => handleDel(record)}>删除</div>

24
src/pages/NewEnergy/ChargeStationMgm/loadable.jsx

@ -13,6 +13,7 @@ import "./index.scss";
function Appointment() { function Appointment() {
// //
const [detailVisible, setDetailVisible] = useState(false); const [detailVisible, setDetailVisible] = useState(false);
// //
@ -139,7 +140,7 @@ function Appointment() {
label: "站点状态", label: "站点状态",
options: [ options: [
{ value: "0", label: "全部" }, { value: "0", label: "全部" },
...sysConfig?.stationType || []
...sysConfig?.stationStatus || []
], ],
defaultValue: "0", defaultValue: "0",
placeholder: "请选择站点状态", placeholder: "请选择站点状态",
@ -374,15 +375,6 @@ function Appointment() {
/> />
</div> </div>
<div className="row"> <div className="row">
<FormInput
yisaLabel="详细地址"
placeholder="请输入详细地址"
isShowAfterIcon={false}
value={addFormData.address}
onChange={e => { setAddFormData({ address: e.target.value }) }}
/>
</div>
<div className="row">
<FormSelect <FormSelect
yisaLabel="站点类型" yisaLabel="站点类型"
placeholder="请选择站点类型" placeholder="请选择站点类型"
@ -438,12 +430,22 @@ function Appointment() {
setAddFormData({ lng_lat: value }) setAddFormData({ lng_lat: value })
}} }}
onChange={(adress) => { onChange={(adress) => {
console.log(adress);
// console.log(adress);
setAddFormData({ address: adress })
}} }}
close={() => setLngLatVisible(false)} close={() => setLngLatVisible(false)}
/> />
</div> </div>
</div> </div>
<div className="row">
<FormInput
yisaLabel="详细地址"
placeholder="请输入详细地址"
isShowAfterIcon={false}
value={addFormData.address}
onChange={e => { setAddFormData({ address: e.target.value }) }}
/>
</div>
</div> </div>
<div className="right"> <div className="right">
<Upload <Upload

14
src/pages/NewEnergy/RealtimeMonitor/ChargerMonitor/loadable.jsx

@ -1,5 +1,5 @@
import React, { useState, useRef, useEffect } from "react"; import React, { useState, useRef, useEffect } from "react";
import { message, Modal, Image } from "antd";
import { message as Message, Modal, Image, Button } from "antd";
import { dictionary, utils } from "@/config/common"; import { dictionary, utils } from "@/config/common";
import ajax from "@/services"; import ajax from "@/services";
import { TableModule } from "@/components"; import { TableModule } from "@/components";
@ -14,7 +14,7 @@ function ChargerMonitor() {
station_name: "", // station_name: "", //
phone: "", // phone: "", //
plate: "", // plate: "", //
status: sysConfig?.energyChargingStatus[0]?.value ?? 0, //
status: sysConfig?.energyChargingStatus?.[0]?.value ?? 0, //
timePeriod: moment().format("YYYY-MM-DD HH:mm:ss"), timePeriod: moment().format("YYYY-MM-DD HH:mm:ss"),
// start_time: "", // // start_time: "", //
// end_time: "", // // end_time: "", //
@ -45,7 +45,7 @@ function ChargerMonitor() {
type: "Select", type: "Select",
placeholder: "请选择充电状态", placeholder: "请选择充电状态",
defaultValue: initFormData.status, defaultValue: initFormData.status,
options: sysConfig.energyChargingStatus ?? [],
options: sysConfig?.energyChargingStatus ?? [],
}, },
{ {
name: "timePeriod", name: "timePeriod",
@ -154,11 +154,7 @@ function ChargerMonitor() {
fixed: "right", fixed: "right",
width: 100, width: 100,
render: (val, record) => { render: (val, record) => {
return (
<>
<span>-</span>
</>
);
return <Button type="primary">操作</Button>;
}, },
}, },
]; // ]; //
@ -172,7 +168,7 @@ function ChargerMonitor() {
setTableData(res.data.list); setTableData(res.data.list);
setTotal(res.data.total); setTotal(res.data.total);
} else { } else {
message.error(res.message);
Message.error(res.message);
} }
}) })
.catch((err) => { .catch((err) => {

19
src/pages/NewEnergy/RealtimeMonitor/PileMonitor/index.scss

@ -70,13 +70,28 @@
.ant-table-wrapper { .ant-table-wrapper {
.custom-table-cell-span { .custom-table-cell-span {
&.online-status { &.online-status {
&__2 {
&__1 {
color: #2adc41; color: #2adc41;
} }
&__1 {
&__2 {
color: #ec5761; color: #ec5761;
} }
} }
&.gun-status{
&__1{
color: #62CFA7;
}
&__2{
color: #F99B2F;
}
&__3{
color: #FF6978;
}
&__4{
color: #A0B0BD;
}
}
} }
} }
} }

34
src/pages/NewEnergy/RealtimeMonitor/PileMonitor/loadable.jsx

@ -1,5 +1,5 @@
import React, { useState, useEffect, useMemo } from "react"; import React, { useState, useEffect, useMemo } from "react";
import { message } from "antd";
import { message as Message, Button } from "antd";
import { utils } from "@/config/common"; import { utils } from "@/config/common";
import ajax from "@/services"; import ajax from "@/services";
import { TableModule } from "@/components"; import { TableModule } from "@/components";
@ -19,8 +19,8 @@ function PileMonitor() {
const initFormData = { const initFormData = {
station_name: "", // station_name: "", //
muzzle_text: "", // muzzle_text: "", //
pile_type: sysConfig?.energyChargingType[0]?.value ?? 0, //
charge_status: sysConfig?.energyChargingGunStatus[0]?.value ?? 0, //
pile_type: sysConfig?.energyChargingType?.[0]?.value ?? 0, //
charge_status: sysConfig?.energyChargingGunStatus?.[0]?.value ?? 0, //
}; // }; //
const formSearch = [ const formSearch = [
@ -85,15 +85,15 @@ function PileMonitor() {
dataIndex: "charge_status_text", dataIndex: "charge_status_text",
key: "charge_status_text", key: "charge_status_text",
align: "center", align: "center",
// render: (val, record) => {
// return (
// <span
// className={`custom-table-cell-span gun-status__${record?.muzzle_type}`}
// >
// {val}
// </span>
// );
// },
render: (val, record) => {
return (
<span
className={`custom-table-cell-span gun-status__${record?.charge_status}`}
>
{val}
</span>
);
},
}, },
{ {
title: "地锁状态", title: "地锁状态",
@ -119,8 +119,7 @@ function PileMonitor() {
key: "operation", key: "operation",
align: "center", align: "center",
render: (_, record) => { render: (_, record) => {
return <></>;
// return <Button type="primary"></Button>;
return <Button type="primary">操作</Button>;
}, },
}, },
]; // ]; //
@ -135,14 +134,13 @@ function PileMonitor() {
setTableData(res?.data?.list ?? []); setTableData(res?.data?.list ?? []);
setTotal(res?.data?.total ?? 0); setTotal(res?.data?.total ?? 0);
} else { } else {
message.error(res.message);
Message.error(res.message);
} }
}) })
.catch((err) => { .catch((err) => {
console.error(err); console.error(err);
}) })
.finally(() => {
});
.finally(() => {});
} }
// //
@ -153,7 +151,7 @@ function PileMonitor() {
if (res.status === 20000) { if (res.status === 20000) {
setStatsData(res.data ?? {}); setStatsData(res.data ?? {});
} else { } else {
message.error(res.message);
Message.error(res.message);
} }
}) })
.catch((err) => { .catch((err) => {

24
src/pages/OperationCenter/OperationSales/CreditScoreMgm/loadable.jsx

@ -414,7 +414,7 @@ function CreditScoreMgm() {
if (e.status == 20000) { if (e.status == 20000) {
setPayVisible(true) setPayVisible(true)
setPayData(e.data) setPayData(e.data)
}else {
} else {
message.error(e.message) message.error(e.message)
} }
}) })
@ -429,16 +429,23 @@ function CreditScoreMgm() {
const getRechargeRulesUpdate = (e) => { const getRechargeRulesUpdate = (e) => {
let flag = [] let flag = []
let arr = [] let arr = []
let couflag = []
e.list.map((item) => { e.list.map((item) => {
if (item.recharge == null || item.recharge == '') { if (item.recharge == null || item.recharge == '') {
flag.push(false) flag.push(false)
} else { } else {
arr.push(item.recharge) arr.push(item.recharge)
let couponArr = []
item.children.map((res) => { item.children.map((res) => {
if (res.couponId == null || res.couponId == '' || res.num == null || res.num == '') { if (res.couponId == null || res.couponId == '' || res.num == null || res.num == '') {
flag.push(false) flag.push(false)
}else {
couponArr.push(res.couponId)
} }
}) })
if (couponArr.length != [...new Set(couponArr)].length) {
couflag.push(false)
}
} }
}) })
if (flatten(flag).some(ele => ele === false)) { if (flatten(flag).some(ele => ele === false)) {
@ -449,6 +456,10 @@ function CreditScoreMgm() {
message.error("每个规则对应的充值金额不能相同,请修改") message.error("每个规则对应的充值金额不能相同,请修改")
return return
} }
if (flatten(couflag).some(ele => ele === false)) {
message.error("每个规则添加的消费券不能相同,请修改")
return
}
ajax.getRechargeRulesUpdate(e).then((e) => { ajax.getRechargeRulesUpdate(e).then((e) => {
if (e.status == 20000) { if (e.status == 20000) {
message.success(e.message) message.success(e.message)
@ -463,7 +474,7 @@ function CreditScoreMgm() {
if (e.status == 20000) { if (e.status == 20000) {
message.success(e.message) message.success(e.message)
return 1 return 1
}else {
} else {
message.error(e.message) message.error(e.message)
} }
}) })
@ -832,7 +843,9 @@ function CreditScoreMgm() {
return <div className="pay-box"> return <div className="pay-box">
<div className="title">规则{index + 1}</div> <div className="title">规则{index + 1}</div>
{index > 0 ? <div className="delrule-btn" onClick={() => { {index > 0 ? <div className="delrule-btn" onClick={() => {
getRechargeRulesDel({ rid: item.rid });
if (item.rid) {
getRechargeRulesDel({ rid: item.rid });
}
let arr = payData let arr = payData
arr.list.splice(index, 1); arr.list.splice(index, 1);
setFlag(flag + 1) setFlag(flag + 1)
@ -891,10 +904,11 @@ function CreditScoreMgm() {
{ {
index2 > 0 && index2 + 1 == item.children.length ? index2 > 0 && index2 + 1 == item.children.length ?
<div className="add-btn del-btn" onClick={() => { <div className="add-btn del-btn" onClick={() => {
getRechargeRulesDel({ cid: res.couponId })
if (res.cid) {
getRechargeRulesDel({ cid: res.cid })
}
let arr = payData let arr = payData
arr.list[index].children.splice(index2, 1); arr.list[index].children.splice(index2, 1);
console.log(847, arr)
setFlag(flag + 1) setFlag(flag + 1)
setPayData(arr) setPayData(arr)
} }

2
src/services/NewEnergy/realtimeMonitor.js

@ -31,7 +31,7 @@ const getPileMonitorList = (params) => {
const getPileMonitorStatsData = (params) => { const getPileMonitorStatsData = (params) => {
return ajax({ return ajax({
url: "/api/nes/piles/count", url: "/api/nes/piles/count",
type: "post",
type: "get",
data: params, data: params,
}); });
}; };

Loading…
Cancel
Save