diff --git a/src/lang/en_US.json b/src/lang/en_US.json
index 17b472e..76b4f4b 100644
--- a/src/lang/en_US.json
+++ b/src/lang/en_US.json
@@ -8,7 +8,10 @@
"password": "Password",
"login": "Login",
"code": "Verification Code",
- "copyright": ""
+ "copyright": "",
+ "momSystem": "Smart Manufacturing MOM Platform System",
+ "momPlatform": "MOM PlatformSystem",
+ "rememberPassword": "Remember password"
},
"navbar": {
"full": "Full Screen",
@@ -21,5 +24,53 @@
"layoutSetting": "Layout Setting",
"personalCenter": "Personal Center",
"logout": "Logout"
+ },
+ "baseFactoryInfo": {
+ "factoryCode": "Factory Code",
+ "factoryName": "Factory Name",
+ "factoryStatus": "Factory Status",
+ "companyName": "Company Name",
+ "timeZone": "Time Zone",
+ "remark": "Remark",
+ "tenantId": "Tenant ID",
+ "factoryId": "Factory ID",
+ "createBy": "Created By",
+ "createTime": "Create Time",
+ "updateBy": "Updated By",
+ "updateTime": "Update Time",
+ "operation": "Operation",
+ "search": "Search",
+ "reset": "Reset",
+ "add": "Add",
+ "edit": "Edit",
+ "delete": "Delete",
+ "export": "Export",
+ "confirm": "Confirm",
+ "cancel": "Cancel",
+ "placeholder": {
+ "factoryCode": "Please enter factory code",
+ "factoryName": "Please enter factory name",
+ "factoryStatus": "Please select factory status",
+ "companyName": "Please enter company name",
+ "timeZone": "Please select time zone",
+ "remark": "Please enter remark"
+ },
+ "dialog": {
+ "add": "Add Factory Info",
+ "edit": "Edit Factory Info"
+ },
+ "validation": {
+ "factoryIdRequired": "Factory ID cannot be empty",
+ "companyNameRequired": "Company name cannot be empty",
+ "factoryCodeRequired": "Factory code cannot be empty",
+ "factoryNameRequired": "Factory name cannot be empty",
+ "timeZoneRequired": "Time zone cannot be empty",
+ "factoryStatusRequired": "Factory status cannot be empty"
+ },
+ "message": {
+ "success": "Operation successful",
+ "deleteSuccess": "Delete successful",
+ "deleteConfirm": "Are you sure to delete factory info with code \"{ids}\"?"
+ }
}
}
diff --git a/src/lang/zh_CN.json b/src/lang/zh_CN.json
index 071598d..20c1791 100644
--- a/src/lang/zh_CN.json
+++ b/src/lang/zh_CN.json
@@ -8,7 +8,10 @@
"password": "密码",
"login": "登 录",
"code": "请输入验证码",
- "copyright": ""
+ "copyright": "",
+ "momSystem": "智造MOM平台系统",
+ "momPlatform": "智造MOM平台系统",
+ "rememberPassword": "记住密码"
},
"navbar": {
"full": "全屏",
@@ -21,5 +24,53 @@
"layoutSetting": "布局设置",
"personalCenter": "个人中心",
"logout": "退出登录"
+ },
+ "baseFactoryInfo": {
+ "factoryCode": "工厂编号",
+ "factoryName": "工厂名称",
+ "factoryStatus": "工厂状态",
+ "companyName": "公司名称",
+ "timeZone": "时区",
+ "remark": "备注",
+ "tenantId": "租户编号",
+ "factoryId": "主键标识",
+ "createBy": "创建人",
+ "createTime": "创建时间",
+ "updateBy": "更新人",
+ "updateTime": "更新时间",
+ "operation": "操作",
+ "search": "搜索",
+ "reset": "重置",
+ "add": "新增",
+ "edit": "修改",
+ "delete": "删除",
+ "export": "导出",
+ "confirm": "确定",
+ "cancel": "取消",
+ "placeholder": {
+ "factoryCode": "请输入工厂编号",
+ "factoryName": "请输入工厂名称",
+ "factoryStatus": "请选择工厂状态",
+ "companyName": "请输入公司名称",
+ "timeZone": "请选择时区",
+ "remark": "请输入备注"
+ },
+ "dialog": {
+ "add": "添加工厂信息",
+ "edit": "修改工厂信息"
+ },
+ "validation": {
+ "factoryIdRequired": "主键标识不能为空",
+ "companyNameRequired": "公司名称不能为空",
+ "factoryCodeRequired": "工厂编号不能为空",
+ "factoryNameRequired": "工厂名称不能为空",
+ "timeZoneRequired": "时区不能为空",
+ "factoryStatusRequired": "工厂状态不能为空"
+ },
+ "message": {
+ "success": "操作成功",
+ "deleteSuccess": "删除成功",
+ "deleteConfirm": "是否确认删除工厂信息编号为\"{ids}\"的数据项?"
+ }
}
}
diff --git a/src/layout/components/Sidebar/Logo.vue b/src/layout/components/Sidebar/Logo.vue
index c81a68d..38ab03b 100644
--- a/src/layout/components/Sidebar/Logo.vue
+++ b/src/layout/components/Sidebar/Logo.vue
@@ -27,14 +27,18 @@ import logo from '@/assets/logo/logo.png';
import useSettingsStore from '@/store/modules/settings';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+import { useI18n } from 'vue-i18n';
+
+// 使用 useI18n
+const { t, locale } = useI18n();
+
defineProps({
collapse: {
type: Boolean,
required: true
}
});
-
-const title = ref('智造MOM平台系统');
+const title = ref(String(t('login.momPlatform')));
const settingsStore = useSettingsStore();
const sideTheme = computed(() => settingsStore.sideTheme);
diff --git a/src/views/index.vue b/src/views/index.vue
index c91b459..4c9a309 100644
--- a/src/views/index.vue
+++ b/src/views/index.vue
@@ -2,7 +2,7 @@
- 智造MOM平台系统
+ {{ $t('login.momSystem') }}
diff --git a/src/views/login.vue b/src/views/login.vue
index d0b6aef..2e0d402 100644
--- a/src/views/login.vue
+++ b/src/views/login.vue
@@ -1,7 +1,12 @@
- 智造MOM平台系统
+
+
{{ $t('login.momSystem') }}
+
+
+
+
@@ -9,12 +14,12 @@
-
+
-
+
@@ -26,7 +31,7 @@
- 记住密码
+ {{ $t('login.rememberPassword') }}
@@ -56,7 +61,7 @@
@@ -68,6 +73,7 @@ import { useUserStore } from '@/store/modules/user';
import { LoginData, TenantVO } from '@/api/types';
import { to } from 'await-to-js';
import { HttpStatus } from '@/enums/RespEnum';
+import LangSelect from '@/components/LangSelect/index.vue';
const userStore = useUserStore();
const router = useRouter();
@@ -218,10 +224,42 @@ onMounted(() => {
background-size: cover;
}
-.title {
+.title-wrapper {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
margin: 0px auto 30px auto;
+}
+
+.title {
+ margin: 0;
text-align: center;
color: #707070;
+ flex: 1;
+}
+
+.lang-select-wrapper {
+ cursor: pointer;
+ transition: all 0.3s ease;
+
+ :deep(.lang-select--style) {
+ transition: all 0.3s ease;
+ padding: 4px 8px;
+ border-radius: 4px;
+
+ &:hover {
+ background-color: #f5f7fa;
+ transform: scale(1.1);
+ }
+
+ &:active {
+ transform: scale(0.95);
+ }
+ }
+
+ &:hover {
+ opacity: 0.8;
+ }
}
.login-form {
diff --git a/src/views/mes/baseFactoryInfo/index.vue b/src/views/mes/baseFactoryInfo/index.vue
index 6c702d1..4ba3e59 100644
--- a/src/views/mes/baseFactoryInfo/index.vue
+++ b/src/views/mes/baseFactoryInfo/index.vue
@@ -4,21 +4,21 @@
:leave-active-class='proxy?.animate.searchAnimate.leave'>
-
-
-
+
+
+
-
-
+
+
-
-
+
+
- 搜索
- 重置
+ {{ $t('baseFactoryInfo.search') }}
+ {{ $t('baseFactoryInfo.reset') }}
@@ -29,22 +29,22 @@
- 新增
+ {{ $t('baseFactoryInfo.add') }}
修改
+ v-hasPermi="['mes:baseFactoryInfo:edit']">{{ $t('baseFactoryInfo.edit') }}
删除
+ v-hasPermi="['mes:baseFactoryInfo:remove']">{{ $t('baseFactoryInfo.delete') }}
导出
+ v-hasPermi="['mes:baseFactoryInfo:export']">{{ $t('baseFactoryInfo.export') }}
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
+
+
+
{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}
-
-
+
+
{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}
-
+
-
+
-
+
@@ -98,17 +98,17 @@
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
-
+
+
@@ -150,9 +150,11 @@ import {
updateBaseFactoryInfo
} from '@/api/mes/baseFactoryInfo';
import { BaseFactoryInfoVO, BaseFactoryInfoQuery, BaseFactoryInfoForm } from '@/api/mes/baseFactoryInfo/types';
+import { useI18n } from 'vue-i18n';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { enable_status } = toRefs(proxy?.useDict('enable_status'));
+const { t } = useI18n();
const baseFactoryInfoList = ref([]);
const buttonLoading = ref(false);
@@ -172,19 +174,19 @@ const dialog = reactive({
});
// 列显隐信息
-const columns = ref([
- { key: 0, label: `主键标识`, visible: false },
- { key: 1, label: `租户编号`, visible: false },
- { key: 2, label: `公司名称`, visible: true },
- { key: 3, label: `工厂编号`, visible: true },
- { key: 4, label: `工厂名称`, visible: true },
- { key: 5, label: `时区`, visible: true },
- { key: 6, label: `工厂状态`, visible: true },
- { key: 7, label: `备注`, visible: true },
- { key: 8, label: `创建人`, visible: false },
- { key: 9, label: `创建时间`, visible: true },
- { key: 10, label: `更新人`, visible: false },
- { key: 11, label: `更新时间`, visible: false }
+const columns = computed(() => [
+ { key: 0, label: t('baseFactoryInfo.factoryId'), visible: false },
+ { key: 1, label: t('baseFactoryInfo.tenantId'), visible: false },
+ { key: 2, label: t('baseFactoryInfo.companyName'), visible: true },
+ { key: 3, label: t('baseFactoryInfo.factoryCode'), visible: true },
+ { key: 4, label: t('baseFactoryInfo.factoryName'), visible: true },
+ { key: 5, label: t('baseFactoryInfo.timeZone'), visible: true },
+ { key: 6, label: t('baseFactoryInfo.factoryStatus'), visible: true },
+ { key: 7, label: t('baseFactoryInfo.remark'), visible: true },
+ { key: 8, label: t('baseFactoryInfo.createBy'), visible: false },
+ { key: 9, label: t('baseFactoryInfo.createTime'), visible: true },
+ { key: 10, label: t('baseFactoryInfo.updateBy'), visible: false },
+ { key: 11, label: t('baseFactoryInfo.updateTime'), visible: false }
]);
const initFormData: BaseFactoryInfoForm = {
@@ -212,6 +214,27 @@ const timeZones = [
'Europe/Berlin'
];
+const getRules = () => ({
+ factoryId: [
+ { required: true, message: t('baseFactoryInfo.validation.factoryIdRequired'), trigger: 'blur' }
+ ],
+ companyName: [
+ { required: true, message: t('baseFactoryInfo.validation.companyNameRequired'), trigger: 'blur' }
+ ],
+ factoryCode: [
+ { required: true, message: t('baseFactoryInfo.validation.factoryCodeRequired'), trigger: 'blur' }
+ ],
+ factoryName: [
+ { required: true, message: t('baseFactoryInfo.validation.factoryNameRequired'), trigger: 'blur' }
+ ],
+ timeZone: [
+ { required: true, message: t('baseFactoryInfo.validation.timeZoneRequired'), trigger: 'blur' }
+ ],
+ factoryStatus: [
+ { required: true, message: t('baseFactoryInfo.validation.factoryStatusRequired'), trigger: 'change' }
+ ]
+});
+
const data = reactive>({
form: { ...initFormData },
queryParams: {
@@ -231,29 +254,12 @@ const data = reactive>({
updateTime: undefined,
params: {}
},
- rules: {
- factoryId: [
- { required: true, message: '主键标识不能为空', trigger: 'blur' }
- ],
- companyName: [
- { required: true, message: '公司名称不能为空', trigger: 'blur' }
- ],
- factoryCode: [
- { required: true, message: '工厂编号不能为空', trigger: 'blur' }
- ],
- factoryName: [
- { required: true, message: '工厂名称不能为空', trigger: 'blur' }
- ],
- timeZone: [
- { required: true, message: '时区不能为空', trigger: 'blur' }
- ],
- factoryStatus: [
- { required: true, message: '工厂状态不能为空', trigger: 'change' }
- ]
- },
+ rules: getRules()
});
-const { queryParams, form, rules } = toRefs(data);
+const rules = computed(() => getRules());
+
+const { queryParams, form } = toRefs(data);
/** 查询工厂信息列表 */
const getList = async () => {
@@ -299,7 +305,7 @@ const handleSelectionChange = (selection: BaseFactoryInfoVO[]) => {
const handleAdd = () => {
reset();
dialog.visible = true;
- dialog.title = '添加工厂信息';
+ dialog.title = t('baseFactoryInfo.dialog.add');
};
/** 修改按钮操作 */
@@ -309,7 +315,7 @@ const handleUpdate = async (row?: BaseFactoryInfoVO) => {
const res = await getBaseFactoryInfo(_factoryId);
Object.assign(form.value, res.data);
dialog.visible = true;
- dialog.title = '修改工厂信息';
+ dialog.title = t('baseFactoryInfo.dialog.edit');
};
/** 提交按钮 */
@@ -322,7 +328,7 @@ const submitForm = () => {
} else {
await addBaseFactoryInfo(form.value).finally(() => buttonLoading.value = false);
}
- proxy?.$modal.msgSuccess('操作成功');
+ proxy?.$modal.msgSuccess(t('baseFactoryInfo.message.success'));
dialog.visible = false;
await getList();
}
@@ -332,9 +338,9 @@ const submitForm = () => {
/** 删除按钮操作 */
const handleDelete = async (row?: BaseFactoryInfoVO) => {
const _factoryIds = row?.factoryId || ids.value;
- await proxy?.$modal.confirm('是否确认删除工厂信息编号为"' + _factoryIds + '"的数据项?').finally(() => loading.value = false);
+ await proxy?.$modal.confirm(t('baseFactoryInfo.message.deleteConfirm', { ids: _factoryIds })).finally(() => loading.value = false);
await delBaseFactoryInfo(_factoryIds);
- proxy?.$modal.msgSuccess('删除成功');
+ proxy?.$modal.msgSuccess(t('baseFactoryInfo.message.deleteSuccess'));
await getList();
};