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.first }}</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>
<button class="btn btn-outline-secondary btn-sm" @click="checkedCreate('edit', index)">{{ __('common.edit') }}</button>
@ -106,9 +107,9 @@
},
rules: {
name: [{required: true,message: '请输入名称',trigger: 'blur'}, ],
first: [{required: true,message: '请输入首字母',trigger: 'blur'}, ],
logo: [{required: true,message: '请上传图标',trigger: 'change'}, ],
name: [{required: true,message: '{{ __('common.error_required', ['name' => __('common.name')])}}',trigger: 'blur'}, ],
first: [{required: true,message: '{{ __('common.error_required', ['name' => __('brand.first_letter')])}}',trigger: 'blur'}, ],
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><span>@{{ data.name }}</span></div>
<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>
<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>
@ -40,9 +41,9 @@
methods: {
removeCategory(node, data) {
this.$confirm('确定要删除分类吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
this.$confirm('{{ __('common.confirm_delete') }}', '{{ __('common.text_hint') }}', {
confirmButtonText: '{{ __('common.confirm') }}',
cancelButtonText: '{{ __('common.cancel') }}',
type: 'warning'
}).then(() => {
$http.delete(`/categories/${data.id}`).then((res) => {

View File

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

View File

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