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()