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;
diff --git a/main/manager-web/src/components/ParamDialog.vue b/main/manager-web/src/components/ParamDialog.vue
index 8c30ef0b..5e3abc17 100644
--- a/main/manager-web/src/components/ParamDialog.vue
+++ b/main/manager-web/src/components/ParamDialog.vue
@@ -17,17 +17,36 @@
class="custom-input">
-
-
+
+
+
+
-
-
-
-
+
+
+