Xiaopeng Zhang 5 mēneši atpakaļ
vecāks
revīzija
21737c5323

+ 7 - 7
front/package.json

@@ -13,15 +13,15 @@
   "dependencies": {
     "@emotion/react": "latest",
     "@emotion/styled": "latest",
-    "@mui/icons-material": "latest",
-    "@mui/lab": "^7.0.0-beta.12",
-    "@mui/material": "latest",
-    "@mui/x-data-grid": "^8.5.1",
-    "@mui/x-tree-view": "latest",
+    "@mui/icons-material": "^5.18.0",
+    "@mui/lab": "^5.0.0-alpha.177",
+    "@mui/material": "^5.18.0",
+    "@mui/x-data-grid": "^6.20.4",
+    "@mui/x-tree-view": "^6.17.0",
     "antd": "^5.26.1",
     "html-webpack-plugin": "^5.6.3",
-    "react": "latest",
-    "react-dom": "latest",
+    "react": "^18.0.0",
+    "react-dom": "^18.0.0",
     "react-router": "latest",
     "react-router-dom": "^7.6.1",
     "react-use-websocket": "^4.13.0",

+ 123 - 134
front/src/App2.js

@@ -8,9 +8,9 @@ import CancelIcon from '@mui/icons-material/Cancel';
 import Autocomplete from '@mui/material/Autocomplete';
 import { debounce } from '@mui/material/utils';
 import throttle from 'lodash/throttle';
-
-import {RichTreeView } from "@mui/x-tree-view/RichTreeView";
-import { Grid } from '@mui/material';
+import {Tree} from 'antd';
+import {TreeView } from "@mui/x-tree-view/TreeView";
+import Grid from '@mui/material/Unstable_Grid2';
 import Tab from "@mui/material/Tab";
 import TabContext from "@mui/lab/TabContext";
 import TabList from "@mui/lab/TabList";
@@ -42,7 +42,7 @@ import AccordionActions from '@mui/material/AccordionActions';
 import AccordionSummary from '@mui/material/AccordionSummary';
 import AccordionDetails from '@mui/material/AccordionDetails';
 import Stack from '@mui/material/Stack';
-import { DataGrid } from '@mui/x-data-grid';
+import { DataGrid, zhCN , GridToolbarQuickFilter} from '@mui/x-data-grid';
 import Backdrop from '@mui/material/Backdrop';
 import CircularProgress from '@mui/material/CircularProgress';
 import { TreeItem, treeItemClasses } from '@mui/x-tree-view/TreeItem';
@@ -55,14 +55,7 @@ import CloseIcon from '@mui/icons-material/Close';
 import SearchIcon from '@mui/icons-material/Search';
 import Button from '@mui/material/Button';
 
-import {
-  Toolbar,
-  ToolbarButton,
-  QuickFilter,
-  QuickFilterControl,
-  QuickFilterClear,
-  QuickFilterTrigger,
-} from '@mui/x-data-grid';
+
 import Tooltip from '@mui/material/Tooltip';
 
 const MUI_X_PRODUCTS = [
@@ -124,21 +117,9 @@ const MUI_X_PRODUCTS = [
    
   }));
 
-  const StyledToolbarButton = styled(ToolbarButton)(({ theme, ownerState }) => ({
-    gridArea: '1 / 1',
-    width: 'min-content',
-    height: 'min-content',
-    zIndex: 1,
-    opacity: ownerState.expanded ? 0 : 1,
-    pointerEvents: ownerState.expanded ? 'none' : 'auto',
-    transition: theme.transitions.create(['opacity']),
-  }));
 
