提交 7595404b authored 作者: matian's avatar matian

bug fixes:修改类别管理拖拽不显示问题

上级 a0a60373
...@@ -98,6 +98,7 @@ const listOptions = computed(() => { ...@@ -98,6 +98,7 @@ const listOptions = computed(() => {
httpRequest: getCategoryList, httpRequest: getCategoryList,
params: { type: 'tree', category_name: '' }, params: { type: 'tree', category_name: '' },
callback(data: ICategory[], params: any) { callback(data: ICategory[], params: any) {
console.log(data, '1111', params)
const list = rebuildData(params.category_name, data) const list = rebuildData(params.category_name, data)
tableData = list tableData = list
tableDataList = flatten(list) tableDataList = flatten(list)
...@@ -174,6 +175,9 @@ function onExpandChange(row: ICategory, expanded: boolean) { ...@@ -174,6 +175,9 @@ function onExpandChange(row: ICategory, expanded: boolean) {
// 重点代码 根据name字段模糊匹配树状结构数据,最后将处理好的数据返回出来 // 重点代码 根据name字段模糊匹配树状结构数据,最后将处理好的数据返回出来
const rebuildData = (value: any, arr: any) => { const rebuildData = (value: any, arr: any) => {
if (value === '' || value === undefined) {
return arr
}
if (!arr) { if (!arr) {
return [] return []
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论