Commit c6a7a347 by liyuhang19990520

类别代码

parent 99861f4c
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2021-09-03 09:32:50 * @Date: 2021-09-03 09:32:50
* @LastEditTime: 2021-09-03 16:19:47 * @LastEditTime: 2021-09-03 16:47:55
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: \founder_vue\src\views\zdry\dytj.vue * @FilePath: \founder_vue\src\views\zdry\dytj.vue
...@@ -16,7 +16,12 @@ ...@@ -16,7 +16,12 @@
v-if="historyArr.length > 1 && type == 'map'" v-if="historyArr.length > 1 && type == 'map'"
>返回上层</el-button >返回上层</el-button
> >
<div id="charts" ref="charts" v-show="type == 'map'"></div> <div
id="charts"
ref="charts"
v-show="type == 'map'"
v-loading="loading"
></div>
<div id="table" v-show="type == 'table'"> <div id="table" v-show="type == 'table'">
<rightContent <rightContent
@returnBtn="type = 'map'" @returnBtn="type = 'map'"
...@@ -101,6 +106,7 @@ export default { ...@@ -101,6 +106,7 @@ export default {
disabled: false, disabled: false,
}, },
], ],
loading: false,
}; };
}, },
methods: { methods: {
...@@ -245,9 +251,11 @@ export default { ...@@ -245,9 +251,11 @@ export default {
}, },
//下钻处理接口事件 //下钻处理接口事件
getChartsData(xzqhdm) { getChartsData(xzqhdm) {
this.loading = true;
let params = new Object(); let params = new Object();
if (xzqhdm) params.xzqhdm = xzqhdm; if (xzqhdm) params.xzqhdm = xzqhdm;
ryXzqhTj(params).then((res) => { ryXzqhTj(params).then((res) => {
this.loading = false;
if (res.success && res.code == 200) { if (res.success && res.code == 200) {
if (res.data.rows.length > 0) { if (res.data.rows.length > 0) {
let xData = res.data.rows.map((i) => ({ let xData = res.data.rows.map((i) => ({
......
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2021-09-03 09:32:50 * @Date: 2021-09-03 09:32:50
* @LastEditTime: 2021-09-03 16:06:50 * @LastEditTime: 2021-09-03 16:49:26
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: \founder_vue\src\views\zdry\dytj.vue * @FilePath: \founder_vue\src\views\zdry\dytj.vue
...@@ -16,7 +16,12 @@ ...@@ -16,7 +16,12 @@
v-if="historyArr.length > 1 && type == 'map'" v-if="historyArr.length > 1 && type == 'map'"
>返回上层</el-button >返回上层</el-button
> >
<div id="charts" ref="charts" v-show="type == 'map'"></div> <div
id="charts"
ref="charts"
v-show="type == 'map'"
v-loading="loading"
></div>
<div id="table" v-show="type == 'table'"> <div id="table" v-show="type == 'table'">
<rightContent <rightContent
@returnBtn="type = 'map'" @returnBtn="type = 'map'"
...@@ -31,7 +36,7 @@ ...@@ -31,7 +36,7 @@
</template> </template>
<script> <script>
import rightContent from "@c/ptCxForm_components.vue"; import rightContent from "@c/ptCxForm_components.vue";
import { ryXzqhTj, getMainZdGzryxx } from "@/api/zdry/zdrytj.js"; import { ryAjlbTj } from "@/api/zdry/zdrytj.js";
export default { export default {
components: { components: {
rightContent, rightContent,
...@@ -91,7 +96,18 @@ export default { ...@@ -91,7 +96,18 @@ export default {
key: "1", key: "1",
tableLoading: false, tableLoading: false,
tableLength: "", tableLength: "",
excelHeader: "地域统计", Menu: [
{
id: "lbtj",
label: "类别统计",
index: "lbtj",
auth: "M0101",
className: "iconfont iconrizhi",
disabled: false,
},
],
tierNum: 1,
loading: false
}; };
}, },
methods: { methods: {
...@@ -233,27 +249,41 @@ export default { ...@@ -233,27 +249,41 @@ export default {
let obj = this.historyArr[this.historyArr.length - 2]; let obj = this.historyArr[this.historyArr.length - 2];
this.getCharts(obj.x, obj.data, obj.rotate); this.getCharts(obj.x, obj.data, obj.rotate);
this.historyArr.pop(); this.historyArr.pop();
this.tierNum--;
}, },
//下钻处理接口事件 //下钻处理接口事件
getChartsData(xzqhdm) { getChartsData(xzqhdm) {
let params = new Object(); let params = new Object();
if (xzqhdm) params.xzqhdm = xzqhdm; if (this.tierNum == 1) {
ryXzqhTj(params).then((res) => { params.groupid = "CODE_AJZLB";
} else if (this.tierNum == 2) {
params.groupid = "CODE_AJXZLB";
} else if (this.tierNum == 3) {
params.groupid = "CODE_XALBDMBCMS";
}
if (xzqhdm) {
params.ajlb = xzqhdm;
}
this.loading = true
ryAjlbTj(params).then((res) => {
this.loading = false;
if (res.success && res.code == 200) { if (res.success && res.code == 200) {
if (res.data.rows.length > 0) { if (res.data.rows.length > 0) {
let xData = res.data.rows.map((i) => ({ let xData = res.data.rows.map((i) => ({
name: i.xzqhmc, name: i.ajlbmc,
value: i.xzqhdm, value: i.ajlb,
})); }));
let data = res.data.rows.map((i) => ({ let data = res.data.rows.map((i) => ({
name: i.xzqhmc, name: i.ajlbmc,
value: i.count, value: i.count,
dm: i.xzqhdm, dm: i.ajlb,
})); }));
//添加到histoy数组 //添加到histoy数组
this.historyArr.push({ x: xData, data: data }); this.historyArr.push({ x: xData, data: data });
//刷新图 //刷新图
this.getCharts(xData, data); this.getCharts(xData, data);
//更改层数
this.tierNum++;
} else { } else {
this.$message.warning("没有下一层了"); this.$message.warning("没有下一层了");
} }
...@@ -263,13 +293,17 @@ export default { ...@@ -263,13 +293,17 @@ export default {
//表格内容接口 //表格内容接口
getTableData(dm) { getTableData(dm) {
this.type = "table"; this.type = "table";
this.$set(this.cxFormData, "xzqhdm", dm); this.$set(this.cxFormData, "sabq", dm);
}, },
}, },
mounted() { mounted() {
//初始化图形 //初始化图形
this.getChartsData(); this.getChartsData();
}, },
created() {
this.$store.commit("user/SET_Menu", this.Menu);
// debugger;
},
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -294,7 +328,7 @@ export default { ...@@ -294,7 +328,7 @@ export default {
} }
.returnBtn { .returnBtn {
position: absolute; position: absolute;
top: 45px; top: 30px;
right: 40px; right: 40px;
z-index: 111; z-index: 111;
} }
......
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2021-09-03 09:32:50 * @Date: 2021-09-03 09:32:50
* @LastEditTime: 2021-09-03 16:20:30 * @LastEditTime: 2021-09-03 16:48:45
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: In User Settings Edit * @Description: In User Settings Edit
* @FilePath: \founder_vue\src\views\zdry\dytj.vue * @FilePath: \founder_vue\src\views\zdry\dytj.vue
--> -->
<template> <template>
<div id="dytj"> <div id="dytj">
<div id="charts" ref="charts" v-show="type == 'map'"></div> <div id="charts" ref="charts" v-show="type == 'map'" v-loading="loading"></div>
<div id="table" v-show="type == 'table'"> <div id="table" v-show="type == 'table'">
<rightContent <rightContent
@returnBtn="type = 'map'" @returnBtn="type = 'map'"
...@@ -94,6 +94,7 @@ export default { ...@@ -94,6 +94,7 @@ export default {
disabled: false, disabled: false,
}, },
], ],
loading: true
}; };
}, },
methods: { methods: {
...@@ -222,10 +223,12 @@ export default { ...@@ -222,10 +223,12 @@ export default {
}, },
//下钻处理接口事件 //下钻处理接口事件
getChartsData(xzqhdm) { getChartsData(xzqhdm) {
this.loading = true;
let params = new Object(); let params = new Object();
if (xzqhdm) params.xzqhdm = xzqhdm; if (xzqhdm) params.xzqhdm = xzqhdm;
ryXbTj(params).then((res) => { ryXbTj(params).then((res) => {
if (res.success && res.code == 200) { if (res.success && res.code == 200) {
this.loading = false;
if (res.data.rows.length > 0) { if (res.data.rows.length > 0) {
let xData = res.data.rows.map((i) => ({ let xData = res.data.rows.map((i) => ({
name: i.xbmc, name: i.xbmc,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment