Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gs1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴迪
gs1
Commits
20ce2243
Commit
20ce2243
authored
Oct 19, 2021
by
林家欣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资讯中心框架搭建并创建咨询中心下图片资讯
parent
5c6f8df1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
325 additions
and
1 deletions
+325
-1
mock.js
src/components/layout/header/mock.js
+0
-0
index.js
src/router/index.js
+19
-1
PicNews.vue
src/views/News/PicNews.vue
+89
-0
main.vue
src/views/News/main.vue
+217
-0
No files found.
src/components/layout/header/mock.js
View file @
20ce2243
This diff is collapsed.
Click to expand it.
src/router/index.js
View file @
20ce2243
...
@@ -422,12 +422,30 @@ const routes = [
...
@@ -422,12 +422,30 @@ const routes = [
component
:
()
=>
import
(
"@/views/Business/Training.vue"
),
component
:
()
=>
import
(
"@/views/Business/Training.vue"
),
},
},
{
{
path
:
"/News/index"
,
name
:
"newsIndex"
,
meta
:
{
name
:
"资讯中心"
,
},
component
:
()
=>
import
(
"@/views/News/index.vue"
),
},
{
path
:
"/News"
,
path
:
"/News"
,
name
:
"News"
,
name
:
"News"
,
meta
:
{
meta
:
{
name
:
"资讯中心"
,
name
:
"资讯中心"
,
},
},
component
:
()
=>
import
(
"@/views/News/index.vue"
),
component
:
()
=>
import
(
"@/views/News/main.vue"
),
children
:
[
{
path
:
"/News/PicNews"
,
name
:
"PicNews"
,
meta
:
{
name
:
"图片资讯"
,
},
component
:
()
=>
import
(
"@/views/News/PicNews.vue"
),
},
]
},
},
{
{
path
:
"/Knowledge"
,
path
:
"/Knowledge"
,
...
...
src/views/News/PicNews.vue
0 → 100644
View file @
20ce2243
<
template
>
<div
class=
"picNews"
>
<div
class=
"picNews-top"
>
<cate
:father=
"tpzxCate"
></cate>
<ul
class=
"picNews-ul"
>
<li
v-for=
"(tmp, i) in 4"
:key=
"i"
>
<div
class=
"picNews-li-tp"
>
<img
src=
"../../assets/image/news/tpzx-tp1.jpg"
alt=
""
/>
</div>
<div
class=
"picNews-li-bt"
>
中国物品编码中心应邀出席食品安全智慧监管研讨会
</div>
</li>
</ul>
</div>
<div
class=
"picNews-bottom"
>
<div
class=
"container"
>
<pages
/>
</div>
</div>
</div>
</
template
>
<
script
>
import
cate
from
"../comps/cate.vue"
;
import
pages
from
"../comps/pages.vue"
;
export
default
{
components
:
{
cate
,
pages
,
},
data
()
{
return
{
tpzxCate
:
{
name
:
"图片资讯 "
,
ico
:
""
,
},
};
},
methods
:
{},
};
</
script
>
<
style
lang=
"scss"
>
.picNews
{
@media
screen
and
(
min-width
:
992px
)
{
.
picNews-ul
{
justify-content
:
space-between
;
}
}
@media
screen
and
(
max-width
:
992px
)
{
.picNews-ul
{
justify-content
:
space-around
;
}
}
}
</
style
>
<
style
lang=
"scss"
scoped
>
.picNews
{
.picNews-top
{
@include
module-box;
.picNews-ul
{
display
:
flex
;
flex-wrap
:
wrap
;
justify-content
:
space-between
;
li
{
width
:
216px
;
background
:
#ffffff
;
box-shadow
:
0px
4px
15px
2px
rgba
(
4
,
64
,
141
,
0.08
);
border-radius
:
4px
;
img
{
width
:
100%
;
}
.picNews-li-bt
{
width
:
90%
;
margin
:
0
auto
;
text-align
:
center
;
color
:
#414345
;
font-size
:
14px
;
padding
:
14px
0
;
}
}
}
}
.picNews-bottom
{
@include
module-box;
margin-top
:
30px
;
}
}
</
style
>
\ No newline at end of file
src/views/News/main.vue
0 → 100644
View file @
20ce2243
<
template
>
<div
class=
"business container"
>
<breadcrumb
/>
<div
class=
"row"
>
<div
class=
"col-lg-3"
>
<left2
:list=
"routes"
ref=
"left"
/>
</div>
<div
class=
"col-lg-9"
>
<router-view
class=
"marginTopLg20"
></router-view>
</div>
</div>
</div>
</
template
>
<
script
>
import
left2
from
"../comps/left2.vue"
;
import
breadcrumb
from
"../comps/breadcrumb.vue"
;
export
default
{
components
:
{
left2
,
breadcrumb
,
},
data
()
{
return
{
routeList
:
[
{
name
:
"资讯中心"
,
path
:
""
,
active
:
""
,
children
:
[
{
name
:
"图片资讯"
,
path
:
"/News/PicNews"
,
active
:
"PicNews"
,
},
{
name
:
"综合报道"
,
path
:
""
,
active
:
""
,
},
{
name
:
"中心活动"
,
path
:
""
,
active
:
""
,
},
{
name
:
"地方动态"
,
path
:
""
,
active
:
""
,
},
{
name
:
"国际追踪"
,
path
:
""
,
active
:
""
,
},
{
name
:
"标准科研动态"
,
path
:
""
,
active
:
""
,
},
{
name
:
"行业应用"
,
path
:
""
,
active
:
""
,
},
{
name
:
"深度专题"
,
path
:
""
,
active
:
""
,
},
{
name
:
"精彩视频"
,
path
:
""
,
active
:
""
,
},
{
name
:
"公告通知"
,
path
:
""
,
active
:
""
,
},
],
},
{
name
:
"应用领域"
,
path
:
""
,
active
:
""
,
children
:
[
{
name
:
"零售"
,
path
:
""
,
active
:
""
,
},
{
name
:
"物流"
,
path
:
""
,
active
:
""
,
},
{
name
:
"医疗卫生"
,
path
:
""
,
active
:
""
,
},
{
name
:
"食品安全追溯"
,
path
:
""
,
active
:
""
,
},
{
name
:
"电子商务"
,
path
:
""
,
active
:
""
,
},
{
name
:
"移动商务"
,
path
:
""
,
active
:
""
,
},
{
name
:
"物联网"
,
path
:
""
,
active
:
""
,
},
{
name
:
"其他"
,
path
:
""
,
active
:
""
,
},
],
},
],
};
},
computed
:
{
routes
()
{
let
newRouteList
=
[];
let
originPath
;
if
(
this
.
$route
.
meta
.
fatherPath
)
{
originPath
=
this
.
$route
.
meta
.
fatherPath
;
}
else
{
originPath
=
this
.
$route
.
path
;
}
const
currentRoute
=
this
.
deepFindCurrentRoute
(
this
.
routeList
,
originPath
);
console
.
log
(
currentRoute
,
"currentRoute"
);
if
(
currentRoute
.
children
&&
currentRoute
.
children
.
length
>
0
)
{
newRouteList
=
currentRoute
.
children
;
}
else
if
(
currentRoute
.
noneChild
)
{
const
oldRouteList
=
JSON
.
parse
(
localStorage
.
getItem
(
"newRouteList"
));
newRouteList
=
oldRouteList
;
}
else
{
newRouteList
=
this
.
routeList
;
}
localStorage
.
setItem
(
"newRouteList"
,
JSON
.
stringify
(
newRouteList
));
// newRouteList = this.deepFindRouteList(this.routeList, currentPath);
console
.
log
(
newRouteList
,
"newRouteListnewRouteList2"
);
return
newRouteList
;
},
},
created
()
{
console
.
log
(
this
.
$route
,
"this.$route"
);
},
methods
:
{
deepFindCurrentRoute
(
menuList
,
activePath
)
{
let
current
=
[];
const
deep
=
(
arr
,
activePath
)
=>
{
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
+=
1
)
{
if
(
arr
[
i
].
path
!==
activePath
&&
arr
[
i
].
children
&&
arr
[
i
].
children
.
length
>
0
)
{
deep
(
arr
[
i
].
children
,
activePath
);
}
else
if
(
arr
[
i
].
path
===
activePath
)
{
current
=
arr
[
i
];
break
;
}
if
(
current
.
length
>
0
)
{
break
;
}
}
};
deep
(
menuList
,
activePath
);
return
current
;
},
deepFindRouteList
(
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
].
path
===
activePath
)
{
current
=
arr
;
break
;
}
if
(
current
.
length
>
0
)
{
break
;
}
}
};
deep
(
menuList
,
activePath
);
return
current
;
},
},
};
</
script
>
<
style
lang=
"scss"
scoped
>
.business
{
padding-bottom
:
20px
;
}
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment