洪海涛 4 жил өмнө
parent
commit
734cf24753

+ 11 - 11
src/api/dataBig.js

@@ -1,29 +1,29 @@
-import request from "@/utils/request";
+import request from '@/utils/request'
 
-console.log(3, request,request.baseURL);
-const commonUrl = "http://10.179.162.122:10086/api";
+console.log(3, request, request.baseURL)
+const commonUrl = 'http://10.179.162.122:10086/api'
 
 export function getGlobalInterface(data) {
   return request({
-    url: "http://10.179.162.122:10086/render/menu",
-    method: "get",
+    url: 'http://10.179.162.122:10086/render/menu',
+    method: 'get',
     data
-  });
+  })
 }
 
 export function postForm(path, data) {
   return request({
     url: commonUrl + path,
-    method: "post",
+    method: 'post',
     data
-  });
+  })
 }
 
 export function testPost() {
   return request({
     url:
-      "http://127.0.0.1:4523/mock/368525/dataMarket/quality/getOnlineProcessData",
-    method: "post",
+      'http://127.0.0.1:4523/mock/368525/dataMarket/quality/getOnlineProcessData',
+    method: 'post',
     data: {}
-  });
+  })
 }

+ 1 - 1
src/router/newRouter.js

@@ -354,7 +354,7 @@ const layout = [
         meta: { title: '数据大盘' }
       }
     ]
-  },
+  }
 ]
 
 export default layout

+ 41 - 41
src/utils/request.js

@@ -1,85 +1,85 @@
-import axios from "axios";
+import axios from 'axios'
 // import store from '@/store'
 // import { getToken } from '@/utils/auth'
-import { loginUrl } from "@/apiConfig/requestIP.js";
-import { Encrypt } from "@/utils/crypto-js.js";
-import { message } from "@/utils/mesDebounce";
-import router from "@/router/index.js";
-import store from "@/store/index.js";
+import { loginUrl } from '@/apiConfig/requestIP.js'
+import { Encrypt } from '@/utils/crypto-js.js'
+import { message } from '@/utils/mesDebounce'
+import router from '@/router/index.js'
+import store from '@/store/index.js'
 
 // create an axios instance
 const service = axios.create({
-  baseURL: "/apis", // url = base url + request url
+  baseURL: '/apis', // url = base url + request url
   timeout: 5000, // request timeout
   withCredentials: true
-});
+})
 
 service.interceptors.request.use(
   config => {
-    config.headers["secret"] = Encrypt();
+    config.headers['secret'] = Encrypt()
     // config.retry = 2// 如果请求超时,重试次数
     // config.retryInterval = 1000 // 重试间隔
-    console.log(config, 22);
-    return config;
+    console.log(config, 22)
+    return config
   },
   error => {
-    return Promise.reject(error);
+    return Promise.reject(error)
   }
-);
+)
 service.interceptors.response.use(
   response => {
-    const res = response.data;
-    if (typeof res.code !== "undefined" && res.code !== 200 && res.code !== 0) {
+    const res = response.data
+    if (typeof res.code !== 'undefined' && res.code !== 200 && res.code !== 0) {
       message({
-        message: res.msg || "Error",
-        type: "error",
+        message: res.msg || 'Error',
+        type: 'error',
         duration: 5 * 1000
-      });
-    } else if (typeof res.retCode !== "undefined" && res.retCode !== 0) {
+      })
+    } else if (typeof res.retCode !== 'undefined' && res.retCode !== 0) {
       message({
-        message: res.retMsg || "Error",
-        type: "error",
+        message: res.retMsg || 'Error',
+        type: 'error',
         duration: 5 * 1000
-      });
+      })
     }
-    return res;
+    return res
   },
   error => {
     if (error && error.response) {
       switch (error.response.status) {
         case 400:
-          error.message = "错误请求";
-          break;
+          error.message = '错误请求'
+          break
         case 401:
-          error.message = "未授权,请重新登录";
-          break;
+          error.message = '未授权,请重新登录'
+          break
         case 404:
-          error.message = "请求错误,未找到该资源";
-          break;
+          error.message = '请求错误,未找到该资源'
+          break
         case 405:
-          error.message = "请求方法未允许";
-          break;
+          error.message = '请求方法未允许'
+          break
         default:
-          error.message = "服务出现异常,请稍后再试或联系管理员";
+          error.message = '服务出现异常,请稍后再试或联系管理员'
       }
       if (error.response.status !== 403) {
         message({
           message: error.message,
-          type: "warning",
+          type: 'warning',
           duration: 5 * 1000
-        });
+        })
       }
       if (error.response.status === 401) {
-        location.href = loginUrl;
+        location.href = loginUrl
       } else if (error.response.status === 403) {
-        store.dispatch("global/setBizId", -1);
-        store.dispatch("global/setBizName", "");
-        router.push({ name: "notAccess" });
+        store.dispatch('global/setBizId', -1)
+        store.dispatch('global/setBizName', '')
+        router.push({ name: 'notAccess' })
       }
     }
-    return Promise.reject(error);
+    return Promise.reject(error)
   }
-);
+)
 // function axiosRetryInterceptor(res) {
 //   const config = res.config
 //   // 无网络状态或者请求超时
@@ -105,4 +105,4 @@ service.interceptors.response.use(
 //   })
 // }
 
-export default service;
+export default service

+ 17 - 6
src/views/dataBigManage/components/dataTitle.vue

@@ -1,19 +1,30 @@
 <template>
   <div class="data-title-wrapper">
-    <div ref="tips" class="tips"></div>
+    <div ref="tips" class="tips" />
     <div class="title">{{ title }}</div>
   </div>
 </template>
 <script>
 export default {
-  name: 'dataTitle',
-  props: ['title', 'color'],
+  name: 'DataTitle',
+  props: {
+    title: {
+      type: String,
+      required: false,
+      default: () => ''
+    },
+    color: {
+      type: String,
+      required: false,
+      default: () => ''
+    }
+  },
   watch: {
     color() {
       setTimeout(() => {
-        this.$refs.tips.style.setProperty('--bcColor', this.color || 'rgb(64, 158, 255)');
-      }, 300);
-    },
+        this.$refs.tips.style.setProperty('--bcColor', this.color || 'rgb(64, 158, 255)')
+      }, 300)
+    }
   }
 }
 </script>

+ 77 - 75
src/views/dataBigManage/index.vue

@@ -13,7 +13,7 @@
             :options="sectorOptions"
             :props="{ checkStrictly: true }"
             clearable
-          ></el-cascader>
+          />
         </el-form-item>
         <el-form-item label="时间:">
           <div class="date-select">
@@ -26,8 +26,7 @@
                 dateType = item.key;
                 setDate(item.key);
               "
-              >{{ item.label }}</span
-            >
+            >{{ item.label }}</span>
           </div>
           <el-date-picker
             v-model="stratAndEnd"
@@ -56,13 +55,16 @@
                 :options="teamOptions"
                 :props="{ checkStrictly: true }"
                 clearable
-              ></el-cascader>
+              />
             </el-form-item>
           </el-form>
         </div>
         <div class="more-btn-wrapper">
-          <el-button type="primary" size="mini" @click="query_project(form_all)"
-            >筛 选
+          <el-button
+            type="primary"
+            size="mini"
+            @click="query_project(form_all)"
+          >筛 选
           </el-button>
           <el-button size="mini" @click="query_Reset">重 置</el-button>
         </div>
@@ -77,129 +79,129 @@
 </template>
 
 <script>
