From fecdf722570a1e87c085152c0c56d5542fd873a6 Mon Sep 17 00:00:00 2001 From: 17031838 <1103813805@qq.com> Date: Thu, 28 May 2020 01:06:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E9=AA=8C=E5=AE=A4=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/supManager/labManage.vue | 72 +++++++++++++++---- 1 file changed, 58 insertions(+), 14 deletions(-) diff --git a/element-vue/src/components/supManager/labManage.vue b/element-vue/src/components/supManager/labManage.vue index 64eefdc..a63faa9 100644 --- a/element-vue/src/components/supManager/labManage.vue +++ b/element-vue/src/components/supManager/labManage.vue @@ -93,10 +93,10 @@ - + - + @@ -143,8 +143,63 @@ semester: 2 }, search: '', - tableData: [], + tableData: [ + { + name: "小姚", + position: "509", + software:"window", + nickname:"小姚", + tel:"123456789" + + }, + { + name: "我是", + position: "lp", + software:"window", + nickname:"小姚", + tel:"123456789" + } + + ], + currenttableData:[ + { + name: "", + position: "", + software:"", + nickname:"", + tel:"" + } + ], + } + }, + computed: { + tableDataComputed() { + + this.currenttableData=this.tableData.filter(data => !this.search + || data.name.toLowerCase().includes(this.search.toLowerCase()) + || data.position.toLowerCase().includes(this.search.toLowerCase()) + || data.software.toLowerCase().includes(this.search.toLowerCase()) + || data.nickname.toLowerCase().includes(this.search.toLowerCase()) + || data.tel.toLowerCase().includes(this.search.toLowerCase()) + + ) + if (this.currenttableData.name===null&& + this.currenttableData.position===null&& + this.currenttableData.software===null&& + this.currenttableData.nickname===null&& + this.currenttableData.tel===null) { + return null + } + else { + return this.tableData.filter(data => !this.search + || data.name.toLowerCase().includes(this.search.toLowerCase()) + || data.position.toLowerCase().includes(this.search.toLowerCase()) + || data.software.toLowerCase().includes(this.search.toLowerCase()) + || data.nickname.toLowerCase().includes(this.search.toLowerCase()) + || data.tel.toLowerCase().includes(this.search.toLowerCase())) + } } + }, methods: { async load() { @@ -252,18 +307,7 @@ } }, - computed: { - // tableDataComputed() { - // return this.tableData.filter(data => !this.search - // || data.username.toLowerCase().includes(this.search.toLowerCase()) - // || data.tel.toLowerCase().includes(this.search.toLowerCase()) - // || data.nickname.toLowerCase().includes(this.search.toLowerCase()) - // || data.office.toLowerCase().includes(this.search.toLowerCase()) - // || data.email.toLowerCase().includes(this.search.toLowerCase()) - // ) - // }, - }, async mounted() { await this.load()