|
@@ -1,14 +1,12 @@
|
|
|
import {useEffect, useState} from "react";
|
|
|
import Typography from "@mui/material/Typography";
|
|
|
-import {Button, Checkbox, Grid, Switch, TextField} from "@mui/material";
|
|
|
+import {Button, Grid, Switch, TextField} from "@mui/material";
|
|
|
import {connect} from "react-redux";
|
|
|
import {actionCategoryCount, actionCategoryUpsert, actionFullRootCats} from "../../../actions/ActionCategory";
|
|
|
import {actionAllGoodFind} from "../../../actions/ActionGoodFind";
|
|
|
import * as React from "react";
|
|
|
import Autocomplete from "@mui/material/Autocomplete";
|
|
|
import Box from "@mui/material/Box";
|
|
|
-import CheckCircleOutlineIcon from "@mui/icons-material/CheckCircleOutline";
|
|
|
-import {AccordionItem} from "../../MyOrdersPage/AccordionItem";
|
|
|
|
|
|
const AddSubCategory = ({goods, onCreate}) => {
|
|
|
const [subCategory, setSubCategory] = useState({});
|
|
@@ -27,7 +25,6 @@ const AddRootCategory = ({goods, onCreate}) => {
|
|
|
const [name, setName] = useState('');
|
|
|
const [products, setProducts] = useState([]);
|
|
|
const [addSub, setAddSub] = useState(false);
|
|
|
- const [addCat, setAddCat] = useState(false);
|
|
|
const [subCategory, setSubCategory] = useState({});
|
|
|
|
|
|
useEffect(() => {
|
|
@@ -125,7 +122,7 @@ const AddRootCategory = ({goods, onCreate}) => {
|
|
|
)
|
|
|
}
|
|
|
|
|
|
-const CategoryEdit = ({category,
|
|
|
+const CategoryEdit = ({ category,
|
|
|
categoryCount,
|
|
|
goods,
|
|
|
actionRootCat,
|
|
@@ -197,8 +194,15 @@ const CategoryEdit = ({category,
|
|
|
</>
|
|
|
)
|
|
|
}
|
|
|
-export const CCategoryEdit = connect(state => ({category: state.category,
|
|
|
- categoryCount: state.promise['categoryCount'], goods: state.promise['goodAllFind'],
|
|
|
- categoryUpsert: state.promise['categoryUpsert'] }),
|
|
|
- {actionRootCat: actionFullRootCats, onCountCategory: actionCategoryCount,
|
|
|
- onGoodFind: actionAllGoodFind, onCreateCategory: actionCategoryUpsert})(CategoryEdit)
|
|
|
+
|
|
|
+export const CCategoryEdit = connect(state => ({
|
|
|
+ category: state.category,
|
|
|
+ categoryCount: state.promise['categoryCount'],
|
|
|
+ goods: state.promise['goodAllFind'],
|
|
|
+ categoryUpsert: state.promise['categoryUpsert']}),
|
|
|
+ {
|
|
|
+ actionRootCat: actionFullRootCats,
|
|
|
+ onCountCategory: actionCategoryCount,
|
|
|
+ onGoodFind: actionAllGoodFind,
|
|
|
+ onCreateCategory: actionCategoryUpsert})
|
|
|
+(CategoryEdit)
|