魏志佳 пре 4 година
родитељ
комит
cadf83603d
6 измењених фајлова са 247 додато и 43 уклоњено
  1. BIN
      dist.zip
  2. 2 3
      src/views/MyConcerns.vue
  3. 12 5
      src/views/OKRList.vue
  4. 229 32
      src/views/OKRpage.vue
  5. 2 1
      src/views/myDepart.vue
  6. 2 2
      vue.config.js

+ 2 - 3
src/views/MyConcerns.vue

@@ -168,11 +168,10 @@
                                         <span class="KR-tip">KR</span>
                                         <el-popover
                                             placement="top-start"
-                                            
-                                            
                                             width="300"
                                             trigger="hover"
-                                            :content="'KR:'+ele.krInfo">  
+                                            :title="'KR:'+ele.krInfo"
+                                            :content="'详细描述:'+(ele.krDesc|| '暂无')" >  
                                             
                                             <span slot="reference" class="content">
                                                 <span class="KR-content">{{ele.krInfo}}

+ 12 - 5
src/views/OKRList.vue

@@ -182,11 +182,11 @@
                                         <span class="KR-tip">KR</span>
                                         <el-popover
                                             placement="top-start"
-                                            
-                                            
                                             width="300"
                                             trigger="hover"
-                                            :content="'KR:'+ele.krInfo">  
+                                            :title="'KR:'+ele.krInfo"
+                                            :content="'详细描述:'+ (ele.krDesc|| '暂无')"         
+                                            >  
                                             
                                             <span slot="reference" class="content">
                                                 <span class="KR-content">{{ele.krInfo}}
@@ -197,7 +197,7 @@
                                         <!-- <span class="KR-content">{{ele.krInfo}}</span> -->
                                         <span class="KR-opt"> 
                                             <span style="width:90%;">
-                                                <el-progress :percentage="ele.completion"  color='#cc9966'></el-progress>
+                                                <el-progress :percentage="ele.completion"  :color="itemColor"></el-progress>
                                             </span>                                
                                             
                                         </span>
