Browse Source

首页一点点

feature
dai 3 years ago
parent
commit
92cfbdbe5b
  1. BIN
      src/assets/images/shuju/main/card-subtitle-icon.png
  2. 0
      src/assets/images/shuju/main/card-title-bg-480.png
  3. BIN
      src/assets/images/shuju/main/card-title-bg-800.png
  4. BIN
      src/assets/images/shuju/main/weather/dayu.png
  5. BIN
      src/assets/images/shuju/main/weather/duoyun.png
  6. BIN
      src/assets/images/shuju/main/weather/feng.png
  7. BIN
      src/assets/images/shuju/main/weather/leibao.png
  8. BIN
      src/assets/images/shuju/main/weather/leiyu.png
  9. BIN
      src/assets/images/shuju/main/weather/qing.png
  10. BIN
      src/assets/images/shuju/main/weather/wu.png
  11. BIN
      src/assets/images/shuju/main/weather/xiaoyu.png
  12. BIN
      src/assets/images/shuju/main/weather/xue.png
  13. BIN
      src/assets/images/shuju/main/weather/yin.png
  14. BIN
      src/assets/images/shuju/main/weather/yuxue.png
  15. BIN
      src/assets/images/shuju/main/weather/zhongyu.png
  16. BIN
      src/assets/images/shuju/renfang/index/down.png
  17. BIN
      src/assets/images/shuju/renfang/index/i-yujing.png
  18. BIN
      src/assets/images/shuju/renfang/index/up.png
  19. BIN
      src/assets/images/shuju/renfang/index/znyc.png
  20. 44
      src/assets/scss/dataBoard/c/common.scss
  21. 158
      src/assets/scss/dataBoard/renfang/index.scss
  22. 157
      src/assets/scss/dataBoardMain.scss
  23. 747
      src/assets/scss/main-shuju.scss
  24. 684
      src/assets/scss/main-shuju备份.scss
  25. 45
      src/router/index.js
  26. 16
      src/views/dataBoard/404.vue
  27. 754
      src/views/dataBoard/cpts/map/index.vue
  28. 196
      src/views/dataBoard/renfang/index.vue
  29. 129
      src/views/dataBoardMain/main-content.vue
  30. 336
      src/views/dataBoardMain/main-navbar.vue
  31. 156
      src/views/dataBoardMain/main.vue
  32. 304
      src/views/main-shuju/main-navbar.vue
  33. 85
      src/views/main-shuju/main-theme-tools.vue
  34. 24
      src/views/main-shuju/main.vue
  35. 9
      src/views/main-sidebar.vue

BIN
src/assets/images/shuju/main/card-subtitle-icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 504 B

0
src/assets/images/shuju/main/card-title-bg.png → src/assets/images/shuju/main/card-title-bg-480.png

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

BIN
src/assets/images/shuju/main/card-title-bg-800.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
src/assets/images/shuju/main/weather/dayu.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 688 B

BIN
src/assets/images/shuju/main/weather/duoyun.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 895 B

BIN
src/assets/images/shuju/main/weather/feng.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 651 B

BIN
src/assets/images/shuju/main/weather/leibao.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 725 B

BIN
src/assets/images/shuju/main/weather/leiyu.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 807 B

BIN
src/assets/images/shuju/main/weather/qing.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 963 B

BIN
src/assets/images/shuju/main/weather/wu.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 612 B

BIN
src/assets/images/shuju/main/weather/xiaoyu.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 680 B

BIN
src/assets/images/shuju/main/weather/xue.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
src/assets/images/shuju/main/weather/yin.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 621 B

BIN
src/assets/images/shuju/main/weather/yuxue.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 748 B

BIN
src/assets/images/shuju/main/weather/zhongyu.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 692 B

BIN
src/assets/images/shuju/renfang/index/down.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 826 B

BIN
src/assets/images/shuju/renfang/index/i-yujing.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
src/assets/images/shuju/renfang/index/up.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 754 B

BIN
src/assets/images/shuju/renfang/index/znyc.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

44
src/assets/scss/dataBoard/c/common.scss

