Ver código fonte

藏品编辑静态页

shaogen1995 4 meses atrás
pai
commit
ab15eb7ab9

+ 4 - 4
src/pages/B_enterTibet/B3_4page/index.tsx

@@ -35,7 +35,7 @@ export const B3_4inputKeyArr: {
   { name: '发起人', key: 'dddd' }
 ]
 
-const baseFormData: TypeB3Form = {
+export const B3baseFormData: TypeB3Form = {
   pageSize: 10,
   pageNum: 1,
   aaaa: '',
@@ -57,8 +57,8 @@ type Props = {
 function B34page({ pageSta }: Props) {
   // 角色下拉框 待完善
 
-  const [formData, setFormData] = useState(baseFormData)
-  const formDataRef = useRef(baseFormData)
+  const [formData, setFormData] = useState(B3baseFormData)
+  const formDataRef = useRef(B3baseFormData)
 
   useEffect(() => {
     formDataRef.current = formData
@@ -111,7 +111,7 @@ function B34page({ pageSta }: Props) {
 
   // 点击重置
   const resetSelectFu = useCallback(() => {
-    setFormData(baseFormData)
+    setFormData(B3baseFormData)
     setTimeout(() => {
       setTimeKey(Date.now())
     }, 50)

+ 5 - 0
src/pages/B_enterTibet/B3goodsTable/B3GaddNow/index.module.scss

@@ -1,6 +1,11 @@
 // 新增弹窗页面
 .B3GaddNow {
   :global {
+    .B3Gtit {
+      display: flex;
+      justify-content: space-between;
+    }
+
     .ant-modal-close {
       display: none;
     }

+ 32 - 10
src/pages/B_enterTibet/B3goodsTable/B3GaddNow/index.tsx

@@ -5,14 +5,17 @@ import MyPopconfirm from '@/components/MyPopconfirm'
 import MyTable from '@/components/MyTable'
 import { B3eTableC } from '@/utils/tableData'
 import { openGoodsInfoFu } from '@/utils/history'
+import { MessageFu } from '@/utils/message'
 
 type Props = {
   closeFu: () => void
   nowSta: { key: string; id: string }
-  // key:1=入馆 2=入藏 3-登记 4-删除 5-入库 6-出库
+  // key:1=入馆 2=入藏 3-登记 4-删除 5-入库 6-出库 7-藏品编辑
+  dataResFu: (data: any) => void //待完善类型type
+  isOne?: boolean //从藏品编辑进来 只能选择一个藏品
 }
 
-function B3GaddNow({ nowSta, closeFu }: Props) {
+function B3GaddNow({ nowSta, closeFu, isOne = false, dataResFu }: Props) {
   // 待完善 根据key值不同 来设置不同的下拉框数据
 
   // 多选
@@ -20,16 +23,21 @@ function B3GaddNow({ nowSta, closeFu }: Props) {
 
   const checkFu = useCallback(
     (id: number) => {
-      if (checkArr.includes(id)) setCheckArr(checkArr.filter(v => v !== id))
-      else setCheckArr([...checkArr, id])
+      // 藏品编辑只能单选
+      if (isOne) {
+        setCheckArr([id])
+      } else {
+        if (checkArr.includes(id)) setCheckArr(checkArr.filter(v => v !== id))
+        else setCheckArr([...checkArr, id])
+      }
     },
-    [checkArr]
+    [checkArr, isOne]
   )
 
   const startBtn = useMemo(() => {
     return [
       {
-        title: '选择',
+        title: isOne ? '单选' : '选择',
         width: 50,
         render: (item: any) => (
           <Checkbox checked={checkArr.includes(item.id)} onChange={() => checkFu(item.id)} />
@@ -40,7 +48,7 @@ function B3GaddNow({ nowSta, closeFu }: Props) {
         render: (item: any) => item.num || '(空)'
       }
     ]
-  }, [checkArr, checkFu])
+  }, [checkArr, checkFu, isOne])
 
   const tableLastBtn = useMemo(() => {
     return [
@@ -57,11 +65,22 @@ function B3GaddNow({ nowSta, closeFu }: Props) {
     ]
   }, [])
 
+  // 点击提交
+  const btnOk = useCallback(() => {
+    dataResFu(checkArr)
+    if (!isOne) MessageFu.success('提交成功')
+    closeFu()
+  }, [checkArr, closeFu, dataResFu, isOne])
+
   return (
     <Modal
       wrapClassName={styles.B3GaddNow}
       open={true}
-      title='选择藏品'
+      title={
+        <div className='B3Gtit'>
+          <div>选择藏品 key:{nowSta.key}</div> <div>已选中 {checkArr.length} 条</div>{' '}
+        </div>
+      }
       footer={
         [] // 设置footer为空,去掉 取消 确定默认按钮
       }
@@ -133,7 +152,10 @@ function B3GaddNow({ nowSta, closeFu }: Props) {
         <MyTable
           yHeight={575}
           classKey='B3GaddNow'
-          list={[{ id: 99, thumb: '' }]}
+          list={[
+            { id: 99, thumb: '' },
+            { id: 98, thumb: '' }
+          ]}
           columnsTemp={[
             ...B3eTableC,
             ['txt', '入藏状态', 'description'],
@@ -145,7 +167,7 @@ function B3GaddNow({ nowSta, closeFu }: Props) {
         />
 
         <div className='B3GaMainBtn'>
-          <Button type='primary' htmlType='submit' disabled={checkArr.length === 0}>
+          <Button type='primary' disabled={checkArr.length === 0} onClick={btnOk}>
             提交
           </Button>
           &emsp;

+ 9 - 5
src/pages/B_enterTibet/B3goodsTable/index.tsx

@@ -18,7 +18,7 @@ type Props = {
 }
 
 function B3goodsTable({ pageSta }: Props, ref: any) {
-  const { key, id } = useParams<any>()
+  const { key, id, pageKey } = useParams<any>()
 
   // 点击删除
   const delTableFu = useCallback(async (id: number) => {}, [])
@@ -80,15 +80,15 @@ function B3goodsTable({ pageSta }: Props, ref: any) {
   return (
     <div className={styles.B3goodsTable}>
       <div className='B3eGtop'>
-        <div className='B3eGtop1'>藏品清单</div>
+        <div className='B3eGtop1'>藏品清单 待完善{key}</div>
         <div>
           {['查看', '审批'].includes(pageSta) ? null : (
             <>
-              <Button type='primary' onClick={() => setNowSta({ key, id, type: 'now' })}>
+              <Button type='primary' onClick={() => setNowSta({ key: pageKey, id, type: 'now' })}>
                 从已存在的藏品中添加
               </Button>
               &emsp;
-              <Button type='primary' onClick={() => setNowSta({ key, id, type: 'new' })}>
+              <Button type='primary' onClick={() => setNowSta({ key: pageKey, id, type: 'new' })}>
                 新增
               </Button>
             </>
@@ -108,7 +108,11 @@ function B3goodsTable({ pageSta }: Props, ref: any) {
 
       {nowSta.id ? (
         nowSta.type === 'now' ? (
-          <B3GaddNow nowSta={nowSta} closeFu={() => setNowSta({ key: '', id: '', type: '' })} />
+          <B3GaddNow
+            nowSta={nowSta}
+            closeFu={() => setNowSta({ key: '', id: '', type: '' })}
+            dataResFu={data => {}}
+          />
         ) : (
           <B3GaddNew nowSta={nowSta} closeFu={() => setNowSta({ key: '', id: '', type: '' })} />
         )

+ 25 - 15
src/pages/C_goodsManage/C1ledger/index.tsx

@@ -202,12 +202,24 @@ function C1ledger() {
           <Button type='primary' onClick={() => history.push('/register_edit/1/null/3')}>
             藏品登记
           </Button>
+          {advanced ? null : (
+            <>
+              &emsp;
+              <Button type='primary' onClick={clickSearch}>
+                查询
+              </Button>
+              &emsp;
+              <Button type='primary' onClick={resetSelectFu}>
+                重置
+              </Button>
+            </>
+          )}
         </div>
       </div>
 
       {/* 第三行 */}
-      <div className='C1top C1top2'>
-        {advanced ? (
+      {advanced ? (
+        <div className='C1top C1top2'>
           <div className='C1topll'>
             {C1InputKeyArr3.map(item => (
               <div key={item.name}>
@@ -235,23 +247,21 @@ function C1ledger() {
               </div>
             ))}
           </div>
-        ) : (
-          <div className='C1topll'></div>
-        )}
-        <div className='C1toprr'>
-          <Button type='primary' onClick={clickSearch}>
-            查询
-          </Button>
-          &emsp;
-          <Button type='primary' onClick={resetSelectFu}>
-            重置
-          </Button>
+          <div className='C1toprr'>
+            <Button type='primary' onClick={clickSearch}>
+              查询
+            </Button>
+            &emsp;
+            <Button type='primary' onClick={resetSelectFu}>
+              重置
+            </Button>
+          </div>
         </div>
-      </div>
+      ) : null}
 
       {/* 表格 */}
       <MyTable
-        yHeight={540}
+        yHeight={advanced ? 540 : 595}
         list={[{ id: 66, thumb: '', num: 'xxx' }]}
         columnsTemp={C1tableC}
         lastBtn={tableLastBtn}

+ 136 - 0
src/pages/C_goodsManage/C6edit/C6add/index.module.scss

@@ -0,0 +1,136 @@
+.C6add {
+  background-color: #fff;
+  border-radius: 10px;
+  padding: 15px 24px 0px;
+  :global {
+    .C6Tit {
+      font-size: 18px;
+      font-weight: 700;
+      padding-bottom: 10px;
+      padding-left: 18px;
+      border-bottom: 1px solid #ccc;
+      margin-bottom: 17px;
+      color: var(--themeColor);
+      .ant-btn {
+        margin-left: 15px;
+        pointer-events: none;
+      }
+    }
+    .C6Tit2 {
+      margin-top: 24px;
+      display: flex;
+      justify-content: space-between;
+      padding-bottom: 10px;
+      border-bottom: 1px solid #ccc;
+      margin-bottom: 20px;
+      .C6Tit2ll {
+        font-size: 18px;
+        font-weight: 700;
+        padding-left: 18px;
+        margin-bottom: 17px;
+        color: var(--themeColor);
+      }
+      .C6Tit2rr {
+        position: relative;
+        z-index: 2;
+        .ant-btn {
+          margin-left: 15px;
+        }
+      }
+    }
+
+    .C6main {
+      width: 100%;
+      height: calc(100% - 70px);
+      overflow-y: auto;
+      padding-bottom: 40px;
+
+      .C6rowAll {
+        display: flex;
+        justify-content: space-between;
+        align-items: self-start;
+        font-size: 16px;
+        flex-wrap: wrap;
+        .C6row {
+          width: 48%;
+          display: flex;
+          align-items: center;
+          margin-bottom: 20px;
+          .C6rowll {
+            width: 110px;
+            text-align: right;
+            font-weight: 700;
+            & > span {
+              color: #ff4c6f;
+            }
+          }
+          .C6rowrr {
+            width: calc(100% - 110px);
+            .ant-input-affix-wrapper {
+              width: 300px;
+            }
+            .ant-select {
+              width: 300px;
+            }
+          }
+        }
+        .C6row2 {
+          align-items: self-start;
+          .C6rowll {
+            position: relative;
+            top: 3px;
+          }
+        }
+        .C6row3 {
+          position: relative;
+          top: 4px;
+        }
+
+        .C6rowFull {
+          width: 100%;
+          margin-top: -20px;
+          align-items: self-start;
+          margin-bottom: 0;
+          .C6rowll {
+            position: relative;
+            top: 3px;
+          }
+        }
+      }
+      // 藏品清单
+      .C6googsBox {
+        padding-right: 20px;
+        margin-top: 24px;
+        .D1GtNum {
+          cursor: pointer;
+          text-decoration: underline;
+          // &:hover {
+          //   color: var(--themeColor);
+          // }
+        }
+
+        .D1GtNumAc {
+          color: var(--themeColor);
+        }
+
+        .C6tab2Tit {
+          font-weight: 700;
+          color: var(--themeColor);
+        }
+      }
+    }
+
+    .C6btn {
+      position: absolute;
+      bottom: 20px;
+      left: 134px;
+      .ant-btn {
+        margin-right: 20px;
+      }
+    }
+
+    .ant-table-cell {
+      padding: 8px !important;
+    }
+  }
+}

+ 466 - 0
src/pages/C_goodsManage/C6edit/C6add/index.tsx

@@ -0,0 +1,466 @@
+import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
+import styles from './index.module.scss'
+import { useParams } from 'react-router-dom'
+import { pageTitTxtObj } from '@/pages/D_storeManage/D4impStor/D4edit'
+import X3auditInfo from '@/pages/X_stock/X3auditInfo'
+import { Button, DatePicker, Input } from 'antd'
+import dayjs from 'dayjs'
+import { B3aForm1 } from '@/pages/B_enterTibet/B3_4page/B3edit/data'
+import Z3upFiles from '@/components/Z3upFiles'
+import ZRichTexts from '@/components/ZRichTexts'
+import B3GaddNow from '@/pages/B_enterTibet/B3goodsTable/B3GaddNow'
+import MyTable from '@/components/MyTable'
+import history, { openGoodsInfoFu } from '@/utils/history'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import { B3eTableC } from '@/utils/tableData'
+import { MessageFu } from '@/utils/message'
+import classNames from 'classnames'
+import Y1cathet from '@/pages/Y_goodsDetails/Y1cathet'
+import B3GaddNew from '@/pages/B_enterTibet/B3goodsTable/B3GaddNew'
+import ImageLazy from '@/components/ImageLazy'
+import X2lookText from '@/pages/X_stock/X2lookText'
+import B3flowTable from '@/pages/B_enterTibet/B3flowTable'
+
+function C6add() {
+  const { key, id } = useParams<any>()
+
+  // 滚到顶部
+  const sollrDom = useRef<HTMLDivElement>(null)
+
+  useEffect(() => {
+    console.log('key:', key)
+
+    if (sollrDom.current) sollrDom.current.scrollTop = 0
+  }, [key])
+
+  // 上传附件的ref
+  const filesRef = useRef<any>(null)
+  // const filesRes = filesRef.current.filesIdRes();
+
+  // 富文本的ref
+  const ZRichTextRef = useRef<any>(null)
+
+  // 审批意见的ref
+  const ZAuditRef = useRef<any>(null)
+
+  // 设置富文本
+  //  ZRichTextRef.current?.ritxtShowFu(JSON.parse(data.rtf))
+
+  const timeChange = useCallback((e: any) => {
+    console.log(123, e)
+  }, [])
+
+  // 新增的底部按钮点击
+  const btnClickFu = useCallback((val: number) => {
+    const rtf1 = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
+    console.log('申请信息富文本', JSON.stringify(rtf1.val || ''))
+
+    const rtf2 = ZAuditRef.current?.resData()
+    console.log('审批信息富文本', rtf2)
+
+    // if (1 + 1 === 2) return
+
+    if (val === 2) {
+      // 存草稿 当前页保存 不跳转
+      MessageFu.success('草稿保存成功')
+    } else {
+      // 跳到详情页
+      history.push(`/edit_add/4/999`)
+    }
+  }, [])
+
+  // 打开侧边栏
+  const [cathet, setCathet] = useState(0)
+
+  // 点击删除
+  const delTableFu = useCallback(async (id: number) => {}, [])
+
+  const startBtn = useMemo(() => {
+    return [
+      {
+        title: '藏品编号',
+        render: (item: any) => {
+          return (
+            <span
+              onClick={() => setCathet(item.id)}
+              className={classNames('D1GtNum', item.id === cathet ? 'D1GtNumAc' : '')}
+            >
+              {item.num}
+            </span>
+          )
+        }
+      }
+    ]
+  }, [cathet])
+
+  const tableLastBtn = useMemo(() => {
+    return [
+      {
+        title: '操作',
+        render: (item: any) => {
+          return (
+            <>
+              <Button size='small' type='text' onClick={() => openGoodsInfoFu(item.id)}>
+                查看
+              </Button>
+              {['3', '4'].includes(key) ? null : (
+                <MyPopconfirm txtK='删除' onConfirm={() => delTableFu(item.id)} />
+              )}
+            </>
+          )
+        }
+      }
+    ]
+  }, [delTableFu, key])
+
+  // 审批的sta
+  const [auditSta, setAuDitSta] = useState('')
+
+  // 点击所选藏品 / 继续编辑
+  const [nowSta, setNowSta] = useState({ key: '', id: '', type: '' })
+
+  // 查看模式下的按钮 待完善
+  const lookBtn = useMemo(() => {
+    return (
+      <>
+        <Button type='primary'>创建</Button>
+        <Button type='primary'>提交</Button>
+        <MyPopconfirm
+          txtK='撤回'
+          onConfirm={() => {}}
+          Dom={
+            <Button type='primary' danger>
+              撤回
+            </Button>
+          }
+        />
+
+        <Button type='primary'>审批</Button>
+        <Button type='primary'>编辑</Button>
+        <Button type='primary'>重新提交</Button>
+        <Button type='primary'>导出</Button>
+        <MyPopconfirm
+          txtK='删除'
+          onConfirm={() => {}}
+          Dom={
+            <Button type='primary' danger>
+              删除
+            </Button>
+          }
+        />
+        <Button onClick={() => history.push('/edit')}>返回</Button>
+      </>
+    )
+  }, [])
+
+  // 模拟 所选藏品 表格数据
+  const [listTemp, setListTemp] = useState<any[]>([{ id: 99, thumb: '', num: '一段编号_可点击' }])
+
+  // 编辑明细 表格
+  const tableLastBtn2 = useMemo(() => {
+    return [
+      {
+        title: '编辑项',
+        render: (item: any) =>
+          ['封面图', '附件信息', '简介'].includes(item.name) ? (
+            <span className='C6tab2Tit'>{item.name}</span>
+          ) : (
+            item.name
+          )
+      },
+      {
+        title: '编辑前',
+        render: (item: any) => {
+          if (item.name === '封面图')
+            return (
+              <div className='tableImgAuto'>
+                <ImageLazy
+                  width={60}
+                  height={60}
+                  srcBig={item.qian}
+                  src={item.qian}
+                  offline={true}
+                />
+              </div>
+            )
+          else if (item.name === '附件信息')
+            return item.qian.map((v: any, i: number) => (
+              <a key={v.name} href={v.src} download target='_blank' rel='noreferrer'>
+                {v.name}
+                {i < item.qian.length - 1 ? ',' : ''}
+              </a>
+            ))
+          else if (item.name === '简介')
+            return (
+              <Button size='small' type='text' onClick={() => setLook('xxx')}>
+                查看
+              </Button>
+            )
+          else return item.qian || '(空)'
+        }
+      },
+      {
+        title: '编辑后',
+        render: (item: any) => {
+          if (item.name === '封面图')
+            return (
+              <div className='tableImgAuto'>
+                <ImageLazy width={60} height={60} srcBig={item.hou} src={item.hou} offline={true} />
+              </div>
+            )
+          else if (item.name === '附件信息')
+            return item.hou.map((v: any, i: number) => (
+              <a key={v.name} href={v.src} download target='_blank' rel='noreferrer'>
+                {v.name}
+                {i < item.hou.length - 1 ? ',' : ''}
+              </a>
+            ))
+          else if (item.name === '简介')
+            return (
+              <Button size='small' type='text' onClick={() => setLook('xxx')}>
+                查看
+              </Button>
+            )
+          else return item.hou || '(空)'
+        }
+      }
+    ]
+  }, [])
+
+  //查看富文本信息
+  const [look, setLook] = useState('')
+
+  return (
+    <div className={styles.C6add}>
+      <div className='pageTitle'>
+        {/* 待完善id */}
+        藏品编辑-{Reflect.get(pageTitTxtObj, key)}-{id}
+      </div>
+
+      <div className='C6main' ref={sollrDom}>
+        {['3'].includes(key) ? (
+          <X3auditInfo auditSta={auditSta} auditStaFu={val => setAuDitSta(val)} ref={ZAuditRef} />
+        ) : null}
+
+        {/* 表单字段、附件等 */}
+        <div className='C6Tit'>
+          {/* 待完善 */}
+          申请信息
+          <Button type='dashed'>草稿</Button>
+        </div>
+        <div className='C6rowAll'>
+          <div className='C6row'>
+            <div className='C6rowll'>
+              <span> * </span>申请名称:
+            </div>
+            <div className='C6rowrr'>
+              <Input
+                readOnly={['3', '4'].includes(key)}
+                placeholder='请输入内容'
+                maxLength={30}
+                showCount
+              />
+            </div>
+          </div>
+
+          <div className='C6row'>
+            <div className='C6rowll'>
+              <span> * </span>业务日期:
+            </div>
+            <div className='C6rowrr'>
+              <DatePicker
+                disabled={['3', '4'].includes(key)}
+                allowClear={false}
+                value={dayjs()}
+                onChange={timeChange}
+              />
+            </div>
+          </div>
+
+          {B3aForm1.map(v => (
+            <div className='C6row' key={v.name}>
+              <div className='C6rowll'>{v.name}:</div>
+              <div className='C6rowrr'>
+                这是一段文本
+                {['3', '4'].includes(key) && v.name === '发起人'
+                  ? ' - 查看和审批后面显示创建时间'
+                  : ''}
+              </div>
+            </div>
+          ))}
+
+          <div className='C6row C6row2'>
+            <div className='C6rowll'>附件:</div>
+            <div className='C6rowrr'>
+              <Z3upFiles
+                max={10}
+                isLook={['3', '4'].includes(key)}
+                ref={filesRef}
+                fileCheck={false}
+                dirCode={'xxxxxxx'}
+                myUrl='xxxxxxxxxxxx'
+                lookData={[]}
+                size={500}
+              />
+            </div>
+          </div>
+
+          <div className='C6row'>
+            <div className='C6rowll'>原因事由:</div>
+            <div className='C6rowrr'>
+              <Input
+                readOnly={['3', '4'].includes(key)}
+                placeholder='请输入内容'
+                maxLength={30}
+                showCount
+              />
+            </div>
+          </div>
+
+          <div className='C6row C6rowFull'>
+            <div className='C6rowll'>备注:</div>
+            <div className='C6rowrr'>
+              <ZRichTexts
+                check={false}
+                dirCode={'xxxxxxxx'}
+                isLook={['3', '4'].includes(key)}
+                ref={ZRichTextRef}
+                myUrl='xxxxxxxxxx'
+                isOne={true}
+                upAudioBtnNone={true}
+              />
+            </div>
+          </div>
+        </div>
+
+        {/* 所选藏品 */}
+        <div className='C6googsBox'>
+          <div className='C6Tit2'>
+            <div className='C6Tit2ll'>所选藏品</div>
+            <div className='C6Tit2rr'>
+              {['3', '4'].includes(key) ? null : (
+                <>
+                  <Button type='primary' onClick={() => setNowSta({ key: '7', id, type: 'now' })}>
+                    选择藏品
+                  </Button>
+                  <Button
+                    disabled={listTemp.length === 0}
+                    type='primary'
+                    onClick={() => setNowSta({ key: '7', id, type: 'new' })}
+                  >
+                    继续编辑
+                  </Button>
+                </>
+              )}
+            </div>
+          </div>
+
+          {/* 表格 */}
+          <MyTable
+            list={listTemp}
+            columnsTemp={B3eTableC}
+            startBtn={startBtn}
+            lastBtn={tableLastBtn}
+            pagingInfo={false}
+          />
+        </div>
+
+        {/* 编辑明细 */}
+        <div className='C6googsBox'>
+          <div className='C6Tit'>编辑明细</div>
+
+          {/* 表格 */}
+          <MyTable
+            list={[
+              { id: 1, name: '名称', qian: '11', hou: '22' },
+              {
+                id: 2,
+                name: '封面图',
+                qian: 'https://houseoss.4dkankan.com/project/DEMO/staticResource/touxiang.jpg',
+                hou: 'https://houseoss.4dkankan.com/project/DEMO/staticResource/touxiang.jpg'
+              },
+              {
+                id: 3,
+                name: '附件信息',
+                qian: [
+                  {
+                    name: '666.jpg',
+                    src: 'https://houseoss.4dkankan.com/project/DEMO/staticResource/touxiang.jpg'
+                  }
+                ],
+                hou: [
+                  {
+                    name: '666.jpg',
+                    src: 'https://houseoss.4dkankan.com/project/DEMO/staticResource/touxiang.jpg'
+                  },
+                  {
+                    name: '777.mp4',
+                    src: 'https://houseoss.4dkankan.com/project/DEMO/staticResource/loop.mp4'
+                  }
+                ]
+              },
+              { id: 4, name: '简介', qian: '11', hou: '22' }
+            ]}
+            columnsTemp={[]}
+            lastBtn={tableLastBtn2}
+            pagingInfo={false}
+          />
+        </div>
+
+        {/* 申请流程 */}
+        {['3', '4'].includes(key) ? <B3flowTable /> : null}
+      </div>
+
+      {/* 底部按钮 */}
+      <div className='C6btn'>
+        {key === '4' ? (
+          lookBtn
+        ) : (
+          <>
+            <Button type='primary' onClick={() => btnClickFu(1)}>
+              {key === '1' ? '创建' : '保存'}
+            </Button>
+
+            {key === '1' ? (
+              <Button type='primary' onClick={() => btnClickFu(2)}>
+                存草稿
+              </Button>
+            ) : null}
+
+            <MyPopconfirm txtK='取消' onConfirm={() => history.push('/edit')} />
+          </>
+        )}
+      </div>
+
+      {/* 打开侧边栏 */}
+      <Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
+
+      {/* 所选藏品弹窗 / 继续编辑 */}
+
+      {nowSta.id ? (
+        nowSta.type === 'now' ? (
+          <B3GaddNow
+            isOne={true}
+            nowSta={nowSta}
+            closeFu={() => setNowSta({ key: '', id: '', type: '' })}
+            dataResFu={data => {
+              setListTemp([{ id: 99, thumb: '', num: '一段编号_可点击' }])
+              setTimeout(() => {
+                setNowSta({ key: '7', id: '77', type: 'new' })
+              }, 20)
+            }}
+          />
+        ) : (
+          <B3GaddNew nowSta={nowSta} closeFu={() => setNowSta({ key: '', id: '', type: '' })} />
+        )
+      ) : null}
+
+      {/* 查看富文本 */}
+      {look ? <X2lookText closeFu={() => setLook('')} /> : null}
+    </div>
+  )
+}
+
+const MemoC6add = React.memo(C6add)
+
+export default MemoC6add

+ 23 - 0
src/pages/C_goodsManage/C6edit/index.module.scss

@@ -1,4 +1,27 @@
 .C6edit {
+  background-color: #fff;
+  border-radius: 10px;
+  padding: 15px 24px 0;
   :global {
+    .C6top {
+      display: flex;
+      justify-content: space-between;
+      margin-bottom: 15px;
+      .C6topll {
+        display: flex;
+        & > div {
+          position: relative;
+          margin-right: 15px;
+          display: flex;
+          align-items: center;
+          .ant-input {
+            width: 160px;
+          }
+        }
+      }
+    }
+    .ant-table-cell {
+      padding: 8px !important;
+    }
   }
 }

+ 196 - 2
src/pages/C_goodsManage/C6edit/index.tsx

@@ -1,10 +1,204 @@
-import React from 'react'
+import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
 import styles from './index.module.scss'
+import { B3_4inputKeyArr, B3baseFormData, D3InputKeyType } from '@/pages/B_enterTibet/B3_4page'
+import { Button, DatePicker, Input, Select } from 'antd'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import history from '@/utils/history'
+import dayjs from 'dayjs'
+import MyTable from '@/components/MyTable'
+import { B3tableC } from '@/utils/tableData'
+const { RangePicker } = DatePicker
+
 function C6edit() {
+  // 没有接入后端 待完善
+
+  const [formData, setFormData] = useState(B3baseFormData)
+  const formDataRef = useRef(B3baseFormData)
+
+  useEffect(() => {
+    formDataRef.current = formData
+  }, [formData])
+
+  // 点击搜索的 时间戳
+  const [timeKey, setTimeKey] = useState(0)
+
+  // 点击搜索
+  const clickSearch = useCallback(() => {
+    setFormData({ ...formData, pageNum: 1 })
+    setTimeout(() => {
+      setTimeKey(Date.now())
+    }, 50)
+  }, [formData])
+
+  // 时间选择器改变
+  const timeChange = useCallback(
+    (date: any, dateString: any) => {
+      let startTime = ''
+      let endTime = ''
+      if (dateString[0] && dateString[1]) {
+        startTime = dateString[0] + ' 00:00:00'
+        endTime = dateString[1] + ' 23:59:59'
+      }
+      setFormData({ ...formData, startTime, endTime })
+    },
+    [formData]
+  )
+
+  // 封装发送请求的函数
+  const getListFu = useCallback(() => {
+    console.log('发送请求', formDataRef.current)
+  }, [])
+
+  useEffect(() => {
+    getListFu()
+  }, [getListFu, timeKey])
+
+  // 输入框的改变
+  const txtChangeFu = useCallback(
+    (txt: string, key: D3InputKeyType) => {
+      setFormData({
+        ...formData,
+        [key]: txt
+      })
+    },
+    [formData]
+  )
+
+  // 点击重置
+  const resetSelectFu = useCallback(() => {
+    setFormData(B3baseFormData)
+    setTimeout(() => {
+      setTimeKey(Date.now())
+    }, 50)
+  }, [])
+
+  // 页码变化
+  const paginationChange = useCallback(
+    (pageNum: number, pageSize: number) => {
+      setFormData({ ...formData, pageNum, pageSize })
+      setTimeout(() => {
+        setTimeKey(Date.now())
+      }, 50)
+    },
+    [formData]
+  )
+
+  // 点击删除
+  const delTableFu = useCallback(
+    async (id: number) => {
+      getListFu()
+    },
+    [getListFu]
+  )
+
+  // 点击各种操作按钮
+  const btnFu = useCallback((id: number | string, key: string) => {
+    history.push(`edit_add/${key}/${id}`)
+  }, [])
+
+  const tableLastBtn = useMemo(() => {
+    //   看状态和账号角色显示按钮 待完善
+    return [
+      {
+        title: '操作',
+        render: (item: any) => {
+          return (
+            <>
+              <Button size='small' type='text' onClick={() => btnFu(item.id, '2')}>
+                编辑
+              </Button>
+              <Button size='small' type='text' onClick={() => btnFu(item.id, '3')}>
+                审批
+              </Button>
+              <Button size='small' type='text' onClick={() => btnFu(item.id, '4')}>
+                查看
+              </Button>
+              <MyPopconfirm txtK='删除' onConfirm={() => delTableFu(item.id)} />
+            </>
+          )
+        }
+      }
+    ]
+  }, [btnFu, delTableFu])
+
   return (
     <div className={styles.C6edit}>
       <div className='pageTitle'>藏品编辑</div>
-      <p>待开发</p>
+      <div className='C6top'>
+        <div className='C6topll'>
+          {B3_4inputKeyArr.map(item => (
+            <div key={item.name}>
+              <span>{item.name}:</span>
+              <Input
+                placeholder={`请输入${item.name}`}
+                maxLength={30}
+                value={formData[item.key]}
+                onChange={e => txtChangeFu(e.target.value, item.key)}
+              />
+            </div>
+          ))}
+        </div>
+        <div className='C6toprr'>
+          <Button type='primary'>批量导出</Button>&emsp;
+          <Button type='primary' onClick={() => btnFu('null', '1')}>
+            新增
+          </Button>
+        </div>
+      </div>
+      <div className='C6top'>
+        <div className='C6topll'>
+          <div>
+            <span>发起日期范围:</span>
+            <RangePicker
+              value={
+                formData.startTime ? [dayjs(formData.startTime), dayjs(formData.endTime)] : null
+              }
+              onChange={timeChange}
+            />
+          </div>
+
+          <div>
+            <span>申请状态:</span>
+            <Select
+              placeholder='请选择'
+              style={{ width: 200 }}
+              value={formData.eeee}
+              onChange={e => setFormData({ ...formData, eeee: e })}
+              options={[{ value: '', label: '全部' }]}
+            />
+          </div>
+
+          <div>
+            <span>选择角色:</span>
+            <Select
+              style={{ width: 200 }}
+              placeholder='请选择'
+              options={[]}
+              fieldNames={{ value: 'id', label: 'roleName' }}
+              value={formData.ffff}
+              onChange={e => setFormData({ ...formData, ffff: e })}
+            />
+          </div>
+        </div>
+        <div className='C6toprr'>
+          <Button type='primary' onClick={clickSearch}>
+            查询
+          </Button>
+          &emsp;<Button onClick={resetSelectFu}>重置</Button>
+        </div>
+      </div>
+
+      {/* 表格 */}
+      <MyTable
+        yHeight={610}
+        list={[{ id: 91 }]}
+        columnsTemp={B3tableC}
+        lastBtn={tableLastBtn}
+        pageNum={formData.pageNum}
+        pageSize={formData.pageSize}
+        total={0}
+        onChange={(pageNum, pageSize) => paginationChange(pageNum, pageSize)}
+      />
     </div>
   )
 }

+ 5 - 1
src/pages/D_storeManage/D4impStor/D4edit/index.tsx

@@ -381,7 +381,11 @@ function D4edit() {
       <Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
       {/* 新增弹窗 */}
       {nowSta.id ? (
-        <B3GaddNow nowSta={nowSta} closeFu={() => setNowSta({ key: '', id: '' })} />
+        <B3GaddNow
+          nowSta={nowSta}
+          closeFu={() => setNowSta({ key: '', id: '' })}
+          dataResFu={data => {}}
+        />
       ) : null}
 
       {/* 批量设置存放位置 */}

+ 5 - 1
src/pages/D_storeManage/D6putsStor/D6edit/index.tsx

@@ -435,7 +435,11 @@ function D6edit() {
       <Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
       {/* 新增弹窗 */}
       {nowSta.id ? (
-        <B3GaddNow nowSta={nowSta} closeFu={() => setNowSta({ key: '', id: '' })} />
+        <B3GaddNow
+          nowSta={nowSta}
+          closeFu={() => setNowSta({ key: '', id: '' })}
+          dataResFu={data => {}}
+        />
       ) : null}
     </div>
   )

+ 31 - 24
src/pages/Layout/data.ts

@@ -66,48 +66,48 @@ const tabLeftArr: RouterType = [
         path: '/ledger',
         Com: React.lazy(() => import('../C_goodsManage/C1ledger'))
       },
-      // {
-      //   id: 320,
-      //   name: '藏品附件',
-      //   path: '/files',
-      //   Com: React.lazy(() => import('../C_goodsManage/C2files'))
-      // },
+      {
+        id: 320,
+        name: '藏品附件222',
+        path: '/files',
+        Com: React.lazy(() => import('../C_goodsManage/C2files'))
+      },
       // {
       //   id: 330,
       //   name: '藏品关注',
       //   path: '/focus',
       //   Com: React.lazy(() => import('../C_goodsManage/C3focus'))
       // },
-      // {
-      //   id: 340,
-      //   name: '藏品导入',
-      //   path: '/import',
-      //   Com: React.lazy(() => import('../C_goodsManage/C4import'))
-      // },
+      {
+        id: 340,
+        name: '藏品导入333',
+        path: '/import',
+        Com: React.lazy(() => import('../C_goodsManage/C4import'))
+      },
       {
         id: 350,
         name: '藏品登记',
         path: '/register',
         Com: React.lazy(() => import('../C_goodsManage/C5register'))
       },
-      // {
-      //   id: 360,
-      //   name: '藏品编辑',
-      //   path: '/edit',
-      //   Com: React.lazy(() => import('../C_goodsManage/C6edit'))
-      // },
+      {
+        id: 360,
+        name: '藏品编辑',
+        path: '/edit',
+        Com: React.lazy(() => import('../C_goodsManage/C6edit'))
+      },
       {
         id: 370,
         name: '藏品删除',
         path: '/delete',
         Com: React.lazy(() => import('../C_goodsManage/C7delete'))
+      },
+      {
+        id: 380,
+        name: '回收站111',
+        path: '/recycleBin',
+        Com: React.lazy(() => import('../C_goodsManage/C8recycleBin'))
       }
-      // {
-      //   id: 380,
-      //   name: '回收站',
-      //   path: '/recycleBin',
-      //   Com: React.lazy(() => import('../C_goodsManage/C8recycleBin'))
-      // }
     ]
   },
   {
@@ -311,5 +311,12 @@ export const routerSon: RouterTypeRow = [
     name: '出库-新增/编辑/审批/查看',
     path: '/putsStor_edit/:key/:id',
     Com: React.lazy(() => import('../D_storeManage/D6putsStor/D6edit'))
+  },
+  // ------------藏品编辑------------------
+  {
+    id: 9,
+    name: '藏品编辑-新增/编辑/审批/查看',
+    path: '/edit_add/:key/:id',
+    Com: React.lazy(() => import('../C_goodsManage/C6edit/C6add'))
   }
 ]