Merge branch 'main' into py-display

This commit is contained in:
CGD
2026-03-31 14:24:27 +08:00
committed by GitHub
74 changed files with 1034 additions and 451 deletions
+10 -6
View File
@@ -28,17 +28,16 @@ nav {
}
.copyright {
text-align: center;
padding: 0 !important;
color: rgb(0, 0, 0);
font-size: 12px;
font-weight: 400;
margin-top: auto;
padding: 30px 0 20px;
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.el-message {
@@ -60,6 +59,11 @@ export default {
isCDNEnabled: process.env.VUE_APP_USE_CDN === 'true'
};
},
created() {
// 挂载 store 状态
this.$store.commit('setUserInfo', JSON.parse(localStorage.getItem('userInfo') || '{}'));
this.$store.commit('setPubConfig', JSON.parse(localStorage.getItem('pubConfig') || '{}'));
},
mounted() {
// 检测是否为移动设备且VUE_APP_H5_URL不为空,如果两个条件都满足则跳转到H5页面
if (this.isMobileDevice() && process.env.VUE_APP_H5_URL) {
@@ -170,6 +170,9 @@ export default {
RequestService.clearRequestTime();
callback(res);
})
.fail((err) => {
callback(err);
})
.networkFail(() => {
RequestService.reAjaxFun(() => {
this.getAgentMcpAccessAddress(agentId, callback);
@@ -73,6 +73,7 @@
</template>
<script>
import { debounce } from '@/utils'
import Api from '@/apis/api';
export default {
@@ -115,6 +116,10 @@ export default {
if (val) {
this.resetData();
this.loadSessions();
} else {
this.audioElement?.pause();
this.audioElement = null;
this.playingAudioId = null;
}
},
dialogVisible(val) {
@@ -305,7 +310,7 @@ export default {
}
return 'el-icon-video-play';
},
playAudio(message) {
playAudio: debounce(function(message) {
if (this.playingAudioId === message.audioId) {
// 如果正在播放当前音频,则停止播放
if (this.audioElement) {
@@ -326,9 +331,12 @@ export default {
this.playingAudioId = message.audioId;
Api.agent.getAudioId(message.audioId, (res) => {
if (res.data && res.data.data) {
if (!this.audioElement) {
this.audioElement = new Audio();
}
// 使用获取到的下载ID播放音频
this.audioElement = new Audio(Api.getServiceUrl() + `/agent/play/${res.data.data}`);
this.audioElement.src = Api.getServiceUrl() + `/agent/play/${res.data.data}`;
this.audioElement.onended = () => {
this.playingAudioId = null;
this.audioElement = null;
@@ -337,7 +345,7 @@ export default {
this.audioElement.play();
}
});
},
}, 300),
getUserAvatar(sessionId) {
// 从 sessionId 中提取所有数字
const numbers = sessionId.match(/\d+/g);
@@ -314,7 +314,7 @@ export default {
if (res.data.code === 0) {
this.mcpUrl = res.data.data || "";
} else {
this.mcpUrl = "";
this.mcpUrl = res.data.msg;
console.error('获取MCP地址失败:', res.data.msg);
}
});
+13 -34
View File
@@ -26,7 +26,7 @@
<span class="nav-text">{{ $t("header.smartManagement") }}</span>
</div>
<!-- 普通用户显示音色克隆 -->
<div v-if="!isSuperAdmin && featureStatus.voiceClone" class="equipment-management"
<div v-if="!userInfo.superAdmin && featureStatus.voiceClone" class="equipment-management"
:class="{ 'active-tab': $route.path === '/voice-clone-management' }" @click="goVoiceCloneManagement">
<img loading="lazy" alt="" src="@/assets/header/voice.png" :style="{
filter:
@@ -38,7 +38,7 @@
</div>
<!-- 超级管理员显示音色克隆下拉菜单 -->
<el-dropdown v-if="isSuperAdmin && featureStatus.voiceClone" trigger="click" class="equipment-management more-dropdown" :class="{
<el-dropdown v-if="userInfo.superAdmin && featureStatus.voiceClone" trigger="click" class="equipment-management more-dropdown" :class="{
'active-tab':
$route.path === '/voice-clone-management' ||
$route.path === '/voice-resource-management',
@@ -64,7 +64,7 @@
</el-dropdown-menu>
</el-dropdown>
<div v-if="isSuperAdmin" class="equipment-management" :class="{ 'active-tab': $route.path === '/model-config' }"
<div v-if="userInfo.superAdmin" class="equipment-management" :class="{ 'active-tab': $route.path === '/model-config' }"
@click="goModelConfig">
<img loading="lazy" alt="" src="@/assets/header/model_config.png" :style="{
filter:
@@ -81,7 +81,7 @@
}" />
<span class="nav-text">{{ $t("header.knowledgeBase") }}</span>
</div>
<el-dropdown v-if="isSuperAdmin" trigger="click" class="equipment-management more-dropdown" :class="{
<el-dropdown v-if="userInfo.superAdmin" trigger="click" class="equipment-management more-dropdown" :class="{
'active-tab':
$route.path === '/dict-management' ||
$route.path === '/params-management' ||
@@ -140,7 +140,7 @@
<!-- 右侧元素 -->
<div class="header-right">
<div class="search-container" v-if="$route.path === '/home' && !(isSuperAdmin && isSmallScreen)">
<div class="search-container" v-if="$route.path === '/home' && !(userInfo.superAdmin && isSmallScreen)">
<div class="search-wrapper">
<el-input v-model="search" :placeholder="$t('header.searchPlaceholder')" class="custom-search-input"
@keyup.enter.native="handleSearch" @focus="showSearchHistory" @blur="hideSearchHistory" clearable
@@ -189,7 +189,7 @@
<script>
import userApi from "@/apis/module/user";
import i18n, { changeLanguage } from "@/i18n";
import { mapActions, mapGetters } from "vuex";
import { mapActions, mapState } from "vuex";
import ChangePasswordDialog from "./ChangePasswordDialog.vue"; // 引入修改密码弹窗组件
import featureManager from "@/utils/featureManager"; // 引入功能管理工具类
@@ -202,10 +202,6 @@ export default {
data() {
return {
search: "",
userInfo: {
username: "",
mobile: "",
},
isChangePasswordDialogVisible: false, // 控制修改密码弹窗的显示
paramDropdownVisible: false,
voiceCloneDropdownVisible: false,
@@ -224,18 +220,16 @@ export default {
label: "label",
children: "children",
},
// 功能状态
featureStatus: {
voiceClone: false, // 音色克隆功能状态
knowledgeBase: false, // 知识库功能状态
},
};
},
computed: {
...mapGetters(["getIsSuperAdmin"]),
isSuperAdmin() {
return this.getIsSuperAdmin;
},
...mapState({
featureStatus: (state) => ({
voiceClone: state.pubConfig.systemWebMenu?.features?.voiceClone?.enabled, // 音色克隆功能状态
knowledgeBase: state.pubConfig.systemWebMenu?.features?.knowledgeBase?.enabled, // 知识库功能状态
}),
userInfo: (state) => state.userInfo,
}),
// 获取当前语言
currentLanguage() {
return i18n.locale || "zh_CN";
@@ -325,7 +319,6 @@ export default {
},
},
async mounted() {
this.fetchUserInfo();
this.checkScreenSize();
window.addEventListener("resize", this.checkScreenSize);
// 从localStorage加载搜索历史
@@ -386,20 +379,6 @@ export default {
async loadFeatureStatus() {
// 等待featureManager初始化完成
await featureManager.waitForInitialization();
const config = featureManager.getConfig();
this.featureStatus.voiceClone = config.voiceClone;
this.featureStatus.knowledgeBase = config.knowledgeBase;
},
// 获取用户信息
fetchUserInfo() {
userApi.getUserInfo(({ data }) => {
this.userInfo = data.data;
if (data.data.superAdmin !== undefined) {
this.$store.commit("setUserInfo", data.data);
}
});
},
checkScreenSize() {
this.isSmallScreen = window.innerWidth <= 1386;
+76 -11
View File
@@ -17,17 +17,36 @@
class="custom-input"></el-input>
</el-form-item>
<el-form-item :label="$t('paramDialog.paramValue')" prop="paramValue" class="form-item">
<el-input v-model="form.paramValue" :placeholder="$t('paramDialog.paramValuePlaceholder')"
class="custom-input"></el-input>
<el-form-item :label="$t('paramDialog.valueType')" prop="valueType" class="form-item">
<el-select
v-model="form.valueType"
:placeholder="$t('paramDialog.valueTypePlaceholder')"
class="custom-select"
>
<el-option
v-for="item in valueTypeOptions"
:key="item.value"
:label="$t(`paramDialog.${item.value}Type`)"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item :label="$t('paramDialog.valueType')" prop="valueType" class="form-item">
<el-select v-model="form.valueType" :placeholder="$t('paramDialog.valueTypePlaceholder')"
class="custom-select">
<el-option v-for="item in valueTypeOptions" :key="item.value" :label="$t(`paramDialog.${item.value}Type`)"
:value="item.value" />
</el-select>
<el-form-item :label="$t('paramDialog.paramValue')" prop="paramValue" class="form-item">
<el-input
v-if="form.valueType !== 'json' && form.valueType !== 'array'"
v-model="form.paramValue"
:placeholder="$t('paramDialog.paramValuePlaceholder')"
class="custom-input"
></el-input>
<el-input
v-else
type="textarea"
v-model="form.paramValue"
:placeholder="$t('paramDialog.paramValuePlaceholder')"
:rows="6"
class="custom-textarea"
></el-input>
</el-form-item>
<el-form-item :label="$t('paramDialog.remark')" prop="remark" class="form-item remark-item">
@@ -98,8 +117,37 @@ export default {
submit() {
this.$refs.form.validate((valid) => {
if (valid) {
const submitData = { ...this.form };
// 如果是 array 类型,校验格式并转换
if (submitData.valueType === 'array' && submitData.paramValue) {
const lines = submitData.paramValue.split('\n').filter(line => line.trim());
// 检查除最后一行外的每行是否以分号结尾
for (let i = 0; i < lines.length - 1; i++) {
if (!lines[i].trim().endsWith(';')) {
this.$message.error('数组格式错误,需要使用英文分号结尾');
return;
}
}
const items = lines
.map(item => item.trim().replace(/;$/, ''))
.filter(item => item);
submitData.paramValue = items.join(';');
}
// 如果是 json 类型,压缩 JSON 格式后再提交
else if (submitData.valueType === 'json' && submitData.paramValue) {
try {
const parsed = JSON.parse(submitData.paramValue);
submitData.paramValue = JSON.stringify(parsed);
} catch (e) {
// 如果解析失败,保持原值
}
}
this.saving = true; // 开始加载
this.$emit('submit', this.form);
this.$emit('submit', submitData);
}
});
},
@@ -116,7 +164,24 @@ export default {
},
watch: {
visible(newVal) {
if (!newVal) {
if (newVal) {
if (this.form.paramValue) {
// 如果是 json 类型,格式化显示
if (this.form.valueType === 'json') {
try {
const parsed = JSON.parse(this.form.paramValue);
this.form.paramValue = JSON.stringify(parsed, null, 2);
} catch (e) {
// 如果解析失败,保持原值
}
}
// 如果是 array 类型,将分号分隔的字符串转换为每行一个项目
else if (this.form.valueType === 'array') {
const items = this.form.paramValue.split(';').filter(item => item.trim());
this.form.paramValue = items.join(';\n');
}
}
} else {
// 当对话框关闭时,重置saving状态
this.saving = false;
}
@@ -88,7 +88,6 @@
<el-option :label="$t('providerDialog.booleanType')" value="boolean"></el-option>
<el-option :label="$t('providerDialog.dictType')" value="dict"></el-option>
<el-option :label="$t('providerDialog.arrayType')" value="array"></el-option>
<el-option :label="$t('providerDialog.ragType')" value="RAG"></el-option>
</el-select>
</template>
<template v-else>
+3 -3
View File
@@ -670,10 +670,10 @@ export default {
'home.wish': 'Vamos ter um dia maravilhoso!',
'home.languageModel': 'LLM',
'home.voiceModel': 'TTS',
'home.configureRole': 'Configurar Papel',
'home.voiceprintRecognition': 'Impressão Vocal',
'home.configureRole': 'ConfRoles',
'home.voiceprintRecognition': 'RecVoz',
'home.deviceManagement': 'Dispositivos',
'home.chatHistory': 'Histórico de Chat',
'home.chatHistory': 'Conversa',
'home.lastConversation': 'Última Conversa',
'home.noConversation': 'Nenhuma conversa',
'home.justNow': 'Agora mesmo',
+3 -13
View File
@@ -10,7 +10,6 @@ export default new Vuex.Store({
state: {
token: '',
userInfo: {}, // 添加用户信息存储
isSuperAdmin: false, // 添加superAdmin状态
pubConfig: { // 添加公共配置存储
version: '',
beianIcpNum: 'null',
@@ -29,12 +28,6 @@ export default new Vuex.Store({
getUserInfo(state) {
return state.userInfo
},
getIsSuperAdmin(state) {
if (localStorage.getItem('isSuperAdmin') === null) {
return state.isSuperAdmin
}
return localStorage.getItem('isSuperAdmin') === 'true'
},
getPubConfig(state) {
return state.pubConfig
}
@@ -46,19 +39,17 @@ export default new Vuex.Store({
},
setUserInfo(state, userInfo) {
state.userInfo = userInfo
const isSuperAdmin = userInfo.superAdmin === 1
state.isSuperAdmin = isSuperAdmin
localStorage.setItem('isSuperAdmin', isSuperAdmin)
localStorage.setItem('userInfo', JSON.stringify(userInfo))
},
setPubConfig(state, config) {
state.pubConfig = config
localStorage.setItem('pubConfig', JSON.stringify(config))
},
clearAuth(state) {
state.token = ''
state.userInfo = {}
state.isSuperAdmin = false
localStorage.removeItem('token')
localStorage.removeItem('isSuperAdmin')
localStorage.removeItem('userInfo')
}
},
actions: {
@@ -67,7 +58,6 @@ export default new Vuex.Store({
return new Promise((resolve) => {
commit('clearAuth')
goToPage(Constant.PAGE.LOGIN, true);
window.location.reload(); // 彻底重置状态
})
},
// 添加获取公共配置的 action
+14 -1
View File
@@ -1,5 +1,6 @@
//功能配置工具
import Api from "@/apis/api";
import store from "@/store";
class FeatureManager {
constructor() {
@@ -72,7 +73,13 @@ class FeatureManager {
this.initialized = true;
}
/**
* 更新config缓存
*/
updateConfigCache(config) {
store.commit('setPubConfig', config);
localStorage.setItem('pubConfig', JSON.stringify(config));
}
/**
* 从pub-config接口获取配置
@@ -85,6 +92,7 @@ class FeatureManager {
if (result && result.status === 200) {
// 检查是否有data字段
if (result.data) {
const configCache = result.data.data || {};
// 检查是否有code字段,如果有则按照code判断
if (result.data.code !== undefined) {
if (result.data.code === 0 && result.data.data && result.data.data.systemWebMenu) {
@@ -110,6 +118,7 @@ class FeatureManager {
console.warn('配置中缺少features对象,使用默认配置');
resolve(this.defaultFeatures);
}
configCache.systemWebMenu = config;
} catch (error) {
console.warn('处理systemWebMenu配置失败:', error);
resolve(null);
@@ -143,6 +152,7 @@ class FeatureManager {
console.warn('配置中缺少features对象,使用默认配置');
resolve(this.defaultFeatures);
}
configCache.systemWebMenu = config;
} catch (error) {
console.warn('处理systemWebMenu配置失败:', error);
resolve(null);
@@ -152,6 +162,7 @@ class FeatureManager {
resolve(null);
}
}
this.updateConfigCache(configCache)
} else {
console.warn('接口返回数据中缺少data字段,使用默认配置');
resolve(null);
@@ -183,6 +194,8 @@ class FeatureManager {
// 异步保存到后端API
this.saveConfigToAPI(config).catch(error => {
console.warn('保存配置到API失败:', error);
}).finally(() => {
this.init()
});
// 触发配置变更事件
+30
View File
@@ -257,3 +257,33 @@ export function sm2Decrypt(privateKey, cipherText) {
return sm2.doDecrypt(dataWithoutPrefix, privateKey, 1);
}
/**
* 防抖函数
* @param {Function} fn 要防抖的函数
* @param {number} delay 延迟时间(毫秒),默认500ms
* @param {boolean} immediate 是否立即执行,默认false
* @returns {Function} 防抖处理后的函数
*/
export function debounce(fn, delay = 500, immediate = false) {
let timer = null;
return function (...args) {
const context = this;
if (timer) {
clearTimeout(timer);
}
if (immediate && !timer) {
fn.apply(context, args);
}
timer = setTimeout(() => {
if (!immediate) {
fn.apply(context, args);
}
timer = null;
}, delay);
};
}
@@ -136,17 +136,22 @@
</div>
</div>
</div>
<el-footer>
<version-footer />
</el-footer>
</div>
</template>
<script>
import HeaderBar from "@/components/HeaderBar";
import agentApi from "@/apis/module/agent";
import VersionFooter from "@/components/VersionFooter.vue";
export default {
name: "AgentTemplateManagement",
components: {
HeaderBar,
VersionFooter
},
data() {
@@ -478,11 +483,10 @@ export default {
/* 主容器样式 */
.main-wrapper {
margin: 5px 22px;
// 顶部 63px 底部 35px 查询72px
height: calc(100vh - 63px - 35px - 72px);
margin: 0 22px;
border-radius: 15px;
min-height: calc(100vh - 24vh);
height: auto;
max-height: 80vh;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
position: relative;
background: rgba(237, 242, 255, 0.5);
@@ -587,7 +591,7 @@ export default {
justify-content: space-between !important;
align-items: center;
margin-top: auto;
padding: 0 20px 15px !important;
padding: 0 20px !important;
width: 100% !important;
box-sizing: border-box !important;
}
@@ -119,7 +119,9 @@
@refresh="fetchBindDevices(currentAgentId)" />
<ManualAddDeviceDialog :visible.sync="manualAddDeviceDialogVisible" :agent-id="currentAgentId"
@refresh="fetchBindDevices(currentAgentId)" />
<el-footer>
<version-footer />
</el-footer>
</div>
</template>
@@ -128,12 +130,14 @@ import Api from '@/apis/api';
import AddDeviceDialog from "@/components/AddDeviceDialog.vue";
import HeaderBar from "@/components/HeaderBar.vue";
import ManualAddDeviceDialog from "@/components/ManualAddDeviceDialog.vue";
import VersionFooter from "@/components/VersionFooter.vue";
export default {
components: {
HeaderBar,
AddDeviceDialog,
ManualAddDeviceDialog
ManualAddDeviceDialog,
VersionFooter
},
data() {
return {
@@ -504,11 +508,9 @@ export default {
}
.main-wrapper {
margin: 5px 22px;
height: calc(100vh - 63px - 35px - 72px);
margin: 0 22px;
border-radius: 15px;
min-height: calc(100vh - 24vh);
height: auto;
max-height: 80vh;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
position: relative;
background: rgba(237, 242, 255, 0.5);
@@ -645,7 +647,7 @@ export default {
justify-content: space-between;
align-items: center;
margin-top: 10px;
padding-bottom: 10px;
/* padding-bottom: 10px; */
}
@@ -807,7 +809,7 @@ export default {
flex: 1;
display: flex;
flex-direction: column;
max-height: calc(100vh - 40vh);
/* max-height: calc(100vh - 40vh); */
}
:deep(.el-table__body-wrapper) {
+43 -24
View File
@@ -48,7 +48,7 @@
<el-table ref="dictDataTable" :data="dictDataList" style="width: 100%"
v-loading="dictDataLoading" element-loading-text="拼命加载中"
element-loading-spinner="el-icon-loading"
element-loading-background="rgba(255, 255, 255, 0.7)" class="data-table"
element-loading-background="rgba(255, 255, 255, 0.7)" class="transparent-table"
header-row-class-name="table-header">
<el-table-column :label="$t('modelConfig.select')" align="center" width="70">
<template slot-scope="scope">
@@ -461,11 +461,10 @@ export default {
}
.main-wrapper {
margin: 5px 22px;
// 顶部 63px 底部 35px 查询72px
height: calc(100vh - 63px - 35px - 72px);
margin: 0 22px;
border-radius: 15px;
min-height: calc(100vh - 24vh);
height: auto;
max-height: 80vh;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
position: relative;
background: rgba(237, 242, 255, 0.5);
@@ -555,13 +554,14 @@ export default {
.content-area {
flex: 1;
padding: 24px;
padding: 24px 24px 0;
height: 100%;
min-width: 600px;
overflow: hidden;
background-color: white;
display: flex;
flex-direction: column;
box-sizing: border-box;
}
.dict-data-card {
@@ -574,31 +574,51 @@ export default {
overflow: hidden;
}
.data-table {
border-radius: 6px;
overflow-y: hidden;
background-color: transparent !important;
--table-max-height: calc(100vh - 40vh);
max-height: var(--table-max-height);
:deep(.transparent-table) {
background: white;
flex: 1;
width: 100%;
display: flex;
flex-direction: column;
:deep(.el-table__body-wrapper) {
max-height: calc(var(--table-max-height) - 40px);
.el-table__body-wrapper {
flex: 1;
overflow-y: auto;
max-height: none !important;
}
:deep(.el-table__body) {
tr:last-child td {
border-bottom: none;
.el-table__header-wrapper {
flex-shrink: 0;
}
.el-table__header th {
background: white !important;
color: black;
font-weight: 600;
height: 40px;
padding: 8px 0;
font-size: 14px;
border-bottom: 1px solid #e4e7ed;
}
.el-table__body tr {
background-color: white;
td {
border-top: 1px solid rgba(0, 0, 0, 0.04);
border-bottom: 1px solid rgba(0, 0, 0, 0.04);
padding: 8px 0;
height: 40px;
color: #606266;
font-size: 14px;
}
}
}
:deep(.el-table) {
&::before {
display: none;
.el-table__row:hover>td {
background-color: #f5f7fa !important;
}
&::after {
&::before {
display: none;
}
}
@@ -607,7 +627,6 @@ export default {
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px 0;
width: 100%;
flex-shrink: 0;
min-height: 60px;
@@ -889,7 +908,7 @@ export default {
}
:deep(.el-card__body) {
padding: 15px;
padding: 0;
display: flex;
flex-direction: column;
flex: 1;
@@ -131,9 +131,7 @@ export default {
async created() {
// 等待功能配置管理器初始化完成
try {
console.log('等待功能配置管理器初始化...')
await featureManager.waitForInitialization()
console.log('功能配置管理器初始化完成,开始加载功能配置')
await this.loadFeatures()
this.setupConfigChangeListener()
} catch (error) {
@@ -152,14 +150,8 @@ export default {
async getFeaturesByIds(featureIds) {
try {
const featureConfig = await featureManager.getAllFeatures()
console.log('获取到的功能配置:', JSON.stringify(featureConfig, null, 2))
console.log('请求的功能ID列表:', featureIds)
const result = featureIds.map(id => {
const feature = featureConfig[id]
console.log(`功能 ${id} 的配置:`, feature)
console.log(`功能 ${id} 的启用状态:`, feature?.enabled)
return {
id: id,
name: this.$t(`feature.${id}.name`),
@@ -168,7 +160,6 @@ export default {
}
})
console.log('最终返回的功能列表:', JSON.stringify(result, null, 2))
return result
} catch (error) {
console.error('获取功能配置失败:', error)
@@ -245,7 +236,6 @@ export default {
setTimeout(() => {
this.loadFeatures()
this.$router.go(0)
}, 1000)
} catch (error) {
console.error('保存配置失败:', error)
@@ -261,7 +251,6 @@ export default {
// 设置配置变化监听器
setupConfigChangeListener() {
this.configChangeHandler = () => {
console.log('检测到配置变化,重新加载功能列表')
this.loadFeatures()
}
window.addEventListener('featureConfigReloaded', this.configChangeHandler)
@@ -433,11 +422,9 @@ export default {
}
.main-wrapper {
margin: 0 22px 5px 22px;
height: calc(100vh - 63px - 35px - 58px);
margin: 0 22px;
border-radius: 15px;
min-height: calc(100vh - 24vh);
height: auto;
max-height: 80vh;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
position: relative;
background: rgba(237, 242, 255, 0.5);
@@ -472,11 +472,10 @@ export default {
}
.main-wrapper {
margin: 5px 22px;
// 顶部 63px 底部 35px 查询72px
height: calc(100vh - 63px - 35px - 72px);
margin: 0 22px;
border-radius: 15px;
min-height: calc(100vh - 24vh);
height: auto;
max-height: 80vh;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
position: relative;
background: rgba(237, 242, 255, 0.5);
@@ -555,7 +554,6 @@ export default {
justify-content: space-between;
align-items: center;
margin-top: auto;
padding-bottom: 10px;
width: 100%;
}
@@ -1127,11 +1127,10 @@ export default {
}
.main-wrapper {
margin: 5px 22px;
// 顶部 63px 底部 35px 查询58px
height: calc(100vh - 63px - 35px - 58px);
margin: 0 22px;
border-radius: 15px;
min-height: calc(100vh - 24vh);
height: auto;
max-height: 80vh;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
position: relative;
background: rgba(237, 242, 255, 0.5);
+63 -40
View File
@@ -69,7 +69,7 @@
element-loading-background="rgba(255, 255, 255, 0.7)"
:header-cell-style="{ background: 'transparent' }"
:data="modelList"
class="data-table"
class="transparent-table"
header-row-class-name="table-header"
:header-cell-class-name="headerCellClassName"
@selection-change="handleSelectionChange"
@@ -637,7 +637,7 @@ export default {
};
</script>
<style scoped>
<style lang="scss" scoped>
.el-switch {
height: 23px;
}
@@ -660,11 +660,10 @@ export default {
}
.main-wrapper {
margin: 5px 22px;
// 顶部 63px 底部 35px 查询72px
height: calc(100vh - 63px - 35px - 72px);
margin: 0 22px;
border-radius: 15px;
min-height: calc(100vh - 26vh);
height: auto;
max-height: 80vh;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
position: relative;
background: rgba(237, 242, 255, 0.5);
@@ -689,7 +688,6 @@ export default {
height: 100%;
border-radius: 15px;
background: transparent;
border: 1px solid #fff;
}
.nav-panel {
@@ -752,13 +750,14 @@ export default {
.content-area {
flex: 1;
padding: 24px;
padding: 24px 24px 0;
height: 100%;
min-width: 600px;
overflow: hidden;
background-color: white;
display: flex;
flex-direction: column;
box-sizing: border-box;
}
.action-group {
@@ -843,15 +842,15 @@ export default {
outline: none;
}
.data-table {
border-radius: 6px;
overflow: hidden;
background-color: transparent !important;
}
// .data-table {
// border-radius: 6px;
// overflow: hidden;
// background-color: transparent !important;
// }
.data-table /deep/ .el-table__row {
background-color: transparent !important;
}
// .data-table ::v-deep .el-table__row {
// background-color: transparent !important;
// }
.table-header th {
background-color: transparent !important;
@@ -863,7 +862,7 @@ export default {
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px 0;
// padding: 16px 0;
width: 100%;
flex-shrink: 0;
min-height: 60px;
@@ -918,7 +917,7 @@ export default {
background: linear-gradient(135deg, #3a8ee6, #5a7cff);
}
.el-table th /deep/ .el-table__cell {
.el-table th ::v-deep .el-table__cell {
overflow: hidden;
-webkit-user-select: none;
-moz-user-select: none;
@@ -966,21 +965,6 @@ export default {
color: #fff !important;
}
::v-deep .data-table {
&.el-table::before,
&.el-table::after,
&.el-table__inner-wrapper::before {
display: none !important;
}
}
::v-deep .data-table .el-table__header-wrapper {
border-bottom: 1px solid rgb(224, 227, 237);
}
::v-deep .data-table .el-table__body td {
border-bottom: 1px solid rgb(224, 227, 237) !important;
}
.el-button img {
height: 1em;
@@ -1118,16 +1102,55 @@ export default {
flex: 1;
overflow: hidden;
}
:deep(.transparent-table) {
background: white;
flex: 1;
width: 100%;
display: flex;
flex-direction: column;
.data-table {
--table-max-height: calc(100vh - 45vh);
max-height: var(--table-max-height);
.el-table__body-wrapper {
flex: 1;
overflow-y: auto;
max-height: none !important;
}
.el-table__header-wrapper {
flex-shrink: 0;
}
.el-table__header th {
background: white !important;
color: black;
font-weight: 600;
height: 40px;
padding: 8px 0;
font-size: 14px;
border-bottom: 1px solid #e4e7ed;
}
.el-table__body tr {
background-color: white;
td {
border-top: 1px solid rgba(0, 0, 0, 0.04);
border-bottom: 1px solid rgba(0, 0, 0, 0.04);
padding: 8px 0;
height: 40px;
color: #606266;
font-size: 14px;
}
}
.el-table__row:hover>td {
background-color: #f5f7fa !important;
}
&::before {
display: none;
}
}
.data-table ::v-deep .el-table__body-wrapper {
max-height: calc(var(--table-max-height) - 80px);
overflow-y: auto;
}
::v-deep .el-loading-mask {
background-color: rgba(255, 255, 255, 0.6) !important;
+4 -6
View File
@@ -422,11 +422,10 @@ export default {
}
.main-wrapper {
margin: 5px 22px;
// 顶部 63px 底部 35px 查询72px
height: calc(100vh - 63px - 35px - 72px);
margin: 0 22px;
border-radius: 15px;
min-height: calc(100vh - 24vh);
height: auto;
max-height: 80vh;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
position: relative;
background: rgba(237, 242, 255, 0.5);
@@ -505,7 +504,6 @@ export default {
justify-content: space-between;
align-items: center;
margin-top: 10px;
padding-bottom: 10px;
}
.ctrl_btn {
@@ -735,7 +733,7 @@ export default {
}
.el-table {
--table-max-height: calc(100vh - 40vh);
// --table-max-height: calc(100vh - 40vh);
max-height: var(--table-max-height);
.el-table__body-wrapper {
@@ -381,11 +381,10 @@ export default {
}
.main-wrapper {
margin: 5px 22px;
// 顶部 63px 底部 35px 查询72px
height: calc(100vh - 63px - 35px - 72px);
margin: 0 22px;
border-radius: 15px;
min-height: calc(100vh - 24vh);
height: auto;
max-height: 80vh;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
position: relative;
background: rgba(237, 242, 255, 0.5);
@@ -464,7 +463,7 @@ export default {
justify-content: space-between;
align-items: center;
margin-top: 10px;
padding-bottom: 10px;
// padding-bottom: 10px;
}
.ctrl_btn {
@@ -712,7 +711,7 @@ export default {
}
.el-table {
--table-max-height: calc(100vh - 40vh);
// --table-max-height: calc(100vh - 40vh);
max-height: var(--table-max-height);
.el-table__body-wrapper {
@@ -460,11 +460,10 @@ export default {
}
.main-wrapper {
margin: 5px 22px;
// 顶部 63px 底部 35px 查询72px
height: calc(100vh - 63px - 35px - 72px);
margin: 0 22px;
border-radius: 15px;
min-height: calc(100vh - 24vh);
height: auto;
max-height: 80vh;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
position: relative;
background: rgba(237, 242, 255, 0.5);
@@ -546,7 +545,6 @@ export default {
justify-content: space-between;
align-items: center;
margin-top: 10px;
padding-bottom: 10px;
}
.ctrl_btn {
@@ -794,7 +792,7 @@ export default {
}
.el-table {
--table-max-height: calc(100vh - 40vh);
// --table-max-height: calc(100vh - 40vh);
max-height: var(--table-max-height);
.el-table__body-wrapper {
@@ -189,11 +189,10 @@ export default {
}
.main-wrapper {
margin: 5px 22px;
// 顶部 63px 底部 35px 查询58px
height: calc(100vh - 63px - 35px - 58px);
margin: 0 22px;
border-radius: 15px;
min-height: calc(100vh - 24vh);
height: auto;
max-height: 80vh;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
position: relative;
background: rgba(237, 242, 255, 0.5);
@@ -53,12 +53,16 @@
</div>
</div>
</div>
<el-footer>
<version-footer />
</el-footer>
</div>
</template>
<script>
import HeaderBar from "@/components/HeaderBar.vue";
import agentApi from '@/apis/module/agent';
import VersionFooter from "@/components/VersionFooter.vue";
// 默认模型配置常量
const DEFAULT_MODEL_CONFIG = {
@@ -73,7 +77,7 @@ const DEFAULT_MODEL_CONFIG = {
export default {
name: 'TemplateQuickConfig',
components: { HeaderBar },
components: { HeaderBar, VersionFooter },
data() {
return {
form: {
@@ -276,7 +280,7 @@ export default {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1.5vh 24px;
padding: 16px 24px;
}
.page-title {
@@ -286,9 +290,9 @@ export default {
}
.main-wrapper {
margin: 1vh 22px;
height: calc(100vh - 63px - 35px - 60px);
margin: 0 22px;
border-radius: 15px;
height: calc(100vh - 24vh);
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
position: relative;
background: rgba(237, 242, 255, 0.5);
@@ -381,11 +381,10 @@ export default {
}
.main-wrapper {
margin: 5px 22px;
// 顶部 63px 底部 35px 查询72px
height: calc(100vh - 63px - 35px - 72px);
margin: 0 22px;
border-radius: 15px;
min-height: calc(100vh - 24vh);
height: auto;
max-height: 80vh;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
position: relative;
background: rgba(237, 242, 255, 0.5);
@@ -721,7 +720,7 @@ export default {
}
.el-table {
--table-max-height: calc(100vh - 40vh);
// --table-max-height: calc(100vh - 40vh);
max-height: var(--table-max-height);
.el-table__body-wrapper {
@@ -511,11 +511,10 @@ export default {
}
.main-wrapper {
margin: 5px 22px;
// 顶部 63px 底部 35px 查询72px
height: calc(100vh - 63px - 35px - 72px);
margin: 0 22px;
border-radius: 15px;
min-height: calc(100vh - 24vh);
height: auto;
max-height: 80vh;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
position: relative;
background: rgba(237, 242, 255, 0.5);
@@ -594,7 +593,6 @@ export default {
justify-content: space-between;
align-items: center;
margin-top: 10px;
padding-bottom: 10px;
}
.ctrl_btn {
@@ -852,7 +850,7 @@ export default {
.el-table {
--table-max-height: calc(100vh - 40vh);
max-height: var(--table-max-height);
// max-height: var(--table-max-height);
.el-table__body-wrapper {
max-height: calc(var(--table-max-height) - 40px);
@@ -864,7 +862,6 @@ export default {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 40px;
}
:deep(.transparent-table) {
+4 -6
View File
@@ -202,11 +202,9 @@ export default {
}
.main-wrapper {
margin: 5px 22px;
height: calc(100vh - 63px - 35px - 60px);
margin: 0 22px;
border-radius: 15px;
min-height: calc(100vh - 24vh);
height: auto;
max-height: 80vh;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
position: relative;
background: rgba(237, 242, 255, 0.5);
@@ -285,7 +283,7 @@ export default {
justify-content: space-between;
align-items: center;
margin-top: 10px;
padding-bottom: 10px;
// padding-bottom: 10px;
}
.ctrl_btn {
@@ -533,7 +531,7 @@ export default {
}
.el-table {
--table-max-height: calc(100vh - 40vh);
// --table-max-height: calc(100vh - 40vh);
max-height: var(--table-max-height);
.el-table__body-wrapper {
@@ -363,11 +363,10 @@ export default {
}
.main-wrapper {
margin: 5px 22px;
// 顶部 63px 底部 35px 查询72px
height: calc(100vh - 63px - 35px - 72px);
margin: 0 22px;
border-radius: 15px;
min-height: calc(100vh - 24vh);
height: auto;
max-height: 80vh;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
position: relative;
background: rgba(237, 242, 255, 0.5);
@@ -433,7 +432,7 @@ export default {
overflow: hidden;
::v-deep .el-card__body {
padding: 15px;
padding: 15px 15px 0;
display: flex;
flex-direction: column;
flex: 1;
@@ -676,7 +675,7 @@ export default {
}
.el-table {
--table-max-height: calc(100vh - 40vh);
// --table-max-height: calc(100vh - 40vh);
max-height: var(--table-max-height);
.el-table__body-wrapper {
-1
View File
@@ -76,7 +76,6 @@
margin-top: 20px;
align-items: center;
border-radius: 10px;
background: #f6f8fb;
border: 1px solid #e4e6ef;
height: 40px;
padding: 0 15px;
+1 -1
View File
@@ -276,7 +276,7 @@ export default {
cursor: pointer;
.left-add {
width: 105px;
padding: 0 14px;
height: 34px;
border-radius: 17px;
background: #5778ff;
+15 -16
View File
@@ -238,13 +238,6 @@ export default {
this.$store.dispatch("fetchPubConfig").then(() => {
// 根据配置决定默认登录方式
this.isMobileLogin = this.enableMobileRegister;
// pub-config接口调用完成后,重新初始化featureManager以确保使用最新的配置
featureManager.waitForInitialization().then(() => {
console.log('featureManager重新初始化完成,使用pub-config配置');
}).catch(error => {
console.warn('featureManager重新初始化失败:', error);
});
});
},
methods: {
@@ -256,7 +249,9 @@ export default {
window.open(url, '_blank');
},
fetchCaptcha() {
if (this.$store.getters.getToken) {
// 处理手动清空localstorage导致无法获取验证码的问题
const token = localStorage.getItem('token')
if (token) {
if (this.$route.path !== "/home") {
this.$router.push("/home");
}
@@ -308,6 +303,17 @@ export default {
}
return true;
},
getUserInfo() {
Api.user.getUserInfo(({ data }) => {
if (data.code === 0) {
this.$store.commit("setUserInfo", data.data);
goToPage("/home");
} else {
showDanger("用户信息获取失败");
}
});
},
async login() {
if (this.isMobileLogin) {
@@ -361,20 +367,13 @@ export default {
({ data }) => {
showSuccess(this.$t('login.loginSuccess'));
this.$store.commit("setToken", JSON.stringify(data.data));
goToPage("/home");
this.getUserInfo();
},
(err) => {
// 直接使用后端返回的国际化消息
let errorMessage = err.data.msg || "登录失败";
showDanger(errorMessage);
if (
err.data != null &&
err.data.msg != null &&
err.data.msg.indexOf("图形验证码") > -1 || err.data.msg.indexOf("Captcha") > -1
) {
this.fetchCaptcha();
}
}
);
+8 -4
View File
@@ -355,6 +355,9 @@
:settings="ttsSettings"
@save="handleTtsSettingsSave"
/>
<el-footer>
<version-footer />
</el-footer>
</div>
</template>
@@ -368,10 +371,11 @@ import TtsAdvancedSettings from "@/components/TtsAdvancedSettings.vue";
import HeaderBar from "@/components/HeaderBar.vue";
import i18n from "@/i18n";
import featureManager from "@/utils/featureManager";
import VersionFooter from "@/components/VersionFooter.vue";
export default {
name: "RoleConfigPage",
components: { HeaderBar, FunctionDialog, ContextProviderDialog, TtsAdvancedSettings },
components: { HeaderBar, FunctionDialog, ContextProviderDialog, TtsAdvancedSettings, VersionFooter },
data() {
return {
showContextProviderDialog: false,
@@ -1291,7 +1295,7 @@ export default {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1.5vh 24px;
padding: 16px 24px;
}
.page-title {
@@ -1301,9 +1305,9 @@ export default {
}
.main-wrapper {
margin: 1vh 22px;
height: calc(100vh - 63px - 35px - 60px);
margin: 0 22px;
border-radius: 15px;
height: calc(100vh - 24vh);
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
position: relative;
background: rgba(237, 242, 255, 0.5);