shaogen1995 1 день назад
Родитель
Сommit
b81b393bb6

+ 5 - 1
src/components/MyTable/form.tsx

@@ -11,7 +11,7 @@ import { DatePicker, Form, FormInstance, Input, Table, TableProps } from 'antd'
 import ImageLazy from '../ImageLazy'
 import classNames from 'classnames'
 import dayjs from 'dayjs'
-import { resJiLianFu, resTagFu } from '@/utils/dataChange'
+import { myTableTransferSize, resJiLianFu, resTagFu, zhiDiResFu } from '@/utils/dataChange'
 
 interface MyTableProps extends Omit<TableProps, 'onChange'> {
   yHeight?: number //设置表格的高度
@@ -175,6 +175,10 @@ const MyTable = forwardRef<MyTableMethods, MyTableProps>(
             }
             return resTxt || isNull
           },
+          // 尺寸
+          size: myTableTransferSize,
+          // 质地
+          zhiDi: zhiDiResFu,
           img: (item: any) =>
             v[3] && !item[v[2]] ? (
               <div dangerouslySetInnerHTML={{ __html: v[3] }}></div>

+ 3 - 1
src/components/MyTable/index.tsx

@@ -3,7 +3,7 @@ import styles from './index.module.scss'
 import { Table } from 'antd'
 import ImageLazy from '../ImageLazy'
 import dayjs from 'dayjs'
-import { myTableTransferSize, resJiLianFu, resTagFu } from '@/utils/dataChange'
+import { myTableTransferSize, resJiLianFu, resTagFu, zhiDiResFu } from '@/utils/dataChange'
 
 type Props = {
   yHeight?: number //设置表格的高度
@@ -124,6 +124,8 @@ function MyTable({
 
         // 尺寸
         size: myTableTransferSize,
+        // 质地
+        zhiDi: zhiDiResFu,
         img: (item: any) => (
           <div className='tableImgAuto'>
             <ImageLazy

+ 1 - 1
src/pages/Cledger/C1ledger/index.tsx

@@ -142,7 +142,7 @@ function C1ledger() {
         type: 'cascader',
         key: 'textureDictId',
         placeholder: '质地',
-        options: getDictFu('质地')
+        options: getDictFu('质地3')
       },
       {
         type: 'select',

+ 1 - 1
src/pages/Cledger/C2routing/index.tsx

@@ -21,7 +21,7 @@ const C2topSearch = [
     type: 'cascader',
     key: 'textureDictId',
     placeholder: '质地',
-    options: getDictFu('质地')
+    options: getDictFu('质地3')
   },
   {
     type: 'select',

+ 1 - 1
src/pages/Cledger/C3goodsInfo/index.tsx

@@ -44,7 +44,7 @@ const C1topSearch = [
     type: 'cascader',
     key: 'textureDictId',
     placeholder: '质地',
-    options: getDictFu('质地')
+    options: getDictFu('质地3')
   },
   {
     type: 'select',

+ 1 - 1
src/pages/Fstorehouse/F1inStorage/F1edit/index.tsx

@@ -191,7 +191,7 @@ function F1editContent() {
             ['select', '级别', 'level', selectObj['藏品级别']],
             ['txtCTag', '文化标签', 'artDictId', '文创'],
             ['txtC', '年代', 'ageDictId'],
-            ['txtC', '质地', 'textureDictId'],
+            ['txtCTag', '质地', 'textureDictId', '质地3'],
             ['select', '完残程度', 'tornLevel', selectObj['完残程度']],
             ['ping', '数量', 'pcs', 'pcsUnitDictId'],
             [

+ 1 - 1
src/pages/Fstorehouse/F2moveStorage/F2edit/index.tsx

@@ -195,7 +195,7 @@ function F2editContent() {
             ['select', '级别', 'level', selectObj['藏品级别']],
             ['txtCTag', '文化标签', 'artDictId', '文创'],
             ['txtC', '年代', 'ageDictId'],
-            ['txtC', '质地', 'textureDictId'],
+            ['txtCTag', '质地', 'textureDictId', '质地3'],
             ['select', '完残程度', 'tornLevel', selectObj['完残程度']],
             ['ping', '数量', 'pcs', 'pcsUnitDictId'],
             [

+ 1 - 1
src/pages/Fstorehouse/F3outStorage/F3edit/index.tsx

@@ -133,7 +133,7 @@ function F3editContent() {
             ['select', '级别', 'level', selectObj['藏品级别']],
             ['txtCTag', '文化标签', 'artDictId', '文创'],
             ['txtC', '年代', 'ageDictId'],
-            ['txtC', '质地', 'textureDictId'],
+            ['txtCTag', '质地', 'textureDictId', '质地3'],
             ['select', '完残程度', 'tornLevel', selectObj['完残程度']],
             ['ping', '数量', 'pcs', 'pcsUnitDictId'],
             ['connectTxt', '库房位置', 'storageName', 'siteLoc'],

+ 1 - 1
src/pages/Fstorehouse/F4check/F4edit/index.tsx

@@ -195,7 +195,7 @@ function F1editContent() {
             ['select', '级别', 'level', selectObj['藏品级别']],
             ['txtCTag', '文化标签', 'artDictId', '文创'],
             ['txtC', '年代', 'ageDictId'],
-            ['txtC', '质地', 'textureDictId'],
+            ['txtCTag', '质地', 'textureDictId', '质地3'],
             ['select', '完残程度', 'tornLevel', selectObj['完残程度']],
             ['ping', '盘点前数量', 'pcs', 'pcsUnitDictId'],
             [

+ 3 - 3
src/pages/ZgoodsInfo/data.ts

@@ -1,6 +1,6 @@
 import dayjs from 'dayjs'
 import { GoodsType } from '../Zother/SonGoodsList/data'
-import { myTableTransferSize, resJiLianFu } from '@/utils/dataChange'
+import { myTableTransferSize, resJiLianFu, zhiDiResFu } from '@/utils/dataChange'
 
 const isNull = '(空)'
 
@@ -29,9 +29,9 @@ export const GIrowArr = [
     }
   },
   {
-    key: 'textureDictId',
+    key: ['texture1DictId', ' texture2DictId', 'textureDictId'],
     name: '质地',
-    resFu: (info: GoodsType) => resJiLianFu(info.textureDictId)
+    resFu: (info: GoodsType) => zhiDiResFu(info)
   },
   { key: 'tornLevel', name: '完残程度' },
   { key: 'tornInfo', name: '完残状况' },

+ 10 - 0
src/pages/Zother/AddGoods/index.module.scss

@@ -59,6 +59,16 @@
             }
           }
         }
+
+        // 3个质地
+        .AGrowZhiDi {
+          display: flex;
+          width: 48%;
+          .AGrowZhiDi1 {
+            width: 75%;
+          }
+        }
+
         .AGrowSize {
           position: relative;
           display: flex;

+ 59 - 37
src/pages/Zother/AddGoods/index.tsx

@@ -16,8 +16,16 @@ import { MessageFu } from '@/utils/message'
 import { API_getFileListByIds } from '@/store/action/Cledger/C4file'
 import { FileUpInfoType } from '../data'
 
+export const jiLianDuoArr = ['artDictId', 'tagDictId', 'textureDictId']
+
 // 级联的数据转换成字符串
-export const cascaderChArr = ['ageDictId', 'pcsUnitDictId', 'textureDictId', 'qualityLevelDictId']
+export const cascaderChArr = [
+  'ageDictId',
+  'pcsUnitDictId',
+  'texture1DictId',
+  'texture2DictId',
+  'qualityLevelDictId'
+]
 
 // 下拉框为空的时候转变成null
 export const addZiSelectChArr = [
@@ -89,15 +97,13 @@ function AddGoods({
         if (!obj[v]) obj[v] = null
       })
 
-      // 处理文化标签
-      if (obj.artDictId) {
-        const artDictId = obj.artDictId.split(';').map((item: string) => item.split(','))
-        obj.artDictId = artDictId
-      }
-      if (obj.tagDictId) {
-        const tagDictId = obj.tagDictId.split(';').map((item: string) => item.split(','))
-        obj.tagDictId = tagDictId
-      }
+      // 处理多选的级联标签
+      jiLianDuoArr.forEach(v => {
+        if (obj[v]) {
+          const temp = obj[v].split(';').map((item: string) => item.split(','))
+          obj[v] = temp
+        }
+      })
 
       FormBoxRef.current?.setFieldsValue(obj)
 
@@ -172,24 +178,16 @@ function AddGoods({
         if (values[v]) obj[v] = values[v].join(',')
       })
 
-      // 文化标签-级联多选特殊处理
-      let artDictId = ''
-      if (obj.artDictId.length) {
-        obj.artDictId.forEach((v: string[], i: number) => {
-          artDictId += v.join(',') + (i === obj.artDictId.length - 1 ? '' : ';')
-        })
-      }
-
-      obj.artDictId = artDictId
-
-      let tagDictId = ''
-      if (obj.tagDictId.length) {
-        obj.tagDictId.forEach((v: string[], i: number) => {
-          tagDictId += v.join(',') + (i === obj.tagDictId.length - 1 ? '' : ';')
-        })
-      }
+      jiLianDuoArr.forEach(v => {
+        let temp = ''
+        if (obj[v].length) {
+          obj[v].forEach((c: string[], i: number) => {
+            temp += c.join(',') + (i === obj[v].length - 1 ? '' : ';')
+          })
+        }
 
-      obj.tagDictId = tagDictId
+        obj[v] = temp
+      })
 
       if (isEdit) {
         // 藏品编辑模块
@@ -396,16 +394,40 @@ function AddGoods({
               </Form.Item>
             </div>
 
-            <Form.Item label='质地' name='textureDictId'>
-              <Cascader
-                changeOnSelect
-                options={getDictFu('质地')}
-                placeholder='请选择'
-                fieldNames={{ label: 'name', value: 'id', children: 'children' }}
-                allowClear={true}
-                showSearch={true}
-              />
-            </Form.Item>
+            <div className='AGrowZhiDi'>
+              <Form.Item label='质地' name='texture1DictId' className='AGrowZhiDi1'>
+                <Cascader
+                  changeOnSelect
+                  options={getDictFu('质地1')}
+                  placeholder='请选择'
+                  fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                  allowClear={true}
+                  showSearch={true}
+                />
+              </Form.Item>
+              <Form.Item name='texture2DictId'>
+                <Cascader
+                  changeOnSelect
+                  options={getDictFu('质地2')}
+                  placeholder='请选择'
+                  fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                  allowClear={true}
+                  showSearch={true}
+                />
+              </Form.Item>
+              <Form.Item name='textureDictId'>
+                <Cascader
+                  changeOnSelect
+                  options={getDictFu('质地3')}
+                  placeholder='请选择'
+                  fieldNames={{ label: 'name', value: 'id', children: 'children' }}
+                  allowClear={true}
+                  showSearch={true}
+                  multiple
+                  maxTagCount='responsive'
+                />
+              </Form.Item>
+            </div>
 
             <Form.Item label='完残程度' name='tornLevel'>
               <Select allowClear={true} placeholder='请选择' options={selectObj['完残程度']} />

+ 6 - 1
src/pages/Zother/SonGoodsList/data.ts

@@ -50,7 +50,12 @@ export type GoodsType = {
   status: number
   storyIds: string
   tagDictId: string
+
+  // 3个质地
+  texture1DictId: string
+  texture2DictId: string
   textureDictId: string
+
   thumb: string
   thumbPc: string
   tornInfo: string
@@ -158,7 +163,7 @@ export const sgTopSelectDomGood = [
     name: '质地',
     key: 'textureDictId',
     type: 'Cascader',
-    options: getDictFu('质地')
+    options: getDictFu('质地3')
   },
   {
     name: '完残程度',

+ 17 - 2
src/utils/dataChange.tsx

@@ -1,4 +1,5 @@
 import { TypeI5Tree } from '@/pages/Isystem/I5organization/data'
+import { GoodsType } from '@/pages/Zother/SonGoodsList/data'
 import store from '@/store'
 
 // 树结构 通过最后一级id得到前面的id或者名称
@@ -202,9 +203,13 @@ export const resJiLianFu = (idTemp: string, type?: 'tag', isNull?: string) => {
 }
 
 // 藏品标签回显 、文化标签回显
-export function resTagFu(idString: string, type: '藏品' | '文创'): any {
+export function resTagFu(idString: string, type: '藏品' | '文创' | '质地3'): any {
   const dataList =
-    type === '藏品' ? store.getState().E1tag.treeData : store.getState().E3label.treeData
+    type === '藏品'
+      ? store.getState().E1tag.treeData
+      : type === '文创'
+        ? store.getState().E3label.treeData
+        : store.getState().I2dict.dictAll
 
   // 1. 构建ID到名称的映射
   const idToNameMap = new Map<string, string>()
@@ -229,6 +234,16 @@ export function resTagFu(idString: string, type: '藏品' | '文创'): any {
     .join(';') // 使用中文分号拼接
 }
 
+// 3个质地回显处理
+export const zhiDiResFu = (info: GoodsType) => {
+  const txt1 = info.texture1DictId ? resJiLianFu(info.texture1DictId) : ''
+  const txt2 = info.texture2DictId ? resJiLianFu(info.texture2DictId) : ''
+  const txt3 = info.textureDictId ? resTagFu(info.textureDictId, '质地3') : ''
+  const arr = [txt1, txt2, txt3].filter(v => v && v !== '(空)')
+  const resTxt = arr.length ? arr.join(' / ') : '(空)'
+  return resTxt
+}
+
 // size字段拼接
 export const myTableTransferSize = (item: any) => {
   let danWei = 'cm'

+ 2 - 2
src/utils/http.ts

@@ -10,8 +10,8 @@ export const defaultPassWord = 'Aa147852'
 
 export const envFlag = process.env.NODE_ENV === 'development'
 
-const baseUrlTemp = 'https://sit-qingdaobeer.4dage.com' // 测试环境
-// const baseUrlTemp = 'http://192.168.20.61:8112' // 线下环境
+// const baseUrlTemp = 'https://sit-qingdaobeer.4dage.com' // 测试环境
+const baseUrlTemp = 'http://192.168.20.61:8112' // 线下环境
 
 const baseFlag = baseUrlTemp.includes('https://')
 

+ 1 - 1
src/utils/tableData.ts

@@ -52,7 +52,7 @@ export const goodsSonTableC = (loc?: boolean) => {
     ['txt', '藏品名称', 'name'],
     ['select', '级别', 'level', selectObj['藏品级别']],
     ['txtC', '年代', 'ageDictId'],
-    ['txtC', '质地', 'textureDictId'],
+    ['txtCTag', '质地', 'textureDictId', '质地3'],
     ['select', '完残程度', 'tornLevel', selectObj['完残程度']],
     ['ping', '数量', 'pcs', 'pcsUnitDictId']
   ]