ソースを参照

根据接口调整前端算法

fengxu 2 年 前
コミット
a1e1841f6f
3 ファイル変更249 行追加207 行削除
  1. 247 205
      cokingCoal/js/humanResources.js
  2. 1 1
      cokingCoal/js/newIndex.js
  3. 1 1
      cokingCoal/js/request.js

+ 247 - 205
cokingCoal/js/humanResources.js

@@ -89,7 +89,7 @@ let app = new Vue({
             treeIndex: 0,
             rollFlag: true,
             config1: {
-                waitTime: 1300,
+                waitTime: 7300,
                 header: ["双选单位", "双选岗位", "双选人数", "报名人数", "发布时间"],
                 headerHeight: 55,
                 columnWidth: [230, 170],
@@ -368,6 +368,9 @@ let app = new Vue({
             noticeList: [],
             noticeIndex: 0,
             isShowInfoList: false,
+
+            recruitTypeMax: 0,
+            recruitTypeList: []
         }
     },
     created() {
@@ -408,16 +411,19 @@ let app = new Vue({
         this.$nextTick(() => {
 
 
-            let rightOne = this.$refs.rightOne
-            this.initLineRight(rightOne, { value: 25, total: 67 })
-            let rightTwo = this.$refs.rightTwo
-            this.initLineRight(rightTwo, { value: 22, total: 67 })
-            let rightThree = this.$refs.rightThree
-            this.initLineRight(rightThree, { value: 10, total: 67 })
-            let rightFour = this.$refs.rightFour
-            this.initLineRight(rightFour, { value: 8, total: 67 })
-            let rightFive = this.$refs.rightFive
-            this.initLineRight(rightFive, { value: 2, total: 67 })
+            // let rightOne = this.$refs.rightOne
+            // this.initLineRight(rightOne, { value: 25, total: 67 })
+            // let rightTwo = this.$refs.rightTwo
+            // this.initLineRight(rightTwo, { value: 22, total: 67 })
+            // let rightThree = this.$refs.rightThree
+            // this.initLineRight(rightThree, { value: 10, total: 67 })
+            // let rightFour = this.$refs.rightFour
+            // this.initLineRight(rightFour, { value: 8, total: 67 })
+            // let rightFive = this.$refs.rightFive
+            // this.initLineRight(rightFive, { value: 2, total: 67 })
+
+
+
             // let c1 = this.$refs.c1
             // this.initRightCycle(c1, 40)
             // let c2 = this.$refs.c2
@@ -492,51 +498,52 @@ let app = new Vue({
         }, 5000)
 
 
-        // localEnvAppToken().then(res => {
-        //     localStorage.setItem("app_token", res.app_token)
-        //     getLocalEnvAccessToken().then(res => {
-        //         localStorage.setItem("access_token", res.access_token)
-        //         that.getPlayers()
-        //         that.getPostDetail()
-        //         that.getHalfYearDelivcv()
-        //         that.getHotDelivcv()
-        //         that.arrToListArr()
-        //         that.getDelivcvAndApply()
-        //         that.getreviewarrange()
-        //         that.getRecruitType()
-        //         that.getFailReason()
-        //         that.getQualAudits()
-        //         that.getNoticePerson()
-        //         that.getNotice()
-        //         that.getDoubleChoice()
-        //         setInterval(() => {
-        //             that.getreviewarrange({
-        //                 mianshi: [
-        //                     ["焦煤", "李哥", "301", "2", "2023-08-31 10:40:55.0"],
-        //                     ["焦", "李13哥", "311", "2", "2023-08-31 10:40:55.0"],
-        //                     ["焦", "李13哥", "311", "2", "2023-08-31 10:40:55.0"],
-        //                     ["焦", "李13哥", "311", "2", "2023-08-31 10:40:55.0"],
-        //                     ["焦", "李13哥", "311", "2", "2023-08-31 10:40:55.0"],
-        //                     ["焦", "李13哥", "311", "2", "2023-08-31 10:40:55.0"],
-        //                     ["焦", "李13哥", "311", "2", "2023-08-31 10:40:55.0"],
-        //                     ["焦", "李13哥", "311", "2", "2023-08-31 10:40:55.0"],
-        //                 ],
-        //                 bishi: [
-        //                     ["煤", "李13哥", "311", "2", "2023-08-31 10:40:55.0"],
-        //                     ["煤", "李13哥", "311", "2", "2023-08-31 10:40:55.0"],
-        //                     ["煤", "李13哥", "311", "2", "2023-08-31 10:40:55.0"],
-        //                     ["煤", "李13哥", "311", "2", "2023-08-31 10:40:55.0"],
-        //                     ["煤", "李13哥", "311", "2", "2023-08-31 10:40:55.0"],
-        //                     ["煤", "李13哥", "311", "2", "2023-08-31 10:40:55.0"],
-        //                     ["煤", "李13哥", "311", "2", "2023-08-31 10:40:55.0"],
-        //                     ["煤", "李13哥", "311", "2", "2023-08-31 10:40:55.0"],
-        //                     ["煤", "李13哥", "311", "2", "2023-08-31 10:40:55.0"],
-        //                 ],
-        //             })
-        //         }, (1000 * 10))
-
-        //     })
-        // }).catch(err => {
+        localEnvAppToken().then(res => {
+            localStorage.setItem("app_token", res.app_token)
+            getLocalEnvAccessToken().then(res => {
+                localStorage.setItem("access_token", res.access_token)
+                that.getPlayers()
+                that.getPostDetail()
+                that.getHalfYearDelivcv()
+                that.getHotDelivcv()
+                that.arrToListArr()
+                that.getDelivcvAndApply()
+                that.getreviewarrange()
+                that.getRecruitType()
+                that.getFailReason()
+                that.getQualAudits()
+                that.getNoticePerson()
+                that.getNotice()
+                that.getDoubleChoice()
+                that.getPositionAll()
+                setInterval(() => {
+                    that.getreviewarrange({
+                        mianshi: [
+                            ["焦煤", "李哥", "301", "2", "2023-08-31 10:40:55.0"],
+                            ["焦", "李13哥", "311", "2", "2023-08-31 10:40:55.0"],
+                            ["焦", "李13哥", "311", "2", "2023-08-31 10:40:55.0"],
+                            ["焦", "李13哥", "311", "2", "2023-08-31 10:40:55.0"],
+                            ["焦", "李13哥", "311", "2", "2023-08-31 10:40:55.0"],
+                            ["焦", "李13哥", "311", "2", "2023-08-31 10:40:55.0"],
+                            ["焦", "李13哥", "311", "2", "2023-08-31 10:40:55.0"],
+                            ["焦", "李13哥", "311", "2", "2023-08-31 10:40:55.0"],
+                        ],
+                        bishi: [
+                            ["煤", "李13哥", "311", "2", "2023-08-31 10:40:55.0"],
+                            ["煤", "李13哥", "311", "2", "2023-08-31 10:40:55.0"],
+                            ["煤", "李13哥", "311", "2", "2023-08-31 10:40:55.0"],
+                            ["煤", "李13哥", "311", "2", "2023-08-31 10:40:55.0"],
+                            ["煤", "李13哥", "311", "2", "2023-08-31 10:40:55.0"],
+                            ["煤", "李13哥", "311", "2", "2023-08-31 10:40:55.0"],
+                            ["煤", "李13哥", "311", "2", "2023-08-31 10:40:55.0"],
+                            ["煤", "李13哥", "311", "2", "2023-08-31 10:40:55.0"],
+                            ["煤", "李13哥", "311", "2", "2023-08-31 10:40:55.0"],
+                        ],
+                    })
+                }, (1000 * 10))
+
+            })
+        }).catch(err => {
             this.isChangeList = true
 
             let pageBtm = this.$refs.pageBtm
@@ -545,7 +552,7 @@ let app = new Vue({
             let vita = this.$refs.vita
             that.initVitaEcharts(vita)
             that.getPostDetail()
-        // })
+        })
     },
     methods: {
         // 监听键盘
@@ -884,6 +891,9 @@ let app = new Vue({
             category.forEach((value) => {
                 datas.push(value.value);
             });
+            if (total == 0) {
+                total += 1
+            }
             option = {
                 // backgroundColor: 'rgb(231,238,249)',
                 xAxis: {
@@ -997,6 +1007,10 @@ let app = new Vue({
                         normal: {
                             formatter: (params) => {
                                 var text;
+                                if (total == 0) {
+                                    text = `0 人  |  0%`;
+                                    return text
+                                }
                                 if (params.value >= 10) {
                                     if (((params.value / total) * 100).toFixed(0) < 10) {
                                         text = `${("  " + params.value)}人  |  ${(((params.value) / total) * 100).toFixed(0)}%`;
@@ -1641,6 +1655,7 @@ let app = new Vue({
 
         },
         initThreeBig(el) {
+            let that = this
             this.roseEcharts = echarts.init(el)
             var placeHolderStyle = {
                 normal: {
@@ -1729,7 +1744,7 @@ let app = new Vue({
                         }
                     },
                     data: [{
-                        value: 12,
+                        value: that.recruitTypeList[0],
                         itemStyle: {
                             normal: {
                                 color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
@@ -1743,7 +1758,7 @@ let app = new Vue({
                         },
                         label: dataStyle,
                     }, {
-                        value: 33,
+                        value: that.recruitTypeMax,
                         itemStyle: placeHolderStyle,
                     },
 
@@ -1766,7 +1781,7 @@ let app = new Vue({
                         }
                     },
                     data: [{
-                        value: 15,
+                        value: that.recruitTypeList[1],
                         itemStyle: {
                             normal: {
                                 color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
@@ -1780,7 +1795,7 @@ let app = new Vue({
                         },
                         label: dataStyle,
                     }, {
-                        value: 33,
+                        value: that.recruitTypeMax,
                         itemStyle: placeHolderStyle,
                     },
 
@@ -1804,7 +1819,7 @@ let app = new Vue({
                         }
                     },
                     data: [{
-                        value: 9,
+                        value: that.recruitTypeList[2],
                         itemStyle: {
                             normal: {
                                 color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
@@ -1818,7 +1833,7 @@ let app = new Vue({
                         },
                         label: dataStyle,
                     }, {
-                        value: 33,
+                        value: that.recruitTypeMax,
                         itemStyle: placeHolderStyle,
                     },
 
@@ -1972,6 +1987,7 @@ let app = new Vue({
                     bottom: "43%"
                 }
             }
+
             this.showMark = true
             this.showSelect = true
         },
@@ -1983,6 +1999,9 @@ let app = new Vue({
         handleOption(item) {
             this[this.from][this.type] = item
             this.handleMark()
+            if(this.from == "timeList2"){
+                this.getPositionAll()
+            }
         },
         handleMonthOption(item) {
             this.monthItem = item
@@ -2156,7 +2175,9 @@ let app = new Vue({
         },
         getPlayers() {
             let that = this;
-            let data = {};
+            let data = {
+                flag: true
+            };
             fetchPostMethods("/ierp/kapi/v2/mdnb/mdnb_control/Players", data).then(res => {
                 if (res) {
                     that.mainList[1].value = res.value
@@ -2204,17 +2225,17 @@ let app = new Vue({
                 flag: true
             };
             fetchPostMethods("/ierp/kapi/v2/mdnb/mdnb_control/HalfYearDelivcv", data).then(res => {
-                if(res){
+                if (res) {
                     let list = []
-                    res.forEach(item=>{
-                        if(item.key == "月份"){
+                    res.forEach(item => {
+                        if (item.key == "月份") {
                             // that.vitaData.x = item.value
-                            item.value.forEach(i=>{
+                            item.value.forEach(i => {
                                 list.push(i + "月")
 
                             })
                         }
-                        if(item.key == "数量"){
+                        if (item.key == "数量") {
                             that.vitaData.y = item.value
                         }
                     })
@@ -2222,7 +2243,7 @@ let app = new Vue({
                     let vita = this.$refs.vita
                     that.initVitaEcharts(vita)
                 }
-                
+
 
             })
         },
@@ -2232,9 +2253,8 @@ let app = new Vue({
                 flag: true
             };
             fetchPostMethods("/ierp/kapi/v2/mdnb/mdnb_control/HotDelivcv", data).then(res => {
-                if(res){
+                if (res) {
                     that.typeList.data = res.data
-                    console.log(that.typeList.data);
                 }
             })
 
@@ -2320,6 +2340,7 @@ let app = new Vue({
 
         getDelivcvAndApply() {
             let that = this;
+            console.log(that.timeList1);
             let data = {
                 flag: true,
             };
@@ -2361,12 +2382,13 @@ let app = new Vue({
             };
             // fetchPostMethods("/ierp/kapi/v2/mdnb/mdnb_control/getreviewarrange", data).then(res => {
             //     console.log(res);
+            // })
+
             if (res) {
                 that.isRendering(res.mianshi, "interviewIndex", "configInterview", "showInterview")
                 that.isRendering(res.bishi, "examinationIndex", "configWritten", "showExamination")
             }
 
-            // })
         },
         isRendering(data, type, key, flag) {
             let that = this;
@@ -2391,121 +2413,60 @@ let app = new Vue({
             let data = {
                 flag: true
             }
-            fetchPostMethods("/ierp/kapi/v2/mdnb/mdnb_control/RecruitType",data).then(res => {
-                console.log(res);
+            fetchPostMethods("/ierp/kapi/v2/mdnb/mdnb_control/RecruitType", data).then(res => {
+                if (res) {
+                    res.data.forEach(item => {
+                        that.recruitTypeMax += item.value
+                        that.recruitTypeList.push(item.value)
+                    })
+                }
             })
         },
         getFailReason() {
             let that = this;
             let data = {
-                flag: false
+                flag: true
             };
-            let res = {
-                data: [
-                    [
-                        {
-                            value: "信息有误",
-                            key: "不通过原因"
-                        },
-                        {
-                            value: 5200,
-                            key: "不通过数量"
-                        },
-                        {
-                            value: "0.00%",
-                            key: "百分比"
-                        }
-                    ],
-                    [
-                        {
-                            value: "出勤不足",
-                            key: "不通过原因"
-                        },
-                        {
-                            value: 2900,
-                            key: "不通过数量"
-                        },
-                        {
-                            value: "0.00%",
-                            key: "百分比"
-                        }
-                    ],
-                    [
-                        {
-                            value: "工作年限不符",
-                            key: "不通过原因"
-                        },
-                        {
-                            value: 2500,
-                            key: "不通过数量"
-                        },
-                        {
-                            value: "0.00%",
-                            key: "百分比"
-                        }
-                    ],
-                    [
-                        {
-                            value: "信息不完整",
-                            key: "不通过原因"
-                        },
-                        {
-                            value: 1200,
-                            key: "不通过数量"
-                        },
-                        {
-                            value: "0.00%",
-                            key: "百分比"
-                        }
-                    ],
-                    [
-                        {
-                            value: "任职条件不符",
-                            key: "不通过原因"
-                        },
-                        {
-                            value: 600,
-                            key: "不通过数量"
-                        },
-                        {
-                            value: "0.00%",
-                            key: "百分比"
-                        }
-                    ]
-                ]
-            }
-            let dataList = []
-            let total = 0
-            res.data.forEach((item, index) => {
-                // that.leftErrorList[index] = item[]
-                item.forEach(i => {
-                    let obj = {}
-                    if (i.key == "不通过原因") {
-                        that.leftErrorList[index] = i.value
-                    }
-                    if (i.key == "不通过数量") {
-                        obj.value = i.value
-                        dataList[index] = obj
-                    }
-                })
-            })
-            dataList.forEach(item => {
-                total = total + item.value
-            })
-            // leftErrorList:["信息不完整","信息有误","任职条件不符","出勤不足","工作年限不符"]
-
             let rightOne = this.$refs.rightOne
-            this.initLineRight(rightOne, { value: dataList[0].value, total })
             let rightTwo = this.$refs.rightTwo
-            this.initLineRight(rightTwo, { value: dataList[1].value, total })
             let rightThree = this.$refs.rightThree
-            this.initLineRight(rightThree, { value: dataList[2].value, total })
             let rightFour = this.$refs.rightFour
-            this.initLineRight(rightFour, { value: dataList[3].value, total })
             let rightFive = this.$refs.rightFive
-            this.initLineRight(rightFive, { value: dataList[4].value, total })
-            fetchPostMethods("/ierp/kapi/v2/mdnb/mdnb_control/FailReason",data).then(res => {
-                console.log(res);
+            // leftErrorList:["信息不完整","信息有误","任职条件不符","出勤不足","工作年限不符"]
+            fetchPostMethods("/ierp/kapi/v2/mdnb/mdnb_control/FailReason", data).then(res => {
+                if (res) {
+                    let dataList = []
+                    let total = 0
+                    res.data.forEach((item, index) => {
+                        // that.leftErrorList[index] = item[]
+                        item.forEach(i => {
+                            let obj = {}
+                            if (i.key == "不通过原因") {
+                                that.leftErrorList[index] = i.value
+                            }
+                            if (i.key == "不通过数量") {
+                                obj.value = i.value
+                                dataList[index] = obj
+                            }
+                        })
+                    })
+                    dataList.forEach(item => {
+                        total = total + item.value
+                    })
+                    that.initLineRight(rightOne, { value: dataList[0].value, total })
+                    that.initLineRight(rightTwo, { value: dataList[1].value, total })
+                    that.initLineRight(rightThree, { value: dataList[2].value, total })
+                    that.initLineRight(rightFour, { value: dataList[3].value, total })
+                    that.initLineRight(rightFive, { value: dataList[4].value, total })
+
+
+                    // that.initLineRight(rightOne, { value: 25, total: 67 })
+                    // that.initLineRight(rightTwo, { value: 22, total: 67 })
+                    // that.initLineRight(rightThree, { value: 10, total: 67 })
+                    // that.initLineRight(rightFour, { value: 8, total: 67 })
+                    // that.initLineRight(rightFive, { value: 2, total: 67 })
+
+                }
             })
         },
         getQualAudits() {
@@ -2513,32 +2474,19 @@ let app = new Vue({
             let data = {
                 flag: true
             };
-            fetchPostMethods("/ierp/kapi/v2/mdnb/mdnb_control/QualAudits", data).then(res => { })
-            let res = {
-                data: [
-                    {
-                        value: 6,
-                        key: "当前总人数"
-                    },
-                    {
-                        value: 1,
-                        key: "通过总人数"
-                    },
-                    {
-                        value: "17.00%",
-                        key: "当前通过率"
-                    }
-                ]
-            }
-            res.data.forEach(item => {
-                if (item.key == "当前总人数") {
-                    that.rightList[0].num1 = item.value
-                }
-                if (item.key == "通过总人数") {
-                    that.rightList[0].num2 = item.value
-                }
-                if (item.key == "当前通过率") {
-                    that.rightList[0].num3 = item.value
+            fetchPostMethods("/ierp/kapi/v2/mdnb/mdnb_control/QualAudits", data).then(res => {
+                if (res) {
+                    res.data.forEach(item => {
+                        if (item.key == "当前总人数") {
+                            that.rightList[0].num1 = item.value
+                        }
+                        if (item.key == "通过总人数") {
+                            that.rightList[0].num2 = item.value
+                        }
+                        if (item.key == "当前通过率") {
+                            that.rightList[0].num3 = item.value
+                        }
+                    })
                 }
             })
             // rightList: [{
@@ -2746,9 +2694,103 @@ let app = new Vue({
                 flag: true
             }
             fetchPostMethods("/ierp/kapi/v2/mdnb/mdnb_control/DoubleChoice", data).then(res => {
-                // console.log(res);
+                if (res) {
+                    that.mainList[0].value = res.value
+                }
             })
-        }
+        },
+        getPositionAll() {
+            let that = this;
+            console.log(that.timeList2);
+
+            let data = {
+                flag: true,
+                start: that.timeList2[0],
+                end: that.timeList2[1],
+            }
+            this.leftTime && clearInterval(this.leftTime)
+            that.leftFlag = false
+            that.config2.data = []
+            let lastList = []
+            let topList = []
+            let mainList = []
+            fetchPostMethods("/ierp/kapi/v2/mdnb/mdnb_control/PositionAll", data).then(res => {
+                if (res) {
+                    res.data.forEach((item, index) => {
+                        if (index <= 8) {
+                            item.unshift("0" + (index + 1))
+                        } else {
+                            item.unshift((index + 1).toString())
+                        }
+                    })
+                    if (res.data.length > 5) {
+                        for (let i = 0; i < 3; i++) {
+                            let color;
+                            if (i == 0) {
+                                color = "yellow"
+                            } else if (i == 1) {
+                                color = "red"
+                            } else {
+                                color = "green"
+                            }
+                            topList.push(["<span class='" + color + "'>" + res.data[i][0] + "</span>", "<span class='" + color + "'>" + res.data[i][1] + "</span>", "<span class='" + color + "'>" + res.data[i][2] + "</span>"])
+                        }
+                        res.data.splice(0, 3)
+                        mainList.push(...spArr(res.data, 2))
+                        mainList.forEach(item => {
+                            item.unshift(...topList)
+                            lastList.push(...item)
+                        })
+                    } else if (res.data.length <= 5 && res.data.length >= 3) {
+                        for (let i = 0; i < 3; i++) {
+                            let color;
+                            if (i == 0) {
+                                color = "yellow"
+                            } else if (i == 1) {
+                                color = "red"
+                            } else {
+                                color = "green"
+                            }
+                            topList.push(["<span class='" + color + "'>" + res.data[i][0] + "</span>", "<span class='" + color + "'>" + res.data[i][1] + "</span>", "<span class='" + color + "'>" + res.data[i][2] + "</span>"])
+                        }
+                        res.data.splice(0, 3)
+                        lastList.push(...topList, ...res.data)
+                    } else if (res.data.length < 3) {
+                        for (let i = 0; i < res.data.length; i++) {
+                            let color;
+                            if (i == 0) {
+                                color = "yellow"
+                            } else if (i == 1) {
+                                color = "red"
+                            } else {
+                                color = "green"
+                            }
+                            lastList.push(["<span class='" + color + "'>" + res.data[i][0] + "</span>", "<span class='" + color + "'>" + res.data[i][1] + "</span>", "<span class='" + color + "'>" + res.data[i][2] + "</span>"])
+                        }
+                    }
+                    that.config2.data = lastList
+                    setTimeout(() => {
+                        that.leftFlag = true
+                        that.leftTime = setInterval(() => {
+                            that.leftList.forEach((item, index) => {
+                                item.flag = !item.flag
+                                if (item.flag) {
+                                    if (index == 0) {
+                                        that.leftFlag = true
+                                    } else {
+                                        that.leftFlag = false
+                                        setTimeout(() => {
+                                            let leftChange = that.$refs.leftChange
+                                            that.initThreeBig(leftChange)
+                                        })
+                                    }
+                                }
+                            })
+                        }, 5000)
+                    }, 10)
+                }
+            })
+        },
 
 
     },

+ 1 - 1
cokingCoal/js/newIndex.js

@@ -477,7 +477,7 @@ let app = new Vue({
             dataFlag: true,
 
             
-            isShowRequest: false,
+            isShowRequest: true,
 
 
 

+ 1 - 1
cokingCoal/js/request.js

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