Преглед изворни кода

qingdan delete handsontable

Xiaopeng Zhang пре 6 месеци
родитељ
комит
a4d2a039c9

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
front/dist/main.bundle.js


Разлика између датотеке није приказан због своје велике величине
+ 1 - 1
front/dist/report.html


Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
front/dist/src_App2_js-node_modules_moment_locale_sync_recursive_-data_image_png_base64_iVBORw0KGgoAAAAN-c43643.bundle.js


Разлика између датотеке није приказан због своје велике величине
+ 27 - 0
front/dist/src_App2_js.bundle.js


Разлика између датотеке није приказан због своје велике величине
+ 17 - 0
front/dist/vendors-node_modules_antd_es_table_index_js-node_modules_antd_lib_locale_zh_CN_js-node_module-538aa5.bundle.js


Разлика између датотеке није приказан због своје велике величине
+ 17 - 0
front/dist/vendors-node_modules_handsontable_react_es_react-handsontable_js-node_modules_antd_es_table_i-76f0c6.bundle.js


+ 0 - 5
front/package.json

@@ -11,20 +11,15 @@
   "author": "",
   "license": "ISC",
   "dependencies": {
-    "@chakra-ui/react": "^3.21.0",
     "@emotion/react": "latest",
     "@emotion/styled": "latest",
-    "@handsontable/react": "^11.0.0",
-    "@handsontable/react-wrapper": "^15.3.0",
     "@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",
     "antd": "^5.26.1",
-    "handsontable": "^15.3.0",
     "html-webpack-plugin": "^5.6.3",
-    "hyperformula": "^3.0.0",
     "react": "latest",
     "react-dom": "latest",
     "react-router": "latest",

+ 2 - 2
front/src/App2.js

@@ -15,7 +15,7 @@ import Tab from "@mui/material/Tab";
 import TabContext from "@mui/lab/TabContext";
 import TabList from "@mui/lab/TabList";
 import TabPanel from "@mui/lab/TabPanel";
-import Qingdan2 from './Qingdan2';
+import Qingdan3 from './Qingdan3';
 import Gfsj from './Gfsj';
 import Tbxx from './Tbxx';
 import Bjhz from './Bjhz';
@@ -1253,7 +1253,7 @@ const MUI_X_PRODUCTS = [
                       </TabList>
                    </Box>
                    {qdbt.map((x, index)=><TabPanel sx={{p: 1}} value={(index+1).toString()}>
-                             <Qingdan2
+                             <Qingdan3
                                 name={location["id"]}
                                 bh={qdbh}
                                 bt={x}

+ 0 - 399
front/src/Djcs.js

@@ -1,399 +0,0 @@
-import * as React from 'react';
-import Box from "@mui/material/Box";
-import 'handsontable/dist/handsontable.full.min.css';
-//import 'handsontable/styles/ht-theme-main.min.css';
-import { HandsonTable } from 'handsontable/base';
-import {HotTable} from "@handsontable/react";
-//import { registerAllModules } from 'handsontable/registry';
-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";
-import TabList from "@mui/lab/TabList";
-import TabPanel from "@mui/lab/TabPanel";
-import Stack from "@mui/material/Stack";
-//import { registerPlugin, NestedRows } from 'handsontable/plugins';
-//registerPlugin(NestedRows);
-import Service from './Service';
-
-
-import { textRenderer, registerRenderer } from 'handsontable/renderers';
-export default function Djcs({name, bh, rgde, jxde, clde, beizhu, clickCallback}) {
-     
-    registerRenderer('customStylesRenderer', (hotInstance, TD, ...rest) => {
-         textRenderer(hotInstance, TD, ...rest);
-         TD.style.fontWeight = 'bold';
-         TD.style.color = 'green';
-         TD.style.background = '#d7f1e1';
-       });
-
-       registerRenderer('highlightRowRenderer', (hotInstance, TD, ...rest) => {
-          textRenderer(hotInstance, TD, ...rest);
-          TD.style.color = 'green';
-          TD.style.background = '#d7f1e1';
-        });
-    const [detail, setDetail] = React.useState([
-                    {
-                    "序号": null, "清单编码": null, "名称" : null, "项目特征" : null, 
-                    "计算规则" : null, "单位" : null, "数量" : null, 
-                    "综合单价" : null, "合价" : null, "人工费" : null, "主材费" : null,
-                     "设备费" : null, "辅材费" : null, "材料费" : null, 
-                    "机械费" : null, "管理费" : null, "利润"  : null, "暂估价" : null, "综合人工工日" : null }
-    ]);
-    const hotRef = React.useRef(null);
-    const [value, setValue] = React.useState("1");
-    const [rcjhl, setRcjhl] = React.useState([]);
-    const [rcjhl2, setRcjhl2] = React.useState([]);
-    const [fuzhu, setFuzhu] = React.useState([]);
-    const [tuijian, setTuijian] = React.useState([]);
-
-    const [highlight, setHighlight] = React.useState([]);
-    const selectedRow = React.useRef(-1);
-
-    const rgdeRef = React.useRef(null);
-    const jxdeRef = React.useRef(null);
-    const cldeRef = React.useRef(null);
-    const isQdrcj = React.useRef(false);
-    React.useEffect(
-        () => {
-          Service.generateDjcs(name, bh).then(x=>{
-          setDetail(x);
-          selectedRow.current = -1;
-          });
-        }, [bh]
-      );
-    React.useEffect(
-        () => {
-            console.log(beizhu);
-            let result = [["序号", "编号", "说明"]];
-            if (beizhu != null) { 
-                let keys = Object.keys(beizhu["BZBH"]);
-                for(let i = 0; i < keys.length; i++) {
-                    let key = keys[i];
-                    result.push([i+1, beizhu["BZBH"][key], beizhu["SM"][key]]);
-                }
-                setFuzhu(result);
-            }
-        }, [beizhu]
-      );
-
-    React.useEffect(
-        () => {
-          console.log("rgde changed");
-          console.log(rgde);
-          rgdeRef.current = rgde;
-          jxdeRef.current = jxde;
-          cldeRef.current = clde;
-          if (isQdrcj.current) {
-             setHighlight([]);
-          } else {
-          let toHighlight = [];
-          for(let i = 1; i < rcjhl.length; i++) {
-              let entry = rcjhl[i];
-              let bianhao = entry[1];
-              let rcjlb = entry[8];
-              if (Number(rcjlb) == Number(1) && rgde) {
-                  for (let j = 0; j < rgde.length; j++) {
-                      if (rgde[j]["CLBH"] == bianhao) {
-                          let danjia = Number(entry[5]);
-                          if (danjia != rgde[j]["YSJG"]) {
-                               console.log(`[${i},5]danjia bu yizhi`);
-                               toHighlight.push({row: i, col: 5, renderer: "customStylesRenderer"});
-                          }
-                          let hanliang = Number(entry[10]);
-                          if (hanliang != rgde[j]["gr"]) {
-                               console.log(`[${i}, 10]hanliang bu yizhi`);
-                               toHighlight.push({row: i, col: 10, renderer: "customStylesRenderer"});
-                          }
-
-                      }              
-                  }
-
-              }   
-              if (Number(rcjlb) == Number(3) && jxde ) {
-                   for (let j = 0; j < jxde.length; j++) {
-                      if (jxde[j]["jxbh"] == bianhao) {
-                         let danjia = Number(entry[5]);
-                         if (danjia != jxde[j]["tbdj"]) {
-                              console.log(`[${i},5]danjia bu yizhi`);
-                              toHighlight.push({row: i, col: 5, renderer: "customStylesRenderer"});
-                         }
-                         let hanliang = Number(entry[10]);
-                         if (hanliang != jxde[j]["sl"]) {
-                              console.log(`[${i}, 10]hanliang bu yizhi`);
-                              toHighlight.push({row: i, col: 10, renderer: "customStylesRenderer"});
-                         }
-                      }
-                   }
-
-              }   
-              if (Number(rcjlb) == Number(2) && clde ) {
-                   for (let j = 0; j < clde.length; j++) {
-                      if (clde[j]["CLBH"] == bianhao) {
-                         let danjia = Number(entry[5]);
-                         if (danjia != clde[j]["YSJG"]) {
-                              console.log(`[${i},5]danjia bu yizhi`);
-                              toHighlight.push({row: i, col: 5, renderer: "customStylesRenderer"});
-                         }
-                         let hanliang = Number(entry[10]);
-                         if (hanliang != clde[j]["SL"]) {
-                              console.log(`[${i}, 10]hanliang bu yizhi`);
-                              toHighlight.push({row: i, col: 10, renderer: "customStylesRenderer"});
-                         }
-                      }
-                   }
-
-              }   
-          }
-          console.log(toHighlight);
-          setHighlight(toHighlight);
-          }
-
-
-          let bzrcjhl = [["人材机编码", "名称", "单位", "单价", "合价", "含量"]] 
-          if (rgde)
-          for (let i = 0; i  < rgde.length; i++) {
-               bzrcjhl.push([rgde[i]["CLBH"], rgde[i]["CLMC"], rgde[i]["JLDW"], rgde[i]["YSJG"], rgde[i]["gf"], rgde[i]["gr"]]);
-          }
-          
-          if (clde)
-          for (let i = 0; i  < clde.length; i++) {
-               bzrcjhl.push([clde[i]["CLBH"], clde[i]["CLMC"], clde[i]["JLDW"], clde[i]["YSJG"], clde[i]["HJ"], clde[i]["SL"]]);
-          }
-          if (jxde)
-          for (let i = 0; i  < jxde.length; i++) {
-               bzrcjhl.push([jxde[i]["jxbh"], jxde[i]["jxmc"], jxde[i]["DW"], jxde[i]["tbdj"], jxde[i]["hj"], jxde[i]["sl"]]);
-          }
-          setRcjhl2(bzrcjhl);
-        }, [rgde, jxde, clde]
-      );
-
-      const handleChange = (event, newValue) => {
-        setValue(newValue);
-      };
-
-
-    return (
-
-               <Stack spacing={2}>
-                 <Box>
-                 <HotTable 
-                 nestedRows={true}
-                    data={detail
-                    }
-
-                 afterSelection={(row, column)=>{
-                        selectedRow.current = row;
-                        console.log(row);
-                        let bt = "Djcs" ;
-                        let selected = hotRef.current?.hotInstance?.getData()[row];
-                        if (selected[0] != null) {
-                             Service.generateQingdanrcj(name, bh,bt,selected[1]).then(x=>{
-                                 setRcjhl(x);
-                                 isQdrcj.current=true;
-                                 setHighlight([]);
-                               });
-                               Service.generateQingdanTuijian(name, bh,bt,selected[1]).then(x=>{
-                                   setTuijian(x);
-                                   //isQdrcj.current = true;
-                                   //setHighlight([]);
-                                });
-                        }else{
-                            let qdbm = null;
-                            for (let i = row - 1;  i > -1; i= i - 1) {
-                                let above = hotRef.current?.hotInstance?.getData()[i];
-                                if (above[0] != null) {
-                                    qdbm = above[1];
-                                    break;
-                                }
-                                 
-                            }
-                             clickCallback(qdbm, selected[1]);
-                             Service.generateDingercj(name, bh,bt,qdbm, selected[1]).then(x=>{
-                               setRcjhl(x);
-                               isQdrcj.current = false;
-                               
-                               let toHighlight = [];
-                               for(let i = 1; i < x.length; i++) {
-                                   let entry = x[i];
-                                   let bianhao = entry[1];
-                                   let rcjlb = entry[8];
-                                   if (Number(rcjlb) == 1 &&  rgdeRef.current  ) {
-                                      for (let j = 0;j < rgdeRef.current.length; j++) {
-                                         if (rgdeRef.current[j]["CLBH"] == bianhao) {
-                                              let danjia = Number(entry[5]);
-                                              if (danjia != rgdeRef.current[j]["YSJG"]) {
-                                                   console.log(`[${i},5]danjia bu yizhi`);
-                                                   toHighlight.push({row: i, col: 5, renderer: "customStylesRenderer"});
-                                              }
-                                              let hanliang = Number(entry[10]);
-                                              if (hanliang != rgdeRef.current[j]["gr"]) {
-                                                   console.log(`[${i}, 10]hanliang bu yizhi`);
-                                                   toHighlight.push({row: i, col: 10, renderer: "customStylesRenderer"});
-                                              }
-                                         }
-                                      }
-
-                                   }   
-                                   if (Number(rcjlb) == 3 && jxdeRef.current  ) {
-                                      for (let j = 0; j < jxdeRef.current.length; j++) {
-                                         if (jxdeRef.current[j]["jxbh"] == bianhao) {
-                                               let danjia = Number(entry[5]);
-                                               if (danjia != jxdeRef.current[j]["tbdj"]) {
-                                                    console.log(`[${i},5]danjia bu yizhi`);
-                                                    toHighlight.push({row: i, col: 5, renderer: "customStylesRenderer"});
-                                               }
-                                               let hanliang = Number(entry[10]);
-                                               if (hanliang != jxdeRef.current[j]["sl"]) {
-                                                    console.log(`[${i}, 10]hanliang bu yizhi`);
-                                                    toHighlight.push({row: i, col: 10, renderer: "customStylesRenderer"});
-                                               }
-                                         }
-                                      }
-
-                                   }   
-                                   if (Number(rcjlb) == 2 && cldeRef.current  ) {
-                                      for (let j = 0; j < cldeRef.current.length; j++) {
-                                         if (cldeRef.current[j]["CLBH"] == bianhao) {
-                                               let danjia = Number(entry[5]);
-                                               if (danjia != cldeRef.current[j]["YSJG"]) {
-                                                    console.log(`[${i},5]danjia bu yizhi`);
-                                                    toHighlight.push({row: i, col: 5, renderer: "customStylesRenderer"});
-                                               }
-                                               let hanliang = Number(entry[10]);
-                                               if (hanliang != cldeRef.current[j]["SL"]) {
-                                                    console.log(`[${i}, 10]hanliang bu yizhi`);
-                                                    toHighlight.push({row: i, col: 10, renderer: "customStylesRenderer"});
-                                               }
-                                         }
-                                      }
-
-                                   }   
-                               }
-                               setHighlight(toHighlight);
-                             });
-
-                        }
-                            
-
-                    }}
-                    cells={(row, col, prop) => {
-                         if (row == selectedRow.current) {
-                           return {
-                             // row options, which apply to each cell of the second row
-                             // and to each cell of the fifth row
-                             renderer: "highlightRowRenderer"
-                           };
-                         }
-                       }
-                    }
-                    ref = {hotRef}
-                    contextMenu={true}
-                    bindRowsWithHeaders={true}
-                    fixedRowsTop={0}
-                    fixedColumnsStart={2}
-                    manualColumnResize={true}
-                    rowHeaders={true}
-                    colHeaders={["ID", "序号", "清单编码", "名称", "项目特征", "计算规则", "单位", "数量", "综合单价", "合价", "人工费", "主材费", "设备费", "辅材费", "材料费", "机械费", "管理费", "利润" , "暂估价", "综合人工工日" ]}
-                    height="400"
-                    selectionMode="single"
-                    autoWrapRow={false}
-                    autoWrapCol={false}
-                    readOnly={true}
-                    licenseKey="non-commercial-and-evaluation" // for non-commercial use only
-                  />
-                  </Box>
-                   <Box >
-                   
-                   <TabContext value={value}>
-                       <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
-                         <TabList onChange={handleChange} aria-label="lab API tabs example">
-                           <Tab label="人材机含量" value="1" />
-                           <Tab label="标准定额人材机含量" value="2" />
-                           <Tab label="定额附注" value="3" />
-                           <Tab label="组价推荐" value="4" />
-                         </TabList>
-                       </Box>
-                       <TabPanel value="1">
-                          <HotTable 
-                          nestedRows={false}
-                             data={rcjhl
-                             }
-                             cell={highlight}
-                             manualColumnResize={true}
-                             rowHeaders={true}
-                             colHeaders={true}
-                             height="300"
-                             readOnly={true}
-                             fixedRowsTop={1}
-                             selectionMode="single"
-                             autoWrapRow={false}
-                             autoWrapCol={false}
-                             licenseKey="non-commercial-and-evaluation" // for non-commercial use only
-                           />
-
-                       </TabPanel>
-                       <TabPanel value="2">
-                          <HotTable 
-                          nestedRows={false}
-                             data={rcjhl2
-                             }
-                             manualColumnResize={true}
-                             rowHeaders={true}
-                             colHeaders={true}
-                             height="300"
-                             readOnly={true}
-                             fixedRowsTop={1}
-                             selectionMode="single"
-                             autoWrapRow={false}
-                             autoWrapCol={false}
-                             licenseKey="non-commercial-and-evaluation" // for non-commercial use only
-                           />
-
-                       </TabPanel>
-                       <TabPanel value="3">
-                          <HotTable 
-                          nestedRows={false}
-                             data={fuzhu
-                             }
-                             manualColumnResize={true}
-                             rowHeaders={true}
-                             colHeaders={true}
-                             height="300"
-                             readOnly={true}
-                             fixedRowsTop={1}
-                             selectionMode="single"
-                             autoWrapRow={false}
-                             autoWrapCol={false}
-                             licenseKey="non-commercial-and-evaluation" // for non-commercial use only
-                           />
-
-                       </TabPanel>
-
-                       <TabPanel value="4">
-                          <HotTable 
-                          nestedRows={false}
-                             data={tuijian
-                             }
-                             manualColumnResize={true}
-                             rowHeaders={true}
-                             colHeaders={true}
-                             height="300"
-                             readOnly={true}
-                             fixedRowsTop={1}
-                             selectionMode="single"
-                             autoWrapRow={false}
-                             autoWrapCol={false}
-                             licenseKey="non-commercial-and-evaluation" // for non-commercial use only
-                           />
-
-                       </TabPanel>
-                     </TabContext>
-                  </Box>
-
-                  </Stack>
-
-
-
-    );
-}

+ 0 - 769
front/src/Djcs2.js

@@ -1,769 +0,0 @@
-import * as React from 'react';
-import Box from "@mui/material/Box";
-import 'handsontable/dist/handsontable.full.min.css';
-//import 'handsontable/styles/ht-theme-main.min.css';
-import { HandsonTable } from 'handsontable/base';
-import {HotTable} from "@handsontable/react";
-//import { registerAllModules } from 'handsontable/registry';
-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";
-import TabList from "@mui/lab/TabList";
-import TabPanel from "@mui/lab/TabPanel";
-import Stack from "@mui/material/Stack";
-//import { registerPlugin, NestedRows } from 'handsontable/plugins';
-//registerPlugin(NestedRows);
-import Service from './Service';
-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 { DataGrid } from '@mui/x-data-grid';
-import {extractFuzhu, match_target} from './utils';
-import Button from '@mui/material/Button';
-import {shanchu_djcs, undo_djcs, redo_djcs, danxiangdinge_djcs, updateDercj_djcs, changguidinge_djcs, handleBeizhu_djcs, huan, updateShuliang_djcs} from './editor';
-
-import { textRenderer, registerRenderer } from 'handsontable/renderers';
-
-import { Table, ConfigProvider, Button as AButton } from "antd";
-
-import zhCN from 'antd/locale/zh_CN';
-
-
-function number_equal(a, b) {
-     if (Number(a) - Number(b) < 0.0001 && Number(a) - Number(b) > -0.0001) {
-          return true;
-     }
-     return false;
-}
-export default function Djcs2({name, bh, rgde, jxde, clde, beizhu, beizhuFK, clickCallback, loadingCallback, dingeclick}) {
-     const lastClickRef = React.useRef(null);
-
-     const afterOnCellMouseDown = (event, coord, TD) => {
-          
-          if (lastClickRef.current == null) {
-               lastClickRef.current = Date.now();
-          } else {
-               let origin = lastClickRef.current;
-               lastClickRef.current = Date.now();
-               let delta = lastClickRef.current - origin;
-               if (delta < 300 && coord.col == 1 && coord.row > 0 && !isQdrcj.current){//300 ms -> 换
-                   //tihuanCallback(coord.row, coord.col);
-               }
-          }
-        };
-     var editCheck = function(cell){
-          //cell - the cell component for the editable cell
-      
-          //get row data
-          //console.log(cell);
-          if(cell._cell.row.data['序号']) return false;
-          return true;
-      }
-
-
-     function handleSelect(row){
-          //e - the click event object
-          //cell - cell component
-          console.log('rowSelected');
-          selectedRowKeysTable.current = [row._row['data']['key']];
-          let bt = "Djcs" ;
-          
-          if (row._row.data['序号'] != null && row._row.data['序号'].length >0) {
-               selectedRowKeysTableParent.current = row._row['data']['key'];
-
-               setFuzhu([]);
-               Service.generateQingdanrcj(name, bh,bt,row._row.data['清单编码']).then(x=>{
-                    setRcjhl(x);
-                    isQdrcj.current=true;
-                    highlight.current = [];
-               });
-               Service.generateQingdanTuijian(name, bh,bt,row._row.data['清单编码']).then(x=>{
-                    setTuijian(x);
-                    if (tuijianTable.current) tuijianTable.current.replaceData(x);
-               });
-          } else {
-               
-               let row_parent = row._row;
-               while(row_parent.modules.dataTree.parent) {
-                   row_parent = row_parent.modules.dataTree.parent;
-               }
-               debmRef.current = row._row['data']['清单编码'];
-               selectedRowKeysTableParent.current = row_parent['data']['key'];
-
-
-                             clickCallback(row_parent['data']['清单编码'], row._row['data']['清单编码']);
-                             Service.generateDingercj(name, bh,bt,row_parent['data']['清单编码'], row._row['data']['清单编码']).then(x=>{
-                               setRcjhl(x[0]);
-                               isQdrcj.current = false;
-                               setFuzhuEnable(x[1]);
-                               let toHighlight = [];
-                               for(let i = 1; i < x[0].length; i++) {
-                                   let entry = x[0][i];
-                                   let bianhao = entry[1];
-                                   let rcjlb = entry[8];
-                                   if (Number(rcjlb) == 1 &&  rgdeRef.current  ) {
-                                      for (let j = 0;j < rgdeRef.current.length; j++) {
-                                         if (rgdeRef.current[j]["CLBH"] == bianhao) {
-                                              let danjia = Number(entry[5]);
-                                              if (!number_equal(danjia , rgdeRef.current[j]["YSJG"])) {
-                                                   console.log(`[${i},5]danjia bu yizhi`);
-                                                   toHighlight.push({row: i, col: 5, });
-                                              }
-                                              let hanliang = Number(entry[10]);
-                                              if (!number_equal(hanliang , rgdeRef.current[j]["gr"])) {
-                                                   console.log(`[${i}, 10]hanliang bu yizhi`);
-                                                   toHighlight.push({row: i, col: 10, });
-                                              }
-                                         }
-                                      }
-
-                                   }   
-                                   if (Number(rcjlb) == 3 && jxdeRef.current  ) {
-                                      for (let j = 0; j < jxdeRef.current.length; j++) {
-                                         if (jxdeRef.current[j]["jxbh"] == bianhao) {
-                                               let danjia = Number(entry[5]);
-                                               if (!number_equal(danjia , jxdeRef.current[j]["tbdj"])) {
-                                                    console.log(`[${i},5]danjia bu yizhi`);
-                                                    toHighlight.push({row: i, col: 5, });
-                                               }
-                                               let hanliang = Number(entry[10]);
-                                               if (!number_equal(hanliang , jxdeRef.current[j]["sl"])) {
-                                                    console.log(`[${i}, 10]hanliang bu yizhi`);
-                                                    toHighlight.push({row: i, col: 10, });
-                                               }
-                                         }
-                                      }
-
-                                   }   
-                                   if (Number(rcjlb) == 2 && cldeRef.current  ) {
-                                      for (let j = 0; j < cldeRef.current.length; j++) {
-                                         if (cldeRef.current[j]["CLBH"] == bianhao) {
-                                               let danjia = Number(entry[5]);
-                                               if (!number_equal(danjia , cldeRef.current[j]["YSJG"])) {
-                                                    console.log(`[${i},5]danjia bu yizhi`);
-                                                    toHighlight.push({row: i, col: 5, });
-                                               }
-                                               let hanliang = Number(entry[10]);
-                                               if (!number_equal(hanliang , cldeRef.current[j]["SL"])) {
-                                                    console.log(`[${i}, 10]hanliang bu yizhi`);
-                                                    toHighlight.push({row: i, col: 10, });
-                                               }
-                                         }
-                                      }
-
-                                   }   
-                               }
-                               highlight.current = toHighlight;
-                             });
-          }
-     }
-     
-    registerRenderer('customStylesRenderer', (hotInstance, TD, row, column,  prop, value, ...rest) => {
-         let newValue = value; 
-          if ((column == 11 || column == 5) && row > 0) {
-            newValue = Number(value).toFixed(2).toString();
-         }
-         if (column == 10 && row > 0) {
-          newValue = Number(value).toFixed(4).toString();
-         }
-         textRenderer(hotInstance, TD, row, column, prop, newValue, ...rest);
-         for (let i = 0; i < highlight.current.length; i++) {
-          let entry = highlight.current[i];
-          if (entry.row == row && entry.col == column) {
-               TD.style.fontWeight = 'bold';
-               TD.style.color = 'green';
-               TD.style.background = '#d7f1e1';
-          }
-         }
-       });
-
-       
-    const [detail, setDetail] = React.useState([
-                    
-    ]);
-    const hotRcjRef = React.useRef(null);
-    const myRef = React.useRef(null);
-    const myTable = React.useRef(null);
-    const tuijianRef = React.useRef(null);
-    const tuijianTable = React.useRef(null);
-    const rcj2Ref = React.useRef(null);
-    const rcj2Table = React.useRef(null);
-    const [value, setValue] = React.useState("1");
-    const [rcjhl, setRcjhl] = React.useState([]);
-    const [rcjhl2, setRcjhl2] = React.useState([]);
-    const [fuzhu, setFuzhu] = React.useState([]);
-    const [tuijian, setTuijian] = React.useState([]);
-    const beizhuFKRef = React.useRef(null);
-
-    const [fuzhuEnable, setFuzhuEnable] = React.useState(false);
-
-   const [selectedRowKeys, setSelectedRowKeys] = React.useState([]);
-   const onSelectChange = (newSelectedRowKeys) => {
-     console.log('selectedRowKeys changed: ', newSelectedRowKeys);
-     setSelectedRowKeys(newSelectedRowKeys);
-     const [newData, newHl] = handleBeizhu_djcs(beizhuFKRef.current, selectedRowKeysTable.current[0], newSelectedRowKeys, fuzhu);
-                                  if (newData) {
-                                     myTable.current.updateData(newData.filter(x=>x['key'] == selectedRowKeysTableParent.current));
-                                     setRcjhl(newHl);
-
-                                  }
-   };
-   const rowSelection = {
-     selectedRowKeys,
-     onChange: onSelectChange,
-     getCheckboxProps: (record) => {
-          return {
-               disabled: !fuzhuEnable
-          };
-     }
-   };
-    const highlight = React.useRef([]);
-
-    
-    const rgdeRef = React.useRef(null);
-    const jxdeRef = React.useRef(null);
-    const cldeRef = React.useRef(null);
-    const isQdrcj = React.useRef(false);
-    const debmRef = React.useRef(null);
-    const selectedRowKeysTable = React.useRef([]);
-    const selectedRowKeysTableParent = React.useRef(null);
-    const afterChange = (changes, source) => {
-     if (changes == null || changes.every(x=>x[2] == x[3])) {
-
-     } else {
-          let data =  hotRcjRef.current?.hotInstance?.getData();
-          for(let i = 1; i < data.length; i++) {
-               data[i][11] = Number(data[i][10]) * Number(data[i][5]);
-           }
-           setRcjhl(data);
-     
-          let newData = updateDercj_djcs(selectedRowKeysTable.current[0], data);
-          myTable.current.updateData(newData.filter(x=>x['key'] == selectedRowKeysTableParent.current)).then(function() {
-               let getRow = myTable.current.getRows(); //get array of currently selected row components.
-               let component = null;
-               for(let i = 0; i < getRow.length; i++) {
-                    let entry = getRow[i]._row.modules.dataTree.children;
-                    for(let j = 0; j < entry.length; j++) {
-                         let child = entry[j];
-                         if(child.data['key'] == selectedRowKeysTable.current[0]) {
-                              //console.log(child);
-                              component = child.component;
-                              break;
-                         }
-                         
-                    }
-
-               }
-               
-               handleSelect(component);
-          });
-          
-          
-     }
-   };
-
-    React.useEffect(() => {
-     myTable.current = new Tabulator(myRef.current, {
-          index: "key",
-          height: 380,
-        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:80, headerSort:false, frozen: true}, //never hide this column
-                     {title:"清单编码", field:"清单编码", width:120,headerSort:false, frozen: true, formatter:"textarea" },
-                     {title:"名称", field:"名称", width:150, headerSort:false, formatter:"textarea"}, //hide this column first
-                     {title:"项目特征", field:"项目特征", width:150 , headerSort:false, formatter:"textarea"},
-                     {title:"计算规则", field:"计算规则", width:150, headerSort:false, formatter:"textarea"},
-                     {title:"单位", field:"单位", width:100, headerSort:false},
-                     {title:"数量", field:"数量", width:100, headerSort:false, editor: "input", editable: editCheck },
-                     {title:"综合单价", field:"综合单价", width:100, headerSort:false, formatter:"money"},
-                     {title:"合价", field:"合价", width:100, headerSort:false, formatter:"money"},
-                     {title:"人工费", field:"人工费", width:100, headerSort:false, formatter:"money"},
-                     {title:"主材费", field:"主材费", width:100, headerSort:false, formatter:"money"},
-                     {title:"设备费", field:"设备费", width:100, headerSort:false, formatter:"money"},
-                     {title:"辅材费", field:"辅材费", width:100, headerSort:false, formatter:"money"},
-                     {title:"材料费", field:"材料费", width:100, headerSort:false, formatter:"money"},
-                     {title:"机械费", field:"机械费", width:100, headerSort:false, formatter:"money"},
-                     {title:"管理费", field:"管理费", width:100, headerSort:false, formatter:"money"},
-                     {title:"利润", field:"利润", width:100, headerSort:false, formatter:"money"},
-                     {title:"暂估价", field:"暂估价", width:100, headerSort:false, formatter:"money"},
-                     {title:"综合人工工日", field:"综合人工工日", width:100, headerSort:false},
-             ]
-      }); 
-      
-      myTable.current.on("cellDblClick", function(e, cell){
-          //e - the click event object
-          //cell - cell component
-          console.log(cell);
-      });
-
-      myTable.current.on("rowSelected", handleSelect);
-      
-
-      myTable.current.on("cellEdited", function(cell){
-          //console.log("edited");
-          //console.log();
-          let key = cell._cell.row.data['key'];
-          myTable.current.deselectRow();
-          let [success, data] = updateShuliang_djcs(cell._cell.row.data['数量'], selectedRowKeysTable.current[0]);
-          if (success) {
-                           myTable.current.updateData(data.filter(x=>x['key'] == selectedRowKeysTableParent.current)).then(function() {
-                              let getRow = myTable.current.getRows(); //get array of currently selected row components.
-                              let component = null;
-                              for(let i = 0; i < getRow.length; i++) {
-                                   let entry = getRow[i]._row.modules.dataTree.children;
-                                   for(let j = 0; j < entry.length; j++) {
-                                        let child = entry[j];
-                                        if(child.data['key'] == key) {
-                                             //console.log(child);
-                                             component = child.component;
-                                             break;
-                                        }
-                                        
-                                   }
-
-                              }
-                              component.select();
-                              handleSelect(component);
-                              //handleSelect(getRow[0]);
-                           });                            
-                                                       
-          }
-      });
-
-
-      myTable.current.on("tableBuilt", () => {
-          Service.generateDjcs(name, bh).then(x=>{
-               myTable.current.replaceData(x);
-               });
-        });
-
-        
-    
-   }, [bh]);
-
-
-   React.useEffect(
-     () => {
-          beizhuFKRef.current = beizhuFK;
-     }, [beizhuFK]
-   );
- 
-    React.useEffect(
-        () => {
-            console.log(beizhu);
-            let result = [];
-            if (beizhu != null) { 
-                let keys = Object.keys(beizhu["BZBH"]);
-                for(let i = 0; i < keys.length; i++) {
-                    let key = keys[i];
-                    result.push({'key': i+1, '序号': i+1, '编号': beizhu["BZBH"][key], '说明': beizhu["SM"][key]});//序号很重要
-                }
-                setFuzhu(result);
-                let newSelect = extractFuzhu(debmRef.current);
-                setSelectedRowKeys(newSelect);
-                //setSelectedRowKeys([1]);
-                
-            }
-        }, [beizhu]
-      );
-
-      React.useEffect(
-          () => {
-               if (tuijianRef.current != null ) {
-               tuijianTable.current = new Tabulator(tuijianRef.current, {
-                    index: "key",
-                    height: 200,
-                  data: tuijian, //link data to table
-                  reactiveData: false, //enable data reactivity
-                  dataTreeStartExpanded:false,
-                  dataTree: false,
-                  selectableRows:1, //make rows selectable
-                  
-                  
-                  columns: [ //Define Table Columns
-                               {title:"ID", field:"ID", width:80, headerSort:false, }, //never hide this column
-                               {title:"定额编号", field:"定额编号", width:120,headerSort:false,  formatter:"textarea" },
-                               {title:"工程量名称", field:"工程量名称", width:150, headerSort:false, formatter:"textarea"}, //hide this column first
-                               {title:"工作内容", field:"工作内容", width:150 , headerSort:false, formatter:"textarea"},
-                             
-                       ]
-               });
-               tuijianTable.current.on("tableBuilt", () => {
-                    
-                    tuijianTable.current.replaceData(tuijian);
-                         
-                  });
-               }
-               if (rcj2Ref.current != null ) {
-                    rcj2Table.current = new Tabulator(rcj2Ref.current, {
-                         index: "key",
-                         height: 200,
-                       data: rcjhl2, //link data to table
-                       reactiveData: false, //enable data reactivity
-                       dataTreeStartExpanded:false,
-                       dataTree: false,
-                       selectableRows:1, //make rows selectable
-                       
-                       
-                       columns: [ //Define Table Columns
-                                    {title:"人材机编码", field:"人材机编码", width:80, headerSort:false, }, //never hide this column
-                                    {title:"名称", field:"名称", width:120,headerSort:false,  formatter:"textarea" },
-                                    {title:"单位", field:"单位", width:150, headerSort:false, formatter:"textarea"}, //hide this column first
-                                    {title:"单价", field:"单价", width:150 , headerSort:false, formatter:"money"},
-                                    {title:"合价", field:"合价", width:150 , headerSort:false, formatter:"money"},
-                                    {title:"含量", field:"含量", width:150 , headerSort:false, formatter:"textarea"},
-                                  
-                            ]
-                    });
-                    rcj2Table.current.on("tableBuilt", () => {
-                         
-                         rcj2Table.current.replaceData(rcjhl2);
-                              
-                       });
-                    }
-          }, [value]
-        );
-
-
-
-      React.useEffect(
-          () => {
-               myTable.current.deselectRow();
-               //console.log(dingeclick);
-               if (selectedRowKeysTable.current.length > 0 ) {
-                    const [success, data, key] = changguidinge_djcs(JSON.parse(dingeclick), selectedRowKeysTable.current[0]);
-                    if (success) {
-                         myTable.current.updateData(data.filter(x=>x['key'] == selectedRowKeysTableParent.current)).then(function(){
-                              let getRow = myTable.current.getRows(); //get array of currently selected row components.
-                              let component = null;
-                              for(let i = 0; i < getRow.length; i++) {
-                                   let entry = getRow[i]._row.modules.dataTree.children;
-                                   for(let j = 0; j < entry.length; j++) {
-                                        let child = entry[j];
-                                        if(child.data['key'] == key) {
-                                             //console.log(child);
-                                             component = child.component;
-                                             break;
-                                        }
-                                        
-                                   }
-
-                              }
-                              
-                              component.select();
-                              handleSelect(component);
-
-                                   
-                               
-                          });
-                    }
-               }
-               
-          }, [dingeclick]//常规添加定额
-      );
-
-    React.useEffect(
-        () => {
-          console.log("rgde changed");
-          console.log(rgde);
-          rgdeRef.current = rgde;
-          jxdeRef.current = jxde;
-          cldeRef.current = clde;
-          if (isQdrcj.current) {
-             highlight.current = [];
-          } else {
-          let toHighlight = [];
-          for(let i = 1; i < rcjhl.length; i++) {
-              let entry = rcjhl[i];
-              let bianhao = entry[1];
-              let rcjlb = entry[8];
-              if (Number(rcjlb) == Number(1) && rgde) {
-                  for (let j = 0; j < rgde.length; j++) {
-                      if (rgde[j]["CLBH"] == bianhao) {
-                          let danjia = Number(entry[5]);
-                          if (!number_equal(danjia , rgde[j]["YSJG"])) {
-                               console.log(`[${i},5]danjia bu yizhi`);
-                               toHighlight.push({row: i, col: 5});
-                          }
-                          let hanliang = Number(entry[10]);
-                          if (!number_equal(hanliang , rgde[j]["gr"])) {
-                               console.log(`[${i}, 10]hanliang bu yizhi`);
-                               toHighlight.push({row: i, col: 10});
-                          }
-
-                      }              
-                  }
-
-              }   
-              if (Number(rcjlb) == Number(3) && jxde ) {
-                   for (let j = 0; j < jxde.length; j++) {
-                      if (jxde[j]["jxbh"] == bianhao) {
-                         let danjia = Number(entry[5]);
-                         if (!number_equal(danjia , jxde[j]["tbdj"])) {
-                              console.log(`[${i},5]danjia bu yizhi`);
-                              toHighlight.push({row: i, col: 5, });
-                         }
-                         let hanliang = Number(entry[10]);
-                         if (!number_equal(hanliang , jxde[j]["sl"])) {
-                              console.log(`[${i}, 10]hanliang bu yizhi`);
-                              toHighlight.push({row: i, col: 10, });
-                         }
-                      }
-                   }
-
-              }   
-              if (Number(rcjlb) == Number(2) && clde ) {
-                   for (let j = 0; j < clde.length; j++) {
-                      if (clde[j]["CLBH"] == bianhao) {
-                         let danjia = Number(entry[5]);
-                         if (!number_equal(danjia , clde[j]["YSJG"])) {
-                              console.log(`[${i},5]danjia bu yizhi`);
-                              toHighlight.push({row: i, col: 5, });
-                         }
-                         let hanliang = Number(entry[10]);
-                         if (!number_equal(hanliang ,clde[j]["SL"])) {
-                              console.log(`[${i}, 10]hanliang bu yizhi`);
-                              toHighlight.push({row: i, col: 10, });
-                         }
-                      }
-                   }
-
-              }   
-          }
-          console.log(toHighlight);
-          highlight.current = toHighlight;
-          }
-
-
-          let bzrcjhl = [] 
-          if (rgde)
-          for (let i = 0; i  < rgde.length; i++) {
-               bzrcjhl.push({'人材机编码': rgde[i]["CLBH"], '名称': rgde[i]["CLMC"], '单位': rgde[i]["JLDW"], '单价': rgde[i]["YSJG"], '合价': rgde[i]["gf"], '含量': rgde[i]["gr"]});
-          }
-          
-          if (clde)
-          for (let i = 0; i  < clde.length; i++) {
-               bzrcjhl.push({'人材机编码': clde[i]["CLBH"], '名称': clde[i]["CLMC"], '单位': clde[i]["JLDW"], '单价': clde[i]["YSJG"], '合价': clde[i]["HJ"], '含量': clde[i]["SL"]});
-          }
-          if (jxde)
-          for (let i = 0; i  < jxde.length; i++) {
-               bzrcjhl.push({'人材机编码': jxde[i]["jxbh"], '名称': jxde[i]["jxmc"], '单位': jxde[i]["DW"], '单价': jxde[i]["tbdj"], '合价': jxde[i]["hj"], '含量': jxde[i]["sl"]});
-          }
-          setRcjhl2(bzrcjhl);
-          if (rcj2Table.current) {
-               rcj2Table.current.replaceData(bzrcjhl);
-          }
-        }, [rgde, jxde, clde]
-      );
-
-      const handleChange = (event, newValue) => {
-        setValue(newValue);
-      };
-
-
-    return (
-
-               <Stack spacing={1}>
-                         <Stack direction='row' spacing={2}>
-                   <Button variant="outlined" size="small" onClick={() => {
-                      if (selectedRowKeysTable.current.length > 0) {
-                         const [success, data] = danxiangdinge_djcs(selectedRowKeysTable.current[0]);
-                         if(success) {
-                            myTable.current.updateData(data.filter(x=>x['key'] == selectedRowKeysTableParent.current)).then(function(){
-                              selectedRowKeysTable.current = [];
-                              selectedRowKeysTableParent.current = null;
-                                   setRcjhl([]);
-                                   setFuzhu([]);
-                                   isQdrcj.current = true;
-                                   highlight.current = [];
-                            });
-                            //console.log(data);
-                         }
-                      }
-                 
-                      
-                      }}
-                   >单项定额</Button>
-                      <Button variant="outlined" size="small" onClick={() => {
-                      if (selectedRowKeysTable.current.length > 0) {
-                          let newData = shanchu_djcs(selectedRowKeysTable.current[0]);
-                          myTable.current.updateData(newData.filter(x=>x['key'] == selectedRowKeysTableParent.current)).then(function(){
-                              if (newData.filter(x=>x['key'] == selectedRowKeysTable.current[0]).length == 0) {
-                                   selectedRowKeysTable.current = [];
-                                   selectedRowKeysTableParent.current = [];
-                                   setRcjhl([]);
-                                   setFuzhu([]);
-                                   isQdrcj.current = true;
-                                   highlight.current = [];
-                               }
-                          });
-                          
-                          
-                          
-                      }
-                      
-                 
-                      
-                      }}
-                   >删除</Button>
-                   <Button variant="outlined" size="small" onClick={() => {
-                      let newData = undo_djcs();
-                      myTable.current.updateData(newData).then(function(){
-                         
-                            selectedRowKeysTable.current = [];
-                            selectedRowKeysTableParent.current = null;
-                            setRcjhl([]);
-                            setFuzhu([]);
-                            isQdrcj.current = true;
-                            highlight.current = [];
-                            
-                        
-                      });
-                     
-                      
-                      }}
-                   >撤销</Button>
-                   <Button variant="outlined" size="small" onClick={() => {
-                      let newData = redo_djcs();
-                      myTable.current.updateData(newData).then(function(){
-                         selectedRowKeysTable.current = [];
-                         selectedRowKeysTableParent.current = null;
-
-                            setRcjhl([]);
-                            setFuzhu([]);
-                            isQdrcj.current = true;
-                            highlight.current = [];
-                      });
-                      
-                      
-                      
-                      }}
-                   >重做</Button>
-                   <Button variant="outlined" size="small" onClick={() => {
-                            console.log("save to cloud");
-                            loadingCallback();
-                      
-                      }}
-                   >保存</Button>
-
-                  
-                   </Stack>
-                 <div ref={myRef}> 
-                  </div>
-                   <Box >
-                   
-                   <TabContext value={value}>
-                       <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
-                         <TabList onChange={handleChange} aria-label="lab API tabs example"  sx={{minHeight: '24px'}}   >
-                           <Tab sx={{p: 0, minHeight: '24px'}} label="人材机含量" value="1" />
-                           <Tab sx={{p: 0, minHeight: '24px'}} label="标准定额人材机含量" value="2" />
-                           <Tab sx={{p: 0, minHeight: '24px'}} label="定额附注" value="3" />
-                           <Tab sx={{p: 0, minHeight: '24px'}} label="组价推荐" value="4" />
-                         </TabList>
-                       </Box>
-                       <TabPanel value="1">
-                          <HotTable 
-                          nestedRows={false}
-                             data={rcjhl
-                             }
-                             cells={(row, col) => {
-                              if (isQdrcj.current) return {readOnly: true, renderer: "customStylesRenderer"};
-                              if (col == 8) {
-                                   return { readOnly: true, renderer: "customStylesRenderer" };
-                              }
-                              if (col <= 1 || col >= 11) {
-                                  return { readOnly: true, renderer: "customStylesRenderer" };
-                              } else if (row == 0){
-                                   return { readOnly: true, renderer: "customStylesRenderer" };
-                              } else {
-                                   return { readOnly: false, renderer: "customStylesRenderer" };
-                              }
-                              
-                            }}
-                             afterChange={afterChange}
-                             ref = {hotRcjRef}
-                             manualColumnResize={true}
-                             rowHeaders={true}
-                             colHeaders={true}
-                             height="200"
-                             afterOnCellMouseDown={afterOnCellMouseDown}
-                             readOnly={true}
-                             fixedRowsTop={1}
-                             selectionMode="single"
-                             autoWrapRow={false}
-                             autoWrapCol={false}
-                             licenseKey="non-commercial-and-evaluation" // for non-commercial use only
-                           />
-
-                       </TabPanel>
-                       <TabPanel value="2">
-                       <div ref={rcj2Ref}></div>
-
-                       </TabPanel>
-                       <TabPanel value="3">
-                       <Box sx={{maxHeight: `200px`}}>
-                       <ConfigProvider
-                          locale={zhCN}
-                          theme={{
-                            components: {
-                              Table: {
-                                 /* here is your component tokens */
-                                 cellPaddingBlock : 8
-                              },
-                            },
-                          }}
-                        >
-
-                          <Table 
-                             scroll={{ x: 'max-content' , y : 200}}
-                             pagination={false}
-                             rowSelection={rowSelection}
-                             columns={
-                              [
-                                   { title: '序号', dataIndex: '序号', width : 80},
-                                   {
-                                        title: '编号',
-                                        dataIndex: '编号',
-                                     
-                                   },
-                                   {
-                                        title: '说明',
-                                        dataIndex: '说明',
-                                     width: 550
-                                    
-                                   },
-                                  
-                                 ]
-                             }
-                           dataSource={fuzhu} />
-
-                        </ConfigProvider>
-                       </Box>
-                      
-
-                       </TabPanel>
-
-                       <TabPanel value="4">
-                          <div ref={tuijianRef}></div>
-
-                       </TabPanel>
-                     </TabContext>
-                  </Box>
-
-                  </Stack>
-
-
-
-    );
-}

+ 0 - 2
front/src/Editable.js

@@ -7,8 +7,6 @@ import TabContext from "@mui/lab/TabContext";
 import TabList from "@mui/lab/TabList";
 import TabPanel from "@mui/lab/TabPanel";
 //registerPlugin(NestedRows);
-import Zjcs from './Zjcs';
-import Djcs from './Djcs';
 import Service from './Service';
 import {useLocation} from "react-router";
 import ExpandMoreIcon from '@mui/icons-material/ExpandMore';

+ 0 - 2
front/src/EditableSelect.js

@@ -7,8 +7,6 @@ import TabContext from "@mui/lab/TabContext";
 import TabList from "@mui/lab/TabList";
 import TabPanel from "@mui/lab/TabPanel";
 //registerPlugin(NestedRows);
-import Zjcs from './Zjcs';
-import Djcs from './Djcs';
 import Service from './Service';
 import {useLocation} from "react-router";
 import ExpandMoreIcon from '@mui/icons-material/ExpandMore';

+ 0 - 2
front/src/EditableSelectGC.js

@@ -7,8 +7,6 @@ import TabContext from "@mui/lab/TabContext";
 import TabList from "@mui/lab/TabList";
 import TabPanel from "@mui/lab/TabPanel";
 //registerPlugin(NestedRows);
-import Zjcs from './Zjcs';
-import Djcs from './Djcs';
 import Service from './Service';
 import {useLocation} from "react-router";
 import ExpandMoreIcon from '@mui/icons-material/ExpandMore';

+ 0 - 123
front/src/Home.js

@@ -1,123 +0,0 @@
-import * as React from 'react';
-import Box from "@mui/material/Box";
-import 'handsontable/dist/handsontable.full.min.css';
-//import 'handsontable/styles/ht-theme-main.min.css';
-import { HandsonTable } from 'handsontable/base';
-import {HotTable} from "@handsontable/react";
-//import { registerAllModules } from 'handsontable/registry';
-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";
-import TabList from "@mui/lab/TabList";
-import TabPanel from "@mui/lab/TabPanel";
-//import { registerPlugin, NestedRows } from 'handsontable/plugins';
-//registerPlugin(NestedRows);
-import { textRenderer, registerRenderer } from 'handsontable/renderers';
-import useWebSocket, { ReadyState } from 'react-use-websocket';
-
-import Zjcs from './Zjcs';
-import Djcs from './Djcs';
-import Service from './Service';
-import {useNavigate, useLocation} from "react-router";
-//registerAllModules();
-
-
-
-export default function Home() {
-
-  const { sendMessage, lastMessage, readyState } = useWebSocket('ws://127.0.0.1:8000/ws', {
-    shouldReconnect: (closeEvent) => true
-  });
-
-
-
-  function coverRenderer(_instance, td, _row, _col, _prop, value, _cellProperties) {
-     
-    
-         const button = document.createElement('button');
-         button.innerText="打开";
-         if (_col == 2) {
-          button.innerText="解析";
-         }
-         //img.src = value;
-         /*button.addEventListener('click', (event) => {
-              console.log(hotRef.current?.hotInstance?.getData()[selectedRow.current]);
-              hotRef.current?.hotInstance?.alter('remove_row', selectedRow.current, 1);
-              //console.log(plugin);
-             event.preventDefault();
-         });*/
-         button.addEventListener('mousedown', (event) => {
-          
-              
-              //console.log(plugin);
-             event.preventDefault();
-         });
-         td.innerText = '';
-         td.appendChild(button);
-    
-    
-
-    return td;
-  }
-
-
-    const hotRef = React.useRef(null);
-    const navigate = useNavigate();
-    let location = useLocation();
-    const [detail, setDetail] = React.useState([["File Name"]]);
-    React.useEffect(
-      () => {
-         Service.generateFiles().then(x=>{
-           setDetail(x);
-         });
-      }, []
-    );
-
-    React.useEffect(() => {
-      console.log(lastMessage);
-    }, [lastMessage]);
-
-    registerRenderer('highlightRowRenderer', (hotInstance, TD, row, column, ...rest) => {
-      
-           coverRenderer(hotInstance, TD, row, column, ...rest);
-      
-    });
-
-    return (
-
-            <HotTable nestedRows={false}
-                    data={detail
-                    }
-                    ref={hotRef}
-                    afterSelection={(row, column)=>{
-                      console.log(row);
-                      let selected = hotRef.current?.hotInstance?.getData()[row];
-                      console.log(selected[0]);
-                      if (column == 1) {
-                         //navigate("/qingdan", {state: {name: selected[0]}});
-                      } else {
-                         //sendMessage(selected[0]);
-                      }
-                      
-                    }}
-                    rowHeaders={true}
-                    colHeaders={false}
-                    height="800"
-                    readOnly={true}
-                    autoWrapRow={false}
-                    autoWrapCol={false}
-                    /*cells={(row, col, prop) => {
-                      if (col >= 1) {
-                        return {
-                          // row options, which apply to each cell of the second row
-                          // and to each cell of the fifth row
-                          renderer: "highlightRowRenderer"
-                        };
-                      }
-                    }
-                 }*/
-                    licenseKey="non-commercial-and-evaluation" // for non-commercial use only
-                  />
-    );
-  }

+ 0 - 914
front/src/Qingdan.js

@@ -1,914 +0,0 @@
-import * as React from 'react';
-import Box from "@mui/material/Box";
-import 'handsontable/dist/handsontable.full.min.css';
-//import 'handsontable/styles/ht-theme-main.min.css';
-import { HandsonTable } from 'handsontable/base';
-import { Table, ConfigProvider, Button as AButton } from "antd";
-import {HotTable} from "@handsontable/react-wrapper";
-import { registerAllModules } from 'handsontable/registry';
-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";
-import TabList from "@mui/lab/TabList";
-import TabPanel from "@mui/lab/TabPanel";
-import Stack from "@mui/material/Stack";
-//import { registerPlugin, NestedRows } from 'handsontable/plugins';
-//registerPlugin(NestedRows);
-import Service from './Service';
-import { textRenderer, registerRenderer } from 'handsontable/renderers';
-import Button from '@mui/material/Button';
-import ButtonGroup from '@mui/material/ButtonGroup';
-import {extractFuzhu} from './utils';
-import {shanchu, undo, redo, danxiangdinge, updateDercj, changguidinge, handleBeizhu, huan, updateShuliang} from './editor';
-import { ConfigValueTooSmallError, HyperFormula } from 'hyperformula';
-import Backdrop from '@mui/material/Backdrop';
-import CircularProgress from '@mui/material/CircularProgress';
-import { DataGrid } from '@mui/x-data-grid';
-import { useHotEditor } from "@handsontable/react-wrapper";
-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,
-
-   } from '@ant-design/icons';
-registerAllModules();
-
-
-/**
- * 
-本条规定了工程量清单编码的表示方式:十二位阿拉伯数字及其设置规定。
-各位数字的含义是:一、二位为专业工程代码(01—房屋建筑与装饰工程;02—仿古建筑工程;
-03—通用安装工程;04—市政工程;05—园林绿化工程;06—矿山工程;07—构筑物工程;08—城市
-轨道交通工程;09—爆破工程。以后进入国标的专业工程代码以此类推);三、四位为附录分类顺序码;
-五、六位为分部工程顺序码;七、八、九位为分项工程项目名称顺序码;十至十二位为清单项目名称
-顺序码。
- */
-
-
-
-
-
-
-
-
-export default function Qingdan({name, bh, bt, rgde, jxde, clde, beizhu/*后台传回来的附注信息,要整理后才能成为展示用的行*/ , beizhuFK, clickCallback, loadingCallback, dingeclick, tihuanCallback, tihuanClick}) {
-
-
-     
-
-     const hyperformulaInstance = HyperFormula.buildEmpty({
-          // to use an external HyperFormula instance,
-          // initialize it with the `'internal-use-in-handsontable'` license key
-          licenseKey: 'internal-use-in-handsontable',
-        });
-
-
-     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]);
-     }
-     
-
-
-
-
-     registerRenderer('customStylesRenderer', (hotInstance, TD, row, column, prop, value, ...rest) => {
-          let newValue = value; 
-          if ((column == 10 || column == 11 || column == 5) && row > 0) {
-            newValue = Number(value).toFixed(2).toString();
-         }
-          textRenderer(hotInstance, TD, row, column, prop, newValue, ...rest);
-         for (let i = 0; i < highlight.current.length; i++) {
-          let entry = highlight.current[i];
-          if (entry.row == row && entry.col == column) {
-               TD.style.fontWeight = 'bold';
-               TD.style.color = 'green';
-               TD.style.background = '#d7f1e1';
-          }
-         }
-         
-       });
-
-
-    const lastClickRef = React.useRef(null);
- 
-
-
-    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 [valueTab, setValueTab] = React.useState("1");
-    const [rcjhl, setRcjhl] = React.useState([]);
-    const [rcjhl2, setRcjhl2] = React.useState([]);
-    const [fuzhu, setFuzhu] = React.useState([]);//展示用的附注行
-    const [tuijian, setTuijian] = React.useState([]);
-    const [fuzhuEnable, setFuzhuEnable] = React.useState(false);
-    const highlight = React.useRef([]);
-    const selectedRow = React.useRef(-1);
-    const hotRef = React.useRef(null);
-    const detailRef = React.useRef(null);
-    const hotRcjRef = React.useRef(null);
-    const hotTuijianRef = React.useRef(null);
-    const rgdeRef = React.useRef(null);
-    const jxdeRef = React.useRef(null);
-    const cldeRef = React.useRef(null);
-    const isQdrcj = React.useRef(false);
-    const debmRef = React.useRef(null);
-    const beizhuFKRef = React.useRef(null);
-    const [selectedRowKeys, setSelectedRowKeys] = React.useState([]);
-    const [rowSelectionModel, setRowSelectionModel] = React.useState({
-     type: 'include',
-     belong: '',
-     ids: new Set(),
-   });
-    const [expandedRowKeys, setExpandedRowKeys] = React.useState([]);
-    const rowSelection = {
-     selectedRowKeys,
-     onChange: (selectedRowKeys) => {
-          //console.log(selectedRowKeys);
-          if (selectedRowKeys.length > 0) {
-               setExpandedRowKeys([selectedRowKeys.at(-1)]);
-          } else {
-          setSelectedRowKeys(selectedRowKeys);
-          //handleSelection(selectedRowKeys);
-          }
-     }
-     
-      
-     };
-    React.useEffect(
-        () => {
-          Service.generateQingdanmingxi(name, bh, bt).then(x=>{
-          //切换清单将重置缓存和操作栈
-            
-          setDetail(x);
-          detailRef.current = x;
-
-          setRcjhl([]);
-          setFuzhu([]);
-          selectedRow.current = -1;
-          });
-        }, [bh, bt]
-      );
-    React.useEffect(
-        () => {
-            //console.log(beizhu);
-            let result = [];
-            if (beizhu != null) { 
-                let keys = Object.keys(beizhu["BZBH"]);
-                for(let i = 0; i < keys.length; i++) {
-                    let key = keys[i];
-                    result.push({'id': i+1, '序号': i+1, '编号': beizhu["BZBH"][key], '说明': beizhu["SM"][key]});//序号很重要
-                }
-                setFuzhu(result);
-                setRowSelectionModel({type: 'include', belong: debmRef.current, 
-                ids: new Set(extractFuzhu(debmRef.current))});
-            }
-        }, [beizhu]//后台传回来的附注信息有更新,要把他展示出来
-      );
-
-
-      React.useEffect(
-          () => {
-               handleSelection(selectedRowKeys);
-          }, [selectedRowKeys]
-      );
-
-      React.useEffect(
-          () => {
-               beizhuFKRef.current = beizhuFK;
-          }, [beizhuFK]
-      );
-
-      React.useEffect(
-          () => {
-               //console.log(dingeclick);
-               if (selectedRowKeys.length > 0 ) {
-                    const [success, data] = changguidinge(JSON.parse(dingeclick), selectedRowKeys[0]);
-                    if (success) {
-                         setDetail(data);
-                         detailRef.current = data;
-                         setExpandedRowKeys([...expandedRowKeys, selectedRowKeys[0]]);
-                    }
-               }
-               
-          }, [dingeclick]//常规添加定额
-      );
-
-      React.useEffect(
-          () => {
-               //console.log(dingeclick);
-               if (selectedRowKeys.length > 0 ) {
-                    const data = huan(JSON.parse(tihuanClick), selectedRowKeys[0]);
-                    
-                    setDetail(data);
-                    detailRef.current = data;
-                         
-                    handleSelection(selectedRowKeys);
-                         
-
-                         //setExpandedRowKeys([...expandedRowKeys, selectedRowKeys[0]]);
-                    
-               }
-               
-          }, [tihuanClick]//替换定额人材机
-      );
-    React.useEffect(
-        () => {
-          //console.log("rgde changed");
-          //console.log(rgde);
-          rgdeRef.current = rgde;
-          jxdeRef.current = jxde;
-          cldeRef.current = clde;
-          if (isQdrcj.current) {
-             highlight.current = [];
-          } else {
-          let toHighlight = [];
-          for(let i = 1; i < rcjhl.length; i++) {
-              let entry = rcjhl[i];
-              let bianhao = entry[1];
-              let rcjlb = entry[8];
-              let hit = false;
-              if (Number(rcjlb) == Number(1) && rgde) {
-                  for (let j = 0; j < rgde.length; j++) {
-                      if (rgde[j]["CLBH"] == bianhao) {
-                          if(rgde[j]["CLMC"] == entry[2])hit = true;
-                          let danjia = Number(entry[5]);
-                          if (danjia != rgde[j]["YSJG"]) {
-                               //console.log(`[${i},5]danjia bu yizhi`);
-                               toHighlight.push({row: i, col: 5, renderer: "customStylesRenderer"});
-                          }
-                          let hanliang = Number(entry[10]);
-                          if (hanliang != rgde[j]["gr"]) {
-                               //console.log(`[${i}, 10]hanliang bu yizhi`);
-                               toHighlight.push({row: i, col: 10, renderer: "customStylesRenderer"});
-                          }
-
-                      }              
-                  }
-
-              }   
-              if (Number(rcjlb) == Number(3) && jxde ) {
-                   for (let j = 0; j < jxde.length; j++) {
-                      if (jxde[j]["jxbh"] == bianhao) {
-                         if(jxde[j]["jxmc"] == entry[2])hit = true;
-                         let danjia = Number(entry[5]);
-                         if (danjia != jxde[j]["tbdj"]) {
-                              //console.log(`[${i},5]danjia bu yizhi`);
-                              toHighlight.push({row: i, col: 5, renderer: "customStylesRenderer"});
-                         }
-                         let hanliang = Number(entry[10]);
-                         if (hanliang != jxde[j]["sl"]) {
-                              //console.log(`[${i}, 10]hanliang bu yizhi`);
-                              toHighlight.push({row: i, col: 10, renderer: "customStylesRenderer"});
-                         }
-                      }
-                   }
-
-              }   
-              if (Number(rcjlb) == Number(2) && clde ) {
-                   for (let j = 0; j < clde.length; j++) {
-                      if (clde[j]["CLBH"] == bianhao) {
-                         if(clde[j]["CLMC"] == entry[2])hit = true;
-                         let danjia = Number(entry[5]);
-                         if (danjia != clde[j]["YSJG"]) {
-                              //console.log(`[${i},5]danjia bu yizhi`);
-                              toHighlight.push({row: i, col: 5, renderer: "customStylesRenderer"});
-                         }
-                         let hanliang = Number(entry[10]);
-                         if (hanliang != clde[j]["SL"]) {
-                              //console.log(`[${i}, 10]hanliang bu yizhi`);
-                              toHighlight.push({row: i, col: 10, renderer: "customStylesRenderer"});
-                         }
-                      }
-                   }
-
-              }
-              if (!hit) {
-                 toHighlight.push({row: i, col: 1, renderer: "customStylesRenderer"});
-              }   
-          }
-          //console.log(toHighlight);
-          highlight.current = toHighlight;
-          }
-          let bzrcjhl = [["人材机编码", "名称", "单位", "单价", "合价", "含量"]] 
-          if (rgde)
-          for (let i = 0; i  < rgde.length; i++) {
-               bzrcjhl.push([rgde[i]["CLBH"], rgde[i]["CLMC"], rgde[i]["JLDW"], rgde[i]["YSJG"], rgde[i]["gf"], rgde[i]["gr"]]);
-          }
-          
-          if (clde)
-          for (let i = 0; i  < clde.length; i++) {
-               bzrcjhl.push([clde[i]["CLBH"], clde[i]["CLMC"], clde[i]["JLDW"], clde[i]["YSJG"], clde[i]["HJ"], clde[i]["SL"]]);
-          }
-          if (jxde)
-          for (let i = 0; i  < jxde.length; i++) {
-               bzrcjhl.push([jxde[i]["jxbh"], jxde[i]["jxmc"], jxde[i]["DW"], jxde[i]["tbdj"], jxde[i]["hj"], jxde[i]["sl"]]);
-          }
-          setRcjhl2(bzrcjhl);
-        }, [rgde, jxde, clde]
-      );
-
-
-      const handleChange = (event, newValue) => {
-        setValueTab(newValue);
-      };
-
-      const afterChange = (changes, source) => {
-          if (changes == null || changes.every(x=>x[2] == x[3])) {
-
-          } else {
-               let data =  hotRcjRef.current?.hotInstance?.getData();
-               for(let i = 1; i < data.length; i++) {
-                    data[i][11] = Number(data[i][10]) * Number(data[i][5]);
-                }
-                setRcjhl(data);
-          
-          let newData = updateDercj(selectedRowKeys[0], data);
-          setDetail(newData);
-          detailRef.current = newData;
-          handleSelection(selectedRowKeys);
-          }
-        };
-
-        const afterOnCellMouseDown = (event, coord, TD) => {
-          
-          if (lastClickRef.current == null) {
-               lastClickRef.current = Date.now();
-          } else {
-               let origin = lastClickRef.current;
-               lastClickRef.current = Date.now();
-               let delta = lastClickRef.current - origin;
-               if (delta < 300 && coord.col == 1 && coord.row > 0 && !isQdrcj.current){//300 ms -> 换
-                   tihuanCallback(coord.row, coord.col);
-               }
-          }
-        };
-
-  
-
-      
-      const handleSelection = (row) => {
-          if (row == null || row.length == 0) {
-               setRcjhl([]);
-               setFuzhu([]);
-               isQdrcj.current = true;
-               highlight.current = [];
-               return;
-          }
-                        let qd = detail.filter(x=>x['key'] == row[0]);
-                        if (qd.length > 0) {
-                             setFuzhu([]);
-                             Service.generateQingdanrcj(name, bh,bt,qd[0]['清单编码']).then(x=>{
-                              
-                              setRcjhl(x);
-                              //hotRcjRef.current?.hotInstance?.loadData(x);
-                              
-                                isQdrcj.current = true;
-                                highlight.current = [];
-                             });
-                             Service.generateQingdanTuijian(name, bh,bt,qd[0]['清单编码']).then(x=>{
-                              setTuijian(x);
-                              //hotTuijianRef.current?.hotInstance?.loadData(x);
-                              //isQdrcj.current = true;
-                              //setHighlight([]);
-                           });
-                        }else{
-                            let qdbm = null;
-                            let qd = detailRef.current.filter(x=>
-                              x["children"].filter(y=>y['key'] == row[0]).length > 0
-                            )[0];
-                            qdbm = qd['清单编码'];
-                            let debm = qd['children'].filter(x=>x['key'] == row[0])[0]['清单编码'];
-                            let danwei = qd['children'].filter(x=>x['key'] == row[0])[0]['单位'];
-
-                             //console.log(name, bh,bt,qdbm, selected[1]);
-                             debmRef.current = debm;
-                             clickCallback(qdbm, debm);
-                             Service.generateDingercj(name, bh,bt,qdbm, debm, danwei).then(x=>{
-                               console.log(x);
-                               setRcjhl(x[0]);
-                               setFuzhuEnable(x[1]);
-                               //hotRcjRef.current?.hotInstance?.loadData(x);
-                               isQdrcj.current = false;
-                               let toHighlight = [];
-                               for(let i = 1; i < x[0].length; i++) {
-                                   let entry = x[0][i];
-                                   let bianhao = entry[1];
-                                   let rcjlb = entry[8];
-                                   let hit = false;
-                                   if (Number(rcjlb) == 1 &&  rgdeRef.current  ) {
-                                      for (let j = 0;j < rgdeRef.current.length; j++) {
-                                         if (rgdeRef.current[j]["CLBH"] == bianhao) {
-                                             if(rgdeRef.current[j]["CLMC"] == entry[2])hit = true;
-                                              let danjia = Number(entry[5]);
-                                              if (danjia != rgdeRef.current[j]["YSJG"]) {
-                                                   //console.log(`[${i},5]danjia bu yizhi`);
-                                                   toHighlight.push({row: i, col: 5, renderer: "customStylesRenderer"});
-                                              }
-                                              let hanliang = Number(entry[10]);
-                                              if (hanliang != rgdeRef.current[j]["gr"]) {
-                                                   //console.log(`[${i}, 10]hanliang bu yizhi`);
-                                                   toHighlight.push({row: i, col: 10, renderer: "customStylesRenderer"});
-                                              }
-                                         }
-                                      }
-
-                                   }   
-                                   if (Number(rcjlb) == 3 && jxdeRef.current  ) {
-                                      for (let j = 0; j < jxdeRef.current.length; j++) {
-                                         if (jxdeRef.current[j]["jxbh"] == bianhao) {
-                                             if(jxdeRef.current[j]["jxmc"] == entry[2])hit = true;
-                                               let danjia = Number(entry[5]);
-                                               if (danjia != jxdeRef.current[j]["tbdj"]) {
-                                                    //console.log(`[${i},5]danjia bu yizhi`);
-                                                    toHighlight.push({row: i, col: 5, renderer: "customStylesRenderer"});
-                                               }
-                                               let hanliang = Number(entry[10]);
-                                               if (hanliang != jxdeRef.current[j]["sl"]) {
-                                                    //console.log(`[${i}, 10]hanliang bu yizhi`);
-                                                    toHighlight.push({row: i, col: 10, renderer: "customStylesRenderer"});
-                                               }
-                                         }
-                                      }
-
-                                   }   
-                                   if (Number(rcjlb) == 2 && cldeRef.current  ) {
-                                      for (let j = 0; j < cldeRef.current.length; j++) {
-                                         if (cldeRef.current[j]["CLBH"] == bianhao) {
-                                             if(cldeRef.current[j]["CLMC"] == entry[2])hit = true;
-                                               let danjia = Number(entry[5]);
-                                               if (danjia != cldeRef.current[j]["YSJG"]) {
-                                                    //console.log(`[${i},5]danjia bu yizhi`);
-                                                    toHighlight.push({row: i, col: 5, renderer: "customStylesRenderer"});
-                                               }
-                                               let hanliang = Number(entry[10]);
-                                               if (hanliang != cldeRef.current[j]["SL"]) {
-                                                    //console.log(`[${i}, 10]hanliang bu yizhi`);
-                                                    toHighlight.push({row: i, col: 10, renderer: "customStylesRenderer"});
-                                               }
-                                         }
-                                      }
-
-                                   }
-                                   if (!hit) {
-                                        toHighlight.push({row: i, col: 1, renderer: "customStylesRenderer"});
-                                   }   
-                               }
-                               highlight.current = toHighlight;
-                             });
-
-                        }
-
-
-                        
-      };
-
-
-    return (
-        <Stack spacing={2}>
-
-                   <Box>
-                   <Stack direction='row' spacing={2}>
-                   <Button variant="outlined" size="small" onClick={() => {
-                      if (selectedRowKeys.length > 0) {
-                         const [success, data] = danxiangdinge(selectedRowKeys[0]);
-                         if(success) {
-                            setDetail(data);
-                            detailRef.current = data;
-                            setExpandedRowKeys([...expandedRowKeys, selectedRowKeys[0]]);
-                         }
-                      }
-                 
-                      
-                      }}
-                   >单项定额</Button>
-                      <Button variant="outlined" size="small" onClick={() => {
-                      if (selectedRowKeys.length > 0) {
-                          let newData = shanchu(selectedRowKeys[0]);
-                          setDetail(newData);
-                          detailRef.current = newData;
-                          if (newData.filter(x=>x['key'] == selectedRowKeys[0]).length == 0) {
-                              setSelectedRowKeys([]);
-                              handleSelection([]);
-                          }
-                          
-                          
-                      }
-                      
-                 
-                      
-                      }}
-                   >删除</Button>
-                   <Button variant="outlined" size="small" onClick={() => {
-                      let newData = undo();
-                      setDetail(newData);
-                      detailRef.current = newData;
-                      if (newData.filter(x=>x['key'] == selectedRowKeys[0]).length == 0
-                      && newData.filter(x=>x["children"].filter(y=>y['key']==selectedRowKeys[0]).length > 0).length == 0) {
-                         setSelectedRowKeys([]);
-                         handleSelection([]);
-                     } else {
-                         handleSelection(selectedRowKeys);
-                     }
-                      
-                      }}
-                   >撤销</Button>
-                   <Button variant="outlined" size="small" onClick={() => {
-                      let newData = redo();
-                      setDetail(newData);
-                      detailRef.current = newData;
-                      if (newData.filter(x=>x['key'] == selectedRowKeys[0]).length == 0
-                      && newData.filter(x=>x["children"].filter(y=>y['key']==selectedRowKeys[0]).length > 0).length == 0) {
-                         setSelectedRowKeys([]);
-                         handleSelection([]);
-                     } else {
-                         handleSelection(selectedRowKeys);
-                     }
-                      
-                      }}
-                   >重做</Button>
-                   <Button variant="outlined" size="small" onClick={() => {
-                            console.log("save to cloud");
-                            loadingCallback();
-                      
-                      }}
-                   >保存</Button>
-
-                  
-                   </Stack>
-                   <Box sx={{minHeight: `calc(100vh - 340px)`}}>
-                   <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 - 400px)'}}
-                    //pagination={{ position: ['none', 'none'] }}
-                    pagination={false}
-                    columns = {[
-                         
-                         { dataIndex: '操作',        title : '操作',        key : '操作'          , width : 30 , fixed: 'left'   },
-                         { dataIndex: '序号'  ,       title : '序号'   ,      key : '序号'        , width : 30   , fixed: 'left'      },
-                         { dataIndex: '清单编码'  ,   title : '清单编码' ,    key : '清单编码'    , width : 100     , fixed: 'left'    },
-                         { dataIndex: '名称'   ,      title : '名称'  ,       key : '名称'        , width : 200         },
-                         { dataIndex: '项目特征' ,    title : '项目特征' ,    key : '项目特征'    , width : 300         },
-                         { dataIndex: '计算规则' ,    title : '计算规则' ,    key : '计算规则'    , width : 300         },
-                         { dataIndex: '单位'    ,     title : '单位'  ,       key : '单位'        , width : 100         },
-                         { dataIndex: '数量'    ,     title : '数量'  ,       key : '数量'        , width : 100    ,
-                         
-                         render: (text, record) => {
-                              //console.log("column render");
-                              //console.log("text".concat(text));
-                              //console.log(record);
-                                      if(record['序号']) {
-                                        return ( <plaintext>{text}</plaintext> );
-                                      } else {
-                                        return ( 
-                                             <Editable initialText={text}  onChange={(value)=>{
-                                                  let [success, data] = updateShuliang(value, selectedRowKeys[0]);
-                                                  if (success) {
-                                                       setDetail(data);
-                                                       detailRef.current = data;
-                                                       handleSelection(selectedRowKeys);
-                                                  }
-                                             }}
-                                             >
-                                            </Editable>
-                                         );
-                                      }
-                                      //console.log(text);
-                                      
-                              }
-                         },
-                         { dataIndex: '综合单价' ,   title : '综合单价'  ,   key : '综合单价'     , width : 100  ,
-                             render: (text, record) => {
-                              let temp = Number(text);
-                              let temp2 = temp.toFixed(2);
-                              let temp3 = temp2.toString();
-                              return ( <plaintext>{temp3}</plaintext> );
-
-                             }
-                         },
-                         { dataIndex: '合价'   ,      title : '合价'   ,      key : '合价'        , width : 100  ,
-                         render: (text, record) => {
-                              let temp = Number(text);
-                              let temp2 = temp.toFixed(2);
-                              let temp3 = temp2.toString();
-                              return ( <plaintext>{temp3}</plaintext> );
-
-                             }
-                         },
-                         { dataIndex: '人工费'  ,     title : '人工费'  ,     key : '人工费'      , width : 100     ,
-                         render: (text, record) => {
-                              let temp = Number(text);
-                              let temp2 = temp.toFixed(2);
-                              let temp3 = temp2.toString();
-                              return ( <plaintext>{temp3}</plaintext> );
-
-                             }
-                         },
-                         { dataIndex: '主材费'  ,     title : '主材费'  ,     key : '主材费'      , width : 100    ,
-                         render: (text, record) => {
-                              let temp = Number(text);
-                              let temp2 = temp.toFixed(2);
-                              let temp3 = temp2.toString();
-                              return ( <plaintext>{temp3}</plaintext> );
-
-                             }
-                         },
-                         { dataIndex: '设备费'  ,     title : '设备费'  ,     key : '设备费'      , width : 100   ,
-                         render: (text, record) => {
-                              let temp = Number(text);
-                              let temp2 = temp.toFixed(2);
-                              let temp3 = temp2.toString();
-                              return ( <plaintext>{temp3}</plaintext> );
-
-                             }
-                         },
-                         { dataIndex: '辅材费'  ,     title : '辅材费'  ,     key : '辅材费'      , width : 100   ,
-                         render: (text, record) => {
-                              let temp = Number(text);
-                              let temp2 = temp.toFixed(2);
-                              let temp3 = temp2.toString();
-                              return ( <plaintext>{temp3}</plaintext> );
-
-                             }
-                         },
-                         { dataIndex: '材料费'   ,    title : '材料费'  ,     key : '材料费'      , width : 100  ,
-                         render: (text, record) => {
-                              let temp = Number(text);
-                              let temp2 = temp.toFixed(2);
-                              let temp3 = temp2.toString();
-                              return ( <plaintext>{temp3}</plaintext> );
-
-                             }
-                         },
-                         { dataIndex: '机械费'   ,    title : '机械费'  ,     key : '机械费'      , width : 100     ,
-                         render: (text, record) => {
-                              let temp = Number(text);
-                              let temp2 = temp.toFixed(2);
-                              let temp3 = temp2.toString();
-                              return ( <plaintext>{temp3}</plaintext> );
-
-                             }
-                         },
-                         { dataIndex: '管理费'  ,     title : '管理费'  ,     key : '管理费'      , width : 100    ,
-                         render: (text, record) => {
-                              let temp = Number(text);
-                              let temp2 = temp.toFixed(2);
-                              let temp3 = temp2.toString();
-                              return ( <plaintext>{temp3}</plaintext> );
-
-                             }
-                         },
-                         { dataIndex: '利润'   ,      title : '利润'   ,      key : '利润'        , width : 100  ,
-                         render: (text, record) => {
-                              let temp = Number(text);
-                              let temp2 = temp.toFixed(2);
-                              let temp3 = temp2.toString();
-                              return ( <plaintext>{temp3}</plaintext> );
-
-                             }
-                         },
-                         { dataIndex: '暂估价'  ,     title : '暂估价'  ,     key : '暂估价'      , width : 100 ,
-                         render: (text, record) => {
-                              let temp = Number(text);
-                              let temp2 = temp.toFixed(2);
-                              let temp3 = temp2.toString();
-                              return ( <plaintext>{temp3}</plaintext> );
-
-                             }
-                         },
-                         { dataIndex: '综合人工工日', title : '综合人工工日', key : '综合人工工日', width : 100         },
-                         { dataIndex: '备注'     ,    title : '备注'   ,      key : '备注'        , width : 100         },
-                         
-                        
-
-                         
-                             
-                            
-                       ]}
-                   
-                  />
-                  </ConfigProvider>
-                  </Box>
-                  </Box>
-                   <Box >
-                   
-                   <TabContext value={valueTab}>
-                       <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
-                         <TabList sx={{minHeight: '24px'}} onChange={handleChange} aria-label="lab API tabs example">
-                           <Tab sx={{p: 0, minHeight: '24px'}} label="人材机含量" value="1" />
-                           <Tab sx={{p: 0, minHeight: '24px'}} label="标准定额人材机含量" value="2" />
-                           <Tab sx={{p: 0, minHeight: '24px'}} label="定额附注" value="3" />
-                           <Tab sx={{p: 0, minHeight: '24px'}} label="组价推荐" value="4" />
-                         </TabList>
-                       </Box>
-                       
-                       <TabPanel sx={{p: 1}} value="1">
-                          <HotTable 
-                          nestedRows={false}
-                             data={rcjhl
-                             }
-                             //cell={highlight}
-                             manualColumnResize={true}
-                             rowHeaders={true}
-                             colHeaders={true}
-                             height="190"
-                             formulas={{
-                              engine: hyperformulaInstance,
-                              sheetName: 'Rcj',
-                            }}
-                             
-                              cells={(row, col) => {
-                                   if (isQdrcj.current) return {readOnly: true, renderer: "customStylesRenderer"};
-                                   if (col == 8) {
-                                        return { readOnly: true, renderer: "customStylesRenderer" };
-                                   }
-                                   if (row === 0) {
-                                     return { readOnly: true, renderer: "customStylesRenderer" };
-                                   }
-                                   if (col <= 1 || col === 11) {
-                                        return { readOnly: true, renderer: "customStylesRenderer" };
-                                   }
-                           
-                                   return {renderer: "customStylesRenderer" };
-                                 }}
-                             fixedRowsTop={1}
-                             selectionMode="single"
-                             autoWrapRow={false}
-                             autoWrapCol={false}
-                             ref = {hotRcjRef}
-                             afterChange={afterChange}
-                             afterOnCellMouseDown={afterOnCellMouseDown}
-                             licenseKey="non-commercial-and-evaluation" // for non-commercial use only
-                           >
-                              
-                         </HotTable>
-
-                       </TabPanel>
-                       <TabPanel sx={{p: 1}} value="2">
-                          <HotTable 
-                          nestedRows={false}
-                             data={rcjhl2
-                             }
-                             manualColumnResize={true}
-                             rowHeaders={true}
-                             colHeaders={true}
-                             height="190"
-                             readOnly={true}
-                             fixedRowsTop={1}
-                             selectionMode="single"
-                             autoWrapRow={false}
-                             autoWrapCol={false}
-                             licenseKey="non-commercial-and-evaluation" // for non-commercial use only
-                           />
-
-                           
-
-                       </TabPanel>
-                       <TabPanel sx={{p: 1}} value="3">
-                       <div style={{ height: 190}}>
-                          <DataGrid  disableColumnMenu
-                          getRowHeight={(params) => "auto"}
-                          localeText={{
-                              noRowsLabel: '无数据',
-                              paginationRowsPerPage: '每页行数',
-                              footerRowSelected: (count) => `共选中了${count.toLocaleString()}行`,
-                             
-                              
-                            }}
-                          columns={
-                              [
-                                   { field: '序号', headerName: '序号', },
-                                   {
-                                     field: '编号',
-                                     headerName: '编号',
-                                     
-                                   },
-                                   {
-                                     field: '说明',
-                                     headerName: '说明',
-                                     width: 550
-                                    
-                                   },
-                                  
-                                 ]
-                             }
-                         scroll={{ x: 'max-content' , y : 200}}
-                         rows={fuzhu}
-                         hideFooter={true}
-                         checkboxSelection={fuzhuEnable}
-                         rowSelectionModel={rowSelectionModel}
-                         onRowSelectionModelChange={(newRowSelectionModel) => {
-                              console.log(newRowSelectionModel);
-                              if (newRowSelectionModel.hasOwnProperty('belong')) {
-                                   setRowSelectionModel(newRowSelectionModel);
-                              } else {
-                                  console.log(rowSelectionModel);
-                                  setRowSelectionModel(newRowSelectionModel);
-                                  const [newData, newHl] = handleBeizhu(beizhuFKRef.current, selectedRowKeys[0], newRowSelectionModel.ids, fuzhu);
-                                  if (newData) {
-                                      setDetail(newData);
-                                      detailRef.current = newData;
-                                      setRcjhl(newHl);
-                                  }
-                              }
-                              
-                            }}
-                           />
-                           </div>
-                          
-
-                       </TabPanel>
-                       <TabPanel sx={{p: 1}} value="4">
-                          <HotTable 
-                          nestedRows={false}
-                             data={tuijian
-                             }
-                             ref = {hotTuijianRef}
-                             manualColumnResize={true}
-                             rowHeaders={true}
-                             colHeaders={true}
-                             height="190"
-                             readOnly={true}
-                             fixedRowsTop={1}
-                             selectionMode="single"
-                             autoWrapRow={false}
-                             autoWrapCol={false}
-                             licenseKey="non-commercial-and-evaluation" // for non-commercial use only
-                           />
-
-                       </TabPanel>
-                     </TabContext>
-                  </Box>
-                  </Stack>
-                  
-
-
-
-
-
-    );
-}

+ 977 - 0
front/src/Qingdan3.js

@@ -0,0 +1,977 @@
+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 { Grid } from '@mui/material';
+import Tab from "@mui/material/Tab";
+import TabContext from "@mui/lab/TabContext";
+import TabList from "@mui/lab/TabList";
+import TabPanel from "@mui/lab/TabPanel";
+import Stack from "@mui/material/Stack";
+import Service from './Service';
+import Button from '@mui/material/Button';
+import ButtonGroup from '@mui/material/ButtonGroup';
+import {extractFuzhu} from './utils';
+import {shanchu, undo, redo, danxiangdinge, updateDercj, changguidinge, handleBeizhu, huan, updateShuliang} from './editor';
+import Backdrop from '@mui/material/Backdrop';
+import CircularProgress from '@mui/material/CircularProgress';
+import { DataGrid } 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,
+
+   } from '@ant-design/icons';
+
+import zhCN from 'antd/locale/zh_CN';
+import {copy} from './utils';
+
+
+import {TabulatorFull as Tabulator} from "tabulator-tables"; //import Tabulator library
+import "tabulator-tables/dist/css/tabulator.min.css"; //import Tabulator stylesheet
+import './Tabulator.css';
+
+
+/**
+ * 
+本条规定了工程量清单编码的表示方式:十二位阿拉伯数字及其设置规定。
+各位数字的含义是:一、二位为专业工程代码(01—房屋建筑与装饰工程;02—仿古建筑工程;
+03—通用安装工程;04—市政工程;05—园林绿化工程;06—矿山工程;07—构筑物工程;08—城市
+轨道交通工程;09—爆破工程。以后进入国标的专业工程代码以此类推);三、四位为附录分类顺序码;
+五、六位为分部工程顺序码;七、八、九位为分项工程项目名称顺序码;十至十二位为清单项目名称
+顺序码。
+ */
+
+
+
+
+
+
+
+
+export default function Qingdan3({name, bh, bt, rgde, jxde, clde, beizhu/*后台传回来的附注信息,要整理后才能成为展示用的行*/ , beizhuFK, clickCallback, loadingCallback, dingeclick, tihuanCallback, tihuanClick, suanshiCallback}) {
+    
+     const myTable = React.useRef(null);
+     const myRef = React.useRef(null);
+     const [valueTab, setValueTab] = React.useState("1");
+     const handleChange = (event, newValue) => {
+          setValueTab(newValue);
+        };
+     const [rcjhl, setRcjhl] = React.useState([]);
+     const [rcjhl2, setRcjhl2] = React.useState([]);
+     const [fuzhu, setFuzhu] = React.useState([]);//展示用的附注行
+     const [tuijian, setTuijian] = React.useState([]);
+     const [fuzhuEnable, setFuzhuEnable] = React.useState(false);
+     const hotRcjRef = React.useRef(null);
+     const hotTuijianRef = React.useRef(null);
+     const highlight = React.useRef([]);
+     const debmRef = React.useRef(null);
+     const lastClickRef = React.useRef(null);
+     const tuijianRef = React.useRef(null);
+     const tuijianTable = React.useRef(null);
+     const rcj2Ref = React.useRef(null);
+     const rcj2Table = React.useRef(null);
+     const rcjRef = React.useRef(null);
+     const rcjTable = React.useRef(null);
+     const [detail, setDetail] = React.useState([
+                    
+     ]);
+
+     const selectedRowKeysTable = React.useRef([]);
+     const selectedRowKeysTableParent = React.useRef(null);
+     const beizhuFKRef = React.useRef(null);
+
+
+     const rgdeRef = React.useRef(null);
+     const jxdeRef = React.useRef(null);
+     const cldeRef = React.useRef(null);
+     const isQdrcj = React.useRef(false);
+     const [selectedRowKeys, setSelectedRowKeys] = React.useState([]);
+     const onSelectChange = (newSelectedRowKeys) => {
+          console.log('selectedRowKeys changed: ', newSelectedRowKeys);
+          setSelectedRowKeys(newSelectedRowKeys);
+          const [newData, newHl] = handleBeizhu(beizhuFKRef.current, selectedRowKeysTable.current[0], newSelectedRowKeys, fuzhu);
+                                       if (newData) {
+                                          myTable.current.updateData(newData.filter(x=>x['key'] == selectedRowKeysTableParent.current));
+                                          let y =[];
+                                          for (let i = 1; i < newHl.length; i++) {
+                                            y.push({
+                                          'ID' : newHl[i][0],
+                                          '人材机编码' : newHl[i][1],
+                                          '名称' : newHl[i][2],
+                                          '规格型号': newHl[i][3],
+                                          '单位' : newHl[i][4],
+                                          '单价' : newHl[i][5],
+                                          '产地' : newHl[i][6],
+                                          '供应厂商' : newHl[i][7],
+                                          '人材机类别' : newHl[i][8],
+                                          '甲供标志': newHl[i][9],
+                                          '含量' : newHl[i][10],
+                                          '合价' : newHl[i][11],
+                                          '暂估价标志' : newHl[i][12],
+                                          '主要材料标志' : newHl[i][13],
+                                          '主材标志' : newHl[i][14],
+                                          '设备标志' : newHl[i][15] 
+
+                                          });
+                                        }
+                                         setRcjhl(y);
+                                         if (rcjTable.current) {
+                                            rcjTable.current.replaceData(y);
+                                         }
+     
+                                       }
+        };
+
+
+     /**fuzhu select */
+     const rowSelection = {
+          selectedRowKeys,
+          onChange: onSelectChange,
+          getCheckboxProps: (record) => {
+               return {
+                    disabled: !fuzhuEnable
+               };
+          }
+     };
+
+
+     var editCheck = function(cell){
+          //cell - the cell component for the editable cell
+      
+          //get row data
+          //console.log(cell);
+          if(cell._cell.row.data['序号']) return false;
+          return true;
+      }
+
+      var editCheckRcj = function(cell){
+          //cell - the cell component for the editable cell
+      
+          //get row data
+          //console.log(cell);
+          if(isQdrcj.current) return false;
+          return true;
+      }
+
+
+      var sparklineFormatter = function(cell, formatterParams, onRendered){
+          for (let i = 0; i < highlight.current.length; i++) {
+               let entry = highlight.current[i];
+               if (entry.row + 1 == cell._cell.row.position && entry.col + 1 == cell._cell.column.getPosition()) {
+                    cell.getElement().style.fontWeight = 'bold';
+                    cell.getElement().style.color = 'green';
+                    cell.getElement().style.background = '#d7f1e1';
+               }
+              }
+              return Number(cell.getValue()).toFixed(2).toString(); 
+          };
+
+      function handleSelect(row){
+          selectedRowKeysTable.current = [row._row['data']['key']];
+          if (row._row.data['序号'] != null && row._row.data['序号'].length >0) {
+               selectedRowKeysTableParent.current = row._row['data']['key'];
+
+               setFuzhu([]);
+               Service.generateQingdanrcj(name, bh,bt,row._row.data['清单编码']).then(x=>{
+                
+                
+                    let y =[];
+                    for (let i = 1; i < x.length; i++) {
+                         y.push({
+                              'ID' : x[i][0],
+                              '人材机编码' : x[i][1],
+                              '名称' : x[i][2],
+                              '规格型号': x[i][3],
+                              '单位' : x[i][4],
+                              '单价' : x[i][5],
+                              '产地' : x[i][6],
+                              '供应厂商' : x[i][7],
+                              '人材机类别' : x[i][8],
+                              '甲供标志': x[i][9],
+                              '含量' : x[i][10],
+                              '合价' : x[i][11],
+                              '暂估价标志' : x[i][12],
+                              '主要材料标志' : x[i][13],
+                              '主材标志' : x[i][14],
+                              '设备标志' : x[i][15] 
+
+                         });
+                    }
+                    setRcjhl(y);
+                    if (rcjTable.current) {
+                         rcjTable.current.replaceData(y);
+                    }
+                
+                  isQdrcj.current = true;
+                  highlight.current = [];
+               });
+               Service.generateQingdanTuijian(name, bh,bt,row._row.data['清单编码']).then(x=>{
+                setTuijian(x);
+                if (tuijianTable.current) tuijianTable.current.replaceData(x);
+                
+             });
+          }else{
+               setTuijian([]);
+               if (tuijianTable.current) tuijianTable.current.replaceData([]);
+              let row_parent = row._row;
+              while(row_parent.modules.dataTree.parent) {
+                   row_parent = row_parent.modules.dataTree.parent;
+              }
+              
+
+               //console.log(name, bh,bt,qdbm, selected[1]);
+               debmRef.current = row._row['data']['清单编码'];
+               selectedRowKeysTableParent.current = row_parent['data']['key'];
+               let qdbm = row_parent['data']['清单编码'];
+               let debm = row._row['data']['清单编码'];
+               console.log('debm=');
+               console.log(debm);
+               let danwei = row._row['data']['单位'];
+
+               clickCallback(qdbm, debm);
+               Service.generateDingercj(name, bh,bt,qdbm, debm, danwei).then(x=>{
+                 console.log(x);
+                 let y =[];
+                              for (let i = 1; i < x[0].length; i++) {
+                                   y.push({
+                                        'ID' : x[0][i][0],
+                                        '人材机编码' : x[0][i][1],
+                                        '名称' : x[0][i][2],
+                                        '规格型号': x[0][i][3],
+                                        '单位' : x[0][i][4],
+                                        '单价' : x[0][i][5],
+                                        '产地' : x[0][i][6],
+                                        '供应厂商' : x[0][i][7],
+                                        '人材机类别' : x[0][i][8],
+                                        '甲供标志': x[0][i][9],
+                                        '含量' : x[0][i][10],
+                                        '合价' : x[0][i][11],
+                                        '暂估价标志' : x[0][i][12],
+                                        '主要材料标志' : x[0][i][13],
+                                        '主材标志' : x[0][i][14],
+                                        '设备标志' : x[0][i][15] 
+          
+                                   });
+                              }
+                              setRcjhl(y);
+                              if (rcjTable.current) {
+                                   rcjTable.current.replaceData(y);
+                              }
+                 setFuzhuEnable(x[1]);
+                 //hotRcjRef.current?.hotInstance?.loadData(x);
+                 isQdrcj.current = false;
+                 let toHighlight = [];
+                 for(let i = 0; i < y.length; i++) {
+                     let entry = y[i];
+                     let bianhao = entry['人材机编码'];
+                     let rcjlb = entry['人材机类别'];
+                     let hit = false;
+                     if (Number(rcjlb) == 1 &&  rgdeRef.current  ) {
+                        for (let j = 0;j < rgdeRef.current.length; j++) {
+                           if (rgdeRef.current[j]["CLBH"] == bianhao) {
+                               if(rgdeRef.current[j]["CLMC"] == entry['名称'])hit = true;
+                                let danjia = Number(entry['单价']);
+                                if (danjia != rgdeRef.current[j]["YSJG"]) {
+                                     //console.log(`[${i},5]danjia bu yizhi`);
+                                     toHighlight.push({row: i, col: 5, renderer: "customStylesRenderer"});
+                                }
+                                let hanliang = Number(entry['含量']);
+                                if (hanliang != rgdeRef.current[j]["gr"]) {
+                                     //console.log(`[${i}, 10]hanliang bu yizhi`);
+                                     toHighlight.push({row: i, col: 10, renderer: "customStylesRenderer"});
+                                }
+                           }
+                        }
+
+                     }   
+                     if (Number(rcjlb) == 3 && jxdeRef.current  ) {
+                        for (let j = 0; j < jxdeRef.current.length; j++) {
+                           if (jxdeRef.current[j]["jxbh"] == bianhao) {
+                               if(jxdeRef.current[j]["jxmc"] == entry['名称'])hit = true;
+                                 let danjia = Number(entry['单价']);
+                                 if (danjia != jxdeRef.current[j]["tbdj"]) {
+                                      //console.log(`[${i},5]danjia bu yizhi`);
+                                      toHighlight.push({row: i, col: 5, renderer: "customStylesRenderer"});
+                                 }
+                                 let hanliang = Number(entry['含量']);
+                                 if (hanliang != jxdeRef.current[j]["sl"]) {
+                                      //console.log(`[${i}, 10]hanliang bu yizhi`);
+                                      toHighlight.push({row: i, col: 10, renderer: "customStylesRenderer"});
+                                 }
+                           }
+                        }
+
+                     }   
+                     if (Number(rcjlb) == 2 && cldeRef.current  ) {
+                        for (let j = 0; j < cldeRef.current.length; j++) {
+                           if (cldeRef.current[j]["CLBH"] == bianhao) {
+                               if(cldeRef.current[j]["CLMC"] == entry['名称'])hit = true;
+                                 let danjia = Number(entry['单价']);
+                                 if (danjia != cldeRef.current[j]["YSJG"]) {
+                                      //console.log(`[${i},5]danjia bu yizhi`);
+                                      toHighlight.push({row: i, col: 5, renderer: "customStylesRenderer"});
+                                 }
+                                 let hanliang = Number(entry['含量']);
+                                 if (hanliang != cldeRef.current[j]["SL"]) {
+                                      //console.log(`[${i}, 10]hanliang bu yizhi`);
+                                      toHighlight.push({row: i, col: 10, renderer: "customStylesRenderer"});
+                                 }
+                           }
+                        }
+
+                     }
+                     if (!hit) {
+                          toHighlight.push({row: i, col: 1, renderer: "customStylesRenderer"});
+                     }   
+                 }
+                 highlight.current = toHighlight;
+               });
+
+          }
+
+      }
+
+
+   
+     
+    
+
+
+
+     React.useEffect(() => {
+          myTable.current = new Tabulator(myRef.current, {
+               index: "key",
+               height: 380,
+             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:80, headerSort:false, frozen: true}, //never hide this column
+                          {title:"清单编码", field:"清单编码", width:120,headerSort:false, frozen: true ,formatter:"textarea" },
+                          {title:"名称", field:"名称", width:150, headerSort:false, formatter:"textarea"}, //hide this column first
+                          {title:"项目特征", field:"项目特征", width:150 , headerSort:false, formatter:"textarea"},
+                          {title:"计算规则", field:"计算规则", width:150, headerSort:false, formatter:"textarea"},
+                          {title:"单位", field:"单位", width:100, headerSort:false},
+                          {title:"数量", field:"数量", width:100, headerSort:false, editor: "input", editable: editCheck },
+                          {title:"综合单价", field:"综合单价", width:100, headerSort:false, formatter:"money"},
+                          {title:"合价", field:"合价", width:100, headerSort:false, formatter:"money"},
+                          {title:"人工费", field:"人工费", width:100, headerSort:false, formatter:"money"},
+                          {title:"主材费", field:"主材费", width:100, headerSort:false, formatter:"money"},
+                          {title:"设备费", field:"设备费", width:100, headerSort:false, formatter:"money"},
+                          {title:"辅材费", field:"辅材费", width:100, headerSort:false, formatter:"money"},
+                          {title:"材料费", field:"材料费", width:100, headerSort:false, formatter:"money"},
+                          {title:"机械费", field:"机械费", width:100, headerSort:false, formatter:"money"},
+                          {title:"管理费", field:"管理费", width:100, headerSort:false, formatter:"money"},
+                          {title:"利润", field:"利润", width:100, headerSort:false, formatter:"money"},
+                          {title:"暂估价", field:"暂估价", width:100, headerSort:false, formatter:"money"},
+                          {title:"综合人工工日", field:"综合人工工日", width:100, headerSort:false},
+                  ]
+           }); 
+           
+           myTable.current.on("cellDblClick", function(e, cell){
+               //e - the click event object
+               //cell - cell component
+               console.log(cell);
+           });
+     
+           myTable.current.on("rowSelected", handleSelect);
+           
+     
+           myTable.current.on("cellEdited", function(cell){
+               //console.log("edited");
+               //console.log();
+               let key = cell._cell.row.data['key'];
+               myTable.current.deselectRow();
+               let [success, data] = updateShuliang(cell._cell.row.data['数量'], selectedRowKeysTable.current[0]);
+               if (success) {
+                                myTable.current.updateData(data.filter(x=>x['key'] == selectedRowKeysTableParent.current)).then(function() {
+                                   let getRow = myTable.current.getRows(); //get array of currently selected row components.
+                                   let component = null;
+                                   for(let i = 0; i < getRow.length; i++) {
+                                        let entry = getRow[i]._row.modules.dataTree.children;
+                                        for(let j = 0; j < entry.length; j++) {
+                                             let child = entry[j];
+                                             if(child.data['key'] == key) {
+                                                  //console.log(child);
+                                                  component = child.component;
+                                                  break;
+                                             }
+                                             
+                                        }
+     
+                                   }
+                                   component.select();
+                                   handleSelect(component);
+                                   //handleSelect(getRow[0]);
+                                });                            
+                                                            
+               }
+           });
+     
+     
+           myTable.current.on("tableBuilt", () => {
+               Service.generateQingdanmingxi(name, bh, bt).then(x=>{
+                    myTable.current.replaceData(x);
+                    });
+             });
+         
+        }, [bh, bt]);
+
+
+
+        React.useEffect(
+          () => {
+            //console.log("rgde changed");
+            //console.log(rgde);
+            rgdeRef.current = rgde;
+            jxdeRef.current = jxde;
+            cldeRef.current = clde;
+            if (isQdrcj.current) {
+               highlight.current = [];
+            } else {
+            let toHighlight = [];
+            for(let i = 0; i < rcjhl.length; i++) {
+                let entry = rcjhl[i];
+                let bianhao = entry['人材机编码'];
+                let rcjlb = entry['人材机类别'];
+                let hit = false;
+                if (Number(rcjlb) == Number(1) && rgde) {
+                    for (let j = 0; j < rgde.length; j++) {
+                        if (rgde[j]["CLBH"] == bianhao) {
+                            if(rgde[j]["CLMC"] == entry['名称'])hit = true;
+                            let danjia = Number(entry['单价']);
+                            if (danjia != rgde[j]["YSJG"]) {
+                                 //console.log(`[${i},5]danjia bu yizhi`);
+                                 toHighlight.push({row: i, col: 5, renderer: "customStylesRenderer"});
+                            }
+                            let hanliang = Number(entry['含量']);
+                            if (hanliang != rgde[j]["gr"]) {
+                                 //console.log(`[${i}, 10]hanliang bu yizhi`);
+                                 toHighlight.push({row: i, col: 10, renderer: "customStylesRenderer"});
+                            }
+  
+                        }              
+                    }
+  
+                }   
+                if (Number(rcjlb) == Number(3) && jxde ) {
+                     for (let j = 0; j < jxde.length; j++) {
+                        if (jxde[j]["jxbh"] == bianhao) {
+                           if(jxde[j]["jxmc"] == entry['名称'])hit = true;
+                           let danjia = Number(entry['单价']);
+                           if (danjia != jxde[j]["tbdj"]) {
+                                //console.log(`[${i},5]danjia bu yizhi`);
+                                toHighlight.push({row: i, col: 5, renderer: "customStylesRenderer"});
+                           }
+                           let hanliang = Number(entry['含量']);
+                           if (hanliang != jxde[j]["sl"]) {
+                                //console.log(`[${i}, 10]hanliang bu yizhi`);
+                                toHighlight.push({row: i, col: 10, renderer: "customStylesRenderer"});
+                           }
+                        }
+                     }
+  
+                }   
+                if (Number(rcjlb) == Number(2) && clde ) {
+                     for (let j = 0; j < clde.length; j++) {
+                        if (clde[j]["CLBH"] == bianhao) {
+                           if(clde[j]["CLMC"] == entry['名称'])hit = true;
+                           let danjia = Number(entry['单价']);
+                           if (danjia != clde[j]["YSJG"]) {
+                                //console.log(`[${i},5]danjia bu yizhi`);
+                                toHighlight.push({row: i, col: 5, renderer: "customStylesRenderer"});
+                           }
+                           let hanliang = Number(entry['含量']);
+                           if (hanliang != clde[j]["SL"]) {
+                                //console.log(`[${i}, 10]hanliang bu yizhi`);
+                                toHighlight.push({row: i, col: 10, renderer: "customStylesRenderer"});
+                           }
+                        }
+                     }
+  
+                }
+                if (!hit) {
+                   toHighlight.push({row: i, col: 1, renderer: "customStylesRenderer"});
+                }   
+            }
+            //console.log(toHighlight);
+            highlight.current = toHighlight;
+            }
+            let bzrcjhl = [/*["人材机编码", "名称", "单位", "单价", "合价", "含量"]*/] 
+            if (rgde)
+          for (let i = 0; i  < rgde.length; i++) {
+               bzrcjhl.push({'人材机编码': rgde[i]["CLBH"], '名称': rgde[i]["CLMC"], '单位': rgde[i]["JLDW"], '单价': rgde[i]["YSJG"], '合价': rgde[i]["gf"], '含量': rgde[i]["gr"]});
+          }
+          
+          if (clde)
+          for (let i = 0; i  < clde.length; i++) {
+               bzrcjhl.push({'人材机编码': clde[i]["CLBH"], '名称': clde[i]["CLMC"], '单位': clde[i]["JLDW"], '单价': clde[i]["YSJG"], '合价': clde[i]["HJ"], '含量': clde[i]["SL"]});
+          }
+          if (jxde)
+          for (let i = 0; i  < jxde.length; i++) {
+               bzrcjhl.push({'人材机编码': jxde[i]["jxbh"], '名称': jxde[i]["jxmc"], '单位': jxde[i]["DW"], '单价': jxde[i]["tbdj"], '合价': jxde[i]["hj"], '含量': jxde[i]["sl"]});
+          }
+            setRcjhl2(bzrcjhl);
+          }, [rgde, jxde, clde]
+        );
+
+
+
+        React.useEffect(
+          () => {
+              console.log(beizhu);
+              let result = [];
+              if (beizhu != null) { 
+                  let keys = Object.keys(beizhu["BZBH"]);
+                  for(let i = 0; i < keys.length; i++) {
+                      let key = keys[i];
+                      result.push({'key': i+1, '序号': i+1, '编号': beizhu["BZBH"][key], '说明': beizhu["SM"][key]});//序号很重要
+                  }
+                  setFuzhu(result);
+                  let newSelect = extractFuzhu(debmRef.current);
+                  setSelectedRowKeys(newSelect);
+                  //setSelectedRowKeys([1]);
+                  
+              }
+          }, [beizhu]
+        );
+
+        React.useEffect(
+          () => {
+               beizhuFKRef.current = beizhuFK;
+          }, [beizhuFK]
+      );
+
+
+      React.useEffect(
+          () => {
+               myTable.current.deselectRow();
+               //console.log(dingeclick);
+               if (selectedRowKeysTable.current.length > 0 ) {
+                    const [success, data, key] = changguidinge(JSON.parse(dingeclick), selectedRowKeysTable.current[0]);
+                    if (success) {
+                         myTable.current.updateData(data.filter(x=>x['key'] == selectedRowKeysTableParent.current)).then(function(){
+                              let getRow = myTable.current.getRows(); //get array of currently selected row components.
+                              let component = null;
+                              for(let i = 0; i < getRow.length; i++) {
+                                   let entry = getRow[i]._row.modules.dataTree.children;
+                                   for(let j = 0; j < entry.length; j++) {
+                                        let child = entry[j];
+                                        if(child.data['key'] == key) {
+                                             //console.log(child);
+                                             component = child.component;
+                                             break;
+                                        }
+                                        
+                                   }
+
+                              }
+                              
+                              component.select();
+                              handleSelect(component);
+
+                                   
+                               
+                          });
+                    }
+               }
+               
+          }, [dingeclick]//常规添加定额
+      );
+
+
+      React.useEffect(
+          () => {
+               //console.log(dingeclick);
+               if (selectedRowKeysTable.current.length > 0 ) {
+                    const data = huan(JSON.parse(tihuanClick), selectedRowKeysTable.current[0]);
+                    
+                    myTable.current.updateData(data.filter(x=>x['key'] == selectedRowKeysTableParent.current)).then(function(){
+                         let getRow = myTable.current.getRows(); //get array of currently selected row components.
+                         let component = null;
+                         for(let i = 0; i < getRow.length; i++) {
+                              let entry = getRow[i]._row.modules.dataTree.children;
+                              for(let j = 0; j < entry.length; j++) {
+                                   let child = entry[j];
+                                   if(child.data['key'] == selectedRowKeysTable.current[0]) {
+                                        //console.log(child);
+                                        component = child.component;
+                                        break;
+                                   }
+                                   
+                              }
+
+                         }
+                         
+                         
+                         handleSelect(component);
+
+                              
+                          
+                     });
+                         
+
+                        
+                    
+               }
+               
+          }, [tihuanClick]//替换定额人材机
+      );
+
+
+
+      React.useEffect(
+          () => {
+               if (tuijianRef.current != null ) {
+               tuijianTable.current = new Tabulator(tuijianRef.current, {
+                    index: "key",
+                    height: 200,
+                  data: tuijian, //link data to table
+                  reactiveData: false, //enable data reactivity
+                  dataTreeStartExpanded:false,
+                  dataTree: false,
+                  selectableRows:1, //make rows selectable
+                  
+                  
+                  columns: [ //Define Table Columns
+                               {title:"ID", field:"ID", width:80, headerSort:false, }, //never hide this column
+                               {title:"定额编号", field:"定额编号", width:120,headerSort:false,  formatter:"textarea" },
+                               {title:"工程量名称", field:"工程量名称", width:150, headerSort:false, formatter:"textarea"}, //hide this column first
+                               {title:"工作内容", field:"工作内容", width:150 , headerSort:false, formatter:"textarea"},
+                             
+                       ]
+               });
+               tuijianTable.current.on("tableBuilt", () => {
+                    
+                    tuijianTable.current.replaceData(tuijian);
+                         
+                  });
+               }
+               if (rcj2Ref.current != null ) {
+                    rcj2Table.current = new Tabulator(rcj2Ref.current, {
+                         index: "key",
+                         height: 200,
+                       data: rcjhl2, //link data to table
+                       reactiveData: false, //enable data reactivity
+                       dataTreeStartExpanded:false,
+                       dataTree: false,
+                       selectableRows:1, //make rows selectable
+                       
+                       
+                       columns: [ //Define Table Columns
+                                    {title:"人材机编码", field:"人材机编码", width:80, headerSort:false, }, //never hide this column
+                                    {title:"名称", field:"名称", width:120,headerSort:false,  formatter:"textarea" },
+                                    {title:"单位", field:"单位", width:150, headerSort:false, formatter:"textarea"}, //hide this column first
+                                    {title:"单价", field:"单价", width:150 , headerSort:false, formatter:"money"},
+                                    {title:"合价", field:"合价", width:150 , headerSort:false, formatter:"money"},
+                                    {title:"含量", field:"含量", width:150 , headerSort:false, formatter:"textarea"},
+                                  
+                            ]
+                    });
+                    rcj2Table.current.on("tableBuilt", () => {
+                         
+                         rcj2Table.current.replaceData(rcjhl2);
+                              
+                       });
+                    }
+
+               if (rcjRef.current != null ) {
+                         rcjTable.current = new Tabulator(rcjRef.current, {
+                              index: "key",
+                              height: 200,
+                            data: rcjhl, //link data to table
+                            reactiveData: false, //enable data reactivity
+                            dataTreeStartExpanded:false,
+                            dataTree: false,
+                            selectableRows:1, //make rows selectable
+                            editTriggerEvent:"dblclick",
+                            
+                            columns: [ //Define Table Columns
+                                         {title:"ID", field:"ID", width:80, headerSort:false, },
+                                         {title:"人材机编码", field:"人材机编码", width:80, headerSort:false, }, //never hide this column
+                                         {title:"名称", field:"名称", width:120,headerSort:false,  formatter:"textarea", editor: "input", editable: editCheckRcj },
+                                         {title:"规格型号", field:"规格型号", width:80, headerSort:false, editor: "input", editable: editCheckRcj },
+                                         {title:"单位", field:"单位", width:80, headerSort:false, formatter:"textarea"}, //hide this column first
+                                         {title:"单价", field:"单价", width:80 , headerSort:false, formatter: sparklineFormatter, editor: "input", editable: editCheckRcj },
+                                         {title:"产地", field:"产地", width:80, headerSort:false, },
+                                         {title:"供应厂商", field:"供应厂商", width:80, headerSort:false, },
+                                         {title:"人材机类别", field:"人材机类别", width:80, headerSort:false, },
+                                         {title:"甲供标志", field:"甲供标志", width:80 , headerSort:false, formatter:"textarea"},
+                                         {title:"含量", field:"含量", width:80 , headerSort:false, formatter:"money", formatterParams:{precision:4}, editor: "input", editable: editCheckRcj },
+                                         {title:"合价", field:"合价", width:80 , headerSort:false, formatter:"money"},
+                                         {title:"暂估价标志", field:"暂估价标志", width:80 , headerSort:false, formatter:"textarea"},
+                                         {title:"主要材料标志", field:"主要材料标志", width:100 , headerSort:false, formatter:"textarea"},
+                                         {title:"主材标志", field:"主材标志", width:80 , headerSort:false, formatter:"textarea"},
+                                         {title:"设备标志", field:"设备标志", width:80 , headerSort:false, formatter:"textarea"},
+                                       
+                                 ]
+                         });
+                         rcjTable.current.on("tableBuilt", () => {
+                              
+                              rcjTable.current.replaceData(rcjhl);
+                                   
+                            });
+                         rcjTable.current.on("cellDblClick", function(e, cell){
+                              //e - the click event object
+                              //cell - cell component
+                              if(cell._cell.column.getPosition() == 2  && !isQdrcj.current) {
+                                  tihuanCallback(cell._cell.row.position, cell._cell.column.getPosition());
+                              }
+                          });
+                         rcjTable.current.on("cellEdited", function(cell){
+                              let data =  copy(cell._cell.table.getData());
+                              for(let i = 0; i < data.length; i++) {
+                                   data[i]['合价'] = Number(data[i]['单价']) * Number(data[i]['含量']);
+                              }
+                              setRcjhl(data);
+                              if (rcjTable.current) {
+                                   rcjTable.current.replaceData(data);
+                              }
+                              let data2 = [['ID', '人材机编码', '名称', '规格型号', '单位', '单价', '产地', '供应厂商', '人材机类别', '甲供标志', '含量', '合价', '暂估价标志', '主要材料标志', '主材标志', '设备标志']]
+                              for (let i = 0; i < data.length; i++) {
+                                   data2.push([data[i]['ID'], data[i]['人材机编码'], data[i]['名称'], data[i]['规格型号'], data[i]['单位'], 
+                                   data[i]['单价'], data[i]['产地'], data[i]['供应厂商'], data[i]['人材机类别'], 
+                                   data[i]['甲供标志'], data[i]['含量'], data[i]['合价'], data[i]['暂估价标志'], data[i]['主要材料标志'], data[i]['主材标志'], data[i]['设备标志']]);
+                              }
+     
+                              let newData = updateDercj(selectedRowKeysTable.current[0], data2);
+                              myTable.current.updateData(newData.filter(x=>x['key'] == selectedRowKeysTableParent.current)).then(function() {
+                              let getRow = myTable.current.getRows(); //get array of currently selected row components.
+                              let component = null;
+                              for(let i = 0; i < getRow.length; i++) {
+                                     let entry = getRow[i]._row.modules.dataTree.children;
+                                     for(let j = 0; j < entry.length; j++) {
+                                           let child = entry[j];
+                                           if(child.data['key'] == selectedRowKeysTable.current[0]) {
+                                                //console.log(child);
+                                               component = child.component;
+                                                break;
+                                            }
+                         
+                                      }
+
+                              }
+               
+                                handleSelect(component);
+                              });
+                         });
+                         }
+          }, [valueTab]
+        );
+
+
+
+
+    return (
+        <Stack spacing={2}>
+
+                   <Box>
+                   <Stack direction='row' spacing={2}>
+                   <Button variant="outlined" size="small" onClick={() => {
+                      if (selectedRowKeysTable.current.length > 0) {
+                         let getRow = myTable.current.getRows(); //get array of currently selected row components.
+                         let hit = false;
+                         for(let i = 0; i < getRow.length; i++) {
+                              if (getRow[i]._row.data['key'] == selectedRowKeysTable.current[0]) {
+                                   hit = true;
+                              }
+                         }
+                         if (hit) {
+                              suanshiCallback();
+                         }
+                      }
+                 
+                      
+                      }}
+                   >定额(算式)</Button>
+                   <Button variant="outlined" size="small" onClick={() => {
+                      if (selectedRowKeysTable.current.length > 0) {
+                         const [success, data] = danxiangdinge(selectedRowKeysTable.current[0]);
+                         if(success) {
+                              myTable.current.updateData(data.filter(x=>x['key'] == selectedRowKeysTableParent.current)).then(function(){
+                                   selectedRowKeysTable.current = [];
+                                   selectedRowKeysTableParent.current = null;
+                                        setRcjhl([]);
+                                        if (rcjTable.current) {
+                                             rcjTable.current.replaceData([]);
+                                        }
+                                        setFuzhu([]);
+                                        isQdrcj.current = true;
+                                        highlight.current = [];
+                                 });
+                         }
+                      }
+                 
+                      
+                      }}
+                   >单项定额</Button>
+                      <Button variant="outlined" size="small" onClick={() => {
+                      if (selectedRowKeysTable.current.length > 0) {
+                         let newData = shanchu(selectedRowKeysTable.current[0]);
+                         myTable.current.updateData(newData.filter(x=>x['key'] == selectedRowKeysTableParent.current)).then(function(){
+                             if (newData.filter(x=>x['key'] == selectedRowKeysTable.current[0]).length == 0) {
+                                  selectedRowKeysTable.current = [];
+                                  selectedRowKeysTableParent.current = [];
+                                  setRcjhl([]);
+                                  if (rcjTable.current) {
+                                   rcjTable.current.replaceData([]);
+                                  }
+                                  setFuzhu([]);
+                                  isQdrcj.current = true;
+                                  highlight.current = [];
+                              }
+                         });
+                         
+                         
+                         
+                     }
+                      
+                 
+                      
+                      }}
+                   >删除</Button>
+                   <Button variant="outlined" size="small" onClick={() => {
+                   let newData = undo();
+                   myTable.current.updateData(newData).then(function(){
+                      
+                         selectedRowKeysTable.current = [];
+                         selectedRowKeysTableParent.current = null;
+                         setRcjhl([]);
+                         if (rcjTable.current) {
+                              rcjTable.current.replaceData([]);
+                         }
+                         setFuzhu([]);
+                         isQdrcj.current = true;
+                         highlight.current = [];
+                         
+                     
+                   });
+                      
+                      }}
+                   >撤销</Button>
+                   <Button variant="outlined" size="small" onClick={() => {
+                   let newData = redo();
+                   myTable.current.updateData(newData).then(function(){
+                      selectedRowKeysTable.current = [];
+                      selectedRowKeysTableParent.current = null;
+
+                         setRcjhl([]);
+                         if (rcjTable.current) {
+                              rcjTable.current.replaceData([]);
+                         }
+                         setFuzhu([]);
+                         isQdrcj.current = true;
+                         highlight.current = [];
+                   });
+                   
+                      
+                      }}
+                   >重做</Button>
+                   <Button variant="outlined" size="small" onClick={() => {
+                            console.log("save to cloud");
+                            loadingCallback();
+                      
+                      }}
+                   >保存</Button>
+
+                  
+                   </Stack>
+                   <div ref={myRef}> 
+                  </div>
+                  </Box>
+
+
+
+                   <Box >
+                   
+                   <TabContext value={valueTab}>
+                       <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
+                         <TabList sx={{minHeight: '24px'}} onChange={handleChange} aria-label="lab API tabs example">
+                           <Tab sx={{p: 0, minHeight: '24px'}} label="人材机含量" value="1" />
+                           <Tab sx={{p: 0, minHeight: '24px'}} label="标准定额人材机含量" value="2" />
+                           <Tab sx={{p: 0, minHeight: '24px'}} label="定额附注" value="3" />
+                           <Tab sx={{p: 0, minHeight: '24px'}} label="组价推荐" value="4" />
+                         </TabList>
+                       </Box>
+                       
+                       <TabPanel sx={{p: 1}} value="1">
+                        
+                       <div ref={rcjRef}></div>
+                       </TabPanel>
+                       <TabPanel sx={{p: 1}} value="2">
+                         
+                       <div ref={rcj2Ref}></div>
+                           
+
+                       </TabPanel>
+                       <TabPanel sx={{p: 1}} value="3">
+                       <Box sx={{maxHeight: `190px`}}>
+                       <ConfigProvider
+                          locale={zhCN}
+                          theme={{
+                            components: {
+                              Table: {
+                                 /* here is your component tokens */
+                                 cellPaddingBlock : 8
+                              },
+                            },
+                          }}
+                        >
+
+                          <Table 
+                             scroll={{ x: 'max-content' , y : 190}}
+                             pagination={false}
+                             rowSelection={rowSelection}
+                             columns={
+                              [
+                                   { title: '序号', dataIndex: '序号', width : 80},
+                                   {
+                                        title: '编号',
+                                        dataIndex: '编号',
+                                     
+                                   },
+                                   {
+                                        title: '说明',
+                                        dataIndex: '说明',
+                                     width: 550
+                                    
+                                   },
+                                  
+                                 ]
+                             }
+                           dataSource={fuzhu} />
+
+                        </ConfigProvider>
+                       </Box>
+                          
+
+                       </TabPanel>
+                       <TabPanel sx={{p: 1}} value="4">
+                       <div ref={tuijianRef}></div>
+
+                       </TabPanel>
+                     </TabContext>
+                  </Box>
+                  </Stack>
+                  
+
+
+
+
+
+    );
+}

