Commit e5118c88 by zhaopanyu

zpy

parent 9948b7e4
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
@click.native="handleInnerClick(innerItem.name, content.mc, content.id, content.remark)" @click.native="handleInnerClick(innerItem.name, content.mc, content.id, content.remark)"
:class="{ 'menu-item-active': activeNameInner === innerItem.name + '-' + content.mc }"> :class="{ 'menu-item-active': activeNameInner === innerItem.name + '-' + content.mc }">
<img v-if="content.zx === '1'" src="../../assets/images/new.png" alt="new" <img v-if="content.zx === '1'" src="../../assets/images/new.png" alt="new"
style="width: 28px; height: 28px; margin-left: -30px; vertical-align: middle;" /> style="width: 20px; height: 20px; margin-left: -20px; vertical-align: middle;" />
<span <span
:style="{ width: '6px', height: '6px', background: '#165BFF', borderRadius: '50%', display: 'inline-block', marginRight: '10px' }"></span> :style="{ width: '6px', height: '6px', background: '#165BFF', borderRadius: '50%', display: 'inline-block', marginRight: '10px' }"></span>
<span :style="{ <span :style="{
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
@click.native="handleServiceClick(outerItem.mc, service.mc, service.id, service.remark)" @click.native="handleServiceClick(outerItem.mc, service.mc, service.id, service.remark)"
:class="{ 'menu-item-active': activeNameInner === outerItem.mc + '-' + service.mc, 'service-menu-item-active': activeNameInner === outerItem.mc + '-' + service.mc }"> :class="{ 'menu-item-active': activeNameInner === outerItem.mc + '-' + service.mc, 'service-menu-item-active': activeNameInner === outerItem.mc + '-' + service.mc }">
<img v-if="service.zx === '1'" src="../../assets/images/new.png" alt="new" <img v-if="service.zx === '1'" src="../../assets/images/new.png" alt="new"
style="width: 28px; height: 28px; margin-left: -30px; vertical-align: middle;" /> style="width: 20px; height: 20px; margin-left: -20px; vertical-align: middle;" />
<span <span
:style="{ width: '6px', height: '6px', background: '#165BFF', borderRadius: '50%', display: 'inline-block', marginRight: '10px' }"></span> :style="{ width: '6px', height: '6px', background: '#165BFF', borderRadius: '50%', display: 'inline-block', marginRight: '10px' }"></span>
<span :style="{ <span :style="{
...@@ -218,35 +218,6 @@ export default { ...@@ -218,35 +218,6 @@ export default {
}; };
}, },
watch: {
// activeNameOuter(newValue) {
// console.log(newValue, 'newValue');
// if (newValue === '服务类') {
// const selectedItem = this.collapseDataOuter.find(item => item.mc === '智能化服务类');
// if (selectedItem && selectedItem.fwlChildren.length > 0) {
// const firstService = selectedItem.fwlChildren[0];
// this.activeNameInner = `智能化服务类-${firstService.mc}`;
// console.log(this.activeNameInner, ' this.activeNameInner');
// this.activeServiceId = firstService.id; // 设置 activeServiceId 为第一项的 ID
// console.log(this.activeServiceId, 'Selected Service ID');
// this.getListdt(this.activeServiceId);
// }
// } else if (newValue === '产品') {
// const selectedItem = this.collapseDataOuter.find(item => item.mc === '软硬件产品');
// if (selectedItem && selectedItem.cpChildren && selectedItem.cpChildren.length > 0) {
// const firstProduct = selectedItem.cpChildren[0]; // 从 cpChildren 中获取第一个产品
// if (firstProduct.children2 && firstProduct.children2.length > 0) {
// const firstProductChild = firstProduct.children2[0]; // 从 children2 中获取第一个子产品
// this.activeNameInner = `软硬件产品-${firstProductChild.mc}`;
// console.log(this.activeNameInner, 'this.activeNameInner');
// this.activeServiceId = firstProductChild.id; // 设置 activeServiceId 为第一项的 ID
// console.log(this.activeServiceId, 'Selected Product ID');
// this.getListdt(this.activeServiceId);
// }
// }
// }
// }
},
mounted() { mounted() {
this.getList(); this.getList();
}, },
...@@ -286,24 +257,24 @@ export default { ...@@ -286,24 +257,24 @@ export default {
const firstInnerItem = this.collapseDataOuter.find(item => item.cplx === cplx); const firstInnerItem = this.collapseDataOuter.find(item => item.cplx === cplx);
console.log(firstInnerItem, 'firstInnerItem'); console.log(firstInnerItem, 'firstInnerItem');
if (firstInnerItem) { // if (firstInnerItem) {
// 仅在第一次点击外层菜单时设置默认值 // // 仅在第一次点击外层菜单时设置默认值
if (!this.isOuterMenuClicked) { // if (!this.isOuterMenuClicked) {
this.isOuterMenuClicked = true; // 设置状态为已点击外层菜单 // this.isOuterMenuClicked = true; // 设置状态为已点击外层菜单
// 如果是产品,选择第三级菜单的第一项 // // 如果是产品,选择第三级菜单的第一项
if (cplx === '产品' && firstInnerItem.cpChildren.length > 0) { // if (cplx === '产品' && firstInnerItem.cpChildren.length > 0) {
const firstInner = firstInnerItem.cpChildren[0]; // const firstInner = firstInnerItem.cpChildren[0];
this.activeNameInner = `${firstInner.name}-${firstInner.children2[0]?.mc || ''}`; // 设置第三级菜单的第一项 // this.activeNameInner = `${firstInner.name}-${firstInner.children2[0]?.mc || ''}`; // 设置第三级菜单的第一项
this.setActiveInner(firstInner.name, firstInner.children2[0]?.mc, firstInner.children2[0]?.id); // 设置内容 // this.setActiveInner(firstInner.name, firstInner.children2[0]?.mc, firstInner.children2[0]?.id); // 设置内容
} // }
// 如果是服务类,选择第二级菜单的第一项 // // 如果是服务类,选择第二级菜单的第一项
else if (cplx === '服务类' && firstInnerItem.fwlChildren.length > 0) { // else if (cplx === '服务类' && firstInnerItem.fwlChildren.length > 0) {
const firstService = firstInnerItem.fwlChildren[0]; // const firstService = firstInnerItem.fwlChildren[0];
this.activeNameInner = `${firstInnerItem.mc}-${firstService.mc}`; // 设置第二级菜单的第一项 // this.activeNameInner = `${firstInnerItem.mc}-${firstService.mc}`; // 设置第二级菜单的第一项
this.handleServiceClick(firstInnerItem.mc, firstService.mc, firstService.id); // 设置内容 // this.handleServiceClick(firstInnerItem.mc, firstService.mc, firstService.id); // 设置内容
} // }
} // }
} // }
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment