Pārlūkot izejas kodu

国际化——运行监测

sunyadv 5 gadi atpakaļ
vecāks
revīzija
31356c1b29

+ 65 - 2
ys_int/src/i18n/lang/en.js

@@ -13,6 +13,16 @@ const lang = {
         edit: "Edit",
 		imput: "Batch Imput",
 		use: "Start",
+		run: "run",
+		static: "static",
+		warning: "warning",
+		scrap: "scrap",
+		choose: "Please choose",
+		num: "Number",
+		name: "Name",
+		detail: "Detail",
+		back: "Back",
+		upload: "Upload",
     },
     prompt: {
         success: "Modify Success",
@@ -20,6 +30,7 @@ const lang = {
         success2: "Created Success",
         success3: "Delete Success",
 		success4: "Upload Success",
+		success5: "Maintenance Completed",
     },
     msg: {
         changeLanguage: "Whether to change the language?",
@@ -27,6 +38,9 @@ const lang = {
         loginAcc: "Please input Accounts",
         loginPass: "Please input Password",
         inputNewPwd: "Please enter a new password",
+		keySearch: "Please enter a keyword to search",
+		uploadType: "Uploaded images can only be in JPG or PNG format!",
+		uploadSize: "Uploaded images should not exceed 5MB in size!",
     },
     // 主页
     home: {
@@ -61,6 +75,45 @@ const lang = {
         producer: "Producer Manage",
         device: "YM Mold Manage",
     },
+	// 运行监测
+	runTest: {
+		state: "current state",
+		stage: "Equipment warning",
+		stage0: "Normal",
+		stage1: "High temperature",
+		stage2: "Low battery",
+		stage3: "High temperature、Low battery",
+		stage4: "Unknown",
+		isMaintain: "Mold Maintenance",
+		isMaintain0: "Need",
+		isMaintain1: "Normal",
+		process: "Process",
+		processMold: "Process Mold",
+		nowState: "Current maintenance status:",
+		immediate: "Immediate Treatment",
+		record: "Processing records",
+		maintainUser: "Maintenance Person",
+		maintainType: "Maintenance Plan",
+		fileName: "Maintenance Photo",
+		closeTime: "Close Time",
+		maintenance: "Treatment",
+		type: "Maintenance Type",
+		inputType: "Please select the type of maintenance",
+		vulnerable: "Wearing Part",
+		inputVulnerable: "Please select wearing part",
+		action: "Action",
+		inputAction: "Please select action",
+		spray: "spray paint",
+		check: "inspect",
+		dealWarning: "Deal With Warning",
+		warningType: "Warning Type",
+		inputWarningType: "Please enter warning type",
+		moldSet: "Equipment Set",
+		inputMoldSet: "Please select the equipment",
+		completed: "The alarm has been dealt with.",
+		mustUpload: "Must upload photos",
+	},
+	// 项目管理
     project: {
         // 人员管理
         initial: "Initial Password",
@@ -72,8 +125,19 @@ const lang = {
         role: "Role",
         inputRole: "Please input Role",
         company: "Company",
-        inputCompany: "Please input Company",
+        inputCompany: "Please select Company",
     },
+	// 模具管理
+	mold: {
+		moldNo: "Mold Num",
+		modelName: "Mold Name",
+		projectName: "Project Name",
+		factoryName: "Producer",
+		area: "Area",
+		runTimes: "Number of runs",
+		ocCycle: "Cycle",
+		hillNumber: "Electricity",
+	},
     // 基础管理
     basic: {
         next: "Next",
@@ -111,7 +175,6 @@ const lang = {
 		addYM: "Add Equipment",
 		editYM: "Edit Equipment",
 		chooseComp: "Please select a company",
-		keySearch: "Please select a keyword to search",
 		equipmentNo: "Equipment Num",
 		inputequipmentNo: "Please enter the equipment number",
 		useLife: "Years of use",

+ 67 - 3
ys_int/src/i18n/lang/zh.js

@@ -13,6 +13,16 @@ const lang = {
         edit: "编辑",
 		imput: "批量导入",
 		use: "启用",
+		run: "运行",
+		static: "静止",
+		warning: "告警",
+		scrap: "报废",
+		choose: "请选择",
+		num: "编号",
+		name: "名称",
+		detail: "详情",
+		back: "返回",
+		upload: "上传",
     },
     prompt: {
         success: "修改成功",
@@ -20,6 +30,7 @@ const lang = {
         success2: "创建成功",
         success3: "删除成功",
 		success4: "上传成功",
+		success5: "保养完成",
     },
     msg: {
         changeLanguage: "是否切换语言?",
@@ -27,6 +38,9 @@ const lang = {
         loginAcc: "请输入账号",
         loginPass: "请输入密码",
         inputNewPwd: "请输入新密码",
+		keySearch: "请输入关键字进行搜索",
+		uploadType: "上传的图片只能是 JPG 或 PNG 格式!",
+		uploadSize: "上传的图片大小不能超过 5MB!",
     },
     // 主页
     home: {
@@ -61,6 +75,45 @@ const lang = {
         producer: "生产方管理",
         device: "云模盒管理",
     },
+	// 运行监测
+	runTest: {
+		state: "当前状态",
+		stage: "云模盒告警",
+		stage0: "正常",
+		stage1: "温度过高",
+		stage2: "电量过低",
+		stage3: "温度过高、电量过低",
+		stage4: "不明",
+		isMaintain: "模具保养",
+		isMaintain0: "需要",
+		isMaintain1: "正常",
+		process: "处理",
+		processMold: "模具处理",
+		nowState: "当前保养状态",
+		immediate: "立即处理",
+		record: "处理记录",
+		maintainUser: "保养人",
+		maintainType: "保养方案",
+		fileName: "保养照片",
+		closeTime: "关闭时间",
+		maintenance: "处理保养",
+		type: "保养类型",
+		inputType: "请选择保养类型",
+		vulnerable: "易损件",
+		inputVulnerable: "请选择易损件",
+		action: "动作",
+		inputAction: "请选择动作",
+		spray: "喷漆",
+		check: "检查",
+		dealWarning: "告警处理",
+		warningType: "告警类型",
+		inputWarningType: "请输入告警类型",
+		moldSet: "云模盒设置",
+		inputMoldSet: "请选择云模盒",
+		completed: "告警处理完毕",
+		mustUpload: "必须上传照片",
+	},
+	// 项目管理
     project: {
         // 人员管理
         initial: "初始密码",
@@ -71,8 +124,20 @@ const lang = {
         inputTrueMobile: "请输入正确的手机号",   
         role: "角色",
         company: "所属公司",
-        inputCompany: "请输入所属公司",
+        inputCompany: "请选择所属公司",
     },
+	// 模具管理
+	mold: {
+		moldNo: "模具编号",
+		modelName: "模具名称",
+		projectName: "所属项目",
+		factoryName: "制造工厂",
+		area: "位置",
+		runTimes: "运行次数",
+		ocCycle: "每模平均周期",
+		hillNumber: "电量",
+		
+	},
     // 基础管理
     basic: {
         next: "下一步",
@@ -109,8 +174,7 @@ const lang = {
 		// 云模盒管理
 		addYM: "新建云模盒",
 		editYM: "编辑云模盒",
-		chooseComp: "请选择公司",
-		keySearch: "请选择关键字进行搜索",
+		chooseComp: "请选择公司",		
 		equipmentNo: "云模盒编号",
 		inputequipmentNo: "请输入云模盒编号",
 		useLife: "使用年限",

+ 1 - 1
ys_int/src/views/base/allocation.vue

@@ -12,7 +12,7 @@
                     </el-form-item>
                 </el-col>
                 <el-form-item>
-                    <el-input v-model="filters.keyName" :placeholder="$t('basic.keySearch')"></el-input>
+                    <el-input v-model="filters.keyName" :placeholder="$t('msg.keySearch')"></el-input>
                 </el-form-item>
                 <el-form-item>
                     <el-button type="primary" @click="getMoulds">{{$t('base.query')}}</el-button>

+ 28 - 37
ys_int/src/views/detection/detection.vue

@@ -5,65 +5,56 @@
             <el-form :inline="true" :model="filters">
                 <el-col :span="2">
                     <el-form-item>
-                        <el-select v-model="filters.value" placeholder="请选择">
-                        <el-option label="编号" value="0"></el-option>
-                        <el-option label="名称" value="1"></el-option>
+                        <el-select v-model="filters.value" :placeholder="$t('base.choose')">
+                            <el-option :label="$t('base.num')" value="0"></el-option>
+                            <el-option :label="$t('base.name')" value="1"></el-option>
                         </el-select>
                     </el-form-item>
                 </el-col>
                 <el-form-item>
-                    <el-input v-model="filters.name" placeholder="请输入关键字进行搜索" style="width: 300px;" clearable></el-input>
+                    <el-input v-model="filters.name" :placeholder="$t('msg.keySearch')" style="width: 300px;" clearable></el-input>
                 </el-form-item>
                 <el-form-item>
-                    <el-button type="primary" @click="getMoulds(filters.name)">查询</el-button>
+                    <el-button type="primary" @click="getMoulds(filters.name)">{{$t('base.query')}}</el-button>
                 </el-form-item>
             </el-form>
         </el-col>
 
         <!--列表-->
-        <el-table
-            :data="moulds"
-            :height="tableHeight"
-            highlight-current-row
-            v-loading="listLoading"
-            style="width: 100%;"
-        >
+        <el-table :data="moulds" :height="tableHeight" highlight-current-row v-loading="listLoading" style="width: 100%;">
             <el-table-column type="index" width="60"></el-table-column>
-            <el-table-column prop="modelNo" label="模具编号" width="100" sortable></el-table-column>
-            <el-table-column label="模具名称" width="200" sortable>
+            <el-table-column prop="modelNo" :label="$t('mold.moldNo')" width="100" sortable></el-table-column>
+            <el-table-column :label="$t('mold.modelName')" width="200" sortable>
                 <template slot-scope="scope">
-                <a
-                    style="color: #409EFF; cursor: pointer"
-                    @click="toMould(scope.row.id)"
-                >{{scope.row.modelName}}</a>
+                    <a style="color: #409EFF; cursor: pointer" @click="toMould(scope.row.id)">{{scope.row.modelName}}</a>
                 </template>
             </el-table-column>
-            <el-table-column prop="equipmentNo" label="云模盒编号" width="120" sortable></el-table-column>
-            <el-table-column prop="projectName" label="所属项目" width="200" sortable></el-table-column>
-            <el-table-column prop="factoryName" label="制造工厂" width="200" sortable></el-table-column>
-            <el-table-column prop="area" label="位置" width="200" sortable></el-table-column>
-            <el-table-column prop="runTimes" label="运行次数" align="center" width="100" sortable></el-table-column>
-            <el-table-column prop="ocCycle" label="每模平均周期" align="center" width="140" sortable></el-table-column>
-            <el-table-column prop="hillNumber" label="电量" align="center" width="80" sortable></el-table-column>
-            <el-table-column prop="state" label="当前状态" align="center" width="100" sortable></el-table-column>
-            <el-table-column label="云模盒报警" align="center" width="160">
+            <el-table-column prop="equipmentNo" :label="$t('basic.equipmentNo')" width="120" sortable></el-table-column>
+            <el-table-column prop="projectName" :label="$t('mold.projectName')" width="200" sortable></el-table-column>
+            <el-table-column prop="factoryName" :label="$t('mold.factoryName')" width="200" sortable></el-table-column>
+            <el-table-column prop="area" :label="$t('mold.area')" width="200" sortable></el-table-column>
+            <el-table-column prop="runTimes" :label="$t('mold.runTimes')" align="center" width="100" sortable></el-table-column>
+            <el-table-column prop="ocCycle" :label="$t('mold.ocCycle')" align="center" width="140" sortable></el-table-column>
+            <el-table-column prop="hillNumber" :label="$t('mold.hillNumber')" align="center" width="80" sortable></el-table-column>
+            <el-table-column prop="state" :label="$t('runTest.state')" align="center" width="100" sortable></el-table-column>
+            <el-table-column :label="$t('runTest.stage')" align="center" width="160">
                 <template slot-scope="scope">
-                <span v-if="scope.row.stage == 0">正常</span>
-                <span v-else-if="scope.row.stage == 1">温度过高</span>
-                <span v-else-if="scope.row.stage == 2">电量过低</span>
-                <span v-else-if="scope.row.stage == 3">温度过高、电量过低</span>
-                <span v-else>不明</span>
+                    <span v-if="scope.row.stage == 0">{{$t('runTest.stage0')}}</span>
+                    <span v-else-if="scope.row.stage == 1">{{$t('runTest.stage1')}}</span>
+                    <span v-else-if="scope.row.stage == 2">{{$t('runTest.stage2')}}</span>
+                    <span v-else-if="scope.row.stage == 3">{{$t('runTest.stage3')}}</span>
+                    <span v-else>{{$t('runTest.stage4')}}</span>
                 </template>
             </el-table-column>
-            <el-table-column label="模具保养" align="center" width="100">
+            <el-table-column :label="$t('runTest.isMaintain')" align="center" width="100">
                 <template slot-scope="scope">
-                <span v-if="scope.row.isMaintain == 1">需要</span>
-                <span v-else>正常</span>
+                    <span v-if="scope.row.isMaintain == 1">{{$t('runTest.isMaintain0')}}</span>
+                    <span v-else>{{$t('runTest.isMaintain1')}}</span>
                 </template>
             </el-table-column>
-            <el-table-column label="处理" align="center" width="85">
+            <el-table-column :label="$t('runTest.process')" align="center" width="85">
                 <template slot-scope="scope">
-                <el-button size="small" type="primary" @click="toMaintenance(scope.row.id)">详情</el-button>
+                    <el-button size="small" type="primary" @click="toMaintenance(scope.row.id)">{{$t('base.detail')}}</el-button>
                 </template>
             </el-table-column>
         </el-table>

+ 379 - 436
ys_int/src/views/detection/maintenance.vue

@@ -4,48 +4,48 @@
         <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
             <el-form :inline="true">
                 <el-form-item>
-                    <el-button type="text" @click="backToDetection" icon="el-icon-back" class="back">返回</el-button>
+                    <el-button type="text" @click="backToDetection" icon="el-icon-back" class="back">{{$t('base.back')}}</el-button>
                 </el-form-item>
                 <el-form-item class="divLine"></el-form-item>
                 <el-form-item>{{mouldName}}</el-form-item>
-                <el-form-item class="state" style="float: right;">当前状态
-                    <span v-if="mouldState == 0">静止</span>
-                    <span v-else-if="mouldState == 1">运行</span>
+                <el-form-item class="state" style="float: right;">{{$t('runTest.state')}}
+                    <span v-if="mouldState == 0">{{$t('base.static')}}</span>
+                    <span v-else-if="mouldState == 1">{{$t('base.run')}}</span>
                     <!-- 因为目前还不知道mouldState的意义 -->
-                    <span v-else>不明</span>
+                    <span v-else>{{$t('runTest.stage4')}}</span>
                 </el-form-item>
             </el-form>
         </el-col>
+
         <!-- v-if="requirement" -->
         <!-- 模具处理 -->
-        <el-col :span="24" class="title">模具处理</el-col>
-        <el-col :span="6" style="line-height: 32px; border-right: #c3c3c3 1px solid;">
-            当前保养状态:
-            <span v-if="requirement" style="color: #ff4949;">需要</span>
-            <span v-else style="color: black;">正常</span>
-            <el-button size="small" type="primary" 
-                @click="showMaintenance" 
-                v-if="!(user.parentId == 1 && user.subordinateType == 1) && requirement" style="margin-left: 16px;">
-                立即处理
+        <el-col :span="24" class="title">{{$t('runTest.processMold')}}</el-col>
+        <el-col :span="9" style="line-height: 32px; border-right: #c3c3c3 1px solid;">
+            {{$t('runTest.nowState')}}:
+            <span v-if="requirement" style="color: #ff4949;">{{$t('runTest.isMaintain0')}}</span>
+            <span v-else style="color: black;">{{$t('runTest.isMaintain1')}}</span>
+            <el-button size="small" type="primary" @click="showMaintenance"   style="margin-left: 16px;">
+                <!-- v-if="!(user.parentId == 1 && user.subordinateType == 1) && requirement" -->
+                {{$t('runTest.immediate')}}
             </el-button>
         </el-col>
-        <el-col :span="8" :offset="2" style="line-height: 32px;">
-            云模盒告警:{{warningInfo}}
-            <el-button size="small" type="primary"
-                v-if="!(user.parentId == 1 && user.subordinateType == 1) && stage != 0"
-                @click="warningFormVisible = true" style="margin-left: 16px;">
-                立即处理
+        <el-col :span="8" :offset="1" style="line-height: 32px;">
+            {{$t('runTest.stage')}}:{{warningInfo}}
+            <el-button size="small" type="primary"  @click="warningFormVisible = true" style="margin-left: 16px;">
+                <!-- v-if="!(user.parentId == 1 && user.subordinateType == 1) && stage != 0" -->
+                {{$t('runTest.immediate')}}
             </el-button>
         </el-col>
 
         <!-- 操作记录 -->
-        <el-col :span="24" class="title">处理记录</el-col>
+        <el-col :span="24" class="title">{{$t('runTest.record')}}</el-col>
+        
         <!-- 列表 -->
         <el-table :data="records" highlight-current-row v-loading="listLoading" style="width: 100%;" :height="tableHeight">
             <el-table-column type="index" width="60"></el-table-column>
-            <el-table-column prop="maintainUserName" label="保养人" width="100" sortable></el-table-column>
-            <el-table-column prop="maintainType" label="保养方案" sortable></el-table-column>
-            <el-table-column prop="fileName" label="保养照片" width="200" sortable>
+            <el-table-column prop="maintainUserName" :label="$t('runTest.maintainUser')" width="250" sortable></el-table-column>
+            <el-table-column prop="maintainType" :label="$t('runTest.maintainType')" sortable></el-table-column>
+            <el-table-column prop="fileName" :label="$t('runTest.fileName')" width="200" sortable>
                 <template slot-scope="scope" v-if="scope.row.fileUrl != null">
                     <a style="color: #409EFF; cursor: pointer; text-decoration: none;"
                         :href="scope.row.fileUrl" :download="scope.row.fileName">
@@ -57,7 +57,7 @@
                     </a>
                 </template>
             </el-table-column>
-            <el-table-column prop="indate" label="关闭时间" width="200" sortable></el-table-column>
+            <el-table-column prop="indate" :label="$t('runTest.closeTime')" width="200" sortable></el-table-column>
         </el-table>
 
         <!--工具条-->
@@ -74,443 +74,386 @@
         </el-col>
 
         <!--新增界面-->
-        <el-dialog title="处理保养" v-if="maintenanceFormVisible" :visible.sync="maintenanceFormVisible" :close-on-click-modal="false" customClass="customWidth">
-            <el-form :model="maintenanceForm" label-width="100px" :rules="formRules" ref="addForm" :inline="true" class="demo-form-inline">
-                <el-form-item label="保养类型" prop="type">
+        <el-dialog :title="$t('runTest.maintenance')" v-if="maintenanceFormVisible" :visible.sync="maintenanceFormVisible" :close-on-click-modal="false" customClass="customWidth">
+            <el-form :model="maintenanceForm" label-width="130px" :rules="formRules" ref="addForm">
                 <!-- 保养类型选择 -->
-                <el-select v-model="type.value" filterable placeholder="请选择保养类型" style="width:202px">
-                    <el-option
-                    v-for="item in type"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
-                    ></el-option>
-                </el-select>
+                <el-form-item :label="$t('runTest.type')" prop="type">
+                    <el-select v-model="type.value" filterable :placeholder="$t('runTest.inputType')" style="width:202px">
+                        <el-option v-for="item in type" :key="item.value" :label="item.label" :value="item.value"></el-option>
+                    </el-select>
                 </el-form-item>
+
                 <!-- 保养类型为1时 选择易损件ID -->
-                <el-form-item v-if="type.value == 1" label="选择易损件" prop="vulnerable">
-                <el-select
-                    v-model="vulnerable.value"
-                    clearable
-                    filterable
-                    placeholder="请选择易损件"
-                    style="width:202px"
-                >
-                    <el-option
-                    v-for="item in vulnerable"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
-                    ></el-option>
-                </el-select>
+                <el-form-item v-if="type.value == 1" :label="$t('runTest.vulnerable')" prop="vulnerable">
+                    <el-select v-model="vulnerable.value" clearable filterable :placeholder="$t('runTest.inputVulnerable')" style="width:202px">
+                        <el-option v-for="item in vulnerable" :key="item.value" :label="item.label" :value="item.value"></el-option>
+                    </el-select>
                 </el-form-item>
+
                 <!-- 保养类型为0时 选择保养动作 -->
-                <el-form-item v-else label="选择动作" prop="action">
-                    <el-select v-model="action.value" filterable placeholder="请选择动作" style="width:202px">
-                        <el-option
-                        v-for="item in action"
-                        :key="item.value"
-                        :label="item.label"
-                        :value="item.value"
-                        ></el-option>
+                <el-form-item v-else :label="$t('runTest.action')" prop="action">
+                    <el-select v-model="action.value" filterable :placeholder="$t('runTest.inputAction')" style="width:202px">
+                        <el-option v-for="item in action" :key="item.value" :label="item.label" :value="item.value"></el-option>
                     </el-select>
                 </el-form-item>
-                <el-form-item label="选择照片">
-                <el-upload ref="upload" action="customize" :http-request="maintain" :limit="1" :auto-upload="false" :before-upload="beforeUpload">
-                    <el-button size="small" type="primary">上传</el-button>
-                </el-upload>
+
+                <el-form-item :label="$t('runTest.fileName')">
+                    <el-upload ref="upload" action="customize" :http-request="maintain" :limit="1" :auto-upload="false" :before-upload="beforeUpload">
+                        <el-button size="small" type="primary">{{$t('runTest.upload')}}</el-button>
+                    </el-upload>
                 </el-form-item>
             </el-form>
             <div slot="footer" class="dialog-footer">
-                <el-button @click.native="maintenanceFormVisible = false">取消</el-button>
-                <el-button type="primary" @click.native="maintainConfirm" :loading="maintenanceLoading">立即处理</el-button>
+                <el-button @click.native="maintenanceFormVisible = false">{{$t('el.messagebox.cancel')}}</el-button>
+                <el-button type="primary" @click.native="maintainConfirm" :loading="maintenanceLoading">{{$t('runTest.process')}}</el-button>
             </div>
         </el-dialog>
 
         <!--告警处理界面-->
-        <el-dialog
-        title="告警处理"
-        v-if="warningFormVisible"
-        :visible.sync="warningFormVisible"
-        :close-on-click-modal="false"
-        customClass="customWidth"
-        >
-        <el-form
-            :model="warningForm"
-            label-width="100px"
-            :rules="formRules"
-            ref="addForm"
-            :inline="true"
-            class="demo-form-inline"
-        >
-            <el-form-item label="报警类型">
-            <el-input placeholder="报警类型" v-model="warningInfo" :disabled="true"></el-input>
-            </el-form-item>
-            <el-form-item label="云模盒设置" prop="action">
-            <el-select
-                v-model="warningForm.equipmentId"
-                filterable
-                placeholder="请选择云模盒"
-                style="width:202px"
-            >
-                <el-option
-                v-for="item in equipments"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
-                ></el-option>
-            </el-select>
-            </el-form-item>
-        </el-form>
-        <div slot="footer" class="dialog-footer">
-            <el-button @click.native="warningArrangement = false">取消</el-button>
-            <el-button type="primary" @click.native="warningArrangement" :loading="warningLoading">立即处理</el-button>
-        </div>
+        <el-dialog :title="$t('runTest.dealWarning')" v-if="warningFormVisible" :visible.sync="warningFormVisible" :close-on-click-modal="false" customClass="customWidth">
+            <el-form :model="warningForm" label-width="100px" :rules="formRules" ref="addForm" :inline="true" class="demo-form-inline">
+                <el-form-item :label="$t('runTest.warningType')">
+                    <el-input :placeholder="$t('runTest.inputWarningType')" v-model="warningInfo" :disabled="true"></el-input>
+                </el-form-item>
+                <el-form-item :label="$t('runTest.moldSet')" prop="action">
+                    <el-select v-model="warningForm.equipmentId" filterable :placeholder="$t('runTest.inputMoldSet')" style="width:202px">
+                        <el-option v-for="item in equipments" :key="item.value" :label="item.label" :value="item.value"></el-option>
+                    </el-select>
+                </el-form-item>
+            </el-form>
+            <div slot="footer" class="dialog-footer">
+                <el-button @click.native="warningFormVisible = false">{{$t('el.messagebox.cancel')}}</el-button>
+                <el-button type="primary" @click.native="warningArrangement" :loading="warningLoading">{{$t('runTest.process')}}</el-button>
+            </div>
         </el-dialog>
     </section>
 </template>
 
 <script>
-import util from "../../common/js/util";
-export default {
-  data() {
-    return {
-      user: JSON.parse(sessionStorage.getItem("user")),
-      //本页模具ID
-      mouldId: null,
-      //模具名字
-      mouldName: null,
-      //模具状态
-      mouldState: 0,
-      options: [{ value: "aaa", label: "123" }, { value: "bbb", label: "456" }],
-      //记录
-      records: [],
-      //警告信息
-      warningInfo: "",
-      stage: 0,
-      //告警时需要更换的设备的列表
-      equipments: [
-        { value: 1, label: "临时设备1" },
-        { value: 2, label: "临时设备2" },
-        { value: 3, label: "临时设备3" }
-      ],
-      //标题栏过滤器
-      filters: {
-        name: "",
-        value: ""
-      },
-      listLoading: false,
-      page: 1,
-      size: 20,
-      total: 0,
-      tableHeight: 0,
-      //活跃页面
-      activePage: 0,
-      formRules: {},
-      //保养界面 种类
-      type: [{ label: "动作", value: 0 }, { label: "易损件", value: 1 }],
-      //保养界面 动作
-      action: [{ label: "喷漆", value: 0 }, { label: "检查", value: 1 }],
-      //易损件 假数据
-      vulnerable: [
-        { label: "易损件1", value: 0 },
-        { label: "易损件12450", value: 1 },
-        { label: "易损件114514", value: 2 }
-      ],
-      //是否需要保养 提示
-      requirement: false,
-      prompt: true,
-      //保养详情界面显示
-      maintenanceFormVisible: false,
-      maintenanceLoading: false,
-      //告警详情界面显示
-      warningFormVisible: false,
-      warningLoading: false,
-      //保养详情界面数据
-      maintenanceForm: {
-        username: "",
-        account: "",
-        mobile: "",
-        teamName: "",
-        companyId: "",
-        roleType: "",
-        flag: 0
-      },
-      //告警处理截面数据
-      warningForm: {
-        mouldId: null,
-        equipmentId: null
-      },
-      imageUrl: ""
-    };
-  },
-  methods: {
-    //分页
-    handleCurrentChange(val) {
-      this.page = val;
-      this.getList();
-    },
-    handleSizeChange(val) {
-      this.size = val;
-      this.getList();
-    },
-    //标签页面切换时
-    handleClick(tab, event) {
-      this.activeTab = tab.name;
-      //应该是取得对应的消息 目前还没写
-    },
-    selsChange: function(sels) {
-      this.sels = sels;
-    },
-    backToDetection() {
-      this.$router.go(-1);
-    },
-    //上传格式和大小限制
-    beforeUpload(file) {
-      const isJPG = file.type === "image/jpg";
-      const isJPEG = file.type === "image/jpeg";
-      const isPNG = file.type === "image/png";
-      var rightType = isJPG || isPNG || isJPEG;
-      const isLt5M = file.size / 1024 / 1024 < 5;
-      if (!rightType) {
-        this.$message.error("上传的图片只能是 JPG 或 PNG 格式!");
-      }
-      if (!isLt5M) {
-        this.$message.error("上传的图片大小不能超过 5MB!");
-      }
-      return rightType && isLt5M;
-    },
-    //显示保养界面
-    showMaintenance: function() {
-      this.maintenanceFormVisible = true;
-    },
-    //获取记录
-    getList() {
-      this.listLoading = true;
-      this.http.post(
-        this.port.mold.moldMaintainList,
-        { mouldId: this.mouldId, pageSize: this.size, pageNum: this.page },
-        res => {
-          this.listLoading = false;
-          if (res.code == "ok") {
-            this.records = res.data.list;
-            this.total = res.data.total;
-          } else {
-            this.$message({
-              message: res.msg,
-              type: "error"
-            });
-          }
-        },
-        error => {
-          this.listLoading = false;
-          this.$message({
-            message: error,
-            type: "error"
-          });
-        }
-      );
-    },
-    //模具详情 获取模具名字用的
-    getDetail() {
-      this.http.post(
-        this.port.mold.moldDetail,
-        {
-          id: this.mouldId
+    import util from "../../common/js/util";
+    export default {
+        data() {
+            return {
+                user: JSON.parse(sessionStorage.getItem("user")),
+                //本页模具ID
+                mouldId: null,
+                //模具名字
+                mouldName: null,
+                //模具状态
+                mouldState: 0,
+                options: [{ value: "aaa", label: "123" }, { value: "bbb", label: "456" }],
+                //记录
+                records: [],
+                //警告信息
+                warningInfo: "",
+                stage: 0,
+                //告警时需要更换的设备的列表
+                equipments: [],
+                //标题栏过滤器
+                filters: {
+                    name: "",
+                    value: ""
+                },
+                listLoading: false,
+                page: 1,
+                size: 20,
+                total: 0,
+                tableHeight: 0,
+                //活跃页面
+                activePage: 0,
+                formRules: {},
+                //保养界面 种类
+                type: [{ label: this.$t('runTest.action'), value: 0 }, { label: this.$t('runTest.vulnerable'), value: 1 }],
+                //保养界面 动作
+                action: [{ label: this.$t('runTest.spray'), value: 0 }, { label: this.$t('runTest.check'), value: 1 }],
+                //易损件 假数据
+                vulnerable: [],
+                //是否需要保养 提示
+                requirement: false,
+                prompt: true,
+                //保养详情界面显示
+                maintenanceFormVisible: false,
+                maintenanceLoading: false,
+                //告警详情界面显示
+                warningFormVisible: false,
+                warningLoading: false,
+                //保养详情界面数据
+                maintenanceForm: {
+                    username: "",
+                    account: "",
+                    mobile: "",
+                    teamName: "",
+                    companyId: "",
+                    roleType: "",
+                    flag: 0
+                },
+                //告警处理截面数据
+                warningForm: {
+                    mouldId: null,
+                    equipmentId: null
+                },
+                imageUrl: ""
+            };
         },
-        res => {
-          if (res.code == "ok") {
-            this.mouldName = res.data.vo.modelName;
-            this.mouldState = res.data.vo.state;
-            this.requirement = res.data.vo.isMaintain == 1;
-            this.stage = res.data.vo.stage;
-            if(this.stage == 0){
-                this.warningInfo = "正常";
-            }else if(this.stage == 1){
-                this.warningInfo = "温度过高";
-            }else if(this.stage == 2){
-                this.warningInfo = "电量过低";
-            }else if(this.stage == 3){
-                this.warningInfo = "温度过高、电量过低";
-            }else{
-                this.warningInfo = "状况不明";
+        methods: {
+            //分页
+            handleCurrentChange(val) {
+                this.page = val;
+                this.getList();
+            },
+            handleSizeChange(val) {
+                this.size = val;
+                this.getList();
+            },
+            //标签页面切换时
+            handleClick(tab, event) {
+                this.activeTab = tab.name;
+                //应该是取得对应的消息 目前还没写
+            },
+            selsChange: function(sels) {
+                this.sels = sels;
+            },
+            backToDetection() {
+                this.$router.go(-1);
+            },
+            //上传格式和大小限制
+            beforeUpload(file) {
+                const isJPG = file.type === "image/jpg";
+                const isJPEG = file.type === "image/jpeg";
+                const isPNG = file.type === "image/png";
+                var rightType = isJPG || isPNG || isJPEG;
+                const isLt5M = file.size / 1024 / 1024 < 5;
+                if (!rightType) {
+                    this.$message.error(this.$t('msg.uploadType'));
+                }
+                if (!isLt5M) {
+                    this.$message.error(this.$t('msg.uploadSize'));
+                }
+                return rightType && isLt5M;
+            },
+            //显示保养界面
+            showMaintenance: function() {
+                this.maintenanceFormVisible = true;
+            },
+            //获取记录
+            getList() {
+                this.listLoading = true;
+                this.http.post( this.port.mold.moldMaintainList, { 
+                    mouldId: this.mouldId, 
+                    pageSize: this.size, 
+                    pageNum: this.page 
+                },
+                res => {
+                    this.listLoading = false;
+                    if (res.code == "ok") {
+                        this.records = res.data.list;
+                        this.total = res.data.total;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.listLoading = false;
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+            //模具详情 获取模具名字用的
+            getDetail() {
+                this.http.post( this.port.mold.moldDetail, {
+                    id: this.mouldId
+                },
+                res => {
+                    if (res.code == "ok") {
+                        this.mouldName = res.data.vo.modelName;
+                        this.mouldState = res.data.vo.state;
+                        this.requirement = res.data.vo.isMaintain == 1;
+                        this.stage = res.data.vo.stage;
+                        if(this.stage == 0){
+                            this.warningInfo = this.$t('runTest.stage0');
+                        }else if(this.stage == 1){
+                            this.warningInfo = this.$t('runTest.stage1');
+                        }else if(this.stage == 2){
+                            this.warningInfo = this.$t('runTest.stage2');
+                        }else if(this.stage == 3){
+                            this.warningInfo = this.$t('runTest.stage3');
+                        }else{
+                            this.warningInfo = this.$t('runTest.stage4');
+                        }
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+            //模具保养的按钮按下之后(关闭之后也要清理文件但是还没写)
+            maintainConfirm() {
+                if (this.$refs.upload.uploadFiles.length == 1) {
+                    this.$refs.upload.submit();
+                } else {
+                    this.$message({
+                        message: this.$t('runTest.mustUpload'),
+                        type: "error"
+                    });
+                }
+            },
+            //模具保养
+            maintain(params) {
+                if (this.type.value != null) {
+                    var fileObj = params.file;
+                    var form = new FormData();
+                    form.append("file", fileObj);
+                    form.append("mouldId", this.mouldId);
+                    form.append("maintainType", this.type.value);
+                    if (this.type.value == 0) {
+                        if (this.action.value == null) {
+                            return;
+                        }
+                        form.append("ways", this.action.value);
+                    } else {
+                        if (this.vulnerable.value == null) {
+                            return;
+                        }
+                        form.append("ways", this.vulnerable.value); //后面应该换成易损件的ID
+                    }
+                    this.http.uploadFile( this.port.mold.moldMaintain, form,
+                    res => {
+                        if (res.code == "ok") {
+                            this.$message({
+                                message: this.$t('prompt.success5'),
+                                type: "success"
+                            });
+                            this.maintenanceFormVisible = false;
+                            this.requirement = false;
+                            this.$refs.upload.clearFiles();
+                            this.getList();
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: "error"
+                            });
+                        }
+                    },
+                    error => {
+                        this.listLoading = false;
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                    });
+                }
+            },
+            //获取告警时可以更换的设备列表
+            getAlternativeEquipment() {
+                this.http.post( this.port.mold.moldChangeRequirement, {
+                    mouldId: this.mouldId
+                },
+                res => {
+                    if (res.code == "ok") {
+                        this.equipments = [];
+                        res.data.forEach(item => {
+                            this.equipments.push({ label: item.equipmentNo, value: item.id });
+                        });
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+            //告警处理
+            warningArrangement() {
+                if (this.warningForm.equipmentId == null) {
+                    this.$message({
+                        message: this.$t('runTest.inputMoldSet'),
+                        type: "error"
+                    });
+                } else {
+                    this.http.post( this.port.mold.moldChange, this.warningForm,
+                    res => {
+                        if (res.code == "ok") {
+                            this.$message({
+                                message: this.$t('runTest.completed'),
+                                type: "success"
+                            });
+                            this.warningFormVisible = false;
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: "error"
+                            });
+                        }
+                    },
+                    error => {
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                    });
+                }
             }
-          } else {
-            this.$message({
-              message: res.msg,
-              type: "error"
-            });
-          }
         },
-        error => {
-          this.$message({
-            message: error,
-            type: "error"
-          });
-        }
-      );
-    },
-    //模具保养的按钮按下之后(关闭之后也要清理文件但是还没写)
-    maintainConfirm() {
-      if (this.$refs.upload.uploadFiles.length == 1) {
-        this.$refs.upload.submit();
-      } else {
-        this.$message({
-          message: "必须上传照片",
-          type: "error"
-        });
-      }
-    },
-    //模具保养
-    maintain(params) {
-      if (this.type.value != null) {
-        var fileObj = params.file;
-        var form = new FormData();
-        form.append("file", fileObj);
-        form.append("mouldId", this.mouldId);
-        form.append("maintainType", this.type.value);
-        if (this.type.value == 0) {
-          if (this.action.value == null) {
-            return;
-          }
-          form.append("ways", this.action.value);
-        } else {
-          if (this.vulnerable.value == null) {
-            return;
-          }
-          form.append("ways", this.vulnerable.value); //后面应该换成易损件的ID
-        }
-        this.http.uploadFile(
-          this.port.mold.moldMaintain,
-          form,
-          res => {
-            if (res.code == "ok") {
-              this.$message({
-                message: "保养完成",
-                type: "success"
-              });
-              this.maintenanceFormVisible = false;
-              this.requirement = false;
-              this.$refs.upload.clearFiles();
-              this.getList();
-            } else {
-              this.$message({
-                message: res.msg,
-                type: "error"
-              });
-            }
-          },
-          error => {
-            this.listLoading = false;
-            this.$message({
-              message: error,
-              type: "error"
-            });
-          }
-        );
-      }
-    },
-    //获取告警时可以更换的设备列表
-    getAlternativeEquipment() {
-      this.http.post(
-        this.port.mold.moldChangeRequirement,
-        {
-          mouldId: this.mouldId
-        },
-        res => {
-          if (res.code == "ok") {
-            this.equipments = [];
-            res.data.forEach(item => {
-              this.equipments.push({ label: item.equipmentNo, value: item.id });
-            });
-          } else {
-            this.$message({
-              message: res.msg,
-              type: "error"
-            });
-          }
+        created() {
+            let height = window.innerHeight;
+            this.tableHeight = height - 370;
         },
-        error => {
-          this.$message({
-            message: error,
-            type: "error"
-          });
+        mounted() {
+            this.mouldId = this.$route.params.id; //传到当前页面的模具编号
+            this.warningForm.mouldId = this.mouldId; //顺便把相关的告警中的模具ID赋值一下
+            this.getList();
+            this.getDetail();
+            this.getAlternativeEquipment();
         }
-      );
-    },
-    //告警处理
-    warningArrangement() {
-      if (this.warningForm.equipmentId == null) {
-        this.$message({
-          message: "请选择云模盒",
-          type: "error"
-        });
-      } else {
-        this.http.post(
-          this.port.mold.moldChange,
-          this.warningForm,
-          res => {
-            if (res.code == "ok") {
-              this.$message({
-                message: "告警处理完毕",
-                type: "success"
-              });
-              this.warningFormVisible = false;
-            } else {
-              this.$message({
-                message: res.msg,
-                type: "error"
-              });
-            }
-          },
-          error => {
-            this.$message({
-              message: error,
-              type: "error"
-            });
-          }
-        );
-      }
-    }
-  },
-  created() {
-    let height = window.innerHeight;
-    this.tableHeight = height - 370;
-  },
-  mounted() {
-    this.mouldId = this.$route.params.id; //传到当前页面的模具编号
-    this.warningForm.mouldId = this.mouldId; //顺便把相关的告警中的模具ID赋值一下
-    this.getList();
-    this.getDetail();
-    this.getAlternativeEquipment();
-  }
-};
+    };
 </script>
 
 <style scoped>
-.title {
-  padding-left: 10px;
-  padding-bottom: 0px;
-  margin: 20px 0;
-  font-size: 16px;
-  line-height: 24px;
-  border-left: 1px #20a0ff solid;
-}
-.toolbar .el-form-item {
-  font-size: 14px;
-  vertical-align: middle;
-}
-.back {
-  font-size: 16px;
-}
-.divLine {
-  width: 2px;
-  background: #c3c3c3;
-  height: 100%;
-}
+    .title {
+        padding-left: 10px;
+        padding-bottom: 0px;
+        margin: 20px 0;
+        font-size: 16px;
+        line-height: 24px;
+        border-left: 1px #20a0ff solid;
+    }
 
-.projectTitle {
-  font-size: 18px;
-  color: #333;
-}
+    .toolbar .el-form-item {
+        font-size: 14px;
+        vertical-align: middle;
+    }
+
+    .back {
+        font-size: 16px;
+    }
+
+    .divLine {
+        width: 2px;
+        background: #c3c3c3;
+        height: 100%;
+    }
+
+    .projectTitle {
+        font-size: 18px;
+        color: #333;
+    }
 </style>

+ 6 - 6
ys_int/src/views/map/map.vue

@@ -46,9 +46,9 @@
                                         for(var i in data.target.msg.list){
                                             str += "<div class='info-item'><a @click='jumpToMold("+ data.target.msg.list[i].id +")'>" + data.target.msg.list[i].modelName + "(" + data.target.msg.list[i].modelNo + ")</a>"
                                                 if(data.target.msg.list[i].state=='0'){
-                                                    str += "<span class='info-state'><span class='info-ball' style='background:#999999;'></span>静止</span>"
+                                                    str += "<span class='info-state'><span class='info-ball' style='background:#999999;'></span>" + _this.$t('base.static') + "</span>"
                                                 } else {
-                                                    str += "<span class='info-state'><span class='info-ball' style='background:#00CD66;'></span>运行</span>"
+                                                    str += "<span class='info-state'><span class='info-ball' style='background:#00CD66;'></span>" + _this.$t('base.run') + "</span>"
                                                 }
                                             str += "</div>"
                                         }
@@ -138,13 +138,13 @@
                     getHoverTitle: function(dataItem, idx) {
                         var state = "";
                         if(dataItem.state == '0'){
-                            state = "静止"
+                            state = _this.$t('base.static') // 静止
                         } else if(dataItem.state == '1'){
-                            state = "运动"
+                            state = _this.$t('base.run') // 运行
                         } else if(dataItem.state == '2'){
-                            state = "告警"
+                            state = _this.$t('base.warning') // 告警
                         } else if(dataItem.state == '3'){
-                            state = "报废"
+                            state = _this.$t('base.scrap') // 报废
                         }
                         return dataItem.modelName + '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + state;
                     },

+ 8 - 16
ys_vue/src/views/detection/maintenance.vue

@@ -88,7 +88,7 @@
                 </el-select>
                 </el-form-item>
                 <!-- 保养类型为1时 选择易损件ID -->
-                <el-form-item v-if="type.value == 1" label="选择易损件" prop="vulnerable">
+                <el-form-item v-if="type.value == 1" label="易损件" prop="vulnerable">
                 <el-select
                     v-model="vulnerable.value"
                     clearable
@@ -105,7 +105,7 @@
                 </el-select>
                 </el-form-item>
                 <!-- 保养类型为0时 选择保养动作 -->
-                <el-form-item v-else label="选择动作" prop="action">
+                <el-form-item v-else label="动作" prop="action">
                     <el-select v-model="action.value" filterable placeholder="请选择动作" style="width:202px">
                         <el-option
                         v-for="item in action"
@@ -115,7 +115,7 @@
                         ></el-option>
                     </el-select>
                 </el-form-item>
-                <el-form-item label="选择照片">
+                <el-form-item label="保养照片">
                 <el-upload ref="upload" action="customize" :http-request="maintain" :limit="1" :auto-upload="false" :before-upload="beforeUpload">
                     <el-button size="small" type="primary">上传</el-button>
                 </el-upload>
@@ -143,8 +143,8 @@
             :inline="true"
             class="demo-form-inline"
         >
-            <el-form-item label="警类型">
-            <el-input placeholder="警类型" v-model="warningInfo" :disabled="true"></el-input>
+            <el-form-item label="警类型">
+            <el-input placeholder="请选择告警类型" v-model="warningInfo" :disabled="true"></el-input>
             </el-form-item>
             <el-form-item label="云模盒设置" prop="action">
             <el-select
@@ -163,7 +163,7 @@
             </el-form-item>
         </el-form>
         <div slot="footer" class="dialog-footer">
-            <el-button @click.native="warningArrangement = false">取消</el-button>
+            <el-button @click.native="warningFormVisible = false">取消</el-button>
             <el-button type="primary" @click.native="warningArrangement" :loading="warningLoading">立即处理</el-button>
         </div>
         </el-dialog>
@@ -189,11 +189,7 @@ export default {
       warningInfo: "",
       stage: 0,
       //告警时需要更换的设备的列表
-      equipments: [
-        { value: 1, label: "临时设备1" },
-        { value: 2, label: "临时设备2" },
-        { value: 3, label: "临时设备3" }
-      ],
+      equipments: [],
       //标题栏过滤器
       filters: {
         name: "",
@@ -212,11 +208,7 @@ export default {
       //保养界面 动作
       action: [{ label: "喷漆", value: 0 }, { label: "检查", value: 1 }],
       //易损件 假数据
-      vulnerable: [
-        { label: "易损件1", value: 0 },
-        { label: "易损件12450", value: 1 },
-        { label: "易损件114514", value: 2 }
-      ],
+      vulnerable: [],
       //是否需要保养 提示
       requirement: false,
       prompt: true,