Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(popupload): [pop-upload]Fixed popupload review issues. #2368

Merged
merged 2 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
<p class="tips-item">1.上传数据应不超过{{ limit }}条,超过数量不允许上传;</p>
<p class="tips-item">2.相同数据不会重复发</p>
<p class="tips-item">
3.上传文件限{{ fileType.join(',') }}格式,文件不超过{{ fileSize / 1024 }}KB,点击<tiny-link
>下载模板</tiny-link
>
3.上传文件限{{ fileType.join(',') }}格式,文件不超过{{ fileSize / 1024 }}KB,点击
<tiny-link>下载模板</tiny-link>
Comment on lines +16 to +17
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add click handler or href to the download template link.

The <tiny-link> component lacks functionality to actually download the template. This should be implemented to demonstrate proper usage.

Consider adding a click handler:

-<tiny-link>下载模板</tiny-link>
+<tiny-link @click="handleTemplateDownload">下载模板</tiny-link>

And in the script section:

const handleTemplateDownload = () => {
  // Implement template download logic
  window.open('path/to/template/file', '_blank')
}

</p>
</template>
</tiny-alert>
Expand All @@ -36,5 +35,10 @@ const fileType = ref(['.png', '.jpg'])
<style scoped>
.tips-item {
margin: 0;
height: 22px;
line-height: 22px;
}
:deep(.tiny-popupload__dialog-footer) {
justify-content: flex-end !important;
Comment on lines +41 to +42
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Avoid using !important in CSS rules.

Using !important is generally discouraged as it makes styles harder to maintain and override when needed. Consider increasing specificity instead.

-:deep(.tiny-popupload__dialog-footer) {
-  justify-content: flex-end !important;
-}
+:deep(.tiny-popupload .tiny-popupload__dialog-footer) {
+  justify-content: flex-end;
+}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
:deep(.tiny-popupload__dialog-footer) {
justify-content: flex-end !important;
:deep(.tiny-popupload .tiny-popupload__dialog-footer) {
justify-content: flex-end;

}
</style>
10 changes: 7 additions & 3 deletions examples/sites/demos/pc/app/pop-upload/upload-tip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
<p class="tips-item">1.上传数据应不超过{{ limit }}条,超过数量不允许上传;</p>
<p class="tips-item">2.相同数据不会重复发</p>
<p class="tips-item">
3.上传文件限{{ fileType.join(',') }}格式,文件不超过{{ fileSize / 1024 }}KB,点击<tiny-link
>下载模板</tiny-link
>
3.上传文件限{{ fileType.join(',') }}格式,文件不超过{{ fileSize / 1024 }}KB,点击
<tiny-link>下载模板</tiny-link>
</p>
</template>
</tiny-alert>
Expand Down Expand Up @@ -46,5 +45,10 @@ export default {
<style scoped>
.tips-item {
margin: 0;
height: 22px;
line-height: 22px;
}
:deep(.tiny-popupload__dialog-footer) {
justify-content: flex-end !important;
}
</style>
14 changes: 10 additions & 4 deletions packages/theme/src/pop-upload/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
@import './vars.less';

@popupload-prefix-cls: ~'@{css-prefix}popupload';
@file-upload-prefix-cls: ~'@{css-prefix}file-upload';
@upload-list-prefix-cls: ~'@{css-prefix}upload-list';
@popconfirm-prefix-cls: ~'@{css-prefix}popconfirm';
@popupload__modal-prefix-cls: ~'@{css-prefix}popupload__modal';
@alert-prefix-cls: ~'@{css-prefix}alert';

Expand All @@ -36,7 +38,7 @@

&__dialog-header {
.@{alert-prefix-cls} {
margin-bottom: 10px;
margin-bottom: 16px;
}
}

Expand Down Expand Up @@ -70,7 +72,7 @@
font-size: var(--tv-PopUpload-dialog-table-font-size);
height: var(--tv-PopUpload-dialog-table-height);
width: 100%;
margin-top: 10px;
margin-top: 20px;

.header-col {
position: relative;
Expand Down Expand Up @@ -163,14 +165,18 @@
overflow-y: auto;
}

.tiny-file-upload .tiny-upload-list__text-title {
.@{file-upload-prefix-cls} .@{upload-list-prefix-cls}__text-title {
display: none;
}

.@{popupload-prefix-cls}__dialog-footer {
justify-content: flex-end;
}
}

// 新规范适配
&__pop-confirm {
.tiny-popconfirm-popover__title {
.@{popconfirm-prefix-cls}-popover__title {
white-space: nowrap;
}
}
Expand Down
Loading