Commit 816fd3054d4d7fbf1c43e1c584a800466e7060ea

Authored by 张红振
1 parent 3f5d5124

fix bug

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