pushuo 2022-08-31 18:21:46 +08:00
parent b2b985daf9
commit 49a80db477
4 changed files with 14 additions and 10 deletions

View File

@ -28,7 +28,8 @@
<td>@{{ brand.sort_order }}</td> <td>@{{ brand.sort_order }}</td>
<td>@{{ brand.first }}</td> <td>@{{ brand.first }}</td>
<td> <td>
<span :class="brand.status ? 'text-success' : 'text-secondary'">@{{ brand.status ? '启用' : '禁用' }}</span> <span class="text-success" v-if="brand.status">{{ __('common.enabled') }}</span>
<span class="text-secondary" v-else>{{ __('common.disabled') }}</span>
</td> </td>
<td> <td>
<button class="btn btn-outline-secondary btn-sm" @click="checkedCreate('edit', index)">{{ __('common.edit') }}</button> <button class="btn btn-outline-secondary btn-sm" @click="checkedCreate('edit', index)">{{ __('common.edit') }}</button>
@ -106,9 +107,9 @@
}, },
rules: { rules: {
name: [{required: true,message: '请输入名称',trigger: 'blur'}, ], name: [{required: true,message: '{{ __('common.error_required', ['name' => __('common.name')])}}',trigger: 'blur'}, ],
first: [{required: true,message: '请输入首字母',trigger: 'blur'}, ], first: [{required: true,message: '{{ __('common.error_required', ['name' => __('brand.first_letter')])}}',trigger: 'blur'}, ],
logo: [{required: true,message: '请上传图标',trigger: 'change'}, ], logo: [{required: true,message: '{{ __('admin/brand.error_upload') }}',trigger: 'change'}, ],
} }
}, },

View File

@ -13,7 +13,8 @@
<div class="custom-tree-node d-flex align-items-center justify-content-between w-100" slot-scope="{ node, data }"> <div class="custom-tree-node d-flex align-items-center justify-content-between w-100" slot-scope="{ node, data }">
<div><span>@{{ data.name }}</span></div> <div><span>@{{ data.name }}</span></div>
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
<span :class="['me-4', 'badge', 'bg-' + (data.active ? 'success' : 'secondary')]">@{{ data.active ? '启用' : '禁用' }}</span> <span class="me-4 badge bg-success" v-if="data.active">{{ __('common.enabled') }}</span>
<span class="me-4 badge bg-secondary" v-else>{{ __('common.disabled') }}</span>
<div> <div>
<a :href="data.url_edit" class="btn btn-outline-secondary btn-sm">{{ __('common.edit') }}</a> <a :href="data.url_edit" class="btn btn-outline-secondary btn-sm">{{ __('common.edit') }}</a>
<a class="btn btn-outline-danger btn-sm" @click="removeCategory(node, data)">{{ __('common.delete') }}</a> <a class="btn btn-outline-danger btn-sm" @click="removeCategory(node, data)">{{ __('common.delete') }}</a>
@ -40,9 +41,9 @@
methods: { methods: {
removeCategory(node, data) { removeCategory(node, data) {
this.$confirm('确定要删除分类吗?', '提示', { this.$confirm('{{ __('common.confirm_delete') }}', '{{ __('common.text_hint') }}', {
confirmButtonText: '确定', confirmButtonText: '{{ __('common.confirm') }}',
cancelButtonText: '取消', cancelButtonText: '{{ __('common.cancel') }}',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
$http.delete(`/categories/${data.id}`).then((res) => { $http.delete(`/categories/${data.id}`).then((res) => {

View File

@ -16,5 +16,6 @@ return [
'brands_create' => 'Create', 'brands_create' => 'Create',
'brands_show' => 'Detail', 'brands_show' => 'Detail',
'brands_update' => 'Edit', 'brands_update' => 'Edit',
'brands_delete' => 'Delete' 'brands_delete' => 'Delete',
'error_upload' => 'Please upload icon'
]; ];

View File

@ -16,5 +16,6 @@ return [
'brands_create' => '创建品牌', 'brands_create' => '创建品牌',
'brands_show' => '品牌详情', 'brands_show' => '品牌详情',
'brands_update' => '更新品牌', 'brands_update' => '更新品牌',
'brands_delete' => '删除品牌' 'brands_delete' => '删除品牌',
'error_upload' => '请上传图标'
]; ];