Commit b444e586 by liwenjin

Merge branch 'master' of https://gitee.com/gs1-office-web-sit/gs1

parents f684608c d220f926
......@@ -58,6 +58,14 @@ const tycpdmfirmupdateSystem = (params = {}) => {
const tycpdmfirmReturnFile = (params = {}) => {
return `${hostUrl}/office/tycpdmfirm/api/returnFile?status=${params.status}&fileType=${params.fileType}&id=${params.id}`
}
// 个人中心首页 业务大厅页面跳转
const redirectYWDT = (params = {}) => {
return POST(`${Prefix}/office/tycpdmfirm/authApi/redirectBusinessHall`, params)
}
// 个人中心首页 GDS页面跳转
const redirectGDS = (params = {}) => {
return POST(`${Prefix}/office/tycpdmfirm/authApi/redirectGDS`, params)
}
// 个人中心首页 LGN页面跳转
const redirectGLN = () => {
return POST(`${Prefix}/office/tycpdmfirm/authApi/redirectGLN`)
......@@ -92,6 +100,8 @@ export default {
tycpdmfirmChangeAuditList,
tycpdmfirmupdateSystem,
tycpdmfirmReturnFile,
redirectYWDT,
redirectGDS,
redirectGLN,
updateTycpdmFirmInfo,
tycpdmFirmInfoNoAuth,
......
......@@ -114,6 +114,27 @@ const relatedLinks = (params = {}) => {
const getSearchInfo = (params = {}) => {
return POST(`${Prefix}/office/news/api/getSearchInfo`, params);
}
// 综合报道
const zhbdList = (params = {}) => {
return POST(`${Prefix}/office/news/api/zhbdList`, params);
}
// 标准科研
const bzkydtList = (params = {}) => {
return POST(`${Prefix}/office/news/api/bzkydtList`, params);
}
// 深度资讯
const sdztList = (params = {}) => {
return POST(`${Prefix}/office/news/api/sdztList`, params);
}
// 精彩视频
const jcspList = (params = {}) => {
return POST(`${Prefix}/office/news/api/jcspList`, params);
}
//精彩视频详情
const jcspiInfo = (params = {}) => {
return GET(`${Prefix}/office/news/api/jcspiInfo/${params.id}`)
}
export default {
......@@ -141,5 +162,10 @@ export default {
dsxxjyTop8,
gzzdTop7,
centerTop6,
getSearchInfo
getSearchInfo,
zhbdList,
bzkydtList,
sdztList,
jcspList,
jcspiInfo
}
import {uuid} from "@/utils/utils";
export default {
id: "6",
name: "技术与标准",
......
......@@ -56,9 +56,9 @@ export default {
},
methods: {
toAdmin() {
if (this.user.userType === 3 && this.user.levels === null) {
if ((this.user.userType === 1 && this.user.isXT !== 1) || (this.user.userType === 2 && this.user.isXT !== 1) || (this.user.userType === 3 && this.user.levels === null)) {
this.$router.push({path: '/MyManage/UnVerify/index'})
} else if (this.user.userType === 2) {
} else if (this.user.isXT === 1) {
this.$router.push({path: '/MyManage/SystemMember/index'})
} else if (this.user.levels === 0) {
this.$router.push({path: '/MyManage/admin/check'})
......
......@@ -713,6 +713,14 @@ const routes = [{
component: () => import("@/views/News/msg.vue"),
},
{
path: "/News/msgVideo",
name: "msgVideo",
meta: {
name: "精彩视频详情",
},
component: () => import("@/views/News/msgVideo.vue"),
},
{
path: "/News/NoticeArticle",
name: "NoticeArticle",
meta: {
......
......@@ -100,7 +100,7 @@
<li><a :href="path+'/djwh/download/19thfile/党的十九大报告全文.docx'" target="_blank">党的十九大报告全文</a></li>
<li><a :href="path+'/djwh/download/19thfile/质检总局党组关于认真学习宣传贯彻党的十九大精神的通知.doc'" target="_blank">质检总局党组关于认真学习宣传贯彻党的十九大精神的通知</a></li>
<li><a :href="path+'/djwh/download/19thfile/质检总局党组关于印发质检系统学习宣传贯彻党的十九大精神工作方案的通知.doc'" target="_blank">质检总局党组关于印发质检系统学习宣传贯彻党的十九大精神工作方案的通知</a></li>
<li><a :href="path+'/djwh/download/19thfile/中共中央关于认真学习宣传贯彻党的十九大精神的决定.docx'" target="_blank">中共中央关于认真学习宣传贯彻党的十九大精神的决定</a></li>
<li><a :href="path+'/djwh/download/19thfile/中共中央关 于认真学习宣传贯彻党的十九大精神的决定.docx'" target="_blank">中共中央关于认真学习宣传贯彻党的十九大精神的决定</a></li>
<li><a :href="path+'/djwh/download/19thfile/中共中央宣传部关于印发《党的十九大精神宣讲提纲》的通知.pdf'" target="_blank">中共中央宣传部关于印发《党的十九大精神宣讲提纲》的通知</a></li>
<li><a :href="path+'/djwh/download/19thfile/中国物品编码中心关于印发学习宣传贯彻党的十九大精神工作方案的通知.PDF'" target="_blank">中国物品编码中心关于印发学习宣传贯彻党的十九大精神工作方案的通知</a></li>
......@@ -133,10 +133,10 @@
<div class="border-div list-style xglj">
<div class="middle-title">
<h4>相关链接</h4>
<a href=""> <img src="../../assets/image/djwh/19th_rmw.jpg" alt=""></a>
<a href=""> <img src="../../assets/image/djwh/dsxx.jpg" alt=""></a>
<a href=""> <img src="../../assets/image/djwh/lxyz_xxjyw.png" alt=""></a>
<a href=""> <img src="../../assets/image/djwh/lxyz_rmw.png" alt=""></a>
<a href="http://www.12371.cn/special/xg19thjs/"> <img src="../../assets/image/djwh/19th_rmw.jpg" alt=""></a>
<a href="http://www.samr.gov.cn/zt/fdqh/"> <img src="../../assets/image/djwh/dsxx.jpg" alt=""></a>
<a href="http://lxyz.12371.cn"> <img src="../../assets/image/djwh/lxyz_xxjyw.png" alt=""></a>
<a href="http://lxyz.people.cn/GB/index.html"> <img src="../../assets/image/djwh/lxyz_rmw.png" alt=""></a>
</div>
<div class="middle-list">
......@@ -456,7 +456,7 @@ html{
}
.hdtp{
.list-style{
height: 140px;
height: 136px;
a{
display: inline-block;
height: 100%!important;
......@@ -540,10 +540,15 @@ html{
.middle-title{
}
a{
display: inline-block;
width: 100%;
padding: 5px 15px 0 15px;
}
img{
height: 72px;
width: 100%;
padding: 5px 15px 0 15px;
}
}
......
......@@ -5,9 +5,9 @@
<div class="title">GS1系统</div>
<img src="../../../assets/image/knowledge/2013GS1system.jpg" alt="">
<div class="imgBtn">
<a href="#" target="_blank" ><img src="../../../assets/image/knowledge/bmtx.gif" alt=""></a>
<a href="#" target="_blank" ><img src="../../../assets/image/knowledge/sjzttx.gif" alt=""></a>
<a href="#" target="_blank"><img src="../../../assets/image/knowledge/sjjhtx.gif" alt=""></a>
<a href="/Knowledge/GS1System/bmtx" ><img src="../../../assets/image/knowledge/bmtx.gif" alt=""></a>
<a href="/Knowledge/GS1System/sjzttx"><img src="../../../assets/image/knowledge/sjzttx.gif" alt=""></a>
<a href="/Knowledge/GS1System/sjjhtx"><img src="../../../assets/image/knowledge/sjjhtx.gif" alt=""></a>
</div>
<p>GS1系统起源于美国,由美国统一代码委员会(UCC,于2005年更名为GS1 US)于1973年创建。UCC创造性地采用12位的数字标识代码(UPC)。1974年,标识代码和条码首次在开放的贸易中得以应用。继UPC系统成功之后,欧洲物品编码协会,即早期的国际物品编码协会(EAN International,2005年更名为GS1),于1977年成立并开发了与之兼容的系统并在北美以外的地区使用。EAN系统设计意在兼容 UCC系统,主要用13位数字编码。随着条码与数据结构的确定,GS1 系统得以快速发展。</p>
<p>GS1系统为在全球范围内标识货物、服务、资产和位置提供了准确的编码。这些编码能够以条码符号来表示,以便进行商务流程所需的电子识读。该系统克服了厂商、组织使用自身的编码系统或部分特殊编码系统的局限性,提高了贸易的效率和对客户的反应能力。</p>
......
<template>
<div class="org container">
<breadcrumb />
<div class="row status-container">
<div class="row status-container" v-loading='loading'>
<p class="title-style">{{title}}</p>
<div v-html="content"></div>
</div>
......@@ -19,6 +19,7 @@ export default {
},
data() {
return {
loading:false,
id:this.$route.query.id,
content:'',
title:''
......@@ -33,13 +34,12 @@ export default {
this.policyInfoFn();
},
mounted() {
console.log(2)
// 面包屑单独处理
},
methods:{
// 政策法规列表
async policyInfoFn() {
this.loading=true
const params = {
id:this.id,
};
......@@ -47,6 +47,7 @@ export default {
await this.$api.knowledge.policyInfo(params);
const { returnCode, data } = policyInfoRes;
if (returnCode === "0") {
this.loading=false
this.content=data.content;
this.title=data.title
this.$store.commit("system/SET_BREADCRUMB", [
......
......@@ -3,7 +3,7 @@
<breadcrumb/>
<div class="row">
<div class="col-lg-3">
<SubNav/>
<SubNav />
<div v-show="$route.path=='/Knowledge/GS1System/bmtx'" class="showBmtx">
<p>相关链接</p>
<ul>
......@@ -24,7 +24,7 @@
</template>
<script>
import SubNav from "../comps/SubNav.vue";
import SubNav from "../comps/SubNav2.vue";
import breadcrumb from "../comps/breadcrumb.vue";
import "../Search/style/common.scss";
import knowledge from "@/components/layout/header/knowledge.js";
......@@ -38,6 +38,7 @@ export default {
data() {
return {
// showBMTX:false
list:[]
};
},
watch:{
......@@ -48,6 +49,7 @@ export default {
created() {
this.$store.commit("system/SET_SUB_NAV", knowledge.children);
},
......
......@@ -34,7 +34,7 @@
<div class="row">
<div class="detail-cell col-lg-6" v-for="item in handlerInfoFields">
<div class="label" :class="{required:item.required}">{{ item.label }}</div>
<div class="value" :class="{'gs-clickable':item.type==='file'}">{{ item.value }}</div>
<div class="value" :class="{'gs-clickable':item.type==='file'}" @click="checkField(item)">{{ item.value }}</div>
</div>
</div>
</div>
......@@ -395,7 +395,7 @@ export default {
value: ''
},
{
key: '',
key: 'firmbusinesslicensefile',
label: '上传实名认证扫描件',
value: '查看实名认证注册登记表',
type: 'file'
......@@ -431,6 +431,14 @@ export default {
}
this.showImage(form)
}
if (item.key === 'firmbusinesslicensefile') {
const form = {
status: this.status,
fileType: '2', //1.第一步文件 2.第二步文件
id: this.id
}
this.showImage(form)
}
},
showImage(form) {
const result = this.$api.myManage.tycpdmfirmReturnFile(form)
......@@ -492,7 +500,7 @@ export default {
const filterFields = ['firmbusinesslicensefile', 'firmArchivesfile']
this.entInfoFields.forEach(item => (item.key && filterFields.indexOf(item.key) < 0) && (item.value = this.detailInfo[item.key]))
this.handlerInfoFields.forEach(item => item.key && (item.value = this.detailInfo[item.key]))
this.handlerInfoFields.forEach(item => (item.key && filterFields.indexOf(item.key) < 0) && (item.value = this.detailInfo[item.key]))
this.businessFields.forEach(item => item.key && (item.value = this.detailInfo[item.key]))
}
},
......
......@@ -32,7 +32,7 @@
</div>
</div>
</div>
<CheckSearchTable v-if="query.status" :query="query"></CheckSearchTable>
<CheckSearchTable v-if="query.status" :query="query" @refresh="getTotalCount"></CheckSearchTable>
</div>
</template>
......
......@@ -2,7 +2,7 @@
<div class="gs-ac-search-table">
<div v-show="!checkDetail" class="card_wrapper">
<div class="title">{{ status[query.status] }}
<span class="back_btn" @click="$router.push({path:''})">返回</span>
<span class="back_btn" @click="$emit('refresh');$router.push({path:''})">返回</span>
</div>
<div class="body" style="max-height: 100vh;">
<div class="gs-ac-search">
......
......@@ -14,7 +14,7 @@
<ul>
<li>
<p class="content-title">商品条码相关业务</p>
<p>请直接登录<a href="#">网上业务大厅</a>办理商品条码在</p>
<p>请直接登录<a @click="redirectYWDT">网上业务大厅</a>办理商品条码在</p>
</li>
<!-- 厂商实名认证已认证 -->
<li v-if="loginInfo.isQY === 1">
......@@ -26,12 +26,10 @@
>您已成为中国物品编码中心实名认证企业!
</p>
<p style="padding-left:24px">
您可以——前往<a href="http://v3.gds.org.cn/index.aspx" target="_blank"
>中国商品信息服务平台</a
>
办理<a href="http://v3.gds.org.cn/index.aspx" target="_blank"
>“通报进口商品信息” “开通条码微站” “使用数据总资产服务”!</a
>
您可以——前往
<a @click="redirectGDS">中国商品信息服务平台</a>
办理
<a @click="redirectGDS">“通报进口商品信息” “开通条码微站” “使用数据总资产服务”!</a>
</p>
<p v-if="loginInfo.isXT === 2" style="padding-left:24px">
您可以——前往<a @click="redirectGLN">购买GLN</a
......@@ -155,6 +153,24 @@ export default {
}
},
methods: {
async redirectYWDT() {
const params = {userType: this.loginInfo.userType, id: this.loginInfo.id}
const result = await this.$api.myManage.redirectYWDT(params)
if (result.success) {
window.open(result.data, '_black')
} else {
this.$message.error(result.returnMsg)
}
},
async redirectGDS() {
const params = {userType: this.loginInfo.userType, id: this.loginInfo.id}
const result = await this.$api.myManage.redirectGDS(params)
if (result.success) {
window.open(result.data, '_black')
} else {
this.$message.error(result.returnMsg)
}
},
async redirectGLN() {
const result = await this.$api.myManage.redirectGLN()
if (result.success) {
......
......@@ -477,22 +477,17 @@ export default {
const tycpdmFirmInfo = result.data.data
if (tycpdmFirmInfo) { // tycpdmFirmInfo不为null则已完成第一步填写实名信息
if (tycpdmFirmInfo.logoutFlag === null) { // logoutFlag如果为null表示未提交书面材料
await this.$router.replace({path: '/MyManage/UnVerify/uploadvendor'})
this.form.fid = tycpdmFirmInfo.fid
this.form.id = tycpdmFirmInfo.id
this.status = result.data.status
this.initFormData(tycpdmFirmInfo)
// await this.$router.replace({path: '/MyManage/UnVerify/uploadvendor'}) // 第二步没有提交是可以修改第一步的实名信息的
} else {
if (this.$route.query.status !== 'modify' && tycpdmFirmInfo.logoutFlag !== 1) await this.$router.replace({path: '/MyManage/UnVerify/vendorStatus'})
this.form.fid = tycpdmFirmInfo.fid
this.form.id = tycpdmFirmInfo.id
this.status = result.data.status
this.initFormData(tycpdmFirmInfo)
// if (this.loginInfo.userType === 3 && tycpdmFirmInfo.logoutFlag === 1) {
// await this.$alert('您的厂商实名认证审核通过,请重新登录', '', {
// confirmButtonText: '确定',
// showClose: false,
// callback: () => {
// this.$router.replace({path: '/login'})
// }
// })
// }
}
} else {
this.status = 1
......
......@@ -124,7 +124,7 @@ export default {
}
if (code.length >= 4 || (code.length === 5 && code.slice(-1) === '0')) {
_level = 3
if (code.length === 4) {
if (!(code.length === 5 && code.slice(-1) === '0')) {
threeLevelCode = code.substr(0, 4)
} else {
threeLevelCode = code.substr(0, 5)
......@@ -144,9 +144,9 @@ export default {
return item[1] === fourLevelCode
})
}
console.log(oneLevelCode, twoLevelCode, threeLevelCode, fourLevelCode, _level)
// console.log(oneLevelCode, twoLevelCode, threeLevelCode, fourLevelCode, _level)
this.level = _level
console.log(code, level, index)
// console.log(code, level, index)
}
},
mounted() {
......
......@@ -62,9 +62,10 @@ export default {
this.userType = '条码成员'
break
case 3:
this.userType = '官网用户'
break
this.userType = '网站用户'
}
this.loginInfo.isQY === 1 && (this.userType = '实名认证企业')
this.loginInfo.isXT === 1 && (this.userType = '系统成员')
}
},
mounted() {
......
......@@ -45,10 +45,9 @@ export default {
const params = {
page: page,
limit: this.tableResult.pageSize,
classId:5
};
const listRes =
await this.$api.news.newsList(params);
await this.$api.news.zhbdList(params);
const { returnCode, data } = listRes;
if (returnCode === "0") {
this.tableResult = data
......
......@@ -48,7 +48,7 @@ export default {
classId:9
};
const listRes =
await this.$api.news.newsList(params);
await this.$api.news.sdztList(params);
const { returnCode, data } = listRes;
if (returnCode === "0") {
this.tableResult = data
......
......@@ -34,7 +34,7 @@
<p>电子邮箱:wuxm@ancc.org.cn,liwt@ancc.org.cn</p>
<div class="down">
<span style="margin:20px 0 10px;font-size:14px;display:inline-block">资料下载</span>
<list2 :list="list" @getInfo='getInfo'/>
<list2 :list="listFile" @getInfo='getInfo'/>
</div>
......@@ -61,7 +61,8 @@ export default {
pages,
},
computed: {
...mapState(["urls"]),
...mapState(["urls"])
},
data() {
return {
......@@ -101,9 +102,22 @@ export default {
name: "联系方式",
},
},
list: [
listFile:[],
tableResult:{
list:[],
currPage:1,
pageSize:15,
totalCount:0
}
};
},
created(){
this.initListFn(this.tableResult.currPage);
},
mounted(){
this.listFile= [
{
title: "GS1全球追溯标准(第二版)",
directpath: `${this.urls.gs1cn}Manage/down/GS1全球追溯标准(第二版).pdf`
......@@ -145,17 +159,7 @@ export default {
title: "乳制品、熟食品与烘烤食品追溯实施指南(美国)",
directpath: `${this.urls.gs1cn}Manage/down/ruzhipinshushipin.pdf`
},
],
tableResult:{
list:[],
currPage:1,
pageSize:15,
totalCount:0
}
};
},
created(){
this.initListFn(this.tableResult.currPage);
]
},
methods: {
...mapMutations({
......
......@@ -42,7 +42,7 @@ export default {
name: "移动商务",
ico: "",
},
list2:[],
list: [
{
title: "移动商务领域新标准—电子优惠券管理",
......@@ -57,20 +57,25 @@ export default {
},
],
list2:[
};
},
mounted(){
this.list2=[
{
title:'移动商务(宣传折页)',
directpath: `${this.urls.gs1cn}Manage/down/20130620GS1 MobileCom.pdf`
}
],
goDown(id,url){
]
},
methods: {
goDown(id,url){
if(url&&url!==''){
window.open(url,'_blank');
}
}
};
},
methods: {},
};
</script>
<style lang="scss" scoped>
......
......@@ -47,14 +47,7 @@ export default {
},
list2:[
{
title:'《建材行业商品条码应用指南》',
directpath: `${this.urls.gs1cn}Manage/down/建材行业商品条码应用指南.pdf`
},
{
title:' 服装行业商品条码应用指南',
directpath: `${this.urls.gs1cn}Manage/down/服装行业商品条码应用指南.pdf`
}
],
tableResult:{
list:[],
......@@ -67,6 +60,16 @@ export default {
created() {
this.initListFn(this.tableResult.currPage);
},
mounted(){
this.list2=[{
title:'《建材行业商品条码应用指南》',
directpath: `${this.urls.gs1cn}Manage/down/建材行业商品条码应用指南.pdf`
},
{
title:' 服装行业商品条码应用指南',
directpath: `${this.urls.gs1cn}Manage/down/服装行业商品条码应用指南.pdf`
}]
},
methods:{
...mapMutations({
setMatche: "setMatche",
......
......@@ -45,10 +45,9 @@ export default {
const params = {
page: page,
limit: this.tableResult.pageSize,
classId:31
};
const listRes =
await this.$api.news.newsList(params);
await this.$api.news.bzkydtList(params);
const { returnCode, data } = listRes;
if (returnCode === "0") {
this.tableResult = data
......
......@@ -48,7 +48,7 @@ export default {
classId:10
};
const listRes =
await this.$api.news.newsList(params);
await this.$api.news.jcspList(params);
const { returnCode, data } = listRes;
if (returnCode === "0") {
this.tableResult = data
......@@ -70,7 +70,7 @@ export default {
];
this.setMatche(matche);
let link = this.$router.resolve({
path: `/News/msg?id=${id}`,
path: `/News/msgVideo?id=${id}`,
});
window.open(link.href,'_blank')
}
......
......@@ -24,7 +24,7 @@
</div>
<div class="top10-kj">
<ul>
<li v-for="(tmp, i) in topData" :key="i" @click="getInfo(tmp.id,tmp.directpath)">
<li v-for="(tmp, i) in topData.slice(0,5)" :key="i" @click="getInfo(tmp.id,tmp.directpath)">
<span></span
><span>{{tmp.title}}</span
>
......
......@@ -124,17 +124,18 @@ export default {
localStorage.setItem('TOKEN', res.data.token)
const memberInfo = await this.$api.myManage.memberInfo({id: res.data.id})
console.log(memberInfo)
localStorage.setItem('loginInfo', JSON.stringify({...res.data, ...memberInfo.data}))
if (res.data.userType === 3 && res.data.levels === null) {
const loginInfo = res.data
localStorage.setItem('loginInfo', JSON.stringify({...memberInfo.data, ...loginInfo}))
if ((loginInfo.userType === 1 && loginInfo.isXT !== 1) || (loginInfo.userType === 2 && loginInfo.isXT !== 1) || (loginInfo.userType === 3 && loginInfo.levels === null)) {
localStorage.setItem('gs-user', JSON.stringify({type: 'unVerify'}))
this.$router.push({path: '/MyManage/UnVerify/index'})
} else if (res.data.userType === 2) {
} else if (loginInfo.isXT === 1) {
localStorage.setItem('gs-user', JSON.stringify({type: 'verify'}))
this.$router.push({path: '/MyManage/SystemMember/index'})
} else if (res.data.levels === 0) {
} else if (loginInfo.levels === 0) {
localStorage.setItem('gs-user', JSON.stringify({type: 'admin'}))
this.$router.push({path: '/MyManage/admin/check'})
} else if (String(res.data.levels).length === 4) {
} else if (String(loginInfo.levels).length === 4) {
localStorage.setItem('gs-user', JSON.stringify({type: 'adminBranch'}))
this.$router.push({path: '/MyManage/admin/check'})
}
......
<template>
<el-menu
:default-active="activeMenu"
class="el-menu-vertical gs-subnav"
:collapse="false"
:default-openeds="openeds"
:collapse-transition='true'
@select="handleSelect"
@open='opengo'
@close='opengo'
>
<template v-for="submenu in subNav">
<el-submenu
v-if="submenu.children && submenu.children.length > 0"
:key="submenu.id"
:index="submenu.name"
>
<template slot="title">
<span :index="submenu.name" :class="{ 'is-active': activeMenu === submenu.id }">{{ submenu.name }}</span>
</template>
<template v-for="item in submenu.children">
<template v-if="item.children && item.children.length > 0">
<el-submenu :index="item.name" :key="item.id">
<template slot="title">
<span style="margin-left: 6px">{{ item.name }}</span>
</template>
<template v-for="third in item.children">
<el-menu-item
:key="third.id"
:index="third.name"
:class="{ 'is-active': activeMenu === third.id }"
>
{{ third.name }}
</el-menu-item>
</template>
</el-submenu>
</template>
<template v-else>
<el-menu-item
:key="item.id"
:index="item.name"
:class="{ 'is-active': activeMenu === item.id }"
>
{{ item.name }}
</el-menu-item>
</template>
</template>
</el-submenu>
<template v-else>
<el-menu-item
:key="submenu.id"
:index="submenu.name"
:class="{ 'is-active': activeMenu === submenu.id }"
>
<span>{{ submenu.name }}</span>
</el-menu-item>
</template>
</template>
</el-menu>
</template>
<script>
import { mapState } from "vuex";
export default {
data() {
return {
activeMenu: "",
openeds: []
};
},
computed: {
...mapState("system", ["subNav"]),
},
created() {
console.log(this.subNav);
this.openeds = this.subNav.map(nav => nav.name)
},
watch: {
subNav: {
handler(val) {
// console.log("watch------ subNav", val);
const result = this.treeFind(
val,
(item) => item.link === this.$route.path
);
if (result) {
console.log(result);
this.activeMenu = result.id;
}
},
immediate: true,
},
},
methods: {
treeFind(tree, func) {
for (const data of tree) {
if (func(data)) return data;
if (data.children) {
const res = this.treeFind(data.children, func);
if (res) return res;
}
}
return null;
},
handleSelect(index, indexP) {
// console.log(index, indexP);
const temp = JSON.parse(JSON.stringify(indexP));
const key = temp.shift();
this.subNav.forEach((item) => {
if (item.name === key) {
if (temp.length > 1) {
this.checkChildren(index, temp, item.children);
} else if (temp.length === 0) {
this.showApp(item);
} else {
item.children.forEach((_item) => {
if (_item.name === index) {
this.showApp(_item);
}
});
}
}
});
},
checkChildren(index, indexP, list) {
const key = indexP.shift();
list.forEach((item) => {
// console.log(key);
if (item.name === key) {
if (indexP.length > 1) {
this.checkChildren(index, indexP, item.children);
} else {
item.children.forEach((_item) => {
if (_item.name === index) {
this.activeMenu = _item.name;
this.showApp(_item);
}
});
}
}
});
},
showApp(item) {
this.activeMenu = item.id;
if (item.link.startsWith("http")) {
window.open(item.link);
} else {
if (item.breadcrumb) {
this.$store.commit("system/SET_BREADCRUMB", item.breadcrumb);
}
this.$router.push({ path: item.link });
}
},
handleOpen(key, keyPath) {
console.log(key, keyPath);
},
handleClose(key, keyPath) {
console.log(key, keyPath);
},
goLink(item){
console.log(item)
this.$router.push({ path: item.link });
},
opengo(index,indexPath){
this.$router.push({ path: '/Knowledge/GS1System2' });
}
},
};
</script>
<style lang="scss">
.el-menu.gs-subnav {
border-right: none;
background: $side-bg-color;
margin-bottom: 20px;
padding-left: 0;
.el-submenu__title {
background: $side-bg-color;
height: 44px;
line-height: 44px;
}
.menu-title {
margin-top: 25px;
margin-bottom: 10px;
padding-left: 28px;
font-size: 14px;
color: #b7b6b6;
}
.el-menu-item {
height: 44px;
line-height: 44px;
color: #6b6a6a;
background: transparent;
font-size: 14px;
i {
color: $side-bg-color;
font-size: 25px;
position: absolute;
top: 15px;
right: 15px;
}
&:hover,
&:focus,
&.is-active {
color: #f26335;
background: $side-menu-active-color;
border-right: 3px solid #f26335;
}
}
}
</style>
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