mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-27 01:23:55 +08:00
update:模型配置删除接口,只需要id参数
This commit is contained in:
@@ -75,9 +75,9 @@ export default {
|
|||||||
}).send()
|
}).send()
|
||||||
},
|
},
|
||||||
// 删除模型配置
|
// 删除模型配置
|
||||||
deleteModel(modelType, provideCode, id, callback) {
|
deleteModel(id, callback) {
|
||||||
RequestService.sendRequest()
|
RequestService.sendRequest()
|
||||||
.url(`${getServiceUrl()}/api/v1/models/models/${modelType}/${provideCode}/${id}`)
|
.url(`${getServiceUrl()}/api/v1/models/models/${id}`)
|
||||||
.method('DELETE')
|
.method('DELETE')
|
||||||
.success((res) => {
|
.success((res) => {
|
||||||
RequestService.clearRequestTime()
|
RequestService.clearRequestTime()
|
||||||
@@ -87,7 +87,7 @@ export default {
|
|||||||
console.error('删除模型失败:', err)
|
console.error('删除模型失败:', err)
|
||||||
this.$message.error(err.msg || '删除模型失败')
|
this.$message.error(err.msg || '删除模型失败')
|
||||||
RequestService.reAjaxFun(() => {
|
RequestService.reAjaxFun(() => {
|
||||||
this.deleteModel(modelType, provideCode, id, callback)
|
this.deleteModel(id, callback)
|
||||||
})
|
})
|
||||||
}).send()
|
}).send()
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,22 +3,27 @@
|
|||||||
<div class="header-container">
|
<div class="header-container">
|
||||||
<!-- 左侧元素 -->
|
<!-- 左侧元素 -->
|
||||||
<div class="header-left">
|
<div class="header-left">
|
||||||
<img loading="lazy" alt="" src="@/assets/xiaozhi-logo.png" class="logo-img"/>
|
<img loading="lazy" alt="" src="@/assets/xiaozhi-logo.png" class="logo-img" />
|
||||||
<img loading="lazy" alt="" src="@/assets/xiaozhi-ai.png" class="brand-img"/>
|
<img loading="lazy" alt="" src="@/assets/xiaozhi-ai.png" class="brand-img" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 中间导航菜单 -->
|
<!-- 中间导航菜单 -->
|
||||||
<div class="header-center">
|
<div class="header-center">
|
||||||
<div class="equipment-management" :class="{ 'active-tab': $route.path === '/home' }" @click="goHome">
|
<div class="equipment-management" :class="{ 'active-tab': $route.path === '/home' }" @click="goHome">
|
||||||
<img loading="lazy" alt="" src="@/assets/header/robot.png" :style="{ filter: $route.path === '/home' ? 'brightness(0) invert(1)' : 'None' }"/>
|
<img loading="lazy" alt="" src="@/assets/header/robot.png"
|
||||||
|
:style="{ filter: $route.path === '/home' ? 'brightness(0) invert(1)' : 'None' }" />
|
||||||
智能体管理
|
智能体管理
|
||||||
</div>
|
</div>
|
||||||
<div v-if="isSuperAdmin" class="equipment-management" :class="{ 'active-tab': $route.path === '/model-config' }" @click="goModelConfig">
|
<div v-if="isSuperAdmin" class="equipment-management" :class="{ 'active-tab': $route.path === '/model-config' }"
|
||||||
<img loading="lazy" alt="" src="@/assets/header/model_config.png" :style="{ filter: $route.path === '/model-config' ? 'brightness(0) invert(1)' : 'None' }"/>
|
@click="goModelConfig">
|
||||||
|
<img loading="lazy" alt="" src="@/assets/header/model_config.png"
|
||||||
|
:style="{ filter: $route.path === '/model-config' ? 'brightness(0) invert(1)' : 'None' }" />
|
||||||
模型配置
|
模型配置
|
||||||
</div>
|
</div>
|
||||||
<div v-if="isSuperAdmin" class="equipment-management" :class="{ 'active-tab': $route.path === '/user-management' }" @click="goUserManagement">
|
<div v-if="isSuperAdmin" class="equipment-management"
|
||||||
<img loading="lazy" alt="" src="@/assets/header/user_management.png" :style="{ filter: $route.path === '/user-management' ? 'brightness(0) invert(1)' : 'None' }"/>
|
:class="{ 'active-tab': $route.path === '/user-management' }" @click="goUserManagement">
|
||||||
|
<img loading="lazy" alt="" src="@/assets/header/user_management.png"
|
||||||
|
:style="{ filter: $route.path === '/user-management' ? 'brightness(0) invert(1)' : 'None' }" />
|
||||||
用户管理
|
用户管理
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -26,19 +31,15 @@
|
|||||||
<!-- 右侧元素 -->
|
<!-- 右侧元素 -->
|
||||||
<div class="header-right">
|
<div class="header-right">
|
||||||
<div class="search-container">
|
<div class="search-container">
|
||||||
<el-input
|
<el-input v-model="search" placeholder="输入名称搜索.." class="custom-search-input"
|
||||||
v-model="search"
|
@keyup.enter.native="handleSearch">
|
||||||
placeholder="输入名称搜索.."
|
|
||||||
class="custom-search-input"
|
|
||||||
@keyup.enter.native="handleSearch"
|
|
||||||
>
|
|
||||||
<i slot="suffix" class="el-icon-search search-icon" @click="handleSearch"></i>
|
<i slot="suffix" class="el-icon-search search-icon" @click="handleSearch"></i>
|
||||||
</el-input>
|
</el-input>
|
||||||
</div>
|
</div>
|
||||||
<img loading="lazy" alt="" src="@/assets/home/avatar.png" class="avatar-img"/>
|
<img loading="lazy" alt="" src="@/assets/home/avatar.png" class="avatar-img" />
|
||||||
<el-dropdown trigger="click" class="user-dropdown">
|
<el-dropdown trigger="click" class="user-dropdown">
|
||||||
<span class="el-dropdown-link">
|
<span class="el-dropdown-link">
|
||||||
{{ userInfo.username || '加载中...' }}<i class="el-icon-arrow-down el-icon--right"></i>
|
{{ userInfo.username || '加载中...' }}<i class="el-icon-arrow-down el-icon--right"></i>
|
||||||
</span>
|
</span>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<el-dropdown-item @click.native="showChangePasswordDialog">修改密码</el-dropdown-item>
|
<el-dropdown-item @click.native="showChangePasswordDialog">修改密码</el-dropdown-item>
|
||||||
@@ -49,7 +50,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 修改密码弹窗 -->
|
<!-- 修改密码弹窗 -->
|
||||||
<ChangePasswordDialog v-model="isChangePasswordDialogVisible"/>
|
<ChangePasswordDialog v-model="isChangePasswordDialogVisible" />
|
||||||
</el-header>
|
</el-header>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -97,7 +98,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 获取用户信息
|
// 获取用户信息
|
||||||
fetchUserInfo() {
|
fetchUserInfo() {
|
||||||
userApi.getUserInfo(({data}) => {
|
userApi.getUserInfo(({ data }) => {
|
||||||
this.userInfo = data.data
|
this.userInfo = data.data
|
||||||
if (data.data.superAdmin !== undefined) {
|
if (data.data.superAdmin !== undefined) {
|
||||||
this.$store.commit('setUserInfo', data.data);
|
this.$store.commit('setUserInfo', data.data);
|
||||||
@@ -138,14 +139,14 @@ export default {
|
|||||||
// 调用 Vuex 的 logout action
|
// 调用 Vuex 的 logout action
|
||||||
await this.logout();
|
await this.logout();
|
||||||
this.$message.success({
|
this.$message.success({
|
||||||
message:'退出登录成功',
|
message: '退出登录成功',
|
||||||
showClose:true
|
showClose: true
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('退出登录失败:', error);
|
console.error('退出登录失败:', error);
|
||||||
this.$message.error({
|
this.$message.error({
|
||||||
message:'退出登录失败,请重试',
|
message: '退出登录失败,请重试',
|
||||||
showClose:true
|
showClose: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -161,7 +162,8 @@ export default {
|
|||||||
background: #f6fcfe66;
|
background: #f6fcfe66;
|
||||||
border: 1px solid #fff;
|
border: 1px solid #fff;
|
||||||
height: 53px !important;
|
height: 53px !important;
|
||||||
min-width: 900px; /* 设置最小宽度防止过度压缩 */
|
min-width: 900px;
|
||||||
|
/* 设置最小宽度防止过度压缩 */
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,7 +224,8 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
flex-shrink: 0; /* 防止导航按钮被压缩 */
|
flex-shrink: 0;
|
||||||
|
/* 防止导航按钮被压缩 */
|
||||||
}
|
}
|
||||||
|
|
||||||
.equipment-management.active-tab {
|
.equipment-management.active-tab {
|
||||||
@@ -242,10 +245,10 @@ export default {
|
|||||||
max-width: 220px;
|
max-width: 220px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.custom-search-input >>> .el-input__inner {
|
.custom-search-input>>>.el-input__inner {
|
||||||
height: 30px;
|
height: 30px;
|
||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
background-color: #e2e5f8;
|
background-color: #fff;
|
||||||
border: 1px solid #e4e6ef;
|
border: 1px solid #e4e6ef;
|
||||||
padding-left: 15px;
|
padding-left: 15px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
@@ -309,7 +312,7 @@ export default {
|
|||||||
max-width: 145px;
|
max-width: 145px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.custom-search-input >>> .el-input__inner {
|
.custom-search-input>>>.el-input__inner {
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,10 +94,6 @@ export default {
|
|||||||
this.deviceList[index].isEdit = false;
|
this.deviceList[index].isEdit = false;
|
||||||
},
|
},
|
||||||
handleUnbind(device_id) {
|
handleUnbind(device_id) {
|
||||||
if (!this.deviceApi) {
|
|
||||||
this.$message.error('功能模块加载失败');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.$confirm('确认要解绑该设备吗?', '警告', {
|
this.$confirm('确认要解绑该设备吗?', '警告', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
|
|||||||
@@ -101,7 +101,7 @@
|
|||||||
<div class="batch-actions">
|
<div class="batch-actions">
|
||||||
<el-button size="mini" @click="selectAll" style="width: 75px; background: #606ff3">{{ isAllSelected ?
|
<el-button size="mini" @click="selectAll" style="width: 75px; background: #606ff3">{{ isAllSelected ?
|
||||||
'取消全选' : '全选'
|
'取消全选' : '全选'
|
||||||
}}</el-button>
|
}}</el-button>
|
||||||
<el-button size="mini" type="danger" icon="el-icon-delete" @click="batchDelete">
|
<el-button size="mini" type="danger" icon="el-icon-delete" @click="batchDelete">
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -229,9 +229,8 @@ export default {
|
|||||||
}).then(() => {
|
}).then(() => {
|
||||||
const deletePromises = this.selectedModels.map(model =>
|
const deletePromises = this.selectedModels.map(model =>
|
||||||
new Promise(resolve => {
|
new Promise(resolve => {
|
||||||
|
// TODO: 删除获取model.id
|
||||||
Api.model.deleteModel(
|
Api.model.deleteModel(
|
||||||
this.activeTab,
|
|
||||||
model.configJson?.provider || '',
|
|
||||||
model.id,
|
model.id,
|
||||||
({ data }) => resolve(data.code === 0)
|
({ data }) => resolve(data.code === 0)
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user