diff --git a/src/api/outputApi/index.ts b/src/api/outputApi/index.ts new file mode 100644 index 0000000..8d1a75a --- /dev/null +++ b/src/api/outputApi/index.ts @@ -0,0 +1,43 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; + +/** + * 查询项目数据 + * @param query + * @returns {*} + */ + +export const projectProgress = (query?: any): any => { + return request({ + url: '/enterprise/big/screen/projectProgress', + method: 'get', + params: query + }); +}; + +/** + * 产值 + * @param query + * @returns {*} + */ + +export const outpuProgress = (query?: any): any => { + return request({ + url: '/enterprise/big/screen/projectOutputValueComparison', + method: 'get', + params: query + }); +}; +/** + * 预警 + * @param query + * @returns {*} + */ + +export const earlyWarning = (query?: any): any => { + return request({ + url: '/enterprise/big/screen/riskEarlyWarning', + method: 'get', + params: query + }); +}; diff --git a/src/assets/large/actual.png b/src/assets/large/actual.png new file mode 100644 index 0000000..c22820f Binary files /dev/null and b/src/assets/large/actual.png differ diff --git a/src/assets/large/capacity.png b/src/assets/large/capacity.png new file mode 100644 index 0000000..d793950 Binary files /dev/null and b/src/assets/large/capacity.png differ diff --git a/src/assets/large/delay.png b/src/assets/large/delay.png new file mode 100644 index 0000000..23f8e08 Binary files /dev/null and b/src/assets/large/delay.png differ diff --git a/src/assets/large/plan.png b/src/assets/large/plan.png new file mode 100644 index 0000000..ad09f94 Binary files /dev/null and b/src/assets/large/plan.png differ diff --git a/src/views/enterpriseLarge/digitalizationScreen/components/centerPage.vue b/src/views/enterpriseLarge/digitalizationScreen/components/centerPage.vue index 50ab572..c71a8cd 100644 --- a/src/views/enterpriseLarge/digitalizationScreen/components/centerPage.vue +++ b/src/views/enterpriseLarge/digitalizationScreen/components/centerPage.vue @@ -1,275 +1,328 @@ - diff --git a/src/views/enterpriseLarge/digitalizationScreen/components/optionList.ts b/src/views/enterpriseLarge/digitalizationScreen/components/optionList.ts index bcdf958..502ddc2 100644 --- a/src/views/enterpriseLarge/digitalizationScreen/components/optionList.ts +++ b/src/views/enterpriseLarge/digitalizationScreen/components/optionList.ts @@ -1,51 +1,54 @@ export let pieOption = { // 定义中心文字 graphic: [ - { - type: 'text', - left: 'center', - top: '40%', - style: { - // 需要从接口替换 - text: '70%', - fontSize: 24, - fontWeight: 'bold', - fill: '#fff' - } - }, - { - type: 'text', - left: 'center', - top: '50%', - style: { - text: '总进度', - fontSize: 14, - fill: '#fff' - } - }, + // { + // type: 'text', + // left: 'center', + // top: '40%', + // style: { + // // 需要从接口替换 + // text: '70%', + // fontSize: 24, + // fontWeight: 'bold', + // fill: '#fff' + // } + // } + // { + // type: 'text', + // left: 'center', + // top: '50%', + // style: { + // text: '111', + // fontSize: 14, + // fill: '#fff' + // } + // } ], - legend: { - show: true, - type: 'plain', - bottom: 20, - itemWidth: 12, - itemHeight: 12, - textStyle: { - color: '#fff' - } - }, + // legend: { + // show: true, + // type: 'plain', + // bottom: 20, + // itemWidth: 12, + // itemHeight: 12, + // textStyle: { + // color: '#fff' + // } + // }, series: { type: 'pie', data: [], radius: [50, 80], center: ['50%', '45%'], - itemStyle: { - borderColor: '#fff', - borderWidth: 1 - }, + // itemStyle: { + // borderColor: '#fff', + // borderWidth: 1 + // }, label: { alignTo: 'edge', - formatter: '{name|{b}}\n{percent|{c} %}', + formatter: function (params) { + // 只显示前三个数据项 + return `{name|${params.data.name}}\n{percent|${params.data.completionRate}MW}`; + }, minMargin: 10, edgeDistance: 20, lineHeight: 15, @@ -62,7 +65,7 @@ export let pieOption = { }, legend: { top: 'bottom' - }, + } } }; @@ -72,16 +75,39 @@ export let barOption = { itemWidth: 12, itemHeight: 12, // 调整文字与图标间距 - data: ['计划流转面积', '已流转面积'], + data: ['计划产值', '实际产值'], top: 0, - right: 20, + right: 10, + bottom: 10, textStyle: { - color: '#fff', + color: '#fff' } }, + + tooltip: { + show: true, + backgroundColor: '', + trigger: 'axis', + // formatter: '{b0}:{c0}万元', + formatter: (params: any) => { + // params 是数组,对应每条柱子 + return params + .map((p: any) => `${p.seriesName}:${Number(p.value).toFixed(2)} 亿元`) + + .join('
'); + }, + textStyle: { + color: '#fff' + }, + axisPointer: { + type: 'shadow' // 默认为直线,可选为:'line' | 'shadow', + } + // borderColor: 'rgba(252, 217, 18, 1)' + }, xAxis: { type: 'category', - data: ['地块1', '地块2', '地块3', '地块4', '地块5', '地块6'], + data: [], + axisLabel: { color: '#fff' }, @@ -93,34 +119,71 @@ export let barOption = { } }, yAxis: { - name: '单位:m²', + name: '单位:亿元', type: 'value', axisLabel: { formatter: '{value}' + }, + splitLine: { + show: false // 不显示分割线 } }, grid: { - bottom: 0, // 距离容器底部的距离 - containLabel: true // 确保坐标轴标签不被裁剪 + left: '12%', + top: '15%', // 顶部留一点空间给 legend + bottom: '8%', + right: '2%' }, series: [ { - name: '计划流转面积', + name: '计划产值', type: 'bar', data: [], - barWidth: '20%', + barWidth: '10', itemStyle: { - color: 'rgb(29, 253, 253)' - }, + color: { + type: 'linear', + x: 0, + y: 1, // 修改y为1表示从底部开始 + x2: 0, + y2: 0, // 修改y2为0表示渐变到顶部 + colorStops: [ + { + offset: 0, + color: 'rgba(255, 209, 92, 0.1)' // 底部透明度0.1 + }, + { + offset: 1, + color: 'rgba(255, 209, 92, 1)' // 顶部透明度1 + } + ] + } + } }, { - name: '已流转面积', + name: '实际产值', type: 'bar', data: [], - barWidth: '20%', + barWidth: '10', itemStyle: { - color: 'rgb(25, 181, 251)' - }, + color: { + type: 'linear', + x: 0, + y: 1, // 从底部开始 + x2: 0, + y2: 0, // 到顶部结束 + colorStops: [ + { + offset: 0, + color: 'rgba(7, 209, 250, 0.1)' // 底部透明度0.1 + }, + { + offset: 1, + color: 'rgba(7, 209, 250, 1)' // 顶部透明度1 + } + ] + } + } } ] }; @@ -129,7 +192,7 @@ export let mapOption = { geo: { map: 'ch', roam: true, - aspectScale: Math.cos((47 * Math.PI) / 180), + aspectScale: Math.cos((47 * Math.PI) / 180) }, series: [ { @@ -147,7 +210,7 @@ export let mapOption = { { name: 'i', value: [9.085994375000002, 47.55395822835779] }, { name: 'j', value: [8.653968125000002, 47.47709530818285] }, { name: 'k', value: [8.203158125000002, 47.44506909144329] } - ], + ] } ] }; diff --git a/src/views/enterpriseLarge/digitalizationScreen/components/rightPage.vue b/src/views/enterpriseLarge/digitalizationScreen/components/rightPage.vue index 0d08c08..e57e5b6 100644 --- a/src/views/enterpriseLarge/digitalizationScreen/components/rightPage.vue +++ b/src/views/enterpriseLarge/digitalizationScreen/components/rightPage.vue @@ -1,13 +1,60 @@