新增首页tab切换

lijinlong^2
杜函宇 1 year ago
parent 984150722b
commit 66f68dea88

Binary file not shown.

After

Width:  |  Height:  |  Size: 1019 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 820 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 886 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 723 B

@ -0,0 +1,144 @@
<template>
<div id="mains1"></div>
</template>
<script>
import * as echarts from "echarts";
export default {
data() {
return {};
},
mounted() {
this.init();
},
methods: {
init() {
var chartDom = document.getElementById("mains1");
var myChart = echarts.init(chartDom);
var option = {
title: {
show: true,
text: "各区域执法计划",
textStyle: {
color: "#3D434D",
fontSize: 16,
},
left: 34,
top: 15,
},
tooltip: {
// show:false,
trigger: "axis",
axisPointer: {
type: "shadow",
shadowStyle: {
color: "rgba(237,240,242,0.5)",
// opacity: 0.1,
// shadowColor: "rgba(237,240,242,0.5)",
// shadowBlur: 10,
},
},
showContent: false,
},
grid: {
left: "3%",
right: "3%",
bottom: "3%",
containLabel: true,
},
xAxis: [
{
type: "category",
data: [
"苏州",
"张家港市",
"常熟市",
"太仓市",
"昆山市",
"吴江区",
"吴中区",
"姑苏区",
"相城区",
"工业园区",
"高新区",
],
axisTick: {
show: false,
},
axisLabel: {
show: true,
fontSize: "13px",
fontFamily: "Alibaba PuHuiTi",
fontWeight: 500,
color: "#525966",
},
axisLine: {
lineStyle: {
color: "#B6C3D9",
},
},
z: 1000,
},
],
yAxis: [
{
splitLine: {
//线
lineStyle: {
type: "dashed", //线 dotted线 solid:线
},
show: true, //
},
axisLabel: {
show: true,
fontSize: "13px",
fontFamily: "Alibaba PuHuiTi",
fontWeight: 500,
color: "#525966",
},
},
],
series: [
{
type: "bar",
barWidth: 28,
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
{
//ok
offset: 0,
color: "#FF8B02",
}, //
{
offset: 1,
color: "#FFA70F",
},
]),
},
z: 100,
data: [700, 400, 600, 300, 580, 250, 490, 200, 390, 460, 90],
//
emphasis: {
label: {
show: true,
formatter: "{c}",
position: "top",
fontSize: 14,
color: "#FF8C03",
fontWeight: "bold",
fontFamily: "Alibaba PuHuiTi",
},
},
},
],
};
option && myChart.setOption(option);
},
},
};
</script>
<style scoped lang="scss">
#mains1 {
height: 100%;
width: 100%;
}
</style>

@ -164,6 +164,9 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<div class="pagination">
<my-pagination :total="total" @pagesChange="pagesChange"></my-pagination>
</div>
<!-- 查看 --> <!-- 查看 -->
<el-dialog <el-dialog
:visible.sync="addShow" :visible.sync="addShow"
@ -203,9 +206,7 @@
</div> </div>
</div> </div>
</el-dialog> </el-dialog>
<div class="pagination">
<my-pagination :total="total" @pagesChange="pagesChange"></my-pagination>
</div>
</div> </div>
</template> </template>

@ -1,22 +1,66 @@
<template> <template>
<div class="mainBox"> <div class="mainBox">
<div class="select-nav"> <div class="select-nav">
<div>年份:</div> <div class="left-nav" v-if="activeIndex == 1">
<el-select v-model="ruleForm.date" placeholder="请选择年份" size="mini"> <div class="navText">年份:</div>
<el-option <el-select v-model="ruleForm.date" placeholder="请选择年份" size="mini">
v-for="item in options" <el-option
:key="item.value" v-for="item in options"
:label="item.label" :key="item.value"
:value="item.value" :label="item.label"
> :value="item.value"
</el-option> >
</el-select> </el-option>
</el-select>
</div>
<div class="left-nav" v-if="activeIndex == 0">
<div class="navText">年份:</div>
<el-select v-model="ruleForm.date" placeholder="请选择年份" size="mini">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
<div class="navText" style="margin-left: 10px">区划:</div>
<el-select v-model="ruleForm.date" placeholder="请选择区划" size="mini">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</div>
<div class="rightBigNav">
<div class="right-nav">
<div
class="tabStyle"
v-for="(item, index) in options1"
:key="index"
@click="active(index)"
:class="activeIndex == index ? 'blue' : ''"
>
<div
:style="`background-image:url('${
activeIndex == index ? item.url1 : item.url
}')`"
></div>
<span>{{ item.name }}</span>
</div>
</div>
</div>
</div> </div>
<!-- 各区域执法计划 --> <!-- 各区域执法计划 -->
<div class="bodyBox boxAllStyle"> <div class="bodyBox boxAllStyle" v-if="activeIndex == 1">
<div id="execution"></div> <div id="execution">
<executionPlan></executionPlan>
</div>
</div> </div>
<div class="bottomBox"> <div class="bottomBox" v-if="activeIndex == 1">
<div class="boxAllStyle"> <div class="boxAllStyle">
<completePlan></completePlan> <completePlan></completePlan>
</div> </div>
@ -25,12 +69,102 @@
<finishRate></finishRate> <finishRate></finishRate>
</div> </div>
</div> </div>
<div class="bgContent" v-if="activeIndex == 0">
<div class="tables">
<el-table
v-loading="load1"
:data="tableData"
style="width: 100%"
:height="530"
:border="false"
:row-class-name="tableRowClassName"
>
<el-table-column
prop="entprName"
label="行政区划"
header-align="center"
>
</el-table-column>
<el-table-column
prop="majorHazardLevel"
label="区县"
header-align="center"
>
</el-table-column>
<el-table-column
prop="indusTypeClass"
label="省重点计划数"
header-align="center"
>
</el-table-column>
<el-table-column
prop="enterColorChart"
label="省重点完成数"
header-align="center"
>
</el-table-column>
<el-table-column
prop="enterColorChart"
label="省重点完成率"
header-align="center"
>
</el-table-column>
<el-table-column
prop="uscCode"
label="非重点计划数"
header-align="center"
>
</el-table-column>
<el-table-column
prop="isPoint"
label="非重点完成数"
header-align="center"
>
</el-table-column>
<el-table-column
prop="isPoint"
label="非重点完成率"
header-align="center"
>
</el-table-column>
<el-table-column
prop="isPoint"
label="合计计划数"
header-align="center"
>
</el-table-column>
<el-table-column
prop="isPoint"
label="合计完成数"
header-align="center"
>
</el-table-column>
<el-table-column
prop="isPoint"
label="合计完成率"
header-align="center"
>
</el-table-column>
</el-table>
</div>
<div class="pagination">
<my-pagination
:total="total"
@pagesChange="pagesChange"
></my-pagination>
</div>
</div>
</div> </div>
</template> </template>
<script> <script>
import * as echarts from "echarts";
import completePlan from "./echarts/completePlan"; import completePlan from "./echarts/completePlan";
import finishRate from "./echarts/finishRate"; import finishRate from "./echarts/finishRate";
import executionPlan from "./echarts/executionPlan";
import myPagination from "@/views/components/myPagination/index";
export default { export default {
data() { data() {
return { return {
@ -59,141 +193,112 @@ export default {
label: "2019", label: "2019",
}, },
], ],
options1: [
{
name: "表格",
url: require("../../assets/images/bg1.png"),
url1: require("../../assets/images/bg2.png"),
},
{
name: "图表",
url: require("../../assets/images/tb1.png"),
url1: require("../../assets/images/tb2.png"),
},
],
activeIndex: 0,
//======
load1: false,
total: 0,
tableData: [],
}; };
}, },
components: { components: {
completePlan, completePlan,
finishRate, finishRate,
executionPlan,
myPagination,
}, },
mounted() { mounted() {},
this.init();
},
methods: { methods: {
init() { pagesChange(e) {},
var chartDom = document.getElementById("execution"); active(e) {
var myChart = echarts.init(chartDom); this.activeIndex = e;
var option = { },
title: { tableRowClassName({ row, rowIndex }) {
show: true, if (rowIndex % 2 !== 0) {
text: "各区域执法计划", return "success-row";
textStyle: { }
color: "#3D434D", return "";
fontSize: 16,
},
left: 34,
top: 15,
},
tooltip: {
// show:false,
trigger: "axis",
axisPointer: {
type: "shadow",
shadowStyle: {
color: "rgba(237,240,242,0.5)",
// opacity: 0.1,
// shadowColor: "rgba(237,240,242,0.5)",
// shadowBlur: 10,
},
},
showContent: false,
},
grid: {
left: "3%",
right: "3%",
bottom: "3%",
containLabel: true,
},
xAxis: [
{
type: "category",
data: [
"苏州",
"张家港市",
"常熟市",
"太仓市",
"昆山市",
"吴江区",
"吴中区",
"姑苏区",
"相城区",
"工业园区",
"高新区",
],
axisTick: {
show: false,
},
axisLabel: {
show: true,
fontSize: '13px',
fontFamily: 'Alibaba PuHuiTi',
fontWeight: 500,
color: '#525966',
},
axisLine: {
lineStyle: {
color: "#B6C3D9",
},
},
z: 1000,
},
],
yAxis: [
{
splitLine :{ //线
lineStyle:{
type:'dashed', //线 dotted线 solid:线
},
show:true //
},
axisLabel: {
show: true,
fontSize: '13px',
fontFamily: 'Alibaba PuHuiTi',
fontWeight: 500,
color: '#525966',
},
},
],
series: [
{
type: "bar",
barWidth: 28,
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
{
//ok
offset: 0,
color: "#FF8B02",
}, //
{
offset: 1,
color: "#FFA70F",
},
]),
},
z: 100,
data: [700, 400, 600, 300, 580, 250, 490, 200, 390, 460, 90],
//
emphasis:{
label:{
show:true,
formatter: '{c}',
position: 'top',
fontSize: 14,
color: '#FF8C03',
fontWeight: 'bold',
fontFamily:'Alibaba PuHuiTi'
}
}
},
],
};
option && myChart.setOption(option);
}, },
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
//===
.bgContent {
height: calc(100% - 48px);
width: 100%;
.tables {
background-color: #eaf2fd;
.tabs-btns {
display: flex;
align-items: center;
justify-content: center;
.look {
display: flex;
align-items: center;
cursor: pointer;
img {
width: 20px;
margin-right: 5px;
}
span {
font-size: 15px;
font-family: Alibaba PuHuiTi;
font-weight: 400;
color: #045ffd;
}
}
}
::v-deep .el-table {
.success-row {
background-color: rgba(234, 242, 253, 0.25);
}
td {
height: 45px;
text-align: center;
font-size: 14px;
font-family: "Alibaba PuHuiTi";
font-weight: 400;
color: #525966;
}
th {
height: 42px;
background-color: #eaf2fd;
font-size: 15px;
font-family: "Alibaba PuHuiTi";
font-weight: bold;
color: #525966;
.el-checkbox {
display: none;
}
}
// .el-table__body-wrapper {
// height: 450px !important;
// overflow-y: auto;
// }
}
::v-deep .el-table::before {
height: 0;
}
}
}
.pagination {
margin-top: 10px;
}
//===
.boxAllStyle { .boxAllStyle {
background: #ffffff; background: #ffffff;
box-shadow: 0px 1px 24px 0px #e2e2e2; box-shadow: 0px 1px 24px 0px #e2e2e2;
@ -207,12 +312,52 @@ export default {
// height: 38px; // height: 38px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between;
margin-bottom: 15px; margin-bottom: 15px;
& > div:nth-of-type(1) { .left-nav {
font-family: 'Alibaba PuHuiTi'; display: flex;
margin-right: 5px; align-items: center;
color: #525966; .navText {
margin-right: 5px;
color: #525966;
font-family: "Alibaba PuHuiTi";
font-size: 14px;
}
} }
.rightBigNav {
padding: 2px;
box-sizing: border-box;
height: 33px;
background: #fff;
.right-nav {
display: flex;
height: 100%;
font-family: "Alibaba PuHuiTi";
font-size: 14px;
.tabStyle {
height: 100%;
background: #fff;
padding: 0 10px;
border-radius: 2px;
display: flex;
align-items: center;
cursor: pointer;
user-select: none;
color: #7a8599;
& > div:nth-of-type(1) {
height: 13px;
width: 13px;
background-size: 100% 100%;
margin-right: 5px;
}
}
.blue {
background: #518afb;
color: #fff;
}
}
}
::v-deep .el-select { ::v-deep .el-select {
background-color: transparent; background-color: transparent;
width: 210px; width: 210px;
@ -253,7 +398,7 @@ export default {
} }
} }
.bottomBox { .bottomBox {
height: calc(100% - 250px - 53px - 15px); height: calc(100% - 250px - 48px - 15px);
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
& > .boxAllStyle { & > .boxAllStyle {

Loading…
Cancel
Save