@@ -302,7 +302,7 @@ export default {
             list:[],
             currentData:{
                 object:{},
-                krLiat:[]
+                krList:[]
             },
 
 
@@ -321,6 +321,13 @@ export default {
                 {color: '#5cb87a', percentage: 80},
                 {color: '#5cb87a', percentage: 100}
             ],
+            itemColor: [
+                {color: '#f56c6c', percentage: 30},
+                {color: '#e6a23c', percentage: 60},
+                {color: '#cc9966', percentage: 90},
+                {color: '#cc9966', percentage: 100},
+                {color: '#5cb87a', percentage: 100}
+            ],
             
             // 滚动加载更多
             loadingMore: true,//是否还有数据允许加载 

+ 229 - 32
src/views/OKRpage.vue

@@ -2,7 +2,28 @@
   <div class="okrPage" v-loading='loading'>
     <div class="topBox"></div>
     <div class="title">
-      <p>{{time.year}}年第{{time.quarter}}季度OKR</p>
+      <!-- <p>{{time.year}}年第{{time.quarter}}季度OKR</p> -->
+      <el-select v-model="yearValue"  placeholder="年份" @change="yearChange"  style="width:80px"  >
+          <el-option
+          v-for="item in yearsOptions"
+          :key="item.value"
+          :label="item.label"
+          :value="item.value"        
+          >
+          </el-option>
+      </el-select>
+      <span>年</span>
+      <el-select v-model="cycleValue"  placeholder="季度" @change="cycleChange">
+        <el-option
+        v-for="item in cycleOptions"
+        :key="item.value"
+        :label="item.label"
+        :value="item.value"   
+                           
+        >
+        </el-option>
+      </el-select>
+      
     </div>
     <div class="synchronization">
       <!-- <el-button type="warning" icon="el-icon-share" circle></el-button> -->
@@ -64,7 +85,7 @@
       <div class="okrBox first">
         <div class="okrBox-title">
           <p class="top-title">本周工作</p>
-          <el-button type="text" class="createTask" @click="createTask(1)">
+          <el-button type="text" class="createTask" @click="createTask(1)" :disabled='(time.year!=time.currentYear)||(time.quarter!=time.currentQuarter)'>
             <i class="el-icon-plus"></i>新建任务
           </el-button>
         </div>
@@ -76,6 +97,7 @@
                 :title="'标题:'+item.taskTitle"
                 width="300"
                 trigger="hover"
+                
                 :content="'详细描述:'+item.taskInfo"
               >
                 <span slot="reference" class="content">
@@ -111,7 +133,7 @@
                   </span>
                 </span>
               </el-popover>
-              <div class="list-opt">
+              <div class="list-opt" v-show="(time.year==time.currentYear)&&(time.quarter==time.currentQuarter)">
                 <!-- <el-progress :percentage="30"  ></el-progress> -->
                 <!-- <div style="width:30%">
                                     <el-progress :percentage="50" color='#cc9966'></el-progress>
@@ -147,7 +169,7 @@
       <div class="okrBox second">
         <div class="okrBox-title">
           <p class="top-title">OKR</p>
-          <el-button type="text" @click="openCreateKR" class="createTask">
+          <el-button type="text" @click="openCreateKR" class="createTask" :disabled='(time.year!=time.currentYear)||(time.quarter!=time.currentQuarter)'>
             <i class="el-icon-plus"></i>新建KR
           </el-button>
         </div>
@@ -157,7 +179,7 @@
             <span class="O-content" @click="changeObject(item.objectInfo)">
               {{item.objectInfo.objectInfo}}
               <!-- <el-button type="warning" icon="el-icon-edit" size='mini' circle></el-button> -->
-              <span class="edit">
+              <span class="edit" v-show="(time.year==time.currentYear)&&(time.quarter==time.currentQuarter)">
                 <i class="el-icon-edit"></i>
               </span>
             </span>
@@ -180,7 +202,8 @@
                   placement="top-start"
                   width="300"
                   trigger="hover"
-                  :content="'KR:'+ele.krInfo"
+                  :title="'KR:'+ele.krInfo"
+                  :content="'详细描述:'+(ele.krDesc|| '暂无')"                 
                 >
                   <span slot="reference" class="content">
                     <span class="KR-content">
@@ -197,7 +220,7 @@
 
                 <span class="KR-opt">
                   <span style="width:50%">
-                    <el-progress :percentage="ele.completion" color="#cc9966"></el-progress>
+                    <el-progress :percentage="ele.completion" :color="itemColor"></el-progress>
                   </span>
                   <el-button
                     type="warning"
@@ -206,6 +229,7 @@
                     circle
                     @click="editKR(ele)"
                     style="margin-right:5px"
+                    v-show="(time.year==time.currentYear)&&(time.quarter==time.currentQuarter)"
                   ></el-button>
                   <el-popconfirm
                     icon="el-icon-info"
@@ -220,6 +244,7 @@
                       icon="el-icon-delete"
                       size="mini"
                       circle
+                      v-show="(time.year==time.currentYear)&&(time.quarter==time.currentQuarter)"
                     ></el-button>
                   </el-popconfirm>
                 </span>
@@ -231,7 +256,7 @@
       <div class="okrBox third">
         <div class="okrBox-title">
           <p class="top-title">未来四周计划</p>
-          <el-button type="text" class="createTask" @click="createTask(2)">
+          <el-button type="text" class="createTask" @click="createTask(2)" :disabled='(time.year!=time.currentYear)||(time.quarter!=time.currentQuarter)'>
             <i class="el-icon-plus"></i>新建任务
           </el-button>
         </div>
@@ -277,7 +302,7 @@
                   </span>
                 </span>
               </el-popover>
-              <div class="list-opt">
+              <div class="list-opt" v-show="(time.year==time.currentYear)&&(time.quarter==time.currentQuarter)">
                 <!-- <el-progress :percentage="30"  ></el-progress> -->
                 <!-- <div style="width:30%">
                                     <el-progress :percentage="50" color='#cc9966'></el-progress>
@@ -313,7 +338,7 @@
       <div class="okrBox four">
         <div class="okrBox-title">
           <p class="top-title">状态指标</p>
-          <el-button type="text" class="createTask" @click="createStatus">
+          <el-button type="text" class="createTask" @click="createStatus" :disabled='(time.year!=time.currentYear)||(time.quarter!=time.currentQuarter)'>
             <i class="el-icon-plus"></i>新建状态指标
           </el-button>
         </div>
@@ -329,8 +354,9 @@
       </div>
     </div>
     <div class="okrBody noOkr" v-else>
-      <p class="noObject">请先制定目标,才能进行okr工作板管理</p>
-      <p>
+        <!-- {{time}} -->
+      <p class="noObject">{{time.quarter==time.currentQuarter&&time.year==time.currentYear?'请先制定目标,才能进行okr工作板管理':'该季度暂无OKR,换个季度试试吧'}}</p>
+      <p v-show="time.quarter==time.currentQuarter&&time.year==time.currentYear">
         <el-button type="text" style="font-size:20px" @click="createO">立即创建</el-button>
       </p>
       <!-- <el-button type="primary" icon="el-icon-edit" circle></el-button> -->
@@ -716,7 +742,7 @@
                   <el-input
                     type="textarea"
                     placeholder="您可对KR做进一步详细描述"
-                    v-model="krDesc"
+                    v-model="KRDesc"
                     maxlength="100"
                     show-word-limit
                     clearable
@@ -849,11 +875,36 @@ import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import { postAction, getAction } from "@/utils/api/http.js";
 // const SHOW_PARENT = TreeSelect.SHOW_PARENT;
-
+let cycleOptions=[
+    // {
+    //     label:'全部',
+    //     value:0
+    // },
+    {
+        label:'第一季度',
+        value:1
+    },
+    {
+        label:'第二季度',
+        value:2
+    },
+    {
+        label:'第三季度',
+        value:3
+    },
+    {
+        label:'第四季度',
+        value:4
+    },
+]
 export default {
   components: { Treeselect },
   data() {
     return {
+      yearValue:undefined,
+      cycleValue:undefined,
+      yearsOptions:[],
+      cycleOptions,
        clearOnSelect: true,
       loading:false,
       options: [],
@@ -905,7 +956,7 @@ export default {
       KRName: "",
       KRProgress: 0,
       KRId: 0,
-      krDesc:'',
+      KRDesc:'',
 
       percentage: 0,
       colors: [
@@ -914,7 +965,13 @@ export default {
         { color: "#5cb87a", percentage: 80 },
         { color: "#5cb87a", percentage: 100 },
       ],
-
+      itemColor: [
+          {color: '#f56c6c', percentage: 30},
+          {color: '#e6a23c', percentage: 60},
+          {color: '#cc9966', percentage: 90},
+          {color: '#cc9966', percentage: 100},
+          {color: '#5cb87a', percentage: 100}
+      ],
       targetName: "", //目标的名字
       targetNameOk: false,
       KRList: [],
@@ -925,6 +982,9 @@ export default {
       ObjectProgress: 0,
       currentObjId: 0,
       ObejectVisible: false,
+
+      currentKRitem:{},
+      currentTaskitem:{},
     };
   },
   watch: {
@@ -942,6 +1002,21 @@ export default {
             });
           });
         }
+        if(this.currentTaskitem.id){
+            if(this.currentTaskitem.permission==3){
+              if (this.currentTaskitem.remindVOS) {
+                this.taskTag = [];
+                this.currentTaskitem.remindVOS.forEach((item) => {
+                  this.taskTag.push({
+                    id: item.remindId,
+                    label:item.name,
+                  });
+                });
+              }
+
+            }
+        }
+
       },
     },
     KRvisiblePerson: {
@@ -957,6 +1032,21 @@ export default {
             });
           });
         }
