123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461 |
- <template>
- <div>
- <div class="headerSelect">
- <el-select
- v-model="yearsVal"
- placeholder="请选择"
- @change="yearsChange"
- clearable
- >
- <el-option
- v-for="item in yearsOpt"
- :key="item.quarter"
- :label="item.quarter"
- :value="item"
- >
- </el-option>
- </el-select>
- <el-cascader
- :show-all-levels="false"
- :options="xzqTreeData"
- placeholder="行政区"
- @change="regionChange"
- :props="{ checkStrictly: true, expandTrigger: 'hover' }"
- clearable
- v-model="region"
- ></el-cascader>
- <el-select
- v-model="monitorVal"
- placeholder="请选择"
- @change="typeChange"
- clearable
- >
- <el-option
- v-for="item in monitorOpt"
- :key="item.dictCode"
- :label="item.dictValue"
- :value="item.dictCode"
- >
- </el-option>
- </el-select>
- </div>
- <div class="divrow">
- <div class="divCol">
- <div class="divImg">
- <img
- src="/static/images/overview/icon_yrkkg.png"
- style="height: 3.1rem; width: 3.1rem"
- />
- </div>
- <div class="divText">
- <div>
- <span style="color: #fff">监测图斑数</span>
- </div>
- <div>
- <span class="numberColor">{{ sdata.jcgs }}个</span>
- </div>
- </div>
- </div>
- <div class="divCol">
- <div class="divImg">
- <img
- src="/static/images/overview/icon_yrkkg.png"
- style="height: 3.1rem; width: 3.1rem"
- />
- </div>
- <div class="divText">
- <div>
- <span style="color: #fff">监测面积</span>
- </div>
- <div>
- <span class="numberColor">{{ sdata.jcmj }}km²</span>
- </div>
- </div>
- </div>
- </div>
- <div class="echars">
- <div class="echartTitle">
- <div class="block-title">监测类型情况</div>
- <div class="selectTab">
- <el-select
- v-model="tab"
- placeholder="请选择"
- :popper-append-to-body="true"
- @change="GetInfo()"
- >
- <el-option
- v-for="item in options"
- :key="item.value"
- :label="item.name"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </div>
- </div>
- <div class="content">
- <div class="echars2">
- <div ref="echars_pie" id="echars_pie"></div>
- </div>
- </div>
- </div>
- <Statistics
- title="图斑分布情况"
- :cityList="cityList"
- height="236"
- ></Statistics>
- </div>
- </template>
- <script>
- import Statistics from "./statistics";
- import { GetXzqhTree } from "@/api/map";
- import { QueryOne, QueryList } from "@/api/cockpitNew";
- import { GetDateList, CodeList, JscQueryList } from "@/api/ghss/jctb.js";
- export default {
- components: {
- Statistics,
- },
- data() {
- return {
- region: "4602",
- xzqTreeData: [], //申请范围
- tab: 1,
- options: [
- { name: "图斑数", value: 1 },
- { name: "监测面积", value: 2 },
- ],
- sdata: {},
- myChart: null,
- cityList: [],
- yearsOpt: [], //检测图斑时间季度
- monitorOpt: [
- {
- value: "全部监测类型",
- label: "全部监测类型",
- },
- {
- value: "新增建筑物",
- label: "新增建筑物",
- },
- {
- value: "新增耕地",
- label: "新增耕地",
- },
- ],
- monitorVal: "",
- yearsVal: "",
- val0: "2024-02-17 00:00:00",
- val1: "2024-12-31 23:59:59",
- val2: "",
- };
- },
- computed: {},
- mounted() {
- this.getXzqTreeData();
- this.getData();
- },
- methods: {
- regionChange(region) {
- if (region.length && region.length > 1) {
- this.region = region[1];
- } else {
- this.region = region[0];
- }
- this.getData();
- },
- typeChange(val) {
- this.val2 = val;
- this.getzl();
- },
- //年份季度改变
- yearsChange(val) {
- if (val) {
- val = JSON.parse(JSON.stringify(val));
- this.val0 = val.startTime;
- this.val1 = val.endTime;
- this.yearsVal = val.quarter;
- } else {
- this.val0 = "2024-02-17 00:00:00";
- this.val1 = "2024-12-31 23:59:59";
- }
- // this.getzl();
- // this.GetCityList();
- // this.initEcharts();
- this.getData();
- },
- getXzqTreeData() {
- GetXzqhTree().then((res) => {
- if (res.data.length > 0) {
- const list = res.data[0].children.filter((item) => {
- return item.label == "三亚市";
- });
- if (list.length > 0) {
- list[0].value = "4602";
- this.xzqTreeData = list[0];
- } else this.xzqTreeData = res.data;
- }
- });
- GetDateList().then((res) => {
- this.yearsOpt = res.data;
- });
- //检测类型分类
- CodeList({
- dictType: "卫片执法后地类分类标准",
- pageNum: 1,
- pageSize: 999,
- }).then((res) => {
- if (res.code == 200) {
- this.monitorOpt = res.rows;
- }
- });
- },
- getData() {
- this.getzl();
- this.GetCityList();
- this.initEcharts();
- },
- async getzl() {
- let sdres = await QueryOne({
- jscType: "t_gdbh_jctb_tbzl",
- id: this.region,
- val0: this.val0,
- val1: this.val1,
- val2: this.val2,
- });
- this.sdata = sdres.data;
- },
- async GetCityList() {
- this.cityList = [];
- let flres = await QueryList({
- jscType: "t_gdbh_jctb_qxfl",
- id: this.region,
- val0: this.val0,
- val1: this.val1,
- });
- flres.data.forEach((fl) => {
- this.cityList.push({
- name: fl.xzqmc,
- number: fl.jcgs,
- area: fl.jcmj,
- unit: "km²",
- });
- });
- },
- async initEcharts() {
- this.myChart = echarts.init(this.$refs.echars_pie);
- let jclxres = await JscQueryList({
- jscType: "t_gdbh_jctb_jclx",
- id: this.region,
- val0: this.val0,
- val1: this.val1,
- });
- var names = [];
- var values = [];
- if (jclxres.data.length) {
- jclxres.data.forEach((item) => {
- names.push(item.dict_value);
- values.push(item.jcmj);
- });
- }
- let option = {
- // backgroundColor: "#041139",
- tooltip: {
- trigger: "item",
- },
- legend: {
- show: false,
- },
- grid: {
- top: 10,
- left: 30,
- right: 20,
- bottom: 60,
- },
- xAxis: [
- {
- data: names,
- axisLabel: {
- textStyle: {
- color: "#D8F0FF",
- fontSize: 11,
- },
- interval: 0,
- // rotate: 30,
- margin: 10, //刻度标签与轴线之间的距离。
- rotate: 40,
- // 超过4个字显示省略号
- formatter: function (value) {
- if (value.length > 5) {
- return `${value.slice(0, 5)}...`;
- }
- return value;
- },
- },
- axisLine: {
- show: false, //不显示x轴
- lineStyle: {
- color: "rgba(53,65,95,1)",
- },
- },
- axisTick: {
- show: false, //不显示刻度
- },
- boundaryGap: true,
- splitLine: {
- show: false,
- },
- },
- ],
- yAxis: [
- {
- splitLine: {
- show: false,
- },
- axisTick: {
- show: false,
- },
- axisLine: {
- show: false, //不显示x轴
- lineStyle: {
- color: "rgba(53,65,95,1)",
- },
- },
- axisLabel: {
- show: true,
- textStyle: {
- color: "#D8F0FF",
- fontSize: 14,
- },
- },
- },
- ],
- series: [
- // 柱体
- {
- name: "监测类型情况",
- type: "bar",
- barWidth: 15,
- showBackground: true,
- backgroundStyle: {
- color: "rgba(105,160,231,0.2)",
- borderRadius: [30, 30, 30, 30],
- },
- itemStyle: {
- // normal: {
- // color: "#E5E5E5",
- // barBorderRadius: 24
- // },
- color: {
- x: 0,
- y: 0,
- x2: 0,
- y2: 1,
- type: "linear",
- global: false,
- colorStops: [
- {
- //第一节下面
- offset: 0,
- color: "#00D5FF",
- },
- {
- offset: 1,
- color: "#10274B",
- },
- ],
- },
- borderRadius: [30, 30, 30, 30],
- },
- label: {
- show: false, //每条柱状图是否显示数字
- formatter: "{c}",
- position: "top",
- color: "#fff",
- fontSize: 14,
- },
- data: values,
- },
- ],
- };
- this.myChart.setOption(option);
- },
- },
- watch: {},
- beforeDestroy() {},
- };
- </script>
- <style lang="less" scoped>
- .divrow {
- margin: 0;
- padding: 0;
- display: flex;
- justify-content: space-between;
- }
- .divImg {
- width: 30%;
- }
- img {
- height: 3.1rem;
- width: 3.1rem;
- }
- .divCol {
- width: 184px;
- height: 75px;
- background: inherit;
- background-color: rgba(104, 244, 251, 0.21568627);
- border: none;
- border-radius: 5px;
- display: flex;
- white-space: nowrap;
- align-items: center;
- padding-left: 15px;
- justify-content: space-around;
- }
- .divText {
- width: 65%;
- padding-left: 0.5rem;
- .numberColor {
- font-weight: 700;
- font-style: normal;
- font-size: 13px;
- color: #00ffff;
- }
- }
- #echars_pie {
- height: 260px;
- width: 402px;
- }
- .headerSelect {
- width: 100%;
- height: 26px;
- // background: #00ffff;
- margin: 5px 0px;
- display: flex;
- justify-content: space-between;
- /deep/ .el-input--suffix .el-input__inner {
- padding-right: 15px;
- height: 26px;
- background-color: transparent;
- border: none;
- color: #fff;
- }
- /deep/ .el-cascader {
- line-height: 26px;
- }
- /deep/.el-input__icon {
- line-height: 1;
- color: #fff;
- }
- /deep/ .el-input__inner::placeholder {
- color: #fff;
- }
- }
- </style>
|