Commit 602fc40a224d3ec272baf1f20776b3bc0cac9989

Authored by 张红振
1 parent 9ae5a6c7

fix bug

src/views/community/housekeeper/changeAdmin.vue
... ... @@ -67,27 +67,13 @@ const emit = defineEmits<{
67 67 /**
68 68 * 表格选择回调
69 69 */
70   -// const handleSelectionChange = (val: Array) => {
71   -// console.log(val);
72   -// data.selectList = val.map((val: any) => {
73   -// return val.id;
74   -// });
75   -// };
76   -
77   -const dialogCheck = (selection, row) => {
78   - console.log(selection);
79   - multipleTableRef.value!.clearSelection();
80   - if (selection.length === 0) {
81   - // 判断selection是否有值存在
82   - return;
83   - }
84   - if (row) {
85   - console.log(row);
86   - data.selectList.splice(0, 1, row);
87   - console.log(data.selectList);
88   - multipleTableRef.value!.toggleRowSelection(row, true);
89   - }
  70 +const handleSelectionChange = (val: Array) => {
  71 + // console.log(val);
  72 + data.selectList = val.map((val: any) => {
  73 + return val.id;
  74 + });
90 75 };
  76 +
91 77 /**
92 78 * 数据提交
93 79 */
... ... @@ -105,7 +91,7 @@ const submit = () => {
105 91 .then(() => {
106 92 addOrUpBuildingHouseKeeper({
107 93 buildingId: props.buildingId,
108   - houseKeeperIds: data.selectList[0].id,
  94 + houseKeeperIds: data.selectList[0],
109 95 originalIds: props.originalIds,
110 96 }).then((res) => {
111 97 multipleTableRef.value!.clearSelection();
... ... @@ -154,7 +140,6 @@ watchEffect(() => {
154 140 border
155 141 :data="data.tableList"
156 142 @selection-change="handleSelectionChange"
157   - @select="dialogCheck"
158 143 ref="multipleTableRef"
159 144 >
160 145 <el-table-column type="selection" width="55"/>
... ...