|
@@ -88,7 +88,7 @@
|
|
}
|
|
}
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
name: 'Catalog',
|
|
name: 'Catalog',
|
|
- components: { BasicTree, Icon, BasicUpload, Tree },
|
|
|
|
|
|
+ components: { Icon, BasicUpload, Tree },
|
|
setup() {
|
|
setup() {
|
|
const treeData = ref<TreeResultModel[]>([])
|
|
const treeData = ref<TreeResultModel[]>([])
|
|
const row = ref<ATreeRow>({
|
|
const row = ref<ATreeRow>({
|
|
@@ -107,7 +107,7 @@
|
|
const detail = ref({ name: '', content: '', filepath: '', filename: '', ext: '', fid: '' })
|
|
const detail = ref({ name: '', content: '', filepath: '', filename: '', ext: '', fid: '' })
|
|
async function initData() {
|
|
async function initData() {
|
|
const result = await sectionAllApi()
|
|
const result = await sectionAllApi()
|
|
- treeData.value = result.children
|
|
|
|
|
|
+ treeData.value = result.children || []
|
|
}
|
|
}
|
|
|
|
|
|
async function initSectionDetail(id: string) {
|
|
async function initSectionDetail(id: string) {
|
|
@@ -129,7 +129,7 @@
|
|
const replaceFields = { children: 'children', title: 'name', key: 'id' }
|
|
const replaceFields = { children: 'children', title: 'name', key: 'id' }
|
|
|
|
|
|
const onSelect = (selectedKeys: Event, { selectedNodes }) => {
|
|
const onSelect = (selectedKeys: Event, { selectedNodes }) => {
|
|
- if (selectedKeys!.length) {
|
|
|
|
|
|
+ if (selectedKeys && selectedNodes && selectedKeys!.length) {
|
|
const {
|
|
const {
|
|
id,
|
|
id,
|
|
parentId,
|
|
parentId,
|