浏览代码

焦煤大屏接口对接

fengxu 2 年之前
父节点
当前提交
2b81684607
共有 4 个文件被更改,包括 437 次插入86 次删除
  1. 10 5
      cokingCoal/index.html
  2. 411 80
      cokingCoal/js/newIndex.js
  3. 1 1
      cokingCoal/js/request.js
  4. 15 0
      cokingCoal/styles/newIndex.css

+ 10 - 5
cokingCoal/index.html

@@ -502,8 +502,8 @@
                                             </div>
                                             <div class="title flex_sb">
                                                 <div>工资总额均衡预算使用</div>
-                                                <div class="tit_icon" style="height: 45px;">
-                                                    <span>6月</span>
+                                                <div class="tit_icon" style="height: 45px;" @click="handleSelect('total')">
+                                                    <span>{{ selectInfo.total }}月</span>
                                                     <img style="margin-left:10px" src="./images/down.png" alt="">
                                                 </div>
                                             </div>
@@ -553,8 +553,8 @@
                                         </div>
                                         <div class="title_else_sb flex_sb">
                                             <div class="tit_text">平均工资</div>
-                                            <div class="tit_icon">
-                                                <span>6月</span>
+                                            <div class="tit_icon" @click="handleSelect('average')">
+                                                <span>{{ selectInfo.average }}月</span>
                                                 <img style="margin-left:10px" src="./images/down.png" alt="">
                                             </div>
                                         </div>
@@ -659,7 +659,7 @@
                                         </div>
                                     </div>
                                     <div class="right_item_main flex_center" style="height: calc(100% - 100px);flex-wrap: wrap;">
-                                        <div class="item-tl-item" v-for="(item,key) in skillList" :key="key" @click="handleStudio(item)">
+                                        <div class="item-tl-item" v-for="(item,key) in skillList" :key="key" @click="handleStudio(item,key)">
                                             <div class="item_title">{{ item.name }}</div>
                                             <div class="item_main">
                                                 <div class="item_main_top">
@@ -972,6 +972,11 @@
                 </div>
 
             </div>
+
+            <div class="mark_select" :style="markStyle" v-if="selectFlag">
+                <div class="select_option" v-for="(item,index) in monthList" :key="index" @click="selectOption(item)">{{ item }}月</div>
+            </div>
+
         </div>
         <div class="icon_box" @click="handleMore()">
             <img src="./images/blue.png" alt="">

+ 411 - 80
cokingCoal/js/newIndex.js

