ソースを参照

修改动态设置环境

zhbyyy 2 年 前
コミット
28da594022

+ 6 - 6
investmentPort/investHome.html

@@ -527,34 +527,34 @@
               <div>
                 <span>2022年度合并报表净利润</span>
                 <span style="color:#69c0ff"><span
-                    style="font-size: 20px;font-weight: bold;font-size: 40px;">{{numFormat(common1[0])}}</span>亿</span>
+                    style="font-size: 20px;font-weight: bold;font-size: 40px;">{{numFormat(yuanChange(common1[0]))}}</span>亿</span>
               </div>
               <div>
                 <span>提取固定资产折旧和无形资产摊销</span>
                 <span style="color:#69c0ff"><span
-                    style="font-size: 20px;font-weight: bold;font-size: 40px;">{{numFormat(common1[1])}}</span>亿</span>
+                    style="font-size: 20px;font-weight: bold;font-size: 40px;">{{numFormat(yuanChange(common1[1]))}}</span>亿</span>
               </div>
               <div>
                 <span>预计带息负债压降</span>
                 <span style="color:#69c0ff"><span
-                    style="font-size: 20px;font-weight: bold;font-size: 40px;">{{numFormat(common1[2])}}</span>亿</span>
+                    style="font-size: 20px;font-weight: bold;font-size: 40px;">{{numFormat(yuanChange(common1[2]))}}</span>亿</span>
               </div>
               <div>
                 <span>已用额度</span>
                 <span style="color:#69c0ff"><span
-                    style="font-size: 20px;font-weight: bold;font-size: 40px;">{{numFormat(common1[3])}}</span>亿</span>
+                    style="font-size: 20px;font-weight: bold;font-size: 40px;">{{numFormat(yuanChange(common1[3]))}}</span>亿</span>
               </div>
               <div>
                 <span>剩余额度</span>
                 <span style="color:#69c0ff"><span
-                    style="font-size: 20px;font-weight: bold;font-size: 40px;">{{numFormat(common1[4])}}</span>亿</span>
+                    style="font-size: 20px;font-weight: bold;font-size: 40px;">{{numFormat(yuanChange(common1[4]))}}</span>亿</span>
               </div>
             </div>
           </div>
           <div class=""
             style="position:relative;width: 100%;height: 100%;background-color: #092853;border-radius: 15px;"
             @click="leftPenetrateTwo('投资额度分析','总额度','','',titleName,212)">
-            <div class="total3 total">总额度:<span style="font-size: 40px;">{{numFormat(common1[5])}}<span
+            <div class="total3 total">总额度:<span style="font-size: 40px;">{{numFormat(yuanChange(common1[5]))}}<span
                   style="font-size: 30px;">亿</span></span></div>
             <img src="./groupImg/light2.png" class="absolute ballLight2" alt="">
             <div ref="echartBall" style="width: 100%; height: 80%;"></div>

+ 4 - 4
investmentPort/js/groupData.js

@@ -5,9 +5,9 @@ let left1 = [522.84, 179.39, 621.62]
 let left2 = [0.30, 1323.85]
 // 左中
 let left3 = [
-  [359.91, 400.49, 117.65, 148.96, 34.84, 17.79, 26.15, 26.18, 16.83, 0.00, 43.49, 0.00, 43.39, 76.53, 5.05, 8.59, 0.00, 0.28],
-  [359.91, 400.49, 117.65, 148.96, 34.84, 17.79, 26.15, 26.18, 16.83, 0.00, 43.49, 0.00, 43.39, 76.53, 5.05, 8.59, 0.00, 0.28],
-  [359.91, 400.49, 117.65, 148.96, 34.84, 17.79, 26.15, 26.18, 16.83, 0.00, 43.49, 0.00, 43.39, 76.53, 5.05, 8.59, 0.00, 0.28]
+  [159.91, 400.49, 117.65, 148.96, 34.84, 17.79, 26.15, 26.18, 16.83, 0.00, 43.49, 0.00, 43.39, 76.53, 5.05, 8.59, 0.00, 0.28],
+  [359.91, 100.49, 117.65, 148.96, 34.84, 17.79, 26.15, 26.18, 16.83, 0.00, 43.49, 0.00, 43.39, 76.53, 5.05, 8.59, 0.00, 0.28],
+  [359.91, 100.49, 117.65, 148.96, 34.84, 17.79, 26.15, 26.18, 16.83, 0.00, 43.49, 0.00, 43.39, 76.53, 5.05, 8.59, 0.00, 0.28]
 ]
 // 右上
 let left4 = [1363.88, 1198.19, 372, 165.69, 261]
@@ -680,7 +680,7 @@ let right8 = [
 ]
 // 公共
 // 球弹窗
-let common1 = [135.26, 186.82, 78.40, 46.02, 354.47, 400.49]
+let common1 = [135.26, 186.82, 78.40, 46.02, 354.47, 400.49,0.6]
 let common2 = [0.1463]
 // 单柱状图弹窗
 let common3 = [359.91, 400.49, 117.65, 148.96, 34.84, 17.79, 26.15, 26.18, 16.83, 0.00, 43.49, 0.00, 43.39, 76.53, 5.05, 8.59, 0.00, 0.28]

+ 103 - 43
investmentPort/js/investHomeGroup.js

@@ -2,6 +2,7 @@ let app = new Vue({
   el: '#app',
   data () {
     return {
+      env: 'prd',
       fling: false, //水球光泽
       centerOriginalConfig6: '',
       rightAdd: {},// 左边新增筛选参数
@@ -109,7 +110,6 @@ let app = new Vue({
   mounted () {
     this.getUrlParams()
     this.countYear()
-    this.comeIn()
   },
   methods: {
     // 获取地址栏参数
@@ -118,6 +118,7 @@ let app = new Vue({
       // 通过 ? 分割获取后面的参数字符串
       let urlStr = url.split('?')[1]
       if (!urlStr) {
+        this.comeIn()
         return
       }
       // 创建空对象存储参数
@@ -132,6 +133,8 @@ let app = new Vue({
       if (obj.model) {
         obj.model == 'A' || obj.model == 'a' ? this.mockData = false : this.mockData = true
       }
+      obj.env && (this.env = obj.env)
+      this.comeIn()
     },
     // 计算展示的年份
     countYear () {
@@ -231,42 +234,98 @@ let app = new Vue({
     // 获取token
     getAppToken () {
       // dev环境
-      // let value = {
-      //   "appId": "xilan1014",              //系统编码
-      //   "appSecret": "12345678910Aa@Bb@Cc",     //AccessToken加密认证密钥
-      //   "tenantid": "",              //租户id
-      //   "accountId": "",     //数据中心id
-      //   "language": "zh_CN"
-      // }
-      // SIT环境
-      let value = {
-        "appId": "68dp",
-        "appSecret": "9ErhY^O{n?@Pc#eb7HYX",
-        "tenantid": "",
-        // "accountId": "1635498801198269440",
-        "accountId": "1686324824621711360", // 新
-        "language": "zh_CN"
+      if (this.env == 'sit' || this.env == 'SIT') {
+        // SIT环境
+        let value = {
+          "appId": "68dp",
+          "appSecret": "9ErhY^O{n?@Pc#eb7HYX",
+          "tenantid": "",
+          // "accountId": "1635498801198269440",
+          "accountId": "1686324824621711360", // 新
+          "language": "zh_CN"
+        }
+        post('/ierp/api/getAppToken.do', value).then(res => {
+          this.app_token = res.data.app_token
+          this.getAccessToken()
+        })
+      } else if (this.env == 'uat' || this.env == 'UAT') {
+        // UAT环境
+        let value = {
+          "appId": "68dp",
+          "appSecret": "9ErhY^O{n?@Pc#eb7HYX",
+          "tenantid": "",
+          // "accountId": "1635498801198269440",
+          "accountId": "1591303792463183872", // 新
+          "language": "zh_CN"
+        }
+        post('/ierp/api/getAppToken.do', value).then(res => {
+          this.app_token = res.data.app_token
+          this.getAccessToken()
+        })
+      } else {
+        // prd环境
+        let value = {
+          "appId": "68dp",
+          "appSecret": "9ErhY^O{n?@Pc#eb7HYX",
+          "tenantid": "",
+          // "accountId": "1635498801198269440",
+          "accountId": "1591303792463183872", // 新
+          "language": "zh_CN"
+        }
+        post('/ierp/api/getAppToken.do', value).then(res => {
+          this.app_token = res.data.app_token
+          this.getAccessToken()
+        })
       }
-      post('/ierp/api/getAppToken.do', value).then(res => {
-        this.app_token = res.data.app_token
-        this.getAccessToken()
-      })
     },
     // 获取AccessToken
     getAccessToken () {
-      let value = {
-        // "user": "19900000001",                //登录用户手机号
-        "user": "15835113238",                // 新
-        "apptoken": this.app_token,  //应用令牌
-        "tenantid": "",                    //租户id
-        // "accountId": "1635498801198269440",//数据中心id
-        "accountId": "1686324824621711360",// 新
-        "usertype": "Mobile"
+      if (this.env == 'sit' || this.env == 'SIT') {
+        // SIT环境
+        let value = {
+          // "user": "19900000001",                //登录用户手机号
+          "user": "15835113238",                // 新
+          "apptoken": this.app_token,  //应用令牌
+          "tenantid": "",                    //租户id
+          // "accountId": "1635498801198269440",//数据中心id
+          "accountId": "1686324824621711360",// 新
+          "usertype": "Mobile"
+        }
+        post('/ierp/api/login.do', value).then(res => {
+          this.access_token = res.data.access_token
+          this.getOrg()
+        })
+      } else if (this.env == 'uat' || this.env == 'UAT') {
+        // UAT环境
+        let value = {
+          // "user": "19900000001",                //登录用户手机号
+          "user": "15835113238",                // 新
+          "apptoken": this.app_token,  //应用令牌
+          "tenantid": "",                    //租户id
+          // "accountId": "1635498801198269440",//数据中心id
+          "accountId": "1591303792463183872",// 新
+          "usertype": "Mobile"
+        }
+        post('/ierp/api/login.do', value).then(res => {
+          this.access_token = res.data.access_token
+          this.getOrg()
+        })
+      } else {
+        // PRD环境
+        let value = {
+          // "user": "19900000001",                //登录用户手机号
+          "user": "15835113238",                // 新
+          "apptoken": this.app_token,  //应用令牌
+          "tenantid": "",                    //租户id
+          // "accountId": "1635498801198269440",//数据中心id
+          "accountId": "1591303792463183872",// 新
+          "usertype": "Mobile"
+        }
+        post('/ierp/api/login.do', value).then(res => {
+          this.access_token = res.data.access_token
+          this.getOrg()
+        })
       }
-      post('/ierp/api/login.do', value).then(res => {
-        this.access_token = res.data.access_token
-        this.getOrg()
-      })
     },
     // 获取组织架构列表
     getOrg () {
@@ -312,7 +371,6 @@ let app = new Vue({
           pageSize: 1000
         }
         post('/ierp/kapi/v2/mdnb/mdnb_xmkb/mdnb_manager_preinvest/tqqyedfx', value).then(res => {
-          console.log(res.data.rows, '企业额度分析')
           if (res.data.rows.length > 0) {
             let dataList = res.data.rows[0].entryentity
             left3 = [[], [], []]
@@ -379,7 +437,6 @@ let app = new Vue({
           pageSize: 1000
         }
         post('/ierp/kapi/v2/mdnb/mdnb_xmkb/mdnb_manager_preinvest/tqcebjfx', value).then(res => {
-          console.log(res.data, '产业布局分析')
           if (res.data.rows.length > 0) {
             let dataList = this.classify(res.data.rows[0].mdnb_entryentity, 'mdnb_textfield1')
             // 传统产业分析
@@ -905,7 +962,6 @@ let app = new Vue({
           pageSize: 1000
         }
         post('/ierp/kapi/v2/mdnb/mdnb_xmkb/mdnb_manager_preinvest/yjct', value).then(res => {
-          console.log(res.data, '看看左边穿透')
           if (res.data.rows.length > 0) {
             if (typeNum == 2) {
               common4 = []
@@ -2145,7 +2201,7 @@ let app = new Vue({
           this.list[i].classList.remove('light')
         }
       }
-      this.chartCarousel.dispose()
+      this.chartCarousel ? this.chartCarousel.dispose() : ''
       this.initChartL9()
     },
     initChartBall () {
@@ -2155,7 +2211,7 @@ let app = new Vue({
           {
             type: "liquidFill",
             radius: "80%",
-            data: [left2[0], left2[0] + 0.02, left2[0] - 0.02],
+            data: [common2[0], common2[0] + 0.02, common2[0] - 0.02],
             amplitude: '4%',
             waveLength: '20%', //波浪长度
             // data: [
@@ -2877,7 +2933,7 @@ let app = new Vue({
           show: true,
           trigger: "axis",
           formatter: data => {
-            return `${data[0].name}<br /><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[0].color.colorStops[0].color}"></span> ${data[0].seriesName}:${that.numFormat(data[0].value)}亿<br/><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[1].color.colorStops[0].color}"></span> ${data[1].seriesName}:${that.numFormat(data[1].value + data[0].value)}亿`
+            return `${data[0].name}<br /><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[0].color.colorStops[0].color}"></span> ${data[0].seriesName}:${that.numFormat(data[0].value)}亿<br/><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[1].color.colorStops[0].color}"></span> ${data[1].seriesName}:${that.numFormat(data[1].value)}亿`
           },
           axisPointer: {
             // 坐标轴指示器,坐标轴触发有效
@@ -2956,12 +3012,13 @@ let app = new Vue({
             name: "已用额度",
             type: "bar",
             data: left3[0],
-            stack: 'Ad',
+            // stack: 'Ad',
             showBackground: false,
             backgroundStyle: {
               color: "#18416F",
             },
-            barWidth: "20",
+
+            barWidth: "15",
             itemStyle: {
               // barBorderRadius: [10, 10, 0, 0],
               color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
@@ -2976,17 +3033,19 @@ let app = new Vue({
                 },
               ]),
             },
+            zlevel: 1
           },
           {
             name: "总额度",
             type: "bar",
-            data: left3[1],
-            stack: 'Ad',
+            data: left3[2],
+            // stack: 'Ad',
+            barGap: '-130%',
             showBackground: false,
             backgroundStyle: {
               color: "#18416F",
             },
-            barWidth: "20",
+            barWidth: "25",
             itemStyle: {
               // barBorderRadius: [10, 10, 0, 0],
               color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
@@ -3038,6 +3097,7 @@ let app = new Vue({
           common1[5] = findData.mdnb_amountfield25
           common2[0] = findData.mdnb_decimalfield6
         }
+        console.log(common2[0], '看看百分比')
         setTimeout(() => {
           that.initChartBall()
         });

+ 24 - 2
investmentPort/js/request.js

@@ -2,11 +2,15 @@
 /** axios封装
  * 请求拦截、相应拦截、错误统一处理
  */
+let env = 'prd'
+getUrlParams()
 const httpRequest = axios.create({
   // baseURL: 'http://192.168.2.155:8080', // 李瑞投前
   // baseURL: 'http://192.168.2.111:8080', // 苏文投后
   // baseURL: 'http://192.168.2.147:8080', // 旭东中间大屏
-  baseURL: 'http://172.21.3.68:8081', // SIT
+  baseURL: (env == 'SIT' || env == 'sit') ? 'http://172.21.3.68:8081' : (env == 'UAT' || env == 'uat') ? 'http://172.21.3.149:8081' : 'http://172.21.3.149:8081',
+  // baseURL: 'http://172.21.3.68:8081', // SIT
+  // baseURL: 'http://172.21.3.149:8081', // UAT
   timeout: 3 * 60 * 1000, // 3分钟等待
   withCredentials: true, // 携带cookie
 })
@@ -40,7 +44,25 @@ httpRequest.interceptors.request.use(
     return Promise.reject(error)
   }
 )
-
+// 获取地址栏参数
+function getUrlParams () {
+  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];
+  }
+  obj.env && (env = obj.env)
+}
 //响应拦截
 httpRequest.interceptors.response.use(
   function (response) {