From b38a68de85d3334df10c5e0eb72309562e87ed27 Mon Sep 17 00:00:00 2001 From: yuzongping <835949940@qq.com> Date: Fri, 18 Jul 2025 10:38:32 +0800 Subject: [PATCH] =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/charts/lines/index.html | 1 + src/components/charts/lines/index.js | 195 ++++++++++++++++++ src/components/charts/lines/index.scss | 6 + src/components/charts/lines/index.vue | 3 + src/utils/request.js | 4 +- src/views/property/api/index.js | 15 +- .../property/comps/left/middle/4/index.html | 23 ++- .../property/comps/left/middle/4/index.js | 72 +++++++ .../property/comps/left/middle/4/index.scss | 14 ++ .../property/comps/right/middle/4/index.html | 23 ++- .../property/comps/right/middle/4/index.js | 69 ++++++- .../property/comps/right/middle/4/index.scss | 14 ++ src/views/property/comps/right/top/4/index.js | 1 - 13 files changed, 422 insertions(+), 18 deletions(-) create mode 100644 src/components/charts/lines/index.html create mode 100644 src/components/charts/lines/index.js create mode 100644 src/components/charts/lines/index.scss create mode 100644 src/components/charts/lines/index.vue diff --git a/src/components/charts/lines/index.html b/src/components/charts/lines/index.html new file mode 100644 index 0000000..d60fced --- /dev/null +++ b/src/components/charts/lines/index.html @@ -0,0 +1 @@ +
diff --git a/src/components/charts/lines/index.js b/src/components/charts/lines/index.js new file mode 100644 index 0000000..4a3fa82 --- /dev/null +++ b/src/components/charts/lines/index.js @@ -0,0 +1,195 @@ +import * as echarts from 'echarts'; +import elementResizeDetectorMaker from 'element-resize-detector'; +export default { + props: { + id: { + type: String, + default: 'lines' + }, + data: { + type: Array, + default: function () { + return [ + { + name: '1月', + value: '10' + }, + { + name: '2月', + value: '19' + } + ]; + } + }, + color: { + type: Array, + default: function () { + return ['rgba(134, 91, 252, 1)', 'rgba(26, 106, 226, 0.5)', 'rgba(26, 106, 226, 0)'] + } + }, + areaStyle: { + type: Array, + default: function () { + return ['rgba(134, 91, 252, 1)', 'rgba(26, 106, 226, 0.5)', 'rgba(26, 106, 226, 0)'] + } + } + }, + data () { + return { + chart: null + }; + }, + mounted () { + this.initChart(); + }, + computed: { + }, + methods: { + // 设置监听器 页面尺寸变化重新绘制图表 + initResizeCallBack () { + const erd = elementResizeDetectorMaker(); + erd.listenTo(document.getElementById(this.id), () => { + this.$nextTick(() => { + this.chart.resize(); + }); + }); + }, + initChart () { + this.chart = echarts.init(document.getElementById(this.id)); + this.chartSetOption(); + }, + chartSetOption () { + + let xAxisData = []; + let data = []; + this.data.forEach(item => { + xAxisData.push(item.name) + data.push(item.value) + }); + const option = { + grid: { + left: "5%", + right: "10%", + top: "15%", + bottom: "10%", + containLabel: true, + }, + tooltip: { + show: true, + trigger: "item", + }, + legend: { + show: false + }, + color: { + color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [ + { + offset: 1, + color: this.color[0], + }, + { + offset: 0.5, + color: this.color[1], + }, + { + offset: 0, + color: this.color[2], + }, + ]), + }, + xAxis: [ + { + type: "category", + boundaryGap: false, + axisLabel: { + color: 'rgba(185, 211, 235, 1)', + }, + axisLine: { + show: false + }, + axisTick: { + show: false + }, + splitLine: { + show: false + }, + data: xAxisData + }, + ], + yAxis: [ + { + type: "value", + name: "单位:万元", + nameTextStyle: { + color: 'rgba(185, 211, 235, 1)' + }, + axisLabel: { + formatter: "{value}", + textStyle: { + color: "rgba(185, 211, 235, 1)", + }, + }, + axisLine: { + lineStyle: { + color: "#27b4c2", + }, + }, + axisTick: { + show: false, + }, + splitLine: { + show: true, + lineStyle: { + color: "#11366e", + }, + }, + } + ], + series: [ + { + name: "", + type: "line", + smooth: true, + symbolSize: 12, + itemStyle: { + normal: { + color: this.color[0], + lineStyle: { + color: this.color[0], + width: 1, + }, + areaStyle: { + color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [ + { + offset: 1, + color: this.areaStyle[0], + }, + { + offset: 0.5, + color: this.areaStyle[1], + }, + { + offset: 0, + color: this.areaStyle[2], + }, + ]), + }, + }, + }, + markPoint: { + itemStyle: { + normal: { + color: "red", + }, + }, + }, + data: data + } + ], + };; + this.chart.setOption(option); + this.initResizeCallBack(); + + } + } +}; diff --git a/src/components/charts/lines/index.scss b/src/components/charts/lines/index.scss new file mode 100644 index 0000000..b89d9dc --- /dev/null +++ b/src/components/charts/lines/index.scss @@ -0,0 +1,6 @@ +.chart { + overflow: visible; + width: 100%; + height: 100%; + z-index: 2; +} \ No newline at end of file diff --git a/src/components/charts/lines/index.vue b/src/components/charts/lines/index.vue new file mode 100644 index 0000000..5ca257a --- /dev/null +++ b/src/components/charts/lines/index.vue @@ -0,0 +1,3 @@ + + + diff --git a/src/utils/request.js b/src/utils/request.js index 409374c..e1e9307 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -53,8 +53,8 @@ service.interceptors.response.use(res => { try { const code = res.data.code || 200; // 获取错误信息 - // const msg = errorCode[code] || res.data.msg || errorCode['default'] - const msg = errorCode[code] + const msg = errorCode[code] || res.data.msg || errorCode['default'] + // const msg = errorCode[code] if (code === 401) { MessageBox.confirm('登录状态已过期,请重新登录', '系统提示', { confirmButtonText: '重新登录', diff --git a/src/views/property/api/index.js b/src/views/property/api/index.js index 74f26a3..d8e440c 100644 --- a/src/views/property/api/index.js +++ b/src/views/property/api/index.js @@ -327,4 +327,17 @@ export function debtCategoryAnalysis (deptId, year) { method: 'get', params: query }) -} \ No newline at end of file +} + +// 资产一张图-债务预警-右中-债务分布 +export function debtDistribution (deptId, year) { + let query = { + deptId, + year + } + return request({ + url: 'api/home/xixia/assetLiabilities/zwfb', + method: 'get', + params: query + }) +} diff --git a/src/views/property/comps/left/middle/4/index.html b/src/views/property/comps/left/middle/4/index.html index 7301e5c..cdb78f9 100644 --- a/src/views/property/comps/left/middle/4/index.html +++ b/src/views/property/comps/left/middle/4/index.html @@ -1,4 +1,23 @@ -