任务执行人添加检索功能
This commit is contained in:
@@ -185,9 +185,18 @@
|
|||||||
<text>选择执行人</text>
|
<text>选择执行人</text>
|
||||||
<text class="close-btn" @click="closeUserPopup">×</text>
|
<text class="close-btn" @click="closeUserPopup">×</text>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 新增:搜索框 -->
|
||||||
|
<view style="padding: 16rpx;">
|
||||||
|
<input
|
||||||
|
v-model="userSearchKeyword"
|
||||||
|
placeholder="请输入昵称搜索"
|
||||||
|
class="form-input"
|
||||||
|
style="width: 100%;"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
<scroll-view scroll-y class="user-list" style="height: 400rpx;">
|
<scroll-view scroll-y class="user-list" style="height: 400rpx;">
|
||||||
<view
|
<view
|
||||||
v-for="user in userList"
|
v-for="user in filteredUserList"
|
||||||
:key="user.userId"
|
:key="user.userId"
|
||||||
class="user-row"
|
class="user-row"
|
||||||
@click="toggleUser(user)"
|
@click="toggleUser(user)"
|
||||||
@@ -196,6 +205,10 @@
|
|||||||
<text>{{ user.nickName }}</text>
|
<text>{{ user.nickName }}</text>
|
||||||
<text class="user-dept">{{ user.deptName }}</text>
|
<text class="user-dept">{{ user.deptName }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 新增:无匹配提示 -->
|
||||||
|
<view v-if="filteredUserList.length === 0" style="text-align:center;color:#999;padding:20rpx;">
|
||||||
|
暂无匹配用户
|
||||||
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
<view class="popup-footer">
|
<view class="popup-footer">
|
||||||
<button type="primary" size="mini" @click="confirmUserSelect">确定</button>
|
<button type="primary" size="mini" @click="confirmUserSelect">确定</button>
|
||||||
@@ -299,11 +312,22 @@ export default {
|
|||||||
projectIndex: -1,
|
projectIndex: -1,
|
||||||
userList: [],
|
userList: [],
|
||||||
selectedUsers: [],
|
selectedUsers: [],
|
||||||
|
userSearchKeyword: '', // 新增:用户搜索关键字
|
||||||
// userPopupVisible: false, // 不再需要
|
// userPopupVisible: false, // 不再需要
|
||||||
fileList: [],
|
fileList: [],
|
||||||
uploadedFiles: []
|
uploadedFiles: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
filteredUserList() {
|
||||||
|
if (!this.userSearchKeyword.trim()) {
|
||||||
|
return this.userList;
|
||||||
|
}
|
||||||
|
return this.userList.filter(user =>
|
||||||
|
user.nickName && user.nickName.includes(this.userSearchKeyword.trim())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.initData()
|
this.initData()
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user