|
@@ -19,8 +19,10 @@ import dayjs from 'dayjs'
|
|
|
import { baseURL } from '@/utils/http'
|
|
import { baseURL } from '@/utils/http'
|
|
|
import { FileListType } from '@/components/Z3upFiles/data'
|
|
import { FileListType } from '@/components/Z3upFiles/data'
|
|
|
import MyTable from '@/components/MyTable'
|
|
import MyTable from '@/components/MyTable'
|
|
|
-import { getDictFu, selectObj } from '@/utils/dataChange'
|
|
|
|
|
|
|
+import { selectObj } from '@/utils/dataChange'
|
|
|
import { showGoodTableC } from '@/utils/tableData'
|
|
import { showGoodTableC } from '@/utils/tableData'
|
|
|
|
|
+import store from '@/store'
|
|
|
|
|
+import { tagApiArr } from '@/pages/ZgoodsInfo/data'
|
|
|
|
|
|
|
|
type DetailInfo = {
|
|
type DetailInfo = {
|
|
|
id?: number
|
|
id?: number
|
|
@@ -140,9 +142,10 @@ function H1detail() {
|
|
|
searchKey: '',
|
|
searchKey: '',
|
|
|
searchTagName: '',
|
|
searchTagName: '',
|
|
|
level: undefined as string | undefined,
|
|
level: undefined as string | undefined,
|
|
|
- typeDictId: undefined as (string | number)[] | undefined,
|
|
|
|
|
region: undefined as string | undefined,
|
|
region: undefined as string | undefined,
|
|
|
- status: undefined as number | undefined
|
|
|
|
|
|
|
+ status: undefined as number | undefined,
|
|
|
|
|
+ subTagIds: '',
|
|
|
|
|
+ subArtDictIds: ''
|
|
|
})
|
|
})
|
|
|
const goodFormDataRef = useRef(goodFormData)
|
|
const goodFormDataRef = useRef(goodFormData)
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
@@ -159,9 +162,17 @@ function H1detail() {
|
|
|
...fd,
|
|
...fd,
|
|
|
showId: info.id
|
|
showId: info.id
|
|
|
}
|
|
}
|
|
|
- if (Array.isArray(fd.typeDictId) && fd.typeDictId.length) {
|
|
|
|
|
- params.typeDictId = fd.typeDictId[fd.typeDictId.length - 1]
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 针对 多个标签的数据处理
|
|
|
|
|
+ tagApiArr.forEach(v => {
|
|
|
|
|
+ if (params[v] && typeof params[v] === 'string') {
|
|
|
|
|
+ params[v] = params[v]
|
|
|
|
|
+ .replaceAll(';', ',')
|
|
|
|
|
+ .split(',')
|
|
|
|
|
+ .map((v: any) => Number(v))
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
const res = await H1_APIgetShowGoodPage(params)
|
|
const res = await H1_APIgetShowGoodPage(params)
|
|
|
if (res?.code === 0) {
|
|
if (res?.code === 0) {
|
|
|
setGoodList(res.data?.records || [])
|
|
setGoodList(res.data?.records || [])
|
|
@@ -185,9 +196,10 @@ function H1detail() {
|
|
|
searchKey: '',
|
|
searchKey: '',
|
|
|
searchTagName: '',
|
|
searchTagName: '',
|
|
|
level: undefined,
|
|
level: undefined,
|
|
|
- typeDictId: undefined,
|
|
|
|
|
region: undefined,
|
|
region: undefined,
|
|
|
- status: undefined
|
|
|
|
|
|
|
+ status: undefined,
|
|
|
|
|
+ subTagIds: '',
|
|
|
|
|
+ subArtDictIds: ''
|
|
|
})
|
|
})
|
|
|
setTimeout(() => setGoodTimeKey(Date.now()), 50)
|
|
setTimeout(() => setGoodTimeKey(Date.now()), 50)
|
|
|
}, [])
|
|
}, [])
|
|
@@ -259,15 +271,6 @@ function H1detail() {
|
|
|
return arr.map(v => ({ label: v, value: v }))
|
|
return arr.map(v => ({ label: v, value: v }))
|
|
|
}, [info.region])
|
|
}, [info.region])
|
|
|
|
|
|
|
|
- const typeDictOptions = useMemo(() => {
|
|
|
|
|
- // 待完善sg
|
|
|
|
|
- try {
|
|
|
|
|
- return getDictFu('藏品类别') || []
|
|
|
|
|
- } catch {
|
|
|
|
|
- return []
|
|
|
|
|
- }
|
|
|
|
|
- }, [])
|
|
|
|
|
-
|
|
|
|
|
return (
|
|
return (
|
|
|
<div className={styles.H1detail}>
|
|
<div className={styles.H1detail}>
|
|
|
<div className='H1detailMain'>
|
|
<div className='H1detailMain'>
|
|
@@ -354,12 +357,30 @@ function H1detail() {
|
|
|
allowClear
|
|
allowClear
|
|
|
style={{ width: 250 }}
|
|
style={{ width: 250 }}
|
|
|
/>
|
|
/>
|
|
|
- <Input
|
|
|
|
|
- placeholder='搜索藏品标签'
|
|
|
|
|
- value={goodFormData.searchTagName}
|
|
|
|
|
- onChange={e => setGoodFormData(d => ({ ...d, searchTagName: e.target.value }))}
|
|
|
|
|
- allowClear
|
|
|
|
|
- style={{ width: 200 }}
|
|
|
|
|
|
|
+ <Cascader
|
|
|
|
|
+ changeOnSelect
|
|
|
|
|
+ options={store.getState().E1tag.treeData}
|
|
|
|
|
+ placeholder='藏品标签'
|
|
|
|
|
+ fieldNames={{ label: 'name', value: 'id', children: 'children' }}
|
|
|
|
|
+ allowClear={true}
|
|
|
|
|
+ showSearch={true}
|
|
|
|
|
+ value={
|
|
|
|
|
+ goodFormData.subTagIds
|
|
|
|
|
+ ? goodFormData.subTagIds.split(';').map((item: string) => item.split(','))
|
|
|
|
|
+ : []
|
|
|
|
|
+ }
|
|
|
|
|
+ onChange={e => {
|
|
|
|
|
+ const seLectArr: any = e || []
|
|
|
|
|
+ let temp = ''
|
|
|
|
|
+ if (seLectArr.length) {
|
|
|
|
|
+ seLectArr.forEach((v: string[], i: number) => {
|
|
|
|
|
+ temp += v.join(',') + (i === seLectArr.length - 1 ? '' : ';')
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ setGoodFormData({ ...goodFormData, subTagIds: temp })
|
|
|
|
|
+ }}
|
|
|
|
|
+ multiple
|
|
|
|
|
+ maxTagCount='responsive'
|
|
|
/>
|
|
/>
|
|
|
<Select
|
|
<Select
|
|
|
placeholder='级别'
|
|
placeholder='级别'
|
|
@@ -370,13 +391,29 @@ function H1detail() {
|
|
|
style={{ width: 120 }}
|
|
style={{ width: 120 }}
|
|
|
/>
|
|
/>
|
|
|
<Cascader
|
|
<Cascader
|
|
|
- placeholder='类别'
|
|
|
|
|
- allowClear
|
|
|
|
|
- value={goodFormData.typeDictId}
|
|
|
|
|
- onChange={(v: any) => setGoodFormData(d => ({ ...d, typeDictId: v }))}
|
|
|
|
|
- options={typeDictOptions}
|
|
|
|
|
|
|
+ changeOnSelect
|
|
|
|
|
+ options={store.getState().E3label.treeData}
|
|
|
|
|
+ placeholder='文化标签'
|
|
|
fieldNames={{ label: 'name', value: 'id', children: 'children' }}
|
|
fieldNames={{ label: 'name', value: 'id', children: 'children' }}
|
|
|
- style={{ width: 160 }}
|
|
|
|
|
|
|
+ allowClear={true}
|
|
|
|
|
+ showSearch={true}
|
|
|
|
|
+ value={
|
|
|
|
|
+ goodFormData.subArtDictIds
|
|
|
|
|
+ ? goodFormData.subArtDictIds.split(';').map((item: string) => item.split(','))
|
|
|
|
|
+ : []
|
|
|
|
|
+ }
|
|
|
|
|
+ onChange={e => {
|
|
|
|
|
+ const seLectArr: any = e || []
|
|
|
|
|
+ let temp = ''
|
|
|
|
|
+ if (seLectArr.length) {
|
|
|
|
|
+ seLectArr.forEach((v: string[], i: number) => {
|
|
|
|
|
+ temp += v.join(',') + (i === seLectArr.length - 1 ? '' : ';')
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ setGoodFormData({ ...goodFormData, subArtDictIds: temp })
|
|
|
|
|
+ }}
|
|
|
|
|
+ multiple
|
|
|
|
|
+ maxTagCount='responsive'
|
|
|
/>
|
|
/>
|
|
|
<Select
|
|
<Select
|
|
|
placeholder='展区'
|
|
placeholder='展区'
|