Browse Source

调整fetch方法封装,前端接口对接

fengxu 1 year ago
parent
commit
4e5cf374e0
4 changed files with 126 additions and 27 deletions
  1. 8 5
      .idea/workspace.xml
  2. BIN
      JMshujudaping23-08-16.zip
  3. 5 5
      cokingCoal/index.html
  4. 113 17
      cokingCoal/js/newIndex.js

+ 8 - 5
.idea/workspace.xml

@@ -5,6 +5,8 @@
   </component>
   <component name="ChangeListManager">
     <list default="true" id="9e5771b4-ce8c-4005-a15b-30e162f89ae8" name="Changes" comment="修改焦煤大屏前端页面,组件,布局">
+      <change beforePath="$PROJECT_DIR$/JMshujudaping23-08-16.zip" beforeDir="false" afterPath="$PROJECT_DIR$/JMshujudaping23-08-16.zip" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/cokingCoal/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/cokingCoal/index.html" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/cokingCoal/js/newIndex.js" beforeDir="false" afterPath="$PROJECT_DIR$/cokingCoal/js/newIndex.js" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
@@ -23,12 +25,13 @@
     <option name="hideEmptyMiddlePackages" value="true" />
     <option name="showLibraryContents" value="true" />
   </component>
-  <component name="PropertiesComponent">{
-  &quot;keyToString&quot;: {
-    &quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
-    &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;
+  <component name="PropertiesComponent"><![CDATA[{
+  "keyToString": {
+    "RunOnceActivity.OpenProjectViewOnStart": "true",
+    "RunOnceActivity.ShowReadmeOnStart": "true",
+    "last_opened_file_path": "D:/FSproject/java_shui_yuan_screen"
   }
-}</component>
+}]]></component>
   <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
   <component name="TaskManager">
     <task active="true" id="Default" summary="Default task">

BIN
JMshujudaping23-08-16.zip


+ 5 - 5
cokingCoal/index.html

@@ -294,11 +294,11 @@
                             <div class="title_else"><span>人才市场</span></div>
                             <div class="w_100_right flex_column">
                                 <div class="top flex justify-between">
-                                    <div class="flex items-center justify-center">
-                                        <img class="top-img" src="./images/top-1.png" alt="">
-                                        <div>优化池<span class="top-text">0</span></div>
+                                    <div class="flex items-center justify-center"  v-for="(item,index) in HumanResourcesList" :key="index">
+                                        <img class="top-img" :src="item.image" alt="">
+                                        <div>{{ item.key }}<span class="top-text">{{ item.value }}</span></div>
                                     </div>
-                                    <div class="flex items-center justify-center">
+                                    <!-- <div class="flex items-center justify-center">
                                         <img class="top-img" src="./images/top-3.png" alt="">
                                         <div>缓冲池<span class="top-text">1830</span></div>
                                     </div>
@@ -309,7 +309,7 @@
                                     <div class="flex items-center justify-center">
                                         <img class="top-img" src="./images/top-2.png" alt="">
                                         <div>共享池<span class="top-text">242</span></div>
-                                    </div>
+                                    </div> -->
                                 </div>
                                 <div class="right_item_item_btm">
                                     <div class="right_item_btm_box">

+ 113 - 17
cokingCoal/js/newIndex.js

@@ -368,6 +368,25 @@ let app = new Vue({
       honorIndex: 0,
       listFlag: true,
       listInterval: null,
+      HumanResourcesList: [
+        {
+          key: "优化池",
+          value: 0,
+          image: "./images/top-1.png",
+        }, {
+          key: "缓冲池",
+          value: 1830,
+          image: "./images/top-3.png",
+        }, {
+          key: "待岗池",
+          value: 5923,
+          image: "./images/top-4.png",
+        }, {
+          key: "共享池",
+          value: 242,
+          image: "./images/top-2.png",
+        },
+      ]
 
     }
   },
@@ -488,6 +507,7 @@ let app = new Vue({
         this.getOrganizationChange()
         this.getIndustrydistribution()
         this.getHumanResources()
+        // this.getlaborproductivity()
       })
     })
 
@@ -1835,15 +1855,15 @@ let app = new Vue({
       }
 
     },
