Bläddra i källkod

Merge branch 'http_mock' of git.xiaojukeji.com:jacklijiajia/thoth-frontend into http_mock

qinzhipeng_v@didiglobal.com 4 år sedan
förälder
incheckning
d6e567a999

+ 1 - 8
src/App.vue

@@ -37,14 +37,7 @@ export default {
   methods: {
     initOmegaTracker() {
       try {
-        // console.log('OmegaTracker.getTracker', config)
-        window.Omega = OmegaTracker.getTracker(config)
-        // window.Omega.trackEvent('注册的埋点id', {
-        //   'bizId': 99,
-        //   'user': 'amyliaozijun',
-        //   'master_func': '项目',
-        //   'detail_func': '行为'
-        // })
+        window.log = OmegaTracker.getTracker(config)
       } catch (error) {
         console.error(error)
       }

+ 2 - 0
src/api/workSchedule.js

@@ -1,5 +1,6 @@
 // 个人工作台和团队工作台
 import request from '@/utils/request'
+import { log } from '@/utils/global'
 import { TeamManagement } from '@/apiConfig/api'
 
 // 获取用户团队列表
@@ -66,6 +67,7 @@ export function deleteSelfSchedule(id) {
 
 // 获取指定时间段用户日程信息
 export function queryWorkListByTime(data) {
+  log({ c: 'self_workbench', d: 'get_calendar' })
   return request({
     url: TeamManagement + '/workbench/personal/queryWorkListByTime',
     method: 'post',

+ 4 - 6
src/apiConfig/api.js

@@ -2,16 +2,16 @@ import { requestIp } from './requestIP'
 
 /*eslint-disable*/   //规避eslint的检查,如没有eslint可不写
 
-export const mockUrl = 'http://10.190.5.222:8980' // 测试用例 测试计划
+export const mockUrl = 'http://10.179.53.173:8980' // 线上
 
-// export const qualityUrl = 'http://10.190.6.249:8898' // 质量度量 (废弃,下次发版删除)
+export const qualityUrl = 'http://10.190.6.249:8898' // 质量度量
 
 //虚拟硬件线下环境
 export const vehicleUrl_stable = 'http://10.190.3.48:9999' // 虚拟硬件 zhihui
   //虚拟硬件预发环境
-export const vehicleUrl_preonline = 'http://10.190.5.222:9999' // 虚拟硬件 zhihui
+export const vehicleUrl_preonline = 'http://10.179.53.173:9999' // 虚拟硬件 zhihui
   //虚拟硬件线上环境
-export const vehicleUrl_online = 'http://10.190.9.230:9999' // 虚拟硬件 zhihui
+export const vehicleUrl_online = 'http://10.179.91.236:9999' // 虚拟硬件 zhihui
 
 // -----------------------------------------2.0-----------------------------------------------
 
@@ -30,5 +30,3 @@ export const envWebUrl = requestIp + '/env-web' //环境web
 export const workbenchUrl = projectManagementUrl //工作台
 
 export const httpMock = requestIp + '/mock' // mock
-
-export const qualityUrl = requestIp + '/quality-metric' // 质量度量

+ 16 - 0
src/apiConfig/requestIP.js

@@ -16,6 +16,22 @@ if (location.host.indexOf('localhost') < 0) {
   }
 }
 
+export function getEnv() {
+  let env = 'test'
+  if (location.host.indexOf('localhost') < 0) {
+    host = 'http://' + location.host
+    requestIp = host + '/zuul'
+    loginUrl = host + '/sso/login?jumpto=' + location.href
+    logoutUrl = host + '/sso/logout?jumpto=' + location.href
+    if (host.indexOf('zhihui-pre.intra.xiaojukeji.com') >= 0) {
+      env = 'pre'
+    } else if (host.indexOf('zhihui.xiaojukeji.com') >= 0) {
+      env = 'online'
+    }
+  }
+  return env
+}
+
 export let ws = '10.78.128.20:10234'
 if (location.host.match(/localhost/) || location.host.match(/zhihui-test/)) {
   ws = '10.78.128.20:10232'

+ 5 - 1
src/icons/svg/problem.svg

@@ -1,3 +1,6 @@
+<<<<<<< HEAD
+<svg xmlns="http://www.w3.org/2000/svg" width="13.308" height="14.215"><defs><linearGradient id="a" x1=".5" x2=".5" y2="1" gradientUnits="objectBoundingBox"><stop offset="0" stop-color="#409eff"/><stop offset="1" stop-color="#80c9ff"/></linearGradient></defs><g transform="translate(-201.5 -191.2)" fill="url(#a)"><path data-name="路径 13053" d="M212.3 205.415h-9.6a1.157 1.157 0 01-1.2-1.111v-11.993a1.158 1.158 0 011.2-1.111h9.6a1.157 1.157 0 011.2 1.111v1.8a.443.443 0 01-.887 0v-1.8c0-.119-.145-.222-.309-.222h-9.6c-.165 0-.309.1-.309.222V204.3c0 .119.145.222.309.222h9.6c.165 0 .309-.1.309-.222v-.7a.443.443 0 11.887 0v.709a1.156 1.156 0 01-1.2 1.106z"/><path data-name="路径 13054" d="M210.565 195.652h-6.664a.45.45 0 010-.9h6.664a.45.45 0 010 .9zm-1.332 3.095h-5.332a.439.439 0 110-.878h5.329a.439.439 0 110 .878zm1.332 3.117h-6.664a.45.45 0 010-.9h6.664a.45.45 0 010 .9z"/><path data-name="路径 13055" d="M214.363 197.923a.444.444 0 01-.443-.443.91.91 0 10-1.82 0 .444.444 0 01-.887 0 1.8 1.8 0 113.6 0 .445.445 0 01-.45.443z"/><path data-name="路径 13056" d="M213.103 201.123a.444.444 0 01-.443-.443v-.72a1.9 1.9 0 01.56-1.361 1.908 1.908 0 00.694-1.124.451.451 0 01.439-.441.437.437 0 01.443.415 2.553 2.553 0 01-.964 1.789 1 1 0 00-.29.722v.72a.442.442 0 01-.439.443z"/><path data-name="路径 13057" d="M212.62900000000002 201.912a.474.474 0 10.474-.474.474.474 0 00-.474.474z"/></g></svg>
+=======
 
 <svg xmlns="http://www.w3.org/2000/svg" width="8.272" height="9.613" viewBox="0 0 8.272 9.613">
   <g id="问题" transform="translate(-160.5 -103.5)">
@@ -5,4 +8,5 @@
     <path id="路径_433" data-name="路径 433" d="M165.2,112.347h-3.692a1.008,1.008,0,0,1-1.006-1.006v-6.835a1.008,1.008,0,0,1,1.006-1.006h6.26a1.008,1.008,0,0,1,1.006,1.006v3.8a.335.335,0,1,1-.671,0v-3.8a.336.336,0,0,0-.335-.335h-6.26a.336.336,0,0,0-.335.335v6.835a.336.336,0,0,0,.335.335H165.2a.335.335,0,1,1,0,.671Z" fill="#666"/>
     <path id="路径_434" data-name="路径 434" d="M646.23,572.333a.333.333,0,0,1-.335-.332,1.675,1.675,0,0,1,.688-1.32.518.518,0,0,0,.192-.539.538.538,0,0,0-.406-.388.589.589,0,0,0-.5.109.521.521,0,0,0-.2.406.335.335,0,1,1-.671,0,1.186,1.186,0,0,1,.449-.928,1.256,1.256,0,0,1,1.064-.241,1.2,1.2,0,0,1,.913.89,1.188,1.188,0,0,1-.433,1.224,1.014,1.014,0,0,0-.427.784A.34.34,0,0,1,646.23,572.333Zm0,.87a.335.335,0,0,1,0-.671h0a.335.335,0,1,1,0,.671Z" transform="translate(-478.799 -460.089)" fill="#666"/>
   </g>
-</svg>
+</svg>
+>>>>>>> http_mock

+ 9 - 1
src/router/newRouter.js

@@ -192,12 +192,20 @@ const layout = [
         component: () => import('@/views/projectManage/taskList/versionsCalendar'),
         meta: { title: '版本日历' }
       },
+      {
+        path: 'onlineProblem',
+        name: '线上问题 ',
+        icon: 'problem',
+        cutOff: true,
+        component: () => import('@/views/projectManage/onlineproblem'),
+        meta: { title: '线上问题 ' }
+      },
       {
         path: 'useCasePage',
         name: '测试用例',
         icon: 'test-case',
         cutOff: true,
-        component: () => import('@/views/Platform/useCasePage'),
+        component: () => import('@/views/useCase'),
         meta: { title: '测试用例' }
       },
       {

+ 13 - 1
src/utils/global.js

@@ -1,5 +1,6 @@
-let timer = null
 import dayjs from 'dayjs'
+import store from '@/store'
+let timer = null
 export function debounce(func, delay) { // 防抖
   clearTimeout(timer)
   timer = setTimeout(() => {
@@ -51,3 +52,14 @@ export function formatHMS(data) {
   time = (hours < 10 ? ('0' + hours) : hours) + '小时' + (minutes < 10 ? ('0' + minutes) : minutes) + '分' + (seconds < 10 ? ('0' + seconds) : seconds) + '秒'
   return time
 }
+
+export function log({ c: master_func, d: detail_func }) {
+  const userName = localStorage.getItem('username')
+  const { bizId = null } = store.state.global || {}
+  window.log.trackEvent('phpublic_zhihui_project_management_ck', {
+    'biz_id': bizId,
+    'user': userName,
+    master_func,
+    detail_func
+  }).then((res) => console.log(res))
+}

+ 0 - 3
src/views/Platform/useCasePage.vue

@@ -213,9 +213,6 @@ export default {
     this.im_File = document.getElementById('im_File')
     this.initWindow()
   },
-  activated() {
-    this.updateCaseListData()
-  },
   methods: {
     // 左侧导航栏
     AllQueryFolderData(e) {

+ 318 - 0
src/views/projectManage/onlineproblem/component/header.vue

@@ -0,0 +1,318 @@
+<template>
+  <div class="Parent1" style="background-color:#F2F3F6;min-height:calc(100vh - 80px);padding: 0 10px 10px 10px">
+    <div class="stylus-head">
+      <div class="stylus-title">
+        <div>
+          <span style="font-size: 22px;letter-spacing: 1px;font-weight: 600;color: #333B4A;padding-left: 15px">线上问题</span>
+          <div class="new-tab-open">
+            <el-switch
+              v-model="newTabOpen"
+              active-text="新标签页跳转"
+            />
+          </div>
+        </div>
+        <div>
+          <el-button type="primary" size="mini" @click="home_created_project">新建项目</el-button>
+        </div>
+      </div>
+      <el-divider style="color: #EEF0F5;" />
+      <div class="Layout" style="padding-top: 5px;">
+        <div>
+          <el-form :model="form_all" class="Layout">
+            <div class="Layout" style="padding-left: 15px">
+              <div class="queryName">项目名称</div>
+              <el-input v-model="form_all.name" size="small" clearable style="width:72% !important;" placeholder="请输入标题或ID" @change="query_project(form_all)" />
+            </div>
+            <div class="Layout">
+              <div class="queryName marginLeft">负责人</div>
+              <el-select
+                v-model="form_all.projectOwner"
+                filterable
+                clearable
+                remote
+                placeholder="请输入姓名或邮箱前缀"
+                :remote-method="remoteMethod"
+                :loading="loading"
+                size="small"
+                @focus="optionsClear"
+                @change="query_project(form_all)"
+              >
+                <el-option v-for="item in options" :key="item.idap" style="min-width:300px" :label="item.name" :value="test2(item, 0)">
+                  <div class="flex_start">
+                    <div class="deptName">{{ item.deptName }}</div>
+                    <div style="min-width:80px">{{ item.name }}</div>
+                    <div class="deptName">{{ item.idap }}</div>
+                  </div>
+                </el-option>
+              </el-select>
+            </div>
+            <div class="Layout">
+              <div class="queryName marginLeft">优先级</div>
+              <el-select v-model="form_all.priority" size="small" clearable filterable placeholder="请选择" @change="query_project(form_all)">
+                <el-option v-for="item in arr_priority" :key="item.value" :label="item.name" :value="item.value" />
+              </el-select>
+            </div>
+          </el-form>
+        </div>
+        <div class="screen" @click="showSelect">{{ goodName }}</div>
+      </div>
+      <div v-show="DetailedScreening" class="stylus-more">
+        <div>
+          <el-form :model="form_all" class="flex_start">
+            <div class="Layout">
+              <div class="queryName">项目类型</div>
+              <el-select v-model="form_all.bizType" size="small" clearable filterable placeholder="请选择">
+                <el-option v-for="item in arr_prjectType" :key="item.value" :label="item.name" :value="item.value" />
+              </el-select>
+            </div>
+            <div class="Layout" label="创建人">
+              <div class="queryName marginLeft">创建人</div>
+              <el-select
+                v-model="form_all.creater"
+                filterable
+                remote
+                clearable
+                placeholder="请输入姓名或邮箱前缀"
+                :remote-method="remoteMethod"
+                :loading="loading"
+                size="small"
+                @focus="optionsClear"
+              >
+                <el-option
+                  v-for="item in options"
+                  :key="item.idap"
+                  :label="item.name"
+                  :value="test2(item, 0)"
+                >
+                  <div class="flex_start">
+                    <div class="deptName">{{ item.deptName }}</div>
+                    <div style="min-width:80px">{{ item.name }}</div>
+                    <div class="deptName">{{ item.idap }}</div>
+                  </div>
+                </el-option>
+              </el-select>
+            </div>
+          </el-form>
+        </div>
+        <div align="right" style="padding-top: 1%;">
+          <el-button type="primary" size="mini" @click="query_project(form_all)">筛 选</el-button>
+          <el-button size="mini" @click="query_Reset">重 置</el-button>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+import {
+  memberQueryMemberInfoByIDAPorName
+} from '@/api/projectIndex'
+import '@/views/projectManage/publicCss/index.css'
+export default {
+  data() {
+    return {
+      newTabOpen: true,
+      form_all: {},
+      options: [],
+      goodName: '更多筛选',
+      loading: false,
+      arr_priority: [
+        { value: 0, name: 'P0' },
+        { value: 1, name: 'P1' },
+        { value: 2, name: 'P2' },
+        { value: 3, name: 'P3' }
+      ],
+      DetailedScreening: false,
+      arr_prjectType: [
+        { value: 0, name: '业务/产品' },
+        { value: 1, name: '技术优化/技术FT' },
+        { value: 2, name: '测试优化/测试FT' }
+      ]
+    }
+  },
+  methods: {
+    test2(item, e) {
+      // 获取团队人员信息
+      if (typeof this.test[item.idap] === 'undefined') {
+        item.role = e
+        this.test[item.idap] = item
+      }
+      return item.idap
+    },
+    home_created_project() {
+      this.form = {}
+      this.dialogFormVisible = true
+      this.$nextTick(() => {
+        this.$refs['form'].clearValidate()
+      })
+      this.$set(this.form, 'bizId', this.bizId)
+    },
+    remoteMethod(query) {
+      // 人员查询
+      if (query !== '') {
+        this.loading = true
+        setTimeout(() => {
+          this.loading = false
+          memberQueryMemberInfoByIDAPorName({ memberIDAP: query }).then(res => {
+            this.options = res.data
+          })
+        }, 200)
+      } else {
+        this.options = []
+      }
+    },
+    optionsClear() {
+      this.options = []
+    },
+    showSelect() {
+      this.DetailedScreening = !this.DetailedScreening
+      this.goodName === '更多筛选' ? this.goodName = '收起筛选' : this.goodName = '更多筛选'
+    },
+    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.$message({
+        message: '已重置',
+        type: 'success',
+        duration: 1000,
+        offset: 150
+      })
+      this.query_project(this.form_all)
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.stylus-head {
+  position: relative;
+}
+.new-tab-open {
+  // position: absolute;
+  display: inline-block;
+  margin-left: 10px;
+  height: 30px;
+  vertical-align: middle;
+}
+.task {
+  /deep/ .el-dialog__title {
+    line-height: 24px;
+    font-size: 18px;
+    color: #303133;
+    padding-left: 10px;
+}
+
+.blueStripe {
+  width:4px;
+  height:17px;
+  background:#409EFF;
+  border-radius:1px;
+  position: absolute;
+  top: 23px;
+  left: 20px;
+}
+}
+</style>
+
+<style scoped>
+.el-loading-mask {
+  z-index: 8;
+}
+.footer {
+  text-align: right;
+  margin: 1%;
+  background-color: #ffffff;
+  border-radius: 4px;
+}
+
+.requirement-x .el-table .cell {
+  padding: 5px 0;
+  font-size: 14px;
+  font-family: MicrosoftYaHei;
+}
+.requirement-x  .el-table .el-table__body tr:hover td { color: #409EFF; background: #EDF6FF; } /*hover时字体, 背景颜色*/
+
+.requirement_el-dropdown-menu {
+  max-height: 300px !important;
+  max-width: 200px;
+  overflow-y: auto !important;
+}
+
+.el-dropdown-menu__item:not(.is-disabled):hover {
+  background-color: #f6f7fa;
+  color: #606266;
+}
+
+.el-table .warning-row {
+  background: oldlace;
+}
+
+.drop_down {
+  font-size: 14px;
+  color: #333333;
+}
+.el-dialog__header {
+    padding: 0px 0px 0px;
+}
+.div_priority {
+  color: #ffffff;
+  width:fit-content;
+  padding: 0 12px;
+  border-radius: 4px;
+  margin-left: 4px;
+}
+ .Parent1 .el-table .cell {
+    box-sizing: border-box;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    word-break: break-all;
+    line-height: 23px;
+    padding-right: 10px;
+    margin: -6px 0 -2px 0 !important;
+}
+</style>
+
+<style lang="stylus" scoped>
+  .stylus-head >>> .el-form-item__label
+    color #333333
+    font-weight 400
+  .stylus-content >>> .el-table .el-table__body tr:hover td
+    // color #409EFF !important
+    background #EDF6FF
+  .stylus-head >>> .el-divider--horizontal
+    margin 10px 0
+  .stylus-head >>> .el-form-item
+    margin-bottom 0
+  .stylus-head
+    width 100%
+    padding 15px
+    margin-bottom: 10px
+    background-color white
+    border-radius 4px
+    .stylus-title
+      display flex
+      justify-content space-between
+      align-items center
+    .stylus-more
+      background rgba(252,252,252,1)
+      border-radius 4px
+      padding 15px
+      min-height 100px
+      margin-top 22px
+      border 1px solid rgba(238,238,238,1)
+      width 100%
+  .stylus-content
+    width 100%
+    padding 0.3% 1% 1% 1%
+    margin:0 auto
+    background-color white
+    border-radius 4px
+    min-height: calc(100vh - 142px);
+    .stylus-hover:hover
+      color #409EFF !important
+      cursor pointer
+</style>
+

+ 11 - 0
src/views/projectManage/onlineproblem/index.vue

@@ -0,0 +1,11 @@
+<template>
+  <Header />
+</template>
+<script>
+import Header from './component/header'
+export default {
+  components: {
+    Header
+  }
+}
+</script>

+ 77 - 0
src/views/useCase/components/requirementCase.vue

@@ -0,0 +1,77 @@
+<template>
+  <section v-if="bizId !== -1" v-loading="loading" class="case-main">
+    <iframe
+      id="useCaseIframe"
+      frameborder="0"
+      scrolling="no"
+      :src="src"
+    />
+  </section>
+</template>
+<script>
+import { mapGetters } from 'vuex'
+import { EncryptId } from '@/utils/crypto-js.js'
+import { getEnv } from '@/apiConfig/requestIP.js'
+
+export default {
+  data() {
+    return {
+      ifr: null,
+      srcHost: '/case/caseList/zhihui/',
+      loading: true
+    }
+  },
+  computed: {
+    ...mapGetters(['bizId']),
+    src() {
+      const bizId = EncryptId(`${this.bizId}`)
+      console.log(bizId, this.bizId)
+      const host = getEnv() === 'test' ? 'http://10.96.83.94:9000/index.html#' : 'http://agiletc.intra.xiaojukeji.com/#'
+      const src = `${host}${this.srcHost}${encodeURIComponent(bizId)}`
+      return src
+    }
+  },
+  watch: {
+    bizId: {
+      handler(newV) {
+        if (newV === -1) return
+        this.matchObj = { params: { product_id: newV }}
+      },
+      immediate: true
+    }
+  },
+  mounted() {
+    window.addEventListener('message', (e) => {
+      if (e.data === 'useCaseDone') {
+        this.loading = false
+        this.loaded()
+      }
+    }, false)
+  },
+  beforeDestroy() {
+    window.removeEventListener('message', (e) => {
+      // console.log('销毁')
+    }, false)
+  },
+  methods: {
+    loaded() {
+      const ifr = document.getElementById('useCaseIframe')
+      if (ifr) {
+        ifr.contentWindow.postMessage({ user: localStorage.getItem('username') }, '*')
+      }
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+.case-main {
+  // padding: 20px 0 20px 18px;
+  margin: 10px;
+  // border-radius: 10px;
+  overflow: scroll;
+}
+#useCaseIframe {
+  width: 100%;
+  height: 100vh;
+}
+</style>

+ 58 - 0
src/views/useCase/index.vue

@@ -0,0 +1,58 @@
+<template>
+  <section class="all-useCase">
+    <div class="control-pages">
+      <span class="control-item" :class="{'is-active':isActive === 1}" @click="isActive=1">测试用例</span>
+      <span class="control-item" :class="{'is-active':isActive === 2}" @click="isActive=2">老版用例</span>
+    </div>
+    <keep-alive>
+      <requirement-case v-if="isActive === 1" />
+      <test-use-case v-if="isActive === 2" />
+    </keep-alive>
+  </section>
+</template>
+<script>
+import requirementCase from '@/views/useCase/components/requirementCase'
+import testUseCase from '@/views/Platform/useCasePage'
+export default {
+  components: {
+    requirementCase,
+    testUseCase
+  },
+  data() {
+    return {
+      isActive: 1
+    }
+  },
+  watch: {
+    isActive: {
+      handler(newV) {
+        newV > 0
+          ? this.$router.replace({ path: this.$route.path, query: { ...this.$route.query, page: newV }})
+          : this.$router.replace({ path: this.$route.path, query: { ...this.$route.query, page: 1 }})
+      }
+    }
+  },
+  created() {
+    this.$nextTick(() => {
+      this.isActive = this.$route.query.page ? Number(this.$route.query.page) : 1
+    })
+  }
+}
+</script>
+<style scoped lang="scss">
+.control-pages {
+  margin: 10px 10px 0 10px;
+  padding: 10px 20px 10px 20px;
+  border-radius: 4px;
+  background-color: #ffffff;
+  .control-item {
+    margin-right: 30px;
+    padding-bottom: 10px;
+    cursor: pointer;
+  }
+  .is-active {
+    color:#4099ff;
+    border-bottom: 1px solid #4099ff;
+  }
+}
+</style>

+ 4 - 1
src/views/workbench/components/statisticsSection.vue

@@ -34,7 +34,7 @@
               </el-tooltip>
             </el-radio-button>
           </el-radio-group>
-          <h3 @click="getAll()">总数:<span>{{ totalTask }}</span></h3>
+          <h3 class="mt5" @click="getAll()">总数:<span>{{ totalTask }}</span></h3>
           <div class="chart-contain">
             <status-stay-chart :chart-data="echartsOption" @onClick="chartChange" />
             <!-- <normal-echart v-if="echartsOption" :chart-id="type+title" :option="echartsOption" @onClick="chartChange" /> -->
@@ -319,6 +319,9 @@ export default {
   }
 }
 .statistics-chart {
+  .mt5 {
+    margin-top: 5px;
+  }
   .two-title {
     width: 100%;
     display: grid;