+        if(this.currentKRitem.id){
+            if(this.currentKRitem.permission==3){
+            
+            if (this.currentKRitem.remindVOS) {
+              this.KRTag = [];
+              this.currentKRitem.remindVOS.forEach((ele) => {
+                this.KRTag.push({
+                  id: ele.remindId,
+                  label:ele.name,
+                });
+              });
+            }
+
+          }
+        }
       },
     },
   },
@@ -1183,11 +1273,14 @@ export default {
       this.ObjectNameOk = this.ObjectName ? false : true;
     },
     changeObject(item) {
+
       // console.log(item)
-      this.ObjectName = item.objectInfo;
-      this.ObjectProgress = item.completion;
-      this.currentObjId = item.id;
-      this.ObejectVisible = true;
+      if(this.time.year==this.time.currentYear&&this.time.quarter==this.time.currentQuarter){
+        this.ObjectName = item.objectInfo;
+        this.ObjectProgress = item.completion;
+        this.currentObjId = item.id;
+        this.ObejectVisible = true;
+      }
     },
     editObjectComplete() {
       this.checkedObjectName();
@@ -1292,6 +1385,7 @@ export default {
 
     // 编辑任务
     editTask(val) {
+      this.currentTaskitem=val;
       console.log(val);
       this.taskTitle = "修改任务";
 
@@ -1317,6 +1411,10 @@ export default {
         });
       }
 
+      this.$nextTick(()=>{
+        this.currentTaskitem={}
+      })
+      
       // this.taskProgress=0;
       this.taskVisible = true;
     },
