Commit 816fd3054d4d7fbf1c43e1c584a800466e7060ea

Authored by 张红振
1 parent 3f5d5124

fix bug

src/components/Pagination/index.vue
@@ -32,7 +32,7 @@ interface Props { @@ -32,7 +32,7 @@ interface Props {
32 } 32 }
33 const props = withDefaults(defineProps<Props>(), { 33 const props = withDefaults(defineProps<Props>(), {
34 total: 0, 34 total: 0,
35 - pageSizes: () => [10, 20, 50, 100], 35 + pageSizes:()=> [10, 20, 50, 100],
36 pageSize: 10, 36 pageSize: 10,
37 currentPage: 1, 37 currentPage: 1,
38 }); 38 });
@@ -43,20 +43,32 @@ const emit = defineEmits&lt;{ @@ -43,20 +43,32 @@ const emit = defineEmits&lt;{
43 (e: "update:pageSize", val); 43 (e: "update:pageSize", val);
44 }>(); 44 }>();
45 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 -}; 46 +const currentPage = computed({
  47 + get: () => props.currentPage,
  48 + set: val => {
  49 + emit("update:currentPage", val);
  50 + }
  51 +})
  52 +const pageSize = computed({
  53 + get: () => props.pageSize,
  54 + set: val => {
  55 + emit("update:pageSize", val);
  56 + }
  57 +})
  58 +// /**
  59 +// * 监听当前分页改变
  60 +// */
  61 +// const updateCurrentPage = (val) => {
  62 +// console.log(val);
  63 +// emit("update:currentPage", val);
  64 +// };
  65 +// /**
  66 +// * 监听个数改变
  67 +// */
  68 +// const updatePageSize = (val) => {
  69 +// console.log(val);
  70 +// emit("update:pageSize", val);
  71 +// };
