ソースを参照

Merge remote-tracking branch 'origin/rlzc-v0.1' into ts

# Conflicts:
#	.env.production
#	package.json
#	src/api/ai/app/index.ts
#	src/views/ai/ai_app/index.vue
#	src/views/ai/app/index.vue
#	src/views/ai/appSession/index.vue
#	src/views/index.vue
sir lin 11 時間 前
コミット
aced34e95e

+ 4 - 0
.env.production

@@ -16,7 +16,11 @@ VITE_APP_SNAILJOB_ADMIN = '/snail-job'
 # 生产环境
 VITE_APP_BASE_API = '/prod-api'
 # 生产环境websocket
+<<<<<<< HEAD
 VITE_APP_WEB_SOCKET_API = 'ws://127.0.0.1:8080/ws'
+=======
+VITE_APP_WEB_SOCKET_API = 'ws://172.16.196.241:8080/ws'
+>>>>>>> origin/rlzc-v0.1
 
 # 是否在打包时开启压缩,支持 gzip 和 brotli
 VITE_BUILD_COMPRESS = gzip

+ 1 - 1
README.md

@@ -21,7 +21,7 @@ npm run dev
 # 构建生产环境
 npm run build:prod
 
-# 前端访问地址 http://localhost:80
+# 前端访问地址 http://172.16.196.241:80
 ```
 
 ## 本框架与RuoYi的业务差异

+ 7 - 0
package.json

@@ -39,11 +39,17 @@
     "js-cookie": "3.0.5",
     "jsencrypt": "3.3.2",
     "katex": "^0.16.22",
+<<<<<<< HEAD
     "lodash-es": "^4.17.21",
     "markdown-it": "^14.1.0",
     "markdown-it-link-attributes": "^4.0.1",
     "markdown-it-texmath": "^1.0.0",
     "naive-ui": "^2.41.0",
+=======
+    "markdown-it": "^14.1.0",
+    "markdown-it-link-attributes": "^4.0.1",
+    "markdown-it-texmath": "^1.0.0",
+>>>>>>> origin/rlzc-v0.1
     "nprogress": "0.2.0",
     "pinia": "2.2.6",
     "qiniu-js": "^4.0.0-beta.6",
@@ -77,6 +83,7 @@
     "eslint-plugin-prettier": "5.2.3",
     "eslint-plugin-vue": "9.32.0",
     "globals": "16.0.0",
+    "naive-ui": "^2.41.0",
     "prettier": "3.5.2",
     "sass": "1.84.0",
     "typescript": "~5.7.3",

+ 3 - 0
src/api/ai/app/index.ts

@@ -70,6 +70,7 @@ export const delAiApp = (id: string | number | Array<string | number>) => {
     url: '/aiApp/' + id,
     method: 'delete'
   });
+<<<<<<< HEAD
 };/**
  * 删除AI应用
  * @param linkType
@@ -81,4 +82,6 @@ export const getConfigByCondition = (linkType: string,linkId: string,configKey:
     url: '/aiAppConfig/getConfigByCondition',
     method: 'get'
   });
+=======
+>>>>>>> origin/rlzc-v0.1
 };

+ 102 - 0
src/views/ai/ai_app/index.vue

@@ -1,11 +1,15 @@
 <template>
+<<<<<<< HEAD
 
+=======
+>>>>>>> origin/rlzc-v0.1
   <div class="p-2">
     <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
       <div v-show="showSearch" class="mb-[10px]">
         <el-card shadow="hover">
           <el-form ref="queryFormRef" :model="queryParams" :inline="true">
             <el-form-item label="应用名称" prop="name">
+<<<<<<< HEAD
               <el-input v-model="queryParams.keywords" placeholder="请输入应用名称" clearable @keyup.enter="handleQuery" />
             </el-form-item>
             <el-form-item label="是否启用" prop="sn">
@@ -17,6 +21,21 @@
                   :value="item.value">
                 </el-option>
               </el-select>
+=======
+              <el-input v-model="queryParams.name" placeholder="请输入应用名称" clearable @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item label="SN" prop="sn">
+              <el-input v-model="queryParams.sn" placeholder="请输入SN" clearable @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item label="简要信息" prop="briefInfo">
+              <el-input v-model="queryParams.briefInfo" placeholder="请输入简要信息" clearable @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item label="是否是内置app" prop="isBuildIn">
+              <el-input v-model="queryParams.isBuildIn" placeholder="请输入是否是内置app" clearable @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item label="是否启用" prop="enable">
+              <el-input v-model="queryParams.enable" placeholder="请输入是否启用" clearable @keyup.enter="handleQuery" />
+>>>>>>> origin/rlzc-v0.1
             </el-form-item>
             <el-form-item>
               <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
@@ -39,10 +58,17 @@
           <el-col :span="1.5">
             <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['ai:aiApp:remove']">删除</el-button>
           </el-col>
+<<<<<<< HEAD
+=======
+          <el-col :span="1.5">
+            <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['ai:aiApp:export']">导出</el-button>
+          </el-col>
+>>>>>>> origin/rlzc-v0.1
           <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
         </el-row>
       </template>
 
+<<<<<<< HEAD
       <el-table border v-loading="loading" :data="aiAppList" @selection-change="handleSelectionChange">
         <el-table-column type="selection" width="55" align="center" />
         <el-table-column label="应用名称" align="center" prop="name" />
@@ -76,6 +102,15 @@
           </template>
         </el-table-column>
         <el-table-column width="200" label="操作" align="center" class-name="small-padding fixed-width">
+=======
+      <el-table v-loading="loading" :data="aiAppList" @selection-change="handleSelectionChange">
+        <el-table-column type="selection" width="55" align="center" />
+        <el-table-column label="应用名称" align="center" prop="name" />
+        <el-table-column label="SN" align="center" prop="sn" />
+        <el-table-column label="应用类型" align="center" prop="appTypeName" />
+        <el-table-column label="是否启用" align="center" prop="enable" />
+        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+>>>>>>> origin/rlzc-v0.1
           <template #default="scope">
             <el-tooltip content="修改" placement="top">
               <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['ai:aiApp:edit']"></el-button>
@@ -89,6 +124,7 @@
 
       <pagination v-show="total > 0" :total="totalRow" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
     </el-card>
+<<<<<<< HEAD
 
 
 
@@ -97,10 +133,15 @@
     <!-- 添加或修改AI应用对话框 -->
     <el-dialog draggable="true" :title="dialog.title" v-model="dialog.visible" width="60vw" append-to-body>
 
+=======
+    <!-- 添加或修改AI应用对话框 -->
+    <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
+>>>>>>> origin/rlzc-v0.1
       <el-form ref="aiAppFormRef" :model="form" :rules="rules" label-width="80px">
         <el-form-item label="应用名称" prop="name">
           <el-input v-model="form.name" placeholder="请输入应用名称" />
         </el-form-item>
+<<<<<<< HEAD
         <el-form-item label="编号" prop="sn">
           <el-input v-model="form.sn" placeholder="请输入编号" />
         </el-form-item>
@@ -112,6 +153,19 @@
         </el-form-item>
         <el-form-item label="简要信息" prop="briefInfo">
           <el-input v-model="form.briefInfo" type="textarea" :rows="10" placeholder="请输入内容" />
+=======
+        <el-form-item label="SN" prop="sn">
+          <el-input v-model="form.sn" placeholder="请输入SN" />
+        </el-form-item>
+        <el-form-item label="简要信息" prop="briefInfo">
+          <el-input v-model="form.briefInfo" type="textarea" placeholder="请输入内容" />
+        </el-form-item>
+        <el-form-item label="是否是内置app" prop="isBuildIn">
+          <el-input v-model="form.isBuildIn" placeholder="请输入是否是内置app" />
+        </el-form-item>
+        <el-form-item label="是否启用" prop="enable">
+          <el-input v-model="form.enable" placeholder="请输入是否启用" />
+>>>>>>> origin/rlzc-v0.1
         </el-form-item>
       </el-form>
       <template #footer>
@@ -121,6 +175,7 @@
         </div>
       </template>
     </el-dialog>
+<<<<<<< HEAD
     <!-- 定制优化AI应用对话框 lin -->
 <!--<configTabs/>-->
     <el-dialog :title="'大模型设置'" v-model="dialogSetting.visible" center>
@@ -130,14 +185,19 @@
 
 
 
+=======
+>>>>>>> origin/rlzc-v0.1
   </div>
 </template>
 
 <script setup name="AiApp" lang="ts">
 import { listAiApp, getAiApp, delAiApp, addAiApp, updateAiApp } from "@/api/ai/app";
 import { AiAppVO, AiAppQuery, AiAppForm } from '@/api/ai/aiApp/types';
+<<<<<<< HEAD
 import components from "../../../../vite/plugins/components";
 import ConfigTabs from "@/views/ai/ai_app/configPage/configTabs.vue";
+=======
+>>>>>>> origin/rlzc-v0.1
 
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 
@@ -150,6 +210,7 @@ const single = ref(true);
 const multiple = ref(true);
 const total = ref(0);
 const totalRow = ref(0);
+<<<<<<< HEAD
 const options = ref([{
   value: true,
   label: '启用'
@@ -165,10 +226,17 @@ const prop = reactive({
 });
 const aiAppFormRef = ref<ElFormInstance>();
 //编辑新增
+=======
+
+const queryFormRef = ref<ElFormInstance>();
+const aiAppFormRef = ref<ElFormInstance>();
+
+>>>>>>> origin/rlzc-v0.1
 const dialog = reactive<DialogOption>({
   visible: false,
   title: ''
 });
+<<<<<<< HEAD
 //设置
 const dialogSetting = reactive<DialogOption>({
   visible: false,
@@ -176,6 +244,8 @@ const dialogSetting = reactive<DialogOption>({
 });
 //应用类型 lin
 const disable=ref(false);
+=======
+>>>>>>> origin/rlzc-v0.1
 
 const initFormData: AiAppForm = {
   id: undefined,
@@ -195,13 +265,21 @@ const data = reactive<PageData<AiAppForm, AiAppQuery>>({
     keywords: '',// lin add
     page: 1,
     pageSize: 10,
+<<<<<<< HEAD
     appType: 'app_simple',
+=======
+>>>>>>> origin/rlzc-v0.1
     orderByColumn: defaultSort.value.prop,
     isAsc: defaultSort.value.order
   },
   rules: {
+<<<<<<< HEAD
     sn: [
       { required: true, message: "编号不能为空", trigger: "blur" }
+=======
+    id: [
+      { required: true, message: "主键ID不能为空", trigger: "blur" }
+>>>>>>> origin/rlzc-v0.1
     ],
     name: [
       { required: true, message: "应用名称不能为空", trigger: "blur" }
@@ -209,8 +287,11 @@ const data = reactive<PageData<AiAppForm, AiAppQuery>>({
   }
 });
 
+<<<<<<< HEAD
 
 
+=======
+>>>>>>> origin/rlzc-v0.1
 const { queryParams, form, rules } = toRefs(data);
 
 /** 查询AI应用列表 */
@@ -239,15 +320,21 @@ const reset = () => {
 /** 搜索按钮操作 */
 const handleQuery = () => {
   queryParams.value.pageNum = 1;
+<<<<<<< HEAD
 
+=======
+>>>>>>> origin/rlzc-v0.1
   getList();
 }
 
 /** 重置按钮操作 */
 const resetQuery = () => {
   queryFormRef.value?.resetFields();
+<<<<<<< HEAD
   queryParams.value.keywords=''
   queryParams.value.enable=null
+=======
+>>>>>>> origin/rlzc-v0.1
   handleQuery();
 }
 
@@ -260,11 +347,15 @@ const handleSelectionChange = (selection: AiAppVO[]) => {
 
 /** 新增按钮操作 */
 const handleAdd = () => {
+<<<<<<< HEAD
   disable.value=false;
+=======
+>>>>>>> origin/rlzc-v0.1
   reset();
   dialog.visible = true;
   dialog.title = "添加AI应用";
 }
+<<<<<<< HEAD
 /** 设置按钮操作 lin*/
 const Appsetting = async (row) => {
 
@@ -273,6 +364,8 @@ const Appsetting = async (row) => {
   dialogSetting.visible = true;
   console.log(prop.value);
 }
+=======
+>>>>>>> origin/rlzc-v0.1
 
 /** 修改按钮操作 */
 const handleUpdate = async (row?: AiAppVO) => {
@@ -281,8 +374,11 @@ const handleUpdate = async (row?: AiAppVO) => {
   const res = await getAiApp(_id);
   Object.assign(form.value, res.data);
   dialog.visible = true;
+<<<<<<< HEAD
    disable.value=true;
 
+=======
+>>>>>>> origin/rlzc-v0.1
   dialog.title = "修改AI应用";
 }
 
@@ -319,6 +415,7 @@ const handleExport = () => {
   }, `aiApp_${new Date().getTime()}.xlsx`)
 }
 
+<<<<<<< HEAD
 //==
 import {ref} from 'vue'
 import AppEdit from './cpns/app-edit.vue'
@@ -361,10 +458,15 @@ function goChainPage(row) {
   router.push(menuItem.key);
 
 }
+=======
+>>>>>>> origin/rlzc-v0.1
 onMounted(() => {
   getList();
 });
 </script>
+<<<<<<< HEAD
 <style scoped>
 
 </style>
+=======
+>>>>>>> origin/rlzc-v0.1

+ 15 - 0
src/views/ai/app/index.vue

@@ -17,8 +17,13 @@
       <el-row :gutter="20">
         <el-col :span="6" v-for="(item, index) in dataList" :key="index">
           <el-card shadow="hover" class="card "  @click="handleAppSession(item)">
+<<<<<<< HEAD
             <img v-if="item.config===null||item.config.uiConfig===undefined||item.config.uiConfig.appLogo===undefined" :src="defAva" :title="item.briefInfo" class="card-image" alt="">
             <img v-else-if="item.config.uiConfig.appLogo!==null" :src="item.config.uiConfig.appLogo" :title="item.briefInfo" class="card-image" alt="">
+=======
+            <img v-if="item.config===null" :src="defAva" :title="item.briefInfo" class="card-image" alt="">
+            <img v-if="item.config!==null" :src="item.config.uiConfig.appLogo" :title="item.briefInfo" class="card-image" alt="">
+>>>>>>> origin/rlzc-v0.1
             <div class="card-content">
               <span class="ai_title">{{ item.name }}</span>
               <span v-if="item.appType==='app_design'" class="ai_subtitle" style="color: #804205"><strong>{{ item.appTypeName }}</strong></span>
@@ -27,7 +32,11 @@
           </el-card>
         </el-col>
       </el-row>
+<<<<<<< HEAD
       <p v-show="total <= 0" style="text-align: center">暂无相关应用</p>
+=======
+
+>>>>>>> origin/rlzc-v0.1
       <pagination v-show="total > 0" :total="totalRow" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
     </el-card>
 
@@ -61,7 +70,10 @@ const queryParams = ref<AiAppQuery>({
   keywords: '',// lin add
   page: 1,
   pageSize: 10,
+<<<<<<< HEAD
   enable: true,
+=======
+>>>>>>> origin/rlzc-v0.1
   orderByColumn: defaultSort.value.prop,
   isAsc: defaultSort.value.order
 });
@@ -83,8 +95,11 @@ const handleQuery = () => {
 /** 重置按钮操作 */
 const resetQuery = () => {
   queryFormRef.value?.resetFields();
+<<<<<<< HEAD
   queryParams.value.keywords=''
 
+=======
+>>>>>>> origin/rlzc-v0.1
   handleQuery();
 }
 // 获取路由实例

+ 13 - 0
src/views/ai/appSession/index.vue

@@ -386,7 +386,10 @@ function handleUpdateSessionName(sessionId, msg) {
 //获取app
 function getApp() {
   getBySn(appSn.value).then((res) => {
+<<<<<<< HEAD
     console.log(res);
+=======
+>>>>>>> origin/rlzc-v0.1
     appInfo.value = res.data;
     appId.value = appInfo.value.id;
     const uiConfig = res.data.config?.uiConfig;
@@ -404,6 +407,7 @@ function getApp() {
     } else {
       appInfo.value.appLogo = 'https://static.jbolt.cn/website/jboltai_logo_icon.png';
     }
+<<<<<<< HEAD
     console.log(appInfo.value);
     if (!appInfo.value.enable) { //应用已发布
       ElMessage({ message: '应用未发布,请先发布应用', type: 'error' });
@@ -413,6 +417,15 @@ function getApp() {
       loadChatList(true);
     }
 
+=======
+
+    if (!appInfo.value.enable) { //应用已发布
+      ElMessage({ message: '应用未发布,请先发布应用', type: 'error' });
+    }
+    // 页面加载时设置标题
+    document.title = appInfo.value.name;
+    loadChatList(true);
+>>>>>>> origin/rlzc-v0.1
   });
 }
 

+ 4 - 0
src/views/index.vue

@@ -1,5 +1,6 @@
 <template>
   <div class="app-container home">
+<<<<<<< HEAD
     <el-row :gutter="20">
       <el-col :sm="24" :lg="12" style="padding-left: 20px">
         <h2>AI大模型</h2>
@@ -91,6 +92,9 @@
       </el-col>
     </el-row>
     <el-divider />
+=======
+      欢迎使用AI大模型
+>>>>>>> origin/rlzc-v0.1
   </div>
 </template>
 

+ 1 - 1
vite.config.ts

@@ -24,7 +24,7 @@ export default defineConfig(({ mode, command }) => {
       open: true,
       proxy: {
         [env.VITE_APP_BASE_API]: {
-          target: 'http://localhost:8080',
+          target: 'http://172.16.196.241:8080',
           changeOrigin: true,
           ws: true,
           rewrite: (path) => path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '')