功能:完善订单流程和加固
This commit is contained in:
@@ -125,15 +125,6 @@
|
||||
<a-button v-if="hasPermission('shop:edit')" type="link" size="small" @click="showEditModal(record)">
|
||||
编辑
|
||||
</a-button>
|
||||
<a-popconfirm
|
||||
v-if="hasPermission('shop:delete')"
|
||||
title="确定要删除这个店铺吗?"
|
||||
@confirm="handleDelete(record)"
|
||||
>
|
||||
<a-button type="link" size="small" danger>
|
||||
删除
|
||||
</a-button>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
@@ -166,7 +157,14 @@
|
||||
<div class="admin-mobile-card__actions">
|
||||
<a-button size="small" @click="showViewModal(item)">查看</a-button>
|
||||
<a-button v-if="hasPermission('shop:edit')" size="small" @click="showEditModal(item)">编辑</a-button>
|
||||
<a-button v-if="hasPermission('shop:delete')" size="small" danger @click="handleDelete(item)">删除</a-button>
|
||||
<a-button
|
||||
v-if="hasPermission('shop:edit')"
|
||||
size="small"
|
||||
:disabled="!isAdmin"
|
||||
@click="handleStatusChange(item, item.status === 0)"
|
||||
>
|
||||
{{ item.status === 0 ? '启用' : '停用' }}
|
||||
</a-button>
|
||||
</div>
|
||||
</article>
|
||||
</template>
|
||||
@@ -2103,20 +2101,6 @@ const handleModalCancel = () => {
|
||||
syncUploadedThemeBackgroundId('')
|
||||
}
|
||||
|
||||
/** handleDelete is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
|
||||
const handleDelete = async (record: Shop | Record<string, any>) => {
|
||||
try {
|
||||
await runWithGlobalLoading(async () => {
|
||||
const shopId = 'id' in record ? record.id : (record as any).id
|
||||
await adminShopApi.deleteShop(shopId)
|
||||
message.success('删除成功')
|
||||
await fetchShopList()
|
||||
})
|
||||
} catch (error) {
|
||||
message.error('删除失败')
|
||||
}
|
||||
}
|
||||
|
||||
/** handleStatusChange is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
|
||||
const handleStatusChange = async (record: Shop | Record<string, any>, enabled: boolean) => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user