mirror of
https://gitee.com/beecue/fastbee.git
synced 2026-03-22 22:44:51 +08:00
feat(国际化): 新增国际化
This commit is contained in:
@@ -1,53 +1,53 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="分类名称" prop="categoryName">
|
||||
<el-input v-model="queryParams.categoryName" placeholder="请输入分类名称" clearable size="small"
|
||||
<el-form-item :label="$t('system.newsCategory.874509-0')" prop="categoryName">
|
||||
<el-input v-model="queryParams.categoryName" :placeholder="$t('system.news.893410-3')" clearable size="small"
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</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('device.index.105953-8') }}</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('device.index.105953-9') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||
v-hasPermi="['iot:newsCategory:add']">新增</el-button>
|
||||
v-hasPermi="['iot:newsCategory:add']">{{ $t('system.sysclient.652154-4') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['iot:newsCategory:edit']">修改</el-button>
|
||||
v-hasPermi="['iot:newsCategory:edit']">{{ $t('system.sysclient.652154-5') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['iot:newsCategory:remove']">删除</el-button>
|
||||
v-hasPermi="['iot:newsCategory:remove']">{{ $t('system.sysclient.652154-6') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
||||
v-hasPermi="['iot:newsCategory:export']">导出</el-button>
|
||||
v-hasPermi="['iot:newsCategory:export']">{{ $t('system.sysclient.652154-7') }}</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="categoryList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="分类编号" align="center" prop="categoryId" />
|
||||
<el-table-column label="分类名称" align="center" prop="categoryName" />
|
||||
<el-table-column label="显示顺序" align="center" prop="orderNum" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<el-table-column :label="$t('system.newsCategory.874509-1')" align="center" prop="categoryId" />
|
||||
<el-table-column :label="$t('system.newsCategory.874509-0')" align="center" prop="categoryName" />
|
||||
<el-table-column :label="$t('system.newsCategory.874509-2')" align="center" prop="orderNum" />
|
||||
<el-table-column :label="$t('device.index.105953-33')" align="center" prop="createTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" min-width="200" header-align="center" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column :label="$t('iot.group.index.637432-9')" align="center" prop="remark" min-width="200" header-align="center" />
|
||||
<el-table-column :label="$t('device.index.105953-34')" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-view" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['iot:newsCategory:add']">查看</el-button>
|
||||
v-hasPermi="['iot:newsCategory:add']">{{ $t('device.index.105953-60') }}</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['iot:newsCategory:remove']">删除</el-button>
|
||||
v-hasPermi="['iot:newsCategory:remove']">{{ $t('system.sysclient.652154-6') }}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -58,23 +58,23 @@
|
||||
<!-- 添加或修改新闻分类对话框 -->
|
||||
<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="categoryName">
|
||||
<el-input v-model="form.categoryName" placeholder="请输入分类名称" />
|
||||
<el-form-item :label="$t('system.newsCategory.874509-0')" prop="categoryName">
|
||||
<el-input v-model="form.categoryName" :placeholder="$t('system.news.893410-3')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="显示顺序" prop="orderNum">
|
||||
<el-input-number v-model="form.orderNum" placeholder="请输入显示顺序" type="number" controls-position="right"
|
||||
<el-form-item :label="$t('system.newsCategory.874509-2')" prop="orderNum">
|
||||
<el-input-number v-model="form.orderNum" :placeholder="$t('system.newsCategory.874509-3')" type="number" controls-position="right"
|
||||
style="width: 100%" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
<el-form-item :label="$t('iot.group.index.637432-9')" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" :placeholder="$t('iot.group.index.637432-16')" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm" v-hasPermi="['iot:newsCategory:edit']"
|
||||
v-show="form.categoryId">修 改</el-button>
|
||||
v-show="form.categoryId">{{ $t('iot.group.index.637432-17') }}</el-button>
|
||||
<el-button type="primary" @click="submitForm" v-hasPermi="['iot:newsCategory:add']"
|
||||
v-show="!form.categoryId">新 增</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
v-show="!form.categoryId">{{ $t('iot.group.index.637432-18') }}</el-button>
|
||||
<el-button @click="cancel">{{ $t('iot.group.index.637432-19') }}</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
@@ -123,21 +123,14 @@ export default {
|
||||
rules: {
|
||||
categoryName: [{
|
||||
required: true,
|
||||
message: "分类名字不能为空",
|
||||
message: this.$t('system.newsCategory.874509-4'),
|
||||
trigger: "blur"
|
||||
},
|
||||
{
|
||||
min: 1,
|
||||
max: 64,
|
||||
message: '分类名字不能少于1个字符和超过64字符',
|
||||
},
|
||||
],
|
||||
}],
|
||||
orderNum: [{
|
||||
required: true,
|
||||
message: "显示顺序不能为空",
|
||||
message: this.$t('system.newsCategory.874509-5'),
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
}],
|
||||
}
|
||||
};
|
||||
},
|
||||
@@ -194,7 +187,7 @@ export default {
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加新闻分类";
|
||||
this.title = this.$t('system.newsCategory.874509-6');
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
@@ -203,7 +196,7 @@ export default {
|
||||
getNewsCategory(categoryId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改新闻分类";
|
||||
this.title = this.$t('system.newsCategory.874509-7');
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
@@ -212,13 +205,13 @@ export default {
|
||||
if (valid) {
|
||||
if (this.form.categoryId != null) {
|
||||
updateNewsCategory(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.$modal.msgSuccess(this.$t('iot.group.index.637432-24'));
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addNewsCategory(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.$modal.msgSuccess(this.$t('iot.group.index.637432-25'));
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
@@ -230,7 +223,7 @@ export default {
|
||||
handleDelete(row) {
|
||||
const categoryIds = row.categoryId || this.ids;
|
||||
let msg = "";
|
||||
this.$modal.confirm('是否确认删除新闻分类编号为"' + categoryIds + '"的数据项?').then(function () {
|
||||
this.$modal.confirm(this.$t('system.newsCategory.874509-8', [categoryIds])).then(function () {
|
||||
return delNewsCategory(categoryIds).then(response => {
|
||||
msg = response.msg;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user