Commit 37633e16 authored by 左玲玲's avatar 左玲玲 :grimacing:

问题修复

parent 6e91f9c3
......@@ -33,9 +33,9 @@ class Mtable extends PureComponent {
this.props.columns != nextprops.columns
) {
if (nextprops.actionRef) {
nextprops.actionRef?.current?.reload();
nextprops.actionRef?.current?.reset();
} else {
this.actionRefs?.current?.reload();
this.actionRefs?.current?.reset();
}
this.initDrage(nextprops);
}
......
......@@ -76,14 +76,22 @@ function TreeRender({ url, deleteurl, saveurl, onselected, params, noaction, max
}, [data]);
const onChange = (e) => {
const { value } = e.target;
const newExpandedKeys = alldata.map((item) => {
const dataLists = getAllList();
const newExpandedKeys = dataLists.map((item) => {
if (item.title.indexOf(value) > -1) {
return getParentKey(item.key, treeData);
}
return null;
}).filter((item, i, self) => item && self.indexOf(item) === i);
onExpand(newExpandedKeys);
setsearch(value);
if(newExpandedKeys.length>0){
setexpandall(true);
setAutoExpandParent(true)
}else{
setexpandall(false);
setAutoExpandParent(false)
}
onExpand(newExpandedKeys);
};
const loop = data => data.map(item => {
const index = item.title.indexOf(search);
......@@ -240,7 +248,22 @@ function TreeRender({ url, deleteurl, saveurl, onselected, params, noaction, max
useEffect(() => {
setexpandall(true);
onExpand(allkeys)
}, [allkeys])
}, [allkeys]);
function getAllList() {
const dataLists = [];
const generateLists = data => {
for (let i = 0; i < data.length; i++) {
const node = data[i];
const key = node.key;
dataLists.push({ key, title: node.title, level: node.level });
if (node.children) {
generateLists(node.children, node.key);
}
}
};
generateLists(treeData);
return dataLists;
}
return (
<div>
<Modal
......@@ -329,12 +352,12 @@ function TreeRender({ url, deleteurl, saveurl, onselected, params, noaction, max
autoExpandParent={autoExpandParent}
defaultExpandAll={true}
expandedKeys={expandedKeys}
onExpand={(expandedKeys, {expanded: bool, node}) => {
onExpand={(expandedKeys, { expanded: bool, node }) => {
onExpand(expandedKeys);
setAutoExpandParent(false);
if(!bool && node.key=="00000000"){
if (!bool && node.key == "00000000") {
setexpandall(false)
}else{
} else {
setexpandall(true)
}
}}
......
......@@ -50,7 +50,7 @@ const EditUpload = ({ record, fid, storeId }) => {
search: false,
valueType: "select",
request: async (params) => {
let res = await doFetch({ url: "/ngic-auth/sysStorePosition/queryByStoreId/selection", params});
let res = await doFetch({ url: "/ngic-auth/sysStorePosition/queryByStoreId/selection", params:{storeId:params.storeId}});
return res?.data?.dataList
},
editable: (text, record, index) => {
......
......@@ -65,7 +65,7 @@ const EditUpload = ({ record, fid, storeId }) => {
search: false,
valueType: "select",
request: async (params) => {
let res = await doFetch({ url: "/ngic-auth/sysStorePosition/queryByStoreId/selection", params });
let res = await doFetch({ url: "/ngic-auth/sysStorePosition/queryByStoreId/selection", params:{storeId:params.storeId} });
return res?.data?.dataList
},
editable: (text, record, index) => {
......
......@@ -741,8 +741,8 @@ const materielDetail = [
columns: [
{
title: "辅助单位",
dataIndex: "productionUnit",
key: "productionUnit",
dataIndex: "productionUnitName",
key: "productionUnitName",
search: false,
},
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment