shaogen1995 3 ماه پیش
والد
کامیت
d8086100d8
5فایلهای تغییر یافته به همراه42 افزوده شده و 9 حذف شده
  1. 1 1
      src/pages/Layout/data.ts
  2. 5 1
      src/pages/Layout/index.tsx
  3. 4 2
      src/pages/Z_system/Z1dict/Z1add.tsx
  4. 23 4
      src/pages/Z_system/Z1dict/index.tsx
  5. 9 1
      src/utils/tableData.ts

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

@@ -241,7 +241,7 @@ const tabLeftArr: RouterType = [
     name: '展品管理',
     son: [
       {
-        id: 900,
+        id: 910,
         name: '借展管理',
         isLog: true,
         path: '/exhibition',

+ 5 - 1
src/pages/Layout/index.tsx

@@ -253,7 +253,11 @@ function Layout() {
         {/* 左边主体 */}
         <div className='layoutLeftMain mySorrl'>
           {list.map(v => (
-            <div className={classNames('layoutLRowBox')} key={v.id} hidden={!v.son.length}>
+            <div
+              className={classNames('layoutLRowBox')}
+              key={v.id}
+              hidden={!v.son.length || (v.son.length === 1 && v.son[0].name === '藏品详情')}
+            >
               {/* 这个项目没有一级目录 */}
               <div className='layoutLRowBoxTxt'>{v.name}</div>
               {v.son.map(v2 => (

+ 4 - 2
src/pages/Z_system/Z1dict/Z1add.tsx

@@ -15,13 +15,14 @@ export type Z1AddInfoType = {
 }
 
 type Props = {
+  acShuTxt: string
   addInfo: Z1AddInfoType
   addFu: () => void
   closeFu: () => void
   isNoAcIds: string[] //没有数据或者删除了的时候-既右侧没有操作的时候用到
 }
 
-function Z1add({ addInfo, addFu, closeFu, isNoAcIds }: Props) {
+function Z1add({ addInfo, addFu, closeFu, isNoAcIds, acShuTxt }: Props) {
   const { dictList: treeData } = useSelector((state: RootState) => state.Z1dict)
 
   // 级联选择器改变的时候 筛选当前级联的 信息出来
@@ -172,7 +173,8 @@ function Z1add({ addInfo, addFu, closeFu, isNoAcIds }: Props) {
                 changeOnSelect
                 fieldNames={{ label: 'name', value: 'id', children: 'children' }}
                 options={treeData}
-                placeholder={addInfo.txt === '编辑' ? '空' : '请选择'}
+                // placeholder={addInfo.txt === '编辑' ? '空' : '请选择'}
+                placeholder={acShuTxt}
                 value={parentIdArr ? [...parentIdArr] : []}
                 onChange={cardChange}
               />

+ 23 - 4
src/pages/Z_system/Z1dict/index.tsx

@@ -33,7 +33,13 @@ function Z1dict() {
       dispatch(
         Z1_APIgetDict(topId[1], data => {
           setLoding(true)
-          if (data && data.length) setAcShu(data[0].id)
+          if (data && data.length) {
+            setAcShu(data[0].id)
+            const txtDom: HTMLDivElement = document.querySelector('.ant-select-selection-item')!
+            if (txtDom) {
+              acShuTxtRef.current = txtDom.title
+            }
+          }
         })
       )
   }, [dispatch, topId])
@@ -62,12 +68,18 @@ function Z1dict() {
 
   // 当前选中的树节点ID
   const [acShu, setAcShu] = useState('0')
+  // 树节点文字信息
+  const acShuTxtRef = useRef('')
 
   // 点击树节点
   const onSelect = (id: any) => {
     // console.log('点击树节点', id)
-
-    if (id[0]) setAcShu(id[0])
+    if (id[0]) {
+      setAcShu(id[0])
+      // const txtDom: HTMLDivElement = document.querySelector('.ant-select-selection-item')!
+      // console.log('-------11', txtDom.title)
+      // if (txtDom) acShuTxtRef.current = txtDom.title
+    }
   }
 
   const [value, setValue] = useState('')
@@ -190,7 +202,13 @@ function Z1dict() {
         <div className='Z1toprr'>
           <Button
             type='primary'
-            onClick={() => setAddInfo({ id: '-1', txt: '新增', acInfo: rightData })}
+            onClick={() =>
+              setAddInfo({
+                id: '-1',
+                txt: '新增',
+                acInfo: rightData
+              })
+            }
           >
             新增
           </Button>
@@ -256,6 +274,7 @@ function Z1dict() {
       {/* 新增/编辑页面 中图法分类 */}
       {addInfo.id ? (
         <Z1add
+          acShuTxt={acShuTxtRef.current}
           addInfo={addInfo}
           addFu={() => resetFu(false)}
           closeFu={() => setAddInfo({} as Z1AddInfoType)}

+ 9 - 1
src/utils/tableData.ts

@@ -42,6 +42,14 @@ selectObj['业务类型'].forEach(v => {
   businessTypeObj[v.value] = v.label
 })
 
+// 处理情况obj
+export const accountTypeObj: any = {}
+selectObj['入藏去向'].forEach(v => {
+  accountTypeObj[v.value] = v.label
+})
+
+console.log(123456, accountTypeObj, businessTypeObj)
+
 // 申请状态
 export const statusObj = {
   1: '草稿',
@@ -115,7 +123,7 @@ export const B34TableC2 = [
   ['txtC', '质地', 'dictTexture3'],
   ['txtC', '完残情况', 'dictTorn'],
   ['txtC', '来源', 'source'],
-  ['txt', '处理情况', 'accountType'],
+  ['txtChange', '处理情况', 'accountType', accountTypeObj],
   ['text', '备注', 'intro', 50]
 ]