Prechádzať zdrojové kódy

sit部署第一版本

zhbyyy 2 rokov pred
rodič
commit
29139dd8e2

+ 1 - 1
investmentPort/investHomeGroup.html

@@ -264,7 +264,7 @@
               <span class="text">投资产业分布</span>
             </div>
             <div class="content">
-              <div id="echartC1" class="commonBack" style="width: 100%; height: 100%;"></div>
+              <div id="echartC1" ref="echartC1" class="commonBack" style="width: 100%; height: 100%;"></div>
             </div>
           </div>
           <div class="card">

+ 3 - 3
investmentPort/js/groupData.js

@@ -360,13 +360,13 @@ let center1 = [1324.08, 442, 1169.91, 154]
 // 左中
 let center2 = [
   {
-    name: '传统产业', y: 405.29, num: 95, sliced: false, selected: false,
+    name: '传统产业', y: 405.29,value :405.29, num: 95, sliced: false, selected: false,
   },
   {
-    name: '战略新兴产业', y: 196.44, num: 95, sliced: false, selected: false
+    name: '战略新兴产业', y: 296.44, value :296.44,num: 95, sliced: false, selected: false
   },
   {
-    name: '基础产业', y: 722.34, num: 95, sliced: false, selected: false
+    name: '基础产业', y: 722.34, value :722.34,num: 95, sliced: false, selected: false
   }
 ]
 // 左下

+ 329 - 17
investmentPort/js/investHomeGroup.js

