清空回收站

This commit is contained in:
pushuo 2022-08-29 20:20:16 +08:00
parent d2034636ef
commit 234ac1032a
3 changed files with 26 additions and 6 deletions

View File

@ -61,17 +61,23 @@
</div>
<div class="d-flex justify-content-between my-4">
<a href="{{ admin_route('products.create') }}">
<button class="btn btn-primary">{{ __('admin/product.products_create') }}</button>
</a>
@if ($type != 'trashed')
<a href="{{ admin_route('products.create') }}">
<button class="btn btn-primary">{{ __('admin/product.products_create') }}</button>
</a>
@else
<button class="btn btn-primary" @click="clearRestore">{{ __('admin/product.clear_restore') }}</button>
@endif
@if ($type != 'trashed')
<div class="right">
<button class="btn btn-outline-secondary" :disabled="!selected.length" @click="batchDelete">{{ __('admin/product.batch_delete') }}</button>
<button class="btn btn-outline-secondary" :disabled="!selected.length"
@click="batchActive(true)">{{ __('admin/product.batch_active') }}</button>
@click="batchActive(true)">{{ __('admin/product.batch_active') }}</button>
<button class="btn btn-outline-secondary" :disabled="!selected.length"
@click="batchActive(false)">{{ __('admin/product.batch_inactive') }}</button>
@click="batchActive(false)">{{ __('admin/product.batch_inactive') }}</button>
</div>
@endif
</div>
<template v-if="product.data.length">
@ -143,7 +149,9 @@
:total="product.total"></el-pagination>
</template>
<p v-else>无商品</p>
<p v-else>
<x-admin-no-data/>
</p>
</div>
</div>
</div>
@ -289,6 +297,16 @@
location.reload();
})
});
},
clearRestore() {
this.$confirm('确认要清空回收站吗?', '提示', {
type: 'warning'
}).then(() => {
$http.post('products/trashed/clear').then((res) => {
location.reload();
})
});
}
}
});

View File

@ -17,6 +17,7 @@ return [
'products_delete' => 'Delete',
'products_trashed' => 'Trashed',
'products_restore' => 'restore',
'clear_restore' => 'Empty Recycle Bin',
'batch_delete' => 'Batch Delete',
'batch_active' => 'Batch Active',

View File

@ -17,6 +17,7 @@ return [
'products_delete' => '删除商品',
'products_trashed' => '回收站',
'products_restore' => '恢复回收站',
'clear_restore' => '清空回收站',
'batch_delete' => '批量删除',