Skip to content

Commit

Permalink
style: 优化全局 loading 及 empty 配置
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles7c committed May 21, 2024
1 parent 43ac334 commit 7e329fc
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 29 deletions.
11 changes: 9 additions & 2 deletions src/App.vue

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/assets/icons/loading-bold.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 10 additions & 12 deletions src/views/system/dict/tree/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,37 +144,35 @@ onMounted(() => {
</script>

<style lang="scss" scoped>
:deep(.arco-tree-node-title) {
margin-left: 0;
}
:deep(.arco-tree-node-title-text) {
width: 100%;
white-space: nowrap;
}
:deep(.arco-tree-node) {
line-height: normal;
border-radius: var(--border-radius-medium);
&:hover {
background-color: var(--color-secondary-hover);
}
.arco-tree-node-switcher {
width: 0;
margin-right: 0;
}
.arco-tree-node-title {
border-radius: var(--border-radius-medium);
&:hover {
background-color: var(--color-secondary-hover);
background-color: transparent;
}
}
}
:deep(.arco-tree-node-selected) {
.arco-tree-node-title {
font-weight: bold;
background-color: rgba(var(--primary-6), 0.1);
&:hover {
background-color: rgba(var(--primary-6), 0.1);
&:hover {
background-color: rgba(var(--primary-6), 0.1);
}
}
}
Expand Down
30 changes: 15 additions & 15 deletions src/views/system/file/main/FileMain/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
</a-row>

<!-- 文件列表-宫格模式 -->
<a-spin id="fileMain" class="file-main__list" :loading="loading" @scroll="handleScroll">
<a-spin id="fileMain" class="file-main__list" :loading="loading">
<FileGrid v-show="fileList.length && mode === 'grid'" :data="fileList" :is-batch-mode="isBatchMode"
:selected-file-ids="selectedFileIds" @click="handleClickFile" @select="handleSelectFile"
@right-menu-click="handleRightMenuClick"></FileGrid>
Expand All @@ -65,7 +65,7 @@
:selected-file-ids="selectedFileIds" @click="handleClickFile" @select="handleSelectFile"
@right-menu-click="handleRightMenuClick"></FileList>

<a-empty v-show="!fileList.length"></a-empty>
<a-empty v-if="!fileList.length" />
</a-spin>
<div class="pagination">
<a-pagination v-bind="pagination" />
Expand Down Expand Up @@ -187,19 +187,19 @@ const handleMulDelete = () => {
const handleUpload = (options: RequestOption) => {
const controller = new AbortController()
; (async function requestWrap() {
const { onProgress, onError, onSuccess, fileItem, name = 'file' } = options
onProgress(20)
const formData = new FormData()
formData.append(name as string, fileItem.file as Blob)
try {
const res = await uploadFile(formData)
Message.success('上传成功')
onSuccess(res)
search()
} catch (error) {
onError(error)
}
})()
const { onProgress, onError, onSuccess, fileItem, name = 'file' } = options
onProgress(20)
const formData = new FormData()
formData.append(name as string, fileItem.file as Blob)
try {
const res = await uploadFile(formData)
Message.success('上传成功')
onSuccess(res)
search()
} catch (error) {
onError(error)
}
})()
return {
abort() {
controller.abort()
Expand Down
1 change: 1 addition & 0 deletions src/views/system/user/dept/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ onMounted(() => {
}
:deep(.arco-tree-node-selected) {
font-weight: bold;
background-color: rgba(var(--primary-6), 0.1);
&:hover {
background-color: rgba(var(--primary-6), 0.1);
Expand Down

0 comments on commit 7e329fc

Please sign in to comment.