fengxu hace 1 año
padre
commit
d713a9d3c2
Se han modificado 3 ficheros con 243 adiciones y 25 borrados
  1. 1 2
      cokingCoal/js/humanResources.js
  2. 239 21
      cokingCoal/js/newIndex.js
  3. 3 2
      cokingCoal/js/request.js

+ 1 - 2
cokingCoal/js/humanResources.js

@@ -411,7 +411,6 @@ let app = new Vue({
     beforeCreate() {
         // 跳转地址
         let AddUrl = location.protocol + "//" + location.host + "/ierp"
-        return
         if (!window.location.search) {
             // alert("链接已失效,请重新打开")
             window.location.href = AddUrl
@@ -425,7 +424,7 @@ let app = new Vue({
         let newDate = new Date().getTime()
         let authorityType = window.sessionStorage.getItem("authorityType") || false
         if (!authorityType) {
-            if (newDate - dataList[1] > 30000) {
+            if (newDate - parseInt(dataList[1]) < 30000) {
                 // alert("链接已失效,请重新打开")
                 window.location.href = AddUrl
             }

+ 239 - 21
cokingCoal/js/newIndex.js

@@ -156,7 +156,7 @@ let app = new Vue({
             configMark: {
                 waitTime: 2000,
                 // header: ["单位名称", "人员数量", "月份", "预警项"],
-                header: ["单位名称", "月份",  "人员数量", "预警项"],
+                header: ["单位名称", "月份", "人员数量", "预警项"],
                 rowNum: 6,
                 data: [
                     ["<span class='red'>西山煤电</span>", "<span class='red'>71</span>", "<span class='red'>7月</span>", "<span class='red'>薪资低于4000元</span>"],
@@ -511,27 +511,33 @@ let app = new Vue({
     },
     beforeCreate() {
         // 跳转地址
-        let AddUrl = location.protocol + "//" + location.host + "/ierp"
-        return
-        if (!window.location.search) {
-            // alert("链接已失效,请重新打开")
-            window.location.href = AddUrl
-        }
-        let arr = window.location.search.split("&")
-        let dataList = []
-        arr.forEach(item => {
-            dataList.push(item.split("=")[1])
-        })
-        window.user = dataList[0]
-        let newDate = new Date().getTime()
-        let authorityType = window.sessionStorage.getItem("authorityType") || false
-        if (!authorityType) {
-            if (newDate - dataList[1] > 30000) {
+        setTimeout(() => {
+            let AddUrl = location.protocol + "//" + location.host + "/ierp"
+            // return
+            if (!window.location.search) {
                 // alert("链接已失效,请重新打开")
                 window.location.href = AddUrl
             }
-            window.sessionStorage.setItem("authorityType", true)
-        }
+            console.log(window.location);
+            let arr = window.location.search.split("&")
+            let dataList = []
+            arr.forEach(item => {
+                dataList.push(item.split("=")[1])
+            })
+            window.user = dataList[0]
+            let newDate = new Date().getTime()
+            let authorityType = window.sessionStorage.getItem("authorityType") || false
+            console.log(authorityType);
+            if (!authorityType) {
+                if (newDate - parseInt(dataList[1]) < 30000) {
+                    // alert("链接已失效,请重新打开")
+                    console.log(newDate - parseInt(dataList[1]) < 30000);
+                    window.location.href = AddUrl
+                }
+                window.sessionStorage.setItem("authorityType", true)
+            }
+        })
+
     },
     beforeDestroy() {
         window.sessionStorage.removeItem("authorityType")
@@ -931,7 +937,7 @@ let app = new Vue({
                 that.initLineElseEchartsR(echarts90, { x: that.sx[0], y: that.sy[0] })
 
                 let leftEnd = that.$refs.leftEnd
-                that.initBarEchartsElse(leftEnd, leftEndList, ["累计月平均工资", "同期累计月平均工资"])
+                that.initBarEchartsElseJM(leftEnd, leftEndList, ["累计月平均工资", "同期累计月平均工资"])
 
                 let el = this.$refs.container
                 // this.initProvinceChart(el)
@@ -3791,6 +3797,210 @@ let app = new Vue({
                 chart.resize();
             });
         },
+        initBarEchartsElseJM(el, data, nameList) {
+            let chart = echarts.init(el);
+            var scale = 2;
+            var singleData = data.y1;
+            var multipleData = data.y2;
+            var color = "#fff";
+            option = {
+                textStyle: {
+                    fontSize: 30,
+                    color: '#A3E2F4'
+                },
+                tooltip: {
+                    show: true,
+                    backgroundColor: 'rgba(0, 0, 0, 0.5)',
+                    borderColor: "rgba(0,0,0,0.5)",
+                    trigger: 'axis',
+                    textStyle: {
+                        fontSize: 30,
+                        color: '#A3E2F4'
+                    },
+                    axisPointer: { // 坐标轴指示器,坐标轴触发有效
+                        type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
+                    },
+                    formatter: '{b}<br />{a0}: ****<br />{a1}: ****',
+                },
+                legend: {
+                    data: nameList,
+                    align: 'left',
+                    // itemGap: 50,
+                    // x: 'right',
+                    right: '1%',
+                    y: '1%',
+                    // icon: 'rect',
+                    textStyle: {
+                        color: "#fff",
+                        fontSize: 30
+                    }
+                },
+                grid: {
+                    top: "10%",
+                    left: '6%',
+                    right: '4%',
+                    bottom: '20%',
+                },
+                xAxis: [{
+                    type: 'category',
+                    data: data.x,
+                    axisLabel: {
+                        // inside: true,
+                        // rotate: 30,
+                        interval: 0,
+                        padding: [15, 0, 0, 0],
+                        textStyle: {
+                            color: "#fff",
+                            fontSize: 30,
+                        },
+                        formatter: function (value) {
+                            // 将文字进行换行
+                            let list = value.split("")
+                            if (list.length == 5) {
+                                list[3] = ""
+                            }
+                            if (list.length > 4) {
+                                list[4] = ""
+                            }
+                            return list[0] + list[1] + "\n" + list[2] + list[3];
+                        }
+                    },
+                    axisTick: {
+                        show: false,
+                        inside: true,
+                        length: 8 * scale,
+                        lineStyle: {
+                            color: color,
+                        }
+                    },
+                    axisLine: {
+                        show: false,
+                        lineStyle: {
+                            color: color,
+                        }
+                    },
+                    splitLine: {
+                        show: false,
+                        lineStyle: {
+                            color: 'rgba(80,224,255,0.3)',
+                            type: 'dashed'
+                        }
+                    }
+                }],
+                yAxis: [{
+                    type: 'value',
+                    axisLabel: {
+                        // inside: true,
+                        padding: [0, 15, 0, 0],
+                        textStyle: {
+                            color: color,
+                            fontSize: 28,
+                        }
+                    },
+                    axisTick: {
+                        show: false,
+                        lineStyle: {
+                            color: color,
+                        }
+                    },
+                    axisLine: {
+                        show: false,
+                        lineStyle: {
+                            color: color,
+                        }
+                    },
+                    splitLine: {
+                        show: false,
+                        lineStyle: {
+                            color: '#fff',
+                            type: 'dashed'
+                        },
+                        show: false,
+                    },
+                    nameTextStyle: {
+                        color: "#fff",
+                        fontSize: 16 * scale,
+                        padding: [0, 0, 10, 0]
+                    }
+                }],
+                series: [{
+                    name: nameList[0],
+                    type: 'bar',
+                    itemStyle: {
+                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+                            offset: 1,
+                            color: "#02355C",
+                        }, //柱图渐变色
+                        {
+                            offset: 0,
+                            color: "#45DAD1",
+                        },
+                        ], false),
+                    },
+                    barWidth: 20,
+                    label: {
+                        show: false,
+                        position: "top",
+                        align: "center",
+                    },
+                    data: singleData
+                },
+                {
+                    name: nameList[1],
+                    type: 'line',
+                    symbolSize: 20,
+                    itemStyle: {
+                        color: '#40A9FF',
+                    },
+                    smooth: false,
+                    showSymbol: true, // 节点长显
+                    barWidth: 20,
+
+                    data: multipleData
+                },
+
+                    // {
+                    //     name: nameList[1],
+                    //     type: 'line',
+                    //     barWidth: '15%',
+                    //     barGap: '40%',
+                    //     label: {
+                    //         show: false,
+                    //         position: "top",
+                    //         align: "center",
+                    //     },
+                    //     itemStyle: {
+                    //             color: '#ffc72b',
+                    //     },
+                    //     data: multipleData
+                    // }, 
+                    // {
+                    //     name: nameList[1],
+                    //     type: 'bar',
+                    //     barWidth: '15%',
+                    //     barGap: '40%',
+
+                    //     itemStyle: {
+                    //             color: 'rgba(94,218,255,0.4)',
+                    //     },
+                    //     label: {
+                    //         show: false,
+                    //         position: "top",
+                    //         align: "center",
+                    //     },
+                    //     data: multipleData
+                    // },
+                ]
+            };
+            chart.setOption(option);
+            tools.loopShowTooltip(chart, option, {
+                nterval: 2000,
+                loopSeries: true,
+            });
+            window.addEventListener("resize", function () {
+                chart.resize();
+            });
+        },
         initStereoscopic(el, data) {
             this.stereoscopic = echarts.init(el);
             option = {
@@ -6535,8 +6745,16 @@ let app = new Vue({
                         y1,
                         y2,
                     }
+
+                    if (res.mdnb_encryption) {
+                        that.initBarEchartsElse(leftEnd, leftEndList, ["累计月平均工资", "同期累计月平均工资"])
+
+                    } else {
+                        that.initBarEchartsElseJM(leftEnd, leftEndList, ["累计月平均工资", "同期累计月平均工资"])
+
+                    }
+
                 }
-                that.initBarEchartsElse(leftEnd, leftEndList, ["累计月平均工资", "同期累计月平均工资"])
 
 
             })

+ 3 - 2
cokingCoal/js/request.js

@@ -13,7 +13,7 @@ function isLocalEnv() {
 }
 
 
-window.apiType = "sit"  // dev 本地测试 ,  sit  线上测试  uat  客户测试环境 prod  正式环境
+window.apiType = "prod"  // dev 本地测试 ,  sit  线上测试  uat  客户测试环境 prod  正式环境
 // if(window.location.search){
 //   apiType = window.location.search.split("=")[1]
 // }
@@ -272,7 +272,8 @@ function getLocalEnvAccessToken() {
         apptoken: localStorage.getItem("app_token"),
         // appSecuret: "Cs?9HeKqacN%gnu3",
         tenantid: "jmuatierp",
-        user: "18335173447",
+        // user: "18335173447",
+        user: window.user,
         usertype: "Mobile",
         accountId: "1609428936914108416",
       }