|
@@ -16,7 +16,7 @@ import { GoodFileType } from './type'
|
|
|
import { baseURL } from '@/utils/http'
|
|
|
import { fileImgArr, fileVideoArr } from '@/store/action/layout'
|
|
|
import { API_C2dels } from '@/store/action/C2files'
|
|
|
-import { API_goodsAdd, API_goodsInfo, API_setThumb } from '@/store/action/C1ledger'
|
|
|
+import { API_goodsAdd, API_goodsInfo } from '@/store/action/C1ledger'
|
|
|
import { C1GoodType } from '@/pages/A3_ledger/C1ledger/type'
|
|
|
import { MessageFu } from '@/utils/message'
|
|
|
import history, { cascaderObjFu } from '@/utils/history'
|
|
@@ -103,11 +103,11 @@ function AddGoods({ nowSta, closeFu, succFu, isEdit, editSnap }: Props) {
|
|
|
FormBoxRef.current?.setFieldsValue(obj)
|
|
|
|
|
|
// 设置封面图
|
|
|
- // ZupThumbRef.current?.setFileComFileFu({
|
|
|
- // fileName: '',
|
|
|
- // filePath: obj.thumbPc,
|
|
|
- // thumb: obj.thumb
|
|
|
- // })
|
|
|
+ ZupThumbRef.current?.setFileComFileFu({
|
|
|
+ fileName: '',
|
|
|
+ filePath: obj.thumbPc,
|
|
|
+ thumb: obj.thumb
|
|
|
+ })
|
|
|
|
|
|
// 设置富文本
|
|
|
if (obj.rtf) ZRichTextRef.current?.ritxtShowFu(JSON.parse(obj.rtf))
|
|
@@ -321,7 +321,9 @@ function AddGoods({ nowSta, closeFu, succFu, isEdit, editSnap }: Props) {
|
|
|
fileSet,
|
|
|
// inGoodsDate,
|
|
|
dateMaking,
|
|
|
- id: idRes
|
|
|
+ id: idRes,
|
|
|
+ thumb: coverUrl1.thumb || '',
|
|
|
+ thumbPc: coverUrl1.filePath || ''
|
|
|
}
|
|
|
|
|
|
for (const k in obj) {
|
|
@@ -357,19 +359,6 @@ function AddGoods({ nowSta, closeFu, succFu, isEdit, editSnap }: Props) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (objOld.current.thumb !== coverUrl1.thumb) {
|
|
|
- // 只修改封面图
|
|
|
- coverUrl1 &&
|
|
|
- (await API_setThumb({
|
|
|
- id: objOld.current.id,
|
|
|
- thumb: coverUrl1.thumb,
|
|
|
- thumbPc: coverUrl1.thumb
|
|
|
- }))
|
|
|
- MessageFu.success(`${staTxt.current}成功`)
|
|
|
- closeFu()
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
if (flag) return MessageFu.warning('未修改藏品信息')
|
|
|
|
|
|
// -----------藏品编辑模块进来---------------
|
|
@@ -392,12 +381,6 @@ function AddGoods({ nowSta, closeFu, succFu, isEdit, editSnap }: Props) {
|
|
|
|
|
|
const res = await API_goodsAdd(obj, idRes ? '编辑' : '新增')
|
|
|
if (res.code === 0) {
|
|
|
- coverUrl1 &&
|
|
|
- (await API_setThumb({
|
|
|
- id: res.data.id,
|
|
|
- thumb: coverUrl1.thumb,
|
|
|
- thumbPc: coverUrl1.thumb
|
|
|
- }))
|
|
|
MessageFu.success(nowSta.id === 'null' ? `${staTxt.current}成功` : '编辑成功')
|
|
|
succFu(res.data, nowSta.id === 'null' ? '新增' : '编辑', staTxt.current as '提交')
|
|
|
closeFu()
|