-import moment from "moment";
-import { projectList } from "@/api/projectIndex";
-import { testPost } from "@/api/dataBig";
-/*页面专有展示组件*/
-import dataTitle from "./components/dataTitle";
+import moment from 'moment'
+import { projectList } from '@/api/projectIndex'
+import { testPost } from '@/api/dataBig'
+/* 页面专有展示组件*/
+import dataTitle from './components/dataTitle'
 
 export default {
+  components: { dataTitle },
   data() {
     return {
       // enum
       dateSelect: [
         {
-          key: "week",
-          label: "本周"
+          key: 'week',
+          label: '本周'
         },
         {
-          key: "month",
-          label: "本月"
+          key: 'month',
+          label: '本月'
         },
         {
-          key: "year",
-          label: "本年"
+          key: 'year',
+          label: '本年'
         }
       ],
       // 筛选
       form_all: {},
       DetailedScreening: false,
       stratAndEnd: [], // 开始结束日期
-      dateType: "week", // 时间选择类型
+      dateType: 'week', // 时间选择类型
       bugCountTimeType: 1, // 获取趋缺陷势图数据接口入参:1本周 2本月 3本年
       timeTypeList: [
         // 日期选择
-        { code: 1, label: "周" },
-        { code: 2, label: "月" },
-        { code: 3, label: "年" }
+        { code: 1, label: '周' },
+        { code: 2, label: '月' },
+        { code: 3, label: '年' }
       ],
       sectorOptions: [], // 部门数据
       teamOptions: [] // 团队数据
-    };
+    }
   },
   created() {
-    this.init();
+    this.init()
   },
   methods: {
     setDate(type) {
       // 日期筛选
-      let startDate = null;
-      let endDate = null;
+      let startDate = null
+      let endDate = null
       switch (type) {
-        case "week":
+        case 'week':
           startDate = moment()
-            .startOf("week")
-            .format("YYYY.MM.DD");
+            .startOf('week')
+            .format('YYYY.MM.DD')
           endDate = moment()
-            .endOf("week")
-            .format("YYYY.MM.DD");
-          this.bugCountTimeType = this.timeTypeList[0].code;
-          break;
-        case "month":
+            .endOf('week')
+            .format('YYYY.MM.DD')
+          this.bugCountTimeType = this.timeTypeList[0].code
+          break
+        case 'month':
           startDate = moment()
-            .startOf("month")
-            .format("YYYY.MM.DD");
+            .startOf('month')
+            .format('YYYY.MM.DD')
           endDate = moment()
-            .endOf("month")
-            .format("YYYY.MM.DD");
-          this.bugCountTimeType = this.timeTypeList[1].code;
-          break;
-        case "year":
+            .endOf('month')
+            .format('YYYY.MM.DD')
+          this.bugCountTimeType = this.timeTypeList[1].code
+          break
+        case 'year':
           startDate = moment()
-            .startOf("year")
-            .format("YYYY.MM.DD");
+            .startOf('year')
+            .format('YYYY.MM.DD')
           endDate = moment()
-            .endOf("year")
-            .format("YYYY.MM.DD");
-          this.bugCountTimeType = this.timeTypeList[2].code;
-          break;
+            .endOf('year')
+            .format('YYYY.MM.DD')
+          this.bugCountTimeType = this.timeTypeList[2].code
+          break
       }
-      this.stratAndEnd = [startDate, endDate];
-      this.onSubmit();
+      this.stratAndEnd = [startDate, endDate]
+      this.onSubmit()
     },
     query_project(e) {
       // 查询
       if (this.isToOne) {
-        this.curIndex = 1;
-        this.currentPage = 1;
+        this.curIndex = 1
+        this.currentPage = 1
       }
-      this.table_loading = true;
-      this.query_object = {};
-      this.query_object = e;
-      this.query_object.bizId = this.bizId;
-      this.query_object.curIndex = this.curIndex;
-      this.query_object.pageSize = this.pageSize;
+      this.table_loading = true
+      this.query_object = {}
+      this.query_object = e
+      this.query_object.bizId = this.bizId
+      this.query_object.curIndex = this.curIndex
+      this.query_object.pageSize = this.pageSize
       projectList(this.query_object).then(res => {
-        this.table_project = res.data;
-        this.total = res.total;
-        this.table_loading = false;
-      });
-      this.isToOne = true;
+        this.table_project = res.data
+        this.total = res.total
+        this.table_loading = false
+      })
+      this.isToOne = true
     },
     query_Reset() {
       // 重置
-      this.$set(this.form_all, "priority", this.query_object.priority);
-      this.$set(this.form_all, "name", this.query_object.name);
-      this.$set(this.form_all, "projectOwner", this.query_object.projectOwner);
-      this.$set(this.form_all, "bizType", "");
-      this.$set(this.form_all, "creater", "");
+      this.$set(this.form_all, 'priority', this.query_object.priority)
+      this.$set(this.form_all, 'name', this.query_object.name)
+      this.$set(this.form_all, 'projectOwner', this.query_object.projectOwner)
+      this.$set(this.form_all, 'bizType', '')
+      this.$set(this.form_all, 'creater', '')
       this.$message({
-        message: "已重置",
-        type: "success",
+        message: '已重置',
+        type: 'success',
         duration: 1000,
         offset: 150
-      });
-      this.query_project(this.form_all);
+      })
+      this.query_project(this.form_all)
     },
     init() {
       testPost().then(res => {
-        console.log(res);
-      });
+        console.log(res)
+      })
     },
     onSubmit() {}
