diff --git a/CHANGELOG.md b/CHANGELOG.md index c119bd0b..04a64d10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ * 功能优化:用户文件列表组件增加分页功能支持 * Bug修复:修复用户注册失败Bug,注册操作只弹出一次行为验证码 * 功能优化:首次登录不需要验证码,直接登录,登录失败之后才弹出验证码 -* 功能新增:给 AI 应用(角色)增加分类 +* 功能新增:给 AI 应用(角色)增加分类,前端支持分类筛选 * 功能优化:允许用户在聊天页面设置是否使用流式输出或者一次性输出,兼容 GPT-O1 模型。 ## v4.1.3 diff --git a/web/src/App.vue b/web/src/App.vue index 059f4ffe..b94eed26 100644 --- a/web/src/App.vue +++ b/web/src/App.vue @@ -66,7 +66,8 @@ html, body { margin 0; .el-dialog__body { - max-height 90vh + max-height 80vh + overflow-y auto } } } diff --git a/web/src/assets/css/chat-app.styl b/web/src/assets/css/chat-app.styl index c7692bd4..a34dfdd7 100644 --- a/web/src/assets/css/chat-app.styl +++ b/web/src/assets/css/chat-app.styl @@ -2,14 +2,54 @@ background-color: #282c34; height 100% - .inner { + .apps-type-nav{ + height 43px + padding 8px 0; + margin-bottom 3px + } + + .scrollbar-type-nav{ + display flex + align-items center + height 43px + padding 0 5px + li{ + flex-shrink 0 + display flex + align-items center + justify-content center + margin 0 10px + height 26px + border-radius 4px + border 1px solid rgb(80,80,80) + padding 2px 12px + background rgba(60,60,60 0.9) + color #fff + font-size 14px + cursor pointer + + .image { + width 22px + height 22px + overflow hidden + margin-right 5px + border-radius 50% + } + &.active{ + background #21aa93; + } + } + } + + + .app-list-container { display flex color #ffffff - padding 15px; + padding 2px 15px; overflow-y visible overflow-x hidden - .list-box { + .item__list-box { .item { display flex flex-flow row diff --git a/web/src/assets/css/luma.styl b/web/src/assets/css/luma.styl index 212a47c8..a3b95efb 100644 --- a/web/src/assets/css/luma.styl +++ b/web/src/assets/css/luma.styl @@ -141,7 +141,7 @@ display flex flex-flow row align-items center - height 100px + min-height 100px padding 10px 15px border-radius 10px cursor pointer diff --git a/web/src/components/FileSelect.vue b/web/src/components/FileSelect.vue index 554fb209..de1f8739 100644 --- a/web/src/components/FileSelect.vue +++ b/web/src/components/FileSelect.vue @@ -1,57 +1,64 @@ - \ No newline at end of file diff --git a/web/src/router.js b/web/src/router.js index 8507382a..e1ca5cd6 100644 --- a/web/src/router.js +++ b/web/src/router.js @@ -170,13 +170,13 @@ const routes = [ { path: '/admin/app', name: 'admin-app', - meta: {title: '应用管理'}, + meta: {title: '应用列表'}, component: () => import('@/views/admin/Apps.vue'), }, { path: '/admin/app/type', name: 'admin-app-type', - meta: {title: '应用管理'}, + meta: {title: '应用分类'}, component: () => import('@/views/admin/AppType.vue'), }, { diff --git a/web/src/views/ChatApps.vue b/web/src/views/ChatApps.vue index 45ab5677..684421f4 100644 --- a/web/src/views/ChatApps.vue +++ b/web/src/views/ChatApps.vue @@ -1,7 +1,21 @@ + @@ -62,6 +63,21 @@ autocomplete="off" /> + + + + + { fetchData() @@ -206,11 +223,25 @@ onMounted(() => { ElMessage.error("获取AI模型数据失败"); }) + // get app type + httpGet('/api/admin/app/type/list?enable=1').then((res) => { + appTypes.value = res.data + }).catch(() => { + ElMessage.error("获取应用分类数据失败"); + }) + }) const fetchData = () => { // 获取应用列表 httpGet('/api/admin/role/list').then((res) => { + // 初始化数据 + // const arr = res.data; + // for (let i = 0; i < arr.length; i++) { + // if(arr[i].model_id == 0){ + // arr[i].model_id = '' + // } + // } tableData.value = res.data sortedTableData.value = copyObj(tableData.value) loading.value = false diff --git a/web/vue.config.js b/web/vue.config.js index b5007883..d6595b62 100644 --- a/web/vue.config.js +++ b/web/vue.config.js @@ -21,5 +21,11 @@ module.exports = defineConfig({ devServer: { allowedHosts: "all", port: 8888, + proxy: { + '/static/upload/': { + target: process.env.VUE_APP_API_HOST, + changeOrigin: true, + } + } } })