refactor(api): 更新知识库相关 API 路径并优化 cascader 组件属性设置

-将知识库列表和更新 API路径从 '/datasets/' 更改为 '/datasetsEx/'
- 修复 cascader 组件中 multiple 属性的设置方式,使用 $set 方法以确保响应式更新
This commit is contained in:
陈昱达
2025-04-30 17:14:11 +08:00
parent 31f92e5e0e
commit fa803bfd73
2 changed files with 5 additions and 4 deletions

View File

@@ -4,7 +4,7 @@ import getUrl from '@/assets/js/utils/get-url'
// 获取知识库列表 // 获取知识库列表
export function docManageDataset(data) { export function docManageDataset(data) {
return request({ return request({
url: getUrl('/datasets/list'), url: getUrl('/datasetsEx/list'),
method: 'post', method: 'post',
data data
}) })
@@ -20,7 +20,7 @@ export function getDatasetById(params) {
// 知识库内容修改 // 知识库内容修改
export function datasetUpdate(data) { export function datasetUpdate(data) {
return request({ return request({
url: getUrl('/datasets/update'), url: getUrl('/datasetsEx/update'),
method: 'post', method: 'post',
data data
}) })

View File

@@ -126,11 +126,12 @@ export default {
if (node.level === 1) { if (node.level === 1) {
if (data.id === 0 || data.id === 1) { if (data.id === 0 || data.id === 1) {
this.cascaderProps.multiple = false // this.cascaderProps.multiple = false
this.$set(this.cascaderProps, 'multiple', false)
this.values = [data.id] this.values = [data.id]
} else { } else {
this.values = [] this.values = []
this.cascaderProps.multiple = true this.$set(this.cascaderProps, 'multiple', true)
if (this.values.length === 0) { if (this.values.length === 0) {
this.values.push([2, userInfo.id]) this.values.push([2, userInfo.id])
} }