Browse Source

fix():修复列表序号异常问题

tags/PMS_V1.0.0_Alpha7
何欢 1 year ago
parent
commit
f9d02787fc
  1. 23
      src/pages/NewEnergy/ChargeDeviceMgm/GroundLockManagement/loadable.jsx
  2. 22
      src/pages/NewEnergy/ChargeDeviceMgm/PhysicalPileManagement/loadable.jsx
  3. 2
      src/pages/OffPeak/OffPeakTimeMgm/ManagementTime/loadable.jsx
  4. 14
      src/pages/OffPeak/OffPeakTimeMgm/RuleDetail/loadable.jsx
  5. 12
      src/pages/OffPeak/OffPeakTimeMgm/TimeRule/loadable.jsx

23
src/pages/NewEnergy/ChargeDeviceMgm/GroundLockManagement/loadable.jsx

@ -7,13 +7,14 @@ import ajax from "@/services";
import { TableModule ,FormInput,FormSelect} from "@/components";
import "./index.scss";
import moment from "moment";
import { utils } from "@/config/common";
// import errorImg from "@/assets/images/layout/error.png"
// import { useLocation } from "react-router-dom";
function GroundLockManagement() {
const [selectData, setSelectData] = useState({
supplier:[], //
model:[], //
status:[], //
model:[{value: 0, label: "全部"}], //
status:[{value: 0, label: "全部"}], //
pile_id:[], //
});
const listData={
@ -26,15 +27,6 @@ function GroundLockManagement() {
}
const columns = [
{
title: "序号",
dataIndex: "index",
key: "index",
align:"center",
render: (_, record, index) => {
return index + 1;
},
},
{
title: "设备名称",
dataIndex: "name",
align: "center",
@ -145,7 +137,8 @@ function GroundLockManagement() {
//
const initFormData = {
name: "",
date_type: "0",
model: 0,
status: 0
};
const [visible, setVisible] = useState(false);
//
@ -155,6 +148,7 @@ function GroundLockManagement() {
//
const [total, setTotal] = useState(10);
function search(params) {
utils.tableScrollTop("parent-table-scroll");
ajax.getDeviceLockList(params).then((res) => {
if (res.status === 20000) {
setTableData(res.data.list);
@ -176,11 +170,11 @@ function GroundLockManagement() {
}
//
const handleOk = () => {
if(!rowData.name){
if(!rowData.name||rowData.name.match(/^\s+$/)){
message.destroy();
message.warning(`设备名称不可为空`);
return
}else if(!rowData.code){
}else if(!rowData.code||rowData.code.match(/^\s+$/)){
message.destroy();
message.warning(`设备编码不可为空`);
return
@ -241,6 +235,7 @@ function GroundLockManagement() {
return (
<>
<TableModule
showSerial={true}
ref={tableRef}
columns={columns}
tableData={tableData}

22
src/pages/NewEnergy/ChargeDeviceMgm/PhysicalPileManagement/loadable.jsx

@ -2,10 +2,11 @@ import React, { useState, useRef, useEffect } from "react";
import { message, Modal, Button ,Input} from "antd";
import ajax from "@/services";
import { TableModule ,FormInput,FormSelect} from "@/components";
import { utils } from "@/config/common";
import "./index.scss";
function PhysicalPileManagement() {
const [selectData, setSelectData] = useState([]);
const [selectData, setSelectData] = useState([{value: 0, label: "全部"}]);
const listData={
name: "",
code:"",
@ -15,15 +16,6 @@ function PhysicalPileManagement() {
}
const columns = [
{
title: "序号",
dataIndex: "index",
key: "index",
align:"center",
render: (_, record, index) => {
return index + 1;
},
},
{
title: "设备名称",
dataIndex: "name",
align: "center",
@ -72,7 +64,7 @@ function PhysicalPileManagement() {
//
const initFormData = {
name: "",
// charging_station_id: "0",
charging_station_id: 0,
};
const [visible, setVisible] = useState(false);
//
@ -83,6 +75,7 @@ function PhysicalPileManagement() {
const [total, setTotal] = useState(0);
function search(params) {
utils.tableScrollTop("parent-table-scroll");
ajax.getList(params).then((res) => {
if (res.status === 20000) {
setTableData(res.data.list);
@ -104,16 +97,16 @@ function PhysicalPileManagement() {
}
//
const handleOk = () => {
if(!rowData.name){
if(!rowData.name||rowData.name.match(/^\s+$/)){
message.destroy();
message.warning(`设备名称不可为空`);
return
}else if(!rowData.code){
}else if(!rowData.code||rowData.code.match(/^\s+$/)){
message.destroy();
message.warning(`硬件编码不可为空`);
return
}
else if(!rowData.model){
else if(!rowData.model||rowData.model.match(/^\s+$/)){
message.destroy();
message.warning(`设备型号不可为空`);
return
@ -159,6 +152,7 @@ function PhysicalPileManagement() {
return (
<>
<TableModule
showSerial={true}
ref={tableRef}
columns={columns}
tableData={tableData}

2
src/pages/OffPeak/OffPeakTimeMgm/ManagementTime/loadable.jsx

@ -5,6 +5,7 @@ import { TableModule ,FormInput,FormSelect,FormDatePicker} from "@/components";
import { useSelector, useDispatch } from "react-redux"
import "./index.scss";
// import errorImg from "@/assets/images/layout/error.png"
import { utils } from "@/config/common";
import { useNavigate, useLocation } from "react-router-dom"
import { useParams } from "react-router-dom";
const { TextArea } = Input;
@ -138,6 +139,7 @@ function ManagementTime(props) {
const [total, setTotal] = useState(10);
const [tableSelectCheck, setTableSelectCheck] = useState([]); // id
function search(params) {
utils.tableScrollTop("parent-table-scroll");
ajax.getRuleLinkList({...params,rule_id:id}).then((res) => {
if (res.status === 20000) {
let data=res.data.list

14
src/pages/OffPeak/OffPeakTimeMgm/RuleDetail/loadable.jsx

@ -6,6 +6,7 @@ import { message, Pagination, Table, Space, Modal, Button ,Popover,Input,TimePic
import ajax from "@/services";
import { TableModule ,FormInput,FormSelect} from "@/components";
import "./index.scss";
import { utils } from "@/config/common";
import moment from "moment";
// import errorImg from "@/assets/images/layout/error.png"
// import { useLocation } from "react-router-dom";
@ -51,15 +52,6 @@ function RuleDetail() {
}
const columns = [
{
title: "序号",
dataIndex: "index",
key: "index",
align:"center",
render: (_, record, index) => {
return index + 1;
},
},
{
title: "名称",
dataIndex: "name",
align: "center",
@ -183,6 +175,7 @@ function RuleDetail() {
//id
const [editId,setEditId] = useState("");
function search(params) {
utils.tableScrollTop("parent-table-scroll");
ajax.getTimeRuleDetailsList(params).then((res) => {
if (res.status === 20000) {
setTableData(res.data.list);
@ -205,7 +198,7 @@ function RuleDetail() {
}
//
const handleOk = () => {
if(!rowData.name){
if(!rowData.name || rowData.name.match(/^\s+$/)){
message.destroy();
message.warning(`名称不可为空`);
return
@ -289,6 +282,7 @@ function RuleDetail() {
return (
<>
<TableModule
showSerial={true}
ref={tableRef}
columns={columns}
tableData={tableData}

12
src/pages/OffPeak/OffPeakTimeMgm/TimeRule/loadable.jsx

@ -8,6 +8,7 @@ import { TableModule ,FormInput} from "@/components";
import { useNavigate, useLocation } from "react-router-dom"
import { useSelector, useDispatch } from "react-redux"
import { setTabList} from "@/store/common.js"
import { utils } from "@/config/common";
import "./index.scss";
// import errorImg from "@/assets/images/layout/error.png"
// import { useLocation } from "react-router-dom";
@ -37,8 +38,14 @@ function TimeRule() {
<div className="operateBtn">
<div
onClick={() => {
let sameMenu = []
let sessionStorageData= JSON.parse(sessionStorage.getItem('tabList'))
let sameMenu = sessionStorageData.filter(item => { return item.path.indexOf("/offPeak/managementTime")>-1})
if(sessionStorageData===null){
sessionStorageData=[]
}else{
sameMenu= sessionStorageData.filter(item => { return item.path.indexOf("/offPeak/managementTime")>-1})
}
if(sameMenu.length==0){
sessionStorageData.push({text: "管理时间", name: "managementTime", icon: "", path: `/offPeak/managementTime?&id=${record.id}`})
sessionStorage.setItem("tabList",JSON.stringify(sessionStorageData))
@ -123,6 +130,7 @@ function TimeRule() {
//id
const [editId,setEditId] = useState("");
function search(params) {
utils.tableScrollTop("parent-table-scroll");
ajax.getTimeRuleList(params).then((res) => {
if (res.status === 20000) {
setTableData(res.data.list);
@ -167,7 +175,7 @@ function TimeRule() {
};
//
const handleOk = () => {
if(!rowData.name){
if(!rowData.name||rowData.name.match(/^\s+$/)){
message.destroy();
message.warning(`名称不可为空`);
return

Loading…
Cancel
Save