浏览代码

feat: 增加联网和插件功能

ageer 1 月之前
父节点
当前提交
157ac5a9fc

+ 5 - 5
src/components/common/PromptStore/index.vue

@@ -177,15 +177,15 @@ const createColumns = () => {
 				let text, type;
 				switch (row.modelType) {
 					case "1":
-						text = 'Token billing';
+						text = 'Token计费';
 						type = 'success'; // 绿色标签
 						break;
 					case "2":
-						text = 'Frequency billing';
+						text = '次数计费';
 						type = 'info'; // 蓝色标签
 						break;
 					default:
-						text = 'Unknown billing';
+						text = '未知方式';
 						type = 'default'; // 默认灰色标签
 				}
 				// 直接使用导入的 NTag 组件,设置相应的属性
@@ -279,12 +279,12 @@ const loading = ref<boolean>(false)
 					</main>
 				</div>
 			</n-tab-pane>
-			<n-tab-pane :name="$t('setting.exchange')">
+			<!-- <n-tab-pane :name="$t('setting.exchange')">
 				<div class="input-button-container">
 					<n-input v-model:value="redeem" type="text" :placeholder="$t('store.input')" style="width: 70%" />
 					<n-button :bordered="false" type="success" @click="handleRedeemKey">{{  $t('store.redeemKey') }}</n-button>
 				</div>
-			</n-tab-pane>
+			</n-tab-pane> -->
 		</n-tabs>
 	</NModal>
 

+ 2 - 2
src/components/common/Setting/index.vue

@@ -61,14 +61,14 @@ const show = computed({
           </div>
         </NTabPane>
 
-        
+<!--         
        <NTabPane name="chatmsg" tab="chatmsg">
           <template #tab>
             <SvgIcon class="text-lg" icon="mdi:message" />
             <span class="ml-2">{{ $t('setting.message') }}</span>
           </template>
           <aiMsg />
-        </NTabPane>
+        </NTabPane> -->
 
         <!-- <NTabPane name="Config" tab="Config">
           <template #tab>

+ 1 - 5
src/styles/lib/highlight.less

@@ -1346,7 +1346,7 @@ position: relative;
 		padding: 0;
 		background-color: #fff;
 		border-bottom-right-radius: 20px;
-		// height: 156px;
+		 height: 600px;
 		.chat-footer{
 			border-bottom-right-radius: 12px;
 			position: relative;
@@ -1357,10 +1357,6 @@ position: relative;
 			border: 2px solid #fff;
 			margin: 0 40px 40px;
 			border-radius: 16px;
-			.items-base {
-				// position: absolute;
-				// top: -70px;
-			}
 			.top-bar{
 				& .left{
 					display: flex;

+ 4 - 60
src/views/chat/index.vue

@@ -67,6 +67,8 @@ dataSources.value.forEach((item, index) => {
 })
 
 function handleSubmit() {
+  homeStore.myData.local = "chating"
+  alert(homeStore.myData.local)
   //onConversation() //把这个放到aiGpt
   let message = prompt.value;
   if (!message || message.trim() === '')
@@ -629,18 +631,6 @@ load()
 </script>
 
 <template>
-  <NModal
-  v-model:show="showModal"
-   closable @on-after-leave=""
-   :mask-closable="false"
-    preset="dialog"
-    title="公告详情"
-    positive-text="我已知晓"
-    @positive-click="handleClose"
-   >
-   <div v-html="modalContent"></div>
-  </NModal>
-
   <div class="flex flex-col w-full h-full chat-content" :class="[isMobile? '' : 'chat-content-noMobile']">
     <main class="flex-1 overflow-hidden">
 
@@ -657,53 +647,7 @@ load()
             </div>
             <div class="gpts-box" v-else>
               <div class="help" v-if="gptsFilterList && gptsFilterList.length">
-                <!-- <div class="ai-icon">
-                  <IconSvg icon="chatGPT" :width="isMobile ? '32px' : '64px'" :height="isMobile ? '32px' : '64px'"></IconSvg>
-                </div> -->
-                <div class="text" :style="{padding: isMobile? '22px 10px' : '22px 68px', 'font-size': isMobile? '14px' : '16px', 'line-height': isMobile? '20px' : '28px'}">
-                  <p class="title">
-                    {{ t('chat.helpTitle') }}
-                  </p>
-                  <p v-for="(item,index) in t('chat.helpcontent').split(';')" :key="index">{{ item }}</p>
-                  <div class="gpts-list">
-                    <div class="refresh" @click="refresh">
-                      <IconSvg icon="refresh"></IconSvg>&nbsp;{{ t('chat.refresh') }}
-                    </div>
-                    <div v-for="v in gptsFilterList" :key="v.name" class="gpts-item" :style="{width: isMobile ? '100%' : 'calc(50% - 20px)', marginRight: '20px', padding: isMobile ? '5px 8px' : '14px 10px', 'margin-bottom': isMobile ? '8px' : '20px'}">
-                      <NImage :src="v.logo" :preview-disabled="true" lazy
-                      class="group-hover:scale-[130%] duration-300 shrink-0 overflow-hidden bg-base object-cover rounded-full bc-avatar w-[80px] h-[80px]" :style="{width: isMobile ? '23px' : '46px', height: isMobile ? '23px' : '46px'}">
-                          <template #placeholder>
-                            <div class="w-full h-full justify-center items-center flex"  >
-                            <SvgIcon icon="line-md:downloading-loop" class="text-[60px] text-green-300"   ></SvgIcon>
-                            </div>
-                          </template>
-                      </NImage>
-                      <div :style="{width: `calc(100% - ${isMobile ? '43px' : '66px'})`, float: 'left', marginLeft: '10px'}">
-                        <p class="info" :title="v.info"> {{ v.info }}</p>
-                        <p @click="goUseGpts(v)" class="name"> {{ t('chat.used') }} {{ v.name }}</p>
-                      </div>
-                    </div>
-                  </div>
-
-                  <div>
-                   <p>常见问题:</p> 
-                  <n-space >
-                      <n-tag :bordered="false" :round="true" size="large">
-                        它支持插件系统吗?
-                      </n-tag>
-                      <n-tag :bordered="false" :round="true" size="large">
-                        是否支持多个 AI 服务提供商?
-                      </n-tag>
-                      <n-tag :bordered="false" :round="true" size="large">
-                        它是否支持本地语言模型?
-                      </n-tag>
-                      <n-tag :bordered="false" :round="true" size="large">
-                        部署文档在哪?
-                      </n-tag>
-                  </n-space>
-
-                  </div>
-                </div>
+
               </div>
             </div>
 
@@ -745,7 +689,7 @@ load()
       </div>
     </main>
 
-    <footer :class="footerClass" class="footer-content" v-if="local!=='draw'">
+    <footer :class="footerClass" class="footer-content" v-if="local!=='chating'">
       <div class="w-full max-w-screen-xl m-auto">
         <aiGptInput @handle-clear="handleClear" @export="handleExport" v-if="['gpt-4o-mini','gpt-3.5-turbo-16k'].indexOf(gptConfigStore.myData.model)>-1 || st.inputme "
          v-model:modelValue="prompt" :disabled="buttonDisabled"

+ 3 - 3
src/views/chat/layout/sider/index.vue

@@ -187,7 +187,7 @@ async function store() {
       </main>
       <Footer v-if="isMobile"></Footer>
     </div>
-    <!-- <div class="nav-bar">
+    <div class="nav-bar">
       <div class="user-info" :style="{ height: isLogin ? '144px' : '90px', bottom: isLogin ? '84px' : '24px' }">
 
         <div v-show="isLogin">
@@ -208,7 +208,7 @@ async function store() {
 
           <div class="user-bottom" @click="store">
             <Button block>
-        
+              <!-- 应用市场 -->
               {{ $t('store.siderButton') }}
             </Button>
           </div>
@@ -232,7 +232,7 @@ async function store() {
           {{ $t('mjset.logout') }}
         </div>
       </div>
-    </div> -->
+    </div>
 
 
     

+ 4 - 20
src/views/mj/aiGptInput.vue

@@ -83,6 +83,8 @@ watch(
 	{ deep: true }
 );
 const handleSubmit = () => {
+ 
+
 	if (mvalue.value == "") return;
 	if (checkDisableGpt4(gptConfigStore.myData.model)) {
 		ms.error(t("mj.disableGpt4"));
@@ -418,9 +420,7 @@ function handleClear() {
 					width="28px"
 					height="22px"
 				></IconSvg>
-				<!-- <div @click="show = true">
-            {{ $t('store.siderButton') }}
-        </div> -->
+
 			</div>
 			<input
 				type="file"
@@ -559,24 +559,8 @@ function handleClear() {
 			</NAutoComplete>
 			<div class="send" @click="handleSubmit" v-if="!isMobile">
 				<IconSvg icon="send" width="16px" height="15px"></IconSvg>
-				|
-				<IconSvg icon="money" width="14px" height="24px"></IconSvg>
-				<NPopover trigger="hover">
-					<template #trigger>
-						{{ myToken.modelTokens }}
-					</template>
-					<div class="w-[300px]">
-						{{ $t("mj.tokenInfo1") }}
-						<p class="py-1" v-text="$t('mj.tokenInfo2')"></p>
-						<p class="text-right">
-							<NButton @click="st.isShow = true" type="info" size="small">{{
-								$t("setting.setting")
-							}}</NButton>
-						</p>
-					</div>
-				</NPopover>
 			</div>
-			<!-- translate-y-[-8px]       -->
+	
 		</div>
 	</div>
 

+ 2 - 5
src/views/mj/aiSider.vue

@@ -133,7 +133,7 @@ const handleSelect = (key: string) => {
 <template>
 
 
-  <div class="flex-shrink-0 w-[60px] z-[1000]  h-full" v-if="!isMobile" data-tauri-drag-region>
+  <!-- <div class="flex-shrink-0 w-[60px] z-[1000]  h-full" v-if="!isMobile" data-tauri-drag-region>
     <div
       class="flex h-full select-none flex-col items-center justify-between bg-[#e8eaf1] px-2 pt-4 pb-8 dark:bg-[#25272d]">
       <div class="flex flex-col space-y-4 flex-1 " data-tauri-drag-region>
@@ -176,9 +176,6 @@ const handleSelect = (key: string) => {
       </div>
 
       <div class="flex flex-col  space-y-2 ">
-        <!-- <NAvatar  v-show="isLogin"  size="large"  round  :src="userInfo.avatar"   v-if="userInfo.avatar"  :fallback-src="defaultAvatar"
-         class=" cursor-pointer"  /> -->
-
         <n-popover trigger="click" :show-arrow="false">
           <template #trigger>
             <n-avatar v-show="isLogin" size="large" round :src="userInfo.avatar" />
@@ -199,6 +196,6 @@ const handleSelect = (key: string) => {
     
   </div>
   <Setting v-if="st.show" v-model:visible="st.show" />
-  <PromptStore v-model:visible="show"></PromptStore>
+  <PromptStore v-model:visible="show"></PromptStore> -->
   
 </template>