瀏覽代碼

修复bug

shaogen1995 3 月之前
父節點
當前提交
8466cf2fd1

+ 18 - 10
src/components/ZupFile/index.module.scss

@@ -5,7 +5,6 @@
   z-index: 100;
   width: 100%;
   height: 100%;
-  border-radius: 10px;
   background-color: rgba(0, 0, 0, 0.6);
   display: flex;
   justify-content: center;
@@ -69,28 +68,37 @@
 
       .ant-upload-list-item-actions .anticon {
         color: #ff4d4f !important;
+        display: none;
       }
 
       // 自定义列表
       .custom-upload-item {
         position: relative;
+        display: flex;
+
         .mySelect {
-          position: absolute;
-          top: 50%;
-          left: 50%;
-          transform: translate(-50%, -50%);
           & > span {
             color: #ff4d4f;
             margin-left: 15px;
           }
         }
+        .mySelectIcon {
+          cursor: pointer;
+          position: absolute;
+          right: 0;
+          top: 0;
+          height: 100%;
+          width: 30px;
+          display: flex;
+          justify-content: center;
+          align-items: center;
+          color: #ff4d4f;
+        }
       }
 
-      // .ant-upload-list-item-name {
-      //   width: 600px;
-      //   transition: none !important;
-      //   flex: none !important;
-      // }
+      .ant-upload-list-item-name {
+        width: 220px;
+      }
     }
 
     .ZupFileBtnX {

+ 40 - 48
src/components/ZupFile/index.tsx

@@ -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
     }
   }
 

+ 1 - 1
src/pages/A_workbench/A2business/A2table/index.tsx

@@ -15,7 +15,7 @@ const { RangePicker } = DatePicker
 
 const btnArr = [
   { name: '我发起的', key: '1' },
-  { name: '待我审批', key: '2' },
+  { name: '待我审批', key: '4' },
   { name: '抄送我的', key: '3' }
 ]