|
@@ -8,9 +8,9 @@ import { baseURL } from '@/utils/http'
|
|
|
import { fileTypeRes } from '@/store/action/layout'
|
|
|
import { getTokenFu } from '@/utils/storage'
|
|
|
import history from '@/utils/history'
|
|
|
-import modal from 'antd/es/modal'
|
|
|
import { API_C2dels } from '@/store/action/C2files'
|
|
|
import MyPopconfirm from '../MyPopconfirm'
|
|
|
+import { DeleteOutlined } from '@ant-design/icons'
|
|
|
|
|
|
const { Dragger } = Upload
|
|
|
|
|
@@ -97,57 +97,49 @@ function ZupFile({ tableList, moduleId, isShow, closeFu, succFu }: Props) {
|
|
|
{originNode}
|
|
|
|
|
|
{file.status === 'done' ? (
|
|
|
- <span className='mySelect'>
|
|
|
- <Select
|
|
|
- getPopupContainer={() => document.querySelector('#A1OMain')!}
|
|
|
- style={{ width: 200 }}
|
|
|
- placeholder='请选择'
|
|
|
- value={obj.goodsId}
|
|
|
- onChange={e => selectChangeFu(e, file.uid, file.mySelect.id)}
|
|
|
- options={tableList.map(v => ({
|
|
|
- value: v.id,
|
|
|
- label: v.name
|
|
|
- }))}
|
|
|
+ <>
|
|
|
+ <span className='mySelect'>
|
|
|
+ <Select
|
|
|
+ getPopupContainer={() => document.querySelector('#A1OMain')!}
|
|
|
+ style={{ width: 200 }}
|
|
|
+ placeholder='请选择'
|
|
|
+ value={obj.goodsId}
|
|
|
+ onChange={e => selectChangeFu(e, file.uid, file.mySelect.id)}
|
|
|
+ options={tableList.map(v => ({
|
|
|
+ value: v.id,
|
|
|
+ label: v.name
|
|
|
+ }))}
|
|
|
+ />
|
|
|
+ <span hidden={obj.goodsId}>请选择藏品</span>
|
|
|
+ </span>
|
|
|
+ <MyPopconfirm
|
|
|
+ txtK='删除'
|
|
|
+ onConfirm={async () => {
|
|
|
+ if (file.percent === 100) {
|
|
|
+ // console.log("-----还没有发请求删除", file);
|
|
|
+ const id = file.response.data.id
|
|
|
+ // 已经上传完成,发请求删除
|
|
|
+ const res = await API_C2dels([id])
|
|
|
+
|
|
|
+ if (res.code === 0) {
|
|
|
+ MessageFu.success('删除成功!')
|
|
|
+ setFileList(fileList.filter((v: any) => v.uid !== file.uid))
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ MessageFu.success('删除成功!')
|
|
|
+ setFileList(fileList.filter((v: any) => v.uid !== file.uid))
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ Dom={
|
|
|
+ <div className='mySelectIcon'>
|
|
|
+ <DeleteOutlined />
|
|
|
+ </div>
|
|
|
+ }
|
|
|
/>
|
|
|
- <span>请选择藏品</span>
|
|
|
- </span>
|
|
|
+ </>
|
|
|
) : null}
|
|
|
</span>
|
|
|
)
|
|
|
- },
|
|
|
- // onDrop(e) {
|
|
|
- // // console.log("拖动文件到上传区域", e.dataTransfer.files);
|
|
|
- // },
|
|
|
- // 点击删除
|
|
|
- async onRemove(info) {
|
|
|
- const promiseFu = new Promise((resolve: (value: boolean) => void) => {
|
|
|
- modal.confirm({
|
|
|
- title: '删除确认',
|
|
|
- content: '删除后无法恢复,是否删除?',
|
|
|
- okText: '删除',
|
|
|
- cancelText: '取消',
|
|
|
- async onOk() {
|
|
|
- if (info.percent === 100) {
|
|
|
- // console.log("-----还没有发请求删除", info);
|
|
|
- const id = info.response.data.id
|
|
|
- // 已经上传完成,发请求删除
|
|
|
- const res = await API_C2dels([id])
|
|
|
-
|
|
|
- if (res.code === 0) {
|
|
|
- MessageFu.success('删除成功!')
|
|
|
- resolve(true)
|
|
|
- }
|
|
|
- } else {
|
|
|
- resolve(true)
|
|
|
- MessageFu.success('删除成功!')
|
|
|
- }
|
|
|
- },
|
|
|
- onCancel() {
|
|
|
- resolve(false)
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- return await promiseFu
|
|
|
}
|
|
|
}
|
|
|
|