Commit 01930c27 authored by sunhongwei's avatar sunhongwei

国际化

parent be0a8d15
......@@ -5,7 +5,7 @@ ENV = 'development'
VUE_APP_TITLE = 捷道管理系统
# 捷道管理系统/开发环境
VUE_APP_BASE_API = '/dev-api'
VUE_APP_BASE_API = 'http://jd.admtest.jdshangmen.com'
# VUE_APP_BASE_API = '/api'
# 路由懒加载
......
......@@ -16,6 +16,14 @@ export function getDoneTaskPage(query) {
})
}
export function getCopyTaskPage(query) {
return request({
url: '/bpm/task/copy-page',
method: 'get',
params: query
})
}
export function completeTask(data) {
return request({
url: '/bpm/task/complete',
......
......@@ -25,6 +25,10 @@
</template>
<el-select v-model="locale" placeholder="语言" class="right-menu-item" style="width: 116px;" @change="localeChange">
<el-option v-for="dict in langDatas" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
<div class="avatar-wrapper">
<img :src="avatar" class="user-avatar">
......@@ -56,8 +60,17 @@ import SizeSelect from '@/components/SizeSelect'
import Search from '@/components/HeaderSearch'
import RuoYiGit from '@/components/RuoYi/Git'
import RuoYiDoc from '@/components/RuoYi/Doc'
import {getLocale, saveLocale} from "@/utils/db";
import {LangEnum} from "@/utils/constants";
export default {
data() {
return {
locale: getLocale(),
// 枚举
langDatas: LangEnum.LANG,
}
},
components: {
Breadcrumb,
TopNav,
......@@ -95,6 +108,10 @@ export default {
toggleSideBar() {
this.$store.dispatch('app/toggleSideBar')
},
localeChange(value) {
console.log(value)
saveLocale(value)
},
async logout() {
this.$modal.confirm('确定注销并退出系统吗?', '提示').then(() => {
this.$store.dispatch('LogOut').then(() => {
......
......@@ -229,4 +229,9 @@ export const PayRefundStatusEnum = {
name: '退款关闭'
}
}
export const LangEnum = {
LANG: [
{'label':'中文', 'value': 'zh_CN'},
{'label':'English', 'value': 'en_US'}
]
}
......@@ -4,6 +4,8 @@ const DRAWING_ITEMS_VERSION_KEY = 'DRAWING_ITEMS_VERSION'
const DRAWING_ID = 'idGlobal'
const TREE_NODE_ID = 'treeNodeId'
const FORM_CONF = 'formConf'
const LOCALE_DEF = 'zh_CN'
const LOCALE_CONF = 'locale'
export function getDrawingList() {
// 加入缓存版本的概念,保证缓存数据与程序匹配
......@@ -52,3 +54,13 @@ export function getFormConf() {
export function saveFormConf(obj) {
localStorage.setItem(FORM_CONF, JSON.stringify(obj))
}
export function getLocale() {
const str = localStorage.getItem(LOCALE_CONF)
if (str) return str
return LOCALE_DEF
}
export function saveLocale(locale) {
localStorage.setItem(LOCALE_CONF, locale)
}
......@@ -5,10 +5,12 @@ import { getToken } from '@/utils/auth'
import errorCode from '@/utils/errorCode'
import Cookies from "js-cookie";
import {getTenantEnable} from "@/utils/ruoyi";
import { getLocale } from '@/utils/db';
// 是否显示重新登录
export let isRelogin = { show: false };
axios.defaults.headers['locale'] = getLocale()
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
// 创建axios实例
const service = axios.create({
......
......@@ -14,6 +14,11 @@
{{ processInstance.startUser.nickname }}
<el-tag type="info" size="mini">{{ processInstance.startUser.deptName }}</el-tag>
</el-form-item>
<el-form-item label="抄送人" prop="copyUserIds">
<el-select v-model="auditForms[index].copyUserIds" clearable multiple filterable style="width: 100%">
<el-option v-for="item in userOptions" :key="parseInt(item.id)" :label="item.nickname" :value="parseInt(item.id)" />
</el-select>
</el-form-item>
<el-form-item label="审批建议" prop="comment">
<el-input type="textarea" v-model="auditForms[index].comment" placeholder="请输入审批建议" />
</el-form-item>
......@@ -351,7 +356,8 @@ export default {
}
const data = {
id: task.id,
comment: this.auditForms[index].comment
comment: this.auditForms[index].comment,
copyUserIds: this.auditForms[index].copyUserIds
}
if (pass) {
approveTask(data).then(response => {
......
<template>
<div class="app-container">
<doc-alert title="工作流" url="https://doc.iocoder.cn/bpm" />
<!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="流程名" prop="name">
<el-input v-model="queryParams.name" placeholder="请输入流程名" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="任务编号" align="center" prop="id" width="320" />
<el-table-column label="任务名称" align="center" prop="name" />
<el-table-column label="所属流程" align="center" prop="processInstance.name" />
<el-table-column label="流程发起人" align="center" prop="processInstance.startUserNickname" />
<el-table-column label="创建时间" 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" prop="version" width="80">
<template slot-scope="scope">
<el-tag type="success" v-if="scope.row.suspensionState === 1">激活</el-tag>
<el-tag type="warning" v-if="scope.row.suspensionState === 2">挂起</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleAudit(scope.row)"
v-hasPermi="['bpm:task:query']">详情</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
</div>
</template>
<script>
import {getCopyTaskPage} from '@/api/bpm/task'
export default {
name: "Copy",
components: {
},
data() {
return {
// 遮罩层
loading: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 待办任务列表
list: [],
// 查询参数
dateRangeCreateTime: [],
queryParams: {
pageNo: 1,
pageSize: 10,
name: null,
},
};
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
// 处理查询参数
let params = {...this.queryParams};
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
getCopyTaskPage(params).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRangeCreateTime = [];
this.resetForm("queryForm");
this.handleQuery();
},
handleAudit(row) {
this.$router.push({ path: "/bpm/process-instance/detail", query: { id: row.processInstance.id}});
},
}
};
</script>
......@@ -25,7 +25,13 @@
<img :src="codeUrl" @click="getCode" class="login-code-img"/>
</div>
</el-form-item>
<el-form-item>
<el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox>
<el-select v-model="locale" placeholder="语言" style="float: right; width: 106px;" @change="localeChange">
<el-option v-for="dict in langDatas" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item style="width:100%;">
<el-button :loading="loading" size="medium" type="primary" style="width:100%;" @click.native.prevent="handleLogin">
<span v-if="!loading">登 录</span>
......@@ -54,8 +60,9 @@ import { getCodeImg,socialAuthRedirect } from "@/api/login";
import { getTenantIdByName } from "@/api/system/tenant";
import Cookies from "js-cookie";
import { encrypt, decrypt } from '@/utils/jsencrypt'
import {SystemUserSocialTypeEnum} from "@/utils/constants";
import {SystemUserSocialTypeEnum, LangEnum} from "@/utils/constants";
import { getTenantEnable } from "@/utils/ruoyi";
import { getLocale, saveLocale } from '@/utils/db';
export default {
name: "Login",
......@@ -102,8 +109,10 @@ export default {
},
loading: false,
redirect: undefined,
locale: getLocale(),
// 枚举
SysUserSocialTypeEnum: SystemUserSocialTypeEnum,
langDatas: LangEnum.LANG,
};
},
// watch: {
......@@ -176,6 +185,10 @@ export default {
}
});
},
localeChange(value) {
console.log(value)
saveLocale(value)
},
doSocialLogin(socialTypeEnum) {
// console.log("开始Oauth登录...%o", socialTypeEnum.code);
// 设置登录中
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment