feat: i18n与jetcache
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
<el-breadcrumb class="app-breadcrumb" separator="/">
|
||||
<transition-group name="breadcrumb">
|
||||
<el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path">
|
||||
<span v-if="item.redirect==='noredirect'||index==levelList.length-1" class="no-redirect">{{ item.meta.title }}</span>
|
||||
<a v-else @click.prevent="handleLink(item)">{{ item.meta.title }}</a>
|
||||
<span v-if="item.redirect==='noredirect'||index==levelList.length-1" class="no-redirect">{{ $t(item.meta.title) }}</span>
|
||||
<a v-else @click.prevent="handleLink(item)">{{ $t(item.meta.title) }}</a>
|
||||
</el-breadcrumb-item>
|
||||
</transition-group>
|
||||
</el-breadcrumb>
|
||||
@@ -37,7 +37,7 @@ export default {
|
||||
const first = matched[0]
|
||||
|
||||
if (!this.isDashboard(first)) {
|
||||
matched = [{ path: '/dashboard', meta: { title: '首页' }}].concat(matched)
|
||||
matched = [{ path: '/dashboard', meta: { title: this.$t('menu.home') }}].concat(matched)
|
||||
}
|
||||
|
||||
this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
icon="el-icon-plus"
|
||||
@click="crud.toAdd"
|
||||
>
|
||||
新增
|
||||
{{ $t('common.Create') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="crud.optShow.edit"
|
||||
@@ -24,7 +24,7 @@
|
||||
:disabled="crud.selections.length !== 1"
|
||||
@click="crud.toEdit(crud.selections[0])"
|
||||
>
|
||||
修改
|
||||
{{ $t('common.Update') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="crud.optShow.del"
|
||||
@@ -38,7 +38,7 @@
|
||||
:disabled="crud.selections.length === 0"
|
||||
@click="toDelete(crud.selections)"
|
||||
>
|
||||
删除
|
||||
{{ $t('common.Delete') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="crud.optShow.download"
|
||||
@@ -49,7 +49,7 @@
|
||||
type="warning"
|
||||
icon="el-icon-download"
|
||||
@click="crud.doExport"
|
||||
>导出</el-button>
|
||||
>{{ $t('common.Export') }}</el-button>
|
||||
<!--右侧-->
|
||||
<slot name="right" />
|
||||
</span>
|
||||
@@ -86,7 +86,7 @@
|
||||
:indeterminate="allColumnsSelectedIndeterminate"
|
||||
@change="handleCheckAllChange"
|
||||
>
|
||||
全选
|
||||
{{ $t('common.SelectAll') }}
|
||||
</el-checkbox>
|
||||
<el-checkbox
|
||||
v-for="item in tableColumns"
|
||||
@@ -190,9 +190,9 @@ export default {
|
||||
this.tableColumns = columns
|
||||
},
|
||||
toDelete(datas) {
|
||||
this.$confirm(`确认删除选中的${datas.length}条数据?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
this.$confirm(this.$t('common.Tip1') + ` ${datas.length} ` + this.$t('common.Tip2'), this.$t('common.Tips'), {
|
||||
confirmButtonText: this.$t('common.Confirm'),
|
||||
cancelButtonText: this.$t('common.Cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.crud.delAllLoading = true
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
<el-button v-if="crud.optShow.reset" class="filter-item" size="mini" type="warning" icon="el-icon-refresh-left" @click="crud.resetQuery()">重置</el-button>
|
||||
-->
|
||||
<el-dropdown split-button type="primary" class="filter-item" @click="crud.toQuery">
|
||||
<i class="el-icon-search el-icon--left" />查询
|
||||
<i class="el-icon-search el-icon--left" />{{ $t('common.Query') }}
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item icon="el-icon-zoom-out" @click.native="crud.resetQuery()">重置</el-dropdown-item>
|
||||
<el-dropdown-item icon="el-icon-zoom-out" @click.native="crud.resetQuery()">{{ $t('common.Reset') }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-button v-if="isVisiableEdit" v-permission="permission.edit" type="text" :loading="crud.status.cu === 2" :disabled="disabledEdit" size="mini" icon="el-icon-edit" @click="crud.toEdit(data)">修改</el-button>
|
||||
<el-button v-if="isVisiableEdit" v-permission="permission.edit" type="text" :loading="crud.status.cu === 2" :disabled="disabledEdit" size="mini" icon="el-icon-edit" @click="crud.toEdit(data)">{{ $t('common.Update') }}</el-button>
|
||||
<el-popover v-model="pop" v-permission="permission.del" placement="top" width="180" trigger="manual" @show="onPopoverShow" @hide="onPopoverHide">
|
||||
<p>{{ msg }}</p>
|
||||
<div style="text-align: right; margin: 0">
|
||||
<el-button size="mini" type="text" @click="doCancel">取消</el-button>
|
||||
<el-button :loading="crud.dataStatus[crud.getDataId(data)].delete === 2" type="primary" size="mini" @click="crud.doDelete(data)">确定</el-button>
|
||||
<el-button size="mini" type="text" @click="doCancel">{{ $t('common.Cancel') }}</el-button>
|
||||
<el-button :loading="crud.dataStatus[crud.getDataId(data)].delete === 2" type="primary" size="mini" @click="crud.doDelete(data)">{{ $t('common.Confirm') }}</el-button>
|
||||
</div>
|
||||
<el-button v-if="isVisiableDel" slot="reference" type="text" :disabled="disabledDle" icon="el-icon-delete" size="mini" @click="toDelete">删除</el-button>
|
||||
<el-button v-if="isVisiableDel" slot="reference" type="text" :disabled="disabledDle" icon="el-icon-delete" size="mini" @click="toDelete">{{ $t('common.Delete') }}</el-button>
|
||||
</el-popover>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { download, initData } from '@/api/data'
|
||||
import { downloadFile, parseTime } from '@/utils/index'
|
||||
import Vue from 'vue'
|
||||
import i18n from '@/i18n'
|
||||
|
||||
/**
|
||||
* CRUD配置
|
||||
@@ -84,7 +85,7 @@ function CRUD(options) {
|
||||
},
|
||||
// 标题
|
||||
get title() {
|
||||
return this.add > CRUD.STATUS.NORMAL ? `新增${crud.title}` : this.edit > CRUD.STATUS.NORMAL ? `编辑${crud.title}` : crud.title
|
||||
return this.add > CRUD.STATUS.NORMAL ? i18n.t('common.Create') + ' ' + i18n.t(`${crud.title}`) : this.edit > CRUD.STATUS.NORMAL ? i18n.t('common.Editors') + ' ' + i18n.t(`${crud.title}`) : crud.title
|
||||
}
|
||||
},
|
||||
msg: {
|
||||
|
||||
Reference in New Issue
Block a user