Просмотр исходного кода

Merge branch 'master' of http://192.168.0.115:3000/shaogen1995/qingDao_goods

lanxin недель назад: 3
Родитель
Сommit
16012a6a78

+ 13 - 12
src/assets/styles/base.css

@@ -12,6 +12,7 @@ html {
   --themeColor: #002c15;
   --themeColor2: #fddb77;
   --boxBcaColor: #f7efed;
+  --txtColor: #4c7f7a;
 }
 body {
   font: 1em/1.4 'Microsoft Yahei', 'PingFang SC', 'Avenir', 'Segoe UI', 'Hiragino Sans GB', 'STHeiti', 'Microsoft Sans Serif', 'WenQuanYi Micro Hei', sans-serif;
@@ -64,8 +65,6 @@ textarea {
   min-height: 900px;
   overflow: auto;
   overflow-y: overlay;
-  /* 普通文字按钮的颜色 */
-  /* 按钮的危险颜色 */
   /* antd分页器样式 */
   /* 表格的图片居中 */
   /* antd图片预览组件 */
@@ -90,16 +89,6 @@ textarea {
   font-size: 12px;
   border-radius: 50%;
 }
-#root .ant-btn-text {
-  color: #ab925b;
-}
-#root .ant-btn-text:disabled {
-  cursor: not-allowed;
-  color: rgba(0, 0, 0, 0.25);
-}
-#root .ant-btn-text.ant-btn-dangerous {
-  color: #ff4d4d;
-}
 #root .tableImgAuto {
   display: flex;
   justify-content: center;
@@ -190,3 +179,15 @@ textarea {
   height: calc(100% - 60px);
   overflow-y: auto;
 }
+/* 普通文字按钮的颜色 */
+.ant-btn-text {
+  color: #ab925b !important;
+}
+.ant-btn-text:disabled {
+  cursor: not-allowed !important;
+  color: rgba(0, 0, 0, 0.25) !important;
+}
+/* 按钮的危险颜色 */
+.ant-btn-text.ant-btn-dangerous {
+  color: #ff4d4d !important;
+}

+ 18 - 15
src/assets/styles/base.less

