Browse Source

修改统计年包和月包

limengbo 4 years ago
parent
commit
9785a48ed3
3 changed files with 33 additions and 20 deletions
  1. 19 11
      src/api/skill.js
  2. 8 2
      src/pages/skill/Skill.vue
  3. 6 7
      src/store/modules/skill.js

+ 19 - 11
src/api/skill.js

@@ -52,15 +52,15 @@ service.interceptors.response.use(
 
 
 export function getSkillList (code) {
-  if (code === 'XYYF') {
-    return service({
-      url: `${process.env.XYYF_API}//cms/course`,
-      method: 'get',
-      params: {
-        code
-      }
-    })
-  } else {
+  // if (code === 'XYYF') {
+  //   return service({
+  //     url: `${process.env.XYYF_API}//cms/course`,
+  //     method: 'get',
+  //     params: {
+  //       code
+  //     }
+  //   })
+  // } else {
     return service({
       url: '/skillInfo',
       method: 'get',
@@ -68,7 +68,7 @@ export function getSkillList (code) {
         code
       }
     })
-  }
+  // }
 }
 export function getSkillData (params) {
   if (params.channel === 'BAIDU') {
@@ -77,8 +77,16 @@ export function getSkillData (params) {
       method: 'get',
       params
     })
+  } else if (params.channel === 'XYYF') {
+    return service({
+      url: `http://yfxxt-api.ai160.com/statistics`,
+      method: 'get',
+      params: {
+        startDate: params.startDate,
+        endDate: params.endDate,
+      }
+    })
   } else {
-    console.log(123123123,params)
     return service({
       url: `${process.env.XYYF_API}/statistics`,
       method: 'get',

+ 8 - 2
src/pages/skill/Skill.vue

@@ -28,7 +28,7 @@
             class="pruductForm-skill"
             prop="skillId"
             label="技能选择"
-            v-if="skillParams.channel !== '6001'"
+            v-if="hide(skillParams.channel)"
             :rules="[{ required: true, message: '请选择技能', trigger: 'blur' }]"
           >
           <!-- 兼容小度在家和学有义方不同的返回内容 -->
@@ -460,7 +460,7 @@ export default {
     },
     channelChange(val) {
       this.skillParams.skillId = "";
-      this.$store.dispatch("getSkillList", val);
+      val !== 'XYYF' && this.$store.dispatch("getSkillList", val);
     },
     skillChange(val) {
       this.skillParams.classId = ''
@@ -490,6 +490,12 @@ export default {
         return "0.00%";
       }
       // if(row.)
+    },
+    hide (channel) {
+      if (channel === '6001' || channel === 'XYYF') {
+        return false
+      }
+      return true
     }
   }
 };

+ 6 - 7
src/store/modules/skill.js

@@ -25,17 +25,16 @@ const skill = {
       dispatch,
       commit
     }, code) {
-      console.log(123123123, code)
       return new Promise((resolve, reject) => {
         getSkillList(code).then(res => {
           console.log(3333333, res.data)
           if (res.code == 200) {
-            if (code === 'XYYF') {
-              res.data.unshift({
-                title: "全部",
-                id: 100
-              })
-            }
+            // if (code === 'XYYF') {
+            //   res.data.unshift({
+            //     title: "全部",
+            //     id: 100
+            //   })
+            // }
             resolve(res.data);
             commit('GET_SKILL_LIST', res.data)
           }