mirror of https://github.com/halo-dev/halo
feat: add a refresh button to the data list (halo-dev/console#656)
#### What type of PR is this? /kind feature /milestone 2.0 #### What this PR does / why we need it: 为部分功能数据列表添加刷新按钮。 #### Screenshots: <img width="1664" alt="image" src="https://user-images.githubusercontent.com/21301288/197397277-353befe4-8c43-4326-9ad5-64d2888dc4a3.png"> #### Special notes for your reviewer: /cc @halo-dev/sig-halo-console 测试方式: 1. 需要 `pnpm build:packages` 2. 测试点击刷新按钮是否可以正常请求接口。 #### Does this PR introduce a user-facing change? ```release-note 为部分功能数据列表添加刷新按钮。 ```pull/3445/head
parent
82b1f3b2ea
commit
7a5d52effe
|
@ -50,6 +50,7 @@ import IconUserLine from "~icons/ri/user-line";
|
||||||
import IconMotionLine from "~icons/ri/emotion-line";
|
import IconMotionLine from "~icons/ri/emotion-line";
|
||||||
import IconReplyLine from "~icons/ri/reply-line";
|
import IconReplyLine from "~icons/ri/reply-line";
|
||||||
import IconExternalLinkLine from "~icons/ri/external-link-line";
|
import IconExternalLinkLine from "~icons/ri/external-link-line";
|
||||||
|
import IconRefreshLine from "~icons/ri/refresh-line";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
IconDashboard,
|
IconDashboard,
|
||||||
|
@ -104,4 +105,5 @@ export {
|
||||||
IconMotionLine,
|
IconMotionLine,
|
||||||
IconReplyLine,
|
IconReplyLine,
|
||||||
IconExternalLinkLine,
|
IconExternalLinkLine,
|
||||||
|
IconRefreshLine,
|
||||||
};
|
};
|
||||||
|
|
|
@ -8,6 +8,7 @@ import {
|
||||||
IconGrid,
|
IconGrid,
|
||||||
IconList,
|
IconList,
|
||||||
IconUpload,
|
IconUpload,
|
||||||
|
IconRefreshLine,
|
||||||
VButton,
|
VButton,
|
||||||
VCard,
|
VCard,
|
||||||
VPageHeader,
|
VPageHeader,
|
||||||
|
@ -478,7 +479,18 @@ onMounted(() => {
|
||||||
class="cursor-pointer rounded p-1 hover:bg-gray-200"
|
class="cursor-pointer rounded p-1 hover:bg-gray-200"
|
||||||
@click="viewType = item.name"
|
@click="viewType = item.name"
|
||||||
>
|
>
|
||||||
<component :is="item.icon" />
|
<component :is="item.icon" class="h-4 w-4" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-row gap-2">
|
||||||
|
<div
|
||||||
|
class="group cursor-pointer rounded p-1 hover:bg-gray-200"
|
||||||
|
@click="handleFetchAttachments"
|
||||||
|
>
|
||||||
|
<IconRefreshLine
|
||||||
|
:class="{ 'animate-spin text-gray-900': loading }"
|
||||||
|
class="h-4 w-4 text-gray-600 group-hover:text-gray-900"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</VSpace>
|
</VSpace>
|
||||||
|
|
|
@ -8,6 +8,7 @@ import {
|
||||||
VPagination,
|
VPagination,
|
||||||
VSpace,
|
VSpace,
|
||||||
IconCloseCircle,
|
IconCloseCircle,
|
||||||
|
IconRefreshLine,
|
||||||
VEmpty,
|
VEmpty,
|
||||||
Dialog,
|
Dialog,
|
||||||
} from "@halo-dev/components";
|
} from "@halo-dev/components";
|
||||||
|
@ -387,6 +388,17 @@ function handleSelectUser(user: User | undefined) {
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</FloatingDropdown>
|
</FloatingDropdown>
|
||||||
|
<div class="flex flex-row gap-2">
|
||||||
|
<div
|
||||||
|
class="group cursor-pointer rounded p-1 hover:bg-gray-200"
|
||||||
|
@click="handleFetchComments"
|
||||||
|
>
|
||||||
|
<IconRefreshLine
|
||||||
|
:class="{ 'animate-spin text-gray-900': loading }"
|
||||||
|
class="h-4 w-4 text-gray-600 group-hover:text-gray-900"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</VSpace>
|
</VSpace>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -8,6 +8,7 @@ import {
|
||||||
IconTeam,
|
IconTeam,
|
||||||
IconCloseCircle,
|
IconCloseCircle,
|
||||||
IconAddCircle,
|
IconAddCircle,
|
||||||
|
IconRefreshLine,
|
||||||
VButton,
|
VButton,
|
||||||
VCard,
|
VCard,
|
||||||
VPagination,
|
VPagination,
|
||||||
|
@ -500,6 +501,17 @@ function handleSortItemChange(sortItem?: SortItem) {
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</FloatingDropdown>
|
</FloatingDropdown>
|
||||||
|
<div class="flex flex-row gap-2">
|
||||||
|
<div
|
||||||
|
class="group cursor-pointer rounded p-1 hover:bg-gray-200"
|
||||||
|
@click="handleFetchSinglePages"
|
||||||
|
>
|
||||||
|
<IconRefreshLine
|
||||||
|
:class="{ 'animate-spin text-gray-900': loading }"
|
||||||
|
class="h-4 w-4 text-gray-600 group-hover:text-gray-900"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</VSpace>
|
</VSpace>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -9,6 +9,7 @@ import {
|
||||||
IconEyeOff,
|
IconEyeOff,
|
||||||
IconTeam,
|
IconTeam,
|
||||||
IconCloseCircle,
|
IconCloseCircle,
|
||||||
|
IconRefreshLine,
|
||||||
Dialog,
|
Dialog,
|
||||||
VButton,
|
VButton,
|
||||||
VCard,
|
VCard,
|
||||||
|
@ -763,6 +764,17 @@ function handleContributorChange(user?: User) {
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</FloatingDropdown>
|
</FloatingDropdown>
|
||||||
|
<div class="flex flex-row gap-2">
|
||||||
|
<div
|
||||||
|
class="group cursor-pointer rounded p-1 hover:bg-gray-200"
|
||||||
|
@click="handleFetchPosts"
|
||||||
|
>
|
||||||
|
<IconRefreshLine
|
||||||
|
:class="{ 'animate-spin text-gray-900': loading }"
|
||||||
|
class="h-4 w-4 text-gray-600 group-hover:text-gray-900"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</VSpace>
|
</VSpace>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -4,6 +4,7 @@ import {
|
||||||
IconArrowDown,
|
IconArrowDown,
|
||||||
IconCloseCircle,
|
IconCloseCircle,
|
||||||
IconPlug,
|
IconPlug,
|
||||||
|
IconRefreshLine,
|
||||||
VButton,
|
VButton,
|
||||||
VCard,
|
VCard,
|
||||||
VEmpty,
|
VEmpty,
|
||||||
|
@ -242,6 +243,17 @@ function handleSortItemChange(sortItem?: SortItem) {
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</FloatingDropdown>
|
</FloatingDropdown>
|
||||||
|
<div class="flex flex-row gap-2">
|
||||||
|
<div
|
||||||
|
class="group cursor-pointer rounded p-1 hover:bg-gray-200"
|
||||||
|
@click="handleFetchPlugins"
|
||||||
|
>
|
||||||
|
<IconRefreshLine
|
||||||
|
:class="{ 'animate-spin text-gray-900': loading }"
|
||||||
|
class="h-4 w-4 text-gray-600 group-hover:text-gray-900"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</VSpace>
|
</VSpace>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue