|
@@ -3,7 +3,7 @@ import styles from './index.module.scss'
|
|
|
import { useParams } from 'react-router-dom'
|
|
|
import X3auditInfo from '@/pages/X_stock/X3auditInfo'
|
|
|
import { MessageFu } from '@/utils/message'
|
|
|
-import history from '@/utils/history'
|
|
|
+import history, { btnFlagFu2 } from '@/utils/history'
|
|
|
import { Button, DatePicker, Input } from 'antd'
|
|
|
import MyPopconfirm from '@/components/MyPopconfirm'
|
|
|
import dayjs from 'dayjs'
|
|
@@ -11,22 +11,89 @@ import { B3aForm1 } from '../../B3_4page/B3edit/data'
|
|
|
import Z3upFiles from '@/components/Z3upFiles'
|
|
|
import ZRichTexts from '@/components/ZRichTexts'
|
|
|
import MyTable from '@/components/MyTable'
|
|
|
-import { B1TableC } from '@/utils/tableData'
|
|
|
+import { B1TableC, statusObj } from '@/utils/tableData'
|
|
|
import { pageTitTxtObj } from '@/pages/D_storeManage/D4impStor/D4edit'
|
|
|
import B1MoAdd from './B1MoAdd'
|
|
|
import B3flowTable from '../../B3flowTable'
|
|
|
import B1appraisal from '../B1appraisal'
|
|
|
+import { FourTableType } from '../../B3_4page/type'
|
|
|
+import {
|
|
|
+ B1_APIcreate,
|
|
|
+ B1_APIdel,
|
|
|
+ B1_APIgetInfo,
|
|
|
+ B1_APIrevocation,
|
|
|
+ B1_APIsaveApply,
|
|
|
+ B1_APIsaveAudit,
|
|
|
+ B1_APIsaveCreate,
|
|
|
+ B1_APIsaveDraft
|
|
|
+} from '@/store/action/B1collect'
|
|
|
+import { EXbtnFu } from '@/utils/EXBtn'
|
|
|
+import { B1Xtype } from '../type'
|
|
|
function B1edit() {
|
|
|
const { key, id } = useParams<any>()
|
|
|
+ // key:1 新增 2编辑 3审批 4查看
|
|
|
|
|
|
// 滚到顶部
|
|
|
const sollrDom = useRef<HTMLDivElement>(null)
|
|
|
|
|
|
+ // -------征集线索-------------
|
|
|
+ const [openId, setOpenId] = useState(0)
|
|
|
+
|
|
|
+ const [clueArr, setClueArr] = useState<B1Xtype[]>([])
|
|
|
+
|
|
|
+ const tableLastBtn = useMemo(() => {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ title: '操作',
|
|
|
+ render: (item: any) => {
|
|
|
+ return (
|
|
|
+ <>
|
|
|
+ <Button size='small' type='text' onClick={() => setOpenId(item.id)}>
|
|
|
+ {['3', '4'].includes(key) ? '查看' : '编辑'}
|
|
|
+ </Button>
|
|
|
+ {['3', '4'].includes(key) ? null : (
|
|
|
+ <MyPopconfirm
|
|
|
+ txtK='删除'
|
|
|
+ onConfirm={() => setClueArr(clueArr.filter(v => v.id !== item.id))}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ </>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }, [clueArr, key])
|
|
|
+ // -------征集线索-------------
|
|
|
+
|
|
|
+ // 顶部数据
|
|
|
+ const [topInfo, setTopInfo] = useState({} as FourTableType)
|
|
|
+
|
|
|
+ // 创建订单
|
|
|
+ const creatFu = useCallback(async () => {
|
|
|
+ const res = await B1_APIcreate()
|
|
|
+ if (res.code === 0) {
|
|
|
+ setTopInfo(res.data)
|
|
|
+ }
|
|
|
+ }, [])
|
|
|
+
|
|
|
+ // 获取详情
|
|
|
+ const getInfoFu = useCallback(async () => {
|
|
|
+ const res = await B1_APIgetInfo(id)
|
|
|
+ if (res.code === 0) {
|
|
|
+ setTopInfo(res.data)
|
|
|
+ setClueArr(res.data.collects || [])
|
|
|
+
|
|
|
+ // 设置富文本
|
|
|
+ ZRichTextRef.current?.ritxtShowFu(JSON.parse(res.data.rtf || '{}'))
|
|
|
+ }
|
|
|
+ }, [id])
|
|
|
+
|
|
|
useEffect(() => {
|
|
|
- console.log('key:', key)
|
|
|
+ if (key === '1') creatFu()
|
|
|
+ else getInfoFu()
|
|
|
|
|
|
if (sollrDom.current) sollrDom.current.scrollTop = 0
|
|
|
- }, [key])
|
|
|
+ }, [creatFu, getInfoFu, key])
|
|
|
|
|
|
// 上传附件的ref
|
|
|
const filesRef = useRef<any>(null)
|
|
@@ -38,94 +105,193 @@ function B1edit() {
|
|
|
// 审批意见的ref
|
|
|
const ZAuditRef = useRef<any>(null)
|
|
|
|
|
|
- // 设置富文本
|
|
|
- // ZRichTextRef.current?.ritxtShowFu(JSON.parse(data.rtf))
|
|
|
+ const timeChange = useCallback(
|
|
|
+ (e: any) => {
|
|
|
+ setTopInfo({ ...topInfo, date: dayjs(e).format('YYYY-MM-DD') })
|
|
|
+ },
|
|
|
+ [topInfo]
|
|
|
+ )
|
|
|
|
|
|
- const timeChange = useCallback((e: any) => {
|
|
|
- console.log(123, e)
|
|
|
- }, [])
|
|
|
+ // 审批的sta
|
|
|
+ const [auditSta, setAuDitSta] = useState('')
|
|
|
|
|
|
// 新增的底部按钮点击
|
|
|
- const btnClickFu = useCallback((val: number) => {
|
|
|
- const rtf1 = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
|
|
|
- console.log('申请信息富文本', JSON.stringify(rtf1.val || ''))
|
|
|
+ const btnClickFu = useCallback(
|
|
|
+ async (val: '草稿' | '创建' | '保存' | '审批') => {
|
|
|
+ if (!topInfo.name) return MessageFu.warning('计划名称不能为空')
|
|
|
+
|
|
|
+ if (val === '审批') {
|
|
|
+ // console.log('审批信息富文本', rtf2)
|
|
|
+ if (!auditSta) {
|
|
|
+ if (sollrDom.current) sollrDom.current.scrollTop = 0
|
|
|
+ return MessageFu.warning('请选择审批结果')
|
|
|
+ }
|
|
|
+ const rtf2 = ZAuditRef.current?.resData()
|
|
|
+
|
|
|
+ const res = await B1_APIsaveAudit({
|
|
|
+ orderId: topInfo.id,
|
|
|
+ rtfOpinion: rtf2,
|
|
|
+ status: auditSta === '同意' ? 1 : 2
|
|
|
+ })
|
|
|
+
|
|
|
+ if (res.code === 0) {
|
|
|
+ MessageFu.success('审批成功')
|
|
|
+ // 跳详情页
|
|
|
+ history.push(`/collect_edit/4/${topInfo.id}`)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ const rtf1 = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
|
|
|
+ // console.log('申请信息富文本', JSON.stringify(rtf1.val || ''))
|
|
|
|
|
|
- const rtf2 = ZAuditRef.current?.resData()
|
|
|
- console.log('审批信息富文本', rtf2)
|
|
|
+ // 上传附件
|
|
|
+ const filesRes = filesRef.current.filesIdRes()
|
|
|
|
|
|
- // if (1 + 1 === 2) return
|
|
|
+ const obj = {
|
|
|
+ ...topInfo,
|
|
|
+ fileIds: filesRes.join(','),
|
|
|
+ rtf: JSON.stringify(rtf1.val || ''),
|
|
|
|
|
|
- if (val === 2) {
|
|
|
- // 存草稿 当前页保存 不跳转
|
|
|
- MessageFu.success('草稿保存成功')
|
|
|
- } else {
|
|
|
- // 跳到详情页
|
|
|
- history.push(`/collect_edit/4/111`)
|
|
|
- }
|
|
|
- }, [])
|
|
|
+ collectIds: clueArr.map(v => v.id).join(',')
|
|
|
+ }
|
|
|
+ // console.log(123, obj)
|
|
|
|
|
|
- // 点击删除
|
|
|
- const delTableFu = useCallback(async (id: number) => {}, [])
|
|
|
+ // if (1 + 1 === 2) return
|
|
|
|
|
|
- const tableLastBtn = useMemo(() => {
|
|
|
- return [
|
|
|
- {
|
|
|
- title: '操作',
|
|
|
- render: (item: any) => {
|
|
|
- return (
|
|
|
- <>
|
|
|
- <Button size='small' type='text' onClick={() => setOpenInfo(item)}>
|
|
|
- {['3', '4'].includes(key) ? '查看' : '编辑'}
|
|
|
- </Button>
|
|
|
- {['3', '4'].includes(key) ? null : (
|
|
|
- <MyPopconfirm txtK='删除' onConfirm={() => delTableFu(item.id)} />
|
|
|
- )}
|
|
|
- </>
|
|
|
- )
|
|
|
+ if (val === '草稿') {
|
|
|
+ // 存草稿 当前页保存 不跳转
|
|
|
+ const res = await B1_APIsaveDraft(obj)
|
|
|
+ if (res.code === 0) {
|
|
|
+ MessageFu.success('草稿保存成功')
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ const res = val === '创建' ? await B1_APIsaveCreate(obj) : await B1_APIsaveApply(obj)
|
|
|
+ if (res.code === 0) {
|
|
|
+ MessageFu.success(`${val}成功`)
|
|
|
+ // 跳到详情页
|
|
|
+ history.push(`/collect_edit/4/${topInfo.id}`)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- ]
|
|
|
- }, [delTableFu, key])
|
|
|
+ },
|
|
|
+ [auditSta, clueArr, topInfo]
|
|
|
+ )
|
|
|
|
|
|
- // 审批的sta
|
|
|
- const [auditSta, setAuDitSta] = useState('')
|
|
|
+ // 查看的按钮创建-提交-撤回
|
|
|
+ const lookBtnFu = useCallback(
|
|
|
+ async (val: '创建' | '提交' | '撤回') => {
|
|
|
+ const rtf1 = ZRichTextRef.current?.fatherBtnOkFu() || { flag: true }
|
|
|
+ // console.log('申请信息富文本', JSON.stringify(rtf1.val || ''))
|
|
|
+
|
|
|
+ // 上传附件
|
|
|
+ const filesRes = filesRef.current.filesIdRes()
|
|
|
+ const obj = {
|
|
|
+ ...topInfo,
|
|
|
+ fileIds: filesRes.join(','),
|
|
|
+ rtf: JSON.stringify(rtf1.val || ''),
|
|
|
+ goodsIds: topInfo.goods.map(v => v.id).join(','),
|
|
|
+ goods: topInfo.goods.map(v => ({
|
|
|
+ goodsId: v.id,
|
|
|
+ siteStr: v.siteStr,
|
|
|
+ siteId: v.siteId
|
|
|
+ }))
|
|
|
+ }
|
|
|
+
|
|
|
+ const res =
|
|
|
+ val === '创建'
|
|
|
+ ? await B1_APIsaveCreate(obj)
|
|
|
+ : val === '提交'
|
|
|
+ ? await B1_APIsaveApply(obj)
|
|
|
+ : await B1_APIrevocation(id)
|
|
|
+
|
|
|
+ if (res.code === 0) {
|
|
|
+ if (sollrDom.current) sollrDom.current.scrollTop = 0
|
|
|
+ MessageFu.success(val + '成功')
|
|
|
+ getInfoFu()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ [getInfoFu, id, topInfo]
|
|
|
+ )
|
|
|
|
|
|
- // 查看模式下的按钮 待完善
|
|
|
+ // 查看模式点击删除
|
|
|
+ const delFu = useCallback(async () => {
|
|
|
+ const res = await B1_APIdel(id)
|
|
|
+ if (res.code === 0) {
|
|
|
+ MessageFu.success('删除成功')
|
|
|
+ history.push('/collect')
|
|
|
+ }
|
|
|
+ }, [id])
|
|
|
+
|
|
|
+ // 查看模式点击审批 编辑
|
|
|
+ const lookJumpFu = useCallback(
|
|
|
+ (val: '审批' | '编辑') => {
|
|
|
+ history.push(`/collect_edit/${val === '审批' ? 3 : 2}/${id}`)
|
|
|
+ MessageFu.success(`已跳转至${val}页面`)
|
|
|
+ },
|
|
|
+ [id]
|
|
|
+ )
|
|
|
+
|
|
|
+ // 查看模式下的按钮
|
|
|
const lookBtn = useMemo(() => {
|
|
|
return (
|
|
|
<>
|
|
|
- <Button type='primary'>创建</Button>
|
|
|
- <Button type='primary'>提交</Button>
|
|
|
- <MyPopconfirm
|
|
|
- txtK='撤回'
|
|
|
- onConfirm={() => {}}
|
|
|
- Dom={
|
|
|
- <Button type='primary' danger>
|
|
|
- 撤回
|
|
|
- </Button>
|
|
|
- }
|
|
|
- />
|
|
|
+ {btnFlagFu2(topInfo)['创建'] ? (
|
|
|
+ <Button type='primary' onClick={() => lookBtnFu('创建')}>
|
|
|
+ 创建
|
|
|
+ </Button>
|
|
|
+ ) : null}
|
|
|
+ {btnFlagFu2(topInfo)['提交'] ? (
|
|
|
+ <Button type='primary' onClick={() => lookBtnFu('提交')}>
|
|
|
+ 提交
|
|
|
+ </Button>
|
|
|
+ ) : null}
|
|
|
+
|
|
|
+ {btnFlagFu2(topInfo)['撤回'] ? (
|
|
|
+ <MyPopconfirm
|
|
|
+ txtK='撤回'
|
|
|
+ onConfirm={() => lookBtnFu('撤回')}
|
|
|
+ Dom={
|
|
|
+ <Button type='primary' danger>
|
|
|
+ 撤回
|
|
|
+ </Button>
|
|
|
+ }
|
|
|
+ />
|
|
|
+ ) : null}
|
|
|
+
|
|
|
+ {btnFlagFu2(topInfo)['审批'] ? (
|
|
|
+ <Button type='primary' onClick={() => lookJumpFu('审批')}>
|
|
|
+ 审批
|
|
|
+ </Button>
|
|
|
+ ) : null}
|
|
|
+ {btnFlagFu2(topInfo)['编辑'] ? (
|
|
|
+ <Button type='primary' onClick={() => lookJumpFu('编辑')}>
|
|
|
+ 编辑
|
|
|
+ </Button>
|
|
|
+ ) : null}
|
|
|
+
|
|
|
+ {btnFlagFu2(topInfo)['重新提交'] ? (
|
|
|
+ <Button type='primary' onClick={() => lookBtnFu('提交')}>
|
|
|
+ 重新提交
|
|
|
+ </Button>
|
|
|
+ ) : null}
|
|
|
+
|
|
|
+ {EXbtnFu()}
|
|
|
+
|
|
|
+ {btnFlagFu2(topInfo)['删除'] ? (
|
|
|
+ <MyPopconfirm
|
|
|
+ txtK='删除'
|
|
|
+ onConfirm={() => delFu()}
|
|
|
+ Dom={
|
|
|
+ <Button type='primary' danger>
|
|
|
+ 删除
|
|
|
+ </Button>
|
|
|
+ }
|
|
|
+ />
|
|
|
+ ) : null}
|
|
|
|
|
|
- <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('/collect')}>返回</Button>
|
|
|
</>
|
|
|
)
|
|
|
- }, [])
|
|
|
-
|
|
|
- // 征集线索
|
|
|
- const [openInfo, setOpenInfo] = useState<any>({ id: 0 })
|
|
|
+ }, [delFu, lookBtnFu, lookJumpFu, topInfo])
|
|
|
|
|
|
return (
|
|
|
<div className={styles.B1edit}>
|
|
@@ -134,8 +300,8 @@ function B1edit() {
|
|
|
<div className='B1main'>
|
|
|
{['3'].includes(key) ? (
|
|
|
<X3auditInfo
|
|
|
- dirCode='待完善'
|
|
|
- myUrl='待完善'
|
|
|
+ dirCode='B1collect'
|
|
|
+ myUrl='cms/orderCollect/upload'
|
|
|
auditSta={auditSta}
|
|
|
auditStaFu={val => setAuDitSta(val)}
|
|
|
ref={ZAuditRef}
|
|
@@ -144,9 +310,10 @@ function B1edit() {
|
|
|
|
|
|
{/* 表单字段、附件等 */}
|
|
|
<div className='B1Tit'>
|
|
|
- {/* 待完善 */}
|
|
|
申请信息
|
|
|
- <Button type='dashed'>草稿</Button>
|
|
|
+ {key === '1' ? null : (
|
|
|
+ <Button type='dashed'>{Reflect.get(statusObj, topInfo.status)}</Button>
|
|
|
+ )}
|
|
|
</div>
|
|
|
<div className='B1rowAll'>
|
|
|
<div className='B1row'>
|
|
@@ -155,6 +322,8 @@ function B1edit() {
|
|
|
</div>
|
|
|
<div className='B1rowrr'>
|
|
|
<Input
|
|
|
+ value={topInfo.name}
|
|
|
+ onChange={e => setTopInfo({ ...topInfo, name: e.target.value.trim() })}
|
|
|
readOnly={['3', '4'].includes(key)}
|
|
|
placeholder='请输入内容'
|
|
|
maxLength={30}
|
|
@@ -171,7 +340,7 @@ function B1edit() {
|
|
|
<DatePicker
|
|
|
disabled={['3', '4'].includes(key)}
|
|
|
allowClear={false}
|
|
|
- value={dayjs()}
|
|
|
+ value={dayjs(topInfo.date)}
|
|
|
onChange={timeChange}
|
|
|
/>
|
|
|
</div>
|
|
@@ -181,9 +350,9 @@ function B1edit() {
|
|
|
<div className='B1row' key={v.name}>
|
|
|
<div className='B1rowll'>{v.name}:</div>
|
|
|
<div className='B1rowrr'>
|
|
|
- 这是一段文本
|
|
|
+ {topInfo[v.key as 'name']}
|
|
|
{['3', '4'].includes(key) && v.name === '发起人'
|
|
|
- ? ' - 查看和审批后面显示创建时间'
|
|
|
+ ? ' - ' + topInfo.createTime || ''
|
|
|
: ''}
|
|
|
</div>
|
|
|
</div>
|
|
@@ -197,9 +366,9 @@ function B1edit() {
|
|
|
isLook={['3', '4'].includes(key)}
|
|
|
ref={filesRef}
|
|
|
fileCheck={false}
|
|
|
- dirCode={'xxxxxxx'}
|
|
|
- myUrl='xxxxxxxxxxxx'
|
|
|
- lookData={[]}
|
|
|
+ dirCode='B1collect'
|
|
|
+ myUrl='cms/orderCollect/upload'
|
|
|
+ lookData={topInfo.files || []}
|
|
|
size={500}
|
|
|
/>
|
|
|
</div>
|
|
@@ -209,6 +378,8 @@ function B1edit() {
|
|
|
<div className='B1rowll'>原因事由:</div>
|
|
|
<div className='B1rowrr'>
|
|
|
<Input
|
|
|
+ value={topInfo.reason}
|
|
|
+ onChange={e => setTopInfo({ ...topInfo, reason: e.target.value })}
|
|
|
readOnly={['3', '4'].includes(key)}
|
|
|
placeholder='请输入内容'
|
|
|
maxLength={30}
|
|
@@ -222,10 +393,10 @@ function B1edit() {
|
|
|
<div className='B1rowrr'>
|
|
|
<ZRichTexts
|
|
|
check={false}
|
|
|
- dirCode={'xxxxxxxx'}
|
|
|
+ dirCode='B1collect'
|
|
|
+ myUrl='cms/orderCollect/upload'
|
|
|
isLook={['3', '4'].includes(key)}
|
|
|
ref={ZRichTextRef}
|
|
|
- myUrl='xxxxxxxxxx'
|
|
|
isOne={true}
|
|
|
upAudioBtnNone={true}
|
|
|
/>
|
|
@@ -239,7 +410,7 @@ function B1edit() {
|
|
|
<div className='B1Tit2ll'>征集线索</div>
|
|
|
<div className='B1Tit2rr'>
|
|
|
{['3', '4'].includes(key) ? null : (
|
|
|
- <Button type='primary' onClick={() => setOpenInfo({ id: -1 })}>
|
|
|
+ <Button type='primary' onClick={() => setOpenId(-1)}>
|
|
|
新增
|
|
|
</Button>
|
|
|
)}
|
|
@@ -248,27 +419,18 @@ function B1edit() {
|
|
|
|
|
|
{/* 表格 */}
|
|
|
<MyTable
|
|
|
- list={[{ id: 101 }]}
|
|
|
+ list={clueArr}
|
|
|
columnsTemp={B1TableC}
|
|
|
lastBtn={tableLastBtn}
|
|
|
pagingInfo={false}
|
|
|
/>
|
|
|
</div>
|
|
|
|
|
|
- {/* 相关鉴定 */}
|
|
|
+ {/* 相关鉴定 待完善*/}
|
|
|
{['3', '4'].includes(key) ? <B1appraisal /> : null}
|
|
|
|
|
|
{/* 申请流程 */}
|
|
|
- {['3', '4'].includes(key) ? (
|
|
|
- <B3flowTable
|
|
|
- tableArr={
|
|
|
- [
|
|
|
- // 待完善
|
|
|
- ]
|
|
|
- }
|
|
|
- />
|
|
|
- ) : null}
|
|
|
- {/* main-end */}
|
|
|
+ {['3', '4'].includes(key) ? <B3flowTable tableArr={topInfo.audits || []} /> : null}
|
|
|
</div>
|
|
|
|
|
|
{/* 底部按钮 */}
|
|
@@ -277,12 +439,18 @@ function B1edit() {
|
|
|
lookBtn
|
|
|
) : (
|
|
|
<>
|
|
|
- <Button type='primary' onClick={() => btnClickFu(1)}>
|
|
|
- {key === '1' ? '创建' : '保存'}
|
|
|
- </Button>
|
|
|
+ {key === '3' ? (
|
|
|
+ <Button type='primary' onClick={() => btnClickFu('审批')}>
|
|
|
+ 审批
|
|
|
+ </Button>
|
|
|
+ ) : (
|
|
|
+ <Button type='primary' onClick={() => btnClickFu(key === '1' ? '创建' : '保存')}>
|
|
|
+ {key === '1' ? '创建' : '保存'}
|
|
|
+ </Button>
|
|
|
+ )}
|
|
|
|
|
|
{key === '1' ? (
|
|
|
- <Button type='primary' onClick={() => btnClickFu(2)}>
|
|
|
+ <Button type='primary' onClick={() => btnClickFu('草稿')}>
|
|
|
存草稿
|
|
|
</Button>
|
|
|
) : null}
|
|
@@ -293,13 +461,20 @@ function B1edit() {
|
|
|
</div>
|
|
|
|
|
|
{/* 征集线索 */}
|
|
|
- {openInfo.id ? (
|
|
|
+ {openId ? (
|
|
|
<B1MoAdd
|
|
|
look={['3', '4'].includes(key)}
|
|
|
- sId={id}
|
|
|
- info={openInfo}
|
|
|
- closeFu={() => setOpenInfo({})}
|
|
|
- succFu={() => {}}
|
|
|
+ sId={openId}
|
|
|
+ closeFu={() => setOpenId(0)}
|
|
|
+ succFu={(obj, txt) => {
|
|
|
+ if (txt === '新增') setClueArr([obj, ...clueArr])
|
|
|
+ else {
|
|
|
+ const index = clueArr.findIndex(v => v.id === obj.id)
|
|
|
+ const newArr = [...clueArr]
|
|
|
+ newArr[index] = obj
|
|
|
+ setClueArr(newArr)
|
|
|
+ }
|
|
|
+ }}
|
|
|
/>
|
|
|
) : null}
|
|
|
</div>
|