Commit 0131f489 by 林家欣

fix: 修改禅道部分bug

parent 4872649a
...@@ -125,21 +125,27 @@ export default { ...@@ -125,21 +125,27 @@ export default {
window.removeEventListener("click", this.handleWindowClick); window.removeEventListener("click", this.handleWindowClick);
}, },
methods: { methods: {
comparePath(nav, path) { comparePath(arr, activePath) {
let result = null; let current = [];
nav.forEach((item) => { const deep = (arr, activePath) => {
if (item.link === path) { for (let i = 0; i < arr.length; i += 1) {
result = item; if (
arr[i].link !== activePath &&
arr[i].children &&
arr[i].children.length > 0
) {
deep(arr[i].children, activePath);
} else if (arr[i].link === activePath) {
current = arr[i];
break;
}
if (current.length > 0) {
break;
} }
if (item.children && item.children.length > 0) {
item.children.forEach((item_) => {
if (item_.link === path) {
result = item_;
} }
}); };
} deep(arr, activePath);
}); return current;
return result;
}, },
handleWindowClick() { handleWindowClick() {
// console.log('handleWindowClick', this.fromNav, this.preActive); // console.log('handleWindowClick', this.fromNav, this.preActive);
......
...@@ -207,61 +207,61 @@ export const nav = [ ...@@ -207,61 +207,61 @@ export const nav = [
{ name: "操作指南" }, { name: "操作指南" },
], ],
}, },
// { {
// id: uuid("gs_nav"), id: uuid("gs_nav"),
// name: "我要申请商品条码", name: "我要申请商品条码",
// index: 2, index: 2,
// link: "/Business/Guide1", link: "/Business/Guide1",
// breadcrumb: [ breadcrumb: [
// { name: "业务大厅", path: "/Business" }, { name: "业务大厅", path: "/Business" },
// { name: "操作指南", path: "/Business/Guide" }, { name: "操作指南", path: "/Business/Guide" },
// { name: "我要申请商品条码" }, { name: "我要申请商品条码" },
// ], ],
// }, },
// { {
// id: uuid("gs_nav"), id: uuid("gs_nav"),
// name: "我要编码", name: "我要编码",
// index: 2, index: 2,
// link: "/Business/Guide2", link: "/Business/Guide2",
// breadcrumb: [ breadcrumb: [
// { name: "业务大厅", path: "/Business" }, { name: "业务大厅", path: "/Business" },
// { name: "操作指南", path: "/Business/Guide" }, { name: "操作指南", path: "/Business/Guide" },
// { name: "我要编码" }, { name: "我要编码" },
// ], ],
// }, },
// { {
// id: uuid("gs_nav"), id: uuid("gs_nav"),
// name: "微信共享", name: "微信共享",
// index: 2, index: 2,
// link: "/Business/Guide4", link: "/Business/Guide4",
// breadcrumb: [ breadcrumb: [
// { name: "业务大厅", path: "/Business" }, { name: "业务大厅", path: "/Business" },
// { name: "操作指南", path: "/Business/Guide" }, { name: "操作指南", path: "/Business/Guide" },
// { name: "微信共享" }, { name: "微信共享" },
// ], ],
// }, },
// { {
// id: uuid("gs_nav"), id: uuid("gs_nav"),
// name: "我要咨询", name: "我要咨询",
// index: 2, index: 2,
// link: "/Business/Guide7", link: "/Business/Guide7",
// breadcrumb: [ breadcrumb: [
// { name: "业务大厅", path: "/Business" }, { name: "业务大厅", path: "/Business" },
// { name: "操作指南", path: "/Business/Guide" }, { name: "操作指南", path: "/Business/Guide" },
// { name: "我要咨询" }, { name: "我要咨询" },
// ], ],
// }, },
// { {
// id: uuid("gs_nav"), id: uuid("gs_nav"),
// name: "常见问题", name: "常见问题",
// index: 2, index: 2,
// link: "/Business/Guide8", link: "/Business/Guide8",
// breadcrumb: [ breadcrumb: [
// { name: "业务大厅", path: "/Business" }, { name: "业务大厅", path: "/Business" },
// { name: "操作指南", path: "/Business/Guide" }, { name: "操作指南", path: "/Business/Guide" },
// { name: "常见问题" }, { name: "常见问题" },
// ], ],
// }, },
{ {
id: uuid("gs_nav"), id: uuid("gs_nav"),
name: "收费公示", name: "收费公示",
...@@ -382,7 +382,7 @@ export const nav = [ ...@@ -382,7 +382,7 @@ export const nav = [
breadcrumb: [ breadcrumb: [
{ name: "业务大厅", path: "/Business" }, { name: "业务大厅", path: "/Business" },
{ name: "我是系统成员", path: "/Business/Register" }, { name: "我是系统成员", path: "/Business/Register" },
{ name: "我要编码", path: "/Business/Code1?id=1-1" }, // { name: "我要编码", path: "/Business/Code1?id=1-1" },
{ name: "零售商品" }, { name: "零售商品" },
], ],
}, },
...@@ -394,7 +394,7 @@ export const nav = [ ...@@ -394,7 +394,7 @@ export const nav = [
breadcrumb: [ breadcrumb: [
{ name: "业务大厅", path: "/Business" }, { name: "业务大厅", path: "/Business" },
{ name: "我是系统成员", path: "/Business/Register" }, { name: "我是系统成员", path: "/Business/Register" },
{ name: "我要编码", path: "/Business/Code1?id=1-1" }, // { name: "我要编码", path: "/Business/Code1?id=1-1" },
{ name: "非零售商品" }, { name: "非零售商品" },
], ],
}, },
...@@ -406,7 +406,7 @@ export const nav = [ ...@@ -406,7 +406,7 @@ export const nav = [
breadcrumb: [ breadcrumb: [
{ name: "业务大厅", path: "/Business" }, { name: "业务大厅", path: "/Business" },
{ name: "我是系统成员", path: "/Business/Register" }, { name: "我是系统成员", path: "/Business/Register" },
{ name: "我要编码", path: "/Business/Code1?id=1-1" }, // { name: "我要编码", path: "/Business/Code1?id=1-1" },
{ name: "物流单元" }, { name: "物流单元" },
], ],
}, },
...@@ -525,6 +525,50 @@ export const nav = [ ...@@ -525,6 +525,50 @@ export const nav = [
{ name: "全球参与方位置代码(GLN)业务办理" }, { name: "全球参与方位置代码(GLN)业务办理" },
], ],
}, },
{
id: uuid("gs_nav"),
name: "办理产品电子代码(EPC)",
index: 2,
link: "/Business/cpdzdm",
breadcrumb: [
{ name: "业务大厅", path: "/Business" },
{ name: "办理其他业务", path: "/Business/GLN" },
{ name: "办理产品电子代码(EPC)" },
],
},
{
id: uuid("gs_nav"),
name: "办理资产标识代码",
index: 2,
link: "/Business/GIAI",
breadcrumb: [
{ name: "业务大厅", path: "/Business" },
{ name: "办理其他业务", path: "/Business/GLN" },
{ name: "办理资产标识代码" },
],
},
{
id: uuid("gs_nav"),
name: "办理全球服务关系代码",
index: 2,
link: "/Business/GSRN",
breadcrumb: [
{ name: "业务大厅", path: "/Business" },
{ name: "办理其他业务", path: "/Business/GSRN" },
{ name: "办理全球服务关系代码" },
],
},
{
id: uuid("gs_nav"),
name: "办理动物管理者代码",
index: 2,
link: "/Business/Animalcode",
breadcrumb: [
{ name: "业务大厅", path: "/Business" },
{ name: "办理其他业务", path: "/Business/Animalcode" },
{ name: "办理动物管理者代码" },
],
},
], ],
} }
], ],
......
...@@ -58,3 +58,32 @@ export const getUUID = () => { ...@@ -58,3 +58,32 @@ export const getUUID = () => {
return (c === 'x' ? (Math.random() * 16 | 0) : ('r&0x3' | '0x8')).toString(16) return (c === 'x' ? (Math.random() * 16 | 0) : ('r&0x3' | '0x8')).toString(16)
}) })
} }
/**
* 获取面包屑
*/
export const deepFindBreadcrumb = (menuList, activePath) => {
let current = [];
const deep = (arr, activePath) => {
for (let i = 0; i < arr.length; i += 1) {
if (
arr[i].link !== activePath &&
arr[i].children &&
arr[i].children.length > 0
) {
deep(arr[i].children, activePath);
} else if (arr[i].link === activePath) {
current = arr[i];
break;
}
if (current.length > 0) {
break;
}
}
};
if (activePath) {
deep(menuList, activePath);
}
return current;
};
\ No newline at end of file
...@@ -115,7 +115,7 @@ export default { ...@@ -115,7 +115,7 @@ export default {
data() { data() {
return { return {
flsspCate: { flsspCate: {
name: "非零售商品", name: "物流单元",
ico: "", ico: "",
}, },
}; };
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<div class="msg-title" ref="1-2">条码注册方式:</div> <div class="msg-title" ref="1-2">条码注册方式:</div>
<p> <p>
线上办理:登录中国物品编码中心官网,点击“我要申请商品条码”,手机号绑定成功后,按流程操作即可。<a 线上办理:登录中国物品编码中心官网,点击“我要申请商品条码”,手机号绑定成功后,按流程操作即可。<a
href="/manage/down/2021zcbl.pdf" href="http://www.gs1cn.org/manage/down/2021zcbl.pdf"
target="_blank" target="_blank"
style="color: Red" style="color: Red"
>查看操作指南</a >查看操作指南</a
......
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
" "
> >
线上办理:登录中国商品信息服务平台,从“应用市场—条码商桥”处下单,即时支付即时下载。<a 线上办理:登录中国商品信息服务平台,从“应用市场—条码商桥”处下单,即时支付即时下载。<a
href="/manage/down/2021jpdz.pdf" href="http://www.gs1cn.org/manage/down/2021jpdz.pdf"
target="_blank" target="_blank"
style="color: Red" style="color: Red"
>查看操作指南</a >查看操作指南</a
......
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
/> />
</div> </div>
<p> <p>
查看<a href="/Service/Training.aspx" target="_blank" 查看<a href="/Service/Training" target="_blank"
>全国分支机构培训计划</a >全国分支机构培训计划</a
>,选择适合方式、场次参加培训。 >,选择适合方式、场次参加培训。
</p> </p>
......
...@@ -49,6 +49,7 @@ import cate from "../comps/cate.vue"; ...@@ -49,6 +49,7 @@ import cate from "../comps/cate.vue";
import pages from "../comps/pages.vue"; import pages from "../comps/pages.vue";
import list from "./copms/list.vue"; import list from "./copms/list.vue";
import { nav } from "@/components/layout/header/mock"; import { nav } from "@/components/layout/header/mock";
import { deepFindBreadcrumb } from "@/utils/utils";
export default { export default {
components: { components: {
...@@ -154,31 +155,9 @@ export default { ...@@ -154,31 +155,9 @@ export default {
code: obj.code, code: obj.code,
}, },
}); });
const result = this.deepFindBreadcrumb(nav, '/Business/Msg'); const result = deepFindBreadcrumb(nav, '/Business/Msg');
this.$store.commit("system/SET_BREADCRUMB", result.breadcrumb); this.$store.commit("system/SET_BREADCRUMB", result.breadcrumb);
}, },
deepFindBreadcrumb(menuList, activePath) {
let current = [];
const deep = (arr, activePath) => {
for (let i = 0; i < arr.length; i += 1) {
if (
arr[i].link !== activePath &&
arr[i].children &&
arr[i].children.length > 0
) {
deep(arr[i].children, activePath);
} else if (arr[i].link === activePath) {
current = arr[i];
break;
}
if (current.length > 0) {
break;
}
}
};
deep(menuList, activePath);
return current;
},
jump(i) { jump(i) {
// console.log(i); // console.log(i);
this.setLogoutFlag(this.list[i].active); this.setLogoutFlag(this.list[i].active);
......
...@@ -96,6 +96,8 @@ ...@@ -96,6 +96,8 @@
<script> <script>
import cate from "../comps/cate.vue"; import cate from "../comps/cate.vue";
import fzzx from "./copms/fzzx.vue"; import fzzx from "./copms/fzzx.vue";
import { nav } from "@/components/layout/header/mock";
import { deepFindBreadcrumb } from "@/utils/utils";
export default { export default {
components: { components: {
...@@ -288,9 +290,12 @@ export default { ...@@ -288,9 +290,12 @@ export default {
this.updateKey = new Date().getTime(); this.updateKey = new Date().getTime();
}, },
jump() { jump() {
this.$router.push({ // this.$router.push({
path: "/Org/Branch", // path: "/Org/Branch",
}); // });
window.open('/Org/Branch', '_self');
const result = deepFindBreadcrumb(nav, '/Org/Branch');
this.$store.commit("system/SET_BREADCRUMB", result.breadcrumb);
}, },
}, },
}; };
......
...@@ -46,8 +46,9 @@ export default { ...@@ -46,8 +46,9 @@ export default {
children: [ children: [
{ {
name: "我要申请商品条码", name: "我要申请商品条码",
path: "", path: "/Business/Guide1",
active: "", active: "",
id: "",
children: [ children: [
{ {
name: "1.企业申请商品条码资格", name: "1.企业申请商品条码资格",
...@@ -297,62 +298,62 @@ export default { ...@@ -297,62 +298,62 @@ export default {
}, },
], ],
}, },
// { {
// name: "常见问题", name: "常见问题",
// path: "", path: "",
// active: "", active: "",
// children: [ children: [
// { {
// name: "1.业务办理", name: "1.业务办理",
// path: "/Business/Guide8", path: "/Business/Guide8",
// active: "", active: "",
// id: "ywbl", id: "ywbl",
// noneChild: true, noneChild: true,
// }, },
// { {
// name: "2.产品信息通报", name: "2.产品信息通报",
// path: "/Business/Guide8", path: "/Business/Guide8",
// active: "", active: "",
// id: "cpxxtb", id: "cpxxtb",
// noneChild: true, noneChild: true,
// }, },
// { {
// name: "3.编码技术", name: "3.编码技术",
// path: "/Business/Guide8", path: "/Business/Guide8",
// active: "", active: "",
// id: "bmjs", id: "bmjs",
// noneChild: true, noneChild: true,
// }, },
// { {
// name: "4.法规与标准", name: "4.法规与标准",
// path: "/Business/Guide8", path: "/Business/Guide8",
// active: "", active: "",
// id: "fgybz", id: "fgybz",
// noneChild: true, noneChild: true,
// }, },
// { {
// name: "5.条码质量", name: "5.条码质量",
// path: "/Business/Guide8", path: "/Business/Guide8",
// active: "", active: "",
// id: "tmzl", id: "tmzl",
// noneChild: true, noneChild: true,
// }, },
// { {
// name: "6.条码技术应用", name: "6.条码技术应用",
// path: "/Business/Guide8", path: "/Business/Guide8",
// active: "", active: "",
// id: "tmjsyy", id: "tmjsyy",
// noneChild: true, noneChild: true,
// }, },
// { {
// name: "7.其他", name: "7.其他",
// path: "/Business/Guide8", path: "/Business/Guide8",
// active: "", active: "",
// id: "other", id: "other",
// noneChild: true, noneChild: true,
// }, },
// ], ],
// }, },
], ],
}, },
{ {
...@@ -447,8 +448,9 @@ export default { ...@@ -447,8 +448,9 @@ export default {
{ {
name: "我要编码", name: "我要编码",
path: "/Business/Code", path: "/Business/Code",
redirectUrl: '/Business/Code1',
active: "", active: "",
id: "1-1", id: "",
children: [ children: [
{ {
name: "零售商品", name: "零售商品",
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
</template> </template>
<script> <script>
import { nav } from "@/components/layout/header/mock"; import { nav } from "@/components/layout/header/mock";
import { deepFindBreadcrumb } from "@/utils/utils";
export default { export default {
props: ["list", "currentRoute"], props: ["list", "currentRoute"],
...@@ -37,7 +38,7 @@ export default { ...@@ -37,7 +38,7 @@ export default {
if (type === "link") { if (type === "link") {
window.open(el.path, "_blank"); window.open(el.path, "_blank");
} else { } else {
const result = this.deepFindBreadcrumb(nav, el.path); const result = deepFindBreadcrumb(nav, el.path);
console.log(result, "result"); console.log(result, "result");
if (result && result.breadcrumb) { if (result && result.breadcrumb) {
this.$store.commit("system/SET_BREADCRUMB", result.breadcrumb); this.$store.commit("system/SET_BREADCRUMB", result.breadcrumb);
...@@ -47,28 +48,6 @@ export default { ...@@ -47,28 +48,6 @@ export default {
}); });
} }
}, },
deepFindBreadcrumb(menuList, activePath) {
let current = [];
const deep = (arr, activePath) => {
for (let i = 0; i < arr.length; i += 1) {
if (
arr[i].link !== activePath &&
arr[i].children &&
arr[i].children.length > 0
) {
deep(arr[i].children, activePath);
} else if (arr[i].link === activePath) {
current = arr[i];
break;
}
if (current.length > 0) {
break;
}
}
};
deep(menuList, activePath);
return current;
},
}, },
}; };
</script> </script>
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
</template> </template>
<script> <script>
import { nav } from "@/components/layout/header/mock"; import { nav } from "@/components/layout/header/mock";
import { deepFindBreadcrumb } from "@/utils/utils";
export default { export default {
props: ["list"], props: ["list"],
...@@ -69,7 +70,9 @@ export default { ...@@ -69,7 +70,9 @@ export default {
}, },
}, },
created() { created() {
// console.log(this.$route.query.id, "获取当前路由地址"); console.log(this.list, "获取当前路由地址");
let result = deepFindBreadcrumb(nav, '');
console.log(result, 'resultresultresult2');
}, },
methods: { methods: {
// 路由跳转 // 路由跳转
...@@ -79,9 +82,12 @@ export default { ...@@ -79,9 +82,12 @@ export default {
if (type === "link") { if (type === "link") {
window.open(el.path, "_blank"); window.open(el.path, "_blank");
} else { } else {
const result = this.deepFindBreadcrumb(nav, el.path); let result = deepFindBreadcrumb(nav, el.path);
console.log(result, "result"); console.log(result, "result");
if (result && result.breadcrumb) { if (result) {
if (result.length === 0) {
result = deepFindBreadcrumb(nav, el.redirectUrl);
}
this.$store.commit("system/SET_BREADCRUMB", result.breadcrumb); this.$store.commit("system/SET_BREADCRUMB", result.breadcrumb);
} }
if (el.id) { if (el.id) {
...@@ -105,28 +111,6 @@ export default { ...@@ -105,28 +111,6 @@ export default {
} }
} }
}, },
deepFindBreadcrumb(menuList, activePath) {
let current = [];
const deep = (arr, activePath) => {
for (let i = 0; i < arr.length; i += 1) {
if (
arr[i].link !== activePath &&
arr[i].children &&
arr[i].children.length > 0
) {
deep(arr[i].children, activePath);
} else if (arr[i].link === activePath) {
current = arr[i];
break;
}
if (current.length > 0) {
break;
}
}
};
deep(menuList, activePath);
return current;
},
handleOpen(key, keyPath) { handleOpen(key, keyPath) {
console.log(key, keyPath); console.log(key, keyPath);
}, },
......
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