AI.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868
  1. import * as React from 'react';
  2. import Menu from '@mui/material/Menu';
  3. import AIService from './AIService';
  4. import Service from './Service';
  5. import SimpleService from './SimpleService';
  6. import AuthService from './AuthService';
  7. import {useNavigate, useLocation} from "react-router";
  8. import ArrowRightIcon from '@rsuite/icons/ArrowRight';
  9. import ArrowDownIcon from '@rsuite/icons/ArrowDown';
  10. import TextField from '@mui/material/TextField';
  11. import SearchIcon from '@rsuite/icons/Search';
  12. import ToggleButton from '@mui/material/ToggleButton';
  13. import ToggleButtonGroup from '@mui/material/ToggleButtonGroup';
  14. //registerAllModules();
  15. import { DataGrid, GridActionsCellItem, zhCN as zh_CN} from '@mui/x-data-grid';
  16. import Box from '@mui/material/Box';
  17. import MuiAppBar from '@mui/material/AppBar';
  18. import { styled, useTheme } from '@mui/material/styles';
  19. import Toolbar from '@mui/material/Toolbar';
  20. import Typography from '@mui/material/Typography';
  21. import CssBaseline from '@mui/material/CssBaseline';
  22. import AccountCircle from '@mui/icons-material/AccountCircle';
  23. import Fab from '@mui/material/Fab';
  24. import Tooltip from '@mui/material/Tooltip';
  25. import DeleteIcon from '@mui/icons-material/Delete';
  26. import Button from '@mui/material/Button';
  27. import Dialog from '@mui/material/Dialog';
  28. import Drawer from '@mui/material/Drawer';
  29. import Divider from '@mui/material/Divider';
  30. import IconButton from '@mui/material/IconButton';
  31. import ChevronLeftIcon from '@mui/icons-material/ChevronLeft';
  32. import ChevronRightIcon from '@mui/icons-material/ChevronRight';
  33. import MenuIcon from '@mui/icons-material/Menu';
  34. import AddIcon from '@mui/icons-material/Add';
  35. import DialogTitle from '@mui/material/DialogTitle';
  36. import DialogActions from '@mui/material/DialogActions';
  37. import CircularProgress from '@mui/material/CircularProgress';
  38. import Backdrop from '@mui/material/Backdrop';
  39. import List from '@mui/material/List';
  40. import ListItem from '@mui/material/ListItem';
  41. import ListItemButton from '@mui/material/ListItemButton';
  42. import ListItemIcon from '@mui/material/ListItemIcon';
  43. import ListItemText from '@mui/material/ListItemText';
  44. import HomeIcon from '@mui/icons-material/Home';
  45. import TipsAndUpdatesIcon from '@mui/icons-material/TipsAndUpdates';
  46. import Stack from '@mui/material/Stack';
  47. import Title from './Title';
  48. import {Tree as Tree_2} from 'react-arborist';
  49. import { CustomProvider } from 'rsuite';
  50. import './Tree.css';
  51. import zhCN from 'rsuite/locales/zh_CN';
  52. import FormControl from '@mui/material/FormControl';
  53. import InputLabel from '@mui/material/InputLabel';
  54. import Input from 'rsuite/Input';
  55. import 'rsuite/Input/styles/index.css';
  56. import InputGroup from 'rsuite/InputGroup';
  57. import 'rsuite/InputGroup/styles/index.css';
  58. import Grid from '@mui/material/Grid';
  59. import Container from '@mui/material/Container';
  60. import Paper from '@mui/material/Paper';
  61. import LinearProgress from '@mui/material/LinearProgress';
  62. import Chart from './Chart';
  63. import Chart2 from './Chart2';
  64. import Chart3 from './Chart3';
  65. import Select from '@mui/material/Select';
  66. import MenuItem from '@mui/material/MenuItem';
  67. export default function AI() {
  68. const drawerWidth = 240;
  69. const theme = useTheme();
  70. function RenderDate(props) {
  71. const { hasFocus, value } = props;
  72. const buttonElement = React.useRef(null);
  73. const rippleRef = React.useRef(null);
  74. React.useLayoutEffect(() => {
  75. if (hasFocus) {
  76. const input = buttonElement.current.querySelector('input');
  77. input?.focus();
  78. } else if (rippleRef.current) {
  79. // Only available in @mui/material v5.4.1 or later
  80. rippleRef.current.stop({});
  81. }
  82. }, [hasFocus]);
  83. return (
  84. <strong>
  85. <Button
  86. ref={buttonElement}
  87. touchRippleRef={rippleRef}
  88. variant="contained"
  89. size="small"
  90. style={{ marginLeft: 4 }}
  91. onClick={(event) => {
  92. console.log(value);
  93. event.stopPropagation();
  94. setSelected();
  95. handleZujia();
  96. AIService.qingdan(value).then(x=>{
  97. setQddetail(x);
  98. setZjloading(true);
  99. AIService.zujia(x[0]['清单编码']).then(y=>{
  100. setZjdetail(y);
  101. setZjloading(false);
  102. });
  103. setTjloading(true);
  104. AIService.tuijian(x[0]['清单编码']).then(y=>{
  105. setTjdetail(y);
  106. setTjloading(false);
  107. });
  108. });
  109. }}
  110. >
  111. 组价AI
  112. </Button>
  113. </strong>
  114. );
  115. }
  116. function RenderDe(props) {
  117. const { hasFocus, value } = props;
  118. const buttonElement = React.useRef(null);
  119. const rippleRef = React.useRef(null);
  120. return (
  121. <Box>
  122. {value.split('@').map(x=><Button
  123. variant="contained"
  124. size="small"
  125. style={{ marginLeft: 4 }}
  126. >{x}</Button>)}
  127. </Box>
  128. );
  129. }
  130. function RenderDemc(props) {
  131. const { hasFocus, value } = props;
  132. const buttonElement = React.useRef(null);
  133. const rippleRef = React.useRef(null);
  134. return (
  135. <Box>
  136. {value.split('@@').map(x=><Button
  137. variant="contained"
  138. size="small"
  139. style={{ marginLeft: 4, marginTop: 2 }}
  140. >{x}</Button>)}
  141. </Box>
  142. );
  143. }
  144. const columns = React.useMemo(
  145. () => [
  146. { field: '清单编码', headerName: '清单编码', width: 250 },
  147. { field: '名称', headerName: '名称', width: 400 },
  148. { field: '数量', headerName: '数量', width: 200 },
  149. { field: '操作', headerName: '操作', width: 100 , sortable: false, renderCell: RenderDate},
  150. ],
  151. );
  152. const qdcolumns = React.useMemo(
  153. () => [
  154. { field: '清单编码', headerName: '清单编码', },
  155. { field: '项目名称', headerName: '项目名称', },
  156. { field: '项目特征', headerName: '项目特征', width : 150 },
  157. { field: '计量单位', headerName: '计量单位', },
  158. { field: '工程量计算规则', headerName: '工程量计算规则', width: 300 },
  159. { field: '工作内容', headerName: '工作内容', width: 150 },
  160. ],
  161. );
  162. const zjcolumns = React.useMemo(
  163. () => [
  164. { field: '单位', headerName: '单位', },
  165. { field: '组价定额', headerName: '组价定额', width : 250 , sortable: false, renderCell: RenderDe},
  166. { field: '定额名称', headerName: '定额名称', width : 250, sortable: false, renderCell: RenderDemc },
  167. { field: '数量', headerName: '数量', },
  168. { field: '综合单价', headerName: '综合单价', },
  169. ],
  170. );
  171. const tjcolumns = React.useMemo(
  172. () => [
  173. { field: '组价定额', headerName: '组价定额', width : 250 , sortable: false, renderCell: RenderDe},
  174. { field: '定额名称', headerName: '定额名称', width : 350, sortable: false, renderCell: RenderDemc },
  175. ],
  176. );
  177. const Style = {
  178. position: "absolute",
  179. bottom: 128,
  180. right: 64,
  181. };
  182. const VisuallyHiddenInput = styled('input')({
  183. display: 'none',
  184. accept: ".13jz, .13jt, .jszf"
  185. });
  186. const itemRef = React.useRef(null);
  187. const navigate = useNavigate();
  188. const [detail, setDetail] = React.useState( [
  189. {label: "", value : 0}
  190. ]);
  191. const [detail2, setDetail2] = React.useState( [
  192. ["工程类别", "清单数"],
  193. ["", 0],
  194. ]);
  195. const [expanded, setExpanded] = React.useState([]);
  196. const [frequency, setFrequency] = React.useState([]);
  197. const [qddetail, setQddetail] = React.useState([]);
  198. const [zjdetail, setZjdetail] = React.useState([]);
  199. const [tjdetail, setTjdetail] = React.useState([]);
  200. const [open, setOpen] = React.useState(false);
  201. const [dopen, setDopen] = React.useState(false);
  202. const [bopen, setBopen] = React.useState(false);
  203. const [type, setType] = React.useState();
  204. const [zjloading, setZjloading] = React.useState(false);
  205. const [tjloading, setTjloading] = React.useState(false);
  206. const [cjloading, setCjloading] = React.useState(false);
  207. const [gploading, setGploading] = React.useState(false);
  208. const [zhuanye, setZhuanye] = React.useState(10);
  209. const [tab, setTab] = React.useState(false);
  210. const [qingdanshu, setQingdanshu] = React.useState([]);
  211. const [selected, setSelected] = React.useState();
  212. const [keyword, setKeyword] = React.useState();
  213. React.useEffect(
  214. () => {
  215. AIService.statistics("", navigate).then(x=>{
  216. let t = [];
  217. for (let i = 1; i < x.length; i++) {
  218. t.push({label: x[i][0], value: x[i][1]});
  219. }
  220. setDetail(t);
  221. });
  222. AIService.qingdanshu(10).then(x=>{
  223. setQingdanshu(x);
  224. });
  225. }, []
  226. );
  227. const handleRowClick = (params) => {
  228. //setMessage(`Movie "${params.row.title}" clicked`);
  229. navigate('/editor/qingdan/'.concat(params.row.id));
  230. };
  231. const AppBar = styled(MuiAppBar, {
  232. shouldForwardProp: (prop) => prop !== 'open',
  233. })(({ theme }) => ({
  234. transition: theme.transitions.create(['margin', 'width'], {
  235. easing: theme.transitions.easing.sharp,
  236. duration: theme.transitions.duration.leavingScreen,
  237. }),
  238. variants: [
  239. {
  240. props: ({ open }) => open,
  241. style: {
  242. width: `calc(100% - ${drawerWidth}px)`,
  243. marginLeft: `${drawerWidth}px`,
  244. transition: theme.transitions.create(['margin', 'width'], {
  245. easing: theme.transitions.easing.easeOut,
  246. duration: theme.transitions.duration.enteringScreen,
  247. }),
  248. },
  249. },
  250. ],
  251. }));
  252. const Main = styled('main', { shouldForwardProp: (prop) => prop !== 'open' })(
  253. ({ theme }) => ({
  254. flexGrow: 1,
  255. padding: theme.spacing(3),
  256. transition: theme.transitions.create('margin', {
  257. easing: theme.transitions.easing.sharp,
  258. duration: theme.transitions.duration.leavingScreen,
  259. }),
  260. marginLeft: `-${drawerWidth}px`,
  261. variants: [
  262. {
  263. props: ({ open }) => open,
  264. style: {
  265. transition: theme.transitions.create('margin', {
  266. easing: theme.transitions.easing.easeOut,
  267. duration: theme.transitions.duration.enteringScreen,
  268. }),
  269. marginLeft: 0,
  270. },
  271. },
  272. ],
  273. }),
  274. );
  275. const DrawerHeader = styled('div')(({ theme }) => ({
  276. display: 'flex',
  277. alignItems: 'center',
  278. padding: theme.spacing(0, 1),
  279. // necessary for content to be below app bar
  280. ...theme.mixins.toolbar,
  281. justifyContent: 'flex-end',
  282. }));
  283. const handleDrawerClose = () => {
  284. setOpen(false);
  285. };
  286. const handleTongji = () => {
  287. setOpen(false);
  288. setTab(false);
  289. };
  290. const handleZujia = () => {
  291. setOpen(false);
  292. setTab(true);
  293. };
  294. const handleDrawerOpen = () => {
  295. setOpen(true);
  296. };
  297. const handleClose = () => {
  298. setDopen(false);
  299. };
  300. const handleDelete = () => {
  301. SimpleService.deleteFiles(itemRef.current, navigate).then(x=> {
  302. SimpleService.generateFiles2(navigate).then(x=>{
  303. setDetail(x.map(y=>{return {'id': y[0], 'ID': y[0], '名称': y[1], '创建时间': y[2], '操作': y[0]};}));
  304. });
  305. });
  306. setDopen(false);
  307. };
  308. const onSelect = (selectedKeys) => {
  309. setSelected(selectedKeys['id']);
  310. setZjloading(true);
  311. console.log(selectedKeys);
  312. AIService.qingdan(selectedKeys['title']).then(x=>{
  313. setQddetail(x);
  314. AIService.zujia(x[0]['清单编码']).then(y=>{
  315. setZjdetail(y);
  316. setZjloading(false);
  317. });
  318. setTjloading(true);
  319. AIService.tuijian(x[0]['清单编码']).then(y=>{
  320. setTjdetail(y);
  321. setTjloading(false);
  322. });
  323. });
  324. };
  325. const onExpand = (expandItemValues, node) => {
  326. //console.log(expandItemValues);
  327. //console.log(node);
  328. setExpanded(expandItemValues);
  329. };
  330. const clickLB = (lb) => {
  331. console.log(lb);
  332. setType(lb);
  333. if (lb == null) {
  334. } else if (lb == '建筑与装饰工程') {
  335. //console.log('建筑与装饰工程');
  336. setCjloading(true);
  337. AIService.statistics("建筑与装饰工程", navigate).then(x=>{
  338. let t = [];
  339. for (let i = 1; i < x.length; i++) {
  340. t.push({label: x[i][0], value: x[i][1]});
  341. }
  342. setDetail2(t);
  343. setCjloading(false);
  344. });
  345. } else if (lb == '仿古建筑') {
  346. setCjloading(true);
  347. AIService.statistics("仿古建筑", navigate).then(x=>{
  348. let t = [];
  349. for (let i = 1; i < x.length; i++) {
  350. t.push({label: x[i][0], value: x[i][1]});
  351. }
  352. setDetail2(t);
  353. setCjloading(false);
  354. });
  355. } else if (lb == '安装工程') {
  356. setCjloading(true);
  357. AIService.statistics("安装工程", navigate).then(x=>{
  358. let t = [];
  359. for (let i = 1; i < x.length; i++) {
  360. t.push({label: x[i][0], value: x[i][1]});
  361. }
  362. setDetail2(t);
  363. setCjloading(false);
  364. });
  365. } else if (lb == '市政工程') {
  366. setCjloading(true);
  367. AIService.statistics("市政工程", navigate).then(x=>{
  368. let t = [];
  369. for (let i = 1; i < x.length; i++) {
  370. t.push({label: x[i][0], value: x[i][1]});
  371. }
  372. setDetail2(t);
  373. setCjloading(false);
  374. });
  375. } else if (lb == '园林绿化工程') {
  376. setCjloading(true);
  377. AIService.statistics("园林绿化工程", navigate).then(x=>{
  378. let t = [];
  379. for (let i = 1; i < x.length; i++) {
  380. t.push({label: x[i][0], value: x[i][1]});
  381. }
  382. setDetail2(t);
  383. setCjloading(false);
  384. });
  385. }
  386. };
  387. const clickLB2 = (type, lb) => {
  388. console.log(type);
  389. console.log(lb);
  390. setGploading(true);
  391. AIService.frequency(type, lb).then(x=>{
  392. console.log(x);
  393. setFrequency(x.map(y=>{y['操作'] = y['清单编码'];return y;}));
  394. setGploading(false);
  395. });
  396. };
  397. const handleChangeZhuanye = (event) => {
  398. //console.log(event.target.value);
  399. AIService.qingdanshu(event.target.value).then(x=>{
  400. setQingdanshu(x);
  401. });
  402. setZhuanye(event.target.value);
  403. };
  404. const minHeight = 100;
  405. const maxHeight = 400;
  406. const CustomInputGroup = ({ placeholder, ...props }) => (
  407. <InputGroup {...props} style={{"marginTop": 5}}>
  408. <Input placeholder={placeholder}
  409. value={keyword}
  410. onChange={(value)=>{setKeyword(value);}}
  411. />
  412. <InputGroup.Addon>
  413. <SearchIcon />
  414. </InputGroup.Addon>
  415. </InputGroup>
  416. );
  417. function Node({ node, style }) {
  418. let style_ = {'paddingLeft': style['paddingLeft']};
  419. style_['fontSize'] = "0.875rem";
  420. if (node.state.isSelected) {
  421. style_['backgroundColor'] = "#f2faff";
  422. style_['color'] = "#1675e0";
  423. style_['fontWeight'] = "bold";
  424. console.log(node);
  425. }
  426. return (
  427. <div
  428. style={style_}
  429. onClick={() => {
  430. if (node.children.length > 0) {node.toggle();}
  431. else {
  432. setSelected(node['id']);
  433. setZjloading(true);
  434. }
  435. }
  436. }
  437. >
  438. <FolderArrow node={node} />
  439. <span >
  440. {node.data.name}
  441. </span>
  442. </div>
  443. );
  444. }
  445. function FolderArrow({ node }) {
  446. return (
  447. <span >
  448. {node.isInternal ? (
  449. node.isOpen ? (
  450. <ArrowDownIcon />
  451. ) : (
  452. <ArrowRightIcon />
  453. )
  454. ) : null}
  455. </span>
  456. );
  457. }
  458. const [anchorEl, setAnchorEl] = React.useState();
  459. const accountOpen = Boolean(anchorEl);
  460. const handleAccountClose = () => {
  461. setAnchorEl(null);
  462. };
  463. const handleLogout = () => {
  464. localStorage.setItem("token", "");
  465. AIService.setToken("");
  466. Service.setToken("");
  467. SimpleService.setToken("");
  468. AuthService.setToken("");
  469. navigate("/editor/signin");
  470. };
  471. const handleAccountClick = (event) => {
  472. setAnchorEl(event.currentTarget.children[0]);
  473. };
  474. return (
  475. <Box sx={{ display: 'flex' }}>
  476. <CssBaseline />
  477. <AppBar position="fixed" open={open}>
  478. <Toolbar>
  479. <IconButton
  480. color="inherit"
  481. aria-label="open drawer"
  482. onClick={handleDrawerOpen}
  483. edge="start"
  484. sx={[
  485. {
  486. mr: 2,
  487. },
  488. open && { display: 'none' },
  489. ]}
  490. >
  491. <MenuIcon />
  492. </IconButton>
  493. <Typography variant="h6" noWrap component="div">
  494. 清单AI
  495. </Typography>
  496. <Box sx={{ flexGrow: 1 }} >
  497. <Stack direction="row" spacing={2} sx={{ml: 4}}>
  498. <Button
  499. key={'统计AI'}
  500. onClick={handleTongji}
  501. sx={{ my: 2, color: 'white', display: 'block' }}
  502. >
  503. 统计AI
  504. { !tab && <span style={{height: "3px", width : "48px", backgroundColor: "white", display : "flex", position: "absolute"}}> </span> }
  505. </Button>
  506. <Button
  507. key={'组价AI'}
  508. onClick={handleZujia}
  509. sx={{ my: 2, color: 'white', display: 'block' }}
  510. >
  511. 组价AI
  512. {tab && <span style={{height: "3px", width : "48px", backgroundColor: "white", display : "flex", position: "absolute"}}> </span> }
  513. </Button>
  514. </Stack>
  515. </Box>
  516. <Box sx={{ display: { xs: 'none', md: 'flex' } }}>
  517. <IconButton
  518. size="large"
  519. edge="end"
  520. aria-label="account of current user"
  521. onClick={handleAccountClick}
  522. aria-haspopup="true"
  523. color="inherit"
  524. >
  525. <AccountCircle />
  526. </IconButton>
  527. <Menu
  528. id="menu-appbar"
  529. anchorReference={"anchorPosition"}
  530. anchorPosition={{left: document.documentElement.clientWidth, top: 60}}
  531. open={accountOpen}
  532. onClose={handleAccountClose}
  533. anchorOrigin={{
  534. vertical: 'top',
  535. horizontal: 'right',
  536. }}
  537. keepMounted
  538. transformOrigin={{
  539. vertical: 'top',
  540. horizontal: 'left',
  541. }}
  542. >
  543. <MenuItem onClick={handleLogout}>登出</MenuItem>
  544. </Menu>
  545. </Box>
  546. </Toolbar>
  547. </AppBar>
  548. <Drawer
  549. sx={{
  550. width: drawerWidth,
  551. flexShrink: 0,
  552. '& .MuiDrawer-paper': {
  553. width: drawerWidth,
  554. boxSizing: 'border-box',
  555. },
  556. }}
  557. variant="persistent"
  558. anchor="left"
  559. open={open}
  560. >
  561. <DrawerHeader>
  562. <IconButton onClick={handleDrawerClose}>
  563. {theme.direction === 'ltr' ? <ChevronLeftIcon /> : <ChevronRightIcon />}
  564. </IconButton>
  565. </DrawerHeader>
  566. <Divider />
  567. <List>
  568. {['工作台', '清单AI'].map((text, index) => (
  569. <ListItem key={text} disablePadding>
  570. <ListItemButton onClick={(item)=>{
  571. if (index == 0) {
  572. navigate('/editor/index.html');
  573. }
  574. }}>
  575. <ListItemIcon>
  576. {index % 2 === 0 ? <HomeIcon /> : <TipsAndUpdatesIcon />}
  577. </ListItemIcon>
  578. <ListItemText primary={text} />
  579. </ListItemButton>
  580. </ListItem>
  581. ))}
  582. </List>
  583. </Drawer>
  584. <Main open={open}>
  585. <DrawerHeader />
  586. <div style={{ width: '100%' }}>
  587. { !tab && <Container maxWidth="lg" sx={{ mt: 4, mb: 4 }}>
  588. <Grid container spacing={3}>
  589. {/* Chart */}
  590. <Grid item xs={12} md={5} lg={6}>
  591. <Paper
  592. sx={{
  593. p: 2,
  594. display: 'flex',
  595. flexDirection: 'column',
  596. height: 400,
  597. }}
  598. >
  599. <Title>清单分类</Title>
  600. <Chart data={detail} click={clickLB}></Chart>
  601. </Paper>
  602. </Grid>
  603. {/* Recent Deposits */}
  604. <Grid item xs={12} md={7} lg={6}>
  605. <Paper
  606. sx={{
  607. p: 2,
  608. display: 'flex',
  609. flexDirection: 'column',
  610. height: 400,
  611. }}
  612. >
  613. <Title>次级清单分类</Title>
  614. { cjloading && <LinearProgress/>}
  615. { !cjloading && <Chart2 type={type} click={clickLB2} data={detail2}></Chart2> }
  616. </Paper>
  617. </Grid>
  618. {/* Recent Orders */}
  619. <Grid item xs={12}>
  620. <Paper sx={{ p: 2, display: 'flex', flexDirection: 'column' }}>
  621. <Title>高频清单</Title>
  622. <DataGrid autoHeight
  623. rows={frequency} columns={columns}
  624. disableColumnMenu={true} loading={gploading}
  625. localeText={zh_CN.components.MuiDataGrid.defaultProps.localeText}
  626. />
  627. </Paper>
  628. </Grid>
  629. </Grid>
  630. </Container>}
  631. { tab && <Container maxWidth="xl" sx={{ mt: 4, mb: 4 }}>
  632. <Grid container spacing={3}>
  633. {/* Chart */}
  634. <Grid item xs={12} md={2} lg={3}>
  635. <Paper
  636. sx={{
  637. p: 2,
  638. display: 'flex',
  639. flexDirection: 'column',
  640. }}
  641. >
  642. <Title>清单树</Title>
  643. <FormControl size="small">
  644. <InputLabel id="demo-multiple-name-label">专业</InputLabel>
  645. <Select
  646. labelId="demo-multiple-name-label"
  647. id="demo-multiple-name"
  648. value={zhuanye}
  649. onChange={handleChangeZhuanye}
  650. label="专业"
  651. >
  652. <MenuItem value={10}>建筑与装饰</MenuItem>
  653. <MenuItem value={20}>安装</MenuItem>
  654. <MenuItem value={30}>市政</MenuItem>
  655. <MenuItem value={40}>园林绿化</MenuItem>
  656. </Select>
  657. </FormControl>
  658. <Chart3 qingdanshu={qingdanshu}
  659. selected={selected}
  660. callback={(value)=>{
  661. onSelect(value);
  662. }}
  663. ></Chart3>
  664. </Paper>
  665. </Grid>
  666. {/* Recent Deposits */}
  667. <Grid item xs={12} md={10} lg={9}>
  668. <Paper
  669. sx={{
  670. p: 2,
  671. display: 'flex',
  672. flexDirection: 'column',
  673. }}
  674. >
  675. <DataGrid autoHeight hideFooter={true}
  676. getRowHeight={() => 'auto'}
  677. rows={qddetail} columns={qdcolumns}
  678. disableColumnMenu={true}
  679. localeText={zh_CN.components.MuiDataGrid.defaultProps.localeText}
  680. />
  681. <Title>历史组价</Title>
  682. <div
  683. style={{
  684. minHeight,
  685. maxHeight,
  686. "overflowY": "scroll"
  687. }}
  688. >
  689. <DataGrid autoHeight hideFooter={true}
  690. getRowHeight={() => 'auto'}
  691. rows={zjdetail} columns={zjcolumns}
  692. disableColumnMenu={true}
  693. loading={zjloading}
  694. localeText={zh_CN.components.MuiDataGrid.defaultProps.localeText}
  695. />
  696. </div>
  697. <Title>AI推荐</Title>
  698. <div
  699. style={{
  700. "overflowY": "scroll",
  701. minHeight,
  702. maxHeight
  703. }}
  704. >
  705. <DataGrid autoHeight hideFooter={true}
  706. getRowHeight={() => 'auto'}
  707. rows={tjdetail} columns={tjcolumns}
  708. disableColumnMenu={true}
  709. loading={tjloading}
  710. localeText={zh_CN.components.MuiDataGrid.defaultProps.localeText}
  711. />
  712. </div>
  713. </Paper>
  714. </Grid>
  715. </Grid>
  716. </Container>}
  717. </div>
  718. </Main>
  719. <Dialog
  720. open={dopen}
  721. onClose={handleClose}
  722. aria-labelledby="alert-dialog-title"
  723. aria-describedby="alert-dialog-description"
  724. >
  725. <DialogTitle id="alert-dialog-title">
  726. {"删除该项目?"}
  727. </DialogTitle>
  728. <DialogActions>
  729. <Button onClick={handleClose}>取消</Button>
  730. <Button onClick={handleDelete} autoFocus>
  731. 确定
  732. </Button>
  733. </DialogActions>
  734. </Dialog>
  735. <Backdrop
  736. sx={(theme) => ({ color: '#fff', zIndex: theme.zIndex.drawer + 1 })}
  737. open={bopen}
  738. >
  739. <CircularProgress color="inherit" />
  740. </Backdrop>
  741. </Box>
  742. );
  743. }