@ -0,0 +1,44 @@
@mixin scrollBar {
&::-webkit-scrollbar {
width: 4px;
height: 4px;
&:hover {
width: 8px;
height: 8px;
}
}
&::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
border-radius: 4px;
// box-shadow: inset 0 0 5px rgba(#00023f, 0.2);
box-shadow: none;
background: #07266b;
}
&::-webkit-scrollbar-track {
/*滚动条里面轨道*/
// box-shadow: inset 0 0 5px rgba(#00023f, 0.2);
box-shadow: none;
border-radius: 4px;
background: transparent;
}
}
@mixin scrollBar2 {
&::-webkit-scrollbar {
/*滚动条整体样式*/
width: 8px; /*高宽分别对应横竖滚动条的尺寸*/
height: 1px;
}
&::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
border-radius: 8px;
box-shadow: inset 0 0 5px rgba(#000, 0.1);
background: linear-gradient(270deg, #999, #ddd);
}
&::-webkit-scrollbar-track {
/*滚动条里面轨道*/
box-shadow: inset 0 0 5px rgba(#000, 0.1);
border-radius: 8px;
background: darken(#999, 20);
}
}

158
src/assets/scss/dataBoard/renfang/index.scss

@ -0,0 +1,158 @@
@import "../../c/config";
@import "../../c/function";
@import "../c/common";
.g-row {
padding: 10px 6px;
display: flex;
justify-content: space-between;
.g-left {
width: 480px;
}
.g-center {
width: 800px;
}
.g-right {
width: 480px;
}
}
.m-map {
width: 100%;
height: 650px;
margin-bottom: 10px;
}
.m-box {
.box-title {
position: relative;
width: 100%;
height: 56px;
&-bg {
position: absolute;
top: 0;
left: 0;
z-index: 0;
right: 0;
bottom: 0;
height: 56px;
height: 100%;
}
&-txt {
position: relative;
display: block;
padding-top: 8px;
padding-left: 24px;
font-size: 20px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #ffffff;
line-height: 48px;
}
&-btn {
position: absolute;
z-index: 1;
top: 6px;
right: 24px;
display: flex;
align-items: center;
line-height: 48px;
font-size: 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #6fdeff;
img {
width: 16px;
height: 16px;
margin: 0 8px;
}
}
}
}
.m-subbox {
@include scrollBar;
height: 380px;
overflow-y: auto;
}
.m-cate {
.list {
@include scrollBar;
padding-right: 5px;
height: 245px;
overflow-y: auto;
.item {
margin-top: 30px;
display: flex;
align-items: center;
font-size: 14px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(255, 255, 255, 0.85);
line-height: 24px;
cursor: pointer;
&:hover {
color: #fff;
}
.item-name {
margin-left: 5px;
width: 80px;
flex-shrink: 0;
}
.item-div {
width: 1px;
height: 12px;
background: #d8d8d8;
border-radius: 1px;
}
.item-count {
margin-left: 20px;
width: 80px;
flex-shrink: 0;
b {
font-size: 20px;
font-weight: bold;
}
}
.item-per {
display: flex;
width: 160px;
align-items: center;
b {
font-size: 20px;
font-weight: bold;
}
img {
margin-left: 18px;
margin-right: 6px;
width: 16px;
height: 16px;
}
}
.item-progress {
margin-right: 15px;
width: 416px;
height: 16px;
background: rgba(111, 222, 255, 0.15);
border-radius: 1px;
overflow: hidden;
b {
display: block;
height: 16px;
background: linear-gradient(270deg, #6fdeff 0%, rgba(111, 222, 255, 0.1) 100%);
}
}
}
}
}

157
src/assets/scss/dataBoardMain.scss

@ -0,0 +1,157 @@
@import "./c/config";
@import "./c/function";
.g-fx {
background-color: #00023a;
}
.g-pg {
position: relative;
}
.i-corner {
position: absolute;
z-index: 0;
width: 121px;
&.z-left-top {
top: 15px;
left: 15px;
}
&.z-left-bottom {
bottom: 15px;
left: 15px;
}
&.z-right-top {
top: 15px;
right: 15px;
}
&.z-right-bottom {
bottom: 15px;
right: 15px;
}
}
.m-topnav {
position: relative;
z-index: 1;
width: 100%;
height: 101px;
background-image: url(../images/shuju/main/top-bg.png);
background-repeat: no-repeat;
background-position: top center;
background-size: 100%;
.title {
position: absolute;
left: 0;
right: 0;
top: 0;
margin: 0 auto;
line-height: 70px;
text-align: center;
font-size: 32px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #ffffff;
}
.nav-list {
position: absolute;
top: 40px;
left: 40px;
display: flex;
width: 500px;
&.z-right {
left: auto;
right: 40px;
.nav-item {
background-image: url(../images/shuju/main/nav-right.png);
&.z-on {
&::before {
background-image: url(../images/shuju/main/nav-right-on.png);
}
}
}
}
.nav-item {
position: relative;
width: 120px;
height: 40px;
line-height: 40px;
font-size: 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
background-image: url(../images/shuju/main/nav-left.png);
background-size: 100%;
text-align: center;
cursor: pointer;
color: rgba(#fff, 0.85);
span {
position: relative;
z-index: 1;
}
&:hover {
color: #fff;
}
&.z-on {
background-image: none;
&::before {
position: absolute;
z-index: -1;
content: "";
display: block;
top: -2px;
left: -5px;
width: 132px;
height: 47px;
background-image: url(../images/shuju/main/nav-left-on.png);
background-size: 100%;
}
}
}
}
.msg {
position: absolute;
display: flex;
align-items: center;
top: 40px;
right: 40px;
font-size: 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #ffffff;
line-height: 22px;
.weather {
display: flex;
align-items: center;
img {
position: relative;
width: 20px;
}
div {
margin-left: 3px;
}
}
.date {
margin-left: 24px;
display: flex;
align-items: center;
.date-div {
margin: 0 10px;
height: 22px;
width: 1px;
background-color: #fff;
opacity: 0.8;
}
}
}
}
.g-cnt {
padding: 15px;
}

747
src/assets/scss/main-shuju.scss

@ -1,149 +1,684 @@
@import "~@/element-ui/theme-variables.scss";
@import "./shuju-variables.scss";
@import "./c/config";
@import "./c/function";
@import "./modules/visual/c/common.scss";
.g-fx {
background-color: #00023a;
.g-main {
padding: 10px 20px 10px;
}
.i-corner {
position: absolute;
z-index: 0;
width: 121px;
&.z-left-top {
top: 15px;
left: 15px;
.m-iframe {
position: relative;
box-sizing: content-box;
width: calc(100% + 20px);
margin: -10px -20px -10px;
z-index: 100;
}
/* Reset element-ui
------------------------------ */
.g-bd {
background-image: url(../img/shuju/bg.jpg);
background-size: cover;
background-position: center 0;
height: 100%;
@include scrollBar;
.el-card + .el-card {
margin-top: 15px;
}
.el-input__prefix .el-input__icon {
display: inline-block;
vertical-align: middle;
}
.el-date-editor .el-range-separator {
width: 8%;
}
&.z-left-bottom {
bottom: 15px;
left: 15px;
.el-table th {
color: $--color-text-primary;
background-color: $--background-color-base;
}
&.z-right-top {
top: 15px;
right: 15px;
.el-pagination {
margin-top: 15px;
text-align: right;
}
&.z-right-bottom {
bottom: 15px;
right: 15px;
.el-table__expand-icon {
display: inline-block;
width: 14px;
vertical-align: middle;
margin-right: 5px;
}
}
.m-topnav {
/* Common
------------------------------ */
// 图标
.icon-svg {
width: 1em;
height: 1em;
fill: currentColor;
vertical-align: middle;
overflow: hidden;
}
// 卡片
.aui-card--fill .el-card__header {
height: $content--card-header-height;
line-height: $content--card-header-height - 36px;
}
.aui-card__title {
font-size: 16px;
}
// 表单
.aui-form__label-icon {
display: inline-block;
margin: 0 3px;
vertical-align: middle;
font-size: 18px;
color: $--color-text-secondary;
}
// 按钮
.aui-button--dashed {
border-style: dashed;
&:focus,
&:hover {
background-color: transparent;
}
&-add {
> span > *[class*="el-icon-"],
> span > *[class*="icon"] {
vertical-align: middle;
font-size: 18px;
margin-right: 5px;
}
}
}
/* Layout
------------------------------ */
.g-bd {
position: relative;
z-index: 1;
width: 100%;
height: 101px;
background-image: url(../images/shuju/main/top-bg.png);
background-repeat: no-repeat;
background-position: top center;
background-size: 100%;
.title {
position: absolute;
left: 0;
right: 0;
top: 0;
margin: 0 auto;
line-height: 70px;
text-align: center;
font-size: 32px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #ffffff;
padding-top: $navbar--height;
/* Sidebar fold
------------------------------ */
&.z-sidebar--fold {
.navbar {
&__header,
&__brand {
width: $sidebar--width-fold;
}
&__brand {
&-lg {
display: none;
}
&-mini {
display: inline-block;
}
}
&__icon-menu--switch {
transform: rotateZ(180deg);
}
}
.aui-sidebar {
&__inner {
width: $sidebar--width-fold + 20px;
}
&,
&__menu {
width: $sidebar--width-fold;
}
&__menu > li > .el-submenu__title {
text-align: center;
}
&__menu-icon {
margin-right: 0;
font-size: 18px;
}
}
.g-cnt {
&__wrapper {
margin-left: $sidebar--width-fold;
}
&--tabs > .el-tabs > .el-tabs__header {
left: $sidebar--width-fold;
}
}
}
&.z-sidebar--noside {
.aui-sidebar {
display: none !important;
}
.g-cnt {
&__wrapper {
margin-left: 0 !important;
}
&--tabs > .el-tabs > .el-tabs__header {
left: 0 !important;
}
}
}
.nav-list {
position: absolute;
top: 40px;
left: 40px;
&.z-iframe {
padding-top: 0;
.aui-content--tabs {
padding-top: 0;
}
}
}
/* Navbar
------------------------------ */
.m-navbar {
position: fixed;
top: 0;
right: 0;
left: 0;
z-index: 1030;
display: flex;
align-items: stretch;
height: $navbar--height;
// background-color: $--color-primary;
// box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.05);
background: linear-gradient(180deg, #00023f, #176dec);
box-shadow: 0px 3px 16px 0px rgba(187, 187, 227, 0.35);
font-size: 19px;
.el-menu-item {
font-size: 19px;
}
.navbar--colorful {
.navbar__body {
background-color: transparent;
}
.navbar__menu {
> .el-menu-item,
> .el-submenu > .el-submenu__title {
color: #fff;
&:focus,
&:hover {
color: #fff;
background-color: mix(#000, $--color-primary, 15%);
}
}
> .el-menu-item.is-active,
> .el-submenu.is-active > .el-submenu__title {
color: #fff;
&:focus,
&:hover {
color: #fff;
}
}
.el-menu-item i,
.el-submenu__title i,
.el-menu-item svg,
.el-submenu__title svg,
.el-menu-item .el-dropdown {
color: #fff !important;
}
.el-button {
color: #fff;
background-color: transparent;
}
}
.navbar__search {
&-txt {
.el-input__inner {
color: #fff;
border-color: #fff;
&::-webkit-input-placeholder {
color: #fff;
}
}
}
}
}
.navbar__header {
position: relative;
width: $sidebar--width;
height: $navbar--height;
transition: width 0.3s;
}
.navbar__brand {
position: relative;
display: flex;
width: 500px;
justify-content: center;
align-items: center;
padding: 10px 20px;
margin: 0;
width: 100%;
height: 100%;
font-size: 28px;
font-weight: bold;
text-transform: uppercase;
white-space: nowrap;
// overflow: hidden;
transition: width 0.3s;
font-family: FZZCHJW;
color: #ffffff;
background: linear-gradient(0deg, #03c7ff 24.609375%, #ffffff 81.0791015625%);
-webkit-background-clip: text;
-webkit-text-fill-color: rgba(#fff, 0.7);
&::before {
position: absolute;
content: "";
z-index: 100000;
display: block;
bottom: -10px;
left: -920px;
right: -1000px;
margin: 0 auto;
width: 400px;
height: 20px;
// background-color: #fff;
background-image: url(../img/shuju/flash.png);
background-size: cover;
background-position: center center;
}
&-lg,
&-mini {
max-width: 100%;
color: #fff;
cursor: pointer;
&:focus,
&:hover {
color: #fff;
text-decoration: none;
}
}
&-mini {
display: none;
}
}
.navbar__body {
position: relative;
display: flex;
flex: 1;
// background-color: #fff;
background-color: transparent;
// overflow: hidden;
}
.navbar__menu {
background-color: transparent;
border-bottom: 0 !important;
a:focus,
a:hover {
text-decoration: none;
}
&.z-div {
.el-menu-item,
.sub-menu {
position: relative;
&.z-right {
left: auto;
right: 40px;
.nav-item {
background-image: url(../images/shuju/main/nav-right.png);
&.is-active,
&.z-on {
&::before {
background-image: url(../images/shuju/main/nav-right-on.png);
position: absolute;
content: "";
display: block;
bottom: -6px;
left: 0;
right: 0;
margin: 0 auto;
width: 50px;
height: 4px;
border: 0;
border-radius: 0 0 2px 2px;
background: #1effff;
}
}
&:last-child {
&::after {
display: none;
}
}
&::after {
position: absolute;
content: "";
right: 0;
top: 0;
bottom: 0;
margin: auto 0;
width: 1px;
height: 18px;
background-color: rgba(#ffffff, 0.6);
}
}
}
.nav-item {
.sub-menu {
position: relative;
width: 120px;
height: 40px;
line-height: 40px;
font-size: 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
background-image: url(../images/shuju/main/nav-left.png);
background-size: 100%;
text-align: center;
float: left;
cursor: pointer;
color: rgba(#fff, 0.85);
&:hover {
.sub-menu-list {
display: block;
}
}
span {
position: relative;
z-index: 1;
.sub-menu-list {
position: absolute;
display: none;
padding: 0 10px;
width: 160px;
left: -100px;
right: -100px;
margin: 0 auto;
background-color: rgba(#176dec, 0.9);
text-align: center;
cursor: pointer;
> div {
border-top: 1px dashed rgba(#fff, 0.4);
color: rgba(#fff, 0.7);
transition: all ease 0.5s;
padding: 10px 0;
line-height: $navbar--height * 0.5;
&.z-on {
font-weight: bold;
}
&.z-on,
&:hover {
color: #ffd;
}
}
}
}
&:hover {
.el-menu-item,
.sub-menu {
height: $navbar--height;
padding: 0 15px;
line-height: $navbar--height;
border-color: transparent !important;
color: #fff;
}
.el-menu-item.is-active,
.sub-menu.z-on {
color: #fff;
font-weight: bold;
}
.el-menu-item,
.sub-menu {
i {
color: #fff;
}
&:focus,
&:hover {
color: #fff;
background-color: transparent !important;
&.z-on {
background-image: none;
&::before {
position: absolute;
z-index: -1;
content: "";
display: block;
top: -2px;
left: -5px;
width: 132px;
height: 47px;
background-image: url(../images/shuju/main/nav-left-on.png);
background-size: 100%;
.navbar__icon-menu {
color: #fff;
}
.el-dropdown {
color: #fff;
.el-icon-arrow-down {
transform: rotateZ(180deg);
}
}
}
* {
vertical-align: initial;
}
.navbar__icon-menu {
vertical-align: middle;
font-size: 20px;
}
.el-dropdown {
color: #fff;
font-size: 16px;
.el-icon-arrow-down {
width: auto;
font-size: 16px;
margin: 0 0 0 5px;
transition: transform 0.3s;
}
}
}
.el-badge {
display: inline;
z-index: 2;
&__content {
line-height: 16px;
}
}
}
.msg {
position: absolute;
display: flex;
align-items: center;
top: 40px;
right: 40px;
font-size: 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #ffffff;
line-height: 22px;
.weather {
display: flex;
align-items: center;
img {
position: relative;
width: 16px;
.navbar__search {
> *[class*="el-icon-"],
> *[class*="icon"] {
display: inline-block;
vertical-align: middle;
}
&-txt {
width: 0;
transition: width 0.3s, margin-left 0.3s;
&.is-show {
width: 210px;
margin-left: 8px;
}
div {
margin-left: 3px;
.el-input__inner {
height: $navbar--height - 20px;
padding: 0;
line-height: $navbar--height - 20px;
border-color: $--color-text-primary;
border-top: 0;
border-right: 0;
border-left: 0;
border-radius: 0;
background: transparent;
}
}
}
.navbar__avatar {
.el-dropdown-link {
> img {
width: 42px;
height: auto;
margin-right: 7px;
border-radius: 100%;
vertical-align: middle;
}
}
}
}
/* Content
------------------------------ */
.g-cnt {
position: relative;
// padding: $content--padding;
min-height: calc(100vh - #{$navbar--height});
background-color: transparent;
&__wrapper {
position: relative;
margin-left: $sidebar--width;
min-height: calc(100vh - #{$navbar--height});
background-color: $content--background-color;
transition: margin-left 0.3s;
}
> .aui-card--fill > .el-card__body {
min-height: calc(#{$content--fill-height} - 2px);
}
> .aui-card--fill > .el-card__header + .el-card__body {
min-height: calc(#{$content--fill-height} - #{$content--card-header-height} - 2px);
}
&--tabs {
padding: $content--tabs-header-height 0 0;
}
&--tabs-tools {
position: fixed;
top: $navbar--height;
right: 0;
z-index: 931;
min-width: $content--tabs-header-height;
height: $content--tabs-header-height;
padding: 0 12px;
text-align: center;
font-size: 16px;
line-height: $content--tabs-header-height;
background-color: $--background-color-base;
cursor: pointer;
}
&--tabs-icon-nav {
display: inline-block;
vertical-align: middle;
font-size: 16px;
}
> .el-tabs {
> .el-tabs__header {
position: fixed;
top: $navbar--height;
left: $sidebar--width;
right: 0;
z-index: 930;
padding: 0 55px 0 15px;
margin: 0;
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
background-color: #fff;
transition: left 0.3s;
> .el-tabs__nav-wrap {
margin-bottom: 0;
&:after {
display: none;
}
> .el-tabs__nav-next,
> .el-tabs__nav-prev {
line-height: $content--tabs-header-height;
}
> .el-tabs__nav-scroll > .el-tabs__nav {
& > .el-tabs__active-bar {
display: none;
}
& > .el-tabs__item {
height: $content--tabs-header-height;
padding: 0 15px;
line-height: $content--tabs-header-height;
border: 0;
color: $--color-text-regular;
&:focus,
&:hover,
&.is-active {
color: $--color-text-primary;
background-color: $--background-color-base;
&:after {
display: block;
}
> .el-icon-close {
color: $--color-text-primary;
}
}
&:after {
display: none;
position: absolute;
bottom: 0;
left: 0;
content: "";
width: 100%;
height: 2px;
background-color: $--color-primary;
}
+ .el-tabs__item {
margin-left: 1px;
}
> .el-icon-close {
width: 14px;
margin-left: 15px;
color: $--color-text-secondary;
}
> i.icon {
display: inline-block;
vertical-align: middle;
font-size: 18px;
}
}
}
}
}
.date {
margin-left: 24px;
display: flex;
align-items: center;
.date-div {
margin: 0 10px;
height: 22px;
width: 1px;
background-color: #fff;
opacity: 0.8;
> .el-tabs__content {
padding: $content--padding;
.el-loading-mask {
z-index: 830;
}
> .el-tab-pane {
min-height: calc(#{$content--fill-height-tabs});
> .aui-card--fill > .el-card__body {
min-height: calc(#{$content--fill-height-tabs} - 2px);
}
> .aui-card--fill > .el-card__header + .el-card__body {
min-height: calc(#{$content--fill-height-tabs} - #{$content--card-header-height} - 2px);
}
&.is-iframe {
height: calc(#{$content--fill-height-tabs} + #{$content--padding * 2});
margin: -$content--padding;
min-height: auto;
> .aui-card--fill {
background-color: transparent;
}
> .aui-card--fill > .el-card__header {
background-color: #fff;
}
> .aui-card--fill > .el-card__body {
height: calc(#{$content--fill-height-tabs} - 2px);
margin: $content--padding;
min-height: auto;
border: $--border-base;
border-color: $--border-color-lighter;
border-radius: $--border-radius-base;
background-color: #fff;
}
> .aui-card--fill > .el-card__header + .el-card__body {
height: calc(#{$content--fill-height-tabs} - #{$content--card-header-height} - 2px);
}
}
}
}
}
// quill富文本编辑器
.ql-toolbar {
line-height: 20px;
&.ql-snow {
border-color: $--border-color-base;
}
.ql-formats {
margin: 0 5px;
}
}
.ql-container {
height: 150px;
&.ql-snow {
border-color: $--border-color-base;
}
}
}
.el-loading-mask {
z-index: 5001 !important;
}
/* Page
------------------------------ */
*[class*="aui-page__"] {
padding-top: 0;
.aui-content {
min-height: auto;
&__wrapper {
min-height: 100vh;
margin-left: 0;
}
> .aui-card--fill > .el-card__body {
min-height: calc(100vh - #{$content--padding * 2} - 2px);
}
> .aui-card--fill > .el-card__header + .el-card__body {
min-height: calc(100vh - #{$content--padding * 2} - #{$content--card-header-height} - 2px);
}
}
}

684
src/assets/scss/main-shuju备份.scss

@ -1,684 +0,0 @@
@import "~@/element-ui/theme-variables.scss";
@import "./shuju-variables.scss";
@import "./c/config";
@import "./c/function";
@import "./modules/visual/c/common.scss";
.g-main {
padding: 10px 20px 10px;
}
.m-iframe {
position: relative;
box-sizing: content-box;
width: calc(100% + 20px);
margin: -10px -20px -10px;
z-index: 100;
}
/* Reset element-ui
------------------------------ */
.g-bd {
background-image: url(../img/shuju/bg.jpg);
background-size: cover;
background-position: center 0;
height: 100%;
@include scrollBar;
.el-card + .el-card {
margin-top: 15px;
}
.el-input__prefix .el-input__icon {
display: inline-block;
vertical-align: middle;
}
.el-date-editor .el-range-separator {
width: 8%;
}
.el-table th {
color: $--color-text-primary;
background-color: $--background-color-base;
}
.el-pagination {
margin-top: 15px;
text-align: right;
}
.el-table__expand-icon {
display: inline-block;
width: 14px;
vertical-align: middle;
margin-right: 5px;
}
}
/* Common
------------------------------ */
// 图标
.icon-svg {
width: 1em;
height: 1em;
fill: currentColor;
vertical-align: middle;
overflow: hidden;
}
// 卡片
.aui-card--fill .el-card__header {
height: $content--card-header-height;
line-height: $content--card-header-height - 36px;
}
.aui-card__title {
font-size: 16px;
}
// 表单
.aui-form__label-icon {
display: inline-block;
margin: 0 3px;
vertical-align: middle;
font-size: 18px;
color: $--color-text-secondary;
}
// 按钮
.aui-button--dashed {
border-style: dashed;
&:focus,
&:hover {
background-color: transparent;
}
&-add {
> span > *[class*="el-icon-"],
> span > *[class*="icon"] {
vertical-align: middle;
font-size: 18px;
margin-right: 5px;
}
}
}
/* Layout
------------------------------ */
.g-bd {
position: relative;
padding-top: $navbar--height;
/* Sidebar fold
------------------------------ */
&.z-sidebar--fold {
.navbar {
&__header,
&__brand {
width: $sidebar--width-fold;
}
&__brand {
&-lg {
display: none;
}
&-mini {
display: inline-block;
}
}
&__icon-menu--switch {
transform: rotateZ(180deg);
}
}
.aui-sidebar {
&__inner {
width: $sidebar--width-fold + 20px;
}
&,
&__menu {
width: $sidebar--width-fold;
}
&__menu > li > .el-submenu__title {
text-align: center;
}
&__menu-icon {
margin-right: 0;
font-size: 18px;
}
}
.g-cnt {
&__wrapper {
margin-left: $sidebar--width-fold;
}
&--tabs > .el-tabs > .el-tabs__header {
left: $sidebar--width-fold;
}
}
}
&.z-sidebar--noside {
.aui-sidebar {
display: none !important;
}
.g-cnt {
&__wrapper {
margin-left: 0 !important;
}
&--tabs > .el-tabs > .el-tabs__header {
left: 0 !important;
}
}
}
&.z-iframe {
padding-top: 0;
.aui-content--tabs {
padding-top: 0;
}
}
}
/* Navbar
------------------------------ */
.m-navbar {
position: fixed;
top: 0;
right: 0;
left: 0;
z-index: 1030;
display: flex;
align-items: stretch;
height: $navbar--height;
// background-color: $--color-primary;
// box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.05);
background: linear-gradient(180deg, #00023f, #176dec);
box-shadow: 0px 3px 16px 0px rgba(187, 187, 227, 0.35);
font-size: 19px;
.el-menu-item {
font-size: 19px;
}
.navbar--colorful {
.navbar__body {
background-color: transparent;
}
.navbar__menu {
> .el-menu-item,
> .el-submenu > .el-submenu__title {
color: #fff;
&:focus,
&:hover {
color: #fff;
background-color: mix(#000, $--color-primary, 15%);
}
}
> .el-menu-item.is-active,
> .el-submenu.is-active > .el-submenu__title {
color: #fff;
&:focus,
&:hover {
color: #fff;
}
}
.el-menu-item i,
.el-submenu__title i,
.el-menu-item svg,
.el-submenu__title svg,
.el-menu-item .el-dropdown {
color: #fff !important;
}
.el-button {
color: #fff;
background-color: transparent;
}
}
.navbar__search {
&-txt {
.el-input__inner {
color: #fff;
border-color: #fff;
&::-webkit-input-placeholder {
color: #fff;
}
}
}
}
}
.navbar__header {
position: relative;
width: $sidebar--width;
height: $navbar--height;
transition: width 0.3s;
}
.navbar__brand {
position: relative;
display: flex;
justify-content: center;
align-items: center;
padding: 10px 20px;
margin: 0;
width: 100%;
height: 100%;
font-size: 28px;
font-weight: bold;
text-transform: uppercase;
white-space: nowrap;
// overflow: hidden;
transition: width 0.3s;
font-family: FZZCHJW;
color: #ffffff;
background: linear-gradient(0deg, #03c7ff 24.609375%, #ffffff 81.0791015625%);
-webkit-background-clip: text;
-webkit-text-fill-color: rgba(#fff, 0.7);
&::before {
position: absolute;
content: "";
z-index: 100000;
display: block;
bottom: -10px;
left: -920px;
right: -1000px;
margin: 0 auto;
width: 400px;
height: 20px;
// background-color: #fff;
background-image: url(../img/shuju/flash.png);
background-size: cover;
background-position: center center;
}
&-lg,
&-mini {
max-width: 100%;
color: #fff;
cursor: pointer;
&:focus,
&:hover {
color: #fff;
text-decoration: none;
}
}
&-mini {
display: none;
}
}
.navbar__body {
position: relative;
display: flex;
flex: 1;
// background-color: #fff;
background-color: transparent;
// overflow: hidden;
}
.navbar__menu {
background-color: transparent;
border-bottom: 0 !important;
a:focus,
a:hover {
text-decoration: none;
}
&.z-div {
.el-menu-item,
.sub-menu {
position: relative;
&.is-active,
&.z-on {
&::before {
position: absolute;
content: "";
display: block;
bottom: -6px;
left: 0;
right: 0;
margin: 0 auto;
width: 50px;
height: 4px;
border: 0;
border-radius: 0 0 2px 2px;
background: #1effff;
}
}
&:last-child {
&::after {
display: none;
}
}
&::after {
position: absolute;
content: "";
right: 0;
top: 0;
bottom: 0;
margin: auto 0;
width: 1px;
height: 18px;
background-color: rgba(#ffffff, 0.6);
}
}
}
.sub-menu {
position: relative;
float: left;
cursor: pointer;
&:hover {
.sub-menu-list {
display: block;
}
}
.sub-menu-list {
position: absolute;
display: none;
padding: 0 10px;
width: 160px;
left: -100px;
right: -100px;
margin: 0 auto;
background-color: rgba(#176dec, 0.9);
text-align: center;
cursor: pointer;
> div {
border-top: 1px dashed rgba(#fff, 0.4);
color: rgba(#fff, 0.7);
transition: all ease 0.5s;
padding: 10px 0;
line-height: $navbar--height * 0.5;
&.z-on {
font-weight: bold;
}
&.z-on,
&:hover {
color: #ffd;
}
}
}
}
.el-menu-item,
.sub-menu {
height: $navbar--height;
padding: 0 15px;
line-height: $navbar--height;
border-color: transparent !important;
color: #fff;
}
.el-menu-item.is-active,
.sub-menu.z-on {
color: #fff;
font-weight: bold;
}
.el-menu-item,
.sub-menu {
i {
color: #fff;
}
&:focus,
&:hover {
color: #fff;
background-color: transparent !important;
.navbar__icon-menu {
color: #fff;
}
.el-dropdown {
color: #fff;
.el-icon-arrow-down {
transform: rotateZ(180deg);
}
}
}
* {
vertical-align: initial;
}
.navbar__icon-menu {
vertical-align: middle;
font-size: 20px;
}
.el-dropdown {
color: #fff;
font-size: 16px;
.el-icon-arrow-down {
width: auto;
font-size: 16px;
margin: 0 0 0 5px;
transition: transform 0.3s;
}
}
}
.el-badge {
display: inline;
z-index: 2;
&__content {
line-height: 16px;
}
}
}
.navbar__search {
> *[class*="el-icon-"],
> *[class*="icon"] {
display: inline-block;
vertical-align: middle;
}
&-txt {
width: 0;
transition: width 0.3s, margin-left 0.3s;
&.is-show {
width: 210px;
margin-left: 8px;
}
.el-input__inner {
height: $navbar--height - 20px;
padding: 0;
line-height: $navbar--height - 20px;
border-color: $--color-text-primary;
border-top: 0;
border-right: 0;
border-left: 0;
border-radius: 0;
background: transparent;
}
}
}
.navbar__avatar {
.el-dropdown-link {
> img {
width: 42px;
height: auto;
margin-right: 7px;
border-radius: 100%;
vertical-align: middle;
}
}
}
}
/* Content
------------------------------ */
.g-cnt {
position: relative;
// padding: $content--padding;
min-height: calc(100vh - #{$navbar--height});
background-color: transparent;
&__wrapper {
position: relative;
margin-left: $sidebar--width;
min-height: calc(100vh - #{$navbar--height});
background-color: $content--background-color;
transition: margin-left 0.3s;
}
> .aui-card--fill > .el-card__body {
min-height: calc(#{$content--fill-height} - 2px);
}
> .aui-card--fill > .el-card__header + .el-card__body {
min-height: calc(#{$content--fill-height} - #{$content--card-header-height} - 2px);
}
&--tabs {
padding: $content--tabs-header-height 0 0;
}
&--tabs-tools {
position: fixed;
top: $navbar--height;
right: 0;
z-index: 931;
min-width: $content--tabs-header-height;
height: $content--tabs-header-height;
padding: 0 12px;
text-align: center;
font-size: 16px;
line-height: $content--tabs-header-height;
background-color: $--background-color-base;
cursor: pointer;
}
&--tabs-icon-nav {
display: inline-block;
vertical-align: middle;
font-size: 16px;
}
> .el-tabs {
> .el-tabs__header {
position: fixed;
top: $navbar--height;
left: $sidebar--width;
right: 0;
z-index: 930;
padding: 0 55px 0 15px;
margin: 0;
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
background-color: #fff;
transition: left 0.3s;
> .el-tabs__nav-wrap {
margin-bottom: 0;
&:after {
display: none;
}
> .el-tabs__nav-next,
> .el-tabs__nav-prev {
line-height: $content--tabs-header-height;
}
> .el-tabs__nav-scroll > .el-tabs__nav {
& > .el-tabs__active-bar {
display: none;
}
& > .el-tabs__item {
height: $content--tabs-header-height;
padding: 0 15px;
line-height: $content--tabs-header-height;
border: 0;
color: $--color-text-regular;
&:focus,
&:hover,
&.is-active {
color: $--color-text-primary;
background-color: $--background-color-base;
&:after {
display: block;
}
> .el-icon-close {
color: $--color-text-primary;
}
}
&:after {
display: none;
position: absolute;
bottom: 0;
left: 0;
content: "";
width: 100%;
height: 2px;
background-color: $--color-primary;
}
+ .el-tabs__item {
margin-left: 1px;
}
> .el-icon-close {
width: 14px;
margin-left: 15px;
color: $--color-text-secondary;
}
> i.icon {
display: inline-block;
vertical-align: middle;
font-size: 18px;
}
}
}
}
}
> .el-tabs__content {
padding: $content--padding;
.el-loading-mask {
z-index: 830;
}
> .el-tab-pane {
min-height: calc(#{$content--fill-height-tabs});
> .aui-card--fill > .el-card__body {
min-height: calc(#{$content--fill-height-tabs} - 2px);
}
> .aui-card--fill > .el-card__header + .el-card__body {
min-height: calc(#{$content--fill-height-tabs} - #{$content--card-header-height} - 2px);
}
&.is-iframe {
height: calc(#{$content--fill-height-tabs} + #{$content--padding * 2});
margin: -$content--padding;
min-height: auto;
> .aui-card--fill {
background-color: transparent;
}
> .aui-card--fill > .el-card__header {
background-color: #fff;
}
> .aui-card--fill > .el-card__body {
height: calc(#{$content--fill-height-tabs} - 2px);
margin: $content--padding;
min-height: auto;
border: $--border-base;
border-color: $--border-color-lighter;
border-radius: $--border-radius-base;
background-color: #fff;
}
> .aui-card--fill > .el-card__header + .el-card__body {
height: calc(#{$content--fill-height-tabs} - #{$content--card-header-height} - 2px);
}
}
}
}
}
// quill富文本编辑器
.ql-toolbar {
line-height: 20px;
&.ql-snow {
border-color: $--border-color-base;
}
.ql-formats {
margin: 0 5px;
}
}
.ql-container {
height: 150px;
&.ql-snow {
border-color: $--border-color-base;
}
}
}
.el-loading-mask {
z-index: 5001 !important;
}
/* Page
------------------------------ */
*[class*="aui-page__"] {
padding-top: 0;
.aui-content {
min-height: auto;
&__wrapper {
min-height: 100vh;
margin-left: 0;
}
> .aui-card--fill > .el-card__body {
min-height: calc(100vh - #{$content--padding * 2} - 2px);
}
> .aui-card--fill > .el-card__header + .el-card__body {
min-height: calc(100vh - #{$content--padding * 2} - #{$content--card-header-height} - 2px);
}
}
}

45
src/router/index.js

@ -176,6 +176,49 @@ function cookApiDataItem3(item, parent = []) {
return item;
}
// 新数据模块
export const dataBoardRoutes = {
path: "/dataBoard",
component: () => import("@/views/dataBoardMain/main"),
name: "dataBoard",
redirect: {
path: "/dataBoard/renfang/index",
},
meta: {
title: "主入口布局",
},
children: [
{
path: "renfang/index",
props: true,
component: () => import("@/views/dataBoard/renfang/index"),
name: "dataBoard-renfang-index",
meta: {
title: "人房总览",
isTab: false,
},
},
{
path: "404",
props: true,
component: () => import("@/views/dataBoard/404"),
name: "dataBoard-404",
meta: {
title: "页面未找到或无权访问",
isTab: false,
},
beforeEnter(to, from, next) {
// 拦截处理特殊业务场景
// 如果, 重定向路由包含__双下划线, 为临时添加路由
if (/__.*/.test(to.redirectedFrom)) {
return next(to.redirectedFrom.replace(/__.*/, ""));
}
next();
},
},
],
};
// 模块路由(基于主入口布局页面) 可视化数据
export const moduleShujuRoutes = {
path: "/main-shuju",
@ -263,7 +306,7 @@ const router = new Router({
scrollBehavior: () => ({
y: 0,
}),
routes: pageRoutes.concat(moduleRoutes, moduleShujuRoutes),
routes: pageRoutes.concat(moduleRoutes, moduleShujuRoutes, dataBoardRoutes),
});
router.beforeEach((to, from, next) => {

16
src/views/dataBoard/404.vue

@ -0,0 +1,16 @@
<template>
<div class="m-404">页面未找到或无权访问</div>
</template>
<script>
export default {};
</script>
<style lang="scss" scoped>
.m-404 {
margin-top: 200px;
font-size: 60px;
color: rgba(#fff, 0.6);
text-align: center;
}
</style>

754
src/views/dataBoard/cpts/map/index.vue

@ -0,0 +1,754 @@
<template>
<div class="m-map" :class="{ 'z-td': mapType == 'td' }">
<div id="map"></div>
<div
class="btn"
v-if="mapStyleType == 'light'"
v-show="false"
@click="shiftMapStyle('dark')"
>
切换深色模式
</div>
<div class="btn" v-show="false" v-else @click="shiftMapStyle('light')">
切换浅色模式
</div>
</div>
</template>
<script>
import { requestPost } from "@/js/dai/request";
import nextTick from "dai-js/tools/nextTick";
import {
Scene,
PolygonLayer,
LineLayer,
RasterLayer,
PointLayer,
} from "@antv/l7";
import { GaodeMap, Map } from "@antv/l7-maps";
import { spliceIntoChunks } from "@/utils/index";
import { mapType, searchNearby } from "@/utils/dai-map";
import tdtWp from "@/utils/tdt-wp";
import tdtWpZw from "@/utils/tdt-wp-zw";
let myMap;
let scene;
let polygonLayer;
let lineLayer;
let textLayer;
let posLayer;
let circleLayer;
let dotLayer;
let dotBgLayer;
let dotLayer2;
export default {
name: "l7",
inject: ["refresh"],
data() {
return {
mapType,
mapStyleType: localStorage.getItem("mapStyle") || "dark",
// srcGridData: {},
darkStyle: {
style: "amap://styles/blue",
polygonColor: [
"rgba(255, 100, 60, 0.5)",
"rgba(43, 231, 253, 0.35)",
"rgba(255, 255, 50, 0.35)",
],
lineColor: [
"rgba(255, 180, 150, 0.9)",
"rgba(43, 231, 253, 0.7)",
"rgba(255, 255, 50, 0.7)",
],
circleColor: [
"rgba(255, 180, 150, 0.99)",
"rgba(43, 231, 253, 0.99)",
"rgba(255, 255, 50, 0.99)",
],
textColor: [
"rgba(255, 100, 60, 0.99)",
"rgba(43, 231, 253, 0.99)",
"rgba(255, 255, 50, 0.99)",
],
textStrokeColor: "#fff",
},
lightStyle: {
style: "amap://styles/whitesmoke",
polygonColor: [
"rgba(255, 100, 60, 0.3)",
"rgba(43, 231, 253, 0.3)",
"rgba(255, 255, 50, 0.3)",
],
lineColor: [
"rgba(220, 150, 120, 0.9)",
"rgba(33, 201, 223, 0.8)",
"rgba(200, 200, 50, 0.9)",
],
circleColor: [
"rgba(255, 180, 150, 0.99)",
"rgba(13, 181, 203, 0.8)",
"rgba(255, 255, 50, 0.99)",
],
textColor: [
"rgba(200, 50, 10, 0.99)",
"rgba(0, 130, 153, 0.99)",
"rgba(120, 120, 0, 0.99)",
],
textStrokeColor: "#666",
},
};
},
props: {
pitch: {
type: Number,
default: 60,
},
srcGridData: {
type: Object,
default: null,
},
dotList: {
type: Array,
default: () => [],
},
dotIcoList: {
type: Object,
default: () => ({}),
},
dotList2: {
type: Array,
default: () => [],
},
dotIcoList2: {
type: Object,
default: () => ({}),
},
},
computed: {},
components: {},
watch: {},
async mounted() {
//
window._AMapSecurityConfig = {
securityJsCode: "92ea2c965c6cf1ba7ee3a8fe01449ef2",
};
this.iniMap();
},
computed: {
polygonData() {
const { srcGridData } = this;
if (
!srcGridData ||
!srcGridData.children ||
!Array.isArray(srcGridData.children)
) {
return { type: "FeatureCollection", features: [] };
}
const polygon = [
...srcGridData.children
.filter((item) => item.coordinates.length > 0)
.map((item) => ({
type: "Feature",
properties: {
// id: item.id,
// name: item.name,
// level: item.level,
center: [item.longitude, item.latitude],
...item,
},
geometry: {
type: "Polygon",
coordinates: [
spliceIntoChunks(
item.coordinates.split(",").map((item) => parseFloat(item)),
2
).filter((item) => item.length == 2),
],
},
})),
];
return { type: "FeatureCollection", features: polygon };
},
polygonDotData() {
const { srcGridData } = this;
if (
!srcGridData ||
!srcGridData.children ||
!Array.isArray(srcGridData.children)
) {
return { type: "FeatureCollection", features: [] };
}
const polygon = [
...srcGridData.children
.filter((item) => item.coordinates.length > 0)
.map((item) => ({
type: "Feature",
properties: {
// id: item.id,
// name: item.name,
// level: item.level,
center: [item.longitude, item.latitude],
...item,
},
geometry: {
type: "Polygon",
coordinates: [
item.latitude
? [[item.longitude, item.latitude]]
: spliceIntoChunks(
item.coordinates
.split(",")
.map((item) => parseFloat(item)),
2
).filter((item) => item.length == 2),
],
},
})),
];
return { type: "FeatureCollection", features: polygon };
},
dotData() {
const { dotList } = this;
return {
type: "FeatureCollection",
features: [
...dotList
.filter((item) => item.latitude)
.map((item) => ({
type: "Feature",
properties: {
...item,
},
geometry: {
type: "Point",
coordinates: [
parseFloat(item.longitude),
parseFloat(item.latitude),
],
},
})),
],
};
},
dotData2() {
const { dotList2 } = this;
return {
type: "FeatureCollection",
features: [
...dotList2
.filter((item) => item.latitude)
.map((item) => ({
type: "Feature",
properties: {
...item,
},
geometry: {
type: "Point",
coordinates: [
parseFloat(item.longitude),
parseFloat(item.latitude),
],
},
})),
],
};
},
},
watch: {
srcGridData(val, oldValue) {
if (oldValue == null) {
this.iniMap();
} else {
this.updateGrid();
}
this.zoomInABit();
},
dotList(val, oldValue) {
this.updateDot();
},
dotList2(val, oldValue) {
this.updateDot();
},
},
methods: {
iniMap() {
const { darkStyle, lightStyle, srcGridData } = this;
if (!srcGridData) return false;
let styleConfig = darkStyle;
if (this.mapStyleType == "light") {
styleConfig = lightStyle;
}
const iniCenter = [
srcGridData.longitude ||
this.$store.state.user.longitude ||
116.39743841556731,
srcGridData.latitude ||
this.$store.state.user.latitude ||
39.9088810666821,
];
if (mapType != "qq") {
myMap = new Map({
center: iniCenter,
zoom: 18,
});
} else {
myMap = new GaodeMap({
// pitch: this.pitch,
style: styleConfig.style,
center: iniCenter,
token: "fc14b42e0ca18387866d68ebd4f150c1",
zoom: 18,
isHotspot: false,
resizeEnable: true,
doubleClickZoom: false,
});
}
scene = new Scene({
id: "map",
logoVisible: false,
map: myMap,
});
scene.on("loaded", async () => {
if (mapType == "td") {
this.iniMapBase(scene);
} else if (mapType == "tdzw") {
this.iniMapBase2(scene);
}
this.iniMapGrid(scene);
this.iniMapDot(scene);
this.iniMapDot2(scene);
await nextTick(0);
this.zoomInABit();
});
},
//
iniMapBase(scene) {
console.log("-----------------iniMapBase");
//
const baseLayer = new RasterLayer({
zIndex: 1,
});
baseLayer
.source(
"http://t7.tianditu.com/DataServer?T=vec_w&tk=8a08c117ab9ee45d508686b01cc8d397&x={x}&y={y}&l={z}",
{
parser: {
type: "rasterTile",
tileSize: 256,
// minZoom: 6,
// maxZoom: 15,
zoomOffset: 0,
},
}
)
.style({
opacity: 0.7,
});
//
const annotionLayer = new RasterLayer({
zIndex: 2,
});
annotionLayer
.source(
"http://t7.tianditu.com/DataServer?T=cva_w&tk=8a08c117ab9ee45d508686b01cc8d397&x={x}&y={y}&l={z}",
{
parser: {
type: "rasterTile",
tileSize: 256,
// minZoom: 6,
// maxZoom: 15,
zoomOffset: 0,
},
}
)
.style({
opacity: 0.5,
});
scene.addLayer(baseLayer);
scene.addLayer(annotionLayer);
},
//
iniMapBase2(scene) {
console.log("-----------------iniMapBase");
//
const baseLayer = new RasterLayer({
zIndex: 1,
});
baseLayer
.source(tdtWpZw.vec, {
parser: {
type: "rasterTile",
tileSize: 256,
zoomOffset: 0,
},
})
.style({
opacity: 0.7,
});
scene.addLayer(baseLayer);
},
iniMapGrid(scene) {
const { darkStyle, lightStyle, polygonData, polygonDotData } = this;
let styleConfig = darkStyle;
if (this.mapStyleType == "light") {
styleConfig = lightStyle;
}
console.log("地图初始化数据", polygonData);
polygonLayer = new PolygonLayer({
autoFit: true,
})
// .size(0)
.source(polygonData)
.color("name", styleConfig.polygonColor)
// .shape("extrude")
.shape("fill")
.style({
opacityLinear: {
enable: true, // true - false
dir: "out", // in - out
},
opacity: 1,
// heightfixed: true,
// pickLight: true,
raisingHeight: 0,
// sourceColor: "#333",
// targetColor: "rgba(255,255,255, 0.5)",
});
scene.addLayer(polygonLayer);
lineLayer = new LineLayer({
zIndex: 2,
name: "line2",
})
.source(polygonData)
.shape("line")
.size(1)
.color("name", styleConfig.lineColor)
.style({
opacity: 1,
})
.animate({
interval: 1, //
duration: 2, //
trailLength: 2, // 线
});
scene.addLayer(lineLayer);
circleLayer = new PolygonLayer({
zIndex: 3,
})
.source(polygonDotData)
.color("name", styleConfig.circleColor)
.shape("circle")
.active(true)
.animate(true)
.size(50)
.style({
offsets: [0, -10], // [, ]
opacity: 1,
});
scene.addLayer(circleLayer);
scene.addImage("pos-red", require("@/assets/img/shuju/grid/pos-red.png"));
scene.addImage(
"pos-green",
require("@/assets/img/shuju/grid/pos-green.png")
);
scene.addImage(
"pos-yellow",
require("@/assets/img/shuju/grid/pos-yellow.png")
);
posLayer = new PolygonLayer({
zIndex: 4,
})
.source(polygonDotData)
.shape("name", ["pos-red", "pos-green", "pos-yellow"])
.size(12)
.style({
offsets: [0, 8], // [, ]
// rotation: 60,
// layerType: "fillImage",
});
scene.addLayer(posLayer);
textLayer = new PolygonLayer({
zIndex: 20,
})
.source(polygonDotData)
.color("name", styleConfig.textColor)
.shape("name", "text")
.size(16)
.style({
textAnchor: "center", // center|left|right|top|bottom|top-left
textOffset: [0, 40], // [, ]
spacing: 2, //
padding: [2, 2], // padding []
stroke: styleConfig.textStrokeColor, //
strokeWidth: 0.1, //
strokeOpacity: 0.8,
textAllowOverlap: true,
})
.active(true);
scene.addLayer(textLayer);
polygonLayer.on("mousemove", (e) => {
polygonLayer.style({
raisingHeight: 0,
});
});
polygonLayer.on("click", (e) => {
console.log(e.feature.properties);
this.$emit("clickAgency", e.feature.properties);
});
polygonLayer.on("unmousemove", (e) => {
polygonLayer.style({
raisingHeight: 0,
});
});
},
iniMapDot(scene) {
const { darkStyle, lightStyle, dotIcoList, dotData } = this;
Object.keys(dotIcoList).forEach((k) => {
scene.addImage(k, dotIcoList[k]);
});
dotBgLayer = new PointLayer({
zIndex: 20,
})
.source(dotData)
.shape("circle")
.color("rgba(255,255,255,0.8)")
.size(20)
.style({
strokeWidth: 3,
strokeOpacity: 0.1,
stroke: "#000",
});
scene.addLayer(dotBgLayer);
dotLayer = new PointLayer({
zIndex: 21,
})
.source(dotData)
.shape("categoryKey", (k) => k)
.size(10)
.style({
offsets: [0, 0],
layerType: "fillImage",
});
scene.addLayer(dotLayer);
dotBgLayer.on("click", (e) => {
console.log(e.feature.properties);
this.$emit("clickDot", e.feature.properties);
});
dotBgLayer.on("mousemove", (e) => {
// console.log(e);
if (e.feature.properties.content) {
const popup = new Popup({
offsets: [0, -0],
closeButton: false,
})
.setLnglat(e.feature.geometry.coordinates)
.setHTML(`<span>${e.feature.properties.content}</span>`);
scene.addPopup(popup);
}
});
dotBgLayer.on("unmousemove", (e) => {});
},
iniMapDot2(scene) {
const { dotIcoList2: dotIcoList, dotData2: dotData } = this;
Object.keys(dotIcoList).forEach((k) => {
scene.addImage(k, dotIcoList[k]);
});
dotLayer2 = new PointLayer({
zIndex: 21,
})
.source(dotData)
.shape("categoryKey", (k) => k)
.size(20)
.style({
offsets: [0, 0],
layerType: "fillImage",
});
scene.addLayer(dotLayer2);
dotLayer2.on("click", (e) => {
console.log(e.feature.properties);
this.$emit("clickDot", e.feature.properties);
});
dotLayer2.on("mousemove", (e) => {
// console.log(e);
if (e.feature.properties.content) {
const popup = new Popup({
offsets: [0, -0],
closeButton: false,
})
.setLnglat(e.feature.geometry.coordinates)
.setHTML(`<span>${e.feature.properties.content}</span>`);
scene.addPopup(popup);
}
});
dotLayer2.on("unmousemove", (e) => {});
},
//
zoomInABit() {
let current = scene.getZoom();
scene.setZoomAndCenter(current + 0.5);
},
shiftMapStyle(type) {
this.mapStyleType = type;
localStorage.setItem("mapStyle", type);
this.refresh();
},
updateMap() {
this.updateGrid();
this.updateDot();
this.updateDot2();
},
updateGrid() {
const { polygonData, polygonDotData } = this;
if (polygonLayer) {
polygonLayer.setData(polygonData);
lineLayer.setData(polygonData);
textLayer.setData(polygonDotData);
posLayer.setData(polygonDotData);
circleLayer.setData(polygonDotData);
}
},
updateDot() {
const { dotData } = this;
if (dotLayer) {
console.log(dotData);
dotLayer.setData(dotData);
dotBgLayer.setData(dotData);
}
},
updateDot2() {
const { dotData2: dotData } = this;
if (dotLayer2) {
console.log(dotData);
dotLayer2.setData(dotData);
}
},
},
};
</script>
<style lang="scss" scoped>
.m-map {
position: relative;
height: 100%;
border-radius: 50px;
overflow: hidden;
opacity: 0.9;
background-color: #020c38;
&::after {
position: absolute;
content: "";
display: block;
top: 0;
left: 0;
right: 0;
bottom: 0;
pointer-events: none;
background: radial-gradient(
rgba(#020c38, 0) 0%,
rgba(#020c38, 0) 60%,
rgba(#020c38, 1) 90%,
rgba(#020c38, 1) 100%
);
}
&.z-td {
#app {
/deep/ .l7-scene {
canvas {
background-color: rgba(43, 51, 73, 0.82);
background-image: radial-gradient(
rgba(0, 0, 0, 0),
rgba(0, 0, 0, 0.3),
#000
);
}
.gray {
-webkit-filter: grayscale(100%);
filter: grayscale(100%);
opacity: 0.7;
}
}
}
}
#map {
width: 100%;
height: 100%;
}
.btn {
position: absolute;
bottom: 0;
left: 0;
width: 100px;
line-height: 36px;
height: 36px;
text-align: center;
color: #ffffff;
font-size: 14px;
background-color: rgba(#000, 0.2);
cursor: pointer;
}
}
</style>

196
src/views/dataBoard/renfang/index.vue

@ -0,0 +1,196 @@
<template>
<div class="g-row">
<div class="g-left">
<div class="m-box">
<div class="box-title">
<img
src="~@/assets/images/shuju/main/card-title-bg-480.png"
class="box-title-bg"
/>
<div class="box-title-txt">房屋概览</div>
</div>
<div class="m-subbox"></div>
</div>
<div class="m-box">
<div class="box-title">
<img
src="~@/assets/images/shuju/main/card-title-bg-480.png"
class="box-title-bg"
/>
<div class="box-title-txt">居民概览</div>
</div>
<div class="m-subbox"></div>
</div>
</div>
<div class="g-center">
<div class="m-map">
<grid-map
v-if="orgData.id"
@clickAgency="clickAgencyItem"
:srcGridData="orgData"
/>
</div>
<div class="m-box m-cate">
<div class="box-title">
<img
src="~@/assets/images/shuju/main/card-title-bg-800.png"
class="box-title-bg"
/>
<div class="box-title-txt">居民分类分析</div>
<div class="box-title-btn">
<img src="~@/assets/images/shuju/renfang/index/znyc.png" />
<span>智能预测</span>
</div>
</div>
<div class="list">
<div
class="item"
:key="item.code"
v-for="(item, index) in warningData"
>
<div>{{ ("0" + (index + 1)).substr(-2) }}.</div>
<div class="item-name">{{ item.name }}</div>
<div class="item-count">
<b>{{ item.count }}</b>
</div>
<div class="item-progress">
<b :style="{ width: item.count + '%' }"></b>
</div>
<div class="item-per">
<span>较上月</span>
<img
v-if="false"
src="~@/assets/images/shuju/renfang/index/up.png"
/>
<img v-else src="~@/assets/images/shuju/renfang/index/down.png" />
<b>{{ item.count }}</b>
<span></span>
</div>
</div>
</div>
</div>
</div>
<div class="g-right">
<div class="m-box">
<div class="box-title">
<img
src="~@/assets/images/shuju/main/card-title-bg-480.png"
class="box-title-bg"
/>
<div class="box-title-txt">人口分析</div>
</div>
<div class="m-subbox"></div>
</div>
<div class="m-box">
<div class="box-title">
<img
src="~@/assets/images/shuju/main/card-title-bg-480.png"
class="box-title-bg"
/>
<div class="box-title-txt">人口预警</div>
</div>
<div class="m-subbox"></div>
</div>
</div>
</div>
</template>
<script>
import gridMap from "@/views/dataBoard/cpts/map/index";
import { requestPost } from "@/js/dai/request";
import getQueryPara from "dai-js/modules/getQueryPara";
export default {
components: { gridMap },
data() {
return {
orgData: {}, //
orgId: "",
orgLevel: "",
subAgencyArray: [],
warningData: [],
};
},
async mounted() {
const queryOrgId = getQueryPara("orgId");
const queryOrgLevel = getQueryPara("orgLevel");
console.log("orgId", queryOrgId);
if (queryOrgId) {
this.orgId = queryOrgId;
this.orgLevel = queryOrgLevel || "agency";
}
//
await this.loadOrgData();
this.getWarningList();
},
methods: {
//
async getWarningList() {
const url = "/epmetuser/statsresiwarn/list";
let params = {
id: this.orgData.id,
level: "agency",
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.warningData = data.map((item) => {
return {
code: item.columnName,
name: item.label,
count: item.count,
const: "const",
};
});
} else {
this.$message.error(msg);
}
},
//
async loadOrgData() {
const url = "/gov/org/agency/maporg";
let params = {
orgId: this.orgId,
level: this.orgLevel,
};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.orgData = data;
this.orgId = this.orgData.id;
this.orgLevel = this.orgData.level;
if (data.children && data.children.length > 0) {
this.subAgencyArray = data.children;
} else {
this.subAgencyArray = [];
}
} else {
this.$message.error(msg);
}
},
},
};
</script>
<style
lang="scss"
src="@/assets/scss/dataBoard/renfang/index.scss"
scoped
></style>

129
src/views/dataBoardMain/main-content.vue

@ -0,0 +1,129 @@
<template>
<main class="g-main">
<!-- tab展示内容 -->
<template>
<template v-if="tabIsIframe($router.currentRoute.meta.iframeURL)">
<iframe
:src="
$router.currentRoute.meta.iframeURL +
'?token=' +
token +
'&customerId=' +
customerId
"
ref="iframe"
class="m-iframe"
id="iframe"
width="100%"
height="100%"
frameborder="0"
scrolling="yes"
:style="{ height: $store.state.fixed1920.height - 100 + 'px' }"
/>
</template>
<keep-alive v-show="!tabIsIframe($router.currentRoute.meta.iframeURL)">
<router-view @changeCustomerName="changeCustomerName" />
</keep-alive>
</template>
</main>
</template>
<script>
import { isURL } from "@/utils/validate";
import Cookie from "js-cookie";
export default {
data() {
return {
iframeUrl: "",
token: "",
customerId: "",
};
},
watch: {
// "$router.currentRoute.name": function () {
// console.log($router.currentRoute);
// },
},
created() {
this.token = localStorage.getItem("token");
this.customerId = localStorage.getItem("customerId");
},
methods: {
changeCustomerName(customerName) {
this.$emit("changeCustomerName", customerName);
},
// tabs, iframe
tabIsIframe(url) {
// this.appendIframe(url)
// this.iframeUrl =
// url +
// "?token=" +
// localStorage.getItem("token") +
// "&customerId=" +
// localStorage.getItem("customerId");
// return /^http[s]?:\/\/.*/.test(url);
return isURL(url);
},
// tabs, tab
tabSelectedHandle(tab) {
tab = this.$store.state.contentTabs.filter(
(item) => item.name === tab.name
)[0];
if (tab) {
this.$router.push({
name: tab.name,
params: { ...tab.params },
query: { ...tab.query },
});
}
},
// tabs, tab
tabRemoveHandle(tabName) {
if (tabName === "home") {
return false;
}
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(
(item) => item.name !== tabName
);
if (this.$store.state.contentTabs.length <= 0) {
this.$store.state.sidebarMenuActiveName =
this.$store.state.contentTabsActiveName = "home";
return false;
}
// tab
if (tabName === this.$store.state.contentTabsActiveName) {
let tab =
this.$store.state.contentTabs[
this.$store.state.contentTabs.length - 1
];
this.$router.push({
name: tab.name,
params: { ...tab.params },
query: { ...tab.query },
});
}
},
// tabs,
tabsCloseOtherHandle() {
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(
(item) => {
return (
item.name === "home" ||
item.name === this.$store.state.contentTabsActiveName
);
}
);
},
// tabs,
tabsCloseAllHandle() {
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(
(item) => item.name === "home"
);
this.$router.push({ name: "home" });
},
},
};
</script>
<style lang="scss" src="@/assets/scss/dataBoardMain.scss" scoped></style>

336
src/views/dataBoardMain/main-navbar.vue

@ -0,0 +1,336 @@
<template>
<div class="m-topnav">
<div class="title">{{ customerName }}综合服务平台数据看板</div>
<div class="nav-list z-left">
<div
class="nav-item"
:class="{ 'z-on': $route.path == '/dataBoard/renfang/index' }"
@click="toPage('/board')"
>
<span>人房总览</span>
</div>
<div class="nav-item" @click="toPage('/')">
<span>人口分析</span>
</div>
<div class="nav-item" @click="toPage('/')">
<span>人口变化</span>
</div>
<div class="nav-item" @click="toPage('/')">
<span>人口预警</span>
</div>
</div>
<div class="nav-list z-right">
<div class="nav-item" @click="toPage('/')">
<span>回首页</span>
</div>
</div>
<div class="msg">
<div class="weather">
<img
v-if="weather.weather == '小雨'"
src="~@/assets/images/shuju/main/weather/xiaoyu.png"
/>
<img
v-if="weather.weather == '中雨'"
src="~@/assets/images/shuju/main/weather/zhongyu.png"
/>
<img
v-if="weather.weather == '大雨'"
src="~@/assets/images/shuju/main/weather/dayu.png"
/>
<img
v-if="weather.weather == '雷雨'"
src="~@/assets/images/shuju/main/weather/leiyu.png"
/>
<img
v-if="weather.weather == '雷暴'"
src="~@/assets/images/shuju/main/weather/leibao.png"
/>
<img
v-if="weather.weather == '雨雪'"
src="~@/assets/images/shuju/main/weather/yuxue.png"
/>
<img
v-if="weather.weather == '阴'"
src="~@/assets/images/shuju/main/weather/yin.png"
/>
<img
v-if="weather.weather == '雾'"
src="~@/assets/images/shuju/main/weather/wu.png"
/>
<img
v-if="weather.weather == '风'"
src="~@/assets/images/shuju/main/weather/feng.png"
/>
<img
v-else-if="weather.weather == '雪'"
src="~@/assets/images/shuju/main/weather/xue.png"
/>
<img
v-else-if="weather.weather == '多云'"
src="~@/assets/images/shuju/main/weather/duoyun.png"
/>
<img v-else src="~@/assets/images/shuju/main/weather/qing.png" />
<div>{{ weather.temperature }}</div>
<div>{{ weather.weather }}</div>
</div>
<div class="date">
<div class="date-time">{{ showTime }}</div>
<div class="date-div"></div>
<div class="date-week">{{ showWeek }}</div>
</div>
</div>
<nav v-if="false" class="m-navbar">
<div class="navbar__header">
<h1 class="navbar__brand" @click="$router.push({ name: 'home' })">
<a class="navbar__brand-lg" href="javascript:;">{{ customerName }}</a>
<a class="navbar__brand-mini" href="javascript:;">{{
customerName.slice(0, 2)
}}</a>
</h1>
</div>
<div class="navbar__body">
<el-menu class="navbar__menu mr-auto" mode="horizontal">
<el-menu-item
index="1"
@click="$store.state.sidebarFold = !$store.state.sidebarFold"
>
<svg
class="icon-svg navbar__icon-menu navbar__icon-menu--switch"
aria-hidden="true"
>
<use xlink:href="#icon-outdent"></use>
</svg>
</el-menu-item>
<el-menu-item index="2" @click="refresh()">
<svg class="icon-svg navbar__icon-menu" aria-hidden="true">
<use xlink:href="#icon-sync"></use>
</svg>
</el-menu-item>
</el-menu>
<el-menu
:default-active="$store.state.mainShuju.activeName"
:unique-opened="true"
:collapseTransition="false"
mode="horizontal"
class="navbar__menu mr-auto z-div"
>
<el-menu-item index="index" @click="toIndexPage">
<span>首页</span>
</el-menu-item>
<template v-for="(menu, idx) in $store.state.mainShuju.menuList">
<li
class="sub-menu"
:class="
$store.state.mainShuju.activeName == menu.id ? 'z-on' : ''
"
v-if="menu.children"
:key="menu.id"
@click="gotoRouteHandle(menu.id, idx)"
>
<span>{{ menu.name }}</span>
<div class="sub-menu-list">
<div
:class="
$store.state.mainShuju.activeName == subMenu.id
? 'z-on'
: ''
"
:key="subMenu.id"
@click="gotoRouteHandle(subMenu.id, subIndex)"
v-for="(subMenu, subIndex) in menu.children"
>
{{ subMenu.name }}
</div>
</div>
</li>
<el-menu-item
v-else
:key="menu.id"
:menu="menu"
:index="menu.id"
@click="gotoRouteHandle(menu.id, idx)"
>
<span>{{ menu.name }}</span>
</el-menu-item>
</template>
</el-menu>
<el-menu class="navbar__menu" mode="horizontal">
<!-- <el-menu-item index="1">
<el-dropdown placement="bottom"
:show-timeout="0">
<el-button size="mini">{{ $t('_lang') }}</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-for="(val, key) in i18nMessages"
:key="key"
@click.native="$i18n.locale = key">{{ val._lang }}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</el-menu-item> -->
<!-- <el-menu-item index="2">
<a href="//www.renren.io/"
target="_blank">
<svg class="icon-svg navbar__icon-menu"
aria-hidden="true">
<use xlink:href="#icon-earth"></use>
</svg>
</a>
</el-menu-item> -->
<el-menu-item index="3" @click="fullscreenHandle()">
<svg class="icon-svg navbar__icon-menu" aria-hidden="true">
<use xlink:href="#icon-fullscreen"></use>
</svg>
</el-menu-item>
<el-menu-item index="4" class="navbar__avatar">
<el-dropdown placement="bottom" :show-timeout="0">
<span class="el-dropdown-link">
<img src="~@/assets/img/staff-default-avatar.png" />
<span>{{ $store.state.user.realName }}</span>
<i class="el-icon-arrow-down"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="updatePasswordHandle()">{{
$t("updatePassword.title")
}}</el-dropdown-item>
<el-dropdown-item @click.native="logoutHandle()">{{
$t("logout")
}}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</el-menu-item>
</el-menu>
</div>
<!-- 弹窗, 修改密码 -->
<update-password-work
v-if="updatePassowrdVisible"
ref="updatePassowrd"
></update-password-work>
</nav>
</div>
</template>
<script>
import { messages } from "@/i18n";
import UpdatePasswordWork from "@/views/main-navbar-update-password-work";
import dateFormat from "dai-js/tools/dateFormat";
import nextTick from "dai-js/tools/nextTick";
import { requestGet } from "@/js/dai/request";
export default {
inject: ["refresh"],
data() {
return {
showHeader: true,
i18nMessages: messages,
updatePassowrdVisible: false,
customerName: "",
showWeek: "",
showTime: "",
weather: {
weather: "晴",
temperature: "--",
},
};
},
components: {
UpdatePasswordWork,
},
created() {
this.changeCustomerName();
const customerId = localStorage.getItem("customerId");
let siteconfigElement = window.SITE_CONFIG["menuShujuList"];
// 亿 -
if (
"04c0d396e298f13e57aa5904a657eaa6" != customerId &&
"3fdd0380deff5b30f45376cdf995d1c1" != customerId
) {
for (let index in siteconfigElement) {
if (siteconfigElement[index].id == "6") {
let newMenuArr = siteconfigElement[index].children.filter(
(item) => item.id !== "duoyuanfuwufenxi"
);
siteconfigElement[index].children = newMenuArr;
}
}
}
this.$store.state.mainShuju.menuList = siteconfigElement;
const pollTime = async () => {
this.computeCurrentTime();
await nextTick(1000);
pollTime();
};
pollTime();
this.getWeatherData();
},
computed: {},
methods: {
computeCurrentTime() {
let now = new Date();
let wk = now.getDay();
this.showWeek = [
"星期日",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六",
][wk];
this.showTime = dateFormat(now, "yyyy-MM-dd hh:mm:ss");
},
toPage(path) {
this.$router.push({ path });
},
toIndexPage() {
this.$router.replace("/");
},
// menuId()
gotoRouteHandle(menuId, idx) {
var route = window.SITE_CONFIG["dynamicMenuRoutesShuju"].filter(
(item) => item.meta.menuId === menuId
)[0];
if (route) {
this.$router.push({ name: route.name });
this.$store.state.mainShuju.activeName = menuId;
}
},
changeCustomerName() {
this.customerName =
localStorage.getItem("customerName") || "数据分析可视化平台";
},
async getWeatherData() {
const url =
"https://restapi.amap.com/v3/weather/weatherInfo?key=8c87678f34ce9e8e23245c5161991c4e";
const { data, code, msg } = await requestGet(url, {
city: this.$store.state.user.areaCode,
});
if (code === 0) {
console.log("---------------weather", data);
this.weather = data.lives[0];
} else {
// return this.$message.error("");
}
},
},
};
</script>
<style lang="scss" src="@/assets/scss/dataBoardMain.scss" scoped></style>

156
src/views/dataBoardMain/main.vue

@ -0,0 +1,156 @@
<template>
<fixed1920 class="g-fx">
<div
v-loading.fullscreen.lock="loading"
:element-loading-text="$t('loading')"
:class="[
'g-pg',
{ 'z-sidebar--fold': $store.state.sidebarFold },
{
'z-sidebar--noside': true,
},
{ 'z-iframe': $store.state.inIframe },
]"
>
<template v-if="!loading">
<img
class="i-corner z-left-top"
src="~@/assets/images/shuju/main/corner-left-top.png"
/>
<img
class="i-corner z-right-top"
src="~@/assets/images/shuju/main/corner-right-top.png"
/>
<img
class="i-corner z-right-bottom"
src="~@/assets/images/shuju/main/corner-right-bottom.png"
/>
<img
class="i-corner z-left-bottom"
src="~@/assets/images/shuju/main/corner-left-bottom.png"
/>
<main-navbar ref="ref_navbar" v-if="!$store.state.inIframe" />
<div class="g-cnt">
<main-content
v-if="!$store.state.contentIsNeedRefresh"
@changeCustomerName="changeCustomerName"
/>
</div>
</template>
</div>
</fixed1920>
</template>
<script>
import MainNavbar from "./main-navbar";
import MainContent from "./main-content";
import debounce from "lodash/debounce";
import { mapGetters } from "vuex";
import nextTick from "dai-js/tools/nextTick";
import { requestPost } from "@/js/dai/request";
import fixed1920 from "@/views/components/fixed1920.vue";
export default {
provide() {
return {
//
refresh() {
this.$store.state.contentIsNeedRefresh = true;
this.$nextTick(() => {
this.$store.state.contentIsNeedRefresh = false;
});
},
};
},
data() {
return {
loading: true,
userType: localStorage.getItem("userType"),
};
},
components: {
MainNavbar,
MainContent,
fixed1920,
},
watch: {
$route: "routeHandle",
},
async created() {
this.windowResizeHandle();
this.routeHandle(this.$route);
Promise.all([this.getWorkUserInfo()]).then(() => {
this.loading = false;
});
},
computed: {},
methods: {
changeCustomerName(customerName) {
this.$refs["ref_navbar"].changeCustomerName(customerName);
},
//
windowResizeHandle() {
this.$store.state.sidebarFold =
document.documentElement["clientWidth"] <= 992 || false;
window.addEventListener(
"resize",
debounce(() => {
this.$store.state.sidebarFold =
document.documentElement["clientWidth"] <= 992 || false;
}, 150)
);
},
// ,
routeHandle(route) {
if (!route.meta.isTab) {
this.$store.state.mainShuju.activeName = "";
this.$store.state.mainShuju.contentTabsActiveName = "";
return false;
}
var tab = this.$store.state.contentTabs.filter(
(item) => item.name === route.name
)[0];
if (!tab) {
tab = {
...window.SITE_CONFIG["contentTabDefault"],
...route.meta,
name: route.name,
params: { ...route.params },
query: { ...route.query },
};
this.$store.state.contentTabs =
this.$store.state.contentTabs.concat(tab);
}
this.$store.state.mainShuju.activeName = tab.menuId;
this.$store.state.mainShuju.contentTabsActiveName = tab.name;
},
//
async getWorkUserInfo() {
const url = "/epmetuser/customerstaff/staffbasicinfo";
let params = {};
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.$store.state.user = { ...data };
console.log("user---hahha", this.$store.state.user);
localStorage.setItem("roleList", data.roleList);
localStorage.setItem("customerId", data.customerId);
localStorage.setItem("staffId", data.id);
localStorage.setItem("agencyId", data.agencyId);
localStorage.setItem("level", data.level);
if (!localStorage.getItem("customerName")) {
localStorage.setItem("customerName", data.customerName || "");
}
} else {
this.$message.error(msg);
}
},
},
};
</script>
<style lang="scss" src="@/assets/scss/dataBoardMain.scss" scoped></style>

304
src/views/main-shuju/main-navbar.vue

@ -1,134 +1,82 @@
<template>
<div class="m-topnav">
<div class="title">{{ customerName }}综合服务平台数据看板</div>
<div class="nav-list z-left">
<div class="nav-item" @click="toPage('/')">
<span>人房统计</span>
</div>
<div class="nav-item z-on" @click="toPage('/')">
<span>人口分析</span>
</div>
<div class="nav-item" @click="toPage('/')">
<span>人口变化</span>
</div>
<div class="nav-item" @click="toPage('/')">
<span>人口预警</span>
</div>
</div>
<div class="nav-list z-right">
<div class="nav-item" @click="toPage('/')">
<span>回首页</span>
</div>
</div>
<div class="msg">
<div class="weather">
<img
v-if="weather.weather == '雨'"
src="~@/assets/images/shuju/main/corner-left-top.png"
/>
<img
v-else-if="weather.weather == '雪'"
src="~@/assets/images/shuju/main/corner-left-top.png"
/>
<img
v-else-if="weather.weather == '多云'"
src="~@/assets/images/shuju/main/corner-left-top.png"
/>
<img v-else src="~@/assets/images/shuju/main/corner-left-top.png" />
<div>{{ weather.temperature }}</div>
<div>{{ weather.weather }}</div>
</div>
<div class="date">
<div class="date-time">{{ showTime }}</div>
<div class="date-div"></div>
<div class="date-week">{{ showWeek }}</div>
</div>
</div>
<nav v-if="false" class="m-navbar">
<div>
<nav v-if="showHeader"
class="m-navbar">
<div class="navbar__header">
<h1 class="navbar__brand" @click="$router.push({ name: 'home' })">
<a class="navbar__brand-lg" href="javascript:;">{{ customerName }}</a>
<a class="navbar__brand-mini" href="javascript:;">{{
customerName.slice(0, 2)
<h1 class="navbar__brand"
@click="$router.push({ name: 'home' })">
<a class="navbar__brand-lg"
href="javascript:;">{{ $store.state.user.agencyName }}</a>
<a class="navbar__brand-mini"
href="javascript:;">{{
$store.state.user.agencyName.slice(0, 2)
}}</a>
</h1>
</div>
<div class="navbar__body">
<el-menu class="navbar__menu mr-auto" mode="horizontal">
<el-menu-item
index="1"
@click="$store.state.sidebarFold = !$store.state.sidebarFold"
>
<svg
class="icon-svg navbar__icon-menu navbar__icon-menu--switch"
aria-hidden="true"
>
<el-menu class="navbar__menu mr-auto"
mode="horizontal">
<el-menu-item index="1"
@click="$store.state.sidebarFold = !$store.state.sidebarFold">
<svg class="icon-svg navbar__icon-menu navbar__icon-menu--switch"
aria-hidden="true">
<use xlink:href="#icon-outdent"></use>
</svg>
</el-menu-item>
<el-menu-item index="2" @click="refresh()">
<svg class="icon-svg navbar__icon-menu" aria-hidden="true">
<el-menu-item index="2"
@click="refresh()">
<svg class="icon-svg navbar__icon-menu"
aria-hidden="true">
<use xlink:href="#icon-sync"></use>
</svg>
</el-menu-item>
</el-menu>
<el-menu
:default-active="$store.state.mainShuju.activeName"
:unique-opened="true"
:collapseTransition="false"
mode="horizontal"
class="navbar__menu mr-auto z-div"
>
<el-menu-item index="index" @click="toIndexPage">
<el-menu :default-active="$store.state.mainShuju.activeName"
:unique-opened="true"
:collapseTransition="false"
mode="horizontal"
class="navbar__menu mr-auto z-div">
<el-menu-item index="index"
@click="toIndexPage">
<span>首页</span>
</el-menu-item>
<template v-for="(menu, idx) in $store.state.mainShuju.menuList">
<li
class="sub-menu"
:class="
<li class="sub-menu"
:class="
$store.state.mainShuju.activeName == menu.id ? 'z-on' : ''
"
v-if="menu.children"
:key="menu.id"
@click="gotoRouteHandle(menu.id, idx)"
>
v-if="menu.children"
:key="menu.id"
@click="gotoRouteHandle(menu.id, idx)">
<span>{{ menu.name }}</span>
<div class="sub-menu-list">
<div
:class="
<div :class="
$store.state.mainShuju.activeName == subMenu.id
? 'z-on'
: ''
"
:key="subMenu.id"
@click="gotoRouteHandle(subMenu.id, subIndex)"
v-for="(subMenu, subIndex) in menu.children"
>
:key="subMenu.id"
@click="gotoRouteHandle(subMenu.id, subIndex)"
v-for="(subMenu, subIndex) in menu.children">
{{ subMenu.name }}
</div>
</div>
</li>
<el-menu-item
v-else
:key="menu.id"
:menu="menu"
:index="menu.id"
@click="gotoRouteHandle(menu.id, idx)"
>
<el-menu-item v-else
:key="menu.id"
:menu="menu"
:index="menu.id"
@click="gotoRouteHandle(menu.id, idx)">
<span>{{ menu.name }}</span>
</el-menu-item>
</template>
</el-menu>
<el-menu class="navbar__menu" mode="horizontal">
<el-menu class="navbar__menu"
mode="horizontal">
<!-- <el-menu-item index="1">
<el-dropdown placement="bottom"
:show-timeout="0">
@ -149,14 +97,18 @@
</svg>
</a>
</el-menu-item> -->
<el-menu-item index="3" @click="fullscreenHandle()">
<svg class="icon-svg navbar__icon-menu" aria-hidden="true">
<el-menu-item index="3"
@click="fullscreenHandle()">
<svg class="icon-svg navbar__icon-menu"
aria-hidden="true">
<use xlink:href="#icon-fullscreen"></use>
</svg>
</el-menu-item>
<el-menu-item index="4" class="navbar__avatar">
<el-dropdown placement="bottom" :show-timeout="0">
<el-menu-item index="4"
class="navbar__avatar">
<el-dropdown placement="bottom"
:show-timeout="0">
<span class="el-dropdown-link">
<img src="~@/assets/img/staff-default-avatar.png" />
<span>{{ $store.state.user.realName }}</span>
@ -175,97 +127,63 @@
</el-menu>
</div>
<!-- 弹窗, 修改密码 -->
<update-password-work
v-if="updatePassowrdVisible"
ref="updatePassowrd"
></update-password-work>
<update-password-work v-if="updatePassowrdVisible"
ref="updatePassowrd"></update-password-work>
</nav>
<nav v-else
class="navbar main-line"></nav>
</div>
</template>
<script>
import { messages } from "@/i18n";
import { mapGetters } from "vuex";
import screenfull from "screenfull";
import UpdatePasswordWork from "@/views/main-navbar-update-password-work";
import dateFormat from "dai-js/tools/dateFormat";
import nextTick from "dai-js/tools/nextTick";
import { requestGet } from "@/js/dai/request";
import { clearLoginInfo } from "@/utils";
export default {
inject: ["refresh"],
data() {
data () {
return {
showHeader: true,
i18nMessages: messages,
updatePassowrdVisible: false,
customerName: "",
showWeek: "",
showTime: "",
weather: {
weather: "晴",
temperature: "--",
},
};
},
components: {
UpdatePasswordWork,
},
created() {
created () {
// let platformToken = localStorage.getItem("showHeader") || "";
// if (
// typeof platformToken !== "undefined" &&
// platformToken !== "undefined" &&
// platformToken !== ""
// ) {
// this.showHeader = false;
// }
this.changeCustomerName();
const customerId = localStorage.getItem("customerId");
let siteconfigElement = window.SITE_CONFIG["menuShujuList"];
// 亿 -
if (
"04c0d396e298f13e57aa5904a657eaa6" != customerId &&
"3fdd0380deff5b30f45376cdf995d1c1" != customerId
) {
if ("04c0d396e298f13e57aa5904a657eaa6" != customerId && "3fdd0380deff5b30f45376cdf995d1c1" != customerId) {
for (let index in siteconfigElement) {
if (siteconfigElement[index].id == "6") {
let newMenuArr = siteconfigElement[index].children.filter(
(item) => item.id !== "duoyuanfuwufenxi"
);
if (siteconfigElement[index].id == '6') {
let newMenuArr = siteconfigElement[index].children.filter(item => item.id !== 'duoyuanfuwufenxi');
siteconfigElement[index].children = newMenuArr;
}
}
}
this.$store.state.mainShuju.menuList = siteconfigElement;
const pollTime = async () => {
this.computeCurrentTime();
await nextTick(1000);
pollTime();
};
pollTime();
this.getWeatherData();
},
computed: {},
methods: {
computeCurrentTime() {
let now = new Date();
let wk = now.getDay();
this.showWeek = [
"星期日",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六",
][wk];
this.showTime = dateFormat(now, "yyyy-MM-dd hh:mm:ss");
},
toPage(path) {
this.$router.push({ path });
},
toIndexPage() {
this.$router.replace("/");
toIndexPage () {
this.$router.replace("/indexWork");
},
// menuId()
gotoRouteHandle(menuId, idx) {
gotoRouteHandle (menuId, idx) {
var route = window.SITE_CONFIG["dynamicMenuRoutesShuju"].filter(
(item) => item.meta.menuId === menuId
)[0];
@ -274,27 +192,73 @@ export default {
this.$store.state.mainShuju.activeName = menuId;
}
},
changeCustomerName() {
changeCustomerName () {
this.customerName =
localStorage.getItem("customerName") || "数据分析可视化平台";
},
async getWeatherData() {
const url =
"https://restapi.amap.com/v3/weather/weatherInfo?key=8c87678f34ce9e8e23245c5161991c4e";
const { data, code, msg } = await requestGet(url, {
city: this.$store.state.user.areaCode,
});
if (code === 0) {
console.log("---------------weather", data);
this.weather = data.lives[0];
} else {
// return this.$message.error("");
//
fullscreenHandle () {
if (!screenfull.enabled) {
return this.$message({
message: this.$t("fullscreen.prompt"),
type: "warning",
duration: 500,
});
}
screenfull.toggle();
},
//
updatePasswordHandle () {
this.updatePassowrdVisible = true;
this.$nextTick(() => {
this.$refs.updatePassowrd.init();
});
},
// 退
logoutHandle () {
this.$confirm(
this.$t("prompt.info", { handle: this.$t("logout") }),
this.$t("prompt.title"),
{
confirmButtonText: this.$t("confirm"),
cancelButtonText: this.$t("cancel"),
type: "warning",
}
)
.then(() => {
//
// tabs,
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(
(item) => item.name === "home2"
);
this.$http
.post("/auth/login/logout")
.then(({ data: res }) => {
if (res.code !== 0) {
// 退
if (res.code !== 10007) {
this.$message.error(res.msg);
}
}
clearLoginInfo();
this.$router.push({ name: "login" });
})
.catch(() => { });
})
.catch(() => { });
},
},
};
</script>
<style lang="scss" scoped>
.main-line {
height: 50px;
background: #eeeeee;
}
</style>
<style lang="scss" src="@/assets/scss/main-shuju.scss" scoped></style>

85
src/views/main-shuju/main-theme-tools.vue

@ -0,0 +1,85 @@
<template>
<div class="aui-theme-tools" v-show="false" :class="{ 'aui-theme-tools--open': isOpen }">
<div class="aui-theme-tools__toggle" @click="isOpen = !isOpen">
<svg class="icon-svg" aria-hidden="true">
<use xlink:href="#icon-setting"></use>
</svg>
</div>
<div class="aui-theme-tools__content">
<div class="aui-theme-tools__item">
<h3>Navbar</h3>
<el-checkbox
v-model="$store.state.navbarLayoutType"
true-label="colorful"
>colorful 鲜艳</el-checkbox
>
</div>
<div class="aui-theme-tools__item">
<h3>Sidebar</h3>
<el-checkbox v-model="$store.state.sidebarLayoutSkin" true-label="dark"
>dark 黑色</el-checkbox
>
</div>
<div class="aui-theme-tools__item">
<h3>Theme</h3>
<el-radio-group v-model="themeColor" @change="themeColorChangeHandle">
<el-radio
v-for="item in themeList"
:key="item.name"
:label="item.name"
>{{ `${item.name} ${item.desc}` }}</el-radio
>
</el-radio-group>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
isOpen: false,
themeList: require('@/element-ui/config.js'),
themeColor: ''
}
},
created() {
let color = window.localStorage.getItem('themeColor') || 'blue'
this.themeColorChangeHandle(color)
this.themeColor = color
},
methods: {
themeColorChangeHandle(val) {
window.localStorage.setItem('themeColor', val)
var styleList = [
{
id: 'J_elementTheme',
url: `${
process.env.BASE_URL
}element-theme/${val}/index.css?t=${new Date().getTime()}`
},
{
id: 'J_auiTheme',
url: `${
process.env.BASE_URL
}element-theme/${val}/aui.css?t=${new Date().getTime()}`
}
]
for (var i = 0; i < styleList.length; i++) {
var el = document.querySelector(`#${styleList[i].id}`)
if (el) {
el.href = styleList[i].url
continue
}
el = document.createElement('link')
el.id = styleList[i].id
el.href = styleList[i].url
el.rel = 'stylesheet'
document.querySelector('head').appendChild(el)
}
}
}
}
</script>

24
src/views/main-shuju/main.vue

@ -1,27 +1,10 @@
<template>
<fixed1920 class="g-fx">
<img
class="i-corner z-left-top"
src="~@/assets/images/shuju/main/corner-left-top.png"
/>
<img
class="i-corner z-right-top"
src="~@/assets/images/shuju/main/corner-right-top.png"
/>
<img
class="i-corner z-right-bottom"
src="~@/assets/images/shuju/main/corner-right-bottom.png"
/>
<img
class="i-corner z-left-bottom"
src="~@/assets/images/shuju/main/corner-left-bottom.png"
/>
<fixed1920>
<div
v-loading.fullscreen.lock="loading"
:element-loading-text="$t('loading')"
:class="[
'g-pg',
'g-bd',
{ 'z-sidebar--fold': $store.state.sidebarFold },
{
'z-sidebar--noside': true,
@ -38,6 +21,7 @@
@changeCustomerName="changeCustomerName"
/>
</div>
<main-theme-tools />
</template>
</div>
</fixed1920>
@ -51,6 +35,7 @@ import { mapGetters } from "vuex";
import nextTick from "dai-js/tools/nextTick";
import { requestPost } from "@/js/dai/request";
import fixed1920 from "@/views/components/fixed1920.vue";
import MainThemeTools from "./main-theme-tools";
export default {
provide() {
@ -74,6 +59,7 @@ export default {
MainNavbar,
MainContent,
fixed1920,
MainThemeTools,
},
watch: {

9
src/views/main-sidebar.vue

@ -38,12 +38,19 @@
<div class="nav-div"></div>
<div class="nav-item" @click="$router.push({ name: 'main-shuju' })">
<div class="nav-item" @click="$router.push({ name: 'dataBoard' })">
<svg class="icon-svg aui-sidebar__menu-icon" aria-hidden="true">
<use xlink:href="#icon-stock" />
</svg>
<span>可视化</span>
</div>
<div class="nav-item" @click="$router.push({ name: 'main-shuju' })">
<svg class="icon-svg aui-sidebar__menu-icon" aria-hidden="true">
<use xlink:href="#icon-stock" />
</svg>
<span>可视化旧</span>
</div>
</div>
</div>

Loading…
Cancel
Save