mirror of
https://github.com/ccmjga/zhilu-admin
synced 2026-04-04 03:16:09 +00:00
fix ai page
This commit is contained in:
@@ -1,26 +1,58 @@
|
||||
<template>
|
||||
<button :disabled="disabled" @click="handleClick" type="button" :class="[
|
||||
'text-white focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center me-2 dark:bg-blue-600 inline-flex items-center',
|
||||
disabled ? `${disabledStyle}` : 'bg-blue-700 hover:bg-blue-800 '
|
||||
]">
|
||||
<button :disabled="disabled" @click="handleClick" type="button" :class="{
|
||||
'text-white': true,
|
||||
'focus:ring-4': true,
|
||||
'focus:outline-none': true,
|
||||
'focus:ring-blue-300': true,
|
||||
'font-medium': true,
|
||||
'rounded-lg': true,
|
||||
'text-sm': true,
|
||||
'px-5': true,
|
||||
'py-2.5': true,
|
||||
'text-center': true,
|
||||
'me-2': true,
|
||||
'dark:bg-blue-600': true,
|
||||
'inline-flex': true,
|
||||
'items-center': true,
|
||||
'bg-blue-700 hover:bg-blue-800': !isLoading,
|
||||
[loadingStyle]: isLoading
|
||||
}">
|
||||
<LoadingIcon v-if="isLoading && !abortable" />
|
||||
<StopIcon v-if="isLoading && abortable" />
|
||||
<StopIcon v-else-if="isLoading && abortable" />
|
||||
{{isLoading ? loadingContent : submitContent}}
|
||||
</button>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
import LoadingIcon from "./icons/LoadingIcon.vue";
|
||||
import StopIcon from "./icons/StopIcon.vue";
|
||||
|
||||
const { loadingContent, submitContent, isLoading = false, disabledStyle, disabled = false, abortable = false } =
|
||||
defineProps<{
|
||||
loadingContent?: string;
|
||||
submitContent: string;
|
||||
isLoading: boolean;
|
||||
disabledStyle?: string;
|
||||
disabled: boolean;
|
||||
abortable: boolean;
|
||||
handleClick: (event: Event) => void;
|
||||
}>();
|
||||
const {
|
||||
loadingContent,
|
||||
submitContent,
|
||||
isLoading = false,
|
||||
abortable = false,
|
||||
} = defineProps<{
|
||||
loadingContent?: string;
|
||||
submitContent: string;
|
||||
isLoading: boolean;
|
||||
abortable: boolean;
|
||||
handleClick: (event: Event) => void;
|
||||
}>();
|
||||
|
||||
const loadingStyle = computed<string>(() => {
|
||||
switch (true) {
|
||||
case isLoading && !abortable:
|
||||
return "bg-blue-400 cursor-not-allowed";
|
||||
case isLoading && abortable:
|
||||
return "bg-blue-700 hover:bg-blue-800";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
});
|
||||
|
||||
const disabled = computed(() => {
|
||||
return !abortable && isLoading;
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<svg aria-hidden="true" role="status" :class="`inline ${size} ${textColor} me-3 animate-spin`" viewBox="0 0 100 101"
|
||||
<svg aria-hidden="true" role="status" :class="`inline ${size} ${textColor} animate-spin me-2`" viewBox="0 0 100 101"
|
||||
fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z"
|
||||
@@ -11,8 +11,8 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const { size = 'w-4 h-4' , textColor = 'text-white' } = defineProps<{
|
||||
size?: string;
|
||||
textColor?: string;
|
||||
const { size = "w-4 h-4", textColor = "text-white" } = defineProps<{
|
||||
size?: string;
|
||||
textColor?: string;
|
||||
}>();
|
||||
</script>
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
<template>
|
||||
<svg :class="`inline ${textColor} ${size} me-1`" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24"
|
||||
height="24" fill="currentColor" viewBox="0 0 24 24">
|
||||
<svg :class="{
|
||||
'inline': true,
|
||||
[textColor]: true,
|
||||
[size]: true,
|
||||
'me-2': true
|
||||
}" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24">
|
||||
<path d="M7 5a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2H7Z" />
|
||||
</svg>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const { size = 'w-6 h-6' , textColor = 'text-white' } = defineProps<{
|
||||
size?: string;
|
||||
textColor?: string;
|
||||
const { size = "w-5 h-5", textColor = "text-white" } = defineProps<{
|
||||
size?: string;
|
||||
textColor?: string;
|
||||
}>();
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user