Skip to content

Commit

Permalink
bug
Browse files Browse the repository at this point in the history
  • Loading branch information
star7th committed Oct 17, 2024
1 parent 898d802 commit e5b8c4f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
'../server/index.php?s=',
// "lang" :'en'
lang: 'zh-cn'
}</script><link href="./static/css/app.7c659cf3ab25f6f9ec98250e52eaaa7b.css" rel="stylesheet"></head><body class="grey-bg"><div id="app"></div><script type="text/javascript" src="./static/js/manifest.3ad1d5771e9b13dbdad2.js"></script><script type="text/javascript" src="./static/js/vendor.3bfa74dba21c6c83e952.js"></script><script type="text/javascript" src="./static/js/app.037fe75a03da659c82e6.js"></script></body></html>
}</script><link href="./static/css/app.d50f10894220231e6b95af303d756986.css" rel="stylesheet"></head><body class="grey-bg"><div id="app"></div><script type="text/javascript" src="./static/js/manifest.3ad1d5771e9b13dbdad2.js"></script><script type="text/javascript" src="./static/js/vendor.3bfa74dba21c6c83e952.js"></script><script type="text/javascript" src="./static/js/app.aed469ee2200b9159c9b.js"></script></body></html>

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ export default {
const pushTreeData = (OneData, parent_cat_id, level, i) => {
treeData2.push({
cat_id: OneData.id || 0,
cat_id: OneData.cat_id || 0,
cat_name: OneData.title || '',
page_id: OneData.page_id || 0,
parent_cat_id: parent_cat_id || 0,
Expand Down Expand Up @@ -408,7 +408,7 @@ export default {
selectMenu(page_id) {
this.changeUrl(page_id)
this.getPageContent(page_id)
this.$refs.tree.setCurrentKey(parseInt(page_id))
this.$refs.tree.setCurrentKey(`page_${page_id}`)
},
// 改变url.
changeUrl(page_id) {
Expand Down Expand Up @@ -468,7 +468,7 @@ export default {
this.openeds = openeds
// 延迟把左侧栏滚动到默认展开的那个页面,同时设置选中当前页面
setTimeout(() => {
const element = document.querySelector('#node-' + page_id)
const element = document.querySelector('#node-page_' + page_id)
element.scrollIntoView()
this.selectMenu(page_id)
}, 1000)
Expand Down
10 changes: 5 additions & 5 deletions web_src/src/models/itemTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const itemMenuDataToTreeData = menu => {
let type = 'page'
treeData.push({
title: value.page_title,
id: value.page_id,
id: `page_${value.page_id}`,
page_id: value.page_id,
page_cat_id: 0,
key: `page_${value.page_id}`,
Expand All @@ -26,7 +26,7 @@ const itemMenuDataToTreeData = menu => {
let oneCat = {
children: [],
title: catData[index].cat_name,
id: catData[index].cat_id,
id: `cat_${catData[index].cat_id}`,
cat_id: catData[index].cat_id,
parent_cat_id: parent_cat_id,
key: `cat_${catData[index].cat_id}`,
Expand All @@ -40,7 +40,7 @@ const itemMenuDataToTreeData = menu => {
let type = 'page'
oneCat.children.push({
title: catData[index].pages[k].page_title,
id: catData[index].pages[k].page_id,
id: `page_${catData[index].pages[k].page_id}`,
page_id: catData[index].pages[k].page_id,
page_cat_id: catData[index].pages[k].cat_id,
key: `page_${catData[index].pages[k].page_id}`,
Expand Down Expand Up @@ -74,13 +74,13 @@ const itemMenuDataToTreeData = menu => {
const getParentIds = (tree, pageId) => {
for (let i = 0; i < tree.length; i++) {
const node = tree[i]
if (node.id == pageId) {
if (node.page_id && node.page_id == pageId) {
return []
}
if (node.children && node.children.length > 0) {
const parentIds = getParentIds(node.children, pageId)
if (parentIds !== null) {
parentIds.push(node.id)
parentIds.push(`cat_${node.cat_id}`)
return parentIds
}
}
Expand Down

0 comments on commit e5b8c4f

Please sign in to comment.