@@ -152,7 +152,7 @@ let app = new Vue({
             },
             configMark: {
                 waitTime: 2000,
-                header: ["单位名称", "人员数量", "月份", "预警项", ""],
+                header: ["单位名称", "月份", "人员数量", "预警项", ""],
                 rowNum: 6,
                 data: [
                     ["<span class='red'>西山煤电</span>", "<span class='red'>71</span>", "<span class='red'>3月</span>", "<span class='red'>薪资低于4000元</span>"],
@@ -455,7 +455,20 @@ let app = new Vue({
             staffList: {
                 coal: 97395,
                 noCoal: 81766
-            }
+            },
+            selectFlag: false,
+            selectInfo: {
+                total: "06",
+                average: "06"
+
+            },
+            selectType: "total",
+            markStyle: {
+                position: "absolute",
+                top: "13%",
+                right: "21%",
+            },
+            newSkillList: []
         }
     },
     beforeCreate() {
@@ -494,31 +507,25 @@ let app = new Vue({
             this.keyDown()
             // document.documentElement.webitRequestFullScreen()
 
-            this.sx = spArr(salaryList.x, 6)
-            this.sy = spArr(salaryList.y, 6)
 
 
 
 
-            this.seniorityListX = spArr(this.echartsTwoBar2.x, 4)
-            this.seniorityListY = spArr(this.echartsTwoBar2.y, 4)
-            this.ageListX = spArr(this.echartsTwoBar1.x, 4)
-            this.ageListY = spArr(this.echartsTwoBar1.y, 4)
+
+
+
 
             // let organization = this.$refs.organization
             // this.initOrganization(organization, "", this.organizationList)
 
 
 
-            let serviceAge = this.$refs.serviceAge
-            this.initLineEcharts(serviceAge, { x: this.ageListX[this.saTimeIndex], y: this.ageListY[this.saTimeIndex] })
 
 
 
-            let leftEnd = this.$refs.leftEnd
-            this.initBarEchartsElse(leftEnd, leftEndList, ["累计平均工资", "同期累计平均工资"])
-            let echarts90 = this.$refs.echarts90
-            this.initLineElseEchartsR(echarts90, { x: this.sx[0], y: this.sy[0] })
+
+
+
 
 
 
@@ -539,7 +546,6 @@ let app = new Vue({
 
             // this.timeNt()
             // this.studentTime()
-            this.SAtimeFun()
             // setInterval(()=>{
             //   this.workEcharts.dispose()
             //   let works = this.$refs.works
@@ -577,37 +583,47 @@ let app = new Vue({
 
             }, 9000)
         })
-        let that = this;
-        localEnvAppToken().then(res => {
-            localStorage.setItem("app_token", res.app_token)
-            getLocalEnvAccessToken().then(res => {
-                localStorage.setItem("access_token", res.access_token)
-                this.getAccumulatedLogin()
-                this.getMauInfo()
-                this.getDistributionInfo()
-                this.getOrganizationChange()
-                this.getIndustrydistribution()
-                this.getHumanResources()
-                this.getSalaryCalProg()
-                this.getCollegeinternAndEnterpriseship()
-                this.getTurnOver()
-                this.getOptimizeResources()
-                this.getHumanOrgAllResources()
-                this.getMapData()
-                this.getPersonnelResource()
-                this.getEduStructure()
-                this.getSkillLevel()
-                this.getRankLevel()
-                this.getGrassRoots()
-                this.getEmploysNums()
-                this.getPositionSequence()
-
-                this.getDownholeoperationTrue()
-                this.getDownholeoperationFlase()
 
 
-            })
-        }).catch(err => {
+
+        this.requestFunction()
+        // this.noRequestFunction()
+
+
+        setInterval(() => {
+            this.getAccumulatedLogin()
+            this.getMauInfo()
+            console.log("数据更新每五分钟一次");
+        }, 60000 * 5)
+
+    },
+
+    methods: {
+        // 监听键盘
+        keyDown() {
+            let that = this;
+            document.onkeydown = (e) => {
+                //事件对象兼容
+                if (this.imageFlag) {
+                    let e1 = e || event || window.event || arguments.callee.caller.arguments[0]
+                    //键盘按键判断:左箭头-37;上箭头-38;右箭头-39;下箭头-40
+                    //左
+                    if (e1 && e1.keyCode == 37) {
+                        if (that.imageIndex != 0) {
+                            that.imageIndex = that.imageIndex - 1
+                        }
+                        // 按下左箭头
+                    } else if (e1 && e1.keyCode == 39) {
+                        // 按下右箭头
+                        that.imageIndex = that.imageIndex + 1
+                    }
+                }
+
+            }
+        },
+
+        noRequestFunction() {
+            let that = this;
             let industry = that.$refs.industry
             that.initOrganizationElse(industry, "", that.industry, "")
 
@@ -652,43 +668,163 @@ let app = new Vue({
             let echartTwo = this.$refs.echartTwo
             this.initTwoBarEcharts(echartTwo, { x: that.nx1[0], y: that.ny1[0] })
 
-        })
+            this.ageListX = spArr(this.echartsTwoBar1.x, 4)
+            this.ageListY = spArr(this.echartsTwoBar1.y, 4)
+            this.seniorityListX = spArr(this.echartsTwoBar2.x, 4)
+            this.seniorityListY = spArr(this.echartsTwoBar2.y, 4)
+            let serviceAge = this.$refs.serviceAge
+            this.initLineEcharts(serviceAge, { x: this.ageListX[this.saTimeIndex], y: this.ageListY[this.saTimeIndex] })
+            this.SAtimeFun()
 
+            let echarts90 = that.$refs.echarts90
+            that.sx = spArr(salaryList.x, 6)
+            that.sy = spArr(salaryList.y, 6)
 
+            that.initLineElseEchartsR(echarts90, { x: that.sx[0], y: that.sy[0] })
 
+            let leftEnd = that.$refs.leftEnd
+            that.initBarEchartsElse(leftEnd, leftEndList, ["累计平均工资", "同期累计平均工资"])
+        },
 
-        setInterval(() => {
-            this.getAccumulatedLogin()
-            this.getMauInfo()
-            console.log("数据更新每五分钟一次");
-        }, 60000 * 5)
+        requestFunction() {
+            let that = this;
+            localEnvAppToken().then(res => {
+                localStorage.setItem("app_token", res.app_token)
+                getLocalEnvAccessToken().then(res => {
+                    localStorage.setItem("access_token", res.access_token)
+                    this.getAccumulatedLogin()
+                    this.getMauInfo()
+                    this.getDistributionInfo()
+                    this.getOrganizationChange()
+                    this.getIndustrydistribution()
+                    this.getHumanResources()
+                    this.getSalaryCalProg()
+                    this.getCollegeinternAndEnterpriseship()
+                    this.getTurnOver()
+                    this.getOptimizeResources()
+                    this.getHumanOrgAllResources()
+                    this.getMapData()
+                    this.getPersonnelResource()
+                    this.getEduStructure()
+                    this.getSkillLevel()
+                    this.getRankLevel()
+                    this.getGrassRoots()
+                    this.getEmploysNums()
+                    this.getPositionSequence()
+
+                    this.getDownholeoperationTrue()
+                    this.getDownholeoperationFlase()
+
+                    // 员工年龄
+                    this.getStaffAge()
+
+                    this.getCalSalary()
+                    // 均衡工资
+                    this.getCalSalary1()
+                    // 薪酬预警
+                    this.getCalSalary2()
+
+                    this.getCollegestudy()
+
+                    // 技能大师
+                    this.getCmasterstudio(1)
+                    this.getCmasterstudio(2)
+                    this.getCmasterstudio(3)
+                    this.getCmasterstudio(4)
+                    this.getCmasterstudio(5)
 
-    },
 
-    methods: {
-        // 监听键盘
-        keyDown() {
-            let that = this;
-            document.onkeydown = (e) => {
-                //事件对象兼容
-                if (this.imageFlag) {
-                    let e1 = e || event || window.event || arguments.callee.caller.arguments[0]
-                    //键盘按键判断:左箭头-37;上箭头-38;右箭头-39;下箭头-40
-                    //左
-                    if (e1 && e1.keyCode == 37) {
-                        if (that.imageIndex != 0) {
-                            that.imageIndex = that.imageIndex - 1
-                        }
-                        // 按下左箭头
-                    } else if (e1 && e1.keyCode == 39) {
-                        // 按下右箭头
-                        that.imageIndex = that.imageIndex + 1
-                    }
-                }
 
-            }
+                })
+            }).catch(err => {
+                let industry = that.$refs.industry
+                that.initOrganizationElse(industry, "", that.industry, "")
+
+                let student = this.$refs.student
+                this.initEchartsBar(student, schoolList, "#07ecd9")
+
+                this.fx = spArr(mobilizeList.x, 6)
+                this.fy1 = spArr(mobilizeList.y1, 6)
+                this.fy2 = spArr(mobilizeList.y2, 6)
+                this.fy3 = spArr(mobilizeList.y3, 6)
+                this.fy4 = spArr(mobilizeList.y4, 6)
+                this.fy5 = spArr(mobilizeList.y5, 6)
+
+                let mobilize = this.$refs.mobilize
+                this.initEchartStack(mobilize, { x: this.fx[0], y1: this.fy1[0], y2: this.fy2[0], y3: this.fy3[0], y4: this.fy4[0], y5: this.fy5[0] })
+                this.timeSy()
+                let buffer = that.$refs.buffer
+                this.initStereoscopic(buffer, userList)
+                this.initChartsBig()
+
+                let level = this.$refs.level
+                let sum = 0
+                levelList.y.forEach(item => {
+                    sum = sum + item
+                })
+                that.levelListX = spArr(levelList.x, 5)
+                that.levelListY = spArr(levelList.y, 5)
+                that.initLineElseEcharts(level, { x: that.levelListX[0], y: that.levelListY[0] }, sum)
+
+                let initChartR1 = this.$refs.initChartR1
+                this.initChartR1(initChartR1)
+
+                let efficiency = this.$refs.efficiency
+                this.initDownholeEcharts(efficiency, { x: downhole.x, y: [downhole.y[0], downhole.y[1]] }, 1)
+                this.downholeTimes()
+
+                let sequence = this.$refs.sequence
+                this.initBarEcharts(sequence, { x: ["管理序列", "技术序列", "操作序列"], y1: [34242, 18547, 134012], y2: [20, 30, 50] }, ["当前数"])
+
+                this.nx1 = spArr(this.echartTwoList.x, 5)
+                this.ny1 = spArr(this.echartTwoList.y, 5)
+                let echartTwo = this.$refs.echartTwo
+                this.initTwoBarEcharts(echartTwo, { x: that.nx1[0], y: that.ny1[0] })
+
+                this.ageListX = spArr(this.echartsTwoBar1.x, 4)
+                this.ageListY = spArr(this.echartsTwoBar1.y, 4)
+                this.seniorityListX = spArr(this.echartsTwoBar2.x, 4)
+                this.seniorityListY = spArr(this.echartsTwoBar2.y, 4)
+                let serviceAge = this.$refs.serviceAge
+                this.initLineEcharts(serviceAge, { x: this.ageListX[this.saTimeIndex], y: this.ageListY[this.saTimeIndex] })
+                this.SAtimeFun()
+
+                let echarts90 = that.$refs.echarts90
+                that.sx = spArr(salaryList.x, 6)
+                that.sy = spArr(salaryList.y, 6)
+
+                that.initLineElseEchartsR(echarts90, { x: that.sx[0], y: that.sy[0] })
+
+                let leftEnd = that.$refs.leftEnd
+                that.initBarEchartsElse(leftEnd, leftEndList, ["累计平均工资", "同期累计平均工资"])
+
+
+            })
         },
 
+        handleSelect(flag = 'total') {
+            if (flag == 'total') {
+                this.markStyle = {
+                    position: "absolute",
+                    top: "13%",
+                    right: "21%",
+                }
+            } else if (flag == 'average') {
+                this.markStyle = {
+                    position: "absolute",
+                    top: "25.5%",
+                    right: "1.5%",
+                }
+            }
+            this.handleMark()
+            this.isShowMark = true;
+            this.selectFlag = true;
+            this.selectType = flag
+        },
+        selectOption(item) {
+            console.log(item);
+            this.selectInfo[this.selectType] = item
+        },
         SAtimeFun() {
             let that = this;
             this.SAtime = setInterval(() => {
@@ -1820,7 +1956,7 @@ let app = new Vue({
                         },
                         symbol: 'circle',
                         symbolSize: 0,
-                        symbolOffset: [0, -330],
+                        symbolOffset: [0, -370],
                         data: effectScatterData,
                         // data: series[1].data,
                     },
@@ -1863,7 +1999,7 @@ let app = new Vue({
                         },
                         symbol: img2,
                         symbolSize: [250, 160],
-                        symbolOffset: [0, -165],
+                        symbolOffset: [0, -200],
                         z: 999,
                         data: mapDate,
                     },
@@ -1946,8 +2082,8 @@ let app = new Vue({
                         symbol: function (value, params) {
                             return params.data.img;
                         },
-                        symbolSize: [64, 82],
-                        symbolOffset: [0, -50],
+                        symbolSize: [96, 123],
+                        symbolOffset: [0, -75],
                         z: 9999,
                         data: mapDate,
                     },
@@ -4942,7 +5078,13 @@ let app = new Vue({
             // });
         },
         handleWarning() {
-            this.getSalaryCalProgDetail()
+            this.isShowMark = false
+
+            this.isShowMark = true
+            this.salaryFlag = true
+            this.pdfFlag = false
+            this.mobilizeFlag = false
+            this.echartsMark = false
 
         },
         handleMark() {
@@ -4958,12 +5100,19 @@ let app = new Vue({
             this.honorIndex = 0
             this.achievementIndex = 0
         },
-        handleStudio(item) {
+        handleStudio(item, index) {
             let that = this;
             this.handleMark()
             this.studioTitle = item.name + "技能大师工作室"
             this.isShowMark = true
             this.studioMark = true
+            studioInformation.data = this.newSkillList[index][0]
+            leaderInformation.data = this.newSkillList[index][2]
+            achievementList = this.newSkillList[index][1]
+            honorList = this.newSkillList[index][3]
+            if (this.newSkillList[index][0].length < 4) {
+
+            }
             setTimeout(() => {
                 this.listFlag = false
             }, 5000)
@@ -4976,6 +5125,8 @@ let app = new Vue({
             this.warningFlag = true
             this.mobilizeFlag = false
             this.echartsMark = false
+            this.getSalaryCalProgDetail()
+            // console.log(12312312);
         },
         handleORG() {
             this.isShowMark = true
@@ -5627,7 +5778,6 @@ let app = new Vue({
             let data = {}
             let initChartR1 = this.$refs.initChartR1
             fetchPostMethods("/ierp/kapi/v2/mdnb/mdnb_control/RankLevel", data).then(res => {
-                console.log(res);
                 if (res) {
                     let nameList = []
                     let valueList = []
@@ -5803,7 +5953,188 @@ let app = new Vue({
                 that.ny2 = spArr(that.echartTwoList2.y, 5)
             })
         },
-        
+        getStaffAge() {
+            let that = this;
+            let data = {};
+            fetchPostMethods("/ierp/kapi/v2/mdnb/mdnb_control/StaffAge", data).then(res => {
+                if (res) {
+                    let dataObj = {
+                        x: [],
+                        y: []
+                    }
+                    res.data.forEach(item => {
+                        dataObj.x.push(item.key)
+                        dataObj.y.push(item.value)
+                    })
+                    that.echartsTwoBar1 = JSON.parse(JSON.stringify(dataObj))
+                }
+
+                that.ageListX = spArr(that.echartsTwoBar1.x, 4)
+                that.ageListY = spArr(that.echartsTwoBar1.y, 4)
+
+                let serviceAge = that.$refs.serviceAge
+                that.initLineEcharts(serviceAge, { x: that.ageListX[that.saTimeIndex], y: that.ageListY[that.saTimeIndex] })
+                that.SAtimeFun()
+                that.getStaffSeniority()
+            })
+        },
+        getStaffSeniority() {
+            let that = this;
+            let data = {};
+            fetchPostMethods("/ierp/kapi/v2/mdnb/mdnb_control/StaffSeniority", data).then(res => {
+                if (res) {
+                    let obj = {
+                        x: [],
+                        y: []
+                    }
+                    res.data.forEach(item => {
+                        obj.x.push(item.key)
+                        obj.y.push(item.value)
+                    })
+                    that.echartsTwoBar2 = JSON.parse(JSON.stringify(obj))
+                }
+            })
+            that.seniorityListX = spArr(that.echartsTwoBar2.x, 4)
+            that.seniorityListY = spArr(that.echartsTwoBar2.y, 4)
+        },
+        getCalSalary() {
+            let that = this;
+            let data = {
+                flag: true,
+                month: parseInt(that.selectInfo.average)
+            };
+            let leftEnd = that.$refs.leftEnd
+            fetchPostMethods("/ierp/kapi/v2/mdnb/mdnb_control/getCalSalary", data).then(res => {
+                if (res) {
+                    leftEndList = res.data
+                }
+                that.initBarEchartsElse(leftEnd, leftEndList, ["累计平均工资", "同期累计平均工资"])
+
+            })
+        },
+        getCalSalary1() {
+            let that = this;
+            let data = {
+                flag: true,
+                month: parseInt(that.selectInfo.total)
+            }
+            let echarts90 = that.$refs.echarts90
+            fetchPostMethods("/ierp/kapi/v2/mdnb/mdnb_control/getCalSalary1", data).then(res => {
+                if (res) {
+                    salaryList = res.data
+                }
+                that.sx = spArr(salaryList.x, 6)
+                that.sy = spArr(salaryList.y, 6)
+
+                that.initLineElseEchartsR(echarts90, { x: that.sx[0], y: that.sy[0] })
+
+            })
+        },
+        getCalSalary2() {
+            let that = this;
+            let data = {
+                flag: true
+            }
+            fetchPostMethods("/ierp/kapi/v2/mdnb/mdnb_control/getCalSalary2", data).then(res => {
+                if (res) {
+                    that.configMark.data = res
+                }
+            })
+        },
+        addArray(arr) {
+            let newArr = [...arr]
+            if (newArr.length <= 5) {
+                newArr.push(...arr)
+                this.addArray(newArr)
+            } else {
+                return newArr
+            }
+        },
+        addArray(arr, newArr = []) {
+            newArr = newArr.concat(arr);  // 将原数组添加到新数组中
+            if (newArr.length <= 4) {
+                return this.addArray(arr, newArr);  // 递归调用方法
+            } else {
+                return newArr;
+            }
+        },
+        getCmasterstudio(level) {
+            let that = this;
+            let data = {
+                level
+            }
+            fetchPostMethods("/ierp/kapi/v2/mdnb/mdnb_control/Cmasterstudio", data).then(res => {
+                if (res) {
+                    let skillObj = []
+                    let list1 = []
+                    let list2 = []
+                    let list3 = []
+                    let list4 = []
+                    res.data.forEach(item => {
+                        if (item.key == "工作室总数") {
+                            skillList[level - 1].blue = item.value
+                        }
+                        if (item.key == "工作室成员人数") {
+                            skillList[level - 1].green = item.value
+                        }
+                        if (item.key == "工作室名称") {
+                            skillObj[0] = that.addArray(item.value)
+
+                        }
+                        if (item.key == "工作室所在单位") {
+                            skillObj[1] = that.addArray(item.value)
+                        }
+                        if (item.key == "颁发单位及时间") {
+                            skillObj[2] = that.addArray(item.value)
+                        }
+                        if (item.key == "成员人数") {
+                            skillObj[3] = that.addArray(item.value)
+                        }
+                        if (item.key == "平均年龄") {
+                            skillObj[4] = that.addArray(item.value)
+                        }
+                        if (item.key == "主要成果") {
+                            skillObj[5] = that.addArray(item.value)
+                        }
+                        if (item.key == "出生年月") {
+                            skillObj[6] = that.addArray(item.value)
+                        }
+                        if (item.key == "从事事业") {
+                            skillObj[7] = that.addArray(item.value)
+                        }
+                        if (item.key == "职业技能等级") {
+                            skillObj[8] = that.addArray(item.value)
+                        }
+                        if (item.key == "担任职务") {
+                            skillObj[9] = that.addArray(item.value)
+                        }
+                        if (item.key == "曾获荣誉") {
+                            skillObj[10] = that.addArray(item.value)
+                        }
+                    })
+                    skillObj.forEach((item, index) => {
+                        if (index == 0) {
+                            item.forEach((i, z) => {
+                                list1.push([i, skillObj[1][z], skillObj[2][z], skillObj[3][z], skillObj[4][z]])
+                                list3.push([skillObj[6][z], skillObj[7][z], skillObj[8][z], skillObj[9][z]])
+                            })
+                        }
+
+                        if (index == 5) {
+                            list2 = item
+                        }
+                        if (index == skillObj.length - 1) {
+                            list4 = item
+                        }
+                    })
+                    that.newSkillList[level - 1] = [list1, list2, list3, list4]
+                }
+            })
+
+
+
+        }
+
     },
 
 })

+ 1 - 1
cokingCoal/js/request.js

@@ -14,7 +14,7 @@ function isLocalEnv() {
 
 
 
-window.apiType = "dev"  // dev 本地测试 ,  sit  线上测试  
+window.apiType = "sit"  // dev 本地测试 ,  sit  线上测试  
 window.fetchUrl = ""
 // window.fetchUrl = "http://172.21.9.236:8081"
 

+ 15 - 0
cokingCoal/styles/newIndex.css

@@ -1475,4 +1475,19 @@ polyline {
     background-color: #302e2d50;
     letter-spacing: 9px;
     line-height: 1.5;
+}
+.mark_select{
+    width: 200px;
+    padding: 10px 20px;
+    box-sizing: border-box;
+    background-color: #302e2d50;
+
+}
+.select_option{
+    width: 100%;
+    height: 50px;
+    line-height: 50px;
+    text-align: center;
+    font-size: 35px;
+    margin: 10px 0;
 }