ソースを参照

Merge branch 'http_test' into http_mock

qinzhipeng_v@didiglobal.com 4 年 前
コミット
2a36dd8bae

+ 17 - 1
src/api/workSchedule.js

@@ -1,6 +1,6 @@
 // 个人工作台和团队工作台
 import request from '@/utils/request'
-import { TeamManagement } from '@/apiConfig/api'
+import { TeamManagement, teamWorkbenchUrl } from '@/apiConfig/api'
 
 // 获取用户团队列表
 export function queryTeamInfoList(data) {
@@ -278,3 +278,19 @@ export function settingGetCalendar() {
     method: 'get'
   })
 }
+
+// 获取用户信息
+export function getStaffByUsername(name) {
+  return request({
+    url: teamWorkbenchUrl + `/api/staff/getStaffByUsername?username=${name}`,
+    method: 'get'
+  })
+}
+
+// 获取部门下子部门
+export function getSubDeptInfoByParentDeptId(id) {
+  return request({
+    url: teamWorkbenchUrl + `/api/department/getSubDeptInfoByParentDeptId?deptId=${id}`,
+    method: 'get'
+  })
+}

+ 2 - 0
src/apiConfig/api.js

@@ -17,6 +17,8 @@ export const vehicleUrl_online = 'http://10.190.9.230:9999' // 虚拟硬件 zhih
 
 export const projectManagementUrl = requestIp + '/project-management' //项目管理
 
+export const teamWorkbenchUrl = requestIp + '/ldap-server' // 团队工作台
+
 export const ldapServer = requestIp + '/ldap-server' //邮箱查询
 
 export const TeamManagement = projectManagementUrl // 团队配置 项目

+ 3 - 1
src/apiConfig/requestIP.js

@@ -13,9 +13,11 @@ if (location.host.indexOf('localhost') < 0) {
   logoutUrl = host + '/sso/logout?jumpto=' + location.href
   if (host.indexOf('zhihui-pre.intra.xiaojukeji.com') >= 0) {
     envTag = 'pre'
+    envUrl = 'http://zhihui-pre.intra.xiaojukeji.com/zhihui_env/'
+    toolsUrl = 'http://zhihui-pre.intra.xiaojukeji.com/tools/'
   } else if (host.indexOf('zhihui.xiaojukeji.com') >= 0) {
     envTag = 'online'
-    envUrl = 'http://zhihui-env.intra.xiaojukeji.com/#/env'
+    envUrl = 'http://zhihui.xiaojukeji.com/zhihui_env/'
     toolsUrl = 'http://zhihui.xiaojukeji.com/tools/'
   }
 }

+ 55 - 0
src/views/workbench/team/index.vue

@@ -3,6 +3,8 @@
     <!-- 顶部导航栏 -->
     <el-header class="main-header">
       <div class="select-group">
+        <!-- <el-cascader ref="cascader" v-model="teamDepartment" :props="departmentOption" :show-all-levels="false" class="cascader" @change="departmentChange(teamDepartment)" />
+        <span class="el-dropdown-link" style="margin-right: 20px;" @click="setCascader">{{ teamBizName.length > 11 ? teamBizName.substring(0, 11) + '...' : teamBizName }} <i class="el-icon-arrow-down" /></span> -->
         <el-cascader ref="cascader" v-model="teamNames" collapse-tags :options="options" :props="props" class="cascader" @change="handleChange(teamNames, options)" />
         <span class="el-dropdown-link" style="margin-right: 20px;" @click="setCascader">{{ teamBizName.length > 11 ? teamBizName.substring(0, 11) + '...' : teamBizName }} <i class="el-icon-arrow-down" /></span>
         <el-cascader ref="cascader" v-model="bizIdCode" collapse-tags :options="searchEnum.businesslines" :props="propsBizId" class="cascader" @change="handleBizIdChange(bizIdCode, searchEnum.businesslines)" />
@@ -207,6 +209,8 @@ import {
   getTeamBugDisDataBy,
   teamReminding,
   settingQueryBizAndTeamInfo
+  // getStaffByUsername,
+  // getSubDeptInfoByParentDeptId
 } from '@/api/workSchedule'
 import { getSeprateDayInfo, scheduleDelete } from '@/api/projectViewDetails'
 import modifySchedule from '@/views/projectManage/projectList/components/modifySchedule'
@@ -264,6 +268,13 @@ export default {
       dialog_team_visible: false, // 删除日程弹窗
       // teamName: '团队', // 团队名字
       teamNames: [],
+      teamDepartment: [], // 部门
+      // departmentOption: {
+      //   checkStrictly: true,
+      //   lazy: true,
+      //   lazyLoad: this.lazyLoad
+      // }, // 部门props
+      departmentData: [],
       bizIdCode: [-1],
       teamBizName: '团队',
       bizName: '业务线', // 业务线名字
@@ -306,6 +317,7 @@ export default {
         task: false,
         bug: false
       },
+      // deptCode1: '',
       idList: {// 所选项的idList
         requireList: [],
         taskList: [],
@@ -336,6 +348,7 @@ export default {
   },
   created() {
     this.settingGetBizList()
+    // this.getStaffByUsername()
     this.$nextTick(() => {
       this.activeName = this.$route.query.page ? this.$route.query.page : '1'
     })
@@ -348,6 +361,48 @@ export default {
     setCascader() {
       this.$refs.cascader.$el.click()
     },
+    // getStaffByUsername() {
+    //   getStaffByUsername('qinzhipeng_v').then(res => {
+    //     if (res.code === 200) {
+    //       this.deptCode1 = res.data.deptCode1
+    //     }
+    //   })
+    // },
+    // lazyLoad(node, resolve) {
+    //   setTimeout(() => {
+    //     this.getProvence(node, resolve)
+    //   }, 1000)
+    // },
+    // test
+    // getProvence(node, resolve) {
+    //   console.log(node, resolve, 'cdscds')
+    //   console.log(this.deptCode1, 'cdslfkmvdfklvcds')
+    //   getSubDeptInfoByParentDeptId(this.deptCode1).then(e => {
+    //     console.log(e.data, '你的技术')
+    //     // if (Array.isArray(e.data)) {
+    //     // const data =
+    //     // const nodes = null
+    //     // if() {
+    //     // nodes = [{ label: '城市运输与服务技术部', leaf: false, value: res.data.deptCode1 }]
+    //     // }else {
+    //     // nodes = e.data.map(item => ({
+    //     //   value: item.deptId,
+    //     //   label: item.deptName,
+    //     //   leaf: node.level >= 5 // 5层级
+    //     // }))
+    //     // }
+    //     const nodes = e.data.map(item => ({
+    //       value: item.deptId,
+    //       label: item.deptName,
+    //       leaf: node.level >= 5 // 5层级
+    //     }))
+    //     resolve(nodes)
+    //   // }
+    //   })
+    // },
+    // departmentChange(name) {
+    //   console.log(name, 'vdvsdvsd')
+    // },
     handleBizIdChange(val, option) {
       if (val.length > 0) {
         const one = val[0]