Browse Source

写不动了

shaogen1995 4 months ago
parent
commit
7bba235bba

+ 169 - 4
src/pages/A_workbench/A1dataSta/data.ts

@@ -4,10 +4,11 @@ import {
   TitleComponent,
   TooltipComponent,
   GridComponent,
-  TransformComponent
+  TransformComponent,
+  LegendComponent
 } from 'echarts/components'
-import { LineChart } from 'echarts/charts'
-import { UniversalTransition } from 'echarts/features'
+import { LineChart, PieChart, BarChart } from 'echarts/charts'
+import { UniversalTransition, LabelLayout } from 'echarts/features'
 import { CanvasRenderer } from 'echarts/renderers'
 
 echarts.use([
@@ -18,7 +19,15 @@ echarts.use([
   TransformComponent,
   LineChart,
   CanvasRenderer,
-  UniversalTransition
+  UniversalTransition,
+  TooltipComponent,
+  LegendComponent,
+  PieChart,
+  CanvasRenderer,
+  LabelLayout,
+  GridComponent,
+  BarChart,
+  CanvasRenderer
 ])
 
 // 折线图
@@ -78,3 +87,159 @@ export const echartsFu1 = (dom: HTMLDivElement) => {
   }
   option && myChart.setOption(option)
 }
+
+const bingTypeArr = (type: string) => {
+  return [
+    {
+      center: ['40%', '50%'],
+      radius: ['50%', '80%'],
+      label: {
+        position: 'center',
+        formatter: type,
+        fontSize: 20,
+        fontWeight: 'bold'
+      }
+    },
+    {
+      center: ['40%', '60%'],
+      radius: ['40%', '60%'],
+      label: {
+        position: 'center',
+        formatter: type,
+        fontSize: 18,
+        fontWeight: 'bold'
+      }
+    }
+  ]
+}
+
+const binLegendArr = [
+  {
+    top: 'center',
+    right: '0%',
+    orient: 'vertical'
+  },
+  {
+    top: '5%',
+    right: '2%',
+    orient: 'vertical'
+  }
+]
+
+// 饼图
+export const echartsFu2 = (dom: HTMLDivElement, type: string, index: number, data: any) => {
+  const myChart = echarts.getInstanceByDom(dom) || echarts.init(dom)
+  const option = {
+    tooltip: {
+      trigger: 'item'
+    },
+    legend: binLegendArr[index],
+    series: [
+      {
+        ...bingTypeArr(type)[index],
+        type: 'pie',
+
+        avoidLabelOverlap: false,
+        itemStyle: {
+          borderRadius: 10,
+          borderColor: '#fff',
+          borderWidth: 2
+        },
+
+        labelLine: {
+          show: false
+        },
+        data
+      }
+    ]
+  }
+  option && myChart.setOption(option)
+}
+
+// 2个半圆
+export const echartsFu3 = (dom: HTMLDivElement) => {
+  const myChart = echarts.getInstanceByDom(dom) || echarts.init(dom)
+  const option = {
+    tooltip: {
+      trigger: 'item'
+    },
+    legend: {
+      top: '5%',
+      left: 'center'
+    },
+    series: [
+      {
+        type: 'pie',
+        radius: ['70%', '100%'],
+        center: ['26%', '80%'],
+        // adjust the start and end angle
+        startAngle: 180,
+        endAngle: 360,
+        data: [
+          { value: 1048, name: 'Search Engine' },
+          { value: 735, name: 'Direct' },
+          { value: 580, name: 'Email' },
+          { value: 484, name: 'Union Ads' },
+          { value: 300, name: 'Video Ads' }
+        ]
+      },
+      {
+        type: 'pie',
+        radius: ['70%', '100%'],
+        center: ['74%', '80%'],
+        // adjust the start and end angle
+        startAngle: 180,
+        endAngle: 360,
+        data: [
+          { value: 1048, name: 'Search Engine' },
+          { value: 735, name: 'Direct' },
+          { value: 580, name: 'Email' },
+          { value: 484, name: 'Union Ads' },
+          { value: 300, name: 'Video Ads' }
+        ]
+      }
+    ]
+  }
+  option && myChart.setOption(option)
+}
+
+// 柱状图
+
+export const echartsFu4 = (dom: HTMLDivElement) => {
+  const myChart = echarts.getInstanceByDom(dom) || echarts.init(dom)
+  const option = {
+    grid: {
+      left: '10', //距左边边框的距离
+      right: '10', //距右边边框的距离
+      bottom: '20', //距下面边框的距离
+      top: '30', //距上面边框的距离
+      containLabel: true
+    },
+    xAxis: {
+      type: 'category',
+      data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
+    },
+    yAxis: {
+      type: 'value'
+    },
+    series: [
+      {
+        data: [120, 200, 150, 80, 70, 110],
+        type: 'bar'
+      }
+    ],
+    tooltip: {
+      trigger: 'axis',
+      axisPointer: {
+        type: 'cross',
+        label: {
+          backgroundColor: '#6a7985'
+        }
+      },
+      formatter: (val: any) => {
+        return '展览数量' + val[0].data
+      }
+    }
+  }
+  option && myChart.setOption(option)
+}

+ 189 - 30
src/pages/A_workbench/A1dataSta/index.module.scss

@@ -1,6 +1,16 @@
 .A1dataSta {
   overflow-y: auto;
   :global {
+    .A1card {
+      border-radius: 8px;
+      box-shadow: 0px 0px 2px 1px #ccc;
+      transition: all 0.5s;
+      cursor: pointer;
+      &:hover {
+        box-shadow: 0px 0px 2px 2px var(--themeColor);
+      }
+    }
+
     .A1tit {
       font-size: 16px;
       font-weight: 700;
@@ -16,58 +26,207 @@
         background-color: var(--themeColor);
       }
     }
+
+    .A1box1ll {
+      width: 380px;
+      margin-right: 20px;
+      .A1box1ll1 {
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+      }
+    }
+    .A1box1ll2 {
+      display: flex;
+      flex-wrap: wrap;
+      justify-content: space-between;
+      align-content: space-between;
+      padding-top: 20px;
+      height: 267px;
+      & > div {
+        width: calc(50% - 10px);
+        height: calc(50% - 10px);
+        padding: 20px 0 0 35px;
+        & > p {
+          color: var(--themeColor);
+          font-size: 16px;
+        }
+        & > div {
+          margin-top: 24px;
+          font-weight: 700;
+          font-size: 18px;
+        }
+      }
+    }
+
     .A1box1 {
       border-radius: 10px;
       background-color: #fff;
       padding: 24px;
       display: flex;
       justify-content: space-between;
-      .A1box1ll {
-        width: 380px;
-        margin-right: 20px;
-        .A1box1ll1 {
+
+      .A1box1rr {
+        width: calc(100% - 400px);
+        height: 300px;
+      }
+    }
+
+    .A1box2 {
+      height: 300px;
+      margin-top: 20px;
+      border-radius: 10px;
+      background-color: #fff;
+      padding: 24px;
+      .A1box2main {
+        margin-top: 15px;
+        height: 220px;
+        display: flex;
+        .A1box2ll {
+          width: 180px;
           display: flex;
+          flex-direction: column;
+          justify-content: space-around;
           align-items: center;
+          padding: 30px 0;
+          font-size: 16px;
+          & > span {
+            color: var(--themeColor);
+          }
+          & > p {
+            font-size: 24px;
+            font-weight: 700;
+          }
+          .A1_2llbs {
+            & > span {
+              color: var(--themeColor);
+            }
+          }
+        }
+        .A1box2rr {
+          width: calc(100% - 180px);
+          display: flex;
           justify-content: space-between;
+          & > div {
+            position: relative;
+            bottom: 60px;
+            height: 300px;
+            width: 32%;
+          }
         }
       }
-      .A1box1ll2 {
+    }
+    .A1box3 {
+      margin-top: 20px;
+      height: 330px;
+      display: flex;
+      & > div {
+        border-radius: 10px;
+        background-color: #fff;
+        padding: 24px;
+      }
+      .A1box3ll {
+        width: calc(100% - 400px);
+        margin-right: 20px;
         display: flex;
-        flex-wrap: wrap;
-        justify-content: space-between;
-        align-content: space-between;
-        padding-top: 20px;
-        height: 267px;
-        & > div {
-          border-radius: 8px;
-          box-shadow: 1px 1px 1px 1px #ccc;
-          width: calc(50% - 10px);
-          height: calc(50% - 10px);
-          padding: 20px 0 0 35px;
-          & > p {
-            color: var(--themeColor);
+        .A1box3ll1 {
+          width: 180px;
+          .A1box3ll1_1 {
+            margin-top: 20px;
+            width: 180px;
+            height: 110px;
+            display: flex;
+            flex-direction: column;
+            justify-content: space-around;
+            align-items: center;
+            padding: 10px 0;
             font-size: 16px;
+            & > div {
+              color: var(--themeColor);
+            }
+            & > p {
+              font-size: 18px;
+              font-weight: 700;
+            }
+            & > span {
+              & > span {
+                color: var(--themeColor);
+              }
+            }
           }
-          & > div {
-            margin-top: 24px;
-            font-weight: 700;
+        }
+        .A1box3ll2 {
+          width: calc(100% - 180px);
+          position: relative;
+          .A1box3ll2Ech {
+            width: 100%;
+            height: 100%;
+          }
+          .A1box3ll2Txt {
+            position: absolute;
+            bottom: 0px;
+            left: 18%;
             font-size: 18px;
+            font-weight: 700;
+            &:nth-of-type(2) {
+              left: 66%;
+            }
           }
         }
       }
-      .A1box1rr {
-        width: calc(100% - 400px);
-        height: 300px;
+      .A1box3rr {
+        margin-right: 0;
+        .A1box1ll2 {
+          padding-top: 15px;
+          height: 250px;
+          .A1card {
+            height: 110px;
+          }
+        }
       }
     }
-
-    .A1box2 {
-      height: 348px;
+    .A1box4 {
       margin-top: 20px;
-      border-radius: 10px;
-      background-color: #fff;
-      padding: 24px;
+      height: 320px;
       display: flex;
+      .A1box4ll {
+        padding: 24px;
+        background-color: #fff;
+        border-radius: 10px;
+        width: 350px;
+        position: relative;
+        .A1box4llEch {
+          position: absolute;
+          top: 0;
+          left: 0;
+          width: 100%;
+          height: 100%;
+          & > div {
+            width: 100%;
+            height: 100%;
+          }
+        }
+      }
+      .A1box4rr {
+        margin-left: 20px;
+        width: calc(100% - 370px);
+        background-color: #fff;
+        border-radius: 10px;
+        position: relative;
+        display: flex;
+        .A1tit {
+          z-index: 10;
+          position: absolute;
+          top: 24px;
+          left: 24px;
+        }
+        .A1box4rr1 {
+          width: 350px;
+        }
+        .A1box4rr2 {
+          width: calc(100% - 700px);
+        }
+      }
     }
   }
 }

+ 171 - 9
src/pages/A_workbench/A1dataSta/index.tsx

@@ -1,18 +1,35 @@
 import React, { useCallback, useEffect, useRef, useState } from 'react'
 import styles from './index.module.scss'
 import A1selectDate from './A1selectDate'
-import { echartsFu1 } from './data'
+import { echartsFu1, echartsFu2, echartsFu3, echartsFu4 } from './data'
+import { CaretUpOutlined, CaretDownOutlined } from '@ant-design/icons'
+
+const dataTemp = [
+  [
+    { value: 1048, name: '瓷器 50%' },
+    { value: 735, name: '钱币 50%' },
+    { value: 580, name: '陶器 50%' },
+    { value: 580, name: '铜器 50%' }
+  ],
+  [
+    { value: 735, name: '不通过 50%' },
+    { value: 580, name: '待审批 50%' },
+    { value: 580, name: '已完成 50%' }
+  ]
+]
 
 function A1dataSta() {
+  // 待完善 跳转 和 数据
+
   // 加载折线图,固定12个月
+  const echartRef1 = useRef<HTMLDivElement>(null)
   useEffect(() => {
     echartsFu1(echartRef1.current!)
   }, [])
 
+  // 入藏数据 下拉框
   const [value1, setValue1] = useState('30')
 
-  const echartRef1 = useRef<HTMLDivElement>(null)
-
   const getInfo1 = useCallback(async () => {
     console.log('入藏数据', value1)
   }, [value1])
@@ -21,9 +38,75 @@ function A1dataSta() {
     getInfo1()
   }, [getInfo1])
 
+  // 加载 中间的 3个饼图
+  const echartRefBin1 = useRef<HTMLDivElement>(null)
+  const echartRefBin2 = useRef<HTMLDivElement>(null)
+  const echartRefBin3 = useRef<HTMLDivElement>(null)
+
+  const getInfo2 = useCallback(() => {
+    echartsFu2(echartRefBin1.current!, '类别', 0, dataTemp[0])
+    echartsFu2(echartRefBin2.current!, '年代', 0, dataTemp[0])
+    echartsFu2(echartRefBin3.current!, '级别', 0, dataTemp[0])
+  }, [])
+
+  useEffect(() => {
+    getInfo2()
+  }, [getInfo2])
+
+  // 加载2个半圆
+  const echartRefYuan = useRef<HTMLDivElement>(null)
+
+  const getInfo3 = useCallback(() => {
+    echartsFu3(echartRefYuan.current!)
+  }, [])
+
+  useEffect(() => {
+    getInfo3()
+  }, [getInfo3])
+
+  // 藏品保管 下拉框
+  const [value2, setValue2] = useState('30')
+
+  const getInfo4 = useCallback(async () => {
+    console.log('藏品保管', value2)
+  }, [value2])
+
+  useEffect(() => {
+    getInfo4()
+  }, [getInfo4])
+
+  // 流程数据饼图
+  const echartRefBin4 = useRef<HTMLDivElement>(null)
+
+  const getInfo5 = useCallback(() => {
+    echartsFu2(echartRefBin4.current!, '423', 1, dataTemp[1])
+  }, [])
+
+  useEffect(() => {
+    getInfo5()
+  }, [getInfo5])
+
+  // 展览数据饼图
+  const echartRefBin5 = useRef<HTMLDivElement>(null)
+  const echartRefBin6 = useRef<HTMLDivElement>(null)
+  // 柱壮图
+  const echartRefBin7 = useRef<HTMLDivElement>(null)
+
+  const getInfo6 = useCallback(() => {
+    echartsFu2(echartRefBin5.current!, '展览41场', 1, dataTemp[1])
+    echartsFu2(echartRefBin6.current!, '展品9999件', 1, dataTemp[1])
+    echartsFu4(echartRefBin7.current!)
+  }, [])
+
+  useEffect(() => {
+    getInfo6()
+  }, [getInfo6])
+
   return (
     <div className={styles.A1dataSta}>
       <div className='pageTitle'>数据统计</div>
+
+      {/* --------------- */}
       <div className='A1box1'>
         <div className='A1box1ll'>
           <div className='A1box1ll1'>
@@ -31,19 +114,19 @@ function A1dataSta() {
             <A1selectDate value={value1} setValue={val => setValue1(val)} />
           </div>
           <div className='A1box1ll2'>
-            <div>
+            <div className='A1card'>
               <p>征集线索</p>
               <div>124件</div>
             </div>
-            <div>
+            <div className='A1card'>
               <p>藏品鉴定</p>
               <div>124件</div>
             </div>
-            <div>
+            <div className='A1card'>
               <p>藏品入馆</p>
               <div>124件</div>
             </div>
-            <div>
+            <div className='A1card'>
               <p>藏品入藏</p>
               <div>124件</div>
             </div>
@@ -51,10 +134,89 @@ function A1dataSta() {
         </div>
         <div className='A1box1rr' ref={echartRef1}></div>
       </div>
-
+      {/* --------------- */}
       <div className='A1box2'>
         <div className='A1tit'>藏品数据</div>
-        <div className='A1box2_1'></div>
+        <div className='A1box2main'>
+          <div className='A1box2ll A1card'>
+            <span>藏品总账件数</span>
+            <p>5324件</p>
+            <div className='A1_2llbs'>
+              52件
+              <CaretUpOutlined style={{ color: '#ff2121' }} />
+              <CaretDownOutlined style={{ color: 'green' }} />
+              <span>相比上周</span>
+            </div>
+          </div>
+          <div className='A1box2rr'>
+            <div ref={echartRefBin1}></div>
+            <div ref={echartRefBin2}></div>
+            <div ref={echartRefBin3}></div>
+          </div>
+        </div>
+      </div>
+      {/* --------------- */}
+      <div className='A1box3'>
+        <div className='A1box3ll'>
+          <div className='A1box3ll1'>
+            <div className='A1tit'>库房数据</div>
+            <div className='A1box3ll1_1 A1card'>
+              <div>在库数量</div>
+              <p>5004件</p>
+            </div>
+            <div className='A1box3ll1_1 A1card'>
+              <div>库位数量</div>
+              <p>10044处</p>
+              <span>
+                <span>闲置率</span> 52%
+              </span>
+            </div>
+          </div>
+          <div className='A1box3ll2'>
+            <div className='A1box3ll2Ech' ref={echartRefYuan}></div>
+            <div className='A1box3ll2Txt'>2025年3月19日盘点</div>
+            <div className='A1box3ll2Txt'>2025年3月20日盘点</div>
+          </div>
+        </div>
+        <div className='A1box1ll A1box3rr'>
+          <div className='A1box1ll1'>
+            <div className='A1tit'>藏品保管</div>
+            <A1selectDate value={value2} setValue={val => setValue2(val)} />
+          </div>
+          <div className='A1box1ll2'>
+            <div className='A1card'>
+              <p>事故登记</p>
+              <div>124件</div>
+            </div>
+            <div className='A1card'>
+              <p>残损登记</p>
+              <div>124件</div>
+            </div>
+            <div className='A1card'>
+              <p>现状登记</p>
+              <div>124件</div>
+            </div>
+            <div className='A1card'>
+              <p>修复登记</p>
+              <div>124件</div>
+            </div>
+          </div>
+        </div>
+      </div>
+      {/* --------------- */}
+      <div className='A1box4'>
+        <div className='A1box4ll'>
+          <div className='A1tit'>流程数据</div>
+          <div className='A1box4llEch'>
+            <div ref={echartRefBin4}></div>
+          </div>
+        </div>
+        <div className='A1box4rr'>
+          <div className='A1tit'>展览数据</div>
+          <div className='A1box4rr1' ref={echartRefBin5}></div>
+          <div className='A1box4rr1' ref={echartRefBin6}></div>
+          <div className='A1box4rr2' ref={echartRefBin7}></div>
+        </div>
       </div>
     </div>
   )

+ 24 - 0
src/pages/D_storeManage/D1storage/D1Loc/index.module.scss

@@ -0,0 +1,24 @@
+.D1Loc {
+  :global {
+    .D1Ltop {
+      height: 32px;
+      display: flex;
+      justify-content: flex-end;
+      align-items: center;
+    }
+    .D1Lmain {
+      margin-top: 15px;
+      height: calc(100% - 24px);
+      display: flex;
+      .D1Lmainll {
+        width: 400px;
+        background-color: aqua;
+      }
+      .D1Lmainrr {
+        margin-left: 20px;
+        width: calc(100% - 420px);
+        background-color: red;
+      }
+    }
+  }
+}

+ 40 - 0
src/pages/D_storeManage/D1storage/D1Loc/index.tsx

@@ -0,0 +1,40 @@
+import React, { useCallback, useEffect, useState } from 'react'
+import styles from './index.module.scss'
+import { Checkbox } from 'antd'
+// import { D1_APIgetTree } from '@/store/action/D1storage'
+
+function D1Loc() {
+  const [isNull, setIsNull] = useState(false)
+
+  const getTreeFu = useCallback(async () => {
+    // 待完善 报错
+    // const res = await D1_APIgetTree()
+    // if (res.code === 0) {
+    //   console.log(123, res)
+    // }
+  }, [])
+
+  useEffect(() => {
+    // 待完善 isNull 的值来获取数据
+    getTreeFu()
+  }, [getTreeFu])
+
+  return (
+    <div className={styles.D1Loc}>
+      <div className='D1Ltop'>
+        <Checkbox checked={isNull} onChange={e => setIsNull(e.target.checked)}>
+          仅查看空置库位
+        </Checkbox>
+      </div>
+
+      <div className='D1Lmain'>
+        <div className='D1Lmainll'>树列表1</div>
+        <div className='D1Lmainrr'>表格1</div>
+      </div>
+    </div>
+  )
+}
+
+const MemoD1Loc = React.memo(D1Loc)
+
+export default MemoD1Loc

+ 6 - 0
src/pages/D_storeManage/D1storage/D1goods/data.ts

@@ -0,0 +1,6 @@
+// 编号类型 (待完善)
+export const D1GselectNum = [
+  { value: '', label: '全部' },
+  { value: '藏品总登记号', label: '藏品总登记号' },
+  { value: '辅助账号', label: '辅助账号' }
+]

+ 35 - 0
src/pages/D_storeManage/D1storage/D1goods/index.module.scss

@@ -0,0 +1,35 @@
+.D1goods {
+  :global {
+    .D1Gtop {
+      height: 32px;
+      display: flex;
+      justify-content: flex-end;
+      .D1GtRow {
+        position: relative;
+        width: 150px;
+        margin-left: 15px;
+        .D1GtRowTxt {
+          top: -20px;
+          pointer-events: none;
+          left: 0;
+          position: absolute;
+          z-index: 10;
+        }
+      }
+    }
+    .D1Gmain {
+      margin-top: 15px;
+      height: calc(100% - 24px);
+      display: flex;
+      .D1Gmainll {
+        width: 400px;
+        background-color: aqua;
+      }
+      .D1Gmainrr {
+        margin-left: 20px;
+        width: calc(100% - 420px);
+        background-color: red;
+      }
+    }
+  }
+}

+ 46 - 0
src/pages/D_storeManage/D1storage/D1goods/index.tsx

@@ -0,0 +1,46 @@
+import React from 'react'
+import styles from './index.module.scss'
+import { Button, Input, Select } from 'antd'
+import { D1GselectNum } from './data'
+
+function D1goods() {
+  return (
+    <div className={styles.D1goods}>
+      <div className='D1Gtop'>
+        <div className='D1GtRow'>
+          <span className='D1GtRowTxt'>编号类型:</span>
+          <Select options={D1GselectNum} style={{ width: 150 }} />
+        </div>
+
+        <div className='D1GtRow'>
+          <span className='D1GtRowTxt'>藏品编号:</span>
+          <Input placeholder='请输入内容' maxLength={30} />
+        </div>
+
+        <div className='D1GtRow'>
+          <span className='D1GtRowTxt'>藏品名称:</span>
+          <Input placeholder='请输入内容' maxLength={30} />
+        </div>
+
+        <div className='D1GtRow'>
+          <span className='D1GtRowTxt'>库存状态:</span>
+          <Select options={[]} style={{ width: 150 }} />
+        </div>
+
+        <div className='D1GtRow'>
+          <Button type='primary'>查询</Button>&emsp;
+          <Button>重置</Button>
+        </div>
+      </div>
+
+      <div className='D1Gmain'>
+        <div className='D1Gmainll'>树列表</div>
+        <div className='D1Gmainrr'>表格</div>
+      </div>
+    </div>
+  )
+}
+
+const MemoD1goods = React.memo(D1goods)
+
+export default MemoD1goods

+ 24 - 1
src/pages/D_storeManage/D1storage/index.module.scss

@@ -1,7 +1,30 @@
 .D1storage {
   background-color: #fff;
   border-radius: 10px;
-  padding: 24px;
+  padding: 34px 24px 24px;
+  position: relative;
   :global {
+    .D1top {
+      position: absolute;
+      top: 34px;
+      left: 24px;
+      z-index: 10;
+      .D1topllTxt {
+        position: relative;
+        top: 2px;
+        font-size: 18px;
+      }
+      .ant-btn {
+        margin-left: 15px;
+      }
+    }
+    .D1main {
+      width: 100%;
+      height: 100%;
+      & > div {
+        width: 100%;
+        height: 100%;
+      }
+    }
   }
 }

+ 23 - 2
src/pages/D_storeManage/D1storage/index.tsx

@@ -1,10 +1,31 @@
-import React from 'react'
+import React, { useState } from 'react'
 import styles from './index.module.scss'
+import { Button } from 'antd'
+import D1Loc from './D1Loc'
+import D1goods from './D1goods'
+
+type TypeTopBtn = '按库位查看' | '按藏品查看'
+
+const topBtnArr: TypeTopBtn[] = ['按库位查看', '按藏品查看']
+
 function D1storage() {
+  const [topAc, setTopAc] = useState<TypeTopBtn>('按库位查看')
+
   return (
     <div className={styles.D1storage}>
       <div className='pageTitle'>库房管理</div>
-      <div className='D1top'></div>
+      <div className='D1top'>
+        <span className='D1topllTxt'>仓库列表</span>
+        {topBtnArr.map(v => (
+          <Button onClick={() => setTopAc(v)} key={v} type={topAc === v ? 'primary' : 'default'}>
+            {v}
+          </Button>
+        ))}
+      </div>
+      <div className='D1main'>
+        {topAc === '按库位查看' ? <D1Loc /> : null}
+        {topAc === '按藏品查看' ? <D1goods /> : null}
+      </div>
     </div>
   )
 }

+ 1 - 11
src/pages/D_storeManage/D2storSet/D2site/D2Sadd.tsx

@@ -7,6 +7,7 @@ import { D2_APIaddAdd, D2_APIaddEdit, D2_APIgetAreaList } from '@/store/action/D
 import TextArea from 'antd/es/input/TextArea'
 import { MessageFu } from '@/utils/message'
 import { TypeD2listSite } from '../type'
+import { cartesianProduct } from './data'
 
 type ArrType = {
   name: string
@@ -139,17 +140,6 @@ function D2Sadd({ addObj, sId, addTableFu, closeFu }: Props) {
         }
       })
 
-      // 计算笛卡尔积
-      const cartesianProduct = (arrays: any) => {
-        return arrays.reduce(
-          (acc: any, currentArray: any) =>
-            acc.flatMap((prevArr: any) =>
-              currentArray.map((currentItem: any) => [...prevArr, currentItem])
-            ),
-          [[]]
-        )
-      }
-
       // 生成组合并转换为目标对象数组
       const combinations = cartesianProduct(possibleValues as any)
       const newArr = combinations.map(([num1, num2, num3]: any) => ({ num1, num2, num3 }))

+ 11 - 0
src/pages/D_storeManage/D2storSet/D2site/data.ts

@@ -13,3 +13,14 @@ export const D2checkDuplicate = (items: D2SlistType[]): string[] => {
   // 提取重复的 name
   return Object.keys(nameMap).filter(name => nameMap[name] > 1)
 }
+
+// ------------批量生成 笛卡尔积
+export const cartesianProduct = (arrays: any) => {
+  return arrays.reduce(
+    (acc: any, currentArray: any) =>
+      acc.flatMap((prevArr: any) =>
+        currentArray.map((currentItem: any) => [...prevArr, currentItem])
+      ),
+    [[]]
+  )
+}

+ 4 - 4
src/pages/D_storeManage/D2storSet/index.tsx

@@ -136,28 +136,28 @@ function D2storSet() {
         <div className='D2topll'>
           <span>仓库名称:</span>
           <Input
-            placeholder='请输入仓库名称'
+            placeholder='请输入内容'
             maxLength={30}
             value={formData.name}
             onChange={e => txtChangeFu(e.target.value, 'name')}
           />
           <span>仓库编码:</span>
           <Input
-            placeholder='请输入仓库编码'
+            placeholder='请输入内容'
             maxLength={30}
             value={formData.num}
             onChange={e => txtChangeFu(e.target.value, 'num')}
           />
           <span>仓库负责人:</span>
           <Input
-            placeholder='请输入仓库负责人'
+            placeholder='请输入内容'
             maxLength={30}
             value={formData.managerUser}
             onChange={e => txtChangeFu(e.target.value, 'managerUser')}
           />
           <span>仓库说明:</span>
           <Input
-            placeholder='请输入仓库说明'
+            placeholder='请输入内容'
             maxLength={30}
             value={formData.description}
             onChange={e => txtChangeFu(e.target.value, 'description')}

+ 19 - 19
src/pages/Layout/data.ts

@@ -114,12 +114,12 @@ const tabLeftArr: RouterType = [
     id: 4,
     name: '库存管理',
     son: [
-      // {
-      //   id: 100,
-      //   name: '库房管理',
-      //   path: '/storage',
-      //   Com: React.lazy(() => import('../D_storeManage/D1storage'))
-      // },
+      {
+        id: 100,
+        name: '库房管理',
+        path: '/storage',
+        Com: React.lazy(() => import('../D_storeManage/D1storage'))
+      },
       {
         id: 101,
         name: '库房设置',
@@ -210,19 +210,19 @@ const tabLeftArr: RouterType = [
         name: '编号规则',
         path: '/numRule',
         Com: React.lazy(() => import('../Z_system/Z2numRule'))
-      }
+      },
       // {
       //   id: 102,
       //   name: '流程设置',
       //   path: '/flowSet',
       //   Com: React.lazy(() => import('../Z_system/Z3flowSet'))
       // },
-      // {
-      //   id: 103,
-      //   name: '组织管理',
-      //   path: '/organization',
-      //   Com: React.lazy(() => import('../Z_system/Z4organization'))
-      // },
+      {
+        id: 103,
+        name: '组织管理',
+        path: '/organization',
+        Com: React.lazy(() => import('../Z_system/Z4organization'))
+      },
       // {
       //   id: 9900,
       //   name: '角色管理',
@@ -235,12 +235,12 @@ const tabLeftArr: RouterType = [
       //   path: '/user',
       //   Com: React.lazy(() => import('../Z_system/Z6user'))
       // },
-      // {
-      //   id: 9901,
-      //   name: '系统日志',
-      //   path: '/log',
-      //   Com: React.lazy(() => import('../Z_system/Z7log'))
-      // }
+      {
+        id: 9901,
+        name: '系统日志',
+        path: '/log',
+        Com: React.lazy(() => import('../Z_system/Z7log'))
+      }
     ]
   }
 ]

+ 6 - 0
src/pages/Z_system/Z4organization/index.module.scss

@@ -1,4 +1,10 @@
 .Z4organization {
+  background-color: #fff;
+  border-radius: 10px;
+  padding: 24px;
   :global {
+    .Z4top {
+      text-align: right;
+    }
   }
 }

+ 13 - 2
src/pages/Z_system/Z4organization/index.tsx

@@ -1,10 +1,21 @@
-import React from 'react'
+import React, { useEffect } from 'react'
 import styles from './index.module.scss'
+import { Button } from 'antd'
+import { useDispatch } from 'react-redux'
+import { D4_APIgetTree } from '@/store/action/Z4organization'
 function Z4organization() {
+  const dispatch = useDispatch()
+
+  useEffect(() => {
+    dispatch(D4_APIgetTree())
+  }, [dispatch])
+
   return (
     <div className={styles.Z4organization}>
       <div className='pageTitle'>组织管理</div>
-      <p>待开发</p>
+      <div className='Z4top'>
+        <Button type='primary'>新增</Button>
+      </div>
     </div>
   )
 }

+ 8 - 0
src/store/action/D1storage.ts

@@ -0,0 +1,8 @@
+import http from '@/utils/http'
+
+/**
+ * 库房管理-获取树列表
+ */
+export const D1_APIgetTree = () => {
+  return http.get('cms/storage/st/getTree')
+}

+ 16 - 0
src/store/action/Z4organization.ts

@@ -0,0 +1,16 @@
+import http from '@/utils/http'
+import { AppDispatch } from '..'
+
+/**
+ * 组织管理 - 获取树列表
+ */
+export const D4_APIgetTree = (): any => {
+  return async (dispatch: AppDispatch) => {
+    const res = await http.get('sys/dept/getTree')
+    if (res.code === 0) {
+      console.log(123, res)
+
+      // dispatch({ type: 'D2/getList', payload: obj })
+    }
+  }
+}