AI.js 24 KB

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