Commit 0131f489 by 林家欣

fix: 修改禅道部分bug

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