Browse Source

对客服/反馈信息页面做国际化替换

main
yyd 2 months ago
parent
commit
b8569e212d
  1. 101
      src/views/business/commonFeedback/index.vue

101
src/views/business/commonFeedback/index.vue

@ -1,18 +1,20 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="反馈人" prop="userId"> <el-form-item :label="$t('business.customerSupport.commonFeedback.userId')" prop="userId">
<el-input v-model="queryParams.userId" placeholder="请输入反馈人" clearable @keyup.enter.native="handleQuery" /> <el-input v-model="queryParams.userId" :placeholder="$t('business.customerSupport.commonFeedback.userIdPlaceholder')" clearable @keyup.enter.native="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item label="星级" prop="star"> <el-form-item :label="$t('business.customerSupport.commonFeedback.star')" prop="star">
<el-input v-model="queryParams.star" placeholder="请输入星级" clearable @keyup.enter.native="handleQuery" /> <el-input v-model="queryParams.star" :placeholder="$t('business.customerSupport.commonFeedback.starPlaceholder')" clearable @keyup.enter.native="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item label="是否正向" prop="isGood"> <el-form-item :label="$t('business.customerSupport.commonFeedback.isGood')" prop="isGood">
<el-input v-model="queryParams.isGood" placeholder="请输入是否正向" clearable @keyup.enter.native="handleQuery" /> <el-input v-model="queryParams.isGood" :placeholder="$t('business.customerSupport.commonFeedback.isGoodPlaceholder')" clearable @keyup.enter.native="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item label="创建时间"> <el-form-item :label="$t('business.customerSupport.commonFeedback.createTime')">
<el-date-picker v-model="daterangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" <el-date-picker v-model="daterangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" type="daterange" :range-separator="$t('business.customerSupport.commonFeedback.rangeSeparator')"
:start-placeholder="$t('business.customerSupport.commonFeedback.startDate')"
:end-placeholder="$t('business.customerSupport.commonFeedback.endDate')"
:default-time="['00:00:00', '23:59:59']"></el-date-picker> :default-time="['00:00:00', '23:59:59']"></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
@ -43,23 +45,23 @@
<el-table v-loading="loading" :data="commonFeedbackList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="commonFeedbackList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="唯一ID" align="center" prop="id" v-if="true" /> <el-table-column :label="$t('business.customerSupport.commonFeedback.uniqueId')" align="center" prop="id" v-if="true" />
<el-table-column label="反馈人" align="center" prop="userId" /> <el-table-column :label="$t('business.customerSupport.commonFeedback.userId')" align="center" prop="userId" />
<el-table-column label="反馈内容" align="center" prop="content" /> <el-table-column :label="$t('business.customerSupport.commonFeedback.content')" align="center" prop="content" />
<el-table-column label="星级" align="center" prop="star" /> <el-table-column :label="$t('business.customerSupport.commonFeedback.star')" align="center" prop="star" />
<el-table-column label="是否正向" align="center" prop="isGood" /> <el-table-column :label="$t('business.customerSupport.commonFeedback.isGood')" align="center" prop="isGood" />
<el-table-column label="状态" align="center" prop="status"> <el-table-column :label="$t('business.customerSupport.commonFeedback.status')" align="center" prop="status">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.status == '0'">正常</el-tag> <el-tag v-if="scope.row.status == '0'">{{ $t('business.customerSupport.commonFeedback.statusNormal') }}</el-tag>
<el-tag type="danger" v-if="scope.row.status == '1'">封禁</el-tag> <el-tag type="danger" v-if="scope.row.status == '1'">{{ $t('business.customerSupport.commonFeedback.statusBanned') }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180"> <el-table-column :label="$t('business.customerSupport.commonFeedback.createTime')" align="center" prop="createTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width"> <el-table-column :label="$t('business.customerSupport.commonFeedback.operationColumn')" align="center" width="200" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-view" @click="handleDetail(scope.row)">{{ $t('common.button.detail') }}</el-button> <el-button size="mini" type="text" icon="el-icon-view" @click="handleDetail(scope.row)">{{ $t('common.button.detail') }}</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
@ -74,19 +76,20 @@
@pagination="getList" /> @pagination="getList" />
<!-- 添加或修改反馈信息对话框 --> <!-- 添加或修改反馈信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="$t('business.customerSupport.commonFeedback.' + (form.id ? 'editTitle' : 'addTitle'))" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="反馈人" prop="userId"> <el-form-item :label="$t('business.customerSupport.commonFeedback.userId')" prop="userId">
<el-input v-model="form.userId" placeholder="请输入反馈人" /> <el-input v-model="form.userId" :placeholder="$t('business.customerSupport.commonFeedback.userIdPlaceholder')" />
</el-form-item> </el-form-item>
<el-form-item label="反馈内容"> <el-form-item :label="$t('business.customerSupport.commonFeedback.contentLabel')">
<editor v-model="form.content" :min-height="192" /> <editor v-model="form.content" :min-height="192" />
</el-form-item> </el-form-item>
<el-form-item label="星级" prop="star"> <el-form-item :label="$t('business.customerSupport.commonFeedback.starLabel')" prop="star">
<el-input v-model="form.star" placeholder="请输入星级" /> <el-input v-model="form.star" :placeholder="$t('business.customerSupport.commonFeedback.starPlaceholder')" />
</el-form-item> </el-form-item>
<el-form-item label="是否正向(0正向,1负向)" prop="isGood"> <el-form-item :label="$t('business.customerSupport.commonFeedback.isGoodLabel')" prop="isGood">
<el-input v-model="form.isGood" placeholder="请输入是否正向(0正向,1负向)" /> <el-input v-model="form.isGood" :placeholder="$t('business.customerSupport.commonFeedback.isGoodPlaceholder')" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -96,38 +99,38 @@
</el-dialog> </el-dialog>
<!-- 反馈信息详情 --> <!-- 反馈信息详情 -->
<el-dialog :title="title" :visible.sync="detailOpen" width="700px" append-to-body> <el-dialog :title="$t('business.customerSupport.commonFeedback.detailTitle')" :visible.sync="detailOpen" width="700px" append-to-body>
<el-form ref="form" :model="form" label-width="auto"> <el-form ref="form" :model="form" label-width="auto">
<el-form-item label="反馈人:"> <el-form-item :label="$t('business.customerSupport.commonFeedback.userIdLabel')">
{{form.userId}} {{form.userId}}
</el-form-item> </el-form-item>
<el-form-item label="反馈内容"> <el-form-item :label="$t('business.customerSupport.commonFeedback.contentLabel')">
<editor v-model="form.content" :min-height="192" /> <editor v-model="form.content" :min-height="192" />
</el-form-item> </el-form-item>
<el-form-item label="星级:"> <el-form-item :label="$t('business.customerSupport.commonFeedback.starLabel')">
{{form.star}} {{form.star}}
</el-form-item> </el-form-item>
<el-form-item label="是否正向(0正向,1负向):"> <el-form-item :label="$t('business.customerSupport.commonFeedback.isGoodLabel')">
{{form.isGood}} {{form.isGood}}
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="cancel"> </el-button> <el-button @click="cancel">{{ $t('business.customerSupport.commonFeedback.closeButton') }}</el-button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { import {
listCommonFeedback, addCommonFeedback,
getCommonFeedback, delCommonFeedback,
delCommonFeedback, getCommonFeedback,
addCommonFeedback, listCommonFeedback,
updateCommonFeedback updateCommonFeedback
} from "@/api/business/commonFeedback"; } from "@/api/business/commonFeedback";
export default { export default {
name: "CommonFeedback", name: "CommonFeedback",
data() { data() {
return { return {
@ -172,12 +175,12 @@
rules: { rules: {
userId: [{ userId: [{
required: true, required: true,
message: "反馈人不能为空", message: this.$t('business.customerSupport.commonFeedback.userIdRequired'),
trigger: "blur" trigger: "blur"
}], }],
content: [{ content: [{
required: true, required: true,
message: "反馈内容不能为空", message: this.$t('business.customerSupport.commonFeedback.contentRequired'),
trigger: "blur" trigger: "blur"
}], }],
} }
@ -245,14 +248,14 @@
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "添加反馈信息"; this.title = this.$t('business.customerSupport.commonFeedback.addTitle');
}, },
/** 详情按钮操作 */ /** 详情按钮操作 */
handleDetail(row) { handleDetail(row) {
this.reset(); this.reset();
this.form = row; this.form = row;
this.detailOpen = true; this.detailOpen = true;
this.title = "反馈信息"; this.title = this.$t('business.customerSupport.commonFeedback.detailTitle');
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
@ -263,7 +266,7 @@
this.loading = false; this.loading = false;
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改反馈信息"; this.title = this.$t('business.customerSupport.commonFeedback.editTitle');
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
@ -273,7 +276,7 @@
this.buttonLoading = true; this.buttonLoading = true;
if (this.form.id != null) { if (this.form.id != null) {
updateCommonFeedback(this.form).then(response => { updateCommonFeedback(this.form).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess(this.$t('business.customerSupport.commonFeedback.updateSuccess'));
this.open = false; this.open = false;
this.getList(); this.getList();
}).finally(() => { }).finally(() => {
@ -281,7 +284,7 @@
}); });
} else { } else {
addCommonFeedback(this.form).then(response => { addCommonFeedback(this.form).then(response => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess(this.$t('business.customerSupport.commonFeedback.addSuccess'));
this.open = false; this.open = false;
this.getList(); this.getList();
}).finally(() => { }).finally(() => {
@ -294,13 +297,13 @@
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除反馈信息编号为"' + ids + '"的数据项?').then(() => { this.$modal.confirm(this.$t('business.customerSupport.commonFeedback.deleteConfirm', { ids: ids })).then(() => {
this.loading = true; this.loading = true;
return delCommonFeedback(ids); return delCommonFeedback(ids);
}).then(() => { }).then(() => {
this.loading = false; this.loading = false;
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess(this.$t('business.customerSupport.commonFeedback.deleteSuccess'));
}).catch(() => {}).finally(() => { }).catch(() => {}).finally(() => {
this.loading = false; this.loading = false;
}); });

Loading…
Cancel
Save