style(webui): 在 Oxfmt 中配置导入排序功能,并对全 webui 目录进行格式化
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import UserAction from '@/components/admin/UserAction.vue'
|
||||
import { useHead } from '@unhead/vue'
|
||||
import type { MenuOption } from 'naive-ui'
|
||||
import { computed, onMounted, ref, useTemplateRef } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
import UserAction from '@/components/admin/UserAction.vue'
|
||||
import { useNowUser } from '@/stores/now-user.js'
|
||||
import { useHead } from '@unhead/vue'
|
||||
|
||||
useHead({
|
||||
titleTemplate: '%s | 管理面板 | NayHome',
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
<script setup lang="ts">
|
||||
import { useRoute } from 'vue-router'
|
||||
import { onMounted, reactive, ref, useTemplateRef, watch } from 'vue'
|
||||
import { api } from '@/tools/web.ts'
|
||||
import type { ReturnDto } from '@/types/response.ts'
|
||||
import type { Chatroom } from '@/types/chatroom.ts'
|
||||
import { fetchEventSource } from '@microsoft/fetch-event-source'
|
||||
import { useHead } from '@unhead/vue'
|
||||
import { useMessage } from 'naive-ui'
|
||||
import { onMounted, reactive, ref, useTemplateRef, watch } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
|
||||
import ChatControlPanel from '@/components/chatroom/ChatControlPanel.vue'
|
||||
import ChatroomCard from '@/components/chatroom/ChatroomCard.vue'
|
||||
import ChatTable from '@/components/chatroom/ChatTable.vue'
|
||||
import ChatControlPanel from '@/components/chatroom/ChatControlPanel.vue'
|
||||
import { fetchEventSource } from '@microsoft/fetch-event-source'
|
||||
import { api } from '@/tools/web.ts'
|
||||
import type { AiiTokenInfo } from '@/types/aii.ts'
|
||||
import type { Chatroom } from '@/types/chatroom.ts'
|
||||
import type { ReturnDto } from '@/types/response.ts'
|
||||
import { SEE_YOU_TOMORROW } from '@/types/syt.ts'
|
||||
import { useHead } from '@unhead/vue'
|
||||
|
||||
const pageHead = reactive({
|
||||
title: '正在加载聊天室...',
|
||||
@@ -23,11 +24,7 @@ useHead(pageHead)
|
||||
const ROUTE = useRoute()
|
||||
const MESSAGE = useMessage()
|
||||
|
||||
const crName = ref('')
|
||||
const crDescription = ref('')
|
||||
const crFeatureImage = ref('')
|
||||
const crContent = ref('')
|
||||
const crScript = ref('')
|
||||
const chatroom = ref<Chatroom | null>(null)
|
||||
|
||||
const selectedModel = ref<number | null>(null)
|
||||
const quickerPrompt = ref('')
|
||||
@@ -54,11 +51,7 @@ function load() {
|
||||
})
|
||||
.then((cr) => {
|
||||
pageHead.title = cr.name
|
||||
crName.value = cr.name
|
||||
crDescription.value = cr.description
|
||||
crFeatureImage.value = cr.feature_image
|
||||
crContent.value = cr.content
|
||||
crScript.value = cr.script
|
||||
chatroom.value = cr
|
||||
})
|
||||
.catch((e) => {
|
||||
MESSAGE.error(`访问聊天室失败:${e}`)
|
||||
@@ -155,7 +148,7 @@ function accept() {
|
||||
}
|
||||
})
|
||||
.then((result) => {
|
||||
crContent.value = result.content
|
||||
chatroom.value!.content = result.content
|
||||
})
|
||||
.catch((err) => {
|
||||
MESSAGE.error(`保存失败:${err}`)
|
||||
@@ -190,8 +183,8 @@ function messageEdit(oldMessage: string, newMessage: string, change: 'aii' | 'us
|
||||
}
|
||||
})
|
||||
.then((result) => {
|
||||
crContent.value = result.content
|
||||
MESSAGE.success('聊天记录已删除,页面已更新~')
|
||||
chatroom.value!.content = result.content
|
||||
MESSAGE.success('聊天记录已更新,页面已更新~')
|
||||
})
|
||||
.catch((err) => {
|
||||
MESSAGE.error(`修改聊天消息失败:${err}`)
|
||||
@@ -211,7 +204,7 @@ function messageDelete(message: string, change: 'aii' | 'user') {
|
||||
}
|
||||
})
|
||||
.then((result) => {
|
||||
crContent.value = result.content
|
||||
chatroom.value!.content = result.content
|
||||
MESSAGE.success('聊天记录已删除,页面已更新~')
|
||||
})
|
||||
.catch((err) => {
|
||||
@@ -243,16 +236,16 @@ function enableSidebar() {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<div class="page-container" v-if="chatroom !== null">
|
||||
<div class="main-column">
|
||||
<chatroom-card
|
||||
:id="Number(ROUTE.params.id)"
|
||||
:name="crName"
|
||||
:description="crDescription"
|
||||
:feature_image="crFeatureImage"
|
||||
:name="chatroom.name"
|
||||
:description="chatroom.description"
|
||||
:feature_image="chatroom.feature_image"
|
||||
/>
|
||||
<chat-table
|
||||
:content="crContent"
|
||||
:content="chatroom.content"
|
||||
:aii-thinking
|
||||
:aii-message
|
||||
:aii-token-info
|
||||
@@ -269,7 +262,8 @@ function enableSidebar() {
|
||||
</div>
|
||||
<div class="sidebar-column" ref="sidebar">
|
||||
<chat-control-panel
|
||||
:script="crScript"
|
||||
:chatroom="chatroom"
|
||||
:load-page="load"
|
||||
v-model:quicker-prompt="quickerPrompt"
|
||||
v-model:select-model="selectedModel"
|
||||
/>
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
<script setup lang="ts">
|
||||
import ChatroomCard from '@/components/chatroom/ChatroomCard.vue'
|
||||
import { useHead } from '@unhead/vue'
|
||||
import { ref, watch } from 'vue'
|
||||
|
||||
import ChatroomCard from '@/components/chatroom/ChatroomCard.vue'
|
||||
import ChatroomCreatorModal from '@/components/chatroom/ChatroomCreatorModal.vue'
|
||||
import { useNowUser } from '@/stores/now-user.ts'
|
||||
import { api } from '@/tools/web.ts'
|
||||
import type { ChatroomPublic } from '@/types/chatroom.ts'
|
||||
import type { ReturnDto } from '@/types/response.ts'
|
||||
import ChatroomCreatorModal from '@/components/chatroom/ChatroomCreatorModal.vue'
|
||||
import { useNowUser } from '@/stores/now-user.ts'
|
||||
import { useHead } from '@unhead/vue'
|
||||
|
||||
useHead({
|
||||
title: '聊天室列表',
|
||||
@@ -29,7 +30,7 @@ function load() {
|
||||
}
|
||||
|
||||
watch(
|
||||
() => NOWUSER.isLogin,
|
||||
() => NOWUSER.is_login,
|
||||
() => {
|
||||
load()
|
||||
},
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import InDev from '@/components/InDev.vue'
|
||||
import { useHead } from '@unhead/vue'
|
||||
|
||||
import InDev from '@/components/InDev.vue'
|
||||
|
||||
useHead({
|
||||
title: '剧本市场',
|
||||
})
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import UserAction from '@/components/admin/UserAction.vue'
|
||||
import { useHead } from '@unhead/vue'
|
||||
|
||||
import UserAction from '@/components/admin/UserAction.vue'
|
||||
|
||||
useHead({
|
||||
title: '首页',
|
||||
})
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import ConfigCard from '@/components/admin/ConfigCard.vue'
|
||||
import { useHead } from '@unhead/vue'
|
||||
import { ref } from 'vue'
|
||||
import { api } from '@/tools/web.ts'
|
||||
import InDev from '@/components/InDev.vue'
|
||||
import { useMessage } from 'naive-ui'
|
||||
import { ref } from 'vue'
|
||||
|
||||
import ConfigCard from '@/components/admin/ConfigCard.vue'
|
||||
import InDev from '@/components/InDev.vue'
|
||||
import { api } from '@/tools/web.ts'
|
||||
import type { ReturnDto } from '@/types/response.ts'
|
||||
|
||||
interface SiteConfig {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import { useNowUser } from '@/stores/now-user.js'
|
||||
import { computed } from 'vue'
|
||||
import { useHead } from '@unhead/vue'
|
||||
import { computed } from 'vue'
|
||||
|
||||
import { useNowUser } from '@/stores/now-user.js'
|
||||
|
||||
useHead({
|
||||
title: '总览',
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
<script setup lang="ts">
|
||||
import { useNowUser } from '@/stores/now-user.js'
|
||||
import { ref, watch } from 'vue'
|
||||
import SelectFileModal from '@/components/file/SelectFileModal.vue'
|
||||
import { api } from '@/tools/web.js'
|
||||
import type { UploadFileDto, UserDto } from '@/types/user.js'
|
||||
import { useHead } from '@unhead/vue'
|
||||
import { ref, watch } from 'vue'
|
||||
|
||||
import ChangeEmailModal from '@/components/admin/ChangeEmailModal.vue'
|
||||
import ChangePhoneModal from '@/components/admin/ChangePhoneModal.vue'
|
||||
import SelectFileModal from '@/components/file/SelectFileModal.vue'
|
||||
import { useNowUser } from '@/stores/now-user.js'
|
||||
import { api } from '@/tools/web.js'
|
||||
import type { UploadFileDto, UserDto } from '@/types/user.js'
|
||||
|
||||
useHead({
|
||||
title: '用户资料',
|
||||
@@ -65,7 +66,7 @@ watch(
|
||||
)
|
||||
|
||||
watch(
|
||||
() => NOWUSER.isLogin,
|
||||
() => NOWUSER.is_login,
|
||||
() => {
|
||||
reInitForm()
|
||||
},
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import InDev from '@/components/InDev.vue'
|
||||
import { useHead } from '@unhead/vue'
|
||||
|
||||
import InDev from '@/components/InDev.vue'
|
||||
|
||||
useHead({
|
||||
title: '剧本',
|
||||
})
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import { useNowUser } from '@/stores/now-user.js'
|
||||
import UserPasswordModal from '@/components/admin/UserPasswordModal.vue'
|
||||
import { h, ref } from 'vue'
|
||||
import { api } from '@/tools/web.ts'
|
||||
import { type DataTableColumn, NTag, NText } from 'naive-ui'
|
||||
import InDev from '@/components/InDev.vue'
|
||||
import { useHead } from '@unhead/vue'
|
||||
import { type DataTableColumn, NTag, NText } from 'naive-ui'
|
||||
import { h, ref } from 'vue'
|
||||
|
||||
import UserPasswordModal from '@/components/admin/UserPasswordModal.vue'
|
||||
import InDev from '@/components/InDev.vue'
|
||||
import { useNowUser } from '@/stores/now-user.js'
|
||||
import { api } from '@/tools/web.ts'
|
||||
|
||||
useHead({
|
||||
title: '用户安全',
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import { useHead } from '@unhead/vue'
|
||||
import { ref, watch } from 'vue'
|
||||
|
||||
import { uploadFilesCom } from '@/components/file/upload-files.js'
|
||||
import UploadFileModal from '@/components/file/UploadFileModal.vue'
|
||||
import { useNowUser } from '@/stores/now-user.js'
|
||||
import { api } from '@/tools/web.js'
|
||||
import type { UploadFileDto } from '@/types/user.js'
|
||||
import { useNowUser } from '@/stores/now-user.js'
|
||||
import { uploadFilesCom } from '@/components/file/upload-files.js'
|
||||
import { useHead } from '@unhead/vue'
|
||||
|
||||
useHead({
|
||||
title: '上传',
|
||||
@@ -24,7 +25,7 @@ function load() {
|
||||
}
|
||||
|
||||
watch(
|
||||
() => NOWUSER.isLogin,
|
||||
() => NOWUSER.is_login,
|
||||
() => {
|
||||
load()
|
||||
},
|
||||
@@ -39,7 +40,7 @@ watch(
|
||||
</template>
|
||||
|
||||
<n-flex vertical>
|
||||
<n-alert type="info"> 接受的文件类型: </n-alert>
|
||||
<n-alert type="info"> 接受的文件类型:</n-alert>
|
||||
<n-button @click="showUploadModal = true">打开上传向导</n-button>
|
||||
|
||||
<upload-file-modal
|
||||
@@ -57,7 +58,7 @@ watch(
|
||||
<template #header>
|
||||
<n-h3 prefix="bar" style="margin: 0">个人文件库</n-h3>
|
||||
</template>
|
||||
<template #header-extra> 您已经上传的文件都在这里,可以选择性地删除以及重新下载。 </template>
|
||||
<template #header-extra> 您已经上传的文件都在这里,可以选择性地删除以及重新下载。</template>
|
||||
|
||||
<component :is="uploadFilesCom(files)" />
|
||||
</n-card>
|
||||
|
||||
Reference in New Issue
Block a user