From d7074b200559c66c2ffa478431ed01a98d598a09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E8=8B=A5=E6=99=A8?= <974220104@qq.com> Date: Fri, 3 Nov 2023 11:23:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=85=E6=B0=91=E5=88=97=E8=A1=A8=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=EF=BC=8C=E5=9B=BE=E8=A1=A8=E6=9A=82=E6=97=A0=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/dataBoard/renfang/resi/classNew.vue | 75 +++++++-- .../visualizing/components/dangyuan.vue | 55 ++++++- .../visualizing/components/dibaorenyuan.vue | 108 ++++++++++++- .../visualizing/components/laonianren.vue | 74 +++++++-- .../visualizing/components/shiyerenyuan.vue | 145 +++++++++++++++++- .../visualizing/components/zhiyuanzhe.vue | 56 ++++++- 6 files changed, 471 insertions(+), 42 deletions(-) diff --git a/src/views/dataBoard/renfang/resi/classNew.vue b/src/views/dataBoard/renfang/resi/classNew.vue index 8e0661f03..eb9fbc076 100644 --- a/src/views/dataBoard/renfang/resi/classNew.vue +++ b/src/views/dataBoard/renfang/resi/classNew.vue @@ -249,6 +249,10 @@ export default { list: [], listData: [], oldList: [ + { + label: "全部", + value: ["ALL", "ALL"], + }, { label: "60-69岁", value: ["60", "69"], @@ -267,6 +271,10 @@ export default { }, ], oldAllList: [ + { + label: "全部", + value: ["ALL", "ALL"], + }, { label: "0-9岁", value: ["0", "9"], @@ -308,12 +316,6 @@ export default { value: ["90", "139"], }, ], - jzList: [ - { - label: "不知奥", - value: "90,120", - }, - ], colList: [ { align: "left", @@ -620,6 +622,11 @@ export default { ...this.searchParams, ...item, }; + for (let key in queryParam) { + if (queryParam[key] == "ALL") { + queryParam[key] = undefined; + } + } this.$http.post(url, queryParam).then(({ data: res }) => { this.loading = false; const { data, code, msg } = res; @@ -666,7 +673,13 @@ export default { const { data } = await this.$http.post("sys/dict/data/dictlist", { dictType: "reside_situation", }); - this.resideArr = data.data; + this.resideArr = [ + { + value: "ALL", + label: "全部", + }, + ...data.data, + ]; } catch (error) { console.log(error, "获取居住情况字典"); } @@ -686,7 +699,13 @@ export default { const { data } = await this.$http.post("sys/dict/data/dictlist", { dictType: "unemployment_reason", }); - this.unemploymentArr = data.data; + this.unemploymentArr = [ + { + value: "ALL", + label: "全部", + }, + ...data.data, + ]; } catch (error) { console.log(error, "获取失业原因字典"); } @@ -696,7 +715,13 @@ export default { const { data } = await this.$http.post("sys/dict/data/dictlist", { dictType: "career_goals", }); - this.careerArr = data.data; + this.careerArr = [ + { + value: "ALL", + label: "全部", + }, + ...data.data, + ]; } catch (error) { console.log(error, "获取就业愿望字典"); } @@ -706,7 +731,13 @@ export default { const { data } = await this.$http.post("sys/dict/data/dictlist", { dictType: "VOLUNTEER_CATEGORY", }); - this.volunteerArr = data.data; + this.volunteerArr = [ + { + value: "ALL", + label: "全部", + }, + ...data.data, + ]; } catch (error) { console.log(error, "获取志愿者类别字典"); } @@ -716,7 +747,13 @@ export default { const { data } = await this.$http.post("sys/dict/data/dictlist", { dictType: "low_income_reason", }); - this.lowIncomeReasonArr = data.data; + this.lowIncomeReasonArr = [ + { + value: "ALL", + label: "全部", + }, + ...data.data, + ]; } catch (error) { console.log(error, "获取低保原因字典"); } @@ -726,7 +763,13 @@ export default { const { data } = await this.$http.post("sys/dict/data/dictlist", { dictType: "low_income_type", }); - this.lowIncomeTypeArr = data.data; + this.lowIncomeTypeArr = [ + { + value: "ALL", + label: "全部", + }, + ...data.data, + ]; } catch (error) { console.log(error, "获取低保类型字典"); } @@ -736,7 +779,13 @@ export default { let { data } = await this.$http.post("sys/dict/data/education", { formCode: "resi_base_info", }); - this.PostDictonArr = data.data; + this.PostDictonArr = [ + { + value: "ALL", + label: "全部", + }, + ...data.data, + ]; } catch (error) { console.log(error, "获取学历字典"); } diff --git a/src/views/dataBoard/renfang/visualizing/components/dangyuan.vue b/src/views/dataBoard/renfang/visualizing/components/dangyuan.vue index 20f505251..5a130baf5 100644 --- a/src/views/dataBoard/renfang/visualizing/components/dangyuan.vue +++ b/src/views/dataBoard/renfang/visualizing/components/dangyuan.vue @@ -130,11 +130,36 @@ export default { saveAsImage: { show: true }, }, }, + title: { + show: !this.dyLeft || this.dyLeft.length == 0, // 是否要展示“暂无数据”矢量图 + text: " {a|}", // 写入占位符a,以便后续填充内容 + x: "center", + y: "center", + subtext: "暂无数据", // 子标题 + itemGap: -10, // 设置主副标题间隔 + textStyle: { + rich: { + a: { + height: 128, // 设置图片高度 + width: 268, // 设置图片宽度 + backgroundColor: { + // 引入图片,作为背景图,填写相对路径 + image: require("@/assets/images/overview/zanwu.png"), + }, + }, + }, + }, + subtextStyle: { + // 配置副标题的文字样式 + fontSize: 12, + color: "#ffffff", + }, + }, series: [ { name: "Nightingale Chart", type: "pie", - radius: [30, 130], + radius: this.dyLeft && this.dyLeft.length > 0 ? [30, 130] : [0, 0], center: ["50%", "50%"], roseType: "area", itemStyle: { @@ -221,11 +246,37 @@ export default { saveAsImage: { show: true }, }, }, + title: { + show: !this.dyRight || this.dyRight.length == 0, // 是否要展示“暂无数据”矢量图 + text: " {a|}", // 写入占位符a,以便后续填充内容 + x: "center", + y: "center", + subtext: "暂无数据", // 子标题 + itemGap: -10, // 设置主副标题间隔 + textStyle: { + rich: { + a: { + height: 128, // 设置图片高度 + width: 268, // 设置图片宽度 + backgroundColor: { + // 引入图片,作为背景图,填写相对路径 + image: require("@/assets/images/overview/zanwu.png"), + }, + }, + }, + }, + subtextStyle: { + // 配置副标题的文字样式 + fontSize: 12, + color: "#ffffff", + }, + }, series: [ { name: "Nightingale Chart", type: "pie", - radius: [30, 130], + radius: + this.dyRight && this.dyRight.length > 0 ? [30, 130] : [0, 0], center: ["50%", "50%"], roseType: "area", itemStyle: { diff --git a/src/views/dataBoard/renfang/visualizing/components/dibaorenyuan.vue b/src/views/dataBoard/renfang/visualizing/components/dibaorenyuan.vue index d52862e29..d3fe20e6c 100644 --- a/src/views/dataBoard/renfang/visualizing/components/dibaorenyuan.vue +++ b/src/views/dataBoard/renfang/visualizing/components/dibaorenyuan.vue @@ -177,10 +177,35 @@ export default { saveAsImage: { show: true }, }, }, + title: { + show: !this.dbryData1 || this.dbryData1.length == 0, // 是否要展示“暂无数据”矢量图 + text: " {a|}", // 写入占位符a,以便后续填充内容 + x: "center", + y: "center", + subtext: "暂无数据", // 子标题 + itemGap: -10, // 设置主副标题间隔 + textStyle: { + rich: { + a: { + height: 126, // 设置图片高度 + width: 268, // 设置图片宽度 + backgroundColor: { + // 引入图片,作为背景图,填写相对路径 + image: require("@/assets/images/overview/zanwu.png"), + }, + }, + }, + }, + subtextStyle: { + // 配置副标题的文字样式 + fontSize: 12, + color: "#ffffff", + }, + }, series: [ { type: "pie", - radius: [30, 130], + radius: this.dbryData1 && this.dbryData1.length > 0?[30, 130]:[0,0], center: ["50%", "50%"], roseType: "area", itemStyle: { @@ -280,10 +305,35 @@ export default { saveAsImage: { show: true }, }, }, + title: { + show: !this.dbryData2 || this.dbryData2.length == 0, // 是否要展示“暂无数据”矢量图 + text: " {a|}", // 写入占位符a,以便后续填充内容 + x: "center", + y: "center", + subtext: "暂无数据", // 子标题 + itemGap: -10, // 设置主副标题间隔 + textStyle: { + rich: { + a: { + height: 126, // 设置图片高度 + width: 268, // 设置图片宽度 + backgroundColor: { + // 引入图片,作为背景图,填写相对路径 + image: require("@/assets/images/overview/zanwu.png"), + }, + }, + }, + }, + subtextStyle: { + // 配置副标题的文字样式 + fontSize: 12, + color: "#ffffff", + }, + }, series: [ { type: "pie", - radius: [30, 130], + radius: this.dbryData2 && this.dbryData2.length > 0?[30, 130]:[0,0], center: ["50%", "50%"], roseType: "area", itemStyle: { @@ -385,10 +435,35 @@ export default { saveAsImage: { show: true }, }, }, + title: { + show: !this.dbryData3 || this.dbryData3.length == 0, // 是否要展示“暂无数据”矢量图 + text: " {a|}", // 写入占位符a,以便后续填充内容 + x: "center", + y: "center", + subtext: "暂无数据", // 子标题 + itemGap: -10, // 设置主副标题间隔 + textStyle: { + rich: { + a: { + height: 126, // 设置图片高度 + width: 268, // 设置图片宽度 + backgroundColor: { + // 引入图片,作为背景图,填写相对路径 + image: require("@/assets/images/overview/zanwu.png"), + }, + }, + }, + }, + subtextStyle: { + // 配置副标题的文字样式 + fontSize: 12, + color: "#ffffff", + }, + }, series: [ { type: "pie", - radius: [30, 130], + radius: this.dbryData3 && this.dbryData3.length > 0?[30, 130]:[0,0], center: ["50%", "50%"], roseType: "area", itemStyle: { @@ -489,10 +564,35 @@ export default { saveAsImage: { show: true }, }, }, + title: { + show: !this.dbryData4 || this.dbryData4.length == 0, // 是否要展示“暂无数据”矢量图 + text: " {a|}", // 写入占位符a,以便后续填充内容 + x: "center", + y: "center", + subtext: "暂无数据", // 子标题 + itemGap: -10, // 设置主副标题间隔 + textStyle: { + rich: { + a: { + height: 126, // 设置图片高度 + width: 268, // 设置图片宽度 + backgroundColor: { + // 引入图片,作为背景图,填写相对路径 + image: require("@/assets/images/overview/zanwu.png"), + }, + }, + }, + }, + subtextStyle: { + // 配置副标题的文字样式 + fontSize: 12, + color: "#ffffff", + }, + }, series: [ { type: "pie", - radius: [30, 130], + radius: this.dbryData4 && this.dbryData4.length > 0?[30, 130]:[0,0], center: ["50%", "50%"], roseType: "area", itemStyle: { diff --git a/src/views/dataBoard/renfang/visualizing/components/laonianren.vue b/src/views/dataBoard/renfang/visualizing/components/laonianren.vue index b1a824e68..400ffcca9 100644 --- a/src/views/dataBoard/renfang/visualizing/components/laonianren.vue +++ b/src/views/dataBoard/renfang/visualizing/components/laonianren.vue @@ -46,18 +46,8 @@ export default { }, data() { return { - lnrLeft: [ - { value: 108, name: "60-69" }, - { value: 38, name: "70-79" }, - { value: 92, name: "80-89" }, - { value: 22, name: "90岁及以上" }, - ], - lnrRight: [ - { value: 66, name: "与子女同住" }, - { value: 70, name: "空巢" }, - { value: 71, name: "独居" }, - { value: 53, name: "其他" }, - ], + lnrLeft: [], + lnrRight: [], }; }, created() { @@ -140,11 +130,37 @@ export default { saveAsImage: { show: true }, }, }, + title: { + show: !this.lnrLeft || this.lnrLeft.length == 0, // 是否要展示“暂无数据”矢量图 + text: " {a|}", // 写入占位符a,以便后续填充内容 + x: "center", + y: "center", + subtext: "暂无数据", // 子标题 + itemGap: -10, // 设置主副标题间隔 + textStyle: { + rich: { + a: { + height: 128, // 设置图片高度 + width: 268, // 设置图片宽度 + backgroundColor: { + // 引入图片,作为背景图,填写相对路径 + image: require("@/assets/images/overview/zanwu.png"), + }, + }, + }, + }, + subtextStyle: { + // 配置副标题的文字样式 + fontSize: 12, + color: "#ffffff", + }, + }, series: [ { name: "Nightingale Chart", type: "pie", - radius: [30, 130], + radius: + this.lnrLeft && this.lnrLeft.length > 0 ? [30, 130] : [0, 0], center: ["50%", "50%"], roseType: "area", itemStyle: { @@ -173,7 +189,7 @@ export default { type_id: "aged", type_name: "老年人", pageType: "normal", - type: "old" + type: "old", }, }); }); @@ -224,6 +240,31 @@ export default { } }, }, + title: { + show: !this.lnrRight || this.lnrRight.length == 0, // 是否要展示“暂无数据”矢量图 + text: " {a|}", // 写入占位符a,以便后续填充内容 + x: "center", + y: "center", + subtext: "暂无数据", // 子标题 + itemGap: -10, // 设置主副标题间隔 + textStyle: { + rich: { + a: { + height: 128, // 设置图片高度 + width: 268, // 设置图片宽度 + backgroundColor: { + // 引入图片,作为背景图,填写相对路径 + image: require("@/assets/images/overview/zanwu.png"), + }, + }, + }, + }, + subtextStyle: { + // 配置副标题的文字样式 + fontSize: 12, + color: "#ffffff", + }, + }, toolbox: { show: false, feature: { @@ -237,7 +278,8 @@ export default { { name: "Nightingale Chart", type: "pie", - radius: [30, 130], + radius: + this.lnrRight && this.lnrRight.length > 0 ? [30, 130] : [0, 0], center: ["50%", "50%"], roseType: "area", itemStyle: { @@ -265,7 +307,7 @@ export default { type_id: "aged", type_name: "老年人", pageType: "normal", - type: "old" + type: "old", }, }); }); diff --git a/src/views/dataBoard/renfang/visualizing/components/shiyerenyuan.vue b/src/views/dataBoard/renfang/visualizing/components/shiyerenyuan.vue index 5839174a6..94d72f9ae 100644 --- a/src/views/dataBoard/renfang/visualizing/components/shiyerenyuan.vue +++ b/src/views/dataBoard/renfang/visualizing/components/shiyerenyuan.vue @@ -195,10 +195,37 @@ export default { saveAsImage: { show: true }, }, }, + title: { + show: !this.syryData1 || this.syryData1.length == 0, // 是否要展示“暂无数据”矢量图 + text: " {a|}", // 写入占位符a,以便后续填充内容 + x: "center", + y: "center", + subtext: "暂无数据", // 子标题 + itemGap: -10, // 设置主副标题间隔 + textStyle: { + rich: { + a: { + height: 128, // 设置图片高度 + width: 268, // 设置图片宽度 + backgroundColor: { + // 引入图片,作为背景图,填写相对路径 + image: require("@/assets/images/overview/zanwu.png"), + }, + }, + }, + }, + subtextStyle: { + // 配置副标题的文字样式 + fontSize: 12, + color: "#ffffff", + }, + }, series: [ { + name: "Nightingale Chart", type: "pie", - radius: [30, 130], + radius: + this.syryData1 && this.syryData1.length > 0 ? [30, 130] : [0, 0], center: ["50%", "50%"], roseType: "area", itemStyle: { @@ -298,10 +325,37 @@ export default { saveAsImage: { show: true }, }, }, + title: { + show: !this.syryData2 || this.syryData2.length == 0, // 是否要展示“暂无数据”矢量图 + text: " {a|}", // 写入占位符a,以便后续填充内容 + x: "center", + y: "center", + subtext: "暂无数据", // 子标题 + itemGap: -10, // 设置主副标题间隔 + textStyle: { + rich: { + a: { + height: 128, // 设置图片高度 + width: 268, // 设置图片宽度 + backgroundColor: { + // 引入图片,作为背景图,填写相对路径 + image: require("@/assets/images/overview/zanwu.png"), + }, + }, + }, + }, + subtextStyle: { + // 配置副标题的文字样式 + fontSize: 12, + color: "#ffffff", + }, + }, series: [ { + name: "Nightingale Chart", type: "pie", - radius: [30, 130], + radius: + this.syryData2 && this.syryData2.length > 0 ? [30, 130] : [0, 0], center: ["50%", "50%"], roseType: "area", itemStyle: { @@ -403,10 +457,37 @@ export default { saveAsImage: { show: true }, }, }, + title: { + show: !this.syryData3 || this.syryData3.length == 0, // 是否要展示“暂无数据”矢量图 + text: " {a|}", // 写入占位符a,以便后续填充内容 + x: "center", + y: "center", + subtext: "暂无数据", // 子标题 + itemGap: -10, // 设置主副标题间隔 + textStyle: { + rich: { + a: { + height: 128, // 设置图片高度 + width: 268, // 设置图片宽度 + backgroundColor: { + // 引入图片,作为背景图,填写相对路径 + image: require("@/assets/images/overview/zanwu.png"), + }, + }, + }, + }, + subtextStyle: { + // 配置副标题的文字样式 + fontSize: 12, + color: "#ffffff", + }, + }, series: [ { + name: "Nightingale Chart", type: "pie", - radius: [30, 130], + radius: + this.syryData3 && this.syryData3.length > 0 ? [30, 130] : [0, 0], center: ["50%", "50%"], roseType: "area", itemStyle: { @@ -507,10 +588,37 @@ export default { saveAsImage: { show: true }, }, }, + title: { + show: !this.syryData4 || this.syryData4.length == 0, // 是否要展示“暂无数据”矢量图 + text: " {a|}", // 写入占位符a,以便后续填充内容 + x: "center", + y: "center", + subtext: "暂无数据", // 子标题 + itemGap: -10, // 设置主副标题间隔 + textStyle: { + rich: { + a: { + height: 128, // 设置图片高度 + width: 268, // 设置图片宽度 + backgroundColor: { + // 引入图片,作为背景图,填写相对路径 + image: require("@/assets/images/overview/zanwu.png"), + }, + }, + }, + }, + subtextStyle: { + // 配置副标题的文字样式 + fontSize: 12, + color: "#ffffff", + }, + }, series: [ { + name: "Nightingale Chart", type: "pie", - radius: [30, 130], + radius: + this.syryData4 && this.syryData4.length > 0 ? [30, 130] : [0, 0], center: ["50%", "50%"], roseType: "area", itemStyle: { @@ -611,10 +719,37 @@ export default { saveAsImage: { show: true }, }, }, + title: { + show: !this.syryData5 || this.syryData5.length == 0, // 是否要展示“暂无数据”矢量图 + text: " {a|}", // 写入占位符a,以便后续填充内容 + x: "center", + y: "center", + subtext: "暂无数据", // 子标题 + itemGap: -10, // 设置主副标题间隔 + textStyle: { + rich: { + a: { + height: 128, // 设置图片高度 + width: 268, // 设置图片宽度 + backgroundColor: { + // 引入图片,作为背景图,填写相对路径 + image: require("@/assets/images/overview/zanwu.png"), + }, + }, + }, + }, + subtextStyle: { + // 配置副标题的文字样式 + fontSize: 12, + color: "#ffffff", + }, + }, series: [ { + name: "Nightingale Chart", type: "pie", - radius: [30, 130], + radius: + this.syryData5 && this.syryData5.length > 0 ? [30, 130] : [0, 0], center: ["50%", "50%"], roseType: "area", itemStyle: { diff --git a/src/views/dataBoard/renfang/visualizing/components/zhiyuanzhe.vue b/src/views/dataBoard/renfang/visualizing/components/zhiyuanzhe.vue index c4de3122b..72ed67feb 100644 --- a/src/views/dataBoard/renfang/visualizing/components/zhiyuanzhe.vue +++ b/src/views/dataBoard/renfang/visualizing/components/zhiyuanzhe.vue @@ -130,11 +130,37 @@ export default { saveAsImage: { show: true }, }, }, + title: { + show: !this.zyzLeft || this.zyzLeft.length == 0, // 是否要展示“暂无数据”矢量图 + text: " {a|}", // 写入占位符a,以便后续填充内容 + x: "center", + y: "center", + subtext: "暂无数据", // 子标题 + itemGap: -10, // 设置主副标题间隔 + textStyle: { + rich: { + a: { + height: 128, // 设置图片高度 + width: 268, // 设置图片宽度 + backgroundColor: { + // 引入图片,作为背景图,填写相对路径 + image: require("@/assets/images/overview/zanwu.png"), + }, + }, + }, + }, + subtextStyle: { + // 配置副标题的文字样式 + fontSize: 12, + color: "#ffffff", + }, + }, series: [ { name: "Nightingale Chart", type: "pie", - radius: [30, 130], + radius: + this.zyzLeft && this.zyzLeft.length > 0 ? [30, 130] : [0, 0], center: ["50%", "50%"], roseType: "area", itemStyle: { @@ -223,11 +249,37 @@ export default { saveAsImage: { show: true }, }, }, + title: { + show: !this.zyzRight || this.zyzRight.length == 0, // 是否要展示“暂无数据”矢量图 + text: " {a|}", // 写入占位符a,以便后续填充内容 + x: "center", + y: "center", + subtext: "暂无数据", // 子标题 + itemGap: -10, // 设置主副标题间隔 + textStyle: { + rich: { + a: { + height: 128, // 设置图片高度 + width: 268, // 设置图片宽度 + backgroundColor: { + // 引入图片,作为背景图,填写相对路径 + image: require("@/assets/images/overview/zanwu.png"), + }, + }, + }, + }, + subtextStyle: { + // 配置副标题的文字样式 + fontSize: 12, + color: "#ffffff", + }, + }, series: [ { name: "Nightingale Chart", type: "pie", - radius: [30, 130], + radius: + this.zyzRight && this.zyzRight.length > 0 ? [30, 130] : [0, 0], center: ["50%", "50%"], roseType: "area", itemStyle: {