Commit 3f5d51248101faaed5fdbbea5f2ed9dadfdfd706

Authored by 张红振
1 parent 5878530d

fix bug

src/components/Pagination/index.vue
... ... @@ -3,7 +3,7 @@
3 3 * 分页
4 4 * @module Pagination
5 5 */
6   -
  6 +import { computed } from "vue";
7 7 import { scrollTo } from "@/utils/scroll";
8 8  
9 9 // TIP 每个属性都必传,不带默认值
... ... @@ -37,6 +37,27 @@ const props = withDefaults(defineProps<Props>(), {
37 37 currentPage: 1,
38 38 });
39 39  
  40 +const emit = defineEmits<{
  41 + (e: "pageChange", curPage: number, curSize: number, tagName: string): void;
  42 + (e: "update:currentPage", val);
  43 + (e: "update:pageSize", val);
  44 +}>();
  45 +
  46 +/**
  47 + * 监听当前分页改变
  48 + */
  49 +const updateCurrentPage = (val) => {
  50 + console.log(val);
  51 + emit("update:currentPage", val);
  52 +};
  53 +/**
  54 + * 监听个数改变
  55 + */
  56 +const updatePageSize = (val) => {
  57 + console.log(val);
  58 + emit("update:pageSize", val);
  59 +};
  60 +
40 61 /**
41 62 * @method handleSizeChange
42 63 * @description 每页内容条数变化响应
... ... @@ -53,20 +74,19 @@ const handleCurrentChange = (val) =&gt; {
53 74 scrollTo(0, 800);
54 75 emit("pageChange", val, props.pageSize, props.tagName);
55 76 };
56   -const emit = defineEmits<{
57   - (e: "pageChange", curPage: number, curSize: number, tagName: string): void;
58   -}>();
59 77 </script>
60 78  
61 79 <template>
62 80 <div class="pagination-container">
63 81 <el-pagination
64   - v-model:current-page="currentPage"
  82 + v-model:currentPage="currentPage"
65 83 :page-sizes="pageSizes"
66   - :page-size="pageSize"
  84 + v-model:pageSize="pageSize"
67 85 layout="total, sizes, prev, pager, next, jumper"
68 86 :total="total"
69   - background
  87 + background
  88 + :onUpdate:currentPage="updateCurrentPage"
  89 + :onUpdate:pageSize="updatePageSize"
70 90 @size-change="handleSizeChange"
71 91 @current-change="handleCurrentChange"
72 92 >
... ...
src/views/community/housekeeper/changeAdmin.vue
... ... @@ -155,8 +155,8 @@ watchEffect(() =&gt; {
155 155 <Pagination
156 156 v-if="data.total > 0"
157 157 :total="data.total"
158   - :currentPage="searchData.page"
159   - :pageSize="searchData.pageSize"
  158 + v-model:currentPage="searchData.page"
  159 + v-model:pageSize="searchData.pageSize"
160 160 @pageChange="search"
161 161 ></Pagination>
162 162 </div>
... ...
src/views/community/housekeeper/index.vue
... ... @@ -112,10 +112,10 @@ const changeSuccess: void = () =&gt; {
112 112 changeObj.changeVisible = false;
113 113 search();
114 114 };
115   -const changeClose=()=>{
116   - changeObj.currBuildingId =null;
117   - changeObj.originalId =null;
118   -}
  115 +const changeClose = () => {
  116 + changeObj.currBuildingId = null;
  117 + changeObj.originalId = null;
  118 +};
119 119 /**
120 120 * 监听路由参数变换
121 121 */
... ... @@ -203,8 +203,8 @@ watchEffect(() =&gt; {
203 203 <Pagination
204 204 v-if="data.total > 0"
205 205 :total="data.total"
206   - :currentPage="searchData.page"
207   - :pageSize="searchData.pageSize"
  206 + v-model:currentPage="searchData.page"
  207 + v-model:pageSize="searchData.pageSize"
208 208 @pageChange="search"
209 209 ></Pagination>
210 210  
... ... @@ -228,10 +228,10 @@ watchEffect(() =&gt; {
228 228 v-model="changeObj.changeVisible"
229 229 title="更换楼管"
230 230 width="60%"
231   - @close="changeClose"
  231 + @close="changeClose"
232 232 >
233 233 <ChangeAdmin
234   - @success="changeSuccess"
  234 + @success="changeSuccess"
235 235 :buildingId="changeObj.currBuildingId"
236 236 :originalIds="changeObj.originalId"
237 237 ></ChangeAdmin>
... ...
src/views/community/houses/buildOwner.vue
... ... @@ -207,8 +207,8 @@ watchEffect(() =&gt; {
207 207 <Pagination
208 208 v-if="data.total > 0"
209 209 :total="data.total"
210   - :currentPage="searchData.page"
211   - :pageSize="searchData.pageSize"
  210 + v-model:currentPage="searchData.page"
  211 + v-model:pageSize="searchData.pageSize"
212 212 @pageChange="search"
213 213 ></Pagination>
214 214 </div>
... ...
src/views/community/houses/index.vue
... ... @@ -196,8 +196,8 @@ watchEffect(() =&gt; {
196 196 <Pagination
197 197 v-if="data.total > 0"
198 198 :total="data.total"
199   - :currentPage="searchData.page"
200   - :pageSize="searchData.pageSize"
  199 + v-model:currentPage="searchData.page"
  200 + v-model:pageSize="searchData.pageSize"
201 201 @pageChange="search"
202 202 ></Pagination>
203 203  
... ...
src/views/community/houses/relieve.vue
... ... @@ -137,8 +137,8 @@ watchEffect(() =&gt; {
137 137 <Pagination
138 138 v-if="data.total > 0"
139 139 :total="data.total"
140   - :currentPage="searchData.page"
141   - :pageSize="searchData.pageSize"
  140 + v-model:currentPage="searchData.page"
  141 + v-model:pageSize="searchData.pageSize"
142 142 @pageChange="search"
143 143 ></Pagination>
144 144 </div>
... ...
src/views/community/residence/index.vue
... ... @@ -144,8 +144,8 @@ onMounted(() =&gt; {
144 144 <Pagination
145 145 v-if="data.total > 0"
146 146 :total="data.total"
147   - :currentPage="searchData.page"
148   - :pageSize="searchData.pageSize"
  147 + v-model:currentPage="searchData.page"
  148 + v-model:pageSize="searchData.pageSize"
149 149 @pageChange="search"
150 150 ></Pagination>
151 151  
... ...
src/views/housekeeper/buildinMganager/index.vue
... ... @@ -156,8 +156,8 @@ onMounted(() =&gt; {
156 156 <Pagination
157 157 v-if="data.total > 0"
158 158 :total="data.total"
159   - :currentPage="searchData.page"
160   - :pageSize="searchData.pageSize"
  159 + v-model:currentPage="searchData.page"
  160 + v-model:pageSize="searchData.pageSize"
161 161 @pageChange="search"
162 162 ></Pagination>
163 163  
... ...
src/views/ownerManagement/owner/index.vue
... ... @@ -242,8 +242,8 @@ watchEffect(() =&gt; {
242 242 <Pagination
243 243 v-if="data.total > 0"
244 244 :total="data.total"
245   - :currentPage="searchData.page"
246   - :pageSize="searchData.pageSize"
  245 + v-model:currentPage="searchData.page"
  246 + v-model:pageSize="searchData.pageSize"
247 247 @pageChange="search"
248 248 ></Pagination>
249 249  
... ...
src/views/property/index.vue
... ... @@ -213,8 +213,8 @@ onMounted(() =&gt; {
213 213 </el-table>
214 214 <Pagination
215 215 :total="data.params.total"
216   - :currentPage="data.params.query.page"
217   - :pageSize="data.params.query.pageSize"
  216 + v-model:currentPage="data.params.query.page"
  217 + v-model:pageSize="data.params.query.pageSize"
218 218 @pageChange="handlePageChange"
219 219 ></Pagination>
220 220 </div>
... ...