@@ -1367,11 +1465,14 @@ export default {
     },
     editSatus(item) {
       // console.log(item);
-      this.statusTitle = "修改状态指标";
-      this.statusName = item.content;
-      this.statusType = item.type;
-      this.statusId = item.id;
-      this.statusVisible = true;
+      if(this.time.year==this.time.currentYear&&this.time.quarter==this.time.currentQuarter){
+        this.statusTitle = "修改状态指标";
+        this.statusName = item.content;
+        this.statusType = item.type;
+        this.statusId = item.id;
+        this.statusVisible = true;
+      }
+      
     },
     // 创建状态指标提交
     statusOk() {
@@ -1471,7 +1572,7 @@ export default {
       this.KRPower = "1"; //kr的权限
       this.KRremindValue = []; //kr的提醒人
       this.KRvisiblePerson = []; //kr的可见人
-      this.krDesc='';
+      this.KRDesc='';
     },
     checkKRName() {
       this.KRNameOk = this.KRName ? false : true;
@@ -1489,6 +1590,7 @@ export default {
           krInfo: {
             completion: this.KRProgress,
             krInfo: this.KRName,
+            krDesc:this.KRDesc,
             objectId: this.okrObject.id,
             permission: this.KRPower,
             publicIds: this.KRvisiblePerson,
@@ -1505,9 +1607,10 @@ export default {
     },
     editKR(item) {
       console.log(item);
+      this.currentKRitem=item
       this.KRTitle = "修改KR";
       this.KRName = item.krInfo;
-      this.krDesc= item.krDesc
+      this.KRDesc= item.krDesc
       this.KRId = item.id;
       this.KRVisible = true;
       this.KRProgress = item.completion;
@@ -1528,6 +1631,9 @@ export default {
           this.KRvisiblePerson.push(ele.publicId);
         });
       }
+      this.$nextTick(()=>{
+        this.currentKRitem={}
+      })
     },
     editKROk() {
       this.checkKRName();
@@ -1546,7 +1652,7 @@ export default {
             permission: this.KRPower,
             publicIds: this.KRvisiblePerson,
             remindIds: this.KRremindValue,
-            krDesc:this.krDesc,
+            krDesc:this.KRDesc,
           },
         }).then((res) => {
           // console.log(res)
@@ -1557,11 +1663,29 @@ export default {
         });
       }
     },
