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, getNext: (i: boolean) => void }> = ({ plotCode, getNext }) => {
const [filtParam, setFilterParam] = useState<any[]>([]);
const [list, setList] = useState<any[]>([]);
useEffect(() => {
(async () => {
const res = await Service.landType({ dicName: “calcium_type” });
console.log(res, “res1”);
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).split(","));
})();
}, []);
const handScreeningChange = (timeTypes: any) => {
setFilterParam(timeTypes);
debugger;
};
const handClick = async () => {
if (filtParam && !filtParam.length) {
message.error(“缺少必填信息!”);
return;
}
let param = {
calciumTypeList: filtParam,
plotCode: plotCode
};
const res = await Service.getCreateSensitive(param);
if (res) {
getNext && getNext(true);
} else {
getNext && getNext(false);
}
};
return