@@ -4,15 +4,15 @@ let app = new Vue({
     return {
       boardType: '', // 哪边的项目看板
       pullShow: false, // 选择年份弹窗
-      pollList: [2021, 2022, 2023, 2024],
+      pollList: [],
       mockData: true,// 是否使用修改的数据
-      year: 2023, // 选择的年份
+      year: '', // 选择的年份
       boardUrl: '', // 跳转路径
       boardTipShow: false, // 项目看板弹窗专用
       lineCommonCompany: [], //双柱状图弹窗上面的折线图x轴
       commonCompanyAll: [], // 公司包括编码
       changeLine: true,
-      versions: false, // 是否使用接口数据数据
+      versions: true, // 是否使用接口数据数据
       app_token: '',
       centerShow: false, // 中间内容显示
       echartR4Chart: '',// 倒数第二个专用
@@ -94,9 +94,44 @@ let app = new Vue({
     }
   },
   mounted () {
+    this.getUrlParams()
+    this.countYear()
     this.comeIn()
   },
   methods: {
+    // 获取地址栏参数
+    getUrlParams (id) {
+      let url = window.location.href
+      // 通过 ? 分割获取后面的参数字符串
+      let urlStr = url.split('?')[1]
+      if (!urlStr) {
+        return
+      }
+      // 创建空对象存储参数
+      let obj = {};
+      // 再通过 & 将每一个参数单独分割出来
+      let paramsArr = urlStr.split('&')
+      for (let i = 0, len = paramsArr.length; i < len; i++) {
+        // 再通过 = 将每一个参数分割为 key:value 的形式
+        let arr = paramsArr[i].split('=')
+        obj[arr[0]] = arr[1];
+      }
+      if(obj.model){
+        obj.model=='A' || obj.model=='a'?this.mockData = false:this.mockData = true
+      }
+    },
+    // 计算展示的年份
+    countYear () {
+      this.year = new Date().getFullYear()
+      for (i = 2022; true; i++) {
+        if (i == this.year) {
+          this.pollList.push(i)
+          return
+        } else {
+          this.pollList.push(i)
+        }
+      }
+    },
     comeIn () {
       if (this.versions) {
         // 接口版
@@ -243,7 +278,7 @@ let app = new Vue({
           access_token: this.access_token,
           "data": {
             "mdnb_combofield": this.mockData ? 'B' : 'A',
-            "mdnb_datefield": this.year + '-01-01',
+            "mdnb_datefield": this.year - 1 + '-01-01',
           },
           pageSize: 1000
         }
@@ -273,7 +308,7 @@ let app = new Vue({
           access_token: this.access_token,
           "data": {
             "mdnb_combofield": this.mockData ? 'B' : 'A',
-            "mdnb_datefield": this.year + '-01-01',
+            "mdnb_datefield": this.year - 1 + '-01-01',
           },
           pageSize: 1000
         }
@@ -309,7 +344,7 @@ let app = new Vue({
           access_token: this.access_token,
           "data": {
             "mdnb_combofield": this.mockData ? 'B' : 'A',
-            "mdnb_datefield": this.year + '-01-01',
+            "mdnb_datefield": this.year - 1 + '-01-01',
           },
           pageSize: 1000
         }
@@ -317,7 +352,7 @@ let app = new Vue({
           if (res.data.rows.length > 0) {
             let dataList = this.classify(res.data.rows[0].mdnb_entryentity, 'mdnb_textfield1')
             // 传统产业分析
-            if (dataList[0]) {
+            if (dataList[0].length > left7.length || dataList[0].length == left7.length) {
               for (let i = 0; i < left7.length; i++) {
                 left7[i].num = dataList[0].data[i].mdnb_integerfield13
                 left7[i].y = dataList[0].data[i].mdnb_amountfield8
@@ -325,7 +360,7 @@ let app = new Vue({
               this.initChartL5()
             }
             // 战略性新兴产业
-            if (dataList[1]) {
+            if (dataList[1].length > left8.length || dataList[1].length == left8.length) {
               for (let i = 0; i < left8.length; i++) {
                 left8[i].num = dataList[1].data[i].mdnb_integerfield13
                 left8[i].y = dataList[1].data[i].mdnb_amountfield8
@@ -333,7 +368,7 @@ let app = new Vue({
               this.initChartL6()
             }
             // 特色优势产业
-            if (dataList[2]) {
+            if (dataList[2].length > left9.length || dataList[2].length == left9.length) {
               for (let i = 0; i < left9.length; i++) {
                 left9[i].num = dataList[2].data[i].mdnb_integerfield13
                 left9[i].y = dataList[2].data[i].mdnb_amountfield8
@@ -341,7 +376,7 @@ let app = new Vue({
               this.initChartL7()
             }
             // 公共基础等产业
-            if (dataList[3]) {
+            if (dataList[3].length > left10.length || dataList[3].length == left10.length) {
               for (let i = 0; i < left10.length; i++) {
                 left10[i].num = dataList[3].data[i].mdnb_integerfield13
                 left10[i].y = dataList[3].data[i].mdnb_amountfield8
@@ -361,7 +396,7 @@ let app = new Vue({
           access_token: this.access_token,
           "data": {
             "mdnb_combofield": this.mockData ? 'B' : 'A',
-            "mdnb_datefield": this.year + '-01-01',
+            "mdnb_datefield": this.year - 1 + '-01-01',
           },
           pageSize: 1000
         }
@@ -421,7 +456,7 @@ let app = new Vue({
           access_token: this.access_token,
           "data": {
             "mdnb_combofield": this.mockData ? 'B' : 'A',
-            "mdnb_datefield": this.year + '-01-01',
+            "mdnb_datefield": this.year - 1 + '-01-01',
           },
           pageSize: 1000
         }
@@ -447,7 +482,7 @@ let app = new Vue({
           access_token: this.access_token,
           "data": {
             "mdnb_combofield": this.mockData ? 'B' : 'A',
-            "mdnb_datefield": this.year + '-01-01',
+            "mdnb_datefield": this.year - 1 + '-01-01',
           },
           pageSize: 1000
         }
@@ -628,6 +663,9 @@ let app = new Vue({
         }
         get('/ierp/kapi/v2/mdnb/mdnb_xmkb/presetdata/getKeyData', value).then(res => {
           // 头部指标
+          if(!res.data){
+            return
+          }
           center4[0] = res.data.transformations.estateAmount
           center4[1] = res.data.transformations.estateNum
           center4[2] = res.data.transformations.figureAmount
@@ -640,6 +678,7 @@ let app = new Vue({
           // 投资产业分布
           for (let i = 0; i < center2.length; i++) {
             center2[i].y = that.yuanChange(res.data.distribution[i].amount)
+            center2[i].value = that.yuanChange(res.data.distribution[i].amount)
             center2[i].num = res.data.distribution[i].count
             center2[i].typeno = res.data.distribution[i].typeno
           }
@@ -954,6 +993,7 @@ let app = new Vue({
           param,
           orgNum
         }
+        that.config6.header[2] = '投资主体'
         that.config6.header[5] = '年投资完成额(亿)'
         if (portType == 1) {
           get('/ierp/kapi/v2/mdnb/mdnb_xmkb/presetdata/MainPageMonthReportProject', value).then(res => {
@@ -962,7 +1002,10 @@ let app = new Vue({
             res.data.forEach((item, index) => {
               that.config6.data[index] = []
               that.config6.data[index][0] = item.projectname
-              that.config6.data[index][2] = item.orgName
+              that.config6.data[index][1] = item.orgName
+              that.config6.data[index][2] = item.tzzt
+              that.config6.data[index][3] = item.cylb
+              that.config6.data[index][4] = item.cylb2
               that.config6.data[index][5] = item.amount
             })
             that.config6 = { ...that.config6 }
@@ -976,7 +1019,10 @@ let app = new Vue({
             res.data.forEach((item, index) => {
               that.config6.data[index] = []
               that.config6.data[index][0] = item.projectname
-              that.config6.data[index][2] = item.orgName
+              that.config6.data[index][1] = item.orgName
+              that.config6.data[index][2] = item.tzzt
+              that.config6.data[index][3] = item.cylb
+              that.config6.data[index][4] = item.cylb2
               that.config6.data[index][5] = item.amount
             })
             that.config6 = { ...that.config6 }
@@ -1033,11 +1079,12 @@ let app = new Vue({
     },
     // 找项目编码
     findProjectCode (a, b, type) {
+      console.log(a, b, type,'??????????',this.originalConfig6)
       if (type == 'center') {
         let c = this.originalConfig6.find(item => {
-          return item.name == b && item.group == a
+          return item.projectname == a && item.tzzt == b
         })
-        return c.typeno
+        return c.projectno
       } else if (type == 'right') {
         let c = this.originalConfig6.find(item => {
           return item.mdnb_project_name == a && item.mdnb_org == b
@@ -1052,6 +1099,7 @@ let app = new Vue({
     },
     // 去项目看板
     goLookBoard (e, f) {
+      console.log(e,'看看E')
       if (f) {
         this.boardType = f
         this.boardUrl = `http://172.21.3.68:8081/ierp/accessTokenLogin.do?access_token=${this.access_token}&redirect=http://172.21.3.68:8081/ierp/index.html?formId=mdnb_threetoproject&prj=${this.findProjectCode(e.row[0], e.row[1], this.boardType)}`
@@ -3885,6 +3933,7 @@ let app = new Vue({
     },
     // 大屏二
     initChartC1 () {
+      //3D饼图
       var chartData = center2
       var timer = null;
       var i = 0;
@@ -4081,6 +4130,57 @@ let app = new Vue({
       function autoTooltip (point) {
         that.center1Chart.tooltip.refresh(point);
       }
+      // 南丁格尔图
+      // let myChart = echarts.init(this.$refs['echartC1'])
+      // option = {
+      //   color: ['#064F78', '#BDB35D', '#623726', '#955773', '#B57C63', '#73A88E', '#09736D', '#13400B', '#0D3265'],
+      //   legend: {
+      //     icon: "circle",
+      //     top: 'bottom',
+      //     orient: 'vertical', // vertical 竖着 
+      //     left: '78%',
+      //     textStyle: {
+      //       color: '#fff',
+      //       fontSize: 20,
+      //       fontFamily: 'Microsoft YaHei'
+      //     },
+      //   },
+      //   tooltip: {
+      //     trigger: 'item',
+      //     textStyle: {
+      //       color: '#fff', //X轴文字颜色
+      //       fontSize: 20,
+      //       fontFamily: 'Microsoft YaHei'
+      //     },
+      //     formatter: data => {
+      //       // 小圆点
+      //       return `${data.name}:${data.percent}%<br/>${data.data.y}亿,${data.data.num}个`
+      //     },
+      //   },
+      //   series: [
+      //     {
+      //       name: '',
+      //       type: 'pie',
+      //       radius: [0, 220],
+      //       center: ['50%', '50%'],
+      //       roseType: 'area',
+      //       itemStyle: {
+      //         borderRadius: 8
+      //       },
+      //       label: {
+      //         normal: {
+      //           show: false,
+      //         },
+      //       },
+      //       data: center2
+      //     }
+      //   ]
+      // };
+      // myChart.setOption(option)
+      // tools.loopShowTooltip(myChart, option, {
+      //   interval: 2000,
+      //   loopSeries: true,
+      // });
     },
     initChartC2 () {
       let that = this
@@ -4732,6 +4832,7 @@ let app = new Vue({
               formatter: '{value} %',
               textStyle: {
                 color: 'rgba(250,250,250,0.6)',
+                fontFamily: 'Microsoft YaHei'
               },
             },
           },
@@ -4781,6 +4882,7 @@ let app = new Vue({
 
     },
     initChartC4 () {
+      // 3D饼图
       var chartData = []
       var timer = null;
       var timer2 = null;
@@ -5020,6 +5122,216 @@ let app = new Vue({
       function autoTooltip (point) {
         that.center4Chart.tooltip.refresh(point);
       }
+      // 环形图
+      // let myChart = echarts.init(this.$refs['echartC4'])
+      // data = [
+      //   { name: '新建', value: 204, value2: 345.53, sliced: false, selected: false },
+      //   { name: '续建', value: 385, value2: 978.55, sliced: false, selected: false },
+      // ]
+      // arrName = getArrayValue(data, "name");
+      // arrValue = getArrayValue(data, "value");
+      // sumValue = eval(arrValue.join("+"));
+      // objData = array2obj(data, "name");
+      // optionData = getData(data);
+      // function getArrayValue (array, key) {
+      //   var key = key || "value";
+      //   var res = [];
+      //   if (array) {
+      //     array.forEach(function (t) {
+      //       res.push(t[key]);
+      //     });
+      //   }
+      //   return res;
+      // }
+
+      // function array2obj (array, key) {
+      //   var resObj = {};
+      //   for (var i = 0; i < array.length; i++) {
+      //     resObj[array[i][key]] = array[i];
+      //   }
+      //   return resObj;
+      // }
+
+      // function getData (data) {
+      //   var res = {
+      //     series: [],
+      //     yAxis: [],
+      //   };
+      //   for (let i = 0; i < data.length; i++) {
+      //     // console.log([70 - i * 15 + '%', 67 - i * 15 + '%']);
+      //     res.series.push({
+      //       name: "",
+      //       type: "pie",
+      //       clockWise: false, //顺时加载
+      //       hoverAnimation: false, //鼠标移入变大
+      //       radius: [53 - i * 15 + "%", 48 - i * 15 + "%"],
+      //       center: ["50%", "50%"],
+      //       label: {
+      //         show: false,
+      //       },
+      //       itemStyle: {
+      //         label: {
+      //           show: false,
+      //         },
+      //         labelLine: {
+      //           show: false,
+      //         },
+      //         borderWidth: 5,
+      //       },
+      //       data: [
+      //         {
+      //           value: data[i].value,
+      //           name: data[i].name,
+      //         },
+      //         {
+      //           value: sumValue - data[i].value,
+      //           name: "",
+      //           itemStyle: {
+      //             color: "rgba(0,0,0,0)",
+      //             borderWidth: 0,
+      //           },
+      //           tooltip: {
+      //             show: false,
+      //           },
+      //           hoverAnimation: false,
+      //         },
+      //       ],
+      //     });
+      //     res.series.push({
+      //       name: "",
+      //       type: "pie",
+      //       silent: true,
+      //       z: 1,
+      //       clockWise: false, //顺时加载
+      //       hoverAnimation: false, //鼠标移入变大
+      //       radius: [53 - i * 15 + "%", 48 - i * 15 + "%"],
+      //       center: ["50%", "50%"],
+      //       label: {
+      //         show: false,
+      //       },
+      //       itemStyle: {
+      //         label: {
+      //           show: false,
+      //         },
+      //         labelLine: {
+      //           show: false,
+      //         },
+      //         borderWidth: 5,
+      //       },
+      //       data: [
+      //         {
+      //           value: 7.5,
+      //           itemStyle: {
+      //             color: "rgb(3, 31, 62)",
+      //             borderWidth: 0,
+      //           },
+      //           tooltip: {
+      //             show: false,
+      //           },
+      //           hoverAnimation: false,
+      //         },
+      //         {
+      //           value: 2.5,
+      //           name: "",
+      //           itemStyle: {
+      //             color: "rgba(0,0,0,0)",
+      //             borderWidth: 0,
+      //           },
+      //           tooltip: {
+      //             show: false,
+      //           },
+      //           hoverAnimation: false,
+      //         },
+      //       ],
+      //     });
+      //     res.yAxis.push(((data[i].value / sumValue) * 100).toFixed(2) + "%");
+      //   }
+      //   return res;
+      // }
+      // let option = {
+      //   graphic: {
+      //     elements: [{
+      //       type: 'image',//需要填充图片,配置image,如果不需要图片可以配置其他的, text, circle, sector, ring, polygon, polyline, rect, line, bezierCurve, arc, group,
+      //       style: {
+      //         // image: './images/loop.png', //这里添加图片地址
+      //         width: 320,
+      //         height: 320
+      //       },
+      //       left: '30',//
+      //       top: 'middle' //配置图片居中
+      //     }]
+      //   },
+      //   legend: {
+      //     show: true,
+      //     icon: "circle",
+      //     top: "center",
+      //     left: "70%",
+      //     data: arrName,
+      //     width: 50,
+      //     padding: [0, 5],
+      //     itemGap: 25,
+      //     formatter: function (name) {
+      //       return (
+      //         "{title|" + name + "}\n{value|" + objData[name].value + "}  {title|项}"
+      //       );
+      //     },
+
+      //     textStyle: {
+      //       rich: {
+      //         title: {
+      //           fontSize: '20px',
+      //           color: "red",
+      //           fontFamily: 'Microsoft YaHei'
+      //         },
+      //         value: {
+      //           fontSize: '20px',
+      //           color: "#fff",
+      //         },
+      //       },
+      //     },
+      //   },
+      //   color: ['#064F78', '#BDB35D', '#623726', '#955773', '#B57C63', '#73A88E', '#09736D', '#13400B', '#0D3265'],
+
+      //   grid: {
+      //     top: "center",
+      //     left: "center",
+      //     containLabel: false,
+      //   },
+      //   yAxis: [
+      //     {
+      //       type: "category",
+      //       inverse: true,
+      //       axisLine: {
+      //         show: false,
+      //       },
+      //       axisTick: {
+      //         show: false,
+      //       },
+      //       axisLabel: {
+      //         interval: 0,
+      //         inside: true,
+      //         textStyle: {
+      //           color: "#fff",
+      //           fontSize: 20,
+      //           fontFamily: 'Microsoft YaHei'
+      //         },
+      //         show: true,
+      //       },
+      //       data: optionData.yAxis,
+      //     },
+      //   ],
+      //   xAxis: [
+      //     {
+      //       show: false,
+      //     },
+      //   ],
+      //   series: optionData.series,
+      // }
+      // myChart.setOption(option)
+      // tools.loopShowTooltip(myChart, option, {
+      //   interval: 2000,
+      //   loopSeries: true,
+      // });
     },
     initProjectList () {
       let dataList = []