-  const StyledQuickFilter = styled(QuickFilter)({
-    display: 'grid',
-    alignItems: 'center',
-    marginLeft: 'auto',
-  });
+
+
 
   const StyledTextField = styled(TextField)(({ theme, ownerState }) => ({
     gridArea: '1 / 1',
@@ -149,63 +130,7 @@ const MUI_X_PRODUCTS = [
   }));
   
 
-  function CustomToolbar() {
-    return (
-      <Toolbar>
-        <StyledQuickFilter defaultExpanded>
-          <QuickFilterTrigger
-            render={(triggerProps, state) => (
-              <Tooltip title="搜索" enterDelay={0}>
-                <StyledToolbarButton
-                  {...triggerProps}
-                  ownerState={{ expanded: state.expanded }}
-                  color="default"
-                  aria-disabled={state.expanded}
-                >
-                  <SearchIcon fontSize="small" />
-                </StyledToolbarButton>
-              </Tooltip>
-            )}
-          />
-          <QuickFilterControl
-            render={({ ref, ...controlProps }, state) => (
-              <StyledTextField
-                {...controlProps}
-                ownerState={{ expanded: state.expanded }}
-                inputRef={ref}
-                aria-label="搜索"
-                placeholder="搜索"
-                size="small"
-                slotProps={{
-                  input: {
-                    startAdornment: (
-                      <InputAdornment position="start">
-                        <SearchIcon fontSize="small" />
-                      </InputAdornment>
-                    ),
-                    endAdornment: state.value ? (
-                      <InputAdornment position="end">
-                        <QuickFilterClear
-                          edge="end"
-                          size="small"
-                          aria-label="清除"
-                          material={{ sx: { marginRight: -0.75 } }}
-                        >
-                          <CancelIcon fontSize="small" />
-                        </QuickFilterClear>
-                      </InputAdornment>
-                    ) : null,
-                    ...controlProps.slotProps?.input,
-                  },
-                  ...controlProps.slotProps,
-                }}
-              />
-            )}
-          />
-        </StyledQuickFilter>
-      </Toolbar>
-    );
-  }
+
 
 
   export default function App2() {
@@ -271,17 +196,17 @@ const MUI_X_PRODUCTS = [
     const relation = React.useRef({});
     const columns =[
     
-      {field: '定额编号', headerName: '定额编号'},
-      {field: '名称', headerName: '名称'}, 
-      {field: '单位', headerName: '单位'},
-      {field: '单价', headerName: '单价'}
+      {field: '定额编号', headerName: '定额编号', sortable: false},
+      {field: '名称', headerName: '名称', sortable: false}, 
+      {field: '单位', headerName: '单位', sortable: false},
+      {field: '单价', headerName: '单价', sortable: false}
     ];
     const columns2 =[
     
-      {field: '编号', headerName: '定额编号'},
-      {field: '名称', headerName: '名称', width: 200}, 
-      {field: '单位', headerName: '单位'},
-      {field: '单价', headerName: '单价'}
+      {field: '编号', headerName: '定额编号', sortable: false},
+      {field: '名称', headerName: '名称', width: 200, sortable: false}, 
+      {field: '单位', headerName: '单位', sortable: false},
+      {field: '单价', headerName: '单价', sortable: false}
     ];
     let location = useParams();
 
@@ -458,7 +383,7 @@ const MUI_X_PRODUCTS = [
                     setBeizhuFK(res["bz_selected2"]);
                     Service.generateDingeshu(res["actual_zhuanye"]).then(x=>{
                         setOutlineDes_(x);
-                        setSelectedItems(id);
+                        setSelectedItems([id]);
                         setExpandedItems(findparent(id));
                            Service.generateDingeXilie(res["actual_zhuanye"], id).then(x=>{
                                 let y = JSON.parse(x);
@@ -664,11 +589,11 @@ const MUI_X_PRODUCTS = [
              setExpandedDe(newExpanded);
           }
        };
-    const handleItemSelectionTogglePbs = (event, itemId, isSelected) => {
-      if (isSelected) {
+    const handleItemSelectionTogglePbs = (itemId, event) => {
+      if (itemId.length > 0) {
         console.log(itemId);
-        if (["0", "3", "4", "6", "7", "8", "9", "11", "12", "13", "15", "16", "18", "19", "20", "21"].includes(itemId)) {
-            Service.generatePeibiXilie(itemId).then(x=>{
+        if (["0", "3", "4", "6", "7", "8", "9", "11", "12", "13", "15", "16", "18", "19", "20", "21"].includes(itemId[0])) {
+            Service.generatePeibiXilie(itemId[0]).then(x=>{
                 let y = JSON.parse(x);
                 console.log(y);
                
@@ -1031,8 +956,41 @@ const MUI_X_PRODUCTS = [
           Service.setQufei(x);
           });
         Service.generateOutline2(location["id"]).then(x=>{
+          let y = x.map(z=>{
+            z['key'] = z['id'];
+            z['title'] = z['label'];
+            return z;
+          });
+          let y1 = y.map(
+            z=> {
+              if (z.hasOwnProperty('children')) {
+                z['children'] = z['children'].map(a=>{
+                  a['key'] = a['id'];
+                  a['title'] = a['label'];
+                  return a;
+                });
+              }
+              return z;
+            }
+          );
+          let y2 = y1.map(z=>{
+            if (z.hasOwnProperty('children')) {
+              let child = z['children'];
+              for (let i = 0; i < child.length; i++) {
+                let children = child[i];
+                if (children.hasOwnProperty('children')) {
+                  children['children'] = children['children'].map(a=>{
+                    a['key'] = a['id'];
+                    a['title'] = a['label'];
+                    return a;
+                  })
+                }
+              }
 
-        setOutline(x);
+            }
+            return z;
+          });
+        setOutline(y2);
         });
         Service.generateDetail2(location['id']).then(x=>{
 
@@ -1087,11 +1045,47 @@ const MUI_X_PRODUCTS = [
       }, [acinputvalue]
     );
 
+
+    const onSelect = (selectedKeys, info) => {
+      if (selectedKeys.length > 0) {
+      console.log(selectedKeys);
+      if (selectedKeys[0].includes('Zylb')) {
+      handleItemSelectionToggle(null, selectedKeys[0], true);
+      } else if (selectedKeys[0].includes('TouBiaoXx')){
+        console.log(selectedKeys);
+        handleItemSelectionToggle(null, "Zylb1TouBiaoXx", true);
+      }
+    }
+    };
+    const onSelectDes = (selectedKeys, info) => {
+      if (selectedKeys.length > 0) {
+      console.log(selectedKeys);
+      
+      handleItemSelectionToggleDes(null, selectedKeys[0], true);
+      }
+    };
+
+
+    function CustomToolbar() {
+      return (
+        <Box
+          sx={{
+            p: 0.5,
+            pb: 0,
+          }}
+        >
+          <GridToolbarQuickFilter />
+        </Box>
+      );
+    }
+
+
     return (
 
         <Box sx={{ flexGrow: 1  }}>
           <Grid container spacing={2}>
             <Grid size={3}>
+            <Box sx={{ width: '25vw'}}>
 
 
 
@@ -1105,11 +1099,12 @@ const MUI_X_PRODUCTS = [
                      <Typography  component="span">清单</Typography>
                    </AccordionSummary>
                    <AccordionDetails>
-                     <RichTreeView sx={{overflow: "scroll", maxHeight: "90vh"}}
-                     onItemSelectionToggle={handleItemSelectionToggle}
-                     slots={{ item: CustomTreeItem }}
+                     <Tree height="90vh" virtual={false}
+                     onSelect={onSelect}
+                     
+                     
 
-                     items={outline}/>
+                     treeData={outline}/>
                    </AccordionDetails>
                  </Accordion>
                 <Accordion expanded={expandedDe} disableGutters
@@ -1140,13 +1135,11 @@ const MUI_X_PRODUCTS = [
                      </Select>
                    </FormControl> 
                    <Stack spacing={1}>
-                    <RichTreeView sx={{overflow: "scroll", maxHeight: `calc(100vh - 540px)`}}
-                     onItemSelectionToggle={handleItemSelectionToggleDes}
-                     slots={{ item: CustomTreeItem }}
-
-                     selectedItems={selectedItems}
-                     expandedItems={expandedItems}
-                     items={outlineDes}/>
+                    <Tree height="calc(100vh - 560px)" virtual={false}
+                     onSelect={onSelectDes}
+                     selectedKeys={selectedItems}
+                     expandedKeys={expandedItems}
+                     treeData={outlineDes}/>
                   <div style={{ height: 350 }}>
 
                     <DataGrid
@@ -1162,7 +1155,9 @@ const MUI_X_PRODUCTS = [
                       rows={deXilie}
                       columns={columns}
                       hideFooter={true}
+                      disableColumnMenu
                       onRowDoubleClick={handleDingEEvent}
+                      localeText={zhCN.components.MuiDataGrid.defaultProps.localeText}
                     />
                    </div>
                    </Stack>
@@ -1187,15 +1182,15 @@ const MUI_X_PRODUCTS = [
 
             
 
-
+            </Box>
 
             </Grid>
             <Grid size={9}>
-              {!nest && !qingdan && !cuoshi && !qufei && rcjhz && !gfsj && !bjhz && !tbxx && !qtxm && !zlje && !zygczgj && !jrg && !zcbfwf && !fbrgycl && <Rcjhz 
+              {!nest && !qingdan && !cuoshi && !qufei && rcjhz && !gfsj && !bjhz && !tbxx && !qtxm && !zlje && !zygczgj && !jrg && !zcbfwf && !fbrgycl && <Box sx={{ width: '70vw'}}><Rcjhz 
               id={location['id']} 
               bh={qdbh}
               tiaojiaCallback={tiaojiaCallback}
-              />}
+              /></Box>}
 
                {!nest && !qingdan && !cuoshi && !qufei && !rcjhz && !gfsj && !bjhz && !tbxx && !qtxm && zlje && !zygczgj && !jrg && !zcbfwf && !fbrgycl && <Zlje 
               data={zljeData} 
@@ -1243,7 +1238,7 @@ const MUI_X_PRODUCTS = [
             {!qingdan && !cuoshi && qufei && !rcjhz && !gfsj && !bjhz && !tbxx && !qtxm && !zlje && !zygczgj && !jrg && !zcbfwf && !fbrgycl && <Qufei id={location['id']} qufeiCallback={qufeiCallback}
                   />}
 
-            {!nest && qingdan && !cuoshi && !qufei && !rcjhz && !gfsj && !bjhz  && !tbxx && !qtxm && !zlje && !zygczgj && !jrg && !zcbfwf && !fbrgycl &&  <TabContext value={value}>
+            {!nest && qingdan && !cuoshi && !qufei && !rcjhz && !gfsj && !bjhz  && !tbxx && !qtxm && !zlje && !zygczgj && !jrg && !zcbfwf && !fbrgycl &&  <Box sx={{ width: '70vw'}}><TabContext value={value}>
                    <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
                       <TabList scrollButtons='auto' 
                               variant="scrollable"
@@ -1271,8 +1266,8 @@ const MUI_X_PRODUCTS = [
                              />                     
                      </TabPanel>
                       )}
-                </TabContext>}
-            {!nest && !qingdan && cuoshi && !qufei && !rcjhz && !gfsj && !bjhz && !tbxx && !qtxm && !zlje && !zygczgj && !jrg && !zcbfwf && !fbrgycl &&  <TabContext value={value}>
+                </TabContext></Box>}
+            {!nest && !qingdan && cuoshi && !qufei && !rcjhz && !gfsj && !bjhz && !tbxx && !qtxm && !zlje && !zygczgj && !jrg && !zcbfwf && !fbrgycl &&  <Box sx={{ width: '70vw'}}><TabContext value={value}>
                    <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
                       <TabList scrollButtons='auto' 
                               variant="scrollable"
@@ -1302,7 +1297,9 @@ const MUI_X_PRODUCTS = [
                      />
                    </TabPanel>
                       
-                </TabContext>}
+                </TabContext>
+                </Box>
+                }
 
 
             </Grid>
@@ -1339,16 +1336,14 @@ const MUI_X_PRODUCTS = [
             </IconButton>
             <DialogContent dividers>
             <Stack  direction="row" spacing={2}>
-               
-               <RichTreeView sx={{
-                      overflow: "scroll", 
-                      maxHeight: "350px",
-                      minWidth: "250px"
-                  }}
-                             slots={{ item: CustomTreeItem }}
-
-                     onItemSelectionToggle={handleItemSelectionTogglePbs}
-                     items={peibishu}/>
+               <Box sx={{"overflow": "scroll", maxHeight: "350px", minWidth: "300px", maxWidth: "300px"}}>
+               <Tree  virtual={false}
+                      onSelect={handleItemSelectionTogglePbs}
+
+                     
+                     treeData={peibishu}/>
+                     </Box>
+                     
                
               
                <div style={{ height: 350 }}>
@@ -1366,15 +1361,9 @@ const MUI_X_PRODUCTS = [
                       disableColumnFilter
                       disableColumnSelector
                       disableDensitySelector
-                      showToolbar
-                      slots={{ toolbar: CustomToolbar }}
-                      localeText={{
-                        noRowsLabel: '无数据',
-                        paginationRowsPerPage: '每页行数',
-                        footerRowSelected: (count) => `共选中了${count.toLocaleString()}行`,
-                       
-                        
-                      }}
+                      slots={{ toolbar: CustomToolbar}}
+                      
+                      localeText={zhCN.components.MuiDataGrid.defaultProps.localeText}
                      />
                     </div>
               

+ 1 - 4
front/src/Bjhz.js

@@ -1,6 +1,5 @@
 import * as React from 'react';
 import Box from "@mui/material/Box";
-import {RichTreeView } from "@mui/x-tree-view/RichTreeView";
 import { Grid } from '@mui/material';
 import Tab from "@mui/material/Tab";
 import TabContext from "@mui/lab/TabContext";
@@ -9,9 +8,7 @@ import TabPanel from "@mui/lab/TabPanel";
 import Stack from "@mui/material/Stack";
 //registerPlugin(NestedRows);
 import Service from './Service';
-import EditableSelect from './EditableSelect';
-import EditableSelectGC from './EditableSelectGC';
-import Editable from './Editable';
+
 import Button from '@mui/material/Button';
 
 import {copy} from './utils';

+ 0 - 1
front/src/Djcs3.js

@@ -1,6 +1,5 @@
 import * as React from 'react';
 import Box from "@mui/material/Box";
-import {RichTreeView } from "@mui/x-tree-view/RichTreeView";
 import { Grid } from '@mui/material';
 import Tab from "@mui/material/Tab";
 import TabContext from "@mui/lab/TabContext";

+ 0 - 1
front/src/Editable.js

@@ -1,6 +1,5 @@
 import * as React from 'react';
 import Box from "@mui/material/Box";
-import {RichTreeView } from "@mui/x-tree-view/RichTreeView";
 import { Grid } from '@mui/material';
 import Tab from "@mui/material/Tab";
 import TabContext from "@mui/lab/TabContext";

+ 0 - 1
front/src/EditableSelect.js

@@ -1,6 +1,5 @@
 import * as React from 'react';
 import Box from "@mui/material/Box";
-import {RichTreeView } from "@mui/x-tree-view/RichTreeView";
 import { Grid } from '@mui/material';
 import Tab from "@mui/material/Tab";
 import TabContext from "@mui/lab/TabContext";

+ 0 - 1
front/src/EditableSelectGC.js

@@ -1,6 +1,5 @@
 import * as React from 'react';
 import Box from "@mui/material/Box";
-import {RichTreeView } from "@mui/x-tree-view/RichTreeView";
 import { Grid } from '@mui/material';
 import Tab from "@mui/material/Tab";
 import TabContext from "@mui/lab/TabContext";

+ 0 - 1
front/src/Fbrgycl.js

@@ -1,6 +1,5 @@
 import * as React from 'react';
 import Box from "@mui/material/Box";
-import {RichTreeView } from "@mui/x-tree-view/RichTreeView";
 import { Grid } from '@mui/material';
 import Tab from "@mui/material/Tab";
 import TabContext from "@mui/lab/TabContext";

+ 1 - 4
front/src/Gfsj.js

@@ -1,6 +1,5 @@
 import * as React from 'react';
 import Box from "@mui/material/Box";
-import {RichTreeView } from "@mui/x-tree-view/RichTreeView";
 import { Grid } from '@mui/material';
 import Tab from "@mui/material/Tab";
 import TabContext from "@mui/lab/TabContext";
@@ -9,9 +8,7 @@ import TabPanel from "@mui/lab/TabPanel";
 import Stack from "@mui/material/Stack";
 //registerPlugin(NestedRows);
 import Service from './Service';
-import EditableSelect from './EditableSelect';
-import EditableSelectGC from './EditableSelectGC';
-import Editable from './Editable';
+
 import Button from '@mui/material/Button';
 
 import {copy} from './utils';

+ 2 - 8
front/src/Home2.js

@@ -3,7 +3,7 @@ import * as React from 'react';
 import Service from './Service';
 import {useNavigate, useLocation} from "react-router";
 //registerAllModules();
-import { DataGrid, GridActionsCellItem } from '@mui/x-data-grid';
+import { DataGrid, GridActionsCellItem, zhCN} from '@mui/x-data-grid';
 import Box from '@mui/material/Box';
 import MuiAppBar from '@mui/material/AppBar';
 import { styled, useTheme } from '@mui/material/styles';
@@ -332,13 +332,7 @@ export default function Home2() {
       <DataGrid onRowClick={handleRowClick}
       rows={detail} columns={columns}
       disableColumnMenu={true}
-      localeText={{
-        noRowsLabel: '无数据',
-        paginationRowsPerPage: '每页行数',
-        footerRowSelected: (count) => `共选中了${count.toLocaleString()}行`,
-       
-        
-      }}
+      localeText={zhCN.components.MuiDataGrid.defaultProps.localeText}
       />
 
         <Tooltip title="导入">

+ 0 - 1
front/src/Jrg.js

@@ -1,6 +1,5 @@
 import * as React from 'react';
 import Box from "@mui/material/Box";
-import {RichTreeView } from "@mui/x-tree-view/RichTreeView";
 import { Grid } from '@mui/material';
 import Tab from "@mui/material/Tab";
 import TabContext from "@mui/lab/TabContext";

+ 31 - 29
front/src/Qingdan3.js

@@ -1,7 +1,7 @@
 import * as React from 'react';
 import Box from "@mui/material/Box";
 import { Table, ConfigProvider, Button as AButton } from "antd";
-import {RichTreeView } from "@mui/x-tree-view/RichTreeView";
+import {TreeView } from "@mui/x-tree-view/TreeView";
 import { Grid } from '@mui/material';
 import Tooltip from '@mui/material/Tooltip';
 import AddIcon from '@mui/icons-material/Add';
@@ -22,13 +22,12 @@ import {extractFuzhu} from './utils';
 import {shanchu, undo, redo, danxiangdinge, updateDercj, changguidinge, handleBeizhu, huan, updateShuliang, handleYuban, updateDeMingcheng, handleRcjbc} from './editor';
 import Backdrop from '@mui/material/Backdrop';
 import CircularProgress from '@mui/material/CircularProgress';
-import { DataGrid, GridRowModes, Toolbar, ToolbarButton, GridActionsCellItem, GridRowEditStopReasons } from '@mui/x-data-grid';
+import { DataGrid, GridRowModes, GridActionsCellItem, GridRowEditStopReasons, zhCN as zhCN_MUI, GridToolbarContainer } from '@mui/x-data-grid';
 import Dialog from '@mui/material/Dialog';
 import DialogTitle from '@mui/material/DialogTitle';
 import DialogContent from '@mui/material/DialogContent';
 import IconButton from '@mui/material/IconButton';
 import Typography from '@mui/material/Typography';
-import Editable from './Editable';
 import {
 
      SettingFilled,
@@ -603,8 +602,8 @@ export default function Qingdan3({name, bh, bt, rgde, jxde, clde, beizhu/*后台
             }
           return updatedRow;
         };
-   
-     function EditToolbar(props) {
+
+        function EditToolbar(props) {
           const { setRcjrows } = props;
         
           const handleClick = () => {
@@ -618,7 +617,6 @@ export default function Qingdan3({name, bh, bt, rgde, jxde, clde, beizhu/*后台
                ];
                return a;
              });
-             
              const [newData, newHl] = handleRcjbc(selectedRowKeysTable.current[0], a);
              if (newData) {
                myTable.current.updateData(newData.filter(x=>x['key'] == selectedRowKeysTableParent.current));
@@ -640,30 +638,29 @@ export default function Qingdan3({name, bh, bt, rgde, jxde, clde, beizhu/*后台
                '暂估价标志' : newHl[i][12],
                '主要材料标志' : newHl[i][13],
                '主材标志' : newHl[i][14],
-               '设备标志' : newHl[i][15] 
+               '设备标志' : newHl[i][15]
 
                });
              }
-              setRcjhl(y);
+             setRcjhl(y);
               if (rcjTable.current) {
                  rcjTable.current.replaceData(y);
               }
-
-            }
-
+          }
             
           };
         
           return (
-            <Toolbar>
-              <Tooltip title="补充">
-                <ToolbarButton onClick={handleClick}>
-                  <AddIcon fontSize="small" />
-                </ToolbarButton>
-              </Tooltip>
-            </Toolbar>
+            <GridToolbarContainer>
+              <Button disabled={!showToolbar}
+              color="primary" startIcon={<AddIcon />} onClick={handleClick}>
+                补充
+              </Button>
+            </GridToolbarContainer>
           );
         }
+   
+    
 
    
      
@@ -672,6 +669,7 @@ export default function Qingdan3({name, bh, bt, rgde, jxde, clde, beizhu/*后台
 
 
      React.useEffect(() => {
+        
           myTable.current = new Tabulator(myRef.current, {
                index: "key",
                height: 380,
@@ -917,6 +915,7 @@ export default function Qingdan3({name, bh, bt, rgde, jxde, clde, beizhu/*后台
 
       React.useEffect(
           () => {
+               
                myTable.current.deselectRow();
                //console.log(dingeclick);
                if (selectedRowKeysTable.current.length > 0 ) {
@@ -947,7 +946,7 @@ export default function Qingdan3({name, bh, bt, rgde, jxde, clde, beizhu/*后台
                           });
                     }
                }
-               
+              
           }, [dingeclick]//常规添加定额
       );
 
@@ -1048,6 +1047,7 @@ export default function Qingdan3({name, bh, bt, rgde, jxde, clde, beizhu/*后台
                     }
 
                if (rcjRef.current != null ) {
+                    
                          rcjTable.current = new Tabulator(rcjRef.current, {
                               index: "key",
                               height: 250,
@@ -1138,7 +1138,9 @@ export default function Qingdan3({name, bh, bt, rgde, jxde, clde, beizhu/*后台
                                 handleSelect(component);
                               });
                          });
-                         }
+                         
+                         
+                    }
           }, [valueTab]
         );
 
@@ -1275,8 +1277,10 @@ export default function Qingdan3({name, bh, bt, rgde, jxde, clde, beizhu/*后台
 
                   
                    </Stack>
+                   <div style={{width: "70vw"}}>
                    <div ref={myRef}> 
                   </div>
+                  </div>
                   </Box>
 
 
@@ -1296,8 +1300,9 @@ export default function Qingdan3({name, bh, bt, rgde, jxde, clde, beizhu/*后台
                        </Box>
                        
                        <TabPanel sx={{p: 1}} value="1">
-                        
+                        <div style={{width:"70vw"}}>
                        <div ref={rcjRef}></div>
+                       </div>
                        </TabPanel>
                        <TabPanel sx={{p: 1}} value="2">
                          
@@ -1324,18 +1329,15 @@ export default function Qingdan3({name, bh, bt, rgde, jxde, clde, beizhu/*后台
                          rows={rcjrows}
                          columns={rcjcolumns}
                          processRowUpdate={processRowUpdate}
-                         slots={{ toolbar: EditToolbar }}
                          slotProps={{
                            toolbar: { setRcjrows },
                          }}
-                         showToolbar={showToolbar}
-                         localeText={{
-                              noRowsLabel: '无数据',
-                              paginationRowsPerPage: '每页行数',
-                              footerRowSelected: (count) => `共选中了${count.toLocaleString()}行`,
-                             
-                              
+                         slots={{
+                              toolbar: EditToolbar,
                             }}
+                         
+                         localeText={zhCN_MUI.components.MuiDataGrid.defaultProps.localeText}
+
                        />
                      </Box>
                              

+ 0 - 1
front/src/Qtxm.js

@@ -1,6 +1,5 @@
 import * as React from 'react';
 import Box from "@mui/material/Box";
-import {RichTreeView } from "@mui/x-tree-view/RichTreeView";
 import { Grid } from '@mui/material';
 import Tab from "@mui/material/Tab";
 import TabContext from "@mui/lab/TabContext";

+ 299 - 271
front/src/Qufei.js

@@ -1,6 +1,5 @@
 import * as React from 'react';
 import Box from "@mui/material/Box";
-import {RichTreeView } from "@mui/x-tree-view/RichTreeView";
 import { Grid } from '@mui/material';
 import Tab from "@mui/material/Tab";
 import TabContext from "@mui/lab/TabContext";
@@ -9,46 +8,49 @@ import TabPanel from "@mui/lab/TabPanel";
 import Stack from "@mui/material/Stack";
 //registerPlugin(NestedRows);
 import Service from './Service';
-import { Table, ConfigProvider, Button as AButton } from "antd";
+import { Table, ConfigProvider } from "antd";
 import EditableSelect from './EditableSelect';
 import EditableSelectGC from './EditableSelectGC';
 import Editable from './Editable';
 import Button from '@mui/material/Button';
-
+import {TabulatorFull as Tabulator} from "tabulator-tables"; //import Tabulator library
+import "tabulator-tables/dist/css/tabulator.min.css"; //import Tabulator stylesheet
+import './Tabulator.css';
 import {copy} from './utils';
 
 export default function Qufei({id, qufeiCallback}) {
     
-  const [detail, setDetail] = React.useState([
-    {"序号": null, "清单编码" : null, "名称" : null,"项目特征" : null,
-    "计算规则" : null,
-    "单位" : null,
-    "数量": null,
-    "综合单价" : null,
-    "合价" : null,
-    "人工费": null,
-    "主材费" : null,
-    "设备费": null,
-    "辅材费": null,
-    "材料费" : null,
-    "机械费" : null,
-    "管理费": null,
-    "利润": null,
-    "暂估价" : null,
-    "综合人工工日" : null,
-    "备注" : null}]
-);
+  const [detail, setDetail] = React.useState([]);
 
 const hotRef = React.useRef(null);
+const myRef = React.useRef();
+const myTable = React.useRef(null);
 const [expandedRowKeys, setExpandedRowKeys] = React.useState([]);
 const [selectedRowKeys, setSelectedRowKeys] = React.useState([]);
 
 
 
 const apply = () => {
-  let checked = check(detail);
+  let checked = check(myTable.current.getData());
   if (checked) {
-    qufeiCallback(id, detail);
+    let origin = myTable.current.getData();
+    let y = origin.map(z=>{
+      z["children"] = z['_children'];
+      return z;
+    });
+    let t = y.map(z=>{
+      if (z.hasOwnProperty("children")) {
+        let children = z["children"];
+        for (let i = 0; i < children.length; i++) {
+          let child = children[i];
+          if (child.hasOwnProperty("_children")) {
+            child["children"] = child["_children"];
+          }
+        }
+      }
+      return z;
+      });
+    qufeiCallback(id, t);
   }
 };
 
@@ -60,8 +62,8 @@ const check = (data) => {
     if (data[i]['利润(%)'].length == 0) {
       return false;
     }
-    if (data[i].hasOwnProperty('children')) {
-       let checked = check(data[i]['children']);
+    if (data[i].hasOwnProperty('_children')) {
+       let checked = check(data[i]['_children']);
        if (!checked) {
           return false;
        }
@@ -274,8 +276,8 @@ const traverse = (data) => {
         }
 
     }
-    if (data[i].hasOwnProperty("children")) {
-      traverse(data[i]['children']);
+    if (data[i].hasOwnProperty("_children")) {
+      traverse(data[i]['_children']);
     }
   }
   return data;
@@ -284,231 +286,376 @@ const traverse = (data) => {
 
 
 const handleChangeLR = (value) => {
-  if (selectedRowKeys.length > 0 && detail.length > 0) {
-    let selected = selectedRowKeys[0];
-    if (detail[0]['key'] == selected) {
+  
+    let selected = value.row.getData()['key'];
+    let all = value.row.table.getData();
+    if (all[0]['key'] == selected) {
       //总选择
-      let newData = copy(detail);
-      newData[0]['利润(%)'] = value;
-      for(let i = 0; i < newData[0]["children"].length; i++) {
-        let child = newData[0]['children'][i];
-        child['利润(%)'] = value;
-        for(let j = 0; j < child['children'].length; j++) {
-          child['children'][j]['利润(%)'] = value;
+      let newData = copy(all);
+      newData[0]['利润(%)'] = value.value;
+      for(let i = 0; i < newData[0]["_children"].length; i++) {
+        let child = newData[0]['_children'][i];
+        child['利润(%)'] = value.value;
+        for(let j = 0; j < child['_children'].length; j++) {
+          child['_children'][j]['利润(%)'] = value.value;
         }
       }
-      setDetail(newData);
+      myTable.current.replaceData(newData);
 
     }
-    else if (detail[0]["children"].filter(x=>x['key'] == selected).length > 0) {
+    else if (all[0]["_children"].filter(x=>x['key'] == selected).length > 0) {
       //某个单项工程
-      let newData = copy(detail);
-      for(let i = 0; i < newData[0]["children"].length; i++) {
-        let child = newData[0]['children'][i];
+      let newData = copy(all);
+      for(let i = 0; i < newData[0]["_children"].length; i++) {
+        let child = newData[0]['_children'][i];
         if (child['key'] == selected) {
-          child['利润(%)'] = value;
-          for(let j = 0; j < child['children'].length; j++) {
-            child['children'][j]['利润(%)'] = value;
+          child['利润(%)'] = value.value;
+          for(let j = 0; j < child['_children'].length; j++) {
+            child['_children'][j]['利润(%)'] = value.value;
           }
         }
         
       } 
-      setDetail(newData);
+      myTable.current.replaceData(newData);
     } else {
       //具体一行
-      let newData = copy(detail);
-      for(let i = 0; i < newData[0]["children"].length; i++) {
-        let child = newData[0]['children'][i];
+      let newData = copy(all);
+      for(let i = 0; i < newData[0]["_children"].length; i++) {
+        let child = newData[0]['_children'][i];
         
-        for(let j = 0; j < child['children'].length; j++) {
-          if (child['children'][j]['key'] == selected) {  
-              child['children'][j]['利润(%)'] = value;
+        for(let j = 0; j < child['_children'].length; j++) {
+          if (child['_children'][j]['key'] == selected) {  
+              child['_children'][j]['利润(%)'] = value.value;
           }
         }
         
         
       } 
-      setDetail(newData);
+      myTable.current.replaceData(newData);
     }
 
 
-  }
+  
 };
 
 
 const handleChangeGLF = (value) => {
-  if (selectedRowKeys.length > 0 && detail.length > 0) {
-    let selected = selectedRowKeys[0];
-    if (detail[0]['key'] == selected) {
+  
+    let selected = value.row.getData()['key'];
+    let all = value.row.table.getData();
+    if (all[0]['key'] == selected) {
       //总选择
-      let newData = copy(detail);
-      newData[0]['管理费(%)'] = value;
-      for(let i = 0; i < newData[0]["children"].length; i++) {
-        let child = newData[0]['children'][i];
-        child['管理费(%)'] = value;
-        for(let j = 0; j < child['children'].length; j++) {
-          child['children'][j]['管理费(%)'] = value;
+      let newData = copy(all);
+      newData[0]['管理费(%)'] = value.value;
+      for(let i = 0; i < newData[0]["_children"].length; i++) {
+        let child = newData[0]['_children'][i];
+        child['管理费(%)'] = value.value;
+        for(let j = 0; j < child['_children'].length; j++) {
+          child['_children'][j]['管理费(%)'] = value.value;
         }
       }
-      setDetail(newData);
+      myTable.current.replaceData(newData);
 
     }
-    else if (detail[0]["children"].filter(x=>x['key'] == selected).length > 0) {
+    else if (all[0]["_children"].filter(x=>x['key'] == selected).length > 0) {
       //某个单项工程
-      let newData = copy(detail);
-      for(let i = 0; i < newData[0]["children"].length; i++) {
-        let child = newData[0]['children'][i];
+      let newData = copy(all);
+      for(let i = 0; i < newData[0]["_children"].length; i++) {
+        let child = newData[0]['_children'][i];
         if (child['key'] == selected) {
-          child['管理费(%)'] = value;
-          for(let j = 0; j < child['children'].length; j++) {
-            child['children'][j]['管理费(%)'] = value;
+          child['管理费(%)'] = value.value;
+          for(let j = 0; j < child['_children'].length; j++) {
+            child['_children'][j]['管理费(%)'] = value.value;
           }
         }
         
       } 
-      setDetail(newData);
+      myTable.current.replaceData(newData);
     } else {
       //具体一行
-      let newData = copy(detail);
-      for(let i = 0; i < newData[0]["children"].length; i++) {
-        let child = newData[0]['children'][i];
+      let newData = copy(all);
+      for(let i = 0; i < newData[0]["_children"].length; i++) {
+        let child = newData[0]['_children'][i];
         
-        for(let j = 0; j < child['children'].length; j++) {
-          if (child['children'][j]['key'] == selected) {  
-              child['children'][j]['管理费(%)'] = value;
+        for(let j = 0; j < child['_children'].length; j++) {
+          if (child['_children'][j]['key'] == selected) {  
+              child['_children'][j]['管理费(%)'] = value.value;
           }
         }
         
         
       } 
-      setDetail(newData);
+      myTable.current.replaceData(newData);
     }
 
 
-  }
+  
 };
 
 
 const handleChange = (value) => {
-  if (selectedRowKeys.length > 0 && detail.length > 0) {
-    let selected = selectedRowKeys[0];
-    if (detail[0]['key'] == selected) {
+  
+    let selected = value.row.getData()['key'];
+    let all = value.row.table.getData();
+    if (all[0]['key'] == selected) {
       //总选择
-      let newData = copy(detail);
-      newData[0]['工程类别'] = value;
-      for(let i = 0; i < newData[0]["children"].length; i++) {
-        let child = newData[0]['children'][i];
-        child['工程类别'] = value;
-        for(let j = 0; j < child['children'].length; j++) {
-          child['children'][j]['工程类别'] = value;
+      let newData = copy(all);
+      newData[0]['工程类别'] = value.value;
+      for(let i = 0; i < newData[0]["_children"].length; i++) {
+        let child = newData[0]['_children'][i];
+        child['工程类别'] = value.value;
+        for(let j = 0; j < child['_children'].length; j++) {
+          child['_children'][j]['工程类别'] = value.value;
         }
       }
-      setDetail(traverse(newData));
+      myTable.current.replaceData(traverse(newData));
 
     }
-    else if (detail[0]["children"].filter(x=>x['key'] == selected).length > 0) {
+    else if (all[0]["_children"].filter(x=>x['key'] == selected).length > 0) {
       //某个单项工程
-      let newData = copy(detail);
-      for(let i = 0; i < newData[0]["children"].length; i++) {
-        let child = newData[0]['children'][i];
+      let newData = copy(all);
+      for(let i = 0; i < newData[0]["_children"].length; i++) {
+        let child = newData[0]['_children'][i];
         if (child['key'] == selected) {
-          child['工程类别'] = value;
-          for(let j = 0; j < child['children'].length; j++) {
-            child['children'][j]['工程类别'] = value;
+          child['工程类别'] = value.value;
+          for(let j = 0; j < child['_children'].length; j++) {
+            child['_children'][j]['工程类别'] = value.value;
           }
         }
         
       } 
-      setDetail(traverse(newData));
+      myTable.current.replaceData(traverse(newData));
     } else {
       //具体一行
-      let newData = copy(detail);
-      for(let i = 0; i < newData[0]["children"].length; i++) {
-        let child = newData[0]['children'][i];
+      let newData = copy(all);
+      for(let i = 0; i < newData[0]["_children"].length; i++) {
+        let child = newData[0]['_children'][i];
         
-        for(let j = 0; j < child['children'].length; j++) {
-          if (child['children'][j]['key'] == selected) {  
-              child['children'][j]['工程类别'] = value;
+        for(let j = 0; j < child['_children'].length; j++) {
+          if (child['_children'][j]['key'] == selected) {  
+              child['_children'][j]['工程类别'] = value.value;
           }
         }
         
         
       } 
-      setDetail(traverse(newData));
+      myTable.current.replaceData(traverse(newData));
     }
 
 
-  }
+  
 };
 
 const handleChangeGC = (value) => {
-  if (selectedRowKeys.length > 0 && detail.length > 0) {
-    let selected = selectedRowKeys[0];
-    if (detail[0]['key'] == selected) {
+
+    let selected = value.row.getData()['key'];
+    let all = value.row.table.getData();
+    if (all[0]['key'] == selected) {
       //总选择
-      let newData = copy(detail);
-      newData[0]['工程类型'] = value;
-      for(let i = 0; i < newData[0]["children"].length; i++) {
-        let child = newData[0]['children'][i];
-        child['工程类型'] = value;
-        for(let j = 0; j < child['children'].length; j++) {
-          child['children'][j]['工程类型'] = value;
+      let newData = copy(all);
+      newData[0]['工程类型'] = value.value;
+      for(let i = 0; i < newData[0]["_children"].length; i++) {
+        let child = newData[0]['_children'][i];
+        child['工程类型'] = value.value;
+        for(let j = 0; j < child['_children'].length; j++) {
+          child['_children'][j]['工程类型'] = value.value;
         }
       }
-      setDetail(traverse(newData));
+      myTable.current.replaceData(traverse(newData));
 
     }
-    else if (detail[0]["children"].filter(x=>x['key'] == selected).length > 0) {
+    else if (all[0]["_children"].filter(x=>x['key'] == selected).length > 0) {
       //某个单项工程
-      let newData = copy(detail);
-      for(let i = 0; i < newData[0]["children"].length; i++) {
-        let child = newData[0]['children'][i];
+      let newData = copy(all);
+      for(let i = 0; i < newData[0]["_children"].length; i++) {
+        let child = newData[0]['_children'][i];
         if (child['key'] == selected) {
-          child['工程类型'] = value;
-          for(let j = 0; j < child['children'].length; j++) {
-            child['children'][j]['工程类型'] = value;
+          child['工程类型'] = value.value;
+          for(let j = 0; j < child['_children'].length; j++) {
+            child['_children'][j]['工程类型'] = value.value;
           }
         }
         
       } 
-      setDetail(traverse(newData));
+      myTable.current.replaceData(traverse(newData));
     } else {
       //具体一行
-      let newData = copy(detail);
-      for(let i = 0; i < newData[0]["children"].length; i++) {
-        let child = newData[0]['children'][i];
+      let newData = copy(all);
+      for(let i = 0; i < newData[0]["_children"].length; i++) {
+        let child = newData[0]['_children'][i];
         
-        for(let j = 0; j < child['children'].length; j++) {
-          if (child['children'][j]['key'] == selected) {  
-              child['children'][j]['工程类型'] = value;
+        for(let j = 0; j < child['_children'].length; j++) {
+          if (child['_children'][j]['key'] == selected) {  
+              child['_children'][j]['工程类型'] = value.value;
           }
         }
         
         
       } 
-      setDetail(traverse(newData));
+      myTable.current.replaceData(traverse(newData));
     }
 
 
-  }
+  
 };
 
-function selectRow(record) {
-  /*
-  const selectedRowKeys_ = [...selectedRowKeys];
-  if (selectedRowKeys_.indexOf(record.key) >= 0) {
-       selectedRowKeys_.splice(selectedRowKeys_.indexOf(record.key), 1);
-  } else {
-       selectedRowKeys_.push(record.key);
-  }*/
-   setSelectedRowKeys([record.key]);
-}
+
 React.useEffect(
   () => {
-    
+    myTable.current = new Tabulator(myRef.current, {
+
+      index: "key",
+      height: 600,
+    data: detail, //link data to table
+    reactiveData: false, //enable data reactivity
+    dataTreeStartExpanded:true,
+    dataTree: true,
+    selectableRows:1, //make rows selectable
+    editTriggerEvent:"dblclick", //trigger edit on double click
+    dataTreeStartExpanded:function(row, level){
+        //console.log(row);
+        //console.log(level);
+        return true; //expand rows where the "driver" data field is true;
+    },
+    columns: [ //Define Table Columns 序号", "名称", "取费基数", "计算基础","费率", "金额", "类别
+                 {title:"名称", field:"名称", width:250, headerSort:false, formatter:"textarea"}, //hide this column first
+                 {title:"工程类型", field:"工程类型", width:100 , headerSort:false, formatter:"textarea", editor: "list", editorParams: {
+                   values: [
+                    { //option group
+                      label:"建筑工程",
+                      options:[ //options in option group
+                          {
+                              label:"建筑工程",
+                              value:"建筑工程",
+                             
+                          },
+                          {
+                              label:"单独预制构件制作",
+                              value:"单独预制构件制作",
+                          },
+                          {
+                            label:"打预制桩、单独构件吊装",
+                            value:"打预制桩、单独构件吊装",
+                          },
+                          {
+                          label:"制作兼打桩",
+                          value:"制作兼打桩",
+                          },
+                          {
+                            label:"大型土石方工程",
+                            value:"大型土石方工程",
+                            },
+                      ]
+                    },
+                    { //option group
+                      label:"单独装饰工程",
+                      options:[ //options in option group
+                          {
+                              label:"单独装饰工程",
+                              value:"单独装饰工程",
+                             
+                          },
+                      ]
+                    },
+                    { //option group
+                      label:"安装工程",
+                      options:[ //options in option group
+                          {
+                              label:"安装工程",
+                              value:"安装工程",
+                             
+                          },
+                      ]
+                    },
+                    { //option group
+                      label:"市政工程",
+                      options:[ //options in option group
+                          {
+                              label:"通用项目、道路、排水工程",
+                              value:"通用项目、道路、排水工程",
+                             
+                          },
+                          {
+                            label:"桥梁、水工构筑物",
+                            value:"桥梁、水工构筑物",
+                           
+                        },
+                        {
+                          label:"给水、燃气与集中供热",
+                          value:"给水、燃气与集中供热",
+                         
+                      },
+                      {
+                        label:"路灯及交通设施工程",
+                        value:"路灯及交通设施工程",
+                       
+                    },
+                    {
+                      label:"(市)大型土石方工程",
+                      value:"(市)大型土石方工程",
+                     
+                  },
+                      ]
+                    },
+                   ]
+                 }},
+                 {title:"工程类别", field:"工程类别", width:100, headerSort:false, formatter: "textarea" , editor: "list", editorParams: {
+                   values: ["一类工程", "二类工程", "三类工程"]
+                 }
+
+                 },
+                 {title:"管理费(%)", field:"管理费(%)", width:100, headerSort:false, formatter:"textarea", editor: "input"},
+                 {title:"利润(%)", field:"利润(%)", width:150, headerSort:false, formatter:"textarea", editor: "input" },
+                 {title:"备注", field:"备注", width:200, headerSort:false, formatter:"textarea"},
+               
+         ]
+
+    });//init table
+
+  
+
+
+
+  myTable.current.on("tableBuilt", () => {
     Service.generateQufei(id).then(x=>{
 
-    setDetail(x);
+      console.log(x);
+      let y = x.map(z=>{
+        z["_children"] = z['children'];
+        return z;
+      });
+      let t = y.map(z=>{
+        if (z.hasOwnProperty("_children")) {
+          let children = z["_children"];
+          for (let i = 0; i < children.length; i++) {
+            let child = children[i];
+            if (child.hasOwnProperty("children")) {
+              child["_children"] = child["children"];
+            }
+          }
+        }
+        return z;
+        });
+         myTable.current.replaceData(t);
+     });
+
+   
+    });
+
+    myTable.current.on("cellEdited", function(cell){
+      console.log(cell._cell);
+      if (cell._cell.column.field == '工程类型') {
+        handleChangeGC(cell._cell);
+      }
+      if (cell._cell.column.field == '工程类别') {
+        handleChange(cell._cell);
+      } 
+      if (cell._cell.column.field == '管理费(%)') {
+        handleChangeGLF(cell._cell);
+      } 
+      if (cell._cell.column.field == '利润(%)') {
+        handleChangeLR(cell._cell);
+      } 
     });
   
      
@@ -517,130 +664,11 @@ React.useEffect(
 
 
     return (
-                 <Box>
+                 <Box sx={{ width: '70vw'}}>
                 <Button variant="outlined" onClick={apply}>应用</Button>
-                <ConfigProvider
-                   theme={{
-                    components: {
-                      Table: {
-                        /* here is your component tokens */
-                        cellPaddingBlock : 8
-                      },
-                    },
-                  }}
-                   >
-                 <Table 
-                    dataSource={detail}
-                    
-                    
-                    //afterSelection={handleSelection}
-                    //afterSelection={handleSelection}
-                    ref = {hotRef}
-                    expandable = {
-                         {
-                              expandedRowKeys,
-                              onExpand: (expandable, record) => {
-                                   if (expandable) {
-                                     setExpandedRowKeys([...expandedRowKeys, record.key]);
-                                   } else {
-                                     setExpandedRowKeys(expandedRowKeys.filter((id) => record.key !== id));
-                                   }
-                                 },
-                              expandRowByClick: true
-                         }
-                    }
-
-                    rowSelection= {rowSelection}
-                    onRow={(record)=>({
-                         onClick: () => {
-                              selectRow(record);
-                            }
-                    })}
-                    scroll={{ x: 'max-content' , y : 'calc(100vh - 200px)'}}
-                    //pagination={{ position: ['none', 'none'] }}
-                    pagination={false}
-                    columns = {[
-                         
-                         { dataIndex: '操作',        title : '操作',        key : '操作'          , width : 30 , fixed: 'left'   },
-                         { dataIndex: '名称'   ,      title : '名称'  ,       key : '名称'        , width : 250         },
-                         { dataIndex: '工程类型' ,    title : '工程类型' ,  
-                           key : '工程类型'    , width : 150  ,
-                           render: (text, record) => {
-                            //console.log("column render");
-                            //console.log("text".concat(text));
-                            //console.log(record);
-                                   
-                                      return ( 
-                                           <EditableSelectGC initialText={text}  onChange={handleChangeGC}
-                                           >
-                                          </EditableSelectGC>
-                                       );
-                                    
-                                    //console.log(text);
-                                    
-                            }
-                             },
-                         { dataIndex: '工程类别' ,    title : '工程类别' ,  
-                           key : '工程类别'    , width : 100  ,
-                           render: (text, record) => {
-                            //console.log("column render");
-                            //console.log("text".concat(text));
-                            //console.log(record);
-                                   
-                                      return ( 
-                                           <EditableSelect initialText={text}  onChange={handleChange}
-                                           >
-                                          </EditableSelect>
-                                       );
-                                    
-                                    //console.log(text);
-                                    
-                            }
-                             },
-                         { dataIndex: '管理费(%)' ,    title : '管理费(%)' ,    key : '管理费(%)'    , width : 50   ,
-                         render: (text, record) => {
-                          //console.log("column render");
-                          //console.log("text".concat(text));
-                          //console.log(record);
-                                 
-                                    return ( 
-                                         <Editable initialText={text}  onChange={handleChangeGLF}
-                                         >
-                                        </Editable>
-                                     );
-                                  
-                                  //console.log(text);
-                                  
-                          }      },
-                         { dataIndex: '利润(%)'    ,     title : '利润(%)'  ,       key : '利润(%)'        , width : 50  ,
-                         render: (text, record) => {
-                          //console.log("column render");
-                          //console.log("text".concat(text));
-                          //console.log(record);
-                                 
-                                    return ( 
-                                         <Editable initialText={text}  onChange={handleChangeLR}
-                                         >
-                                        </Editable>
-                                     );
-                                  
-                                  //console.log(text);
-                                  
-                          }
-                        },
-                        { dataIndex: '备注',        title : '备注',        key : '备注'          , width : 100   },
-
-                       
-                        
-
-                         
-                             
-                            
-                       ]}
-                   
-                  />
-                  </ConfigProvider>
-
+                 
+                <div ref={myRef}> 
+                </div>
 
                  </Box>
 

+ 0 - 1
front/src/Rcjhz.js

@@ -1,6 +1,5 @@
 import * as React from 'react';
 import Box from "@mui/material/Box";
-import {RichTreeView } from "@mui/x-tree-view/RichTreeView";
 import { Grid } from '@mui/material';
 import Tab from "@mui/material/Tab";
 import TabContext from "@mui/lab/TabContext";

+ 1 - 4
front/src/Tbxx.js

@@ -1,6 +1,5 @@
 import * as React from 'react';
 import Box from "@mui/material/Box";
-import {RichTreeView } from "@mui/x-tree-view/RichTreeView";
 import { Grid } from '@mui/material';
 import Tab from "@mui/material/Tab";
 import TabContext from "@mui/lab/TabContext";
@@ -9,9 +8,7 @@ import TabPanel from "@mui/lab/TabPanel";
 import Stack from "@mui/material/Stack";
 //registerPlugin(NestedRows);
 import Service from './Service';
-import EditableSelect from './EditableSelect';
-import EditableSelectGC from './EditableSelectGC';
-import Editable from './Editable';
+
 import Button from '@mui/material/Button';
 
 import {copy} from './utils';

+ 0 - 1
front/src/Zcbfwf.js

@@ -1,6 +1,5 @@
 import * as React from 'react';
 import Box from "@mui/material/Box";
-import {RichTreeView } from "@mui/x-tree-view/RichTreeView";
 import { Grid } from '@mui/material';
 import Tab from "@mui/material/Tab";
 import TabContext from "@mui/lab/TabContext";

+ 0 - 1
front/src/Zjcs2.js

@@ -1,6 +1,5 @@
 import * as React from 'react';
 import Box from "@mui/material/Box";
-import {RichTreeView } from "@mui/x-tree-view/RichTreeView";
 import { Grid } from '@mui/material';
 import Tab from "@mui/material/Tab";
 import Tabs from '@mui/material/Tabs';

+ 0 - 1
front/src/Zlje.js

@@ -1,6 +1,5 @@
 import * as React from 'react';
 import Box from "@mui/material/Box";
-import {RichTreeView } from "@mui/x-tree-view/RichTreeView";
 import { Grid } from '@mui/material';
 import Tab from "@mui/material/Tab";
 import TabContext from "@mui/lab/TabContext";

+ 0 - 1
front/src/Zygczgj.js

@@ -1,6 +1,5 @@
 import * as React from 'react';
 import Box from "@mui/material/Box";
-import {RichTreeView } from "@mui/x-tree-view/RichTreeView";
 import { Grid } from '@mui/material';
 import Tab from "@mui/material/Tab";
 import TabContext from "@mui/lab/TabContext";

+ 1 - 1
main.py

@@ -466,7 +466,7 @@ async def read_des(r: DingeshuRequest):
 async def read_pbs(r: DingeshuRequest):
     result = service.getPbs(r.value)
     #print(result)
-    result.insert(0, {"id": "0", "label": "全部"})
+    result.insert(0, {"id": "0","key": "0", "label": "全部", "title": "全部"})
     return result
 
 @app.post("/pbxl/")

+ 6 - 0
package.json

@@ -0,0 +1,6 @@
+{
+  "dependencies": {
+    "react": "^18.0.0",
+    "react-dom": "^18.0.0"
+  }
+}

+ 2 - 2
subdir/service.py

@@ -1016,7 +1016,7 @@ def processDes(dataframe, from_, end, level):
         item = dataframe.iloc[i]
         fbcch = str(item['fbcch'])
         if fbcch == str(level):
-            entry = {"id": str(item["ID"]), "label": str(item["zjbt"])}
+            entry = {"id": str(item["ID"]),"key": str(item["ID"]), "label": str(item["zjbt"]), "title": str(item["zjbt"])}
             next = i + 1
             while next < end and str(dataframe.iloc[next]["fbcch"]) != str(level):
                 next = next + 1
@@ -1030,7 +1030,7 @@ def processPbs(dataframe, from_, end, level):
         item = dataframe.iloc[i]
         fbcch = str(item['fbcch'])
         if fbcch == str(level):
-            entry = {"id": str(item["ID"]), "label": str(item["flmc"]), "data": item["pblbh"]}
+            entry = {"id": str(item["ID"]),"key": str(item["ID"]), "label": str(item["flmc"]),"title": str(item["flmc"]), "data": item["pblbh"]}
             next = i + 1
             while next < end and str(dataframe.iloc[next]["fbcch"]) != str(level):
                 next = next + 1