Commit 8b7b9be0 authored by 沈翠玲's avatar 沈翠玲

国际化

parent 8a15b9a3
import type { Settings as LayoutSettings } from '@ant-design/pro-layout';
import { setLocale } from 'umi';
import { PageLoading } from '@ant-design/pro-layout';
import type { RunTimeLayoutConfig, RequestConfig } from 'umi';
import { history, Link, matchPath } from 'umi';
import type { RequestInterceptor, ResponseInterceptor } from 'umi-request';
import RightContent from '@/components/RightContent';
import Footer from '@/components/Footer';
import { FormattedMessage } from 'umi';
import {
currentUser as queryCurrentUser,
token as getToken,
......@@ -87,7 +89,6 @@ const authHeaderInterceptor: RequestInterceptor = (url, options) => {
},
};
};
const _401ResponseInterceptor: ResponseInterceptor = (resp) => {
if (resp.status == 401) {
return {
......@@ -195,7 +196,6 @@ export async function getInitialState(): Promise<{
return msg;
} else {
history.push(loginPath);
}
} catch (error) {
history.push(loginPath);
......@@ -205,6 +205,9 @@ export async function getInitialState(): Promise<{
// 如果是登录页面,不执行
if (history.location.pathname !== loginPath) {
const currentUser = await fetchUserInfo();
if (currentUser && currentUser.user.locale) {
setLocale(currentUser.user.locale)
}
return {
fetchUserInfo,
currentUser,
......@@ -239,6 +242,7 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) =
} else return [];
},
},
title: localStorage.getItem('umi_locale') === 'th-TH' ? 'ระบบ Kanban' : '看板系统',
rightContentRender: () => <RightContent />,
disableContentMargin: false,
footerRender: () => <Footer />,
......
......@@ -6,7 +6,7 @@ import HeaderDropdown from '../HeaderDropdown';
import styles from './index.less';
import { logout as outLogin } from '@/services/mgr/api';
import type { MenuInfo } from 'rc-menu/lib/interface';
import { FormattedMessage } from 'umi';
export type GlobalHeaderRightProps = {
menu?: boolean;
};
......@@ -62,20 +62,20 @@ const AvatarDropdown: React.FC<GlobalHeaderRightProps> = ({ menu }) => {
{menu && (
<Menu.Item key="info">
<UserOutlined />
个人信息
<FormattedMessage id="个人信息" />
</Menu.Item>
)}
{menu && (
<Menu.Item key="updatePwd">
<SettingOutlined />
修改密码
<FormattedMessage id="menu.personalSetting.pwd" />
</Menu.Item>
)}
{menu && <Menu.Divider />}
<Menu.Item key="logout">
<LogoutOutlined />
退出登录
<FormattedMessage id="退出登录" />
</Menu.Item>
</Menu>
);
......
import { Space } from 'antd';
import React from 'react';
import { useModel, SelectLang } from 'umi';
import { useModel } from 'umi';
import Avatar from './AvatarDropdown';
import styles from './index.less';
......@@ -22,7 +22,6 @@ const GlobalHeaderRight: React.FC = () => {
return (
<Space className={className}>
<Avatar />
<SelectLang className={styles.action} />
</Space>
);
};
......
......@@ -145,6 +145,5 @@ RightContent 是以上几个组件的组合,同时新增了 plugins 的 `Selec
<Tag color={ENVTagColor[REACT_APP_ENV]}>{REACT_APP_ENV}</Tag>
</span>
)}
<SelectLang className={styles.action} />
</Space>
```
import component from './zh-TW/component';
import globalHeader from './zh-TW/globalHeader';
import menu from './zh-TW/menu';
import pwa from './zh-TW/pwa';
import settingDrawer from './zh-TW/settingDrawer';
import settings from './zh-TW/settings';
import pages from './zh-TW/pages';
import model from './zh-TW/model';
import component from './th-TH/component';
import globalHeader from './th-TH/globalHeader';
import menu from './th-TH/menu';
import pwa from './th-TH/pwa';
import settingDrawer from './th-TH/settingDrawer';
import settings from './th-TH/settings';
import pages from './th-TH/pages';
import model from './th-TH/model';
import kanban from './th-TH/kanban';
export default {
'navBar.lang': '語言',
......@@ -13,8 +14,10 @@ export default {
'layout.user.link.privacy': '隱私',
'layout.user.link.terms': '條款',
'app.copyright.produced': '上海領根資訊科技有限公司',
'app.login': '请登录',
...pages,
...model,
...kanban,
...globalHeader,
...menu,
...settingDrawer,
......
export default {
'生产综合看板': 'กระดานการผลิตรวม',
'异常分布': 'การกระจายข้อผิดพลาด',
'工序产量': 'ผลผลิตตามกระบวนการ',
'不合格分布': 'การกระจายผลิตภัณฑ์ที่ไม่ผ่าน',
'当月工序合格率': 'อัตราผลิตภัณฑ์ที่ผ่านตามกระบวนการในเดือนนี้',
'当月异常': 'ข้อผิดพลาดในเดือนนี้',
'未关闭': 'ยังไม่ปิด',
'超期': 'เกินกำหนด',
'设备异常明细': 'รายละเอียดข้อผิดพลาดอุปกรณ์',
'设备正常数': 'จำนวนอุปกรณ์ที่ปกติ',
'设备异常数': 'จำนวนอุปกรณ์ที่มีข้อผิดพลาด',
'设备故障总数': 'จำนวนอุปกรณ์ที่เสียทั้งหมด',
'月计划': 'แผนรายเดือน',
'实际完工': 'งานที่เสร็จจริง',
'超期完工': 'งานที่เสร็จเกินกำหนด',
'计划量': 'ปริมาณตามแผน',
'完成量': 'ปริมาณที่เสร็จสิ้น',
'合格量': 'ปริมาณที่ผ่านมาตรฐาน',
'月度计划&OTD指标': 'แผนรายเดือน & ตัวชี้วัด OTD',
'月计划达成率': 'อัตราการบรรลุแผนรายเดือน',
'上线准时': 'เริ่มการผลิตตรงเวลา',
'下线准时': 'เสร็จสิ้นการผลิตตรงเวลา',
'产品合格': 'ผลิตภัณฑ์ผ่านมาตรฐาน',
'历史月待完工': 'งานที่รอเสร็จในเดือนก่อนหน้า',
'月计划达成率标': 'เกณฑ์อัตราการบรรลุแผนรายเดือน',
'设备': 'อุปกรณ์',
'生产': 'การผลิต',
'合格率': 'อัตราคุณสมบัติ',
'设置': 'การตั้งค่า',
'适配窗口': 'หน้าต่างที่เหมาะสม',
'刷新时间间隔(秒)': 'รีเฟรชช่วงเวลา (วินาที)',
'内容滚动(秒)': 'เลื่อนเนื้อหา (วินาที)',
'取消': 'การยกเลิก',
'确认': 'ยืนยัน'
}
;
\ No newline at end of file
This diff is collapsed.
export default {
'看板系统': 'ระบบ Kanban',
'pages.welcome.speech': 'ยินดีต้อนรับสู่ระบบ Kanban',
'pages.login.success': 'เข้าสู่ระบบสำเร็จ!',
'pages.login.failure': 'เข้าสู่ระบบล้มเหลวโปรดลองอีกครั้ง!',
'pages.login.submit': 'เข้าสู่ระบบ',
'pages.login.username.placeholder': 'ชื่อผู้ใช้',
'pages.login.username.required': 'กรุณากรอกชื่อผู้ใช้',
'pages.login.password.placeholder': 'รหัสผ่าน',
'pages.login.password.required': 'กรุณากรอกรหัสผ่าน',
'pages.login.rememberMe': 'เข้าสู่ระบบอัตโนมัติ',
'pages.login.forgotPassword': 'ลืมรหัสผ่าน',
'pages.login.noAccount': 'ไม่มีบัญชี?',
'pages.login.registerAccount': 'ลงทะเบียนตอนนี้'
};
\ No newline at end of file
......@@ -6,6 +6,7 @@ import settingDrawer from './zh-CN/settingDrawer';
import settings from './zh-CN/settings';
import pages from './zh-CN/pages';
import model from './zh-CN/model';
import kanban from './zh-CN/kanban';
export default {
'navBar.lang': '语言',
......@@ -15,6 +16,7 @@ export default {
'app.copyright.produced': '腾燊嘉城',
'app.login': '请登录',
...pages,
...kanban,
...model,
...globalHeader,
...menu,
......
export default {
'生产综合看板': '生产综合看板',
'异常分布': '异常分布',
'工序产量': '工序产量',
'不合格分布': '不合格分布',
'当月工序合格率': '当月工序合格率',
'当月异常': '当月异常',
'未关闭': '未关闭',
'超期': '超期',
'设备异常明细': '设备异常明细',
'设备正常数': '设备正常数',
'设备异常数': '设备异常数',
'设备故障总数': '设备故障总数',
'月计划': '月计划',
'实际完工': '实际完工',
'超期完工': '超期完工',
'计划量': '计划量',
'完成量': '完成量',
'合格量': '合格量',
'月度计划&OTD指标': '月度计划&OTD指标',
'月计划达成率': '月计划达成率',
'上线准时': '上线准时',
'下线准时': '下线准时',
'产品合格': '产品合格',
'历史月待完工': '历史月待完工',
'月计划达成率标': '月计划达成率标',
'设备': '设备',
'生产': '生产',
'合格率': '合格率',
'设置': '设置',
'适配窗口': '适配窗口',
'刷新时间间隔(秒)': '刷新时间间隔(秒)',
'内容滚动(秒)': '内容滚动(秒)',
'取消': '取消',
'确认': '确认'
};
\ No newline at end of file
......@@ -97,4 +97,6 @@ export default {
'menu.personalSetting': '个人中心',
'menu.personalSetting.pwd': '修改密码',
'退出登录': '退出登录',
'个人信息': '个人信息'
};
export default {
'pages.layouts.userLayout.main': '看板系统',
'pages.layouts.userLayout.subtitle':
"China's well-known energy and gas equipment manufacturer, complete technology integrator and leading enterprise",
'看板系统': '看板系统',
'pages.welcome.speech': '欢迎登陆看板系统',
'pages.login.success': '登录成功!',
......@@ -15,12 +12,5 @@ export default {
'pages.login.rememberMe': '自动登录',
'pages.login.forgotPassword': '忘记密码',
'pages.login.noAccount': '没有帐户?',
'pages.login.registerAccount': '立即注册',
'pages.employee.main.createForm.title': '新增员工',
'pages.employee.main.editForm.title': '编辑员工',
'pages.report.reportOperationSetting.editForm.title': '编辑报表工序设置',
'pages.report.monthlyPlan.createForm.title': '新增月计划',
'pages.report.monthlyPlan.editForm.title': '编辑月计划',
'pages.login.registerAccount': '立即注册'
};
export default {
'menu.login': '登錄',
'menu.welcome': '歡迎',
'menu.devicestatus': '設備狀態看板',
'menu.deviceefficiency': '設備效率看板',
'menu.deviceefficiencyReport': '設備效率報表',
};
export default {
'pages.layouts.userLayout.main': '看板系统',
'pages.welcome.speech': '歡迎登陸看板系统',
'pages.login.success': '登錄成功!',
'pages.login.failure': '登錄失敗,請重試!',
'pages.login.submit': '登錄',
'pages.login.username.placeholder': '用戶名',
'pages.login.username.required': '請輸入用戶名',
'pages.login.password.placeholder': '密碼',
'pages.login.password.required': '請輸入密碼',
'pages.login.rememberMe': '自動登錄',
'pages.login.forgotPassword': '忘記密碼',
'pages.login.noAccount': '沒有帳戶?',
'pages.login.registerAccount': '立即注冊',
'pages.item.main.createForm.title': '新增物料',
'pages.item.main.editForm.title': '編輯物料',
'pages.product.main.createForm.title': '新增産品',
'pages.product.main.editForm.title': '編輯産品',
'pages.product.main.viewForm.title': '查看産品',
'pages.fileInfor.main.importFileForm.title': '上傳文件',
'pages.fileInfor.main.removeForm.title': '刪除文件',
'pages.inspectionCompany.main.createForm.title': '新增檢驗單位',
'pages.inspectionCompany.main.editForm.title': '編輯檢驗單位',
'pages.fillingCompany.main.createForm.title': '新增充裝單位',
'pages.fillingCompany.main.editForm.title': '編輯充裝單位',
'pages.employee.main.createForm.title': '新增員工',
'pages.employee.main.editForm.title': '編輯員工',
};
......@@ -22,7 +22,7 @@
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
/>
<title>看板系统</title>
<title></title>
<link rel="icon" href="<%= context.config.publicPath +'logo.png'%>" type="image/x-icon" />
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
......@@ -231,7 +231,6 @@
width="32"
style="margin-right: 8px"
/>
看板系统
</div>
</div>
</div>
......
......@@ -3,11 +3,11 @@ import * as echarts from 'echarts/lib/echarts';
import { ECharts, getInstanceByDom } from 'echarts';
import { Modal } from 'antd';
import DeviceAbnormal from '../../../materialSynthesis/components/abnormal/deviceAbnormal';
import moment from 'moment';
type ErrorDetailCriteria = KANBAN.ProductionComprehens.ErrorDetailCriteria;
type ErrorDetailSetting = KANBAN.ProductionComprehens.ErrorDetailSetting;
import { useIntl, getIntl } from 'umi';
const formatOptions = (data: any) => {
const intl = getIntl();
const option = {
color: [
{
......@@ -70,6 +70,8 @@ const formatOptions = (data: any) => {
},
grid: {
bottom: 10,
containLabel: true,
left: 10,
top: 20,
},
xAxis: {
......@@ -78,7 +80,7 @@ const formatOptions = (data: any) => {
},
yAxis: {
type: 'category',
data: ['设备'],
data: [intl.formatMessage({id:'设备'})],
axisLabel: {
color: '#fff',
fontSize: 16,
......@@ -105,9 +107,9 @@ const formatOptions = (data: any) => {
data: [],
};
option.series.push({ ...temp, name: '当月异常', data: [data.totalCt] });
option.series.push({ ...temp, name: '未关闭', data: [data.unCloseCt] });
option.series.push({ ...temp, name: '超期', data: [data.expireUnClose] });
option.series.push({ ...temp, name: intl.formatMessage({id:'当月异常'}), data: [data.totalCt] });
option.series.push({ ...temp, name: intl.formatMessage({id:'未关闭'}), data: [data.unCloseCt] });
option.series.push({ ...temp, name: intl.formatMessage({id:'超期'}), data: [data.expireUnClose] });
return option;
};
......@@ -116,6 +118,7 @@ const Main: React.FC<{ data: any; setting: ErrorDetailSetting }> = ({ data, sett
const [isModalOpen, setIsModalOpen] = useState(false);
const closeModal = () => setIsModalOpen(false);
const [criteria, setCriteria] = useState<ErrorDetailCriteria>();
const intl = useIntl();
useEffect(() => {
// Initialize chart
let chart: ECharts | undefined;
......@@ -198,7 +201,7 @@ const Main: React.FC<{ data: any; setting: ErrorDetailSetting }> = ({ data, sett
<>
<div ref={chartRef} style={{ height: '210px' }} />
<Modal
title={'设备异常明细'}
title={intl.formatMessage({id: '设备异常明细'})}
visible={isModalOpen}
footer={null}
width={'70%'}
......
......@@ -5,7 +5,7 @@ import DeviceCountTable from './deviceCount';
import styles from '../../index.less';
import { Modal } from 'antd';
import { useState } from 'react';
import { useIntl } from 'umi';
type EquipmentDetailCriteria = KANBAN.ProductionComprehens.EquipmentDetailCriteria;
type ErrorDetailSetting = KANBAN.ProductionComprehens.ErrorDetailSetting;
......@@ -15,6 +15,7 @@ const Abnormal: React.FC<{
abnormalDeviceData: any;
setting: ErrorDetailSetting;
}> = ({ abnormalProdData, abnormalQualityData, abnormalDeviceData, setting }) => {
const intl = useIntl();
const [isModalOpen, setIsModalOpen] = useState(false);
const [criteria, setCriteria] = useState<EquipmentDetailCriteria>();
const closeModal = () => setIsModalOpen(false);
......@@ -37,11 +38,11 @@ const Abnormal: React.FC<{
</div>
<div className={styles.bottomContainer}>
<div className={styles.bottomItem}>
<p>设备正常数</p>
<p>{intl.formatMessage({id: '设备正常数'})}</p>
<h2 onClick={() => openModal(1)}>{abnormalDeviceData.equipCt}</h2>
</div>
<div className={styles.bottomItemRight} style={{ marginLeft: '10px' }}>
<p>设备异常数</p>
<p>{intl.formatMessage({id: '设备异常数'})}</p>
<h2 onClick={() => openModal(2)}>{abnormalDeviceData.equipErrorCt}</h2>
</div>
</div>
......
......@@ -3,12 +3,13 @@ import * as echarts from 'echarts/lib/echarts';
import { ECharts, getInstanceByDom } from 'echarts';
import { Modal } from 'antd';
import ProductAbnormal from '../../../materialSynthesis/components/abnormal/productAbnormal';
import moment from 'moment';
import { getIntl } from 'umi';
type ErrorDetailCriteria = KANBAN.ProductionComprehens.ErrorDetailCriteria;
type ErrorDetailSetting = KANBAN.ProductionComprehens.ErrorDetailSetting;
const formatOptions = (data: any) => {
const intl = getIntl();
const option = {
color: [
{
......@@ -77,6 +78,8 @@ const formatOptions = (data: any) => {
},
grid: {
bottom: 10,
containLabel: true,
left: 10,
top: 20,
},
xAxis: {
......@@ -85,7 +88,7 @@ const formatOptions = (data: any) => {
},
yAxis: {
type: 'category',
data: ['生产'],
data: [intl.formatMessage({id:'生产'})],
axisLabel: {
color: '#fff',
fontSize: 16,
......@@ -112,9 +115,9 @@ const formatOptions = (data: any) => {
data: [],
};
option.series.push({ ...temp, name: '当月异常', data: [data.totalCt] });
option.series.push({ ...temp, name: '未关闭', data: [data.unCloseCt] });
option.series.push({ ...temp, name: '超期', data: [data.expireUnClose] });
option.series.push({ ...temp, name: intl.formatMessage({id:'当月异常'}), data: [data.totalCt] });
option.series.push({ ...temp, name: intl.formatMessage({id:'未关闭'}), data: [data.unCloseCt] });
option.series.push({ ...temp, name: intl.formatMessage({id:'超期'}), data: [data.expireUnClose] });
return option;
};
......
......@@ -8,8 +8,10 @@ import moment from 'moment';
type ErrorDetailCriteria = KANBAN.ProductionComprehens.ErrorDetailCriteria;
type ErrorDetailSetting = KANBAN.ProductionComprehens.ErrorDetailSetting;
import { useIntl, getIntl } from 'umi';
const formatOptions = (data: any) => {
const intl = getIntl();
const option = {
tooltip: {},
color: [
......@@ -91,7 +93,7 @@ const formatOptions = (data: any) => {
},
yAxis: {
type: 'value',
data: ['质量'],
data: [],
splitLine: {
show: false
},
......@@ -133,7 +135,7 @@ const formatOptions = (data: any) => {
option['xAxis']['data'] = lastSevenDays.reverse()
// option.series.push({ ...temp, name: '当月异常', data: [data.totalCt] });
// option.series.push({ ...temp, name: '未关闭', data: [data.unCloseCt] });
option.series.push({ ...temp, name: '设备故障总数', data: data.reverse()} );
option.series.push({ ...temp, name: intl.formatMessage({id:'设备故障总数'}), data: data.reverse()} );
return option;
};
......
......@@ -11,6 +11,7 @@ import {
queryPlanQuantityPenetratingByKanban,
queryMonthPlanRateData,
} from '../../services/api';
import { useIntl } from 'umi';
type MonthlyPlanProps = KANBAN.ProductionComprehens.WorkOrderMonthlyIndexData;
......@@ -18,6 +19,7 @@ const Main: React.FC<{ data: MonthlyPlanProps; kanbanId: string | undefined }> =
data,
kanbanId,
}) => {
const intl = useIntl();
// 趋势图
const bgTemp = [
'',
......@@ -103,9 +105,9 @@ const Main: React.FC<{ data: MonthlyPlanProps; kanbanId: string | undefined }> =
return (
<>
<div className={styles.centerTopTitle}>
<h4 onClick={openAnnualPlan}>月度计划&OTD指标</h4>
<h4 onClick={openAnnualPlan}>{intl.formatMessage({id: '月度计划&OTD指标'})}</h4>
<p onClick={openMonth}>
月计划达成率<span>{data.monthPlanConcludeRatio}%</span>
{intl.formatMessage({id: '月计划达成率标'})}<span>{data.monthPlanConcludeRatio}%</span>
</p>
</div>
<div className={styles.centerTopChart}>
......@@ -113,19 +115,19 @@ const Main: React.FC<{ data: MonthlyPlanProps; kanbanId: string | undefined }> =
</div>
<div className={styles.centerTopItemContainer}>
<div className={styles.centerTopItem} onClick={() => clickBg(1)}>
<p>上线准时</p>
<p>{intl.formatMessage({id: '上线准时'})}</p>
<h2 onClick={(e) => clickNum(e, 1)}>{data.startOnTimeRatio}%</h2>
</div>
<div className={styles.centerTopItem} onClick={() => clickBg(2)}>
<p>下线准时</p>
<p>{intl.formatMessage({id: '下线准时'})}</p>
<h2 onClick={(e) => clickNum(e, 2)}>{data.endOnTimeRatio}%</h2>
</div>
<div className={styles.centerTopItem} onClick={() => clickBg(3)}>
<p>产品合格</p>
<p>{intl.formatMessage({id: '产品合格'})}</p>
<h2 onClick={(e) => clickNum(e, 3)}>{data.qualifiedRatio}%</h2>
</div>
<div className={styles.centerTopItem} style={{ marginRight: '0px' }}>
<p>历史月待完工</p>
<p>{intl.formatMessage({id: '历史月待完工'})}</p>
<h2 onClick={(e) => clickNum(e, 5)}>{data.hisPendingQuantity}</h2>
</div>
</div>
......
import { useEffect, useRef } from 'react';
import * as echarts from 'echarts/lib/echarts';
import { ECharts, getInstanceByDom } from 'echarts';
import { getIntl } from 'umi';
type MonthlyPlanChartProps = {
data: any;
onOpenModal: (e: undefined, type: number) => void;
};
const formatOptions = (data: any) => {
const intl = getIntl();
const option = {
color: [
{
......@@ -117,9 +118,9 @@ const formatOptions = (data: any) => {
data: [],
};
option.series.push({ ...temp, name: '月计划', data: [data.monthPlanQuantity] });
option.series.push({ ...temp, name: '实际完工', data: [data.actualFinishQuantity] });
option.series.push({ ...temp, name: '超期完工', data: [data.expireFinishQuantity] });
option.series.push({ ...temp, name: intl.formatMessage({id: '月计划'}), data: [data.monthPlanQuantity] });
option.series.push({ ...temp, name: intl.formatMessage({id: '实际完工'}), data: [data.actualFinishQuantity] });
option.series.push({ ...temp, name: intl.formatMessage({id: '超期完工'}), data: [data.expireFinishQuantity] });
return option;
};
......
......@@ -5,13 +5,14 @@ import React, { useEffect, useRef, useState } from 'react';
import ModalChart from './modalChart';
import QualityErrorTable from './qualityErrorTable';
import { queryPunctualityPenetratingByKanban } from '../../services/api';
import { getIntl } from 'umi';
type ProcessFailProps = {
data: KANBAN.ProductionComprehens.ProcessDefectRatioData[];
setting: any;
};
const formatOptions = (data: any) => {
const intl = getIntl();
const option = {
color: [
{
......@@ -109,7 +110,7 @@ const formatOptions = (data: any) => {
};
if (data && data.length) {
const lenged = [
{ label: '合格率', field: 'qualifiedRate' }
{ label: intl.formatMessage({id: '合格率'}), field: 'qualifiedRate' }
];
const xAxisData = data.map((item: any) => item.processName);
const series = lenged.map((item) => {
......
......@@ -4,13 +4,14 @@ import type { ECharts } from 'echarts';
import { getInstanceByDom } from 'echarts';
import ModalTable from './modalTable';
import { Modal } from 'antd';
import { getIntl } from 'umi';
type ProcessOutProps = {
data: KANBAN.ProductionComprehens.ProcessYieldData[];
setting: any;
};
const formatOptions = (data: any) => {
const intl = getIntl();
const option = {
color: [
{
......@@ -119,9 +120,9 @@ const formatOptions = (data: any) => {
};
if (data && data.length) {
const lenged = [
{ label: '计划量', field: 'planQuantity' },
{ label: '完成量', field: 'finishQuantity' },
{ label: '合格量', field: 'qualifiedQuantity' },
{ label: intl.formatMessage({id: '计划量'}), field: 'planQuantity' },
{ label: intl.formatMessage({id: '完成量'}), field: 'finishQuantity' },
{ label: intl.formatMessage({id: '合格量'}), field: 'qualifiedQuantity' },
];
const xAxisData = data.map((item: any) => item.processName);
const series = lenged.map((item) => {
......
import React, { useRef, useState } from 'react';
import { useIntl } from 'umi';
import ProForm, {
DrawerForm,
ProFormCheckbox,
......@@ -38,6 +39,7 @@ export type SettingFormProps = {
const SettingForm: React.FC<SettingFormProps> = (props) => {
const formRef = useRef<ProFormInstance>();
const intl = useIntl();
const [productionProgressKanbanSettings, setProductionProgressKanbanSettings] = useState<
KanbanSetting[]
>([]);
......@@ -45,8 +47,14 @@ const SettingForm: React.FC<SettingFormProps> = (props) => {
return (
<DrawerForm
formRef={formRef}
title="设置"
title={intl.formatMessage({id: '设置'})}
width={600}
submitter={{
searchConfig: {
resetText: intl.formatMessage({id: '取消'}),
submitText: intl.formatMessage({id: '确认'}),
}
}}
visible={props.visible}
onVisibleChange={(visible: boolean) => {
if (visible) {
......@@ -65,10 +73,10 @@ const SettingForm: React.FC<SettingFormProps> = (props) => {
props.onVisibleChange(false);
}}
>
<ProFormCheckbox name="autoResize" label="适配窗口" width="xl" />
<ProFormCheckbox name="autoResize" label={intl.formatMessage({id: '适配窗口'})} width="xl" />
<ProFormDigit
name="intervalTime"
label="刷新时间间隔(秒)"
label={intl.formatMessage({id: '刷新时间间隔(秒)'})}
required
width="xl"
min={10}
......@@ -76,7 +84,7 @@ const SettingForm: React.FC<SettingFormProps> = (props) => {
/>
<ProFormDigit
name="rowMovingTime"
label="内容滚动(秒)"
label={intl.formatMessage({id: '内容滚动(秒)'})}
required
width="xl"
min={1}
......
......@@ -71,7 +71,8 @@
background-size: 100% 100%;
p {
margin-bottom: 0;
font-size: 20px;
font-size: 18px;
line-height: 18px;
}
h2 {
margin-bottom: 0;
......@@ -132,7 +133,7 @@
background: #040f24;
p {
margin-bottom: 15px;
font-size: 20px;
font-size: 18px;
}
h2 {
display: inline-block;
......
......@@ -8,6 +8,7 @@ import MonthlyPlan from './components/MonthlyPlan';
import PassingRate from './components/PassingRate';
import type { Setting } from './components/SettingForm';
import SettingForm from './components/SettingForm';
import { useIntl } from 'umi';
import {
queryProductionComprehensProcessOutputData,
currentMonthStat,
......@@ -191,11 +192,13 @@ const Main: React.FC = () => {
}
};
}, [setting]);
const intl = useIntl();
return (
<>
<KanbanStyle
headerText="生产综合看板"
headerText={intl.formatMessage({
id: '生产综合看板'
})}
subTitle={setting.productionComprehensKanbanSetting?.kanbTitle}
autoResize={setting.autoResize}
onHeaderClick={() => {
......@@ -205,7 +208,7 @@ const Main: React.FC = () => {
<div className={styles.main}>
{/* 左边部分:异常分布 */}
<div className={styles.leftContainer}>
<div className={styles.topContainer}>异常分布</div>
<div className={styles.topContainer}>{intl.formatMessage({id: '异常分布'})}</div>
<Abnormal
abnormalDeviceData={abnormalDeviceData}
abnormalQualityData={abnormalQualityData}
......@@ -233,7 +236,7 @@ const Main: React.FC = () => {
</div>
<div className={styles.centerBottomContainer}>
<div className={styles.centerBottomBg}>
<div className={styles.centerBottomTitle}>工序产量</div>
<div className={styles.centerBottomTitle}>{intl.formatMessage({id: '工序产量'})}</div>
<div style={{ height: '260px', padding: '0px 20px' }}>
<ProcessOutput data={processYieldData} setting={setting} />
</div>
......@@ -245,7 +248,7 @@ const Main: React.FC = () => {
<div className={styles.rightContainer}>
{/* 焊接一次通过率 */}
<div className={styles.rightTopContainer}>
<div className={styles.rightTopTitle}>不合格分布</div>
<div className={styles.rightTopTitle}>{intl.formatMessage({id: '不合格分布'})}</div>
<div className={styles.rightTopBottomContainer}>
<PassingRate
data={countWeldingPassRate}
......@@ -256,7 +259,7 @@ const Main: React.FC = () => {
{/* 当月工序合格率 */}
<div className={styles.rightBottomContainer}>
<div className={styles.rightBottomContent}>
<div className={styles.rightBottomTitle}>当月工序合格率</div>
<div className={styles.rightBottomTitle}>{intl.formatMessage({id: '当月工序合格率'})}</div>
<div style={{ padding: '0 20px', height: '376px' }}>
<ProcessFail data={processDefectRatioData} setting={setting} />
</div>
......
......@@ -38,6 +38,8 @@
.top {
text-align: center;
margin-top: 40px;
margin-bottom: 40px;
}
.header {
......
import styles from './index.less';
import React, { useState } from 'react';
import { Alert, message } from 'antd';
import { Link, SelectLang, useIntl, FormattedMessage, useModel, history } from 'umi';
import { Link, useIntl, FormattedMessage, useModel, history } from 'umi';
import ProForm, { ProFormText, ProFormCheckbox } from '@ant-design/pro-form';
import { UserOutlined, LockOutlined, CloseCircleOutlined } from '@ant-design/icons';
import Footer from '@/components/Footer';
......@@ -76,16 +76,13 @@ const Login: React.FC = () => {
return (
<div className={styles.container}>
<div className={styles.lang} data-lang>
{SelectLang && <SelectLang />}
</div>
<div className={styles.content}>
<div className={styles.top}>
<div className={styles.header}>
<Link to="/">
<img alt="logo" className={styles.logo} src="logo.png" />
<span className={styles.title}>
<FormattedMessage id="pages.layouts.userLayout.main" defaultMessage="看板系统" />
<FormattedMessage id="看板系统" defaultMessage="看板系统" />
</span>
</Link>
</div>
......
......@@ -84,7 +84,7 @@ declare namespace Api {
} & IdDto;
type CurrentUser = {
user: any;
user: T;
roles: any[];
code: number;
};
......
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