Quellcode durchsuchen

1.5.1上线版本

347617796@qq.com vor 4 Jahren
Ursprung
Commit
c3374625f6

+ 31 - 0
src/api/auth.js

@@ -71,5 +71,36 @@ export function setToken (token) {
      localStorage.setItem(TokenKey, token)
 }
 
+// 防抖
+export function _debounce (fn, delay=500) {
+    let timer = null
+    return function () {
+        let arg = arguments
+        clearTimeout(timer)
+        timer = setTimeout(() => {
+            fn.apply(this, arg)
+        }, delay)
+    }
+}
+// 节流
+export function _throttle(fn, interval=500) {
+  var last;
+  var timer;
+  return function() {
+    var th = this;
+    var args = arguments;
+    var now = +new Date();
+    if (last && now - last < interval) {
+      clearTimeout(timer);
+      timer = setTimeout(function() { //用户最后一次点击时间间隔小于设置时间执行
+        last = now;
+        fn.apply(th, args);
+      }, interval);
+    } else {
+      last = now;
+      fn.apply(th, args);
+    }
+  }
+}
 
 

+ 1 - 1
src/components/UserImage.vue

@@ -76,7 +76,7 @@
 		  }
 		}  
         if(!this.imgUrl&&this.id&&this.employeeMap){
-          this.imgUrl=this.employeeMap[this.id].img_url
+          this.imgUrl=this.employeeMap[this.id]? this.employeeMap[this.id].img_url:""
         }
       }
     },

+ 1 - 1
src/components/bonusPointsPopup.vue

@@ -170,7 +170,7 @@
 		    </el-table-column>
 		    <el-table-column prop="status" label="处理状态">
 		      <template slot-scope="scope">
-		        <span :style="'color:' + (scope.row.status == 0 ? '#f70000' : '#47bf47')">{{ scope.row.status == 0 ? '提交失败' : '提交成功' }}</span>
+		        <span :style="'color:' + (scope.row.status == 0 ? '#f70000' : '#47bf47')">{{ scope.row.msg}}</span>
 		      </template>
 		    </el-table-column>
 		    <el-table-column prop="remark" label="备注信息"></el-table-column>

+ 9 - 1
src/views/set/framework.vue

@@ -44,7 +44,7 @@
 					<div class="margin-bottom">
 						<el-button @click="participation()" :loading="enable_loading" size="medium" type="primary">批量启用积分管理</el-button>
 						<el-button @click="forbidden()" :loading="enable_loading" size="medium" type="danger" style="margin-right: 10px;">批量禁用积分管理</el-button>
-						<el-input placeholder="输入同事姓名" size="medium" style="width: 230px;" v-model="keywords" clearable @input="searchUser()">
+						<el-input placeholder="输入同事姓名" size="medium" style="width: 230px;" v-model="keywords" clearable>
 							<!-- <el-button slot="append" icon="el-icon-search" @click="getEmployee()"></el-button> -->
 						</el-input>
 					</div>
@@ -150,6 +150,7 @@
 
 <script>
 import noData from '@/components/noData';
+import {_debounce} from '@/api/auth';
 export default {
 	data() {
 		return {
@@ -189,6 +190,13 @@ export default {
 		noData
 	},
 	watch: {
+		keywords: {
+		  deep: true,
+		  handler: _debounce(function(val) {
+			this.page = 1;
+			this.getEmployee();
+		  })
+		},
 		dept_id(val) {
 			this.getEmployee();
 		}

+ 18 - 1
src/views/task/allTask.vue

@@ -59,7 +59,16 @@
 					</el-table-column>
 					<el-table-column label="积分" prop="base_point" sortable="custom">
 						<template slot-scope="scope">
-							<span class="red">+{{ scope.row.point_config.base_point }} {{ scope.row.pt_name }}</span>
+							<span class="red">
+								{{ scope.row.point_config.base_point }} {{ scope.row.pt_name }}
+							</span>
+							
+<!-- 							<span class="red" v-if="scope.row.point_config.review_point!=0">
+								+{{ scope.row.point_config.review_point }} {{ scope.row.pt_name }}
+							</span>
+							<span class="red" v-else>
+								+{{ scope.row.point_config.base_point }} {{ scope.row.pt_name }}
+							</span> -->
 						</template>
 					</el-table-column>
 					<el-table-column label="截止时间" prop="expire_time" sortable="custom"></el-table-column>
@@ -115,6 +124,7 @@
 import noData from '@/components/noData';
 import examinePopup from '@/components/examinePopup.vue';
 import taskDetailsPopup from '@/views/common/below/taskDetailsPopup'
+import {_debounce} from '@/api/auth';
 
 export default {
 	name: 'my_task',
@@ -155,6 +165,13 @@ export default {
 	},
 	components: { taskDetailsPopup, noData,examinePopup },
 	watch: {
+		'formData.content': {
+		  deep: true,
+		  handler: _debounce(function(val) {
+			this.formData.page = 1;
+			this.get_list();
+		  },1000)
+		},
 		'formData.pt_id'(val) {
 			this.formData.page = 1;
 			this.get_list();

+ 9 - 1
src/views/task/myExamine.vue

@@ -40,7 +40,15 @@
 					</el-table-column>
 					<el-table-column label="积分">
 						<template slot-scope="scope">
-							<span class="red">+{{ scope.row.point_config.base_point }} {{ scope.row.pt_name }}</span>
+							<span class="red">
+								{{ scope.row.point_config.base_point }} {{ scope.row.pt_name }}
+							</span>
+<!-- 							<span class="red" v-if="scope.row.point_config.review_point!=0">
+								+{{ scope.row.point_config.review_point }} {{ scope.row.pt_name }}
+							</span>
+							<span class="red" v-else>
+								+{{ scope.row.point_config.base_point }} {{ scope.row.pt_name }}
+							</span> -->
 						</template>
 					</el-table-column>
 					<el-table-column label="截止时间" prop="expire_time"></el-table-column>

+ 18 - 2
src/views/task/my_task.vue

@@ -27,7 +27,15 @@
 					</el-table-column>
 					<el-table-column label="积分">
 						<template slot-scope="scope">
-							<span class="red">+{{ scope.row.point_config.base_point }} {{ scope.row.pt_name }}</span>
+							<span class="red">
+								{{ scope.row.point_config.base_point }} {{ scope.row.pt_name }}
+							</span>
+<!-- 							<span class="red" v-if="scope.row.point_config.review_point!=0">
+								+{{ scope.row.point_config.review_point }} {{ scope.row.pt_name }}
+							</span>
+							<span class="red" v-else>
+								+{{ scope.row.point_config.base_point }} {{ scope.row.pt_name }}
+							</span> -->
 						</template>
 					</el-table-column>
 					<el-table-column label="截止时间" prop="expire_time"></el-table-column>
@@ -51,7 +59,15 @@
 					</el-table-column>
 					<el-table-column label="积分">
 						<template slot-scope="scope">
-							<span class="red">+{{ scope.row.point_config.base_point }} {{ scope.row.pt_name }}</span>
+							<span class="red" >
+								{{ scope.row.point_config.base_point }} {{ scope.row.pt_name }}
+							</span>
+<!-- 							<span class="red" v-if="scope.row.point_config.review_point!=0">
+								+{{ scope.row.point_config.review_point }} {{ scope.row.pt_name }}
+							</span>
+							<span class="red" v-else>
+								+{{ scope.row.point_config.base_point }} {{ scope.row.pt_name }}
+							</span> -->
 						</template>
 					</el-table-column>
 					<el-table-column label="截止时间" prop="expire_time"></el-table-column>