|
@@ -15,7 +15,7 @@ import { useSelector } from 'react-redux'
|
|
|
import { RootState } from '@/store'
|
|
|
import { GoodFileType } from '@/components/Z3upFiles'
|
|
|
import { C1GoodType } from '@/pages/A3_ledger/C1ledger/type'
|
|
|
-import { API_setGoodsCover } from '@/store/action/C1ledger'
|
|
|
+// import { API_setGoodsCover } from '@/store/action/C1ledger'
|
|
|
|
|
|
type Props = {
|
|
|
isLook?: boolean
|
|
@@ -122,49 +122,49 @@ function Y33com({ isLook, sId, info, setImgCover }: Props) {
|
|
|
// 获取下载权限
|
|
|
const downImg = useSelector((state: RootState) => state.A0Layout.downImg)
|
|
|
|
|
|
- // 设置封面图
|
|
|
- const setCoverFu = useCallback(
|
|
|
- async (thumb: string, thumbPc: string) => {
|
|
|
- const res = await API_setGoodsCover({
|
|
|
- id: info.id,
|
|
|
- thumb,
|
|
|
- thumbPc
|
|
|
- })
|
|
|
- if (res.code === 0) {
|
|
|
- MessageFu.success('设置成功')
|
|
|
- setImgCover && setImgCover()
|
|
|
- }
|
|
|
- },
|
|
|
- [info.id, setImgCover]
|
|
|
- )
|
|
|
+ // // 设置封面图
|
|
|
+ // const setCoverFu = useCallback(
|
|
|
+ // async (thumb: string, thumbPc: string) => {
|
|
|
+ // const res = await API_setGoodsCover({
|
|
|
+ // id: info.id,
|
|
|
+ // thumb,
|
|
|
+ // thumbPc
|
|
|
+ // })
|
|
|
+ // if (res.code === 0) {
|
|
|
+ // MessageFu.success('设置成功')
|
|
|
+ // setImgCover && setImgCover()
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // [info.id, setImgCover]
|
|
|
+ // )
|
|
|
|
|
|
const tableLastBtn = useMemo(() => {
|
|
|
let arr: any[] = []
|
|
|
|
|
|
- if (isLook)
|
|
|
- arr.push({
|
|
|
- title: '封面图设置',
|
|
|
- render: (item: GoodFileType) => {
|
|
|
- const fileNameArr = item.fileName.split('.')
|
|
|
- const fileNameLast = fileNameArr[fileNameArr.length - 1]
|
|
|
+ // if (isLook)
|
|
|
+ // arr.push({
|
|
|
+ // title: '封面图设置',
|
|
|
+ // render: (item: GoodFileType) => {
|
|
|
+ // const fileNameArr = item.fileName.split('.')
|
|
|
+ // const fileNameLast = fileNameArr[fileNameArr.length - 1]
|
|
|
|
|
|
- return fileImgArr.includes(fileNameLast.toLowerCase()) ? (
|
|
|
- item.thumb === info.thumb ? (
|
|
|
- '封面'
|
|
|
- ) : (
|
|
|
- <Button
|
|
|
- size='small'
|
|
|
- type='text'
|
|
|
- onClick={() => setCoverFu(item.thumb, item.filePath)}
|
|
|
- >
|
|
|
- 设为封面
|
|
|
- </Button>
|
|
|
- )
|
|
|
- ) : (
|
|
|
- ' - '
|
|
|
- )
|
|
|
- }
|
|
|
- })
|
|
|
+ // return fileImgArr.includes(fileNameLast.toLowerCase()) ? (
|
|
|
+ // item.thumb === info.thumb ? (
|
|
|
+ // '封面'
|
|
|
+ // ) : (
|
|
|
+ // <Button
|
|
|
+ // size='small'
|
|
|
+ // type='text'
|
|
|
+ // onClick={() => setCoverFu(item.thumb, item.filePath)}
|
|
|
+ // >
|
|
|
+ // 设为封面
|
|
|
+ // </Button>
|
|
|
+ // )
|
|
|
+ // ) : (
|
|
|
+ // ' - '
|
|
|
+ // )
|
|
|
+ // }
|
|
|
+ // })
|
|
|
|
|
|
arr.push({
|
|
|
title: '操作',
|
|
@@ -220,7 +220,7 @@ function Y33com({ isLook, sId, info, setImgCover }: Props) {
|
|
|
})
|
|
|
|
|
|
return arr
|
|
|
- }, [delFu, downImg, info.thumb, isLook, setCoverFu])
|
|
|
+ }, [delFu, downImg, isLook])
|
|
|
|
|
|
const [typeMo, setTypeMo] = useState({} as infoType)
|
|
|
|