فهرست منبع

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

shaogen1995 2 هفته پیش
والد
کامیت
3d37e68064

+ 4 - 0
src/pages/Cledger/C1ledger/index.module.scss

@@ -1,4 +1,8 @@
 .C1ledger {
   :global {
+    .TableListToprr {
+      justify-content: start !important;
+      gap: 0 7%;
+    }
   }
 }

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

@@ -2,17 +2,132 @@ 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'
+import { selectObj, getDictFu } from '@/utils/dataChange'
 import TableList from '@/pages/Zother/TableList'
 import { useSelector } from 'react-redux'
 import { RootState } from '@/store'
 import { API_getGoodsList } from '@/store/action/Cledger/C1ledger'
 import { baseFormData, topSearch } from '@/pages/Zother/data'
 import { baseTableC } from '@/utils/tableData'
+import history from '@/utils/history'
+import { Button, Dropdown } from 'antd'
+
+const C1topSearch = [
+  {
+    type: 'input',
+    key: 'searchKey',
+    placeholder: '搜索藏品登记号、藏品名称,不超过30个字'
+  },
+  {
+    type: 'input',
+    key: 'searchTagName',
+    placeholder: `搜索藏品标签`
+  },
+  {
+    type: 'select',
+    key: 'level',
+    placeholder: '级别',
+    options: selectObj['藏品级别']
+  },
+  {
+    type: 'cascader',
+    key: 'typeDictId',
+    placeholder: '类别',
+    options: getDictFu('藏品类别')
+  },
+  {
+    type: 'cascader',
+    key: 'ageDictId',
+    placeholder: '年代',
+    options: getDictFu('藏品年代')
+  },
+  {
+    type: 'cascader',
+    key: 'textureDictId',
+    placeholder: '质地',
+    options: getDictFu('质地')
+  },
+  {
+    type: 'select',
+    key: 'tornLevel',
+    placeholder: '完残程度',
+    options: selectObj['完残程度']
+  },
+  // TODO
+  {
+    type: 'select',
+    key: 'xxx',
+    placeholder: '入藏状态',
+    options: selectObj['藏品入藏状态']
+  },
+  {
+    type: 'select',
+    key: 'xxx',
+    placeholder: '库存状态',
+    options: selectObj['藏品库存状态']
+  },
+  {
+    type: 'input',
+    key: 'xxx',
+    placeholder: `搜索库房位置`
+  }
+]
+
+const rightBtnOptions = {
+  dangan: [
+    {
+      key: '1',
+      label: '登记',
+      value: '1'
+    },
+    {
+      key: '2',
+      label: '注销',
+      value: '2'
+    }
+  ]
+}
 
 function C1ledger() {
   const tableInfo = useSelector((state: RootState) => state.D1register.tableInfo)
 
+  const dataExport = () => {
+    console.log('数据导出了')
+  }
+
+  // 故事管理定制右侧内容
+  const storyTableListToprr = ({
+    clickSearch,
+    resetSelectFu
+  }: {
+    clickSearch: () => void
+    resetSelectFu: () => void
+  }) => {
+    return (
+      <>
+        {/* <Dropdown menu={{ items: rightBtnOptions['dangan'] }} trigger={['click']}>
+          档案管理
+        </Dropdown>
+        <Dropdown menu={{ items: rightBtnOptions['dangan'] }} trigger={['click']}>
+          库房管理
+        </Dropdown>
+        <Dropdown menu={{ items: rightBtnOptions['dangan'] }} trigger={['click']}>
+          藏品维护
+        </Dropdown> */}
+        <Button type='primary' onClick={dataExport}>
+          数据导入
+        </Button>
+        <Button type='primary' onClick={dataExport}>
+          数据导出
+        </Button>
+        <Button type='primary' onClick={clickSearch}>
+          查询
+        </Button>
+        <Button onClick={resetSelectFu}>重置</Button>
+      </>
+    )
+  }
+
   return (
     <div className={styles.C1ledger}>
       <div className='pageTitle'>藏品总账</div>
@@ -23,8 +138,11 @@ function C1ledger() {
         pageKey='ledger'
         tableInfo={tableInfo}
         columnsTemp={baseTableC('总账')}
+        rightBtnWidth={390}
+        leftRowWidth={'20%'}
         yHeight={585}
-        searchDom={topSearch('总账')}
+        searchDom={C1topSearch}
+        storyTableListToprr={storyTableListToprr}
       />
     </div>
   )

+ 5 - 3
src/pages/Eculture/E2story/E2edit/index.tsx

@@ -149,9 +149,11 @@ function E2edit() {
             <div className='Edtop1row Edtop1rowFull'>
               <div className='Edtop1ll'>关联产品 :</div>
               <div className='Edtop1rr'>
-                <Button disabled={isView} type='primary' onClick={() => setShowSelectGoods(true)}>
-                  添加藏品
-                </Button>
+                {!isView && (
+                  <Button type='primary' onClick={() => setShowSelectGoods(true)}>
+                    添加藏品
+                  </Button>
+                )}
                 <MyTable
                   classKey='storyList'
                   list={storyInfo.goods || []}

+ 10 - 1
src/pages/Zother/TableList/index.tsx

@@ -2,7 +2,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
 import styles from './index.module.scss'
 import { useDispatch } from 'react-redux'
 import history from '@/utils/history'
-import { Button, DatePicker, Input, Select } from 'antd'
+import { Button, DatePicker, Input, Select, Cascader } from 'antd'
 import { tableListAuditBtnFu } from '@/utils/authority'
 import MyTable from '@/components/MyTable'
 import dayjs from 'dayjs'
@@ -175,6 +175,15 @@ function TableList({
                   onChange={e => setFormData({ ...formData, [item.key]: e })}
                   options={item.options}
                 />
+              ) : item.type === 'cascader' ? (
+                <Cascader
+                  allowClear={true}
+                  placeholder={item.placeholder}
+                  style={item.style || ''}
+                  fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                  onChange={e => setFormData({ ...formData, [item.key]: e })}
+                  options={item.options}
+                />
               ) : null}
             </div>
           ))}