From 69a74309ed12cc13f0fa9fb90c5bffad17ade360 Mon Sep 17 00:00:00 2001 From: wjt <1797368093@qq.com> Date: 星期四, 27 六月 2024 13:34:56 +0800 Subject: [PATCH] 问题修改 --- policy/policyApply/perPage.vue | 88 +++++++++++++++++++++++++++++++++---------- 1 files changed, 67 insertions(+), 21 deletions(-) diff --git a/policy/policyApply/perPage.vue b/policy/policyApply/perPage.vue index e9f7cca..4f3479b 100644 --- a/policy/policyApply/perPage.vue +++ b/policy/policyApply/perPage.vue @@ -2,12 +2,21 @@ <u-popup mode="button" :safeAreaInsetBottom="false" :show="show" @close="close" @open="open" z-index="8000" bgColor="#fff"> <view class="bg-box"> <view class="title">閫夋嫨闅忚浜哄憳</view> - <scroll-view scroll-y="true" style="height: 600rpx;"> - <u-checkbox-group iconPlacement="right" v-model="checkboxValue1" placement="column" @change="checkboxChange"> - <u-checkbox :customStyle="{marginBottom: '40rpx', }" v-for="(item, index) in checkboxList1" :key="index" - :name="item.userId" :label="`${item.dept.deptName}--${item.nickName}`"> - </u-checkbox> - </u-checkbox-group> + <u-search v-model="nickName" @search="enforceList" @clear="clearContent" @confirm="enforceList" @custom="enforceList()"></u-search> + <scroll-view scroll-y="true" style="height: 600rpx;margin-top: 20rpx;"> + <view v-if="checkboxList1.length"> + <u-checkbox-group iconPlacement="right" v-model="checkboxValue1" placement="column" @change="checkboxChange"> + <u-checkbox :customStyle="{marginBottom: '40rpx', }" v-for="(item, index) in checkboxList1" :key="index" + :name="item.userId" :label="`${item.dept.deptName}--${item.nickName}`"> + </u-checkbox> + </u-checkbox-group> + </view> + <view class="set-color" v-else> + <view class="set-center"> + <u-icon name="file-text" size="30" color="gray"></u-icon> + <view style="width: 100%;margin-top: 20rpx;">鏆傛棤鏁版嵁</view> + </view> + </view> </scroll-view> <view class="set-flex set-flex-content-between down-options"> <view class="button-per"> @@ -22,13 +31,14 @@ </template> <script> + import { enforceList } from '@/api/policy.js' export default { - props: { - list: { - type: Array, - default: () => [] - } - }, + // props: { + // list: { + // type: Array, + // default: () => [] + // } + // }, data() { return { show: false, @@ -36,18 +46,23 @@ // 鍩烘湰妗堝垪鏁版嵁 checkboxList1: [ ], + nickName: "" } }, watch: { - list: { - handler(n) { - this.checkboxList1 = n - }, - immediate: true - } + // list: { + // handler(n) { + // this.checkboxList1 = n + // }, + // immediate: true + // } }, methods: { + clearContent() { + this.companyName = "" + this.enforceList() + }, checkboxChange(n) { // console.log('change', n); }, @@ -55,13 +70,30 @@ this.show = false }, open(list) { - this.show = true + this.enforceList() }, enteryResult() { - this.$emit('selectValue', this.checkboxValue1) + let list = [] + this.checkboxList1.forEach(item => { + if(this.checkboxValue1.includes(item.userId)) { + list.push({ + peerDeptId: item.dept.deptId, + peerDeptName: item.dept.deptName, + peerId: item.userId, + peerPhone: item.phonenumber, + peerType: 2, + peerUser: item.nickName + }) + } + }) + this.$emit('selectValue', list) this.close() - console.log(44) + }, + enforceList() { + enforceList({nickName: this.nickName}).then(val => { + this.checkboxList1 = val.data.data + }) } } } @@ -96,4 +128,18 @@ padding: 0 32rpx; left: 0; } + .set-color{ + color: gray; + text-align: center; + display: flex; + justify-content: center; + align-items: center; + height: 300rpx; + } + .set-center{ + display: flex; + justify-content: center; + align-items: center; + flex-wrap: wrap; + } </style> \ No newline at end of file -- Gitblit v1.9.1