瀏覽代碼

clear name and department fields on focus. production public path added to vue config

Patrick Bozic 4 年之前
父節點
當前提交
4b201e4b54

+ 4 - 1
src/components/DepartmentCollected.vue

@@ -33,7 +33,7 @@
             <b-icon icon="people-fill"></b-icon>
           </b-input-group-prepend>
 
-          <b-form-input :state="validDepartment" @input="selectDepartment" list="name" class="mr-sm-2" placeholder="请选择部门"></b-form-input>
+          <b-form-input :state="validDepartment" @focus="clearInput" @input="selectDepartment" list="name" class="mr-sm-2" placeholder="请选择部门"></b-form-input>
 
           <datalist id="name">
             <option v-for="department in departmentList" :key="department.id" :value="department.id +' - '+ department.name"></option>
@@ -177,6 +177,9 @@ export default {
       if (!item || type !== 'row') return
       if (item['消耗时间(单位:小时)'] > 12) return 'table-danger'
       if (item['消耗时间(单位:小时)'] < 8) return 'table-danger'
+    },
+    clearInput(e) {
+      e.target.value = '';
     }
   }
 }

+ 4 - 1
src/components/DepartmentDetails.vue

@@ -33,7 +33,7 @@
             <b-icon icon="people-fill"></b-icon>
           </b-input-group-prepend>
 
-          <b-form-input :state="validDepartment" @input="selectDepartment" list="name" class="mr-sm-2" placeholder="请选择部门"></b-form-input>
+          <b-form-input :state="validDepartment" @focus="clearInput" @input="selectDepartment" list="name" class="mr-sm-2" placeholder="请选择部门"></b-form-input>
 
           <datalist id="name">
             <option v-for="department in departmentList" :key="department.id" :value="department.id +' - '+ department.name"></option>
@@ -174,6 +174,9 @@ export default {
         hiddenElement.download = this.year + '-' + this.month + '-' + this.departmentName + '.csv';
         hiddenElement.click();
       }
+    },
+    clearInput(e) {
+      e.target.value = '';
     }
   }
 }

+ 4 - 1
src/components/PersonalCollected.vue

@@ -34,7 +34,7 @@
             <b-icon icon="person-square"></b-icon>
           </b-input-group-prepend>
 
-          <b-form-input :state="validUserAccount" @input="selectEmployee" list="name" class="mr-sm-2" placeholder="请输入姓名"></b-form-input>
+          <b-form-input :state="validUserAccount" @input="selectEmployee" @focus="clearInput" list="name" class="mr-sm-2" placeholder="请输入姓名"></b-form-input>
 
           <datalist id="name">
             <option v-for="employee in employeeList" :key="employee.id" :value="employee.account+' - '+employee.realname"></option>
@@ -209,6 +209,9 @@ export default {
       if (!item || type !== 'row') return
       if (item['消耗时间(单位:小时)'] > 12) return 'table-danger'
       if (item['消耗时间(单位:小时)'] < 8) return 'table-danger'
+    },
+    clearInput(e) {
+      e.target.value = '';
     }
   }
 }

+ 4 - 1
src/components/PersonalDetails.vue

@@ -34,7 +34,7 @@
             <b-icon icon="person-square"></b-icon>
           </b-input-group-prepend>
 
-          <b-form-input :state="validName" @input="selectEmployee" list="name" class="mr-sm-2" placeholder="请输入姓名"></b-form-input>
+          <b-form-input :state="validName" @focus="clearInput" @input="selectEmployee" list="name" class="mr-sm-2" placeholder="请输入姓名"></b-form-input>
 
           <datalist id="name">
             <option v-for="employee in employeeList" :key="employee.id" :value="employee.account+' - '+employee.realname"></option>
@@ -171,6 +171,9 @@ export default {
         hiddenElement.download = this.year + '-' + this.month + '-' + this.userAccount + '.csv';
         hiddenElement.click();
       }
+    },
+    clearInput(e) {
+      e.target.value = '';
     }
   }
 }

+ 5 - 0
vue.config.js

@@ -0,0 +1,5 @@
+module.exports = {
+  publicPath: process.env.NODE_ENV === 'production'
+    ? '/zentao_web/'
+    : '/'
+}