2020-10-30

git add .$ git pull origin feature/V8.30 可以从其他的分支拉当前的分支名$ git push 是最新的代码git checkout -b feature/lsh 创建并且切换分支git checkout feature/lsh 切换分支在一个分支中修改了内容,切换了分支, git pull origin feature/V8.30在拉取对应的分支post: { codes:[1,2,3], elment: 'ph', date: '2013--1-2', }data:[ {code: 1name: ''x: [1, 1,.2, 2012, 2012,]y: [1,2, 3.2, 4.5, 6.5]}{}]git commit -m "EP-EAMS-WS#95 lhs"后端的参数POST /esz/sampling/compare/datasheets 趋势列表{"dataSource":"1","searchType":"1","searchKey":"1","currentPage":1,"pageSize":20,"startTime":"2020-01-01 00:00:00","endTime":"2020-08-20 23:59:59","dateType":"7","siteCodeList":["0407061050389"]} for (let i = 0; i < params.length; i++) { let port; if (params[i].value || params[i].value === 0) { // port = params[i].value; port = params[i].value; } else { port = "--"; } str += `

${params[i].seriesName}:${port}${obj.unit}

`;          } for (let i = 0; i < params.length; i++) {              let port;              let mg            if (params[i].value || params[i].value === 0) {              // port = params[i].value;              port = params[i].value;              mg = obj.unit            } else {              port = "--";              mg = ''            }            str += `

${params[i].seriesName}:${port}${msg}

`;          }废水账号和密码13728989201/Z2h0H1b9Pa630 门户账号和密码13424231553 Z2h0H1b9Pa630EX-LUOSHAOHUA001@SCQSZ-L1406 MINGW64 ~/Desktop/2、需求文档/土壤系统-污染地块管理-V1.2$ npm i anywhere -gD:\Users\EX-lUOSHAOHUA001\AppData\Roaming\npm\anywhere -> D:\Users\EX-lUOSHAOHUA001\AppData\Roaming\npm\node_modules\anywhere\bin\anywhere+ anywhere@1.5.0added 37 packages from 25 contributors in 55.756sEX-LUOSHAOHUA001@SCQSZ-L1406 MINGW64 ~/Desktop/2、需求文档/土壤系统-污染地块管理-V1.2$ anywhereRunning at http://10.161.58.142:8000/Also running at https://10.161.58.142:8001/EX-LUOSHAOHUA001@SCQSZ-L1406 MINGW64 ~/Desktop/2、需求文档/土壤系统-污染地块管理-V1.2$ ^CEX-LUOSHAOHUA001@SCQSZ-L1406 MINGW64 ~/Desktop/2、需求文档/土壤系统-污染地块管理-V1.2$ cd ../EX-LUOSHAOHUA001@SCQSZ-L1406 MINGW64 ~/Desktop/2、需求文档$ anywhereRunning at http://10.161.58.142:8000/Also running at https://10.161.58.142:8001/"utils": path.resolve(__dirname, "../src/utils")// InterfaceManger的文件export default class InterfaceManger extends Component {  constructor(props) {    super(props)    this.state = {      checkedList: defaultCheckedList,      indeterminate: true,      checkAll: false,    };  }  onChange = checkedList => {    this.setState({      checkedList,      indeterminate: !!checkedList.length && checkedList.length < plainOptions.length,      checkAll: checkedList.length === plainOptions.length,    });  };  onCheckAllChange = e => {    this.setState({      checkedList: e.target.checked ? plainOptions : [],      indeterminate: false,      checkAll: e.target.checked,    });  };  render() {    return (      <>

{/*接口类型*/}

全选

)  }}// 全选import React, { Component } from "react";import chooseInterface from "./components/chooseInterface/chooseInterface";import MessageList from "./components/messageList/messageList";import { Checkbox } from "antd";import "./interfaceManger.less"const CheckboxGroup = Checkbox.Group;const plainOptions = ["实时数据接口", "分钟数据接口", "小时数据接口", "日数数据接口", "设备状态接口", "采样接口", "质控数据接口", "告警数据接口", "文件接口"];const defaultCheckedList = ["实时数据接口", "分钟数据接口", "小时数据接口", "日数数据接口", "设备状态接口", "采样接口", "质控数据接口", "告警数据接口", "文件接口"];export default class InterfaceManger extends Component {  constructor(props) {    super(props)    this.state = {      checkedList: defaultCheckedList,      indeterminate: true,      checkAll: false,    };  }  onChange = checkedList => {    this.setState({      checkedList,      indeterminate: !!checkedList.length && checkedList.length < plainOptions.length,      checkAll: checkedList.length === plainOptions.length,    });  };  onCheckAllChange = e => {    this.setState({      checkedList: e.target.checked ? plainOptions : [],      indeterminate: false,      checkAll: e.target.checked,    });  };  render() {    return (      <>

{/*接口类型*/}

全选

)  }}json.parse()字符串转对象< div class="pane-content" style="padding: .2rem .2rem">.messageDataList-container .siteData-list{  padding: 0 0}monitorType-item ant-checkbox-wrapperant-checkbox-group-item ant-checkbox-wrapper ant-checkbox-wrapper-checkedEX-LUOSHAOHUA001@SCQSZ-L1406 MINGW64 ~/Desktop$ node testCode.jsD:\Users\EX-lUOSHAOHUA001\Desktop\testCode.js:12const result = arrs.filter((item) => arr.find(item.code))                                        ^TypeError: 1 is not a function    at Array.find ()    at D:\Users\EX-lUOSHAOHUA001\Desktop\testCode.js:12:42    at Array.filter ()    at Object.(D:\Users\EX-lUOSHAOHUA001\Desktop\testCode.js:12:21)?[90m    at Module._compile (internal/modules/cjs/loader.js:1133:30)?[39m?[90m    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)?[39m?[90m    at Module.load (internal/modules/cjs/loader.js:977:32)?[39m?[90m    at Function.Module._load (internal/modules/cjs/loader.js:877:14)?[39m?[90m    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)?[39m?[90m    at internal/main/run_main_module.js:18:47?[39mEX-LUOSHAOHUA001@SCQSZ-L1406 MINGW64 ~/Desktop$ node testCode.js[  { name: '实时数据接口调用次数', code: 1, numbers: 129, url: 'bg02' },  { name: '日数据接口调用次数', code: 4, numbers: 129, url: 'bg02' },  { name: '设备状态接口调用次数', code: 5, numbers: 129, url: 'bg02' },  { name: '采样数据接口调用次数', code: 6, numbers: 129, url: 'bg02' }] 123qqEX-LUOSHAOHUA001@SCQSZ-L1406 MINGW64 ~/Desktop // componentDidMount () {  //  const { arrs, data } =this.state  //  const { selectedSite, arr} = this.props  //  for (let i = 0; i < arr.length; i++) {  //    for (let j = 0; j < selectedSite.length; j++) {  //      if (arr[i].code === selectedSite[j] ) {  //        data.push(arr[i])  //      }  //    }  //  }  //  // this.setState({ data })  //  console.log(this.state.data, "datata");  // }物连网http://30.23.11.58:30340/swagger-ui.html#!/monitor45info45controller/callCountUsingPOST企业端土壤的提交git commit -m "EP-SEMS#47 "提交git add .git commit -m "EP-SEMS#47 ls"git pull 如果合并冲突后,还要执行git add .git commit -m "EP-SEMS#47 ls"在上传git pushconst arr = [1,4,5,6]const arrs = [    { name: "实时数据接口调用次数", code: 1, numbers: 129, url: 'bg02' },�����      { name: "分钟数据接口调用次数", code: 2, numbers: 129, url: 'bg02' },    { name: "小时数据接口调用次数", code: 3, numbers: 129, url: 'bg02' },    { name: "日数据接口调用次数",  code: 4, numbers: 129, url: 'bg02' },    { name: "设备状态接口调用次数", code: 5, numbers: 129, url: 'bg02' },    { name: "采样数据接口调用次数", code: 6, numbers: 129, url: 'bg02' },    { name: "告急数据接口调用次数", code: 7, numbers: 129, url: 'bg02' },    { name: "文件接口调用次数", code: 8, numbers: 129, url: 'bg02' }]const resultArr = []arr.forEach((item1) => {    const temp = arrs.find((innerItem) => innerItem.code === item1)    resultArr.push(temp)})// PlotSurvey.tsximport React, { useState } from "react";import styls from "./PlotSurvey.module.less";import PlotSuveyMenu from "../PlotSuveyMenu/PlotSuveyMenu";import SensitiveReceptor from "./SensItiveInfo/sensitiveReceptor";import FirstStepSurveyInfo from "../FirstStepSurveyInfo/FirstStepSurveyInfo";const PlotSurvey: React.FC = () => {  const [step, setStep] = useState(1);  const onHandleSelected = (code: number) => {    setStep(code);  };  // 渲染函数  const renderComponent = (step: number) => {    if (step === 1) {      return;    }    if (step === 3) {      return;    }  };  return

{ renderComponent(step) }

;};export default PlotSurvey;父元素position: relative保存按钮定位 子元素    left: 50%;    top: 95%;    position: absolute;    transform: translate(-50%, -95%);记住组件的名字大写的(组件名的大小写)import soilGroundwater from "./components/soilGroundwater/soilGroundwater" 错应该是import SoilGroundwater from "./components/SoilGroundwater/SoilGroundwater"注意的是大小写Failed to compile./src/pages/businessPages/LandManage/components/PlotSurvey/components/SoilGroundwater/SoilGroundwater.tsxCannot find file: 'soilGroundwater.module.less' does not match the corresponding name on disk: '.\src\pages\businessPages\LandManage\components\PlotSurvey\components\SoilGroundwater\SoilGroundwater.module.less'.This error occurred during the build time and cannot be dismissed.表格 // .font {  //  text-align: center;  // }  // .tablecontainer{  //  width: 100%;  //  height: calc(100% - .5rem);  // }className={styls.excles `${styls.PointCntTable} reset-table auto-scroll-y`}const getData = async (pageNo?: number) => {    setLoading(true);    const res = await Service.getSoilgroundInfo();    // if (res.code === 200) {  这里获取不到res.code原因是内部已经封装好了,已经处理好了,所以打印不出来    //  setLoading(false);    // }    setLoading(false);    console.log(res, "code");    // console.log(res[0].code, res && res[0], res[0].regionCode, setLoading);  };把相应的参数传入进去msg: "Required request body is missing: public com.pingan.city.secn.toolkit.http.response.SecnResponse> com.pingan.city.ep.sems.controller.EnterprisePlotSurveyActivityController.querySoilAndGroundwaterInfo(com.pingan.city.ep.sems.controller.dto.req.QuerySurveyCompanyInfoReq)"假数据 const tmpdataSource: any[] = [    {      key: "1",      name: "胡彦斌",      age: 32,      address: "西湖区湖底公园1号",    },    {      key: "2",      name: "胡彦祖",      age: 42,      address: "西湖区湖底公园1号",    },    {      key: "3",      name: "胡彦祖",      age: 42,      address: "西湖区湖底公园1号",    },    {      key: "4",      name: "胡彦祖",      age: 42,      address: "西湖区湖底公园1号",    },    {      key: "5",      name: "胡彦祖",      age: 42,      address: "西湖区湖底公园1号",    },    {      key: "6",      name: "胡彦祖",      age: 42,      address: "西湖区湖底公园1号",    },    {      key: "7",      name: "胡彦祖",      age: 42,      address: "西湖区湖底公园1号",    },    {      key: "8",      name: "胡彦祖",      age: 42,      address: "西湖区湖底公园1号",    },    {      key: "9",      name: "胡彦祖",      age: 42,      address: "西湖区湖底公园1号",    },    {      key: "10",      name: "胡彦祖",      age: 42,      address: "西湖区湖底公园1号",    },    {      key: "11",      name: "胡彦祖",      age: 42,      address: "西湖区湖底公园1号",    },    {      key: "12",      name: "胡彦祖",      age: 42,      address: "西湖区湖底公园1号",    },    {      key: "13",      name: "胡彦祖",      age: 42,      address: "西湖区湖底公园1号",    },    {      key: "14",      name: "胡彦祖",      age: 42,      address: "西湖区湖底公园1号",    },    {      key: "15",      name: "胡彦祖",      age: 42,      address: "西湖区湖底公园1号",    },    {      key: "16",      name: "胡彦祖",      age: 42,      address: "西湖区湖底公园1号",    },    {      key: "17",      name: "胡彦祖",      age: 42,      address: "西湖区湖底公园1号",    },    {      key: "18",      name: "胡彦祖",      age: 42,      address: "西湖区湖底公园1号",    },    {      key: "19",      name: "胡彦祖",      age: 42,      address: "西湖区湖底公园1号",    },    {      key: "20",      name: "胡彦祖",      age: 42,      address: "西湖区湖底公园1号",    },    {      key: "21",      name: "胡彦祖",      age: 42,      address: "西湖区湖底公园1号",    },    {      key: "22",      name: "胡彦祖",      age: 42,      address: "西湖区湖底公园1号",    },    {      key: "23",      name: "胡彦祖",      age: 42,      address: "西湖区湖底公园1号",    },  ];查询土壤详情页样式.container {    width: 100%;  height: 100%;  padding: 0.2rem 0.2rem;  position: relative;  .tableTop {    height: .8rem;    width: 100%;    display: flex;    align-items: center;    flex-direction: row-reverse;  }    .PointCntTable {    height: calc(100% - 1.8rem);    width: calc(100% - 0.4rem);    .btnCon {      span {        color: #427aff;        cursor: pointer;        &:not(:last-child) {          margin-right: 0.2rem;        }      }    }    :global(.ant-table-body-outer) {      height: calc(100% - 0.5rem);    }    :global(.ant-table.ant-table-scroll-position-left .ant-table-fixed-left) {      pointer-events: none;    }    :global(.ant-table-fixed-header .ant-table-fixed-left .ant-table-body-inner) {      margin-right: 0;    }    :global(.col-polluteName),    :global(.col-pointCode),    :global(.col-pointName) {      max-width: 1.6rem;    }  }  .enter {    width: 1.05rem;    height: 0.4rem;    color: #427AFF;    text-align: center;    line-height: 0.4rem;    border: 1px solid #427AFF;    font-size: 0.16rem;    cursor: pointer;  }  .pageCon {    position: absolute;    bottom: 1rem;    left: 0;    display: flex;    align-items: center;    justify-content: flex-end;    padding-right: 0.4rem;    width: 100%;    height: 0.5rem;    line-height: 0.5rem !important;    align-items: center !important;    background: #f5f6fa;    box-shadow: 0 0 0.05rem 0 rgba(0, 0, 0, 0.1);  }  .save {    position: absolute;    width: 0.9rem;    height: 0.4rem;    background: #427AFF;    color: #FFFFFF;    left: 50%;    top: 95%;    transform: translate(-50%, -95%);    text-align: center;    line-height: 0.4rem;    cursor: pointer;  }}查询详情页的代码import React, { useState, useEffect } from "react";import { Table, Pagination } from "antd";import Nodata from "components/NoData/NoData";import styls from "./SoilGroundwater.module.less";import { useStore } from "store/appStore";import Service from "../../../../Service";const PAGESIZE_OPTIONS = ["20", "50", "100"];interface IColumns {  title: string | (() => React.ReactNode),  dataIndex: string,  key: string,  className?: string,  width?: number,  fixed?: boolean | "left" | "right",  render?: (text: any, record: any, index: number) => React.ReactNode}const SoilGroundwater: React.FC = () => {  const store = useStore();  const [loading, setLoading] = useState(true);  const rootFontSize = store.rootFontSize;  const [pageNo, setpageNo] = useState(1);  const [pageSize, setPageSize] = useState(20);  const [totalCount, setTotalCount] = useState(0);  const [dataSource, setDataSource] = useState([]);  const formatData = (vl: string | number | null) => {    return (vl || vl === 0) ? `${vl}` : "--";  };  useEffect(() => {    setpageNo(1);    getData(1);    getExport();  }, [pageSize]);  const getData = async (pageNo?: number) => {    if (!pageNo || !pageSize) return;    setLoading(true);    setDataSource([]);    let par = {      // "currentPage": 1,      currentPage: pageNo,      // "pageSize": 20,      pageSize,      "plotCode": "440306416230003"    };    const res = await Service.getSoilgroundInfo(par);    setTotalCount(res.totalCount || 0);    setDataSource(res.data || []);    setLoading(false);    console.log(res, "code");  };  const getExport = async () => {    if (!pageNo) return;    const res = await Service.importInfo();    console.log(res);  };  const columns: IColumns[] = [    {      title: "序号",      dataIndex: "number",      key: "number",      width: 1.7 * Number(rootFontSize),      render: (text: any, record: any, index: number) =>{(index + 1) + (pageNo - 1) * pageSize}},    {      title: "检测项编号",      dataIndex: "checkItemCode",      key: "checkItemCode",      className: "truncated col-plotCode",      width: 2.3 * rootFontSize,      render: (text: string) =>

{formatData(text)}

},    {      title: "检测项名称",      dataIndex: "checkItemName",      key: "checkItemName",      className: "truncated",      width: 2.8 * rootFontSize,      render: (text: string) =>

{formatData(text)}

},    {      title: "检测项类型",      dataIndex: "checkItemType",      key: "checkItemType",      width: 2 * rootFontSize,      render: (text: string) =>

{formatData(text)}

},    {      title: "CAS码",      dataIndex: "casCode",      key: "casCode",      width: 1.97 * rootFontSize,      render: (text: string) =>

{formatData(text)}

},    {      title: "检测项类别",      dataIndex: "checkItemCategory",      key: "checkItemCategory",      width: 2.2 * rootFontSize,      render: (text: string) =>

{formatData(text)}

},    {      title: "检测项分类",      dataIndex: "checkItemClassify",      key: "checkItemClassify ",      className: "truncated",      render: (text: string) =>

{formatData(text)}

}  ];  const onPageChange = (pageNumber: number) => {    setpageNo(pageNumber);    getData(pageNumber);    console.log(pageNumber, pageNo, "pageNumber");  };  const pageSizeChange = (current: number, size: number) => {    setPageSize(size);    console.log(size, "size");  };  return (

{/*

导入

*/}

`${record.linkCode}_${i}`}            className={`${styls.PointCntTable} reset-table auto-scroll-y`}            columns={columns}            dataSource={dataSource || []}            pagination={false}            scroll={{ y: "auto" }}            loading={loading}            locale={{              emptyText: () => {                return !loading ?: null;              }            }}          />                {dataSource && dataSource.length ?

`共${total}条`} pageSizeOptions={PAGESIZE_OPTIONS} showSizeChanger showQuickJumper className="reset-ant-pagination" onChange={onPageChange} onShowSizeChange={pageSizeChange} />

: null        }        {dataSource && dataSource.length ?

保存

: null}            );};export default SoilGroundwater;点击完成import React, { useState, useEffect } from "react";import { Checkbox, message } from "antd";import Service from "../../../../Service";import Title from "components/BaseTitle/baseTitle";import sStyle from  "./SensitiveReceptor.module.less";const SensitiveReceptor: React.FC<{ plotCode: string, getSensitive: (i: boolean) => void }> = ({ plotCode, getSensitive }) => {  const [filtParam, setFilterParam] = useState([]);  const [list, setList] = useState([]);  const [isSuccess, setIsSuccess] = useState(false);  useEffect(() => {    (async () => {      const res = await Service.landType({ dicName: "calcium_type" });      res.forEach((item: any) => {        item.code = item.fieldValue;        item.name = item.fieldName;      });      setList(res);    })();  }, []);  useEffect(() => {    (async () => {      const res = await Service.getSensitiveInfoDetail({ plotCode });      setFilterParam(res && res.calciumType);    })();  }, []);  const handScreeningChange = (timeTypes: any) => {    console.log(timeTypes);    setFilterParam(timeTypes);  };  const handClick = async () => {    if (filtParam && !filtParam.length) {      message.error("缺少必填信息!");      return;    }    let param = {      calciumTypeList: filtParam,      plotCode: plotCode    };    const res = await Service.getCreateSensitive(param);    if (res) {      setIsSuccess(true);    } else {      setIsSuccess(false);    }    getSensitive && getSensitive(isSuccess);  };  return

</div> <div className={sStyle.center}> <div className={sStyle.centerSize}>地块周边1km范围内敏感点类型</div> <div className={sStyle.multiSelect}> <Checkbox.Group className="monitorType-item CheckboxGroup reset-ant-checkbox" value={filtParam} onChange={(checkedValues: any) => handScreeningChange(checkedValues)} > { (list || []).map((item: any) => { return <Checkbox key={item.code} value={item.code}>{item.name}</Checkbox>; }) } </Checkbox.Group> </div> </div> <div className={sStyle.save} onClick={handClick}>保存</div> </div>; }; export default SensitiveReceptor; 编辑 BaseUpload.tsx git commit -m "EP-SEMS#47 lshedit" Service.landType({ "plotCode" : "440306416230003" }), import React, { useState, useEffect } from "react"; import styls from "./EditsoilGroundwater.module.less"; import Title from "components/BaseTitle/baseTitle"; import { Modal, message, Table, Upload } from "antd"; import Service from "../../../../Service"; import Nodata from "components/NoData/NoData"; import { useStore } from "store/appStore"; import CommonFunc from "utils/commonFunc"; import { plotManageApi } from "utils/apiGroup"; import ApiFetch from "utils/apiFetch"; // import BaseUpload from "../../../EditPlot/BaseUpload"; // const PAGESIZE_OPTIONS = ["20", "50", "100"]; interface IColumns { title: string | (() => React.ReactNode), dataIndex: string, key: string, className?: string, width?: number, fixed?: boolean | "left" | "right", render?: (text: any, record: any, index: number) => React.ReactNode } const EditsensitiveReceptor: React.FC<{ plotCode: string }> = ({ plotCode }) => { const store = useStore(); const [loading, setLoading] = useState(true); const rootFontSize = store.rootFontSize; const [pageNo, setpageNo] = useState(1); const [pageSize] = useState(20); const [totalCount, setTotalCount] = useState(0); const [dataSource, setDataSource] = useState<any[]>([]); const [visible, setVisible] = useState<boolean>(false); const [oneShow, setoneShow] = useState<boolean>(true); const [twoShow, settwoShow] = useState<boolean>(false); const [threeShow] = useState<boolean>(false); const [datas, setDatas] = useState<any[]>([]); const [uploadFile, setUploadFile] = useState<any[]>(); // const [uploadMessage, setUploadMessage] = useState(); // const [permitData] = useState<any[]>([]); // console.log(setthreeShow); const handBackClick = () => { setVisible(true); console.log("setVisible", setVisible); }; const onClose = () => { setVisible(false); if (twoShow) { setVisible(true); setoneShow(true); message.error("导入失败"); } settwoShow(false); }; const onConfirm1 = () => { console.log("11"); setVisible(true); // setoneShow(false); // settwoShow(true); if (twoShow) { setVisible(false); setoneShow(true); settwoShow(true); message.success("导入成功"); } // setthreeShow({ display: "block" }); // console.log(settwoShow, setthreeShow, message, datas, "datas121232"); }; const onConfirm2 = () => { upload(uploadFile); setVisible(true); // setoneShow(); settwoShow(true); if (twoShow) { setVisible(false); setoneShow(true); settwoShow(false); message.success("导入成功"); } }; const onConfirm3 = () => { }; const downloadBar = async () => { let pars = { "templateType": "index" }; const res = await Service.getDownLoadTemplate(pars); setDatas(res || []); console.log("downloadBar", datas, res); window.open(res); }; useEffect(() => { setpageNo(1); getData(1); }, [pageSize]); const getData = async (pageNo?: number) => { if (!pageNo || !pageSize) return; setLoading(true); setDataSource([]); setTotalCount(totalCount || 0); setDataSource([]); setLoading(false); }; const columns: IColumns[] = [ { title: "序号", dataIndex: "number", key: "number", width: 1.7 * Number(rootFontSize), render: (text: any, record: any, index: number) => <span>{(index + 1) + (pageNo - 1) * pageSize}</span> }, { title: "检测项编号", dataIndex: "checkItemCode", key: "checkItemCode", className: "truncated col-plotCode", width: 2.3 * rootFontSize, }, { title: "检测项名称", dataIndex: "checkItemName", key: "checkItemName", className: "truncated", width: 2.8 * rootFontSize, }, { title: "检测项类型", dataIndex: "checkItemType", key: "checkItemType", width: 2 * rootFontSize, }, { title: "CAS码", dataIndex: "casCode", key: "casCode", width: 1.97 * rootFontSize, }, { title: "检测项类别", dataIndex: "checkItemCategory", key: "checkItemCategory", width: 2.2 * rootFontSize, }, { title: "检测项分类", dataIndex: "checkItemClassify", key: "checkItemClassify ", className: "truncated", } ]; const uploadProps = { showUploadList: true, accept: "application/pdf,.xlsx,.word,.doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document", beforeUpload: (file: any, fileList: any) => { setUploadFile(file); setoneShow(false); settwoShow(true); return false; } }; const upload = (file: any) => { const formData = new FormData(); // formData.append("plotCode", plotCode); formData.append("file", file); const api = `${plotManageApi.analysisImport}?plotCode=${plotCode}`; const url = api.startsWith("http://") ? api : `${ApiFetch.host}${api}`; fetch(url, { method: "post", headers: { // "Content-Type": "application/x-www-form-urlencoded", "tkUserToken": CommonFunc.getCookie("tkUserToken") || "", }, body: formData } ).then( response => response.json()); }; return <div className={styls.container} > <div className={styls.tableTop}> <div className={styls.enter} onClick={handBackClick}> <i className="iconfont paicon-export" style={{ paddingRight: "0.05rem" }}></i> 导入 </div> <Modal title="" wrapClassName={styls.editModal} visible={visible} centered onCancel={onClose} footer={null} width="4.6rem" > <div style={oneShow ? { display: "block" } : { display: "none" }} > <Title title="导入土壤和地下水检测指标信息" /> </div> <div className={styls.someFont} style={oneShow ? { display: "block" } : { display: "none" }}> 请上传污染物信息文件, 点击<a className={styls.smallFont} onClick={downloadBar}>模板</a>下载 <div className={styls.footerBtn}> <div onClick={onClose}>取消</div> <div onClick={onConfirm1}> <Upload {...uploadProps}>上传</Upload></div> </div> </div> {/* <div className={styls.file}> <input name="文件" /> </div> */} <div style={twoShow ? { display: "block" } : { display: "none" }} > <Title title="导入土壤和地下水检测指标信息" /> </div> <div className={styls.fileInput} style={twoShow ? { display: "block" } : { display: "none" }} > <div className={styls.inputTop}> <span className={styls.twoFile}>文件</span> <input type="text" value="文件" className={styls.inputOne} /> </div> <div className={styls.footerBtn}> <div onClick={onClose}>取消</div> <div onClick={onConfirm2}>确定</div> </div> </div> <div style={threeShow ? { display: "block" } : { display: "none" }} > <div className={styls.del}> 确定要删除吗? </div> <div className={styls.footerBtn}> <div onClick={onClose}>取消</div> <div onClick={onConfirm3}>确定</div> </div> </div> </Modal> </div> <div className={styls.tablecontainer}> <Table rowKey={(record: any, i: number) => `${record.linkCode}_${i}`} className={`${styls.PointCntTable} reset-table auto-scroll-y`} columns={columns} dataSource={dataSource || []} pagination={false} scroll={{ y: "auto" }} loading={loading} locale={{ emptyText: () => { return !loading ? <Nodata /> : null; } }} /> </div> </div>; }; export default EditsensitiveReceptor; async 在箭头函数中起作用 const getData = async () => { let par = { currentPage: pageNo, pageSize, } const res = await Service.getSolidgroundInfo(par); } 盒子向右边,不用定位和浮动 <div className={styls.tableTop}> <div className={styls.enter} onClick={handBackClick}> <i className="iconfont paicon-export" style={{ paddingRight: "0.05rem" }}></i> 导入 </div> </div> .tableTop { height: .8rem; width: 100%; display: flex; align-items: center; flex-direction: row-reverse; position: relative; } .enter { width: 1.05rem; height: 0.4rem; color: #427AFF; text-align: center; line-height: 0.4rem; border: 1px solid #427AFF; font-size: 0.16rem; cursor: pointer; } // 渲染函数 const renderComponent = (step: number) => { // setStep(step); if (step === 1) { return <EditFirstStepSurveyInfo plotCode={plotCode} />; } else if (step === 2) { return <EditDetailSurveyInfo plotCode={plotCode} />; } else if (step === 3) { return <SensitiveReceptor plotCode={plotCode} getNext={getNext} />; } else if (step === 4) { return <BlockBoundary plotCode={plotCode} getNext={getNext} />; } else if (step === 5) { return <FirmProudInfo plotCode={plotCode} />; } else if (step === 8) { return <QualityInformation plotCode={plotCode} getNext={getNext} />; } else if (step === 9) { return <TaskProgressAndSuggest plotCode={plotCode} />; } else if (step === 6) { return <EditsensitiveReceptor plotCode={plotCode} />; } else if (step === 7) { return <SoilSurveyInfo plotCode={plotCode} />; } }; // 解构赋值 const SensitiveReceptor: React.FC<{ plotCode: string, getNext: (i: boolean) => void }> = ({ plotCode, getNext }) => { let param = { calciumTypeList: filtParam, plotCode: plotCode }; } // 这里没有用到解构赋值 const EditsensitiveReceptor: React.FC<any> = (props) => { let par = { currentPage: pageNo, pageSize, plotCode: props && props.plotCode }; const res = await Service.getSoilgroundInfo(par); } 点击保存 .save { position: absolute; left: 50%; transform: translateX(-50%); bottom: 0.2rem; width: 0.9rem; height: 0.4rem; line-height: 0.4rem; font-size: 0.16rem; color: #fff; background-color: #427aff; text-align: center; cursor: pointer; &:hover { background: #7aa1ff; } } useEffect (()=>{ 只允许在异步函数中使用 "await" 表达式。ts(1308) SensitiveReceptor.tsx(12, 13): Did you mean to mark this function as 'async'? // 这种报错 const res = await Service.landType({}), console.log(res); }) 类型“() => Promise<void>”的参数不能赋给类型“EffectCallback”的参数。 不能将类型“Promise<void>”分配给类型“void | (() => void | undefined)”。 不能将类型“Promise<void>”分配给类型“() => void | undefined”。 类型“Promise<void>”提供的内容与签名“(): void | undefined”不匹配。ts(2345) 平安内部的antd企业版 http://30.99.137.231:3018/index-cn http://30.99.142.191:30359/swagger-ui.html#!/3009720284277452657922320223593584326597/createSensitiveUsingPOST file:///D:/Users/EX-lUOSHAOHUA001/%E6%96%B0%E5%BB%BA%E6%96%87%E4%BB%B6%E5%A4%B9/v1.2/%E4%BC%81%E4%B8%9A%E7%AB%AF/20200916%E4%BC%81%E4%B8%9A%E7%AB%AF%E5%9C%B0%E5%9D%97%E6%B4%BB%E5%8A%A8%E7%94%B3%E6%8A%A5/index.html#artboard17 import React, { useState, useEffect } from "react"; import styls from "./EditsoilGroundwater.module.less"; import Title from "components/BaseTitle/baseTitle"; import { Modal, message, Table, Upload, Pagination, Input } from "antd"; import Service from "../../../../Service"; import Nodata from "components/NoData/NoData"; import { useStore } from "store/appStore"; import CommonFunc from "utils/commonFunc"; import { plotManageApi } from "utils/apiGroup"; import ApiFetch from "utils/apiFetch"; // import BaseUpload from "../../../EditPlot/BaseUpload"; const PAGESIZE_OPTIONS = ["20", "50", "100"]; interface IColumns { title: string | (() => React.ReactNode), dataIndex: string, key: string, className?: string, width?: number, fixed?: boolean | "left" | "right", render?: (text: any, record: any, index: number) => React.ReactNode } <<<<<<< HEAD const EditsensitiveReceptor: React.FC<{ plotCode: string }> = ({ plotCode }) => { ======= const EditsensitiveReceptor: React.FC<any> = (props) => { >>>>>>> 4bef61d85a6d3888412724a447cafa48a7487a4b const store = useStore(); const [loading, setLoading] = useState(true); const rootFontSize = store.rootFontSize; const [pageNo, setpageNo] = useState(1); const [pageSize, setPageSize] = useState(20); const [totalCount, setTotalCount] = useState(0); const [dataSource, setDataSource] = useState<any[]>([]); const [visible, setVisible] = useState<boolean>(false); <<<<<<< HEAD const [oneShow, setoneShow] = useState<boolean>(true); const [twoShow, settwoShow] = useState<boolean>(false); const [threeShow, setthreeShow] = useState<boolean>(false); const [datas, setDatas] = useState<any[]>([]); const [uploadFile, setUploadFile] = useState<any[]>(); // const [uploadMessage, setUploadMessage] = useState(); // const [permitData] = useState<any[]>([]); // console.log(setthreeShow); const handBackClick = () => { setVisible(true); console.log("setVisible", setVisible); }; const onClose = () => { setVisible(false); if (twoShow) { setVisible(true); settwoShow(false); setoneShow(true); // message.error("导入失败"); } else if (threeShow) { settwoShow (true); setthreeShow (false); setVisible(true); } else { settwoShow(false); } }; const onConfirm1 = () => { console.log("11"); setVisible(true); // setoneShow(false); // settwoShow(true); if (twoShow) { setVisible(false); setoneShow(true); settwoShow(true); // message.success("导入成功"); } // setthreeShow({ display: "block" }); // console.log(settwoShow, setthreeShow, message, datas, "datas121232"); ======= const [fileList, setFileList] = useState(); const [isShowUpload, setIsShowUpload] = useState<boolean>(false); const [isShowDelete, setIsShowDelete] = useState<boolean>(false); const handBackClick = () => { setVisible(true); >>>>>>> 4bef61d85a6d3888412724a447cafa48a7487a4b }; const onConfirm2 = () => { upload(uploadFile); setVisible(true); // setoneShow(); settwoShow(true); if (twoShow) { setVisible(false); setoneShow(true); settwoShow(false); // message.success("导入成功"); } }; const onConfirm3 = () => { setthreeShow(false); settwoShow(true); }; const downloadBar = async () => { let pars = { "templateType": "index" }; const res = await Service.getDownLoadTemplate(pars); window.open(res); }; useEffect(() => { setpageNo(1); getData(1); }, [pageSize]); const getData = async (pageNo?: number) => { if (!pageNo || !pageSize) return; setLoading(true); <<<<<<< HEAD setDataSource([]); let par = { currentPage: pageNo, pageSize, "plotCode": plotCode }; const res = await Service.getSoilgroundInfo(par); console.log(res, "resgetSoilgroundInfo"); setTotalCount(res.totalCount || 0); setDataSource(res.data || []); ======= let par = { currentPage: pageNo, pageSize, plotCode: props && props.plotCode }; const res = await Service.getSoilgroundInfo(par); setDataSource(res.data || []); setTotalCount(res.totalCount || 0); >>>>>>> 4bef61d85a6d3888412724a447cafa48a7487a4b setLoading(false); }; const columns: IColumns[] = [ { title: "序号", dataIndex: "number", key: "number", width: 1.7 * Number(rootFontSize), render: (text: any, record: any, index: number) => <span>{(index + 1) + (pageNo - 1) * pageSize}</span> }, { title: "检测项编号", dataIndex: "checkItemCode", key: "checkItemCode", className: "truncated col-plotCode", width: 2.3 * rootFontSize, }, { title: "检测项名称", dataIndex: "checkItemName", key: "checkItemName", className: "truncated", width: 2.8 * rootFontSize, }, { title: "检测项类型", dataIndex: "checkItemType", key: "checkItemType", width: 2 * rootFontSize, }, { title: "CAS码", dataIndex: "casCode", key: "casCode", width: 1.97 * rootFontSize, }, { title: "检测项类别", dataIndex: "checkItemCategory", key: "checkItemCategory", width: 2.2 * rootFontSize, }, { title: "检测项分类", dataIndex: "checkItemClassify", key: "checkItemClassify ", className: "truncated", } ]; <<<<<<< HEAD const onPageChange = (pageNumber: number) => { setpageNo(pageNumber); getData(pageNumber); }; const pageSizeChange = (current: number, size: number) => { setPageSize(size); }; const uploadProps = { showUploadList: false, accept: "application/pdf,.xlsx,.word,.doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document", beforeUpload: (file: any, fileList: any) => { setUploadFile(file); setoneShow(false); settwoShow(true); ======= const onClose = () => { setVisible(false); }; const clearFile = (index: number) => { if (index === 1) { setIsShowUpload(false); setIsShowDelete(false); setFileList({}); } else { setIsShowUpload(true); setIsShowDelete(false); } }; const handConfirm = (index: any) => { if (index === 1) { getList(); } else { setIsShowDelete(false); setIsShowUpload(false); } }; const handDelete = () => { setIsShowDelete(true); }; const uploadProps = { showUploadList: true, accept: "application/pdf,.xlsx,.word,.doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document", beforeUpload: (file: any, fileList: any) => { console.log(file); setIsShowUpload(true); setFileList(file); >>>>>>> 4bef61d85a6d3888412724a447cafa48a7487a4b return false; } }; <<<<<<< HEAD const handleDel = () => { console.log("handleDel"); settwoShow(false); setthreeShow(true); }; const upload = (file: any) => { const formData = new FormData(); // formData.append("plotCode", plotCode); formData.append("file", file); const api = `${plotManageApi.analysisImport}?plotCode=${plotCode}`; ======= const upload = (file: any) => { const formData = new FormData(); formData.append("file", file); const api = `${plotManageApi.exportImport}?plotCode=${props && props.plotCode}&surveyStage=6`; >>>>>>> 4bef61d85a6d3888412724a447cafa48a7487a4b const url = api.startsWith("http://") ? api : `${ApiFetch.host}${api}`; fetch(url, { method: "post", headers: { <<<<<<< HEAD // "Content-Type": "application/x-www-form-urlencoded", "tkUserToken": CommonFunc.getCookie("tkUserToken") || "", }, body: formData }).then((res: any) => { const response = res.json(); return response; }).then((res: any) => { console.log("res.code", res.code); if (res.code === 200) { setpageNo(1); getData(1); message.success("导入成功"); } else { message.error("导入失败"); } }); }; return <div className={styls.container} > <div className={styls.tableTop}> <div className={styls.enter} onClick={handBackClick}> <i className="iconfont paicon-export" style={{ paddingRight: "0.05rem" }}></i> 导入 </div> <Modal title="" wrapClassName={styls.editModal} visible={visible} centered onCancel={onClose} footer={null} width="4.6rem" > <div style={oneShow ? { display: "block" } : { display: "none" }} > <Title title="导入土壤和地下水检测指标信息" /> </div> <div className={styls.someFont} style={oneShow ? { display: "block" } : { display: "none" }}> 请上传污染物信息文件, 点击<a className={styls.smallFont} onClick={downloadBar}>模板</a>下载 <div className={styls.footerBtn}> <div onClick={onClose}>取消</div> <div onClick={onConfirm1}> <Upload {...uploadProps}>上传</Upload></div> </div> ======= "tkUserToken": CommonFunc.getCookie("tkUserToken") || "", }, body: formData } ).then( response => response.json()); }; const getList = async () => { upload(fileList); setVisible(false); }; const renderUploadFoot = () => { return ( <> <div className={styls.upLoad}> <div onClick={onClose}>取消</div> <Upload {...uploadProps} className="uploadModal" > 上传 </Upload> >>>>>>> 4bef61d85a6d3888412724a447cafa48a7487a4b </div> </> ); }; const renderFoot = (index: any) => { return ( <> <div className={styls.foot}> <div onClick={() => clearFile(index)}>取消</div> <div onClick={() => handConfirm(index)}>确定</div> </div> <<<<<<< HEAD <div className={styls.fileInput} style={twoShow ? { display: "block" } : { display: "none" }} > <div className={styls.inputTop}> <span className={styls.twoFile}>文件</span> <Input type="text" value="文件" className={styls.inputOne} suffix={<i onClick={handleDel} className="iconfont paicon-delete" style={{ color: "#427AFF" }} ></i>} /> </div> <div className={styls.footerBtn}> <div onClick={onClose}>取消</div> <div onClick={onConfirm2}>确定</div> ======= </> ); }; const renderContent = () => { return ( <> {!isShowDelete && <Title title="导入土壤和地下水检测指标信息" className={styls.title} />} <div className={styls.content} style={{ display: (isShowUpload) ? "none" : "block" }}> <div className={styls.mes}> 请上传污染物信息文件, 点击 <span onClick={downloadBar}>模板</span> 下载 >>>>>>> 4bef61d85a6d3888412724a447cafa48a7487a4b </div> {renderUploadFoot()} </div> <div className={styls.inputFile} style={{ display: (isShowUpload && !isShowDelete) ? "block" : "none" }}> <div className={styls.input}> <label>文件</label> <Input value={fileList && fileList.name} suffix={<i onClick={handDelete} className="iconfont paicon-delete"></i>} /> </div> <<<<<<< HEAD <div className={styls.footerBtn}> <div onClick={onClose}>取消</div> <div onClick={onConfirm3}>确定</div> ======= {renderFoot(1)} </div> <div className={styls.delete} style={{ display: (isShowDelete && isShowUpload) ? "block" : "none" }}> <div> 确定要删除嘛? >>>>>>> 4bef61d85a6d3888412724a447cafa48a7487a4b </div> {renderFoot(2)} </div> </> ); }; const onPageChange = (pageNumber: number) => { setpageNo(pageNumber); getData(pageNumber); }; const pageSizeChange = (current: number, size: number) => { setPageSize(size); }; return <div className={styls.container} > <div className={styls.tableTop}> <div className={styls.enter} onClick={handBackClick}> <i className="iconfont paicon-export" style={{ paddingRight: "0.05rem" }}></i> 导入 </div> </div> <div className={styls.tablecontainer}> <Table rowKey={(record: any, i: number) => `${record.linkCode}_${i}`} className={`${styls.PointCntTable} reset-table auto-scroll-y`} columns={columns} dataSource={dataSource || []} pagination={false} scroll={{ y: "auto" }} loading={loading} locale={{ emptyText: () => { return !loading ? <Nodata /> : null; } }} /> </div> {dataSource && dataSource.length ? <div className={styls.pageCon}> <Pagination current={pageNo} pageSize={pageSize} total={totalCount} showTotal={(total: number) => `共${total}条`} pageSizeOptions={PAGESIZE_OPTIONS} showSizeChanger showQuickJumper className="reset-ant-pagination" onChange={onPageChange} onShowSizeChange={pageSizeChange} /> </div> : null } <<<<<<< HEAD ======= <Modal title="" wrapClassName={styls.editFileModal} visible={visible} centered onCancel={onClose} footer={null} > {renderContent()} </Modal> >>>>>>> 4bef61d85a6d3888412724a447cafa48a7487a4b </div>; }; export default EditsensitiveReceptor; git log 查看日志 git reset HEAD id 污染地块土壤的项目账号 44030641970009 Z2h0H1b9Pa630 土壤环境综合管理系统 13424231553 Z2h0H1b9Pa630 span display: block; width: 1.58rem; topFilter.tsx lookPlotDetail useEffect写一个tab选项卡 import React, { useState } from "react"; import ReviewInfo from "../components/reviewInfo/reviewInfo"; import PlotInfo from "../components/plotInfo/plotInfo"; import EditReviewInfo from "../components/editReviewInfo/editReviewInfo"; import lStyle from "./plotInquiry.module.less"; const plotCode = "12345678"; const PlotInquiry: React.FC = () => { const [active, setActive] = useState(3); const selectAction = (num: number) => { setActive(num); }; const showComponent = () => { if (active === 1) { return <PlotInfo plotCode={plotCode} />; } if (active === 2) { return <ReviewInfo />; } if (active === 3) { return <EditReviewInfo />; } }; return ( <div className={lStyle.wrapper}> <div className={lStyle.title}> <div className={active === 1 ? "select" : ""} onClick={() => selectAction(1)}>地块详情</div> <div className={active === 2 ? "select" : ""} onClick={() => selectAction(2)}>评审信息</div> <div className={active === 3 ? "select" : ""} onClick={() => selectAction(3)}>编辑评审</div> <div className={active === 4 ? "select" : ""} onClick={() => selectAction(4)}>形式审查</div> <div className={active === 5 ? "select" : ""} onClick={() => selectAction(5)}>编辑审查</div> </div> <div className={lStyle.mainBox}> { showComponent() } </div> </div> ); }; export default PlotInquiry; index.js:1437 Warning: Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render. useEffect(()=>{ }) 如果没有useEffect(()=>{ },[]) 会报错的,他会监听多次的,相当开了定时器,一直在监听所有 表格的样式 import React, { useState, useEffect } from "react"; import { Table } from "antd"; import Nodata from "components/Nodata/Nodata"; import mtStyle from "./ExpertInfo.module.less"; import { useStore } from "store/appStore"; interface IColumns { title: string | (() => React.ReactNode), dataIndex: string, key: string, className?: string, width?: number, fixed?: boolean | "left" | "right", render?: (text: any, record: any, index: number) => React.ReactNode } const ExpertInfo: React.FC = () => { const store = useStore(); const [loading, setLoading] = useState(true); const rootFontSize = store.rootFontSize; const [pageNo, setpageNo] = useState(1); const [pageSize, setPageSize] = useState(20); const [totalCount, setTotalCount] = useState(500); const [dataSource, setDataSource] = useState<any[]>([]); // const formatData = (vl: string | number | null) => { // return (vl || vl === 0) ? `${vl}` : "--"; // }; console.log(pageNo, setLoading, pageSize, setpageNo, setPageSize, totalCount, setTotalCount, setDataSource, useEffect); useEffect(() => { setDataSource(tmpdataSource); setLoading(false); }, []); const tmpdataSource: any[] = [ { key: "1", name: "胡彦斌", age: 32, address: "西湖区湖底公园1号", }, { key: "2", name: "胡彦祖", age: 42, address: "西湖区湖底公园1号", }, { key: "3", name: "胡彦祖", age: 42, address: "西湖区湖底公园1号", }, { key: "4", name: "胡彦祖", age: 42, address: "西湖区湖底公园1号", }, { key: "5", name: "胡彦祖", age: 42, address: "西湖区湖底公园1号", }, { key: "6", name: "胡彦祖", age: 42, address: "西湖区湖底公园1号", }, { key: "7", name: "胡彦祖", age: 42, address: "西湖区湖底公园1号", }, { key: "8", name: "胡彦祖", age: 42, address: "西湖区湖底公园1号", }, ]; const columns: IColumns[] = [ { title: "姓名", dataIndex: "number", key: "number", className: "truncated col-plotName", width: 1.2 * rootFontSize, render: (text: any, record: any, index: number) => "李积勋" }, { title: "工作单位", dataIndex: "plotCode", key: "plotCode", className: "truncated col-plotName", width: 2.1 * rootFontSize, render: (text: string) => "深圳市生态金设计研究院股份有限公司" }, { title: "职务", dataIndex: "plotName", key: "plotName1", className: "truncated col-plotName", width: 1.41 * rootFontSize, render: (text: string) => "高级工程师" }, { title: "联系电话", dataIndex: "plotName", key: "plotName2", className: "truncated col-plotName", width: 1.49 * rootFontSize, render: (text: string) => "15170165737" }, { title: "邮箱", dataIndex: "landTypeName", key: "landTypeName", width: 2.3 * rootFontSize, // className: "truncated col-plotName", render: (text: string) => "15170165737@163.com" }, { title: "是否组长", dataIndex: "regionName", key: "regionName", width: 1.61 * rootFontSize, className: "truncated col-plotName", render: (text: string) => "是" }, { title: "审查意见", dataIndex: "checkItemClassify1", key: "checkItemClassify1", width: 1.8 * rootFontSize, className: "truncated col-plotName", render: (text: string) => "修改后完善后通过" }, { title: "专家具体意见", dataIndex: "checkItemClassify2", key: "checkItemClassify2", className: "truncated col-plotName", width: 2.1 * rootFontSize, render: (text: string) => "意见意见意见意见意见意见意见" }, { title: "备注", dataIndex: "checkItemClassify3", key: "checkItemClassify3", className: "truncated col-plotName", // width: 1.5 * rootFontSize, render: (text: string) => "备注备注备注备注备注备注备注备注备注备注备注备注" } ]; // const browse = (record: any, type: string) => { // // monitorAction.setMonitorPointTopicsSelectType({ type: type, isShow: true, data: record, isRefresh: false }); // }; return ( <div className={mtStyle.wrapper}> <Table rowKey={(record: any, i: number) => `${record.linkCode}_${i}`} columns={columns} dataSource={dataSource || []} pagination={false} className={`${mtStyle.PointCntTable} reset-table auto-scroll-y`} scroll={{ x: "auto", y: "auto" }} loading={loading} locale={{ emptyText: () => { return !loading ? <Nodata /> : null; } }} /> </div> ); }; export default ExpertInfo; 表格的表头和表内容对不齐 主要span是行内元素,要转为块状元素,也可以把它换成div元素 import React, { useState, useEffect } from "react"; import { Table } from "antd"; import Nodata from "components/Nodata/Nodata"; import mtStyle from "./ExpertInfo.module.less"; import { useStore } from "store/appStore"; interface IColumns { title: string | (() => React.ReactNode), dataIndex: string, key: string, className?: string, width?: number, fixed?: boolean | "left" | "right", render?: (text: any, record: any, index: number) => React.ReactNode } const ExpertInfo: React.FC = () => { const store = useStore(); const [loading, setLoading] = useState(true); const rootFontSize = store.rootFontSize; const [pageNo, setpageNo] = useState(1); const [pageSize, setPageSize] = useState(20); const [totalCount, setTotalCount] = useState(500); const [dataSource, setDataSource] = useState<any[]>([]); // const formatData = (vl: string | number | null) => { // return (vl || vl === 0) ? `${vl}` : "--"; // }; console.log(pageNo, setLoading, pageSize, setpageNo, setPageSize, totalCount, setTotalCount, setDataSource, useEffect); useEffect(() => { setDataSource(tmpdataSource); setLoading(false); }, []); const tmpdataSource: any[] = [ { key: "1", name: "胡彦斌", age: 32, address: "西湖区湖底公园1号", }, { key: "2", name: "胡彦祖", age: 42, address: "西湖区湖底公园1号", }, { key: "3", name: "胡彦祖", age: 42, address: "西湖区湖底公园1号", }, { key: "4", name: "胡彦祖", age: 42, address: "西湖区湖底公园1号", }, { key: "5", name: "胡彦祖", age: 42, address: "西湖区湖底公园1号", }, { key: "6", name: "胡彦祖", age: 42, address: "西湖区湖底公园1号", }, { key: "7", name: "胡彦祖", age: 42, address: "西湖区湖底公园1号", }, { key: "8", name: "胡彦祖", age: 42, address: "西湖区湖底公园1号", }, ]; const columns: IColumns[] = [ { title: "姓名", dataIndex: "number", key: "number", // className: "truncated col-plotName", width: 1.2 * rootFontSize, render: (text: any, record: any, index: number) => <div>李积勋</div> }, { title: "工作单位", dataIndex: "plotCode", key: "plotCode", className: "truncated col-plotName", width: 2.6 * rootFontSize, render: (text: string) => <div style={{ width: "2.4rem" }}>深圳市生态金设计研究院股份有限公司</div> }, { title: "职务", dataIndex: "plotName", key: "plotName1", className: "truncated col-plotName", width: 1.4 * rootFontSize, render: (text: string) => <div style={{ width: "1rem" }}>高级工程师</div> }, { title: "联系电话", dataIndex: "plotName", key: "plotName2", className: "truncated col-plotName", width: 1.7 * rootFontSize, render: (text: string) => <div style={{ width: "1.2rem" }}>15170165737</div> }, { title: "邮箱", dataIndex: "landTypeName", key: "landTypeName", width: 2.4 * rootFontSize, // className: "truncated col-plotName", render: (text: string) => <div>15170165737@163.com</div> }, { title: "是否组长", dataIndex: "regionName", key: "regionName", width: 1.6 * rootFontSize, className: "truncated col-plotName", render: (text: string) => <div style={{ width: "1.2rem" }}>是</div> }, { title: "审查意见", dataIndex: "checkItemClassify1", key: "checkItemClassify1", width: 1.9 * rootFontSize, className: "truncated col-plotName", render: (text: string) => <div style={{ width: "1.5rem" }}>修改后完善后通过</div> }, { title: "专家具体意见", dataIndex: "checkItemClassify2", key: "checkItemClassify2", className: "truncated col-plotName", width: 2.2 * rootFontSize, render: (text: string) => <div style={{ width: "1.8rem" }}>意见意见意见意见意见意见意见</div> }, // 记得最后一行,不要给宽 { title: "备注", dataIndex: "checkItemClassify3", key: "checkItemClassify3", className: "truncated col-plotName", render: (text: string) => <div>备注备注备注备注备注备注备注备注备注备注备注备注</div> } ]; // const browse = (record: any, type: string) => { // // monitorAction.setMonitorPointTopicsSelectType({ type: type, isShow: true, data: record, isRefresh: false }); // }; return ( <div className={mtStyle.wrapper}> <Table rowKey={(record: any, i: number) => `${record.linkCode}_${i}`} columns={columns} dataSource={dataSource || []} pagination={false} className={`${mtStyle.PointCntTable} reset-table auto-scroll-y`} scroll={{ y: "auto" }} loading={loading} locale={{ emptyText: () => { return !loading ? <Nodata /> : null; } }} /> </div> ); }; export default ExpertInfo; .container { width: 100%; height: 3.05rem; padding: 0rem 0.05rem; position: relative; .tableTop { height: 0.8rem; width: 100%; display: flex; align-items: center; flex-direction: row-reverse; } .PointCntTable { // height: calc(100% - 4rem); // width: calc(100% - 0.4rem); .btnCon { span { color: #427aff; cursor: pointer; &:not(:last-child) { margin-right: 0.2rem; } } } :global(.ant-table-body-outer) { height: calc(100% - 0.5rem); } :global(.ant-table.ant-table-scroll-position-left .ant-table-fixed-left) { pointer-events: none; } :global(.ant-table-fixed-header .ant-table-fixed-left .ant-table-body-inner) { margin-right: 0; } :global(.col-polluteName), :global(.col-pointCode), :global(.col-pointName) { max-width: 1.6rem; } } .truncated { width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } // .reset-table { // table { // table-layout: fixed; // td.truncated { // td.truncated > div { // width: 100%; // white-space: nowrap; // overflow: hidden; // text-overflow: ellipsis; // } // white-space: nowrap; // overflow: hidden; // text-overflow: ellipsis; // } // } // .ant-table-header { // background: #e5ebfb; // } // .ant-table-body, // .ant-table-body-outer { // height: calc(100% - 0.7rem); // background-color: transparent; // .ant-table-body-inner { // background-color: #fff; // } // } // .ant-table-fixed-header .ant-table-scroll .ant-table-header { // // overflow-y: hidden !important; // } // .ant-table-thead > tr > th { // padding: 0 0.2rem; // height: 0.5rem; // line-height: 0.5rem; // color: #333; // outline: none; // background-color: #e5ebfb; // border-bottom: 0; // &:first-of-type { // padding: 0 0.2rem 0 0.4rem; // } // .ant-table-column-title { // font-size: 0.16rem; // font-weight: 600; // } // } // .ant-table-thead > tr:first-child > th:first-child, // .ant-table-thead > tr:first-child > th:last-child { // border-radius: 0; // } // .ant-table-tbody > tr { // &:nth-of-type(2n) { // background-color: #f0f4fd; // } // &:nth-of-type(2n + 1) { // background-color: #fff; // } // } // .ant-table-tbody > tr > td { // padding: 0 0.2rem; // line-height: 0.5rem; // height: 0.5rem; // font-size: 0.16rem; // color: #333; // background: transparent; // border-bottom: 0; // &:first-of-type { // padding: 0 0.2rem 0 0.4rem; // } // > div { // overflow: hidden; // text-overflow: ellipsis; // white-space: nowrap; // } // } // .ant-table-tbody > tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) > td, // .ant-table-thead > tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) > td, // .ant-table-thead > tr.ant-table-row-hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) > td, // .ant-table-tbody > tr.ant-table-row-hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) > td { // background-color: #ebf0ff; // } // } .pageCon { position: absolute; top: 5rem; right: 0; display: flex; align-items: center; justify-content: flex-end; padding-right: 0.4rem; width: 100%; height: 0.5rem; line-height: 0.5rem !important; align-items: center !important; background: #f5f6fa; box-shadow: 0 0 0.05rem 0 rgba(0, 0, 0, 0.1); } .reset-table .ant-table-tbody > tr > td > div { margin-left: 0.2rem !important; } } EP-SEMS#47 const getDetail = async () => { const res = await Service.auditDetail({ plotCode: props.plotCode }); console.log("详情", res); }; Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function. 形式审核人员 xingshishenherenyuan YvLY1B0ZA9 区下达意见人员 quxiadayijianrenyuan ftWSzzJgCz 地块权属信息审核人员 dikuaiquanshuxinxishenherenyuan vwYIw%E0@c 市技术初审人员 shijishuchushenrenyuan s!#d_^MY8u 上会要求判定人员 shanghuiyaoqiupandingrenyuan FFu98AatBI 专家评审人员 zhuanjiapingshenrenyuan 6BKl*MOK$i 地块确认人员 dikuaiquerenrenyuan hDF0on_p6U init_survey 初步调查资源 detail_survey 详细调查资源 boundary_file 地块边界文件信息 calcium_sensing 敏感受体信息资源 industrial_info 地块中企业生产活动信息资源 checking_index 土壤和地下水检测指标信息资源 check_info 土壤/地下水检测信息资源 quantity_info 土壤环境质量信息资源 deal_process 办理过程进度资源 flex-wrap: wrap; div里面的a标签,超出了div部分自动换行。 文字自动换行 word-wrap: break-word; word-break: break-all; white-space: wrap !important; 超出部分显示省略号 max-width 或 width max-width: 2.01rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; index.js:1437 D:/Users/EX-lUOSHAOHUA001/projects1/ep-sems-web/src/pages/businessPages/ActivityManage/components/LandSurvey/components/lookPlotDetail/plotInquiry/plotInquiry. tsx TypeScript error in D:/Users/EX-lUOSHAOHUA001/projects1/ep-sems-web/src/pages/businessPages/ActivityManage/components/LandSurvey/components/lookPlotDetail/plotInquiry/plotInquiry.tsx(19,15): Type '{ plotCode: string; }' is not assignable to type 'IntrinsicAttributes & { children?: ReactNode; }'. Property 'plotCode' does not exist on type 'IntrinsicAttributes & { children?: ReactNode; }'. TS2322 管理端土壤的账号 44030641810436 Z2h0H1b9Pa630 不能把prop写 console.log(props.lists, "lists"); 这种报错 const ReviewMaterial: React.FC = (props) => { console.log(props.lists, "lists"); 这种写正确 没有数据返回 用逻辑与 console.log(props.lists[0] && props.lists[0].attactmentList, "lists120"); } An expression of type 'void' cannot be tested for truthinessts(1345) 不能将类型“void”分配给类型“ReactNode”。ts(2322) The expected type comes from property 'children' which is declared here on type ' DetailedHTMLProps, HTMLDivElement>' const isPass = [ { code: "0", label: "通过" }, { code: "1", label: "不通过" }, { code: "2", label: "修改后完善后通过" }, ]; 横向滚动条,垂直的滚动条 min-height: 2rem; max-height: 4rem; undefined TypeScript error in undefined(undefined,undefined): File 'D:/Users/EX-lUOSHAOHUA001/projects1/ep-sems-web/src/pages/businessPages/ActivityManage/components/LandSurvey/components /lookPlotDetail/components/reviewInfo/CheckComponent/AttendInfo/AttendInfo.tsx' not found. TS6053 const time = props.lists && props.lists.meetingTime; const changeTime = time ? (String(time).indexOf(" ") !== -1 ? time.split(" ")[0] : time) : "--"; D:\新建文件夹 (2)\2、需求文档\土壤系统-污染地块管理-V1.2 调接口的方法 useEffect(() => { (async () => { if (!plotCode) return; const res = await Service.getPlotInfo({ isSubmit: 1, plotCode }); setDetailData(res); })(); }, []); <RangePicker value={[moment(), moment()]} // 这种它的值写死了 onChange={onChange} className="reset-antd-datepicker ant-calendar-picker-container" /> 记得要把它的值,在重新赋值,要不然,一直为当前的值。 const [list, setList] = useState([]); const change () => { setList(moment(), moment()) } 日期选择框 <RangePicker value={[moment(), moment()]} onChange={onChange} className="reset-antd-datepicker ant-calendar-picker-container" />

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 203,547评论 6 477
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 85,399评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 150,428评论 0 337
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,599评论 1 274
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,612评论 5 365
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,577评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,941评论 3 395
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,603评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,852评论 1 297
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,605评论 2 321
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,693评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,375评论 4 318
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,955评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,936评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,172评论 1 259
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 43,970评论 2 349
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,414评论 2 342