Commit e2b70c09ba5bb4f4e21c9bf0d994d84cd7ac5dee
1 parent
07ef1fd2
fix:DEFECT-1190 修复选择几个该租户创建的公共接口,批量发布提示错误,批量删除也不成功,而且选择了数据,再恢复刷新后,批量删除和批量发布按钮还显示为红色状态
Showing
1 changed file
with
20 additions
and
11 deletions
@@ -152,7 +152,7 @@ | @@ -152,7 +152,7 @@ | ||
152 | else setStatusIsTrue(); | 152 | else setStatusIsTrue(); |
153 | }, | 153 | }, |
154 | getCheckboxProps: (record) => ({ | 154 | getCheckboxProps: (record) => ({ |
155 | - disabled: record.state === 1, | 155 | + disabled: record.creator !== userId.value || record.state === 1, |
156 | }), | 156 | }), |
157 | }; | 157 | }; |
158 | 158 | ||
@@ -174,21 +174,30 @@ | @@ -174,21 +174,30 @@ | ||
174 | }; | 174 | }; |
175 | 175 | ||
176 | const handlePublish = async (type, record) => { | 176 | const handlePublish = async (type, record) => { |
177 | - type === 'publish' ? await getPublish(record.id) : await getCancelPublish(record.id); | ||
178 | - createMessage.success(`${type === 'publish' ? '发布' : '取消发布'}成功`); | ||
179 | - handleSuccess(); | 177 | + try { |
178 | + type === 'publish' ? await getPublish(record.id) : await getCancelPublish(record.id); | ||
179 | + createMessage.success(`${type === 'publish' ? '发布' : '取消发布'}成功`); | ||
180 | + } finally { | ||
181 | + handleSuccess(); | ||
182 | + } | ||
180 | }; | 183 | }; |
181 | 184 | ||
182 | const handleBatchPublish = async (type) => { | 185 | const handleBatchPublish = async (type) => { |
183 | - await putPublishOrCancelPublish(type, batchDeleteIds.value); | ||
184 | - createMessage.success(`${type === 'batchPublish' ? '批量发布' : '批量取消发布'}成功`); | ||
185 | - handleSuccess(); | 186 | + try { |
187 | + await putPublishOrCancelPublish(type, batchDeleteIds.value); | ||
188 | + createMessage.success(`${type === 'batchPublish' ? '批量发布' : '批量取消发布'}成功`); | ||
189 | + } finally { | ||
190 | + handleSuccess(); | ||
191 | + } | ||
186 | }; | 192 | }; |
187 | 193 | ||
188 | const handleDeleteOrBatchDelete = async (record) => { | 194 | const handleDeleteOrBatchDelete = async (record) => { |
189 | - const ids = record === null ? batchDeleteIds.value : [record.id]; | ||
190 | - await deleteBigViewInterface(ids); | ||
191 | - createMessage.success(`${record === null ? '批量删除' : '删除'}成功`); | ||
192 | - handleSuccess(); | 195 | + try { |
196 | + const ids = record === null ? batchDeleteIds.value : [record.id]; | ||
197 | + await deleteBigViewInterface(ids); | ||
198 | + createMessage.success(`${record === null ? '批量删除' : '删除'}成功`); | ||
199 | + } finally { | ||
200 | + handleSuccess(); | ||
201 | + } | ||
193 | }; | 202 | }; |
194 | </script> | 203 | </script> |