@@ -15,6 +15,9 @@ html {
   --themeColor: #002c15;
   --themeColor2: #fddb77;
   --boxBcaColor: #f7efed;
+
+  // 这个项目颜色有点杂
+  --txtColor: #4c7f7a;
 }
 
 body {
@@ -117,21 +120,6 @@ textarea {
   //   color: var(--themeColor);
   // }
 
-  /* 普通文字按钮的颜色 */
-  .ant-btn-text {
-    color: #ab925b;
-  }
-
-  .ant-btn-text:disabled {
-    cursor: not-allowed;
-    color: rgba(0, 0, 0, 0.25);
-  }
-
-  /* 按钮的危险颜色 */
-  .ant-btn-text.ant-btn-dangerous {
-    color: #ff4d4d;
-  }
-
   /* antd分页器样式 */
   // .ant-pagination .ant-pagination-item {
   //   border-radius: 50%;
@@ -322,3 +310,18 @@ textarea {
     overflow-y: auto;
   }
 }
+
+/* 普通文字按钮的颜色 */
+.ant-btn-text {
+  color: #ab925b !important;
+}
+
+.ant-btn-text:disabled {
+  cursor: not-allowed !important;
+  color: rgba(0, 0, 0, 0.25) !important;
+}
+
+/* 按钮的危险颜色 */
+.ant-btn-text.ant-btn-dangerous {
+  color: #ff4d4d !important;
+}

+ 35 - 2
src/pages/Cledger/C1ledger/index.tsx

@@ -1,9 +1,42 @@
-import React from 'react'
+import React, { useCallback, useEffect, useState } from 'react'
 import styles from './index.module.scss'
+import http from '@/utils/http'
+import { GoodsType } from '@/pages/Zother/SonGoodsList/data'
+import { selectObj } from '@/utils/dataChange'
+
+const APITEMP = () => {
+  return http.post('cms/good/ledger/page', { pageSize: 99999 })
+}
+
 function C1ledger() {
+  const [list, setList] = useState<GoodsType[]>([])
+
+  const tmepFu = useCallback(async () => {
+    const res = await APITEMP()
+    if (res.code === 0) {
+      console.log(123456, res)
+      setList(res.data.records || [])
+    }
+  }, [])
+
+  useEffect(() => {
+    tmepFu()
+  }, [tmepFu])
+
   return (
     <div className={styles.C1ledger}>
-      <div className='pageTitle'>藏品总账</div>
+      <div className='pageTitle'>藏品总账-待开发</div>
+
+      <h1>暂时做一个数据查看信息-总条数-{list.length}</h1>
+
+      <div style={{ height: '90%', overflow: 'auto' }}>
+        {list.map(v => (
+          <div key={v.id}>
+            藏品名称:{v.name}--------------藏品编号:{v.num}-------------藏品状态:{v.status}
+            {selectObj['藏品状态'].find(c => c.value === v.status)?.label}
+          </div>
+        ))}
+      </div>
     </div>
   )
 }

+ 1 - 1
src/pages/Eculture/E1tag/E1add.tsx

@@ -173,7 +173,7 @@ function E1add({ addInfo, addFu, closeFu }: Props) {
           </Form.Item>
 
           <Form.Item label='标签说明' name='description'>
-            <TextArea maxLength={100} showCount placeholder='请输入内容' />
+            <TextArea maxLength={500} showCount placeholder='请输入内容' />
           </Form.Item>
 
           <div className='fromRow2'>

+ 117 - 75
src/pages/Eculture/E1tag/index.module.scss

@@ -1,93 +1,135 @@
 .E1tag {
-  background-color: var(--boxBcaColor);
-  border-radius: 10px;
-  padding: 24px;
+  display: flex;
   :global {
-    .E1top {
-      display: flex;
-      justify-content: space-between;
+    .E1son {
+      width: 60%;
+      margin-right: 20px;
+      background-color: var(--boxBcaColor);
+      border-radius: 10px;
+      padding: 24px;
     }
-
-    .E1main {
-      margin-top: 15px;
-      height: calc(100% - 50px);
-      & > div {
-        height: 100%;
-      }
-      .E1Null {
-        width: 100%;
-        height: 300px;
-        font-size: 24px;
-        display: flex;
-        justify-content: center;
-        align-items: center;
+    .E1ll {
+      .E1ll1 {
+        margin-bottom: 20px;
       }
-      .E1m1 {
-        display: flex;
-        justify-content: space-between;
-        .E1m1ll {
-          width: 50%;
-          overflow-y: auto;
-          .site-tree-search-value {
-            color: red;
-            font-weight: 700;
+      .E1ll2 {
+        height: calc(100% - 52px);
+
+        overflow-y: auto;
+        .site-tree-search-value {
+          color: red;
+          font-weight: 700;
+        }
+        .ant-tree {
+          background-color: var(--boxBcaColor);
+          min-height: 100%;
+        }
+        .ant-tree-title span {
+          font-size: 18px;
+        }
+
+        .ant-tree-node-selected {
+          padding: 4px 8px !important;
+          background-color: var(--txtColor) !important;
+          .ant-tree-title span {
+            color: var(--themeColor2) !important;
           }
-          .ant-tree {
-            background-color: var(--boxBcaColor);
-            min-height: 100%;
+        }
+        .NODATA {
+          display: flex;
+          flex-direction: column;
+          justify-content: center;
+          align-items: center;
+          color: #666666;
+          font-size: 16px;
+          height: 100%;
+          // img {
+          //   width: 150px;
+          // }
+          & > p {
+            margin-bottom: 10px;
           }
-          .ant-tree-node-selected {
-            background-color: var(--themeColor2) !important;
+          div {
+            width: 80%;
+            margin-top: 8%;
+            display: flex;
+            justify-content: space-around;
           }
         }
-        .E1m1rr {
-          width: calc(50% - 24px);
-
-          .E1mr2 {
-            .E1mr2Row {
-              display: flex;
-              // align-items: center;
-              margin-bottom: 10px;
-              font-size: 20px;
-              .E1mr2Row1 {
-                font-weight: 700;
-                font-size: 20px;
-              }
+      }
+    }
 
-              .ant-btn {
-                font-size: 20px;
-                height: 46px;
-              }
+    .E1rr {
+      width: calc(40% - 20px);
+      overflow-y: auto;
+      margin-right: 0;
 
-              .E1mr2Row2 {
-                width: calc(100% - 105px);
-                overflow: hidden;
-                text-overflow: ellipsis;
-                white-space: nowrap;
-              }
-              .E1mr2Row2_1 {
-                width: calc(100% - 105px);
-              }
-            }
-            .E1mr2Row0 {
-              margin-bottom: 0;
-              align-items: center;
-            }
-            .E1mr2RowLast {
-              align-items: self-start;
-              .E1mr2Row2 {
-                display: flex;
-                flex-wrap: wrap;
-              }
+      .E1mr2 {
+        .E1mr2_1 {
+          display: flex;
+          align-items: center;
+          justify-content: space-between;
+          font-weight: 700;
+          color: var(--themeColor);
+          font-size: 24px;
+        }
+        .E1mr2_2 {
+          margin: 20px 0 40px;
+          display: flex;
+          .E1mr2Btn {
+            cursor: pointer;
+            margin-right: 15px;
+            width: 130px;
+            height: 40px;
+            line-height: 38px;
+            text-align: center;
+            color: #fff;
+            background-color: var(--txtColor);
+            border-radius: 4px;
+            font-size: 18px;
+            letter-spacing: 2px;
+            border: 1px solid transparent;
+            transition: all 0.3s;
+            &:hover {
+              transform: scale(1.1);
             }
           }
+          .E1mr2Btn2 {
+            color: #ff4d4d;
+            background-color: #fff;
+            border: 1px solid #ccc;
+          }
+        }
+
+        .E1mr2Row {
+          display: flex;
+          font-size: 20px;
+          margin-bottom: 30px;
+          .E1mr2Row1 {
+            font-weight: 700;
+            font-size: 20px;
+            width: 100px;
+          }
 
-          .E1mr3 {
-            margin-top: 15px;
-            height: calc(100% - 100px);
-            background-color: red;
+          .E1mr2Row2 {
+            width: calc(100% - 100px);
+            word-wrap: break-word;
           }
         }
+
+        .E1mr2RowLast {
+          align-items: self-start;
+          .E1mr2Row2 {
+            display: flex;
+            flex-wrap: wrap;
+          }
+        }
+      }
+
+      .E1mr3 {
+        margin-top: 15px;
+        height: calc(100% - 100px);
+        background-color: red;
       }
     }
   }

+ 93 - 76
src/pages/Eculture/E1tag/index.tsx

@@ -8,6 +8,7 @@ import { MessageFu } from '@/utils/message'
 import { E1_APIdel, E1_APIgetTree } from '@/store/action/Eculture/E1tag'
 import { filterTreeByName, treeResIdFu } from '@/pages/Isystem/I2dict/data'
 import { I5AddInfoType, TypeI5Tree } from '@/pages/Isystem/I5organization/data'
+import classNames from 'classnames'
 import E1add from './E1add'
 
 function E1tag() {
@@ -150,87 +151,103 @@ function E1tag() {
   return (
     <div className={styles.E1tag}>
       <div className='pageTitle'>标签管理</div>
-      <div className='E1top'>
-        <Input
-          style={{ width: 300 }}
-          placeholder='请输入标签名称'
-          maxLength={30}
-          showCount
-          value={value}
-          onChange={e => valueChange(e.target.value)}
-          allowClear
-        />
-        <Button
-          type='primary'
-          onClick={() => setAddInfo({ id: '-1', txt: '新增', acInfo: rightData })}
-        >
-          新增
-        </Button>
+
+      {/* 左侧 */}
+      <div className='E1son E1ll'>
+        <div className='E1ll1'>
+          <Input
+            style={{ width: 300 }}
+            placeholder='请输入标签名称'
+            maxLength={30}
+            showCount
+            value={value}
+            onChange={e => valueChange(e.target.value)}
+            allowClear
+          />
+        </div>
+        <div className='E1ll2'>
+          {treeDataTemp && treeDataTemp.length ? (
+            <Tree
+              // 默认全部展开
+              defaultExpandAll={true}
+              // 数据
+              treeData={treeData}
+              // 自定义字段
+              // fieldNames={{ title: 'title', key: 'key', children: 'children' }}
+              // 选中
+              selectedKeys={[acShu]}
+              // 点击
+              onSelect={onSelect}
+            />
+          ) : loding ? (
+            <div className='NODATA'>暂无相关搜索结果,请更换关键字搜索</div>
+          ) : null}
+        </div>
       </div>
+      <div className='E1son E1rr'>
+        {rightData.id ? (
+          <>
+            <div className='E1mr2'>
+              <div className='E1mr2_1'>
+                <div>操作:</div>
+                <Button
+                  size='large'
+                  type='primary'
+                  onClick={() => setAddInfo({ id: '-1', txt: '新增', acInfo: rightData })}
+                >
+                  新增
+                </Button>
+              </div>
+
+              <div className='E1mr2_2'>
+                <div onClick={() => addSonFu(rightData.id)} className={classNames('E1mr2Btn')}>
+                  编辑
+                </div>
+                &emsp;
+                <MyPopconfirm
+                  txtK='删除'
+                  onConfirm={() => delTree(rightData.id)}
+                  disabled={rightData.parentId === '0'}
+                  Dom={<div className={classNames('E1mr2Btn E1mr2Btn2')}>删除</div>}
+                />
+              </div>
+
+              <div className='E1mr2Row'>
+                <div className='E1mr2Row1'>标签名称:</div>
+                <div className='E1mr2Row2'>{rightData.name}</div>
+              </div>
+
+              <div className='E1mr2Row'>
+                <div className='E1mr2Row1'>层级:</div>
+                <div className='E1mr2Row2'>{rightData.level}</div>
+              </div>
+              {/* <div className='E1mr2Row'>
+                    <div className='E1mr2Row1'>id:</div>
+                    <div className='E1mr2Row2'>{rightData.id}</div>
+                  </div> */}
+
+              <div className='E1mr2Row'>
+                <div className='E1mr2Row1'>排序值:</div>
+                <div className='E1mr2Row2'>{rightData.sort}</div>
+              </div>
+
+              <div className='E1mr2Row'>
+                <div className='E1mr2Row1'>标签说明:</div>
+                <div className='E1mr2Row2'>{rightData.description || '(空)'}</div>
+              </div>
+            </div>
+          </>
+        ) : null}
+      </div>
+
+      {/* 右侧 */}
+
+      <div className='E1top'></div>
 
       {/* 主体 */}
       <div className='E1main'>
         <div className='E1m1'>
-          <div className='E1m1ll'>
-            {treeDataTemp && treeDataTemp.length ? (
-              <Tree
-                // 默认全部展开
-                defaultExpandAll={true}
-                // 数据
-                treeData={treeData}
-                // 自定义字段
-                // fieldNames={{ title: 'title', key: 'key', children: 'children' }}
-                // 选中
-                selectedKeys={[acShu]}
-                // 点击
-                onSelect={onSelect}
-              />
-            ) : loding ? (
-              <div className='E1Null'>暂无数据</div>
-            ) : null}
-          </div>
-          <div className='E1m1rr'>
-            {rightData.id ? (
-              <>
-                <div className='E1mr2'>
-                  <div className='E1mr2Row E1mr2Row0'>
-                    <div className='E1mr2Row1'>操作:</div>
-                    <div>
-                      <Button type='text' onClick={() => addSonFu(rightData.id)}>
-                        编辑
-                      </Button>
-                      &emsp;
-                      <MyPopconfirm txtK='删除' onConfirm={() => delTree(rightData.id)} />
-                    </div>
-                  </div>
-
-                  <div className='E1mr2Row'>
-                    <div className='E1mr2Row1'>标签名称:</div>
-                    <div>{rightData.name}</div>
-                  </div>
-
-                  <div className='E1mr2Row'>
-                    <div className='E1mr2Row1'>标签说明:</div>
-                    <div className='E1mr2Row2_1'>{rightData.description || '(空)'}</div>
-                  </div>
-
-                  <div className='E1mr2Row'>
-                    <div className='E1mr2Row1'>层级:</div>
-                    <div>{rightData.level}</div>
-                  </div>
-                  {/* <div className='E1mr2Row'>
-                    <div className='E1mr2Row1'>id:</div>
-                    <div>{rightData.id}</div>
-                  </div> */}
-
-                  <div className='E1mr2Row'>
-                    <div className='E1mr2Row1'>排序值:</div>
-                    <div>{rightData.sort}</div>
-                  </div>
-                </div>
-              </>
-            ) : null}
-          </div>
+          <div className='E1m1rr'></div>
         </div>
       </div>
       {/* 新增/编辑页面 中图法分类 */}

+ 1 - 1
src/pages/Isystem/I2dict/I2add.tsx

@@ -173,7 +173,7 @@ function I2add({ addInfo, addFu, closeFu }: Props) {
             <Input maxLength={20} showCount placeholder='请输入内容' />
           </Form.Item>
 
-          <Form.Item label='说明' name='intro'>
+          <Form.Item label='字典说明' name='intro'>
             <TextArea maxLength={500} showCount placeholder='请输入内容' />
           </Form.Item>
 

+ 81 - 47
src/pages/Isystem/I2dict/index.module.scss

@@ -1,23 +1,20 @@
 .I2dict {
-  background-color: var(--boxBcaColor);
-  border-radius: 10px;
-  padding: 24px;
+  display: flex;
   :global {
-    .I2top {
-      display: flex;
-      justify-content: space-between;
-      .I2topll {
-        display: flex;
-        align-items: center;
-      }
+    .I2son {
+      width: 60%;
+      margin-right: 20px;
+      background-color: var(--boxBcaColor);
+      border-radius: 10px;
+      padding: 24px;
     }
-    .I2main {
-      margin-top: 20px;
-      height: calc(100% - 30px);
-      display: flex;
-      justify-content: space-between;
-      .I2m1ll {
-        width: 60%;
+
+    .I2ll {
+      .I2ll1 {
+        margin-bottom: 20px;
+      }
+      .I2ll2 {
+        height: calc(100% - 52px);
         overflow-y: auto;
         .site-tree-search-value {
           color: red;
@@ -61,43 +58,80 @@
             justify-content: space-around;
           }
         }
+        .ant-tree-title span {
+          font-size: 18px;
+        }
+
         .ant-tree-node-selected {
-          background-color: var(--themeColor2) !important;
+          padding: 4px 8px !important;
+          background-color: var(--txtColor) !important;
+          .ant-tree-title span {
+            color: var(--themeColor2) !important;
+          }
         }
       }
-      .I2m1rr {
-        width: calc(40% - 24px);
-        overflow-y: auto;
-        padding: 20px;
-        .I2mr1 {
-          font-weight: 700;
-          color: var(--themeColor);
-          font-size: 24px;
-          & > span {
-            color: #999;
-            font-size: 14px;
-          }
+    }
+
+    .I2rr {
+      width: calc(40% - 20px);
+      overflow-y: auto;
+      margin-right: 0;
+      .I2mr1 {
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        font-weight: 700;
+        color: var(--themeColor);
+        font-size: 24px;
+        .I2mr1Tit {
+          color: #999;
+          font-size: 14px;
         }
-        .I2mr2 {
-          margin: 20px 0 40px;
-          .ant-btn {
-            font-size: 24px;
-            height: 46px;
+      }
+      .I2mr2 {
+        margin: 20px 0 40px;
+        display: flex;
+        .I2mr2Btn {
+          cursor: pointer;
+          margin-right: 15px;
+          width: 130px;
+          height: 40px;
+          line-height: 38px;
+          text-align: center;
+          color: #fff;
+          background-color: var(--txtColor);
+          border-radius: 4px;
+          font-size: 18px;
+          letter-spacing: 2px;
+          border: 1px solid transparent;
+          transition: all 0.3s;
+          &:hover {
+            transform: scale(1.1);
           }
         }
+        .I2mr2Btn2 {
+          color: #ff4d4d;
+          background-color: #fff;
+          border: 1px solid #ccc;
+        }
+        .I2mr2BtnNo {
+          color: #fff;
+          background-color: #ccc;
+          pointer-events: none;
+        }
+      }
 
-        .I2mr3 {
-          display: flex;
-          font-size: 20px;
-          margin-bottom: 30px;
-          .I2mr3ll {
-            width: 100px;
-            text-align: right;
-            font-weight: 700;
-          }
-          .I2mr3rr {
-            width: calc(100% - 100px);
-          }
+      .I2mr3 {
+        display: flex;
+        font-size: 20px;
+        margin-bottom: 30px;
+        .I2mr3ll {
+          width: 100px;
+          font-weight: 700;
+        }
+        .I2mr3rr {
+          width: calc(100% - 100px);
+          word-wrap: break-word;
         }
       }
     }

+ 77 - 62
src/pages/Isystem/I2dict/index.tsx

@@ -9,6 +9,7 @@ import { I2_APIdel, I2_APIgetDict } from '@/store/action/Isystem/I2dict'
 import { filterTreeByName, I2AddInfoType, treeResIdFu } from './data'
 import I2add from './I2add'
 import { TypeI5Tree } from '../I5organization/data'
+import classNames from 'classnames'
 
 function I2dict() {
   const [loding, setLoding] = useState(false)
@@ -149,9 +150,10 @@ function I2dict() {
   return (
     <div className={styles.I2dict}>
       <div className='pageTitle'>数据字典</div>
-      {/* 顶部 */}
-      <div className='I2top'>
-        <div className='I2topll'>
+
+      {/* 左侧 */}
+      <div className='I2son I2ll'>
+        <div className='I2ll1'>
           <Input
             style={{ width: 300 }}
             placeholder='请输入字典值'
@@ -162,26 +164,8 @@ function I2dict() {
             allowClear
           />
         </div>
-        <div className='I2toprr'>
-          <Button
-            type='primary'
-            onClick={() =>
-              setAddInfo({
-                id: '-1',
-                txt: '新增',
-                acInfo: rightData
-              })
-            }
-          >
-            新增
-          </Button>
-          {/* &emsp; */}
-          {/* <Button onClick={() => resetFu(true)}>重置</Button> */}
-        </div>
-      </div>
-      {/* 主体 */}
-      <div className='I2main'>
-        <div className='I2m1ll'>
+
+        <div className='I2ll2'>
           {treeDataTemp && treeDataTemp.length ? (
             <Tree
               // 默认全部展开
@@ -203,56 +187,87 @@ function I2dict() {
             </div>
           ) : null}
         </div>
-        <div className='I2m1rr'>
-          {rightData.id ? (
-            <>
-              <div className='I2mr1'>
-                操作 <span>{rightData.parentId === '0' ? '(一级字典不可编辑)' : ''}</span>
+      </div>
+
+      {/* 右侧 */}
+      <div className='I2son I2rr'>
+        {rightData.id ? (
+          <>
+            <div className='I2mr1'>
+              <div>
+                操作{' '}
+                <span className='I2mr1Tit'>
+                  {rightData.parentId === '0' ? '(一级字典不可编辑)' : ''}
+                </span>
               </div>
-              <div className='I2mr2'>
-                <Button
-                  type='text'
-                  onClick={() => addSonFu(rightData.id)}
-                  disabled={rightData.parentId === '0'}
-                >
-                  编辑
-                </Button>
-                &emsp;
-                <MyPopconfirm
-                  txtK='删除'
-                  onConfirm={() => delTree(rightData.id)}
-                  disabled={rightData.parentId === '0'}
-                />
+
+              <Button
+                size='large'
+                type='primary'
+                onClick={() =>
+                  setAddInfo({
+                    id: '-1',
+                    txt: '新增',
+                    acInfo: rightData
+                  })
+                }
+              >
+                新增
+              </Button>
+            </div>
+            <div className='I2mr2'>
+              <div
+                onClick={() => addSonFu(rightData.id)}
+                className={classNames('I2mr2Btn', rightData.parentId === '0' ? 'I2mr2BtnNo' : '')}
+              >
+                编辑
               </div>
+              &emsp;
+              <MyPopconfirm
+                txtK='删除'
+                onConfirm={() => delTree(rightData.id)}
+                disabled={rightData.parentId === '0'}
+                Dom={
+                  <div
+                    className={classNames(
+                      'I2mr2Btn I2mr2Btn2',
+                      rightData.parentId === '0' ? 'I2mr2BtnNo' : ''
+                    )}
+                  >
+                    删除
+                  </div>
+                }
+              />
+            </div>
 
-              {/* <div className='I2mr3'>
+            {/* <div className='I2mr3'>
                 <div className='I2mr3ll'>id:</div>
                 <div className='I2mr3rr'>{rightData.id}</div>
               </div> */}
 
-              <div className='I2mr3'>
-                <div className='I2mr3ll'>字典值:</div>
-                <div className='I2mr3rr'>{rightData.name}</div>
-              </div>
+            <div className='I2mr3'>
+              <div className='I2mr3ll'>字典值:</div>
+              <div className='I2mr3rr'>{rightData.name}</div>
+            </div>
 
-              <div className='I2mr3'>
-                <div className='I2mr3ll'>层级:</div>
-                <div className='I2mr3rr'>{rightData.level}</div>
-              </div>
+            <div className='I2mr3'>
+              <div className='I2mr3ll'>层级:</div>
+              <div className='I2mr3rr'>{rightData.level}</div>
+            </div>
 
-              <div className='I2mr3'>
-                <div className='I2mr3ll'>排序值:</div>
-                <div className='I2mr3rr'>{rightData.sort}</div>
-              </div>
+            <div className='I2mr3'>
+              <div className='I2mr3ll'>排序值:</div>
+              <div className='I2mr3rr'>{rightData.sort}</div>
+            </div>
 
-              <div className='I2mr3'>
-                <div className='I2mr3ll'>说明:</div>
-                <div className='I2mr3rr'>{rightData.intro || '(空)'}</div>
-              </div>
-            </>
-          ) : null}
-        </div>
+            <div className='I2mr3'>
+              <div className='I2mr3ll'>字典说明:</div>
+              <div className='I2mr3rr'>{rightData.intro || '(空)'}</div>
+            </div>
+          </>
+        ) : null}
       </div>
+
       {/* 新增/编辑页面 中图法分类 */}
       {addInfo.id ? (
         <I2add

+ 111 - 74
src/pages/Isystem/I5organization/index.module.scss

@@ -1,91 +1,128 @@
 .I5organization {
-  background-color: var(--boxBcaColor);
-  border-radius: 10px;
-  padding: 24px;
+  display: flex;
   :global {
-    .I5top {
-      display: flex;
-      justify-content: space-between;
+    .I5son {
+      width: 60%;
+      margin-right: 20px;
+      background-color: var(--boxBcaColor);
+      border-radius: 10px;
+      padding: 24px;
     }
 
-    .I5main {
-      margin-top: 15px;
-      height: calc(100% - 50px);
-      & > div {
-        height: 100%;
+    .I5ll {
+      .I5ll1 {
+        margin-bottom: 20px;
       }
-      .I5Null {
-        width: 100%;
-        height: 300px;
-        font-size: 24px;
-        display: flex;
-        justify-content: center;
-        align-items: center;
-      }
-      .I5m1 {
-        display: flex;
-        justify-content: space-between;
-        .I5m1ll {
-          width: 50%;
-          overflow-y: auto;
-          .site-tree-search-value {
-            color: red;
-            font-weight: 700;
+
+      .I5ll2 {
+        height: calc(100% - 52px);
+        overflow-y: auto;
+        .site-tree-search-value {
+          color: red;
+          font-weight: 700;
+        }
+        .ant-tree {
+          background-color: var(--boxBcaColor);
+          min-height: 100%;
+        }
+        .ant-tree-title span {
+          font-size: 18px;
+        }
+
+        .ant-tree-node-selected {
+          padding: 4px 8px !important;
+          background-color: var(--txtColor) !important;
+          .ant-tree-title span {
+            color: var(--themeColor2) !important;
           }
-          .ant-tree {
-            background-color: var(--boxBcaColor);
-            min-height: 100%;
+        }
+        .NODATA {
+          display: flex;
+          flex-direction: column;
+          justify-content: center;
+          align-items: center;
+          color: #666666;
+          font-size: 16px;
+          height: 100%;
+          // img {
+          //   width: 150px;
+          // }
+          & > p {
+            margin-bottom: 10px;
           }
-          .ant-tree-node-selected {
-            background-color: var(--themeColor2) !important;
+          div {
+            width: 80%;
+            margin-top: 8%;
+            display: flex;
+            justify-content: space-around;
           }
         }
-        .I5m1rr {
-          width: calc(50% - 24px);
+      }
+    }
 
-          .I5mr2 {
-            .I5mr2Row {
-              display: flex;
-              // align-items: center;
-              margin-bottom: 10px;
-              font-size: 20px;
-              .I5mr2Row1 {
-                font-weight: 700;
-                font-size: 20px;
-              }
+    .I5rr {
+      width: calc(40% - 20px);
+      overflow-y: auto;
+      margin-right: 0;
+      .I5mr2 {
+        .I5mr2_1 {
+          display: flex;
+          align-items: center;
+          justify-content: space-between;
+          font-weight: 700;
+          color: var(--themeColor);
+          font-size: 24px;
+        }
+        .I5mr2_2 {
+          margin: 20px 0 40px;
+          display: flex;
+          .I5mr2Btn {
+            cursor: pointer;
+            margin-right: 15px;
+            width: 130px;
+            height: 40px;
+            line-height: 38px;
+            text-align: center;
+            color: #fff;
+            background-color: var(--txtColor);
+            border-radius: 4px;
+            font-size: 18px;
+            letter-spacing: 2px;
+            border: 1px solid transparent;
+            transition: all 0.3s;
+            &:hover {
+              transform: scale(1.1);
+            }
+          }
+          .I5mr2Btn2 {
+            color: #ff4d4d;
+            background-color: #fff;
+            border: 1px solid #ccc;
+          }
+        }
 
-              .ant-btn {
-                font-size: 20px;
-                height: 46px;
-              }
+        .I5mr2Row {
+          display: flex;
+          font-size: 20px;
+          margin-bottom: 30px;
 
-              .I5mr2Row2 {
-                width: calc(100% - 105px);
-                overflow: hidden;
-                text-overflow: ellipsis;
-                white-space: nowrap;
-              }
-              .I5mr2Row2_1 {
-                width: calc(100% - 105px);
-              }
-            }
-            .I5mr2Row0 {
-              margin-bottom: 0;
-              align-items: center;
-            }
-            .I5mr2RowLast {
-              align-items: self-start;
-              .I5mr2Row2 {
-                display: flex;
-                flex-wrap: wrap;
-              }
-            }
+          .I5mr2Row1 {
+            font-weight: 700;
+            font-size: 20px;
+            width: 100px;
           }
 
-          .I5mr3 {
-            margin-top: 15px;
-            height: calc(100% - 100px);
-            background-color: red;
+          .I5mr2Row2 {
+            width: calc(100% - 100px);
+            word-wrap: break-word;
+          }
+        }
+
+        .I5mr2RowLast {
+          align-items: self-start;
+          .I5mr2Row2 {
+            display: flex;
+            flex-wrap: wrap;
           }
         }
       }

+ 101 - 92
src/pages/Isystem/I5organization/index.tsx

@@ -8,7 +8,9 @@ import { MessageFu } from '@/utils/message'
 import { I5_APIdel, I5_APIgetTree, I5_APIgetUserById } from '@/store/action/Isystem/I5organization'
 import { I5AddInfoType, TypeI5Tree, TypeI5UserList } from './data'
 import { filterTreeByName, treeResIdFu } from '../I2dict/data'
+import classNames from 'classnames'
 import I5add from './I5add'
+
 function I5organization() {
   const dispatch = useDispatch()
 
@@ -163,104 +165,111 @@ function I5organization() {
   return (
     <div className={styles.I5organization}>
       <div className='pageTitle'>组织管理</div>
-      <div className='I5top'>
-        <Input
-          style={{ width: 300 }}
-          placeholder='请输入部门名称'
-          maxLength={30}
-          showCount
-          value={value}
-          onChange={e => valueChange(e.target.value)}
-          allowClear
-        />
-        <Button
-          type='primary'
-          onClick={() => setAddInfo({ id: '-1', txt: '新增', acInfo: rightData })}
-        >
-          新增
-        </Button>
-      </div>
 
-      {/* 主体 */}
-      <div className='I5main'>
-        <div className='I5m1'>
-          <div className='I5m1ll'>
-            {treeDataTemp && treeDataTemp.length ? (
-              <Tree
-                // 默认全部展开
-                defaultExpandAll={true}
-                // 数据
-                treeData={treeData}
-                // 自定义字段
-                // fieldNames={{ title: 'title', key: 'key', children: 'children' }}
-                // 选中
-                selectedKeys={[acShu]}
-                // 点击
-                onSelect={onSelect}
-              />
-            ) : loding ? (
-              <div className='I5Null'>暂无数据</div>
-            ) : null}
-          </div>
-          <div className='I5m1rr'>
-            {rightData.id ? (
-              <>
-                <div className='I5mr2'>
-                  <div className='I5mr2Row I5mr2Row0'>
-                    <div className='I5mr2Row1'>操作:</div>
-                    <div>
-                      <Button type='text' onClick={() => addSonFu(rightData.id)}>
-                        编辑
-                      </Button>
-                      &emsp;
-                      <MyPopconfirm txtK='删除' onConfirm={() => delTree(rightData.id)} />
-                    </div>
-                  </div>
-
-                  <div className='I5mr2Row'>
-                    <div className='I5mr2Row1'>部门名称:</div>
-                    <div>{rightData.name}</div>
-                  </div>
-
-                  <div className='I5mr2Row'>
-                    <div className='I5mr2Row1'>部门说明:</div>
-                    <div className='I5mr2Row2_1'>{rightData.description || '(空)'}</div>
-                  </div>
-
-                  <div className='I5mr2Row'>
-                    <div className='I5mr2Row1'>层级:</div>
-                    <div>{rightData.level}</div>
-                  </div>
-                  {/* <div className='I5mr2Row'>
+      {/* 左侧 */}
+      <div className='I5son I5ll'>
+        <div className='I5ll1'>
+          <Input
+            style={{ width: 300 }}
+            placeholder='请输入部门名称'
+            maxLength={30}
+            showCount
+            value={value}
+            onChange={e => valueChange(e.target.value)}
+            allowClear
+          />
+        </div>
+        <div className='I5ll2'>
+          {treeDataTemp && treeDataTemp.length ? (
+            <Tree
+              // 默认全部展开
+              defaultExpandAll={true}
+              // 数据
+              treeData={treeData}
+              // 自定义字段
+              // fieldNames={{ title: 'title', key: 'key', children: 'children' }}
+              // 选中
+              selectedKeys={[acShu]}
+              // 点击
+              onSelect={onSelect}
+            />
+          ) : loding ? (
+            <div className='NODATA'>暂无相关搜索结果,请更换关键字搜索</div>
+          ) : null}
+        </div>
+      </div>
+      {/* 右侧 */}
+      <div className='I5son I5rr'>
+        {rightData.id ? (
+          <>
+            <div className='I5mr2'>
+              <div className='I5mr2_1'>
+                <div>操作:</div>
+                <Button
+                  size='large'
+                  type='primary'
+                  onClick={() => setAddInfo({ id: '-1', txt: '新增', acInfo: rightData })}
+                >
+                  新增
+                </Button>
+              </div>
+
+              <div className='I5mr2_2'>
+                <div onClick={() => addSonFu(rightData.id)} className={classNames('I5mr2Btn')}>
+                  编辑
+                </div>
+                &emsp;
+                <MyPopconfirm
+                  txtK='删除'
+                  onConfirm={() => delTree(rightData.id)}
+                  disabled={rightData.parentId === '0'}
+                  Dom={<div className={classNames('I5mr2Btn I5mr2Btn2')}>删除</div>}
+                />
+              </div>
+
+              <div className='I5mr2Row'>
+                <div className='I5mr2Row1'>部门名称:</div>
+                <div className='I5mr2Row2'>{rightData.name}</div>
+              </div>
+
+              <div className='I5mr2Row'>
+                <div className='I5mr2Row1'>层级:</div>
+                <div className='I5mr2Row2'>{rightData.level}</div>
+              </div>
+              {/* <div className='I5mr2Row'>
                     <div className='I5mr2Row1'>id:</div>
-                    <div>{rightData.id}</div>
+                    <div className='I5mr2Row2'>{rightData.id}</div>
                   </div> */}
 
-                  <div className='I5mr2Row'>
-                    <div className='I5mr2Row1'>排序值:</div>
-                    <div>{rightData.sort}</div>
-                  </div>
-
-                  <div className='I5mr2Row I5mr2RowLast'>
-                    <div className='I5mr2Row1'>相关成员:</div>
-                    <div className='I5mr2Row2'>
-                      {userList.length
-                        ? userList.map((v, i) => (
-                            <div key={v.userId}>
-                              {v.userName}
-                              {v.isLeader === 1 ? '(部门主管)' : ''}
-                              {i < userList.length - 1 ? ',' : ''}
-                            </div>
-                          ))
-                        : '(空)'}
-                    </div>
-                  </div>
+              <div className='I5mr2Row'>
+                <div className='I5mr2Row1'>排序值:</div>
+                <div className='I5mr2Row2'>{rightData.sort}</div>
+              </div>
+
+              <div className='I5mr2Row'>
+                <div className='I5mr2Row1'>部门说明:</div>
+                <div className='I5mr2Row2'>{rightData.description || '(空)'}</div>
+              </div>
+
+              <div className='I5mr2Row I5mr2RowLast'>
+                <div className='I5mr2Row1'>相关成员:</div>
+                <div className='I5mr2Row2'>
+                  {userList.length
+                    ? userList.map((v, i) => (
+                        <div key={v.userId}>
+                          {v.userName}
+                          {v.isLeader === 1 ? '(部门主管)' : ''}
+                          {i < userList.length - 1 ? ',' : ''}
+                        </div>
+                      ))
+                    : '(空)'}
                 </div>
-              </>
-            ) : null}
-          </div>
-        </div>
+              </div>
+            </div>
+          </>
+        ) : null}
       </div>
+
       {/* 新增/编辑页面 中图法分类 */}
       {addInfo.id ? (
         <I5add

+ 53 - 29
src/pages/Zother/AddGoods/index.tsx

@@ -15,6 +15,7 @@ import { API_getGoodsInfo } from '@/store/action/Cledger/C1ledger'
 import { MessageFu } from '@/utils/message'
 import { API_getFileListByIds } from '@/store/action/Cledger/C4file'
 import { FileUpInfoType } from '../data'
+import { useInfo } from '../InfoContext'
 
 // 级联的数据转换成字符串
 export const cascaderChArr = [
@@ -49,6 +50,8 @@ type Props = {
 }
 
 function AddGoods({ closeFu, succFu, isEdit, moduleId, info, APIsave, fileUpInfo }: Props) {
+  const { delSnapIdsRef } = useInfo()
+
   // 获取标签 树结构
   const E1tree = useSelector((state: RootState) => state.E1tag.treeData)
 
@@ -64,41 +67,51 @@ function AddGoods({ closeFu, succFu, isEdit, moduleId, info, APIsave, fileUpInfo
   // 藏品编辑模块用来对比
   const objOld = useRef({} as GoodsType)
 
-  // 编辑进来获取详情
-  const getInfo = useCallback(async (id: number) => {
-    const res = await API_getGoodsInfo(id)
-    if (res.code === 0) {
-      // 藏品编辑信息保存
-      objOld.current = { ...res.data }
+  const resInfoFu = useCallback(async (infoRes: GoodsType) => {
+    // 藏品编辑信息保存
+    objOld.current = { ...infoRes }
 
-      const obj = { ...res.data }
-      // makeDate inGoodYear 2个日期需要格式处理一下
-      if (obj.makeDate) obj.makeDate = dayjs(obj.makeDate)
-      if (obj.inGoodYear) obj.inGoodYear = dayjs(obj.inGoodYear)
+    const obj: any = { ...infoRes }
+    // makeDate inGoodYear 2个日期需要格式处理一下
+    if (obj.makeDate) obj.makeDate = dayjs(obj.makeDate)
+    if (obj.inGoodYear) obj.inGoodYear = dayjs(obj.inGoodYear)
 
-      cascaderChArr.forEach(v => {
-        if (obj[v] === '0') obj[v] = null
-        else if (obj[v]) {
-          obj[v] = obj[v].split(',')
-        }
-      })
+    cascaderChArr.forEach(v => {
+      if (obj[v] === '0') obj[v] = null
+      else if (obj[v]) {
+        obj[v] = obj[v].split(',')
+      }
+    })
 
-      addZiSelectChArr.forEach(v => {
-        if (!obj[v]) obj[v] = null
-      })
+    addZiSelectChArr.forEach(v => {
+      if (!obj[v]) obj[v] = null
+    })
 
-      FormBoxRef.current?.setFieldsValue(obj)
+    FormBoxRef.current?.setFieldsValue(obj)
 
-      // 设置附件
-      if (obj.fileIds) {
-        const fileRes = await API_getFileListByIds(obj.fileIds.split(','))
-        if (fileRes.code === 0) {
-          fileRef.current?.sonSetListFu(fileRes.data || [])
-        }
+    // 设置附件
+    if (obj.fileIds) {
+      const fileRes = await API_getFileListByIds(obj.fileIds.split(','))
+      if (fileRes.code === 0) {
+        fileRef.current?.sonSetListFu(fileRes.data || [])
       }
     }
   }, [])
 
+  // 编辑进来获取详情
+  const getInfo = useCallback(
+    async (id: number) => {
+      if (info.pageType === 'clue') {
+        // 从征集进来 不用拿详情
+        resInfoFu(info)
+      } else {
+        const res = await API_getGoodsInfo(id)
+        if (res.code === 0) resInfoFu(res.data)
+      }
+    },
+    [info, resInfoFu]
+  )
+
   useEffect(() => {
     if (info.id > 0) getInfo(info.id)
   }, [getInfo, info.id])
@@ -121,7 +134,7 @@ function AddGoods({ closeFu, succFu, isEdit, moduleId, info, APIsave, fileUpInfo
 
       const obj = {
         ...values,
-        id: info.id > 0 ? info.id : null,
+        id: info.pageType === 'clue' ? null : info.id > 0 ? info.id : null,
         makeDate,
         inGoodYear,
         fileIds: flieList.map((v: any) => v.id).join(','),
@@ -145,11 +158,22 @@ function AddGoods({ closeFu, succFu, isEdit, moduleId, info, APIsave, fileUpInfo
       const res = await APIsave(obj)
       if (res.code === 0) {
         MessageFu.success(info.id > 0 ? '编辑成功' : '新增成功')
-        succFu(info.id > 0 ? '编辑' : '新增', res.data)
+        // if (1 + 1 === 2) {
+        //   console.log('----------------', info)
+        //   return
+        // }
+
+        const resObj = { ...res.data }
+        if (info.pageType === 'clue') {
+          resObj.clueId = info.id
+          if (info.id2) delSnapIdsRef.current.push(info.id2)
+        }
+
+        succFu(info.id > 0 ? '编辑' : '新增', resObj)
         closeFu()
       }
     },
-    [APIsave, closeFu, info.id, succFu]
+    [APIsave, closeFu, delSnapIdsRef, info, succFu]
   )
 
   return (

+ 63 - 23
src/pages/Zother/EditBtn/index.tsx

@@ -10,6 +10,7 @@ import { MessageFu } from '@/utils/message'
 import { fileIdsResFu } from '@/utils'
 import { API_objType } from '@/store/action/Dmanage/D1register'
 import AuditList from '../AuditList'
+import { GoodsType } from '../SonGoodsList/data'
 
 type Props = {
   path: string
@@ -42,6 +43,28 @@ function EditBtn({ path, APIobj, checkListTxt = '藏品' }: Props) {
     }
   }, [btnCan])
 
+  // 藏品登记号为空 和重复的判断
+  const numFlag = (data: GoodsType[]) => {
+    const numSet = new Set<string>()
+
+    for (const item of data) {
+      // 检查是否为空
+      if (!item.num || item.num.trim() === '') {
+        return `${item.name} - 藏品登记号不能为空`
+      }
+
+      // 检查是否重复
+      if (numSet.has(item.num)) {
+        const duplicateNames = data.filter(d => d.num === item.num).map(d => d.name)
+        return `${duplicateNames.join(' / ')} - 藏品登记号重复`
+      }
+
+      numSet.add(item.num)
+    }
+
+    return null
+  }
+
   // 点击按钮触发事件
   const sonClick = useCallback(
     async (val: string, flag?: string) => {
@@ -49,23 +72,35 @@ function EditBtn({ path, APIobj, checkListTxt = '藏品' }: Props) {
       // 新增、编辑、审批、查看互相跳转
       if (flag) pageSkitFu(path, val, info.id, flag)
       else {
-        const obj = {
-          ...info,
-          fileIds: fileIdsResFu(info.files),
-          goodIds: snaps
-            .filter(c => !c.isNew)
-            .map(v => v.id)
-            .join(','),
-          delSnapIds: delSnapIdsRef.current.length ? delSnapIdsRef.current : '',
-          snaps: snaps.map(v => ({
-            goodsId: v.isNew ? null : v.id,
+        const goodIdArr: number[] = []
+        const collectIdArr: number[] = []
+        const snapsArr: any[] = []
+
+        snaps.forEach(v => {
+          // 从征集中选的藏品--并且没有在点编辑(点提交)存到藏品数据库。这时候就属于征集id
+          const flag = v.pageType === 'clue' && !v.clueId
+
+          if (flag) collectIdArr.push(v.id)
+          else goodIdArr.push(v.id)
+
+          snapsArr.push({
+            goodsId: v.isNew || flag ? null : v.id,
             id: v.id2 ? v.id2 : null,
             orderId: info.id,
             snap: JSON.stringify({
               ...v,
-              id: v.isNew ? null : v.id
+              id: v.isNew || flag ? null : v.id
             })
-          }))
+          })
+        })
+
+        const obj = {
+          ...info,
+          fileIds: fileIdsResFu(info.files),
+          goodIds: goodIdArr.join(','),
+          collectIds: collectIdArr.join(','),
+          delSnapIds: delSnapIdsRef.current.length ? delSnapIdsRef.current : '',
+          snaps: snapsArr
         }
 
         // if (1 + 1 === 2) {
@@ -95,25 +130,30 @@ function EditBtn({ path, APIobj, checkListTxt = '藏品' }: Props) {
             history.replace(path)
           }
         } else if (val === '发起') {
+          let txt = ''
+          if (isLook) txt = ',已为您跳转到编辑页面'
+
           if (!info.num) {
-            let txt = ''
-            if (key !== '2') {
-              txt = ',已为您跳转到编辑页面'
-              history.replace(`${path}_edit/2/${info.id}`)
-            }
+            if (isLook) history.replace(`${path}_edit/2/${info.id}`)
             MessageFu.warning('请输入申请编号' + txt)
 
             return
           }
           if (snaps.length === 0) {
-            let txt = ''
-            if (key !== '2') {
-              txt = ',已为您跳转到编辑页面'
-              history.replace(`${path}_edit/2/${info.id}`)
-            }
+            if (isLook) history.replace(`${path}_edit/2/${info.id}`)
 
             MessageFu.warning(`请至少添加一个${checkListTxt}${txt}`)
             return
+          } else if (path === '/register') {
+            // 校验藏品登记号 为空 或者 重复
+            // console.log('-----', snaps, obj)
+            const flag = numFlag(snaps)
+
+            if (flag) {
+              MessageFu.warning(flag + txt)
+              if (isLook) history.replace(`${path}_edit/2/${info.id}`)
+              return
+            }
           }
           const res = await APIobj['发起'](obj)
           if (res.code === 0) {
@@ -149,7 +189,7 @@ function EditBtn({ path, APIobj, checkListTxt = '藏品' }: Props) {
         }
       }
     },
-    [APIobj, auditInfo, checkListTxt, delSnapIdsRef, info, key, path, setTimeKeyFu, snaps]
+    [APIobj, auditInfo, checkListTxt, delSnapIdsRef, info, isLook, key, path, setTimeKeyFu, snaps]
   )
 
   // 申请记录的显示

+ 3 - 2
src/pages/Zother/EditTop/index.tsx

@@ -73,12 +73,13 @@ function EditTop({ rowArr, pageTxt, APIobj, fileUpInfo }: Props) {
 
           const obj = JSON.parse(v.snap || '{}')
 
-          if (obj.id === null && obj.isNew) obj.id = Date.now() + i
+          const flag = v.pageType === 'clue' && !v.clueId
+          if (obj.id === null || obj.isNew || flag) obj.id = Date.now() + i
 
           if (obj.id) obj.id2 = v.id
-
           arrTemp.push(obj)
         })
+        // console.log('-------', arrTemp)
 
         setSnapsFu(arrTemp)
       }

+ 73 - 0
src/pages/Zother/SelectGoods/index.module.scss

@@ -0,0 +1,73 @@
+// 新增弹窗页面
+.SelectGoods {
+  :global {
+    .sgtit {
+      display: flex;
+      justify-content: space-between;
+    }
+
+    .ant-modal-close {
+      display: none;
+    }
+
+    .ant-modal {
+      width: 1600px !important;
+      min-width: 1600px;
+      top: 40px !important;
+    }
+
+    .ant-modal-body {
+      border-top: 1px solid #ccc;
+    }
+
+    .sgMain {
+      padding-top: 15px;
+      .sgTop {
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        margin-bottom: 15px;
+        .sgtopll {
+          display: flex;
+          width: calc(100% - 140px);
+          & > div {
+            flex: 1;
+            position: relative;
+            margin-right: 15px;
+            display: flex;
+            align-items: center;
+            .ant-select {
+              width: 100%;
+            }
+          }
+        }
+        .sgtoprr {
+          width: 142px;
+        }
+      }
+      .ant-table-cell {
+        padding: 8px !important;
+        text-align: center !important;
+      }
+      .ant-btn-text {
+        color: var(--themeColor);
+      }
+      .tableImgAuto {
+        display: flex;
+        justify-content: center;
+      }
+      .sgMainBtn {
+        position: relative;
+        top: 15px;
+        text-align: center;
+      }
+      .ant-checkbox-inner {
+        width: 30px;
+        height: 30px;
+      }
+      .ant-checkbox-inner:after {
+        left: 35%;
+      }
+    }
+  }
+}

+ 237 - 0
src/pages/Zother/SelectGoods/index.tsx

@@ -0,0 +1,237 @@
+import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
+import styles from './index.module.scss'
+import { GoodsType } from '../SonGoodsList/data'
+import { Button, Cascader, Checkbox, Input, Modal, Select } from 'antd'
+import { openLink } from '@/utils/history'
+import { MessageFu } from '@/utils/message'
+import MyTable from '@/components/MyTable'
+import MyPopconfirm from '@/components/MyPopconfirm'
+
+type Props = {
+  API_getList: any
+  baseFormData: any
+  topSelectDom: any
+  columnsTemp: any
+  closeFu: () => void
+  dataResFu: (data: GoodsType[]) => void
+  oldCheckArr: GoodsType[]
+  // 单选
+  isOne?: boolean
+  //其他额外的参数
+  canObj?: any
+}
+
+function SelectGoods({
+  API_getList,
+  baseFormData,
+  topSelectDom,
+  columnsTemp,
+  closeFu,
+  dataResFu,
+  oldCheckArr,
+  isOne,
+  canObj
+}: Props) {
+  const [formData, setFormData] = useState({ ...baseFormData })
+  const formDataRef = useRef({ ...baseFormData })
+
+  useEffect(() => {
+    formDataRef.current = { ...formData }
+  }, [formData])
+
+  // 点击搜索的 时间戳
+  const [timeKey, setTimeKey] = useState(0)
+
+  // 点击搜索
+  const clickSearch = useCallback(() => {
+    setTimeout(() => {
+      setTimeKey(Date.now())
+    }, 50)
+  }, [])
+
+  // 点击重置
+  const resetSelectFu = useCallback(() => {
+    setFormData({ ...baseFormData })
+    setTimeout(() => {
+      setTimeKey(Date.now())
+    }, 50)
+  }, [baseFormData])
+
+  const [tableList, setTableList] = useState<GoodsType[]>([])
+  const [tableListAll, setTableListAll] = useState<GoodsType[]>([])
+
+  // 封装发送请求的函数
+  const getList = useCallback(async () => {
+    let canObjTemp = canObj || {}
+    const obj = {
+      ...formDataRef.current,
+      ...canObjTemp
+    }
+
+    const res = await API_getList(obj)
+    if (res.code === 0) {
+      setTableList(res.data.records || [])
+      if (timeKey === 0) setTableListAll(res.data.records || [])
+    }
+  }, [API_getList, canObj, timeKey])
+
+  useEffect(() => {
+    getList()
+  }, [getList])
+
+  // 多选
+  const [checkArr, setCheckArr] = useState<GoodsType[]>([])
+
+  // 旧数组
+  useEffect(() => {
+    setCheckArr(oldCheckArr)
+  }, [oldCheckArr])
+
+  // 过滤掉 tableList 里面没有的id
+  const resNum = useMemo(() => {
+    const tableIds = tableListAll.map(v => v.id)
+    const arr = checkArr.filter(v => tableIds.includes(v.id))
+    return arr.length
+  }, [checkArr, tableListAll])
+
+  const checkFu = useCallback(
+    (item: GoodsType) => {
+      // 单选
+      if (isOne) {
+        if (checkArr && checkArr.length && item.id === checkArr[0].id) {
+          setCheckArr([])
+        } else setCheckArr([item])
+      } else {
+        if (checkArr.map(v => v.id).includes(item.id))
+          setCheckArr(checkArr.filter(v => v.id !== item.id))
+        else setCheckArr([...checkArr, item])
+      }
+    },
+    [checkArr, isOne]
+  )
+  const staBtn = useMemo(() => {
+    return [
+      {
+        title: isOne ? '单选' : '选择',
+        width: 50,
+        render: (item: GoodsType) => (
+          <Checkbox
+            checked={checkArr.map(v => v.id).includes(item.id)}
+            onChange={() => checkFu(item)}
+          ></Checkbox>
+        )
+      }
+    ]
+  }, [checkArr, checkFu, isOne])
+
+  const tableLastBtn = useMemo(() => {
+    return [
+      {
+        title: '操作',
+        render: (item: GoodsType) => {
+          return (
+            <Button size='small' type='text' onClick={() => openLink(`/goodsLook/${item.id}`)}>
+              查看
+            </Button>
+          )
+        }
+      }
+    ]
+  }, [])
+
+  // 点击提交
+  const btnOk = useCallback(() => {
+    dataResFu(checkArr)
+    if (!isOne) MessageFu.success('提交成功')
+    closeFu()
+  }, [checkArr, closeFu, dataResFu, isOne])
+
+  // 顶部筛选
+  const searchDom = useCallback(
+    (arr: any[]) => {
+      return arr.map(item => {
+        return (
+          <div key={item.name}>
+            {item.type === 'Input' ? (
+              <Input
+                value={formData[item.key]}
+                onChange={e => setFormData({ ...formData, [item.key]: e.target.value })}
+                placeholder={item.name}
+                maxLength={30}
+                showCount
+              />
+            ) : item.type === 'Select' ? (
+              <Select
+                options={item.options}
+                placeholder={item.name}
+                allowClear={true}
+                value={formData[item.key] || null}
+                onChange={e => setFormData({ ...formData, [item.key]: e })}
+              />
+            ) : item.type === 'Cascader' ? (
+              <Cascader
+                changeOnSelect
+                options={item.options}
+                placeholder={item.name}
+                fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                allowClear={!item.must}
+                value={formData[item.key] ? formData[item.key].split(',') : []}
+                onChange={e => setFormData({ ...formData, [item.key]: e ? e.join(',') : '' })}
+              />
+            ) : null}
+          </div>
+        )
+      })
+    },
+    [formData]
+  )
+
+  return (
+    <Modal
+      wrapClassName={styles.SelectGoods}
+      open={true}
+      title={
+        <div className='sgtit'>
+          <div>选择藏品</div> <div>已选中 {resNum} 条</div>
+        </div>
+      }
+      footer={[]}
+    >
+      <div className='sgMain'>
+        <div className='sgTop'>
+          <div className='sgtopll'>{searchDom(topSelectDom)}</div>
+          <div className='sgtoprr'>
+            <Button type='primary' onClick={clickSearch}>
+              查询
+            </Button>
+            &emsp;
+            <Button onClick={resetSelectFu}>重置</Button>
+          </div>
+        </div>
+
+        {/* 表格 */}
+        <MyTable
+          yHeight={575}
+          classKey='SelectGoods'
+          list={tableList}
+          columnsTemp={columnsTemp}
+          staBtn={staBtn}
+          lastBtn={tableLastBtn}
+          pagingInfo={false}
+        />
+
+        <div className='sgMainBtn'>
+          <Button type='primary' disabled={resNum === 0 && isOne} onClick={btnOk}>
+            提交
+          </Button>
+          &emsp;
+          <MyPopconfirm txtK='取消' onConfirm={closeFu} />
+        </div>
+      </div>
+    </Modal>
+  )
+}
+
+const MemoSelectGoods = React.memo(SelectGoods)
+
+export default MemoSelectGoods

+ 42 - 0
src/pages/Zother/SonGoodsList/data.ts

@@ -1,3 +1,5 @@
+import { getDictFu, selectObj } from '@/utils/dataChange'
+
 // 藏品类型
 export type GoodsType = {
   ageDictId: string
@@ -57,4 +59,44 @@ export type GoodsType = {
 
   // 不用录数据库,新增和编辑 用这个区分
   isNew: boolean
+
+  // 区分是不是 征集数据-详情还没有入数据库
+  pageType?: 'clue'
+  clueId: number
+}
+
+// 藏品征集选择
+export const sgBaseFormData = {
+  pageNum: 1,
+  pageSize: 99999,
+
+  typeDictId: '',
+  ageDictId: '',
+  tornLevel: ''
 }
+
+export const sgTopSelectDom = [
+  {
+    name: '搜索线索编号、线索名称',
+    key: 'searchKey',
+    type: 'Input'
+  },
+  {
+    name: '初定类别',
+    key: 'typeDictId',
+    type: 'Cascader',
+    options: getDictFu('藏品类别')
+  },
+  {
+    name: '初定年代',
+    key: 'ageDictId',
+    type: 'Cascader',
+    options: getDictFu('藏品年代')
+  },
+  {
+    name: '完残程度',
+    key: 'tornLevel',
+    type: 'Select',
+    options: selectObj['完残程度']
+  }
+]

+ 42 - 11
src/pages/Zother/SonGoodsList/index.tsx

@@ -1,16 +1,17 @@
-import React, { useCallback, useMemo, useState } from 'react'
+import React, { useMemo, useState } from 'react'
 import styles from './index.module.scss'
 import { Button } from 'antd'
 import MyTable from '@/components/MyTable'
 import MyPopconfirm from '@/components/MyPopconfirm'
 import AddGoods from '../AddGoods'
 import { useInfo } from '../InfoContext'
-import { GoodsType } from './data'
-import { D1_APIgoodsSave } from '@/store/action/Dmanage/D1register'
-import { goodsSonTableC } from '@/utils/tableData'
+import { GoodsType, sgBaseFormData, sgTopSelectDom } from './data'
+import { D1_APIgetClueList, D1_APIgoodsSave } from '@/store/action/Dmanage/D1register'
+import { goodsSelectCuleC, goodsSonTableC } from '@/utils/tableData'
 import { useParams } from 'react-router-dom'
 import { openLink } from '@/utils/history'
 import { FileUpInfoType } from '../data'
+import SelectGoods from '../SelectGoods'
 
 type Props = {
   // 上传附件的信息
@@ -62,10 +63,7 @@ function SonGoodsList({ fileUpInfo }: Props) {
   }, [delSnapIdsRef, isLook, setSnapsFu, snaps])
 
   // 从征集线索中添加
-  const [clueArr, setClueArr] = useState<GoodsType[]>([])
-  const getClueArrFu = useCallback(async () => {
-    // const res
-  }, [])
+  const [clueShow, setClueShow] = useState(false)
 
   return (
     <div className={styles.SonGoodsList}>
@@ -75,8 +73,9 @@ function SonGoodsList({ fileUpInfo }: Props) {
           <div></div>
         ) : (
           <div>
-            {/* 待完善sg-等蓝鑫写完征集 */}
-            <Button type='primary'>从征集线索中添加</Button>
+            <Button type='primary' onClick={() => setClueShow(true)}>
+              从征集线索中添加
+            </Button>
             <Button type='primary' onClick={() => setOpenInfo({ id: -1 } as GoodsType)}>
               新增
             </Button>
@@ -110,7 +109,7 @@ function SonGoodsList({ fileUpInfo }: Props) {
             } else {
               setSnapsFu(
                 snaps.map(v => {
-                  if (v.id === objTemp.id) return objTemp
+                  if (v.id === objTemp.id || v.id === objTemp.clueId) return objTemp
                   else return v
                 })
               )
@@ -118,6 +117,38 @@ function SonGoodsList({ fileUpInfo }: Props) {
           }}
         />
       ) : null}
+
+      {/* 从藏品征集中添加 */}
+      {clueShow ? (
+        <SelectGoods
+          API_getList={D1_APIgetClueList}
+          baseFormData={sgBaseFormData}
+          topSelectDom={sgTopSelectDom}
+          columnsTemp={goodsSelectCuleC}
+          closeFu={() => setClueShow(false)}
+          oldCheckArr={snaps}
+          dataResFu={data => {
+            //需要过滤掉已经有id的-不替换数据,没有id的替换数据 因为数据可能已经在另外一个弹窗更新了
+            const nowIds = snaps.map(v => v.id)
+            let dataRes = data.map((v, i) => {
+              if (nowIds.includes(v.id)) return snaps[i]
+              else return v
+            })
+
+            dataRes.forEach(v => {
+              // 因为征集和藏品表分开的,所以在藏品里面拿征集信息,自己加上这个标识
+              v.pageType = 'clue'
+
+              // id2表示的是自己这条数据的id id才是goodsId
+              const obj = snapsID2ref.current.find(c => c.goodsId === v.id)
+
+              if (obj) v.id2 = obj.id
+            })
+
+            setSnapsFu(dataRes)
+          }}
+        />
+      ) : null}
     </div>
   )
 }

+ 10 - 0
src/utils/dataChange.ts

@@ -55,6 +55,16 @@ export const selectObj = {
     { value: 3, label: '审批不通过' },
     { value: 4, label: '已完成' }
   ],
+  藏品状态: [
+    { value: 1, label: '入馆中' },
+    { value: 2, label: '待入馆' },
+    { value: 3, label: '已入馆' },
+    { value: 4, label: '入藏中' },
+    { value: 5, label: '待入藏' },
+    { value: 6, label: '已入藏' },
+    { value: 7, label: '注销中' },
+    { value: 8, label: '已删除' }
+  ],
   启用状态: [
     { value: 1, label: '启用' },
     { value: 0, label: '禁用' }

+ 10 - 0
src/utils/tableData.ts

@@ -54,6 +54,16 @@ export const goodsSonTableC = [
   ['ping', '数量', 'pcs', 'pcsUnitDictId']
 ]
 
+// 藏品登记-里面选择藏品征集列表
+export const goodsSelectCuleC = [
+  ['txt', '线索编号', 'num'],
+  ['img', '封面', 'thumb'],
+  ['txt', '线索名称', 'name'],
+  ['txtC', '初定类别', 'typeDictId'],
+  ['txtC', '初定年代', 'ageDictId'],
+  ['select', '完残程度', 'tornLevel', selectObj['完残程度']]
+]
+
 export const I3tableC = [
   ['txt', '编号类型', 'name'],
   ['txt', '前缀', 'prefix'],