|
|
@@ -29,11 +29,11 @@
|
|
|
>
|
|
|
<el-option
|
|
|
:label="$t.value.WhiteList"
|
|
|
- :value="$t.value.WhiteList"
|
|
|
+ value="白名单"
|
|
|
/>
|
|
|
<el-option
|
|
|
:label="$t.value.BlackList"
|
|
|
- :value="$t.value.BlackList"
|
|
|
+ value="黑名单"
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
@@ -71,8 +71,8 @@
|
|
|
width="120"
|
|
|
>
|
|
|
<template #default="scope">
|
|
|
- <el-tag :type="scope.row.list_type === $t.value.WhiteList ? 'success' : 'danger'">
|
|
|
- {{ scope.row.list_type }}
|
|
|
+ <el-tag :type="scope.row.list_type === '白名单' ? 'success' : 'danger'">
|
|
|
+ {{ scope.row.list_type === '白名单' ? $t.value.WhiteList : $t.value.BlackList }}
|
|
|
</el-tag>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
@@ -145,8 +145,8 @@
|
|
|
required
|
|
|
>
|
|
|
<el-radio-group v-model="form.list_type">
|
|
|
- <el-radio :value="$t.value.WhiteList">{{ $t.value.WhiteList }}</el-radio>
|
|
|
- <el-radio :value="$t.value.BlackList">{{ $t.value.BlackList }}</el-radio>
|
|
|
+ <el-radio value="白名单">{{ $t.value.WhiteList }}</el-radio>
|
|
|
+ <el-radio value="黑名单">{{ $t.value.BlackList }}</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
|
|
|
@@ -256,7 +256,7 @@ const resetQuery = () => {
|
|
|
// 新增
|
|
|
const add = () => {
|
|
|
form.ID = 0
|
|
|
- form.list_type = t.value.WhiteList
|
|
|
+ form.list_type = '白名单'
|
|
|
form.vehicle_id = ''
|
|
|
form.expiration_time = null
|
|
|
dialogVisible.value = true
|
|
|
@@ -267,7 +267,7 @@ const edit = (row) => {
|
|
|
form.ID = row.ID
|
|
|
form.list_type = row.list_type
|
|
|
form.vehicle_id = row.vehicle_id
|
|
|
- form.expiration_time = row.expiration_time ? formatTime(row.expiration_time) : ''
|
|
|
+ form.expiration_time = row.expiration_time ? formatTime(row.expiration_time) : null
|
|
|
dialogVisible.value = true
|
|
|
}
|
|
|
|
|
|
@@ -294,12 +294,34 @@ const submit = async() => {
|
|
|
|
|
|
// 删除
|
|
|
const del = async(id) => {
|
|
|
- await ElMessageBox.confirm(t.value.confirmDelete, t.value.tip,
|
|
|
- { type: 'warning', confirmButtonText: t.value.Confirm,
|
|
|
- cancelButtonText: t.value.Cancel })
|
|
|
- await deleteShortlist(id)
|
|
|
- ElMessage.success(t.value.deleteSuccess)
|
|
|
- getList()
|
|
|
+ await ElMessageBox.confirm(
|
|
|
+ t.value.confirmDelete,
|
|
|
+ t.value.tip,
|
|
|
+ {
|
|
|
+ confirmButtonText: t.value.confirm,
|
|
|
+ cancelButtonText: t.value.Cancel,
|
|
|
+ type: 'warning',
|
|
|
+ }
|
|
|
+ )
|
|
|
+ .then(() => {
|
|
|
+ deleteShortlist(id).then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ ElMessage.success(t.value.deleteSuccess)
|
|
|
+ getList()
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: t.value.deleteFailed,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ ElMessage({
|
|
|
+ type: 'info',
|
|
|
+ message: t.value.cancelDelete,
|
|
|
+ })
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
// 初始化
|