60 72
61 /** 73 /**
62 * @method handleSizeChange 74 * @method handleSizeChange
@@ -80,13 +92,13 @@ const handleCurrentChange = (val) =&gt; { @@ -80,13 +92,13 @@ const handleCurrentChange = (val) =&gt; {
80 <div class="pagination-container"> 92 <div class="pagination-container">
81 <el-pagination 93 <el-pagination
82 v-model:currentPage="currentPage" 94 v-model:currentPage="currentPage"
83 - :page-sizes="pageSizes"  
84 v-model:pageSize="pageSize" 95 v-model:pageSize="pageSize"
  96 + :page-sizes="props.pageSizes"
85 layout="total, sizes, prev, pager, next, jumper" 97 layout="total, sizes, prev, pager, next, jumper"
86 :total="total" 98 :total="total"
87 background 99 background
88 - :onUpdate:currentPage="updateCurrentPage"  
89 - :onUpdate:pageSize="updatePageSize" 100 + :onUpdate:currentPage="currentPage"
  101 + :onUpdate:pageSize="pageSize"
90 @size-change="handleSizeChange" 102 @size-change="handleSizeChange"
91 @current-change="handleCurrentChange" 103 @current-change="handleCurrentChange"
92 > 104 >
src/views/community/housekeeper/houseDetail.vue
@@ -127,6 +127,7 @@ let submitForm = (formEl: InstanceType&lt;typeof ElForm&gt; | undefined) =&gt; { @@ -127,6 +127,7 @@ let submitForm = (formEl: InstanceType&lt;typeof ElForm&gt; | undefined) =&gt; {
127 emit('success') 127 emit('success')
128 }) 128 })
129 .catch((err) => { 129 .catch((err) => {
  130 + loading.value = false;
130 console.log(err); 131 console.log(err);
131 }); 132 });
132 } else { 133 } else {
src/views/community/housekeeper/index.vue
@@ -57,7 +57,7 @@ const search = (): void =&gt; { @@ -57,7 +57,7 @@ const search = (): void =&gt; {
57 */ 57 */
58 const edit = (row: Object) => { 58 const edit = (row: Object) => {
59 data.title = "编辑楼宇"; 59 data.title = "编辑楼宇";
60 - data.formObj = row; 60 + data.formObj = JSON.parse(JSON.stringify(row))
61 data.dialogVisible = true; 61 data.dialogVisible = true;
62 }; 62 };
63 /** 63 /**
src/views/community/residence/communityDetail.vue
@@ -85,6 +85,8 @@ let submitForm = (formEl: InstanceType&lt;typeof ElForm&gt; | undefined) =&gt; { @@ -85,6 +85,8 @@ let submitForm = (formEl: InstanceType&lt;typeof ElForm&gt; | undefined) =&gt; {
85 addOrUpdate(props.formObj).then((res) => { 85 addOrUpdate(props.formObj).then((res) => {
86 loading.value = false; 86 loading.value = false;
87 emit("success"); 87 emit("success");
  88 + }).catch((err) => {
  89 + loading.value = false;
88 }); 90 });
89 } else { 91 } else {
90 instance?.proxy?.$message.error('请完善信息')//调用 92 instance?.proxy?.$message.error('请完善信息')//调用
src/views/community/residence/index.vue
@@ -45,7 +45,7 @@ const search = (): void =&gt; { @@ -45,7 +45,7 @@ const search = (): void =&gt; {
45 */ 45 */
46 const edit = (row: Object) => { 46 const edit = (row: Object) => {
47 data.title = "编辑小区"; 47 data.title = "编辑小区";
48 - data.formObj = row; 48 + data.formObj = JSON.parse(JSON.stringify(row));
49 data.dialogVisible = true; 49 data.dialogVisible = true;
50 }; 50 };
51 /** 51 /**
src/views/housekeeper/buildinMganager/detail.vue
@@ -91,6 +91,8 @@ let submitForm = (formEl: InstanceType&lt;typeof ElForm&gt; | undefined) =&gt; { @@ -91,6 +91,8 @@ let submitForm = (formEl: InstanceType&lt;typeof ElForm&gt; | undefined) =&gt; {
91 insertOrUpdate(props.formObj).then((res) => { 91 insertOrUpdate(props.formObj).then((res) => {
92 loading.value = false; 92 loading.value = false;
93 emit("success"); 93 emit("success");
  94 + }).catch((err) => {
  95 + loading.value = false;
94 }); 96 });
95 } else { 97 } else {
96 instance?.proxy?.$message.error("请完善信息"); //调用 98 instance?.proxy?.$message.error("请完善信息"); //调用
@@ -178,7 +180,7 @@ defineExpose({ @@ -178,7 +180,7 @@ defineExpose({
178 <el-form-item label="户籍所在地:" prop="censusRegister"> 180 <el-form-item label="户籍所在地:" prop="censusRegister">
179 <el-input 181 <el-input
180 v-model="props.formObj.censusRegister" 182 v-model="props.formObj.censusRegister"
181 - placeholder="请输入车位数" 183 + placeholder="请输入户籍所在地"
182 ></el-input> 184 ></el-input>
183 </el-form-item> 185 </el-form-item>
184 <el-form-item label="出生日期:" prop="birthdate"> 186 <el-form-item label="出生日期:" prop="birthdate">
@@ -193,7 +195,7 @@ defineExpose({ @@ -193,7 +195,7 @@ defineExpose({
193 <el-form-item label="民族:" prop="nationality"> 195 <el-form-item label="民族:" prop="nationality">
194 <el-input 196 <el-input
195 v-model="props.formObj.nationality" 197 v-model="props.formObj.nationality"
196 - placeholder="请输入车位数" 198 + placeholder="请输入民族"
197 ></el-input> 199 ></el-input>
198 </el-form-item> 200 </el-form-item>
199 <el-row> 201 <el-row>
src/views/housekeeper/buildinMganager/index.vue
@@ -50,7 +50,7 @@ const search = (): void =&gt; { @@ -50,7 +50,7 @@ const search = (): void =&gt; {
50 */ 50 */
51 const edit = (row: Object) => { 51 const edit = (row: Object) => {
52 data.title = "编辑楼管"; 52 data.title = "编辑楼管";
53 - data.formObj = row; 53 + data.formObj = JSON.parse(JSON.stringify(row));
54 data.dialogVisible = true; 54 data.dialogVisible = true;
55 }; 55 };
56 /** 56 /**