Browse Source

移动端中英文转换

asd26269546 1 year ago
parent
commit
b049bb77cc
6 changed files with 69 additions and 120 deletions
  1. 39 96
      src/lang/cn.js
  2. 2 0
      src/main.js
  3. 7 7
      src/views/home/changePassword.vue
  4. 9 5
      src/views/home/feedback.vue
  5. 8 8
      src/views/home/index.vue
  6. 4 4
      src/views/main.vue

+ 39 - 96
src/lang/cn.js

@@ -1,105 +1,48 @@
 
 
 export const lang = {
 export const lang = {
-	equipment:{
-		stat:"状态",
-		model:'产品型号',
-		running:"运行中",
-		offLine:"离线",
-		standby:"待机",
-		auxiliaryMachine:"辅助机器",
-		yield:"产量",
-		temperature:"平均温度",
-		humidity:"平均湿度",
-		equipmentStatus:"设备状态",
-		operatingMode:"工作模式",
-		productionData:"产量数据",
-		ultimateOutput:"极限产量",
-		actualOutput:"实际产量",
+	common:{
+		//消息,工作台,物联网,我的,请输入关键词,添加没有更多了,释放即可刷新,下拉即可刷新,加载中,加载失败,加载完成,没有更多了,返回,提交,修改成功,新增成功,删除成功,确定,取消,提示
+		message:'消息',
+		workbench:'工作台',
+		things:'物联网',
+		mine:'我的',
+		pleaseEnterKeywords:'请输入关键词',
+		add:'添加',
+		noMore:'没有更多了',
+		releaseToRefresh:'释放即可刷新',
+		pullDownToRefresh:'下拉即可刷新',
+		loading:'加载中',
+		loadFailed:'加载失败',
+		loadComplete:'加载完成',
+		noMore:'没有更多了',
+		back:'返回',
+		submit:'提交',
+		modifySuccess:'修改成功',
+		addSuccess:'新增成功',
+		deleteSuccess:'删除成功',
+		confirm:'确定',
+		cancel:'取消',
+		prompt:'提示',
 	},
 	},
-	sterilization:{
-		name:"灭菌柜",
-		pressure:"气压",
-		gasTemp:"Gas Temp",
-		EO:"E.O.温度",
-		waterTemperature:"水温",
-		humidity:"湿度",
-		averageTemperature:"平均温度",
-		hotbox:"温箱",
+	home:{
+		//修改密码,新密码,请输入密码,新密码不能为空,我的反馈,反馈,全部,待回复,已回复
+		modifyPassword:'修改密码',
+		newPassword:'新密码',
+		pleaseEnterPassword:'请输入密码',
+		newPasswordCanNotBeEmpty:'新密码不能为空',
+		myFeedback:'我的反馈',
 	},
 	},
-	threadedHead:{
-		name:"螺纹头",
-		converterStartup:"变频器启动",
-		mainCompressedAirValve:"压缩空气总阀",
-		separatingDisc:"分离盘",
-		injectionValve:"喷油阀",
-		stationVibrationDisk:"工位振动盘",
-	},
-	rollPrinting:{
-		name:"滚印机",
-		frequencyOfMainMotor:"主电机频率",
-		injectionValve:"喷油阀",
-		variableFrequencyMotor:"变频电机",
-		frequency:"频率",
-		heatingMotor:"加热电机",
-		firstCurrentTemperature:"第一当前温度",
-		secondCurrentTemperature:"第二当前温度",
-		fuelInjectionMotor:"喷油电机",
-		oilPumpMotor:"油泵电机",
-		storageMotor:"蓄料电机",
-		centrifugalMotor:"离心电机",
+	userCenter:{
+		//客户画像,修改密码,我的反馈,退出登录,您确定退出本次登录么?,退出成功,退出失败
+		customerPortrait:'客户画像',
+		modifyPassword:'修改密码',
+		myFeedback:'我的反馈',
+		logOut:'退出登录',
+		areYouSureYouWantToExitThisLogin:'您确定退出本次登录么?',
+		logOutSuccess:'退出成功',
+		logOutFailed:'退出失败',
 		
 		
 	},
 	},
-	injection:{
-		name:"注塑机",
-		MoldStatus:"模具状态",
-		hydraulicPress:"液压机",
-		hydraulicOilTemperature:"液压油温度",
-		cylinderTemperature:"简体温度",
-		channel:"通道",
-		pressure:"压力",
-		speed:"速度",
-		videoInstruction:"视频说明书"
-	},
-	assemblingMachine:{
-		name:'组装机',
-		mainMotor:"主电机",
-		valve:"气阀",
-		centrifuge:"离心机",
-		frequencyOfMainMotor:"主电机频率",
-		stopperRate:"胶塞速率",
-		tipVelocity:"针尖速率",
-		rubberStopperSentHorizontally:"胶塞平送",
-		needleTipFlatFeeding:"针尖平送",
-	},
-	warpKnitting:{
-		name:'经编机',
-		spindleSpeed:'主轴转速',
-		jaca:'贾卡',
-		traverse:'横移',
-		currentClothLength:'当前布长',
-		setClothLength:'设定布长',
-		density:'密度',
-		warpLetOffAxis:'送经轴',
-		remainingTurns:'剩余圈数',
-		timeRemaining:'剩余时间',
-		traction:'牵拉',
-		crimp:'卷曲',
-		processwidth:'工艺宽度',
-		processHeight:'工艺高度',
-		totalNumberOfAxles:'总轴数',
-	},
-	packer:{
-		name:'包装机',
-		production:'12小时产量',
-		plannedOutput:"计划产量",
-		versionsPerMinute:"每分钟版数",
-		numberOfModules:"每模个数",
-		singleModeDistance:'单模距离',
-		alignmentDistance:"对版距离",
-		jogSpeed:"点动速度",
-		chainSpeed:'链条速度',
-		alignmentSpeed:"对版速度"
-	},
 	login:{
 	login:{
 		deviceInformation:"设备信息",
 		deviceInformation:"设备信息",
 		switchLanguage:'switch English',
 		switchLanguage:'switch English',

+ 2 - 0
src/main.js

@@ -27,4 +27,6 @@ app.config.globalProperties.getDictOne = getDictOne
 // 比较时间大小
 // 比较时间大小
 app.config.globalProperties.compareTime = compareTime
 app.config.globalProperties.compareTime = compareTime
 app.config.globalProperties.uploadDdRightBtn = uploadDdRightBtn
 app.config.globalProperties.uploadDdRightBtn = uploadDdRightBtn
+//中英文全局挂载
+app.config.globalProperties.t = i18n.global.t
 export default app
 export default app

+ 7 - 7
src/views/home/changePassword.vue

@@ -1,8 +1,8 @@
 <template>
 <template>
 	<div class="form">
 	<div class="form">
 		<van-nav-bar
 		<van-nav-bar
-			title="修改密码"
-			left-text="返回"
+			:title="$t('home.modifyPassword')"
+			:left-text="$t('common.back')"
 			left-arrow
 			left-arrow
 			@click-left="onClickLeft"
 			@click-left="onClickLeft"
 		>
 		>
@@ -11,15 +11,15 @@
 			<van-cell-group inset>
 			<van-cell-group inset>
 				<van-field
 				<van-field
 					v-model="formData.password"
 					v-model="formData.password"
-					label="新密码"
-					placeholder="请输入新密码"
-					:rules="[{ required: true, message: '新密码不能为空' }]"
+					:label="$t('home.newPassword')"
+					:placeholder="$t('home.pleaseEnterPassword')"
+					:rules="[{ required: true, message: $t('home.newPasswordCanNotBeEmpty') }]"
 					required
 					required
 				/>
 				/>
 			</van-cell-group>
 			</van-cell-group>
 			<div style="margin: 16px">
 			<div style="margin: 16px">
 				<van-button round block type="primary" native-type="submit">
 				<van-button round block type="primary" native-type="submit">
-					提交
+					{{$t('common.submit')}}
 				</van-button>
 				</van-button>
 			</div>
 			</div>
 		</van-form>
 		</van-form>
@@ -42,7 +42,7 @@ const onSubmit = () => {
 	proxy.post('/tenantUser/resetPwd' , formData.value,'PUT').then(
 	proxy.post('/tenantUser/resetPwd' , formData.value,'PUT').then(
 		(res) => {
 		(res) => {
 			setTimeout(() => {
 			setTimeout(() => {
-				showSuccessToast('修改成功')
+				showSuccessToast($t('common.modifySuccess'))
 				history.back()
 				history.back()
 			}, 500)
 			}, 500)
 		},
 		},

+ 9 - 5
src/views/home/feedback.vue

@@ -35,13 +35,13 @@
                 <ul>
                 <ul>
                     <li v-for="i in listData" :key="i.id" @click="toDtl(i)">
                     <li v-for="i in listData" :key="i.id" @click="toDtl(i)">
                         <div class="title">
                         <div class="title">
-                            {{i.replyContent}}
+                            {{i.problemStatement}}
                         </div>
                         </div>
                         <div class="time">
                         <div class="time">
                            {{i.createTime}}
                            {{i.createTime}}
                         </div>
                         </div>
                         <div class="status">
                         <div class="status">
-                            已回复
+                            {{i.status == 1 ? '已回复' : '待回复'}}
                         </div>
                         </div>
                     </li>
                     </li>
                 </ul>
                 </ul>
@@ -69,12 +69,16 @@ const listData = ref([])
 
 
 const listConfig = ref([
 const listConfig = ref([
 	{
 	{
-		label: '仓库名称',
+		label: '姓名',
 		prop: 'name',
 		prop: 'name',
 	},
 	},
 	{
 	{
-		label: '仓库类型',
-		prop: 'typeName',
+		label: '公司名称',
+		prop: 'companyName',
+	},
+	{
+		prop:'contactInformation',
+		label:'联系方式'
 	}
 	}
 ])
 ])
 const onRefresh = () => {
 const onRefresh = () => {

+ 8 - 8
src/views/home/index.vue

@@ -5,7 +5,7 @@
 				<div class="back">
 				<div class="back">
 					<!-- <van-icon name="arrow-left" size='20' /> -->
 					<!-- <van-icon name="arrow-left" size='20' /> -->
 				</div>
 				</div>
-				<div class="text">客户画像</div>
+				<div class="text">{{$t('userCenter.customerPortrait')}}</div>
 				<div class="more"></div>
 				<div class="more"></div>
 			</div>
 			</div>
 			<div class="user-info">
 			<div class="user-info">
@@ -26,7 +26,7 @@
 				<div class="icon-box">
 				<div class="icon-box">
 					<i class="iconfont icon-icon_pz"></i>
 					<i class="iconfont icon-icon_pz"></i>
 				</div>
 				</div>
-				<div class="text">修改密码</div>
+				<div class="text">{{$t('userCenter.modifyPassword')}}</div>
 				<div class="more">
 				<div class="more">
 					<van-icon name="arrow" size="16" />
 					<van-icon name="arrow" size="16" />
 				</div>
 				</div>
@@ -35,14 +35,14 @@
 				<div class="icon-box">
 				<div class="icon-box">
 					<i class="iconfont icon-icomx_kefu"></i>
 					<i class="iconfont icon-icomx_kefu"></i>
 				</div>
 				</div>
-				<div class="text">我的反馈</div>
+				<div class="text">{{$t('userCenter.myFeedback')}}</div>
 				<div class="more">
 				<div class="more">
 					<van-icon name="arrow" size="16" />
 					<van-icon name="arrow" size="16" />
 				</div>
 				</div>
 			</li>
 			</li>
 		</ul>
 		</ul>
 		<van-button class="logout" v-if="!corpId" type="primary" @click="logout" block
 		<van-button class="logout" v-if="!corpId" type="primary" @click="logout" block
-			>退出登录</van-button
+			>{{$t('userCenter.logOut')}}</van-button
 		>
 		>
 	</div>
 	</div>
 </template>
 </template>
@@ -64,17 +64,17 @@ const toRouter = (url) => {
 }
 }
 const logout = () => {
 const logout = () => {
 	showConfirmDialog({
 	showConfirmDialog({
-		title: '提示',
-		message: '您确定退出本次登录么?',
+		title: proxy.t('common.prompt'),
+		message: proxy.t('userCenter.areYouSureYouWantToExitThisLogin'),
 	}).then(() => {
 	}).then(() => {
 		proxy.get('logout').then((res) => {
 		proxy.get('logout').then((res) => {
             if (res.code == 200) {
             if (res.code == 200) {
-                showSuccessToast('退出成功')
+                showSuccessToast(proxy.t('userCenter.logOutSuccess'),)
 				localStorage.clear()
 				localStorage.clear()
                 //清除路由历史记录
                 //清除路由历史记录
                 proxy.$router.replace('/?id=$CORPID$')
                 proxy.$router.replace('/?id=$CORPID$')
             } else {
             } else {
-                showFailToast('退出失败')
+                showFailToast(proxy.t('userCenter.logOutFailed'),)
             }
             }
         })
         })
 	})
 	})

+ 4 - 4
src/views/main.vue

@@ -4,16 +4,16 @@
 		<div class="footer"></div>
 		<div class="footer"></div>
 	</div>
 	</div>
 	<van-tabbar v-model="tabType">
 	<van-tabbar v-model="tabType">
-		<van-tabbar-item icon="home-o" to="/main/message">消息</van-tabbar-item>
+		<van-tabbar-item icon="home-o" to="/main/message">{{$t('common.message')}}</van-tabbar-item>
 		<van-tabbar-item icon="search" to="/main/working"
 		<van-tabbar-item icon="search" to="/main/working"
-			>工作台</van-tabbar-item
+			>{{$t('common.workbench')}}</van-tabbar-item
 		>
 		>
 		<van-tabbar-item
 		<van-tabbar-item
 			icon="friends-o"
 			icon="friends-o"
 			:to="tenantId == 'xmhjc' ? '/main/xiamenList' : '/main/equipment'"
 			:to="tenantId == 'xmhjc' ? '/main/xiamenList' : '/main/equipment'"
-			>物联网</van-tabbar-item
+			>{{$t('common.things')}}</van-tabbar-item
 		>
 		>
-		<van-tabbar-item icon="setting-o" to="/main/home">我的</van-tabbar-item>
+		<van-tabbar-item icon="setting-o" to="/main/home">{{$t('common.mine')}}</van-tabbar-item>
 	</van-tabbar>
 	</van-tabbar>
 </template>
 </template>
 <script setup>
 <script setup>