Commit 41eb0505 authored by 皮倩雯's avatar 皮倩雯

fix: '修改台账管理新增编辑分组可以选的全部的bug'

parent 13f218bc
Pipeline #50872 skipped with stages
/* eslint-disable no-lonely-if */
/* eslint-disable no-else-return */
/* eslint-disable prefer-promise-reject-errors */
/* eslint-disable camelcase */
......@@ -21,7 +22,9 @@ const BookConfig = props => {
formObj,
visible,
tableData,
pickItem1,
onCancel,
data,
maxLength,
keepTableData,
} = props;
......@@ -89,6 +92,8 @@ const BookConfig = props => {
});
};
useEffect(() => {
console.log(pickItem1);
console.log(data[0]);
if (visible) {
// 获取台账表
getTableData();
......@@ -100,6 +105,12 @@ const BookConfig = props => {
changTable(res.data.root.TableName);
}
});
} else {
if (!pickItem1 || pickItem1 == '全部') {
form.setFieldsValue({ Type: data[0] });
} else {
form.setFieldsValue({ Type: pickItem1 });
}
}
} else {
setFiled({});
......@@ -253,7 +264,7 @@ const BookConfig = props => {
placeholder="请输入分组名称"
allowClear
>
{tableData.map((item, index) => (
{data.map((item, index) => (
<Option value={item} key={index}>
{item}
</Option>
......
......@@ -48,6 +48,7 @@ const StandingBook = props => {
const [searchFlag, setSearchFlag] = useState(0);
const [currentPage, setCurrentPage] = useState(1);
const [currentPageSize, setCurrentPageSize] = useState(20);
const [data, setData] = useState([]);
const { Item } = Form;
const { Search } = Input;
......@@ -179,9 +180,11 @@ const StandingBook = props => {
setMaxLength(res.data.root.length + 1);
let arr = formateArrDataA(res.data.root, 'type');
let newArr = [];
let dataList = [];
newArr.push('全部');
Object.keys(arr).map((item, index) => {
newArr.push(item);
dataList.push(item);
});
console.log(arr);
arr.全部 = res.data.root;
......@@ -195,6 +198,7 @@ const StandingBook = props => {
console.log(newArr, 'newArr');
// newArr.push('全部');
setTableData(newArr);
setData(dataList);
if (searchFlag === 1) {
onSearch();
}
......@@ -495,6 +499,8 @@ const StandingBook = props => {
<AddModal
visible={isVisible}
type={isType}
data={data}
pickItem1={pickItem}
formObj={formObj}
maxLength={maxLength}
callBackSubmit={onSubmit}
......
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