-  },
-  components: { dataTitle }
-};
+  }
+}
 </script>
 <style lang="scss">
 .data-big-wrapper {

+ 11 - 6
src/views/home/index.vue

@@ -39,23 +39,28 @@
           <br>
           <span style="font-size: 17pt;">一站式质量效率平台,普惠你的工作</span><br>
           <el-button plain class="enter-button" @click.native="handleSelect('4')">
-            <svg-icon icon-class="project-enter"/>
+            <svg-icon icon-class="project-enter" />
             项目管理
           </el-button>
           <el-button plain class="enter-button" @click.native="handleSelect('1')">
-            <svg-icon icon-class="env-enter"/>
+            <svg-icon icon-class="env-enter" />
             环境管理
           </el-button>
           <el-button plain class="enter-button" @click.native="handleSelect('9')">
-            <svg-icon icon-class="tool-enter"/>
+            <svg-icon icon-class="tool-enter" />
             工具集合
           </el-button>
         </div>
         <div class="home-carousel">
           <el-carousel :height="imgHeight + 'px'" indicator-position="outside">
             <el-carousel-item v-for="(item, index) in abc_img" :key="index">
-              <img ref="image" :src="item.thumb" style="width: 100%; cursor: pointer;" @load="loadImage()"
-                   @click="image_carousel(item)">
+              <img
+                ref="image"
+                :src="item.thumb"
+                style="width: 100%; cursor: pointer;"
+                @load="loadImage()"
+                @click="image_carousel(item)"
+              >
             </el-carousel-item>
           </el-carousel>
           <img src="@/assets/home_images/home_inage.png" style="position: absolute; left: 45%; width: 60%;">
@@ -70,7 +75,7 @@
       </a>
       <img style="width: 100%;z-index: -1;" src="@/assets/home_images/home.jpg">
     </div>
-    <div id="content1"/>
+    <div id="content1" />
     <div class="div-main" style="height: 600pt;width: 100%;text-align: center;">
       <div style="font-size: 21pt;margin-top: 54pt;color: #333333;">功能介绍</div>
 

+ 3 - 3
src/views/projectManage/onlineproblem/component/header/index.vue

@@ -86,8 +86,8 @@ export default {
       this.showMore = e
     },
     create() {
-      window.log({c: 'problem', d: 'add_problem'})
-      this.$router.push({name: '质惠新建线上问题'})
+      window.log({ c: 'problem', d: 'add_problem' })
+      this.$router.push({ name: '质惠新建线上问题' })
     },
     async search(key, value) {
       const data = {}
@@ -108,7 +108,7 @@ export default {
       data.month = this.month
       this.$emit('listSearch', data)
       // 埋点搜索线上问题列表
-      window.log({c: 'problem', d: 'get_problem_list'})
+      window.log({ c: 'problem', d: 'get_problem_list' })
     }
   }
 }