-    initBarCharts(el, data) {
+    initBarCharts(el, data, markLine = [15.3, 50.8, 69.2]) {
       this.workEcharts = echarts.init(el);
       let markLine1 = []
       let markLine2 = []
       let markLine3 = []
       data.x.forEach(item => {
-        markLine1.push(15.3)
-        markLine2.push(50.8)
-        markLine3.push(69.2)
+        markLine1.push(markLine[0])
+        markLine2.push(markLine[1])
+        markLine3.push(markLine[2])
       })
       var option = {
         tooltip: { //提示框组件
@@ -2048,8 +2068,8 @@ let app = new Vue({
               symbol: ['none'],
               silent: true,
               data: [{
-                yAxis: 15.3,
-                name: "15.3",
+                yAxis: markLine[0],
+                name: markLine[0],
                 lineStyle: {
                   normal: {
                     type: "dashed",
@@ -2089,8 +2109,8 @@ let app = new Vue({
               symbol: ['none'],
               silent: true,
               data: [{
-                yAxis: 50.8,
-                name: "50.8",
+                yAxis: markLine[1],
+                name: markLine[1],
                 lineStyle: {
                   normal: {
                     type: "dashed",
@@ -2127,8 +2147,8 @@ let app = new Vue({
               symbol: ['none'],
               silent: true,
               data: [{
-                yAxis: 69.2,
-                name: "69.2",
+                yAxis: markLine[2],
+                name: markLine[2],
                 lineStyle: {
                   normal: {
                     type: "dashed",
@@ -4395,9 +4415,9 @@ let app = new Vue({
       this.mobilizeFlag = false
       this.echartsMark = true
       setTimeout(() => {
-        this.initBarCharts(this.$refs.works, worksList)
-        this.initBarChartsElse(this.$refs.efficiencyElse, efficiencyList, "吨/工", { name: "行业线", value: 8.2 })
-        this.initBarChartsElse(this.$refs.whole, wholeList, "吨/人", { name: "标杆矿井线", value: 1800 })
+        this.getlaborproductivity()
+        this.getMineEfficiency()
+        this.getEmpProductivity()
       })
     },
     getAccumulatedLogin() {
@@ -4433,7 +4453,7 @@ let app = new Vue({
       let data = {}
       let that = this
       fetchPostMethods("/ierp/kapi/v2/mdnb/mdnb_control/Distribution", data).then(res => {
-        res.data.forEach(item=>{
+        res.data.forEach(item => {
           item.flag = false
           item.name = item.key
         })
@@ -4456,7 +4476,7 @@ let app = new Vue({
         let x = []
         let y = []
         that.industry = JSON.parse(JSON.stringify({}))
-        res.data.forEach(item=>{
+        res.data.forEach(item => {
           x.push(item.key)
           y.push(item.value)
         })
@@ -4471,9 +4491,85 @@ let app = new Vue({
       let that = this;
       let data = {};
       fetchPostMethods("/ierp/kapi/v2/mdnb/mdnb_control/HumanResources", data).then(res => {
-        console.log(res, "HumanResources");
+        return
+        if (res.data) {
+          that.HumanResourcesList.forEach(i => {
+            res.data.forEach(item => {
+              if (i.key == item.key) {
+                i.value = item.value
+              }
+            })
+          })
+        }
       })
-    }
+    },
+    getlaborproductivity() {
+      let that = this;
+      let data = {};
+      fetchPostMethods("/ierp/kapi/v2/mdnb/mdnb_control/laborproductivity", data).then(res => {
+        let markLine = []
+        if (res.data) {
+          res.data.forEach(item => {
+            if (item.key == '组织名称') {
+              worksList.x = item.value
+            }
+            if (item.key == "目标值") {
+              worksList.y2 = item.value
+            }
+            if (item.key == "实际值") {
+              worksList.y1 = item.value
+            }
+            if (item.key == "社会平均") {
+              markLine[0] = item.value
+            }
+            if (item.key == "省企平均") {
+              markLine[1] = item.value
+            }
+            if (item.key == "央企平均") {
+              markLine[2] = item.value
+            }
+          })
+          that.initBarCharts(that.$refs.works, worksList, markLine)
+        }
+      })
+    },
+    getMineEfficiency() {
+      let that = this;
+      let data = {};
+      fetchPostMethods("/ierp/kapi/v2/mdnb/mdnb_control/MineEfficiency", data).then(res => {
+        console.log(res);
+        let obj = {}
+        if (res != null) {
+          res.data.forEach(item => {
+            if (item.key == "行业线") {
+              obj = {
+                name: item.key,
+                value: item.value
+              }
+            }
+            if (item.key == "组织名称") {
+              efficiencyList.x = item.value
+            }
+            if(item.key == "目标值"){
+              efficiencyList.y2 = item.value
+            }
+            if(item.key == "实际值"){
+              efficiencyList.y1 = item.value
+            }
+          })
+          that.initBarChartsElse(that.$refs.efficiencyElse, efficiencyList, "吨/工", obj)
+        } else {
+          that.initBarChartsElse(that.$refs.efficiencyElse, efficiencyList, "吨/工", { name: "行业线", value: 8.2 })
+        }
+      })
+    },
+    getEmpProductivity() {
+      let that = this;
+      let data = {}
+      fetchPostMethods("/ierp/kapi/v2/mdnb/mdnb_control/EmpProductivity", data).then(res => {
+        that.initBarChartsElse(that.$refs.whole, wholeList, "吨/人", { name: "标杆矿井线", value: 1800 })
+      })
+    },
   },
 
 })