修改国际化配置

This commit is contained in:
lsymicc
2025-06-06 15:48:05 +08:00
parent e0a7d8f8a7
commit d7f823cef2
3 changed files with 533 additions and 165 deletions

View File

@@ -1,28 +1,32 @@
<template>
<div class="app-container">
<!-- 查询表单 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="字典名称" prop="dictName">
<!-- 字典名称 -->
<el-form-item :label="$t('systemManagement_DictManagement.dictName')" prop="dictName">
<el-input
v-model="queryParams.dictName"
placeholder="请输入字典名称"
:placeholder="$t('systemManagement_DictManagement.placeholderDictName')"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="字典类型" prop="dictType">
<!-- 字典类型 -->
<el-form-item :label="$t('systemManagement_DictManagement.dictType')" prop="dictType">
<el-input
v-model="queryParams.dictType"
placeholder="请输入字典类型"
:placeholder="$t('systemManagement_DictManagement.placeholderDictType')"
clearable
style="width: 240px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<!-- 状态 -->
<el-form-item :label="$t('systemManagement_DictManagement.status')" prop="status">
<el-select
v-model="queryParams.status"
placeholder="字典状态"
:placeholder="$t('systemManagement_DictManagement.placeholderStatus')"
clearable
style="width: 240px"
>
@@ -34,25 +38,30 @@
/>
</el-select>
</el-form-item>
<el-form-item label="创建时间">
<!-- 创建时间 -->
<el-form-item :label="$t('systemManagement_DictManagement.createTime')" :label-width="$t('systemManagement_DictManagement.null')">
<el-date-picker
v-model="dateRange"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
:start-placeholder="$t('systemManagement_DictManagement.placeholderDateStart')"
:end-placeholder="$t('systemManagement_DictManagement.placeholderDateEnd')"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<!-- 查询按钮 -->
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('systemManagement_DictManagement.btnSearch') }}</el-button>
<!-- 重置按钮 -->
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('systemManagement_DictManagement.btnReset') }}</el-button>
</el-form-item>
</el-form>
<!-- 操作按钮 -->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<!-- 新增按钮 -->
<el-button
type="primary"
plain
@@ -60,9 +69,10 @@
size="mini"
@click="handleAdd"
v-hasPermi="['system:dict:add']"
>新增</el-button>
>{{ $t('systemManagement_DictManagement.btnAdd') }}</el-button>
</el-col>
<el-col :span="1.5">
<!-- 编辑按钮 -->
<el-button
type="success"
plain
@@ -71,9 +81,10 @@
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:dict:edit']"
>修改</el-button>
>{{ $t('systemManagement_DictManagement.btnEdit') }}</el-button>
</el-col>
<el-col :span="1.5">
<!-- 删除按钮 -->
<el-button
type="danger"
plain
@@ -82,9 +93,10 @@
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:dict:remove']"
>删除</el-button>
>{{ $t('systemManagement_DictManagement.btnDelete') }}</el-button>
</el-col>
<el-col :span="1.5">
<!-- 导出按钮 -->
<el-button
type="warning"
plain
@@ -92,9 +104,10 @@
size="mini"
@click="handleExport"
v-hasPermi="['system:dict:export']"
>导出</el-button>
>{{ $t('systemManagement_DictManagement.btnExport') }}</el-button>
</el-col>
<el-col :span="1.5">
<!-- 刷新缓存 -->
<el-button
type="danger"
plain
@@ -102,34 +115,38 @@
size="mini"
@click="handleRefreshCache"
v-hasPermi="['system:dict:remove']"
>刷新缓存</el-button>
>{{ $t('systemManagement_DictManagement.btnRefreshCache') }}</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 表格 -->
<el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="字典编号" align="center" prop="dictId" />
<el-table-column label="字典名称" align="center" prop="dictName" :show-overflow-tooltip="true" />
<el-table-column label="字典类型" align="center" :show-overflow-tooltip="true">
<!-- 字典编号 -->
<el-table-column :label="$t('systemManagement_DictManagement.dictId')" align="center" prop="dictId" />
<!-- 字典名称 -->
<el-table-column :label="$t('systemManagement_DictManagement.dictName')" align="center" prop="dictName" :show-overflow-tooltip="true" />
<!-- 字典类型 -->
<el-table-column :label="$t('systemManagement_DictManagement.dictType')" align="center" :show-overflow-tooltip="true">
<template slot-scope="scope">
<router-link :to="'/system/dict-data/index/' + scope.row.dictId" class="link-type">
<span>{{ scope.row.dictType }}</span>
</router-link>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status">
<el-table-column :label="$t('systemManagement_DictManagement.status')" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<el-table-column :label="$t('systemManagement_DictManagement.remark')" align="center" prop="remark" :show-overflow-tooltip="true" />
<el-table-column :label="$t('systemManagement_DictManagement.createTime')" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<el-table-column :label="$t('systemManagement_DictManagement.operation')" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
@@ -137,18 +154,19 @@
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:dict:edit']"
>修改</el-button>
>{{ $t('systemManagement_DictManagement.btnEdit') }}</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:dict:remove']"
>删除</el-button>
>{{ $t('systemManagement_DictManagement.btnDelete') }}</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<pagination
v-show="total>0"
:total="total"
@@ -160,13 +178,16 @@
<!-- 添加或修改参数配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="字典名称" prop="dictName">
<el-input v-model="form.dictName" placeholder="请输入字典名称" />
<!-- 字典名称 -->
<el-form-item :label="$t('systemManagement_DictManagement.dictName')" prop="dictName">
<el-input v-model="form.dictName" :placeholder="$t('systemManagement_DictManagement.placeholderDictName')" />
</el-form-item>
<el-form-item label="字典类型" prop="dictType">
<el-input v-model="form.dictType" placeholder="请输入字典类型" />
<!-- 字典类型 -->
<el-form-item :label="$t('systemManagement_DictManagement.dictType')" prop="dictType">
<el-input v-model="form.dictType" :placeholder="$t('systemManagement_DictManagement.placeholderDictType')" />
</el-form-item>
<el-form-item label="状态" prop="status">
<!-- 状态 -->
<el-form-item :label="$t('systemManagement_DictManagement.status')" prop="status">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in dict.type.sys_normal_disable"
@@ -175,13 +196,16 @@
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
<!-- 备注 -->
<el-form-item :label="$t('systemManagement_DictManagement.remark')" prop="remark">
<el-input v-model="form.remark" type="textarea" :placeholder="$t('systemManagement_DictManagement.placeholderRemark')" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
<!-- 确定按钮 -->
<el-button type="primary" @click="submitForm">{{ $t('systemManagement_DictManagement.btnSubmit') }}</el-button>
<!-- 取消按钮 -->
<el-button @click="cancel">{{ $t('systemManagement_DictManagement.btnCancel') }}</el-button>
</div>
</el-dialog>
</div>
@@ -228,10 +252,12 @@ export default {
// 表单校验
rules: {
dictName: [
{ required: true, message: "字典名称不能为空", trigger: "blur" }
// 字典名称不能为空
{ required: true, message: this.$t('systemManagement_DictManagement.checkDictNameIsNull'), trigger: "blur" }
],
dictType: [
{ required: true, message: "字典类型不能为空", trigger: "blur" }
// 字典类型不能为空
{ required: true, message: this.$t('systemManagement_DictManagement.checkDictTypeIsNull'), trigger: "blur" }
]
}
}
@@ -281,12 +307,13 @@ export default {
handleAdd() {
this.reset()
this.open = true
this.title = "添加字典类型"
// 设置标题:添加字典类型
this.title = this.$t('systemManagement_DictManagement.addDictTypeItem')
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.dictId)
this.single = selection.length!=1
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 修改按钮操作 */
@@ -296,22 +323,25 @@ export default {
getType(dictId).then(response => {
this.form = response.data
this.open = true
this.title = "修改字典类型"
// 设置标题:修改字典类型
this.title = this.$t('systemManagement_DictManagement.editDictTypeItem')
})
},
/** 提交按钮 */
submitForm: function() {
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.dictId != undefined) {
updateType(this.form).then(response => {
this.$modal.msgSuccess("修改成功")
// 提示:编辑成功
this.$modal.msgSuccess(this.$t('systemManagement_DictManagement.editSuccessInfo'))
this.open = false
this.getList()
})
} else {
addType(this.form).then(response => {
this.$modal.msgSuccess("新增成功")
// 提示:新增成功
this.$modal.msgSuccess(this.$t('systemManagement_DictManagement.addSuccessInfo'))
this.open = false
this.getList()
})
@@ -322,11 +352,13 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const dictIds = row.dictId || this.ids
this.$modal.confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?').then(function() {
const deleteConfirmText = `${this.$t('systemManagement_DictManagement.textDeleteConfirm1')}${dictIds}${this.$t('systemManagement_DictManagement.textDeleteConfirm2')}`
this.$modal.confirm(deleteConfirmText).then(() => {
return delType(dictIds)
}).then(() => {
this.getList()
this.$modal.msgSuccess("删除成功")
// 提示:删除成功
this.$modal.msgSuccess(this.$t('systemManagement_DictManagement.deleteSuccessInfo'))
}).catch(() => {})
},
/** 导出按钮操作 */
@@ -338,10 +370,11 @@ export default {
/** 刷新缓存按钮操作 */
handleRefreshCache() {
refreshCache().then(() => {
this.$modal.msgSuccess("刷新成功")
// 提示:刷新成功
this.$modal.msgSuccess(this.$t('systemManagement_DictManagement.refreshSuccessInfo'))
this.$store.dispatch('dict/cleanDict')
})
}
}
}
</script>
</script>