From 2cc88967d4a2124ab93c33c4e1a542f802470dcc Mon Sep 17 00:00:00 2001 From: Vinjor Date: Mon, 4 Nov 2024 11:25:10 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=BB=B4=E4=BF=AE=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/projectPicker.vue | 64 +++++++++++++++++++++++++++++++----- 1 file changed, 56 insertions(+), 8 deletions(-) diff --git a/components/projectPicker.vue b/components/projectPicker.vue index c3aef62..98fd9b1 100644 --- a/components/projectPicker.vue +++ b/components/projectPicker.vue @@ -34,10 +34,14 @@ - + + + + + {{ item.name }} { - this.typeList = res.data + this.typeList = this.typeList.concat(res.data) }) }, getProject() { + if(this.typeId!=0){ + request({ + url: '/admin-api/repair/project/page', + method: 'GET', + params: { + pageNo: 1, + pageSize: 10000, + type: this.typeId + } + }).then(res => { + this.groupList = res.data.records + }) + }else{ + this.groupList = [] + } + }, + /** + * 搜搜项目名称 + */ + searchProject(){ + if(this.searchText==""){ + uni.showToast({ + icon: 'none', + title: '请输入项目名称' + }) + return + } request({ url: '/admin-api/repair/project/page', method: 'GET', params: { pageNo: 1, pageSize: 10000, - type: this.typeId + name: this.searchText } }).then(res => { this.groupList = res.data.records }) }, - confirm() { this.$emit('confirm', this.selectedProj) this.cancel() }, cancel() { this.selectedProj = [] - this.groupList = this.typeList[0].groupList + this.groupList = [] this.$refs.popup.close() } } @@ -292,8 +332,16 @@ export default { .addProj{ text-align: right; } + .search-box{ + display: flex; + align-items: center; + justify-content: center; + border-bottom: 1px solid #EEEEEE; + padding-bottom: 10rpx; + } .projItem { display: flex; + padding: 10rpx 0; align-items: center; justify-content: space-between; From 57d30b01256014ab149f6c53e8458cd40c1997e7 Mon Sep 17 00:00:00 2001 From: Vinjor Date: Mon, 4 Nov 2024 11:27:38 +0800 Subject: [PATCH 2/2] 1 --- components/projectPicker.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/projectPicker.vue b/components/projectPicker.vue index 98fd9b1..cb21bcc 100644 --- a/components/projectPicker.vue +++ b/components/projectPicker.vue @@ -163,7 +163,11 @@ export default { this.groupList = res.data.records }) }else{ - this.groupList = [] + if(this.searchText==""){ + this.groupList = [] + }else{ + this.searchProject() + } } }, /**