mirror of
https://github.com/xiaoyiweb/YiAi.git
synced 2025-11-14 21:23:44 +08:00
一些小优化
This commit is contained in:
@@ -32,8 +32,7 @@ const { isSmallLg } = useBasicLayout()
|
||||
const theme = computed(() => appStore.theme)
|
||||
|
||||
const html = computed(() => {
|
||||
if (!notice.value.noticeInfo)
|
||||
return ''
|
||||
if (!notice.value.noticeInfo) return ''
|
||||
return marked(notice.value.noticeInfo)
|
||||
})
|
||||
|
||||
@@ -48,8 +47,7 @@ function handleClose() {
|
||||
async function queryNotice() {
|
||||
const res: ResData = await fetchGetGlobalNoticeAPI()
|
||||
const { success, data } = res
|
||||
if (success)
|
||||
notice.value = data
|
||||
if (success) notice.value = data
|
||||
}
|
||||
|
||||
async function openDrawerAfter() {
|
||||
@@ -64,27 +62,39 @@ function handleReminder() {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<NModal :show="visible" class="p-0 noticeDialog" :style="{ maxWidth: '780px', minWidth: isSmallLg ? '100%' : '780px' }" :on-after-enter="openDrawerAfter" :on-after-leave="handleCloseDialog">
|
||||
<NModal
|
||||
:show="visible"
|
||||
class="p-0 noticeDialog"
|
||||
:style="{ maxWidth: '780px', minWidth: isSmallLg ? '100%' : '780px' }"
|
||||
:on-after-enter="openDrawerAfter"
|
||||
:on-after-leave="handleCloseDialog"
|
||||
>
|
||||
<NSpace vertical>
|
||||
<NCard closable @close="handleClose">
|
||||
<template #header>
|
||||
<div v-if="loading" class="px-[20px]" >
|
||||
<NSkeleton text width="30%" />
|
||||
</div>
|
||||
<div v-if="loading" class="px-[20px]">
|
||||
<NSkeleton text width="30%" />
|
||||
</div>
|
||||
<template v-else>
|
||||
<span class="text-xl">{{ notice.noticeTitle }}</span>
|
||||
</template>
|
||||
</template>
|
||||
<div v-if="loading" class="px-[20px]" >
|
||||
<NSkeleton text :repeat="10" />
|
||||
</div>
|
||||
<div v-if="loading" class="px-[20px]">
|
||||
<NSkeleton text :repeat="10" />
|
||||
</div>
|
||||
<template v-else>
|
||||
<div :class="[darkMode ? 'text-[#fff]' : 'text-[#000]', 'pb-5']" :style="{ background: theme === 'dark' ? '#2c2c32' : '#fff' }" class="p-[20px] markdown-body markdown-body-generate max-h-[500px] overflow-y-auto overflow-x-hidden" v-html="html" />
|
||||
<div
|
||||
:class="[darkMode ? 'text-[#fff]' : 'text-[#000]', 'pb-5']"
|
||||
:style="{ background: theme === 'dark' ? '#2c2c32' : '#fff' }"
|
||||
class="p-[20px] markdown-body markdown-body-generate max-h-[500px] overflow-y-auto overflow-x-hidden"
|
||||
v-html="html"
|
||||
/>
|
||||
</template>
|
||||
<div class="flex justify-end py-3 px-5">
|
||||
<NButton type="primary" @click="handleReminder">
|
||||
24小时不再提示
|
||||
<NButton type="text" @click="handleReminder">
|
||||
今日不再提示
|
||||
</NButton>
|
||||
<NButton type="primary" @click="useGlobalStore.updateNoticeDialog(false)"> 我已知晓 </NButton>
|
||||
</div>
|
||||
</NCard>
|
||||
</NSpace>
|
||||
@@ -92,7 +102,7 @@ function handleReminder() {
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
/deep/ .n-card__content{
|
||||
padding: 0 !important;
|
||||
/deep/ .n-card__content {
|
||||
padding: 0 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -209,7 +209,7 @@ watch(
|
||||
>
|
||||
<template #trigger>
|
||||
<div
|
||||
class="h-10 w-10 cursor-pointer bg-white dark:bg-[#34373c] rounded-lg duration-300 flex justify-center items-center"
|
||||
class="h-10 w-10 cursor-pointer bg-white dark:bg-[#34373c] rounded-lg duration-300 flex justify-center items-center btnhover"
|
||||
:class="[
|
||||
isActive(item)
|
||||
? 'borderRadis shadow-[#3076fd] btns'
|
||||
@@ -336,6 +336,11 @@ watch(
|
||||
.btns {
|
||||
box-shadow: 0 5px 16px #0636e6;
|
||||
}
|
||||
.btnhover:hover{
|
||||
box-shadow: 0 5px 16px #0636e6;
|
||||
transform: scale(1.1);
|
||||
color: #0636e6;
|
||||
}
|
||||
|
||||
.borderRadis {
|
||||
border-radius: 0.75rem;
|
||||
|
||||
@@ -534,7 +534,7 @@ async function onConversation(msg?: string) {
|
||||
dataSources.value.length === 2 &&
|
||||
!activeGroupInfo?.value?.appId
|
||||
) {
|
||||
const lengthStr = isMobile.value ? 15 : 20
|
||||
const lengthStr = isMobile.value ? 20 : 20
|
||||
const title =
|
||||
dataSources.value[1].text.length > lengthStr
|
||||
? dataSources.value[1].text.slice(0, lengthStr)
|
||||
|
||||
@@ -78,9 +78,9 @@ const collapsed = computed(() => appStore.siderCollapsed)
|
||||
const groupKeyWord = ref('')
|
||||
|
||||
function handleInputGroupSearch(event: { target: { value: any } }) {
|
||||
const val = event.target.value;
|
||||
groupKeyWord.value = val;
|
||||
chatStore.setGroupKeyWord(val);
|
||||
const val = event.target.value
|
||||
groupKeyWord.value = val
|
||||
chatStore.setGroupKeyWord(val)
|
||||
}
|
||||
|
||||
function handleBlurInput() {
|
||||
@@ -209,6 +209,13 @@ watch(
|
||||
>
|
||||
<SvgIcon icon="material-symbols-light:add" class="h-6 w-6" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="rounded-md p-2 text-sm focus-visible:outline bg-white text-gray-400 dark:bg-gray-800"
|
||||
@click="handleDelGroup"
|
||||
>
|
||||
<SvgIcon icon="material-symbols-light:delete-outline" class="h-6 w-6" />
|
||||
</button>
|
||||
</div>
|
||||
<div class="flex-1 min-h-0 pb-4 overflow-hidden">
|
||||
<List />
|
||||
@@ -313,7 +320,7 @@ watch(
|
||||
<span class="mr-3">工作台</span>
|
||||
</NButton>
|
||||
</div>
|
||||
<div class="flex justify-betweenx">
|
||||
<!-- <div class="flex justify-betweenx">
|
||||
<NButton
|
||||
type="tertiary"
|
||||
size="small"
|
||||
@@ -326,7 +333,7 @@ watch(
|
||||
/>
|
||||
<span class="mr-3">清空全部非置顶会话</span>
|
||||
</NButton>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- <NButton block @click="show = true">
|
||||
{{ $t('store.siderButton') }}
|
||||
</NButton> -->
|
||||
|
||||
@@ -562,7 +562,7 @@ onMounted(() => {
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
<div class="block text-sm mt-2 flex items-center">
|
||||
<!-- <div class="block text-sm mt-2 flex items-center">
|
||||
参数
|
||||
<NTooltip placement="right-end" trigger="hover">
|
||||
<template #trigger>
|
||||
@@ -572,7 +572,7 @@ onMounted(() => {
|
||||
<p>合理使用参数绘制更为理想的结果!</p>
|
||||
</div>
|
||||
</NTooltip>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="mt-3 flex justify-between items-center space-x-2 text-xs">
|
||||
<span class="w-[65px] block text-sm">品质</span>
|
||||
<span class="flex-1">
|
||||
@@ -629,7 +629,7 @@ onMounted(() => {
|
||||
</NTooltip>
|
||||
</div>
|
||||
|
||||
<div class="block text-sm mt-2 flex items-center">设定</div>
|
||||
<!-- <div class="block text-sm mt-2 flex items-center">设定</div> -->
|
||||
<div class="mt-3 flex justify-between items-center space-x-2 text-xs">
|
||||
<span class="w-[65px] block text-sm">携带参数</span>
|
||||
<span class="flex-1">
|
||||
|
||||
@@ -147,7 +147,7 @@ function handleValidate(e: MouseEvent) {
|
||||
</NFormItem>
|
||||
|
||||
<div class="flex justify-between">
|
||||
<span class="text-[#95AAC9]">更新密码完成后将重新登录!</span>
|
||||
<span class="text-[#95AAC9]">更新密码后将重新登录!</span>
|
||||
<NButton
|
||||
:disabled="model.oldPassword === null"
|
||||
type="primary"
|
||||
@@ -161,7 +161,7 @@ function handleValidate(e: MouseEvent) {
|
||||
<NGridItem class="border rounded-sm p-3 bg-[#f8f9fa] h-48 dark:bg-[#18181c] dark:border-[#ffffff17]">
|
||||
<b class="text-base ">密码要求</b>
|
||||
<p class="text-[#95AAC9] mt-3">
|
||||
要创建一个新的密码,你必须满足以下所有要求。
|
||||
新的密码必须满足以下所有要求。
|
||||
</p>
|
||||
<div class="ml-3 text-[#95AAC9] mt-2">
|
||||
最少6个字符
|
||||
|
||||
@@ -150,18 +150,18 @@ onMounted(() => {
|
||||
<div class="text-[#95aac9] mb-2 text-base">
|
||||
基础模型余额
|
||||
</div>
|
||||
<b class="text-3xl text-[#555]">{{ userBalance.sumModel3Count ?? 0 }}</b> <span class="ml-4 text-[#989898]">每次对话根据模型消费不同积分!</span>
|
||||
<b class="text-3xl text-[#555]">{{ userBalance.sumModel3Count ?? 0 }}</b> <span class="ml-4 text-[#989898]">不同模型消费不同积分!</span>
|
||||
</NGridItem>
|
||||
<NGridItem class="border dark:border-[#ffffff17] rounded-sm p-3">
|
||||
<div class="text-[#95aac9] mb-2 text-base">
|
||||
高级模型余额
|
||||
</div>
|
||||
<b class="text-3xl text-[#555]">{{ userBalance.sumModel4Count ?? 0 }}</b> <span class="ml-4 text-[#989898]">每次对话根据模型消费不同积分!</span>
|
||||
<b class="text-3xl text-[#555]">{{ userBalance.sumModel4Count ?? 0 }}</b> <span class="ml-4 text-[#989898]">不同模型消费不同积分!</span>
|
||||
</NGridItem><NGridItem class="border dark:border-[#ffffff17] rounded-sm p-3">
|
||||
<div class="text-[#95aac9] mb-2 text-base">
|
||||
MJ绘画余额
|
||||
</div>
|
||||
<b class="text-3xl text-[#555]">{{ userBalance.sumDrawMjCount ?? 0 }}</b> <span class="ml-4 text-[#989898]">根据画图动作消耗不同的积分!</span>
|
||||
<b class="text-3xl text-[#555]">{{ userBalance.sumDrawMjCount ?? 0 }}</b> <span class="ml-4 text-[#989898]">不同画图消耗不同积分!</span>
|
||||
</NGridItem><NGridItem class="border dark:border-[#ffffff17] rounded-sm p-3">
|
||||
<div class="text-[#95aac9] mb-2 text-base">
|
||||
卡密充值
|
||||
|
||||
Reference in New Issue
Block a user