+ 0 - 63
front/src/Zjcs.js

@@ -1,63 +0,0 @@
-import * as React from 'react';
-import Box from "@mui/material/Box";
-import 'handsontable/dist/handsontable.full.min.css';
-//import 'handsontable/styles/ht-theme-main.min.css';
-import { HandsonTable } from 'handsontable/base';
-import {HotTable} from "@handsontable/react";
-//import { registerAllModules } from 'handsontable/registry';
-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";
-import TabList from "@mui/lab/TabList";
-import TabPanel from "@mui/lab/TabPanel";
-import Stack from "@mui/material/Stack";
-//import { registerPlugin, NestedRows } from 'handsontable/plugins';
-//registerPlugin(NestedRows);
-import Service from './Service';
-
-
-export default function Zjcs({name, bh}) {
-    const [detail, setDetail] = React.useState([
-
-                    {
-                    "序号" : null, "清单编码": null, "名称" : null, "计算基数" : null,
-                     "计算基础" : null, "费率" : null, "金额" : null, "项目类别" : null}
-    ]);
-    const hotRef = React.useRef(null);
-    React.useEffect(
-        () => {
-          Service.generateZjcs(name, bh).then(x=>{
-          setDetail(x);
-          });
-        }, [bh]
-      );
-
-
-
-
-    return (
-                 <HotTable 
-                 nestedRows={true}
-                    data={detail
-                    }
-                    ref = {hotRef}
-                    contextMenu={true}
-                    bindRowsWithHeaders={true}
-                    fixedRowsTop={0}
-                    fixedColumnsStart={2}
-                    manualColumnResize={true}
-                    rowHeaders={true}
-                    colHeaders={["序号", "清单编码", "名称", "计算基数", "计算基础", "费率", "金额" , "项目类别" ]}
-                    height="600"
-                    readOnly={true}
-                    selectionMode="single"
-                    autoWrapRow={false}
-                    autoWrapCol={false}
-                    licenseKey="non-commercial-and-evaluation" // for non-commercial use only
-                  />
-
-
-
-    );
-}

+ 1 - 1
front/webpack.config.js

@@ -55,7 +55,7 @@ module.exports = {
     extensions: [".js", ".jsx"]
   },
 
-  mode: 'development',
+  mode: 'production',
   performance: {
     hints: false,
     maxEntrypointSize: 512000,

Неке датотеке нису приказане због велике количине промена