|
|
@ -45,6 +45,7 @@ function Fence(props) { |
|
|
|
pn: 1, |
|
|
|
length: Number(pageSizeOptions[0]), // 每页条数 |
|
|
|
} |
|
|
|
const [areaChildIds, setAreaChildIds] = useState([]) |
|
|
|
const [formData, setFormData] = useState(parameter) |
|
|
|
const [formExportData, setFormExportData] = useState(parameter) |
|
|
|
const [lastFormData, setLastFormData] = useState(formData) |
|
|
@ -56,9 +57,33 @@ function Fence(props) { |
|
|
|
const [importVisible, setImportVisible] = useState(false) |
|
|
|
const [importTemplateLink, setImportTemplateLink] = useState("") |
|
|
|
//区域 |
|
|
|
const onChangeList = (value) => { |
|
|
|
const onChangeList = (value, options) => { |
|
|
|
if (!options) { |
|
|
|
setFormData({ |
|
|
|
...formData, |
|
|
|
region: value |
|
|
|
}) |
|
|
|
setAreaChildIds([]) |
|
|
|
return |
|
|
|
} |
|
|
|
let last = options[options.length - 1]; |
|
|
|
let res = []; |
|
|
|
if (last.children) { |
|
|
|
addChild(last, res); |
|
|
|
} |
|
|
|
res.push(last.id); |
|
|
|
setAreaChildIds([...res]) |
|
|
|
setFormData({ ...formData, region: value }) |
|
|
|
} |
|
|
|
const addChild = (child, res) => { |
|
|
|
if (child.children) { |
|
|
|
child.children.forEach((item) => { |
|
|
|
addChild(item, res); |
|
|
|
}) |
|
|
|
} else { |
|
|
|
res.push(child.id); |
|
|
|
} |
|
|
|
} |
|
|
|
const getOperatorData = () => { |
|
|
|
ajax.getOperator().then((e) => { |
|
|
|
setStoreData([ |
|
|
@ -182,7 +207,7 @@ function Fence(props) { |
|
|
|
// 获取列表数据 |
|
|
|
const getData = (data = formData) => { |
|
|
|
setAjaxLoading(true) |
|
|
|
ajax.getPoleListData(data).then(res => { |
|
|
|
ajax.getPoleListData({...data, region: areaChildIds}).then(res => { |
|
|
|
setAjaxLoading(false) |
|
|
|
if (res.status === 20000) { |
|
|
|
utils.tableScrollTop() |
|
|
@ -354,6 +379,7 @@ function Fence(props) { |
|
|
|
options={getCanCaDer} |
|
|
|
onChange={onChangeList} |
|
|
|
changeOnSelect |
|
|
|
expandTrigger="hover" |
|
|
|
style={{ width: 260, marginLeft: 42 }} /> |
|
|
|
</div> |
|
|
|
<div className="yisa-search"> |
|
|
|