-
+    yearChange(key){        
+      this.getOkrPageList()
+    },
+    cycleChange(key){
+        
+        if(this.yearValue=='' || this.yearValue==undefined){
+            this.$message({
+                type:'warning',
+                message:'记得先选择年份哟~'
+            });
+            this.cycleValue=undefined
+        }else{
+            this.getOkrPageList()
+        }
+        
+    },
     // 获取页面展示的list
     getOkrPageList() {
       this.loading=true;
-      postAction("/okr/okr/detail", {}).then((res) => {
+      postAction("/okr/okr/detail", {
+        year:this.yearValue,
+        quarter:this.cycleValue
+      }).then((res) => {
         // console.log(res);
         this.loading=false;
         if (res.success) {
@@ -1582,6 +1706,18 @@ export default {
             });
             this.status = res.result.status;
             this.okrObject = res.result.okr[0].objectInfo;
+
+            this.yearValue=res.result.time.year;
+            this.cycleValue=res.result.time.quarter;
+          }else{
+            this.okr={};
+            this.taskInfoList = {};
+            this.taskFourWeek = {};
+
+            this.time = res.result.time;
+            
+            this.status = {}
+            this.okrObject = {}
           }
         }
       });
@@ -1614,6 +1750,17 @@ export default {
     //请求list
     this.getOkrPageList();
     this.getPeople();
+    postAction('/okr/okr/getObjectYear ',{           
+        }).then((res)=>{
+            // console.log(res);
+            this.yearsOptions=[]
+            res.result.forEach((item)=>{
+                this.yearsOptions.push({
+                    label: `${item}`,
+                    value:item
+                })
+            })
+        })
   },
 };
 </script>
@@ -1672,9 +1819,9 @@ li {
   }
   .title {
     height: 7%;
-    margin-top: -61px;
+    margin-top: -50px;
     padding: 20px 0;
-    margin-bottom: 20px;
+    margin-bottom: 9px;
     color: #fff;
     box-sizing: border-box;
   }
@@ -2212,6 +2359,56 @@ li {
 }
 </style>
 <style lang="less">
+.el-select-dropdown__item {
+    font-size: 14px;
+    padding: 0 20px;
+    position: relative;
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    color: #606266;
+    height: 34px;
+    line-height: 34px;
+    box-sizing: border-box;
+    cursor: pointer;
+    text-align: center;
+  }
+  .el-select-dropdown{
+    position: absolute;
+    top: 88px;
+    // left: 1082px !important;
+  }
+.okrPage{
+  .title{
+
+  .el-input__inner {
+    -webkit-appearance: none;
+    background-color: transparent;
+    background-image: none;
+    border-radius: 4px;
+    border: none;
+    box-sizing: border-box;
+    color: #fff;
+    display: inline-block;
+    font-size: 16px;
+    height: 40px;
+    line-height: 40px;
+    outline: 0;
+    padding: 0 15px;
+    transition: border-color .2s cubic-bezier(.645,.045,.355,1);
+    width: 110px;
+    // text-align: center;
+  }
+  .el-select .el-input .el-select__caret {
+    color: #fff;
+    font-size: 14px;
+    transition: transform .3s;
+    transform: rotateZ( 180deg);
+    cursor: pointer;
+  }
+      
+  }
+}
 .openTargetBox {
   .el-button--text {
     color: #cc9966;

+ 2 - 1
src/views/myDepart.vue

@@ -172,7 +172,8 @@
                                             
                                             width="300"
                                             trigger="hover"
-                                            :content="'KR:'+ele.krInfo">  
+                                            :title="'KR:'+ele.krInfo"
+                                              :content="'详细描述:'+(ele.krDesc|| '暂无')" >  
                                             
                                             <span slot="reference" class="content">
                                                 <span class="KR-content">{{ele.krInfo}}

+ 2 - 2
vue.config.js

@@ -3,8 +3,8 @@ module.exports = {
         port: 3001,
         proxy: {
             "/api": {
-                // target: 'http://192.168.1.72:8910', // 要访问的接口域名
-                target: 'http://okrapi.c-top.com.cn', // 要访问的接口域名
+                target: 'http://192.168.1.188:8910', // 要访问的接口域名
+                // target: 'http://okrapi.c-top.com.cn', // 要访问的接口域名
                 ws: true, // 是否启用websockets
                 changeOrigin: true, //开启代理:在本地会创建一个虚拟服务端,然后发送请求的数据,并同时接收请求的数据,这样服务端和服务端进行数据的交互就不会有跨域问题
                 pathRewrite: {