Browse Source

fix[pc-components]: 修改文件上传失败判断

chenlei 1 year ago
parent
commit
9b91aca164

+ 14 - 0
packages/backend-cli/template/CHANGELOG.md

@@ -1,5 +1,19 @@
 # @dage/backend-template
 
+## 1.0.4
+
+### Patch Changes
+
+- Updated dependencies
+  - @dage/pc-components@1.2.4
+
+## 1.0.3
+
+### Patch Changes
+
+- Updated dependencies
+  - @dage/pc-components@1.2.3
+
 ## 1.0.2
 
 ### Patch Changes

+ 1 - 1
packages/backend-cli/template/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@dage/backend-template",
-  "version": "1.0.2",
+  "version": "1.0.4",
   "private": true,
   "dependencies": {
     "@ant-design/icons": "^5.1.4",

+ 12 - 0
packages/docs/docs/log/PC-COMPONENTS_CHANGELOG.md

@@ -1,5 +1,17 @@
 # @dage/pc-components
 
+## 1.2.4
+
+### Patch Changes
+
+- 处理 styled 警告
+
+## 1.2.3
+
+### Patch Changes
+
+- 修改文件上传失败判断
+
 ## 1.2.2
 
 ### Patch Changes

+ 12 - 0
packages/pc-components/CHANGELOG.md

@@ -1,5 +1,17 @@
 # @dage/pc-components
 
+## 1.2.4
+
+### Patch Changes
+
+- 处理 styled 警告
+
+## 1.2.3
+
+### Patch Changes
+
+- 修改文件上传失败判断
+
 ## 1.2.2
 
 ### Patch Changes

+ 1 - 1
packages/pc-components/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@dage/pc-components",
-  "version": "1.2.2",
+  "version": "1.2.4",
   "description": "PC 端组件库",
   "module": "dist/index.js",
   "main": "dist/index.js",

+ 1 - 1
packages/pc-components/src/components/DageUpload/ItemActions.tsx

@@ -100,7 +100,7 @@ export const DageUploadItemActions: FC<DageUploadItemActionsProps> = ({
   return (
     <UploadItem
       className="dage-upload__item"
-      showdownloadprogress={showDownloadProgress.toString()}
+      $showDownloadProgress={showDownloadProgress}
     >
       {children}
 

+ 1 - 1
packages/pc-components/src/components/DageUpload/index.tsx

@@ -144,7 +144,7 @@ export const DageUpload: FC<DageUploadProps> = ({
     file,
   }) => {
     if (file.status === "done") {
-      if (typeof file.response !== "object" || !file.response.id) {
+      if (typeof file.response !== "object" || !file.response.fileName) {
         // 上传失败
         file.status = "error";
       } else if (isPictureCard && file.originFileObj) {

+ 3 - 3
packages/pc-components/src/components/DageUpload/style.ts

@@ -35,7 +35,7 @@ export const AntdDraggerText = styled.p`
 `;
 
 export const UploadFileItem = styled.div<{
-  showdownloadprogress: string;
+  $showDownloadProgress: boolean;
 }>`
   display: flex;
   align-items: center;
@@ -48,8 +48,8 @@ export const UploadFileItem = styled.div<{
   &:hover {
     background-color: rgba(0, 0, 0, 0.04);
   }
-  ${({ showdownloadprogress }) =>
-    showdownloadprogress === "true" &&
+  ${({ $showDownloadProgress }) =>
+    $showDownloadProgress &&
     css`
       margin-bottom: 10px;
     `}