10 changed files with 12275 additions and 76 deletions
-
39package-lock.json
-
2package.json
-
37src/api/lang.js
-
2src/styles/elDialog.scss
-
258src/views/langinfo/index.vue
-
39src/views/renovation/commdityClass/Edit.vue
-
16src/views/renovation/commdityClass/index.vue
-
44src/views/setup/businessMenus/index.vue
-
47src/views/setup/tabs/index.vue
-
11867yarn.lock
@ -0,0 +1,37 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
// 获取所有语言
|
|||
export function langInfoGetAll(data) { |
|||
return request({ |
|||
url: '/cerePlatformLangInfo/getAll', |
|||
method: 'post', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
// 保存语言
|
|||
export function langInfoSave(data) { |
|||
return request({ |
|||
url: '/cerePlatformLangInfo/save', |
|||
method: 'post', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
// 保存语言
|
|||
export function langInfoUpdate(data) { |
|||
return request({ |
|||
url: '/cerePlatformLangInfo/update', |
|||
method: 'post', |
|||
data |
|||
}) |
|||
} |
|||
|
|||
// 删除语言
|
|||
export function langInfoDelete(data) { |
|||
return request({ |
|||
url: '/cerePlatformLangInfo/delete', |
|||
method: 'post', |
|||
data |
|||
}) |
|||
} |
@ -0,0 +1,258 @@ |
|||
<!-- --> |
|||
<template> |
|||
<div class="userStyle"> |
|||
<!-- 搜索 --> |
|||
<div class="formSearch"> |
|||
<el-form :inline="true" :model="formInline"> |
|||
<el-form-item label="键值"> |
|||
<el-input v-model="formInline.langKey" maxlength="20" placeholder="请输入键值" /> |
|||
</el-form-item> |
|||
<el-form-item label="中文"> |
|||
<el-input v-model="formInline.langZh" maxlength="20" placeholder="请输入中文" /> |
|||
</el-form-item> |
|||
<el-form-item label="英文"> |
|||
<el-input v-model="formInline.langEn" maxlength="20" placeholder="请输入英文" /> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="primary" plain @click="search">查询</el-button> |
|||
<el-button type="info" plain @click="clear">重置</el-button> |
|||
<el-button type="success" plain @click="add">新增语言包</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</div> |
|||
<!-- 表格 --> |
|||
<div class="tableBox"> |
|||
<el-table |
|||
ref="multipleTable" |
|||
:data="tableData" |
|||
border |
|||
:header-cell-style="{ background: '#EEF3FF', color: '#333333' }" |
|||
tooltip-effect="dark" |
|||
style="width: 100%" |
|||
> |
|||
<el-table-column label="键值" width="220"> |
|||
<template slot-scope="scope">{{ scope.row.langKey }}</template> |
|||
</el-table-column> |
|||
<el-table-column prop="langZh" label="中文" /> |
|||
<el-table-column prop="langEn" label="英文" /> |
|||
<el-table-column prop="langDesc" label="说明" /> |
|||
<el-table-column label="操作" show-overflow-tooltip> |
|||
<template slot-scope="scope"> |
|||
<div class="btnList"> |
|||
<el-button type="text" @click="edit(scope.row)">编辑</el-button> |
|||
<el-button type="text" @click="del(scope.row)">删除</el-button> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<div class="fenye"> |
|||
<el-pagination |
|||
:current-page="currentPage" |
|||
:page-sizes="[10, 20, 50, 100]" |
|||
:page-size="10" |
|||
layout="total, sizes, prev, pager, next, jumper" |
|||
:total="total" |
|||
@size-change="handleSizeChange" |
|||
@current-change="handleCurrentChange" |
|||
/> |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- *************对话框开始************* --> |
|||
<!-- 新增角语言信息 --> |
|||
<el-dialog |
|||
:title="userState ? '新增语言信息' : '修改语言信息'" |
|||
:visible.sync="addFormDialog" |
|||
width="30%" |
|||
center |
|||
:close-on-click-modal="false" |
|||
> |
|||
<!-- 新增语言信息 --> |
|||
<div> |
|||
<el-form ref="langRules" :model="addForm" label-width="80px" :rules="langRules"> |
|||
<el-form-item label="键值" prop="langKey"> |
|||
<el-input v-model="addForm.langKey" maxlength="800" placeholder="请输入键值" /> |
|||
</el-form-item> |
|||
<el-form-item label="中文" prop="langZh"> |
|||
<el-input v-model="addForm.langZh" maxlength="800" placeholder="请输入中文" /> |
|||
</el-form-item> |
|||
<el-form-item label="英文" prop="langEn"> |
|||
<el-input v-model="addForm.langEn" maxlength="800" placeholder="请输入英文" /> |
|||
</el-form-item> |
|||
<el-form-item label="说明" prop="langDesc"> |
|||
<el-input v-model="addForm.langDesc" maxlength="800" placeholder="请输入说明" /> |
|||
</el-form-item> |
|||
</el-form> |
|||
</div> |
|||
<span slot="footer" class="dialog-footer"> |
|||
<el-button @click="addFormDialog = false">取 消</el-button> |
|||
<el-button type="primary" @click="addForm_enter('langRules')">确 定</el-button> |
|||
</span> |
|||
</el-dialog> |
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
// 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等) |
|||
// 例如:import 《组件名称》 from '《组件路径》'; |
|||
import { |
|||
langInfoGetAll, |
|||
langInfoSave, |
|||
langInfoUpdate, |
|||
langInfoDelete |
|||
} from '@/api/lang' |
|||
export default { |
|||
// import引入的组件需要注入到对象中才能使用 |
|||
components: {}, |
|||
data() { |
|||
// 这里存放数据 |
|||
return { |
|||
formInline: { |
|||
langKey: '', // 搜索字段 |
|||
langZh: '', |
|||
langEn: '', |
|||
page: '1', // 当前页 |
|||
pageSize: '10' // 每页记录数 |
|||
}, |
|||
total: 1, |
|||
tableData: [], |
|||
userState: 0, |
|||
currentPage: 1, |
|||
dialogVisible: false, |
|||
addForm: { |
|||
id: '', |
|||
langKey: '', |
|||
langDesc: '', |
|||
langZh: '', |
|||
langEn: '' |
|||
}, |
|||
addFormDialog: false, |
|||
langRules: { |
|||
|
|||
}, |
|||
roleId: null |
|||
} |
|||
}, |
|||
// 监听属性 类似于data概念 |
|||
computed: {}, |
|||
// 监控data中的数据变化 |
|||
watch: {}, |
|||
// 生命周期 - 创建完成(可以访问当前this实例) |
|||
created() {}, |
|||
// 生命周期 - 挂载完成(可以访问DOM元素) |
|||
mounted() { |
|||
this.getAll(this.formInline) |
|||
}, |
|||
// 方法集合 |
|||
methods: { |
|||
handleSizeChange(val) { |
|||
this.formInline.pageSize = val |
|||
this.getAll(this.formInline) |
|||
}, |
|||
handleCurrentChange(val) { |
|||
this.formInline.page = val |
|||
this.getAll(this.formInline) |
|||
}, |
|||
// 查询 |
|||
search() { |
|||
this.total = 1 |
|||
this.formInline.page = 1 |
|||
this.getAll(this.formInline) |
|||
}, |
|||
// 清除 |
|||
clear() { |
|||
this.formInline = { |
|||
langKey: '', // 搜索字段 |
|||
langZh: '', |
|||
langEn: '', |
|||
page: '1', // 当前页 |
|||
pageSize: '10' // 每页记录数 |
|||
} |
|||
this.getAll(this.formInline) |
|||
}, |
|||
// 新增角色 |
|||
add() { |
|||
this.userState = 1 |
|||
this.addFormDialog = true |
|||
this.addForm = { |
|||
id: '', |
|||
langKey: '', |
|||
langDesc: '', |
|||
langZh: '', |
|||
langEn: '' |
|||
} |
|||
}, |
|||
// 确认新增角色 |
|||
addForm_enter(langRules) { |
|||
this.$refs[langRules].validate(valid => { |
|||
if (valid) { |
|||
if (this.userState) { |
|||
langInfoSave(this.addForm).then(res => { |
|||
|
|||
if (res.code === '') { |
|||
this.$message({ |
|||
message: '新增成功', |
|||
type: 'success' |
|||
}) |
|||
} |
|||
this.getAll(this.formInline) |
|||
this.addFormDialog = false |
|||
}) |
|||
} else { |
|||
langInfoUpdate(this.addForm).then(res => { |
|||
|
|||
if (res.code === '') { |
|||
this.$message({ |
|||
message: '修改成功', |
|||
type: 'success' |
|||
}) |
|||
} |
|||
this.getAll(this.formInline) |
|||
this.addFormDialog = false |
|||
}) |
|||
} |
|||
} else { |
|||
console.log('error submit!!') |
|||
return false |
|||
} |
|||
}) |
|||
}, |
|||
// 编辑角色 |
|||
edit(row) { |
|||
this.addForm = row |
|||
this.userState = 0; |
|||
this.addFormDialog = true |
|||
}, |
|||
// 删除 |
|||
async del(row) { |
|||
langInfoDelete({ id: row.id }).then(res => { |
|||
if (res.code === '') { |
|||
this.$message({ |
|||
type: 'success', |
|||
message: '删除成功!' |
|||
}) |
|||
} |
|||
this.getAll(this.formInline) |
|||
}) |
|||
}, |
|||
|
|||
|
|||
// 初始化查询所有数据 |
|||
async getAll(formInline) { |
|||
const res = await langInfoGetAll(formInline) |
|||
this.tableData = res.data.list |
|||
this.total = res.data.total |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
<style lang='scss' scoped> |
|||
//@import url(); 引入公共css类 |
|||
@import url("../../styles/elDialog.scss"); |
|||
.userStyle { |
|||
background: #FFFFFF; |
|||
border-radius: 10px; |
|||
padding: 20px; |
|||
} |
|||
</style> |
11867
yarn.lock
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
Write
Preview
Loading…
Cancel
Save
Reference in new issue