Ver código fonte

运行监测echarts图表等

sunyadv 5 anos atrás
pai
commit
8824c697a9

+ 1 - 1
ys_int/package.json

@@ -11,7 +11,7 @@
   },
   "dependencies": {
     "axios": "^0.15.3",
-    "echarts": "^3.3.2",
+    "echarts": "^3.8.5",
     "element-ui": "^2.10.1",
     "font-awesome": "^4.7.0",
     "nprogress": "^0.2.0",

+ 12 - 1
ys_int/src/i18n/lang/en.js

@@ -120,7 +120,17 @@ const lang = {
 		moldSet: "Equipment Set",
 		inputMoldSet: "Please select the equipment",
 		completed: "The alarm has been dealt with.",
-		mustUpload: "Must upload photos",
+        mustUpload: "Must upload photos",
+        lastOpenTime: "Final mold opening time",
+        openCycle: "Open Cycle",
+        openNumChart: "Open Frequency Chart",
+        openCycleChart: "Open Cycle Chart",
+        sec: "Second",
+        frequency: "Frequency",
+        openNum: "Open Frequency",
+        maxOpenCycle: "Maximum Open Cycle",
+        minOpenCycle: "Minimum Open Cycle",
+        avgOpenCycle: "Average Open Cycle",
 	},
 	// 项目管理
     project: {
@@ -354,6 +364,7 @@ const lang = {
         inputAlarmDegreeNum: "Thermal Alarm Degree must be a number",
         chooseEquipment: "Please select the equipment you want to send.",
         issuedSuccess: "Issued Success",
+        sim: "SIM Card Num",
     },
     // 后台翻译
     port: {

+ 12 - 1
ys_int/src/i18n/lang/zh.js

@@ -120,7 +120,17 @@ const lang = {
 		moldSet: "云模盒设置",
 		inputMoldSet: "请选择云模盒",
 		completed: "告警处理完毕",
-		mustUpload: "必须上传照片",
+        mustUpload: "必须上传照片",
+        lastOpenTime: "最后开模时间",
+        openCycle: "开合周期",
+        openNumChart: "开合次数表",
+        openCycleChart: "开合周期表",
+        sec: "秒",
+        frequency: "次数",
+        openNum: "开合次数",
+        maxOpenCycle: "最大开合周期",
+        minOpenCycle: "最小开合周期",
+        avgOpenCycle: "平均开合周期",
 	},
 	// 项目管理
     project: {
@@ -355,6 +365,7 @@ const lang = {
         inputAlarmDegreeNum: "热报警度数必须为数字",
         chooseEquipment: "请选择要下发的云模盒",
         issuedSuccess: "下发成功",
+        sim: "SIM卡号",
     },
     ...locale
 }

+ 3 - 0
ys_int/src/main.js

@@ -23,6 +23,9 @@ Vue.prototype.http = http
 import port from './port'
 Vue.prototype.port = port
 
+import echarts from 'echarts'
+Vue.prototype.echarts = echarts
+
 import 'font-awesome/css/font-awesome.min.css'
 import './assets/iconfont/iconfont.css'
 

+ 107 - 71
ys_int/src/views/base/allocation.vue

@@ -32,22 +32,31 @@
                 <el-form-item style="float: right;">
                     <el-button type="primary" @click="showAllocation">{{$t('base.add')}}</el-button>
                 </el-form-item>
-                <el-form-item style="float: right;">
+                <!-- <el-form-item style="float: right;">
                     <el-button type="primary" @click="issued">{{$t('base.issued')}}</el-button>
-                </el-form-item>
+                </el-form-item> -->
             </el-form>
         </el-col>
 
         <!--列表-->
         <el-table :data="allocations" :height="tableHeight" highlight-current-row v-loading="listLoading" @selection-change="handleSelectionChange" style="width: 100%;">
-            <el-table-column type="selection" width="50"></el-table-column>
+            <!-- <el-table-column type="selection" width="50"></el-table-column> -->
             <el-table-column type="index" width="60"></el-table-column>
             <el-table-column prop="equipmentNo" :label="$t('basic.equipmentNo')" width="180" sortable></el-table-column>
-            <el-table-column prop="hillNumber" :label="$t('mold.hillNumber')" width="80" align="center" sortable></el-table-column>
+            <el-table-column prop="sim" :label="$t('basic.sim')" width="120" sortable></el-table-column>
+            <el-table-column prop="hillNumber" :label="$t('mold.hillNumber')" width="80" align="center" sortable>
+                <template slot-scope="scope">{{scope.row.hillNumber}}<span v-if="scope.row.hillNumber">%</span></template>
+            </el-table-column>
+            <el-table-column prop="alarmBattery" :label="$t('basic.alarmBattery')" width="130" align="center" sortable>
+                <template slot-scope="scope">{{scope.row.alarmBattery}}<span v-if="scope.row.alarmBattery">%</span></template>
+            </el-table-column>
+            <el-table-column prop="alarmDegree" :label="$t('basic.alarmDegree')" width="120" align="center" sortable>
+                <template slot-scope="scope">{{scope.row.alarmDegree}}<span v-if="scope.row.alarmDegree">℃</span></template>
+            </el-table-column>
             <el-table-column prop="useLife" :label="$t('basic.useLife')" width="100" align="center" sortable>
                 <template slot-scope="scope">{{scope.row.useLife}}{{$t('basic.year')}}</template>
             </el-table-column>
-            <el-table-column prop="useLife" :label="$t('basic.diffTime')" width="100" align="center" sortable>
+            <el-table-column prop="diffTime" :label="$t('basic.diffTime')" width="100" align="center" sortable>
                 <template slot-scope="scope">{{scope.row.diffTime}}</template>
             </el-table-column>
             <el-table-column prop="modelName" :label="$t('mold.modelName')" sortable></el-table-column>
@@ -132,11 +141,25 @@
         </el-dialog>
 
         <!-- 启用弹窗 -->
-        <el-dialog :title="$t('base.use')" :visible.sync="operateDialogVisible" width="400px">
-            <el-form label-width="100px" :rules="formRules" :inline="true" class="demo-form-inline">
-                <!-- <el-form-item label="某个参数">
+        <el-dialog :title="$t('base.use')" :visible.sync="operateDialogVisible" width="450px">
+            <!-- <el-form label-width="100px" :rules="formRules" :inline="true" class="demo-form-inline">
+                <el-form-item label="某个参数">
                     <el-input autocomplete="off" placeholder="填了也不会发生什么"></el-input>
-                </el-form-item> -->
+                </el-form-item>
+            </el-form>
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="operateDialogVisible = false">{{$t('el.messagebox.cancel')}}</el-button>
+                <el-button type="primary" @click="enable">{{$t('base.use')}}</el-button>
+            </span> -->
+            <el-form :model="issuedVal" label-width="130px" :rules="formRules" ref="issuedVal" :inline="true" class="demo-form-inline">
+                <el-form-item :label="$t('basic.alarmBattery')" prop="alarmBattery">
+                    <el-input v-model.number="issuedVal.alarmBattery" type="age" autocomplete="off" :placeholder="$t('basic.inputAlarmBattery')" style="width:250px;"></el-input>
+                    %
+                </el-form-item>
+                <el-form-item :label="$t('basic.alarmDegree')" prop="alarmDegree">
+                    <el-input v-model.number="issuedVal.alarmDegree" type="age" autocomplete="off" :placeholder="$t('basic.inputAlarmDegree')" style="width:250px;"></el-input>
+                    ℃
+                </el-form-item>
             </el-form>
             <span slot="footer" class="dialog-footer">
                 <el-button @click="operateDialogVisible = false">{{$t('el.messagebox.cancel')}}</el-button>
@@ -446,81 +469,97 @@
             //打开启用窗口
             openEnable(index) {
                 this.operateDialogVisible = true;
+                this.issuedVal.alarmBattery = this.allocations[this.activeIndex].alarmBattery;
+                this.issuedVal.alarmDegree = this.allocations[this.activeIndex].alarmDegree;
                 this.activeIndex = index;
             },
 
             //启用设备
             enable() {
-                if(this.allocations[this.activeIndex].belongCompanyId == null){
-                    this.$message({
-                        message: this.$t("basic.inputBlongComp"),
-                        type: "error"
-                    });
-                }else{
+                // if(this.allocations[this.activeIndex].belongCompanyId == null){
+                //     this.$message({
+                //         message: this.$t("basic.inputBlongComp"),
+                //         type: "error"
+                //     });
+                // }else{
+                this.allocations[this.activeIndex].isUse = 1;
+                // this.http.post( this.port.base.enableMould, {
+                //     id: this.allocations[this.activeIndex].id,
+                //     isUse: 1
+                // },
+                var str = this.allocations[this.activeIndex].equipmentNo;
+                this.http.post( this.port.base.setPacket, {
+                    lowPowerLimit: this.issuedVal.alarmBattery,//.toString(16),
+                    hotAlarmLimit: this.issuedVal.alarmDegree,//.toString(16),
+                    isUse: 1,
+                    equipmentNo: str
+                },
+                res => {
                     this.operateDialogVisible = false;
-                    this.allocations[this.activeIndex].isUse = 1;
-                    this.http.post( this.port.base.enableMould, {
-                        id: this.allocations[this.activeIndex].id,
-                        isUse: 1
-                    },
-                    res => {
-                        if (res.code == "ok") {
-                            this.$message({
-                                message: this.$t("basic.inUse"),
-                                type: "success"
-                            });
-                            this.getMoulds();
-                        } else {
-                            this.$message({
-                                message: res.msg,
-                                type: "error"
-                            });
-                        }
-                    },
-                    error => {
+                    if (res.code == "ok") {
                         this.$message({
-                            message: error,
+                            message: this.$t("basic.inUse"),
+                            type: "success"
+                        });
+                        this.getMoulds();
+                    } else {
+                        this.$message({
+                            message: res.msg,
                             type: "error"
                         });
+                    }
+                },
+                error => {
+                    this.operateDialogVisible = false;
+                    this.$message({
+                        message: error,
+                        type: "error"
                     });
-                }
+                });
             },
 
             //停用云模盒
             disableEquipment(index) {
-                if(this.allocations[index].belongCompanyId == null){
-                    this.$message({
-                        message: this.$t("basic.inputBlongComp"),
-                        type: "error"
-                    });
-                }else{
+                // if(this.allocations[index].belongCompanyId == null){
+                //     this.$message({
+                //         message: this.$t("basic.inputBlongComp"),
+                //         type: "error"
+                //     });
+                // }else{
+                this.allocations[index].isUse = 1;
+                // this.http.post( this.port.base.enableMould, {
+                //     id: this.allocations[index].id,
+                //     isUse: 0
+                // },
+                var str = this.allocations[this.activeIndex].equipmentNo;
+                this.http.post( this.port.base.setPacket, {
+                    lowPowerLimit: this.issuedVal.alarmBattery,//.toString(16),
+                    hotAlarmLimit: this.issuedVal.alarmDegree,//.toString(16),
+                    isUse: 0,
+                    equipmentNo: str
+                },
+                res => {
                     this.operateDialogVisible = false;
-                    this.allocations[index].isUse = 1;
-                    this.http.post( this.port.base.enableMould, {
-                        id: this.allocations[index].id,
-                        isUse: 0
-                    },
-                    res => {
-                        if (res.code == "ok") {
-                            this.$message({
-                                message: this.$t("basic.offUse"),
-                                type: "success"
-                            });
-                            this.getMoulds();
-                        } else {
-                            this.$message({
-                                message: res.msg,
-                                type: "error"
-                            });
-                        }
-                    },
-                    error => {
+                    if (res.code == "ok") {
                         this.$message({
-                            message: error,
+                            message: this.$t("basic.offUse"),
+                            type: "success"
+                        });
+                        this.getMoulds();
+                    } else {
+                        this.$message({
+                            message: res.msg,
                             type: "error"
                         });
+                    }
+                },
+                error => {
+                    this.operateDialogVisible = false;
+                    this.$message({
+                        message: error,
+                        type: "error"
                     });
-                }
+                });
             },
 
             //导入云模盒
@@ -562,10 +601,6 @@
             },
 
             saveIssued() {
-                console.log(this.multipleSelection)
-                console.log(this.issuedVal)
-                console.log(this.issuedVal.alarmBattery.toString(16))
-                console.log(this.issuedVal.alarmDegree.toString(16))
                 if(this.multipleSelection.length == 0) {
                     this.$message({
                         message: this.$t('basic.chooseEquipment'),
@@ -578,8 +613,8 @@
                     }
                     str = str.substring(0,str.length-1)
                     this.http.post( this.port.base.setPacket, {
-                        lowPowerLimit: this.issuedVal.alarmBattery.toString(16),
-                        hotAlarmLimit: this.issuedVal.alarmDegree.toString(16),
+                        lowPowerLimit: this.issuedVal.alarmBattery,//.toString(16),
+                        hotAlarmLimit: this.issuedVal.alarmDegree,//.toString(16),
                         equipmentNo: str
                     },
                     res => {
@@ -588,6 +623,7 @@
                                 message: this.$t('basic.issuedSuccess'),
                                 type: "success"
                             });
+                            this.issuedVisible = false;
                             this.getMoulds();
                         } else {
                             this.$message({

+ 2 - 1
ys_int/src/views/detection/detection.vue

@@ -29,13 +29,14 @@
                     <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="$t('basic.equipmentNo')" width="120" sortable></el-table-column>
+            <el-table-column prop="equipmentNo" :label="$t('basic.equipmentNo')" width="180" 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="lastOpenTime" :label="$t('mold.lastOpenTime')" align="center" width="150" sortable></el-table-column>
             <el-table-column :label="$t('runTest.state')" align="center" width="100" sortable>
                 <template slot-scope="scope">
                     <span v-if="scope.row.state == 0">{{$t('base.static')}}</span>

+ 320 - 54
ys_int/src/views/detection/maintenance.vue

@@ -18,59 +18,83 @@
             </el-form>
         </el-col>
 
-        <!-- 模具处理 -->
-        <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="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" :style="allDetail">
+            <!-- 模具处理 -->
+            <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="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">{{$t('runTest.openCycle')}}</el-col>
+            <el-col :span="24">
+                <el-col :span="11">
+                    <div style="padding:0 20px">
+                        <b style="font-size:20px;text-align:center;margin-bottom:20px;">{{$t('runTest.openNumChart')}}</b>
+                        <el-date-picker v-model="openNum" style="float:right;width:125px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" 
+                        @change='changeOpen(1)' size="mini" :clearable="false" type="date" :placeholder="$t('el.datepicker.selectDate')"></el-date-picker>
+                    </div>
+                    <div id="myChart1" :style="{ height: '300px'}"></div>
+                </el-col>
+                <el-col :span="11" :offset="2">
+                    <div style="padding:0 20px">
+                        <b style="font-size:20px;text-align:center;margin-bottom:20px;">{{$t('runTest.openCycleChart')}}</b>
+                        <el-date-picker v-model="openCycle" style="float:right;width:210px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" 
+                        @change='changeOpen(2)' size="mini" :clearable="false" type="daterange" 
+                        :start-placeholder="$t('el.datepicker.startDate')" :end-placeholder="$t('el.datepicker.endDate')"></el-date-picker>
+                    </div>
+                    <div id="myChart2" :style="{ height: '300px'}"></div>
+                </el-col>
+            </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="$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">
-                        <!-- 大图加载 -->
-                        <div class="demo-image__preview">
-                        <el-image style="width: 100px; height: 100px"
-                            :src="scope.row.fileUrl" :preview-src-list="scope.row.fileUrl"></el-image>
-                        </div>
-                    </a>
-                </template>
-            </el-table-column>
-            <el-table-column prop="indate" :label="$t('runTest.closeTime')" width="200" sortable></el-table-column>
-        </el-table>
+            <!-- 操作记录 -->
+            <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="$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">
+                            <!-- 大图加载 -->
+                            <div class="demo-image__preview">
+                            <el-image style="width: 100px; height: 100px"
+                                :src="scope.row.fileUrl" :preview-src-list="scope.row.fileUrl"></el-image>
+                            </div>
+                        </a>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="indate" :label="$t('runTest.closeTime')" width="200" sortable></el-table-column>
+            </el-table>
 
-        <!--工具条-->
-        <el-col :span="24" class="toolbar">
-            <el-pagination
-                @size-change="handleSizeChange"
-                @current-change="handleCurrentChange"
-                :page-sizes="[20 , 50 , 80 , 100 , 200]"
-                :page-size="20"
-                layout="total, sizes, prev, pager, next"
-                :total="total"
-                style="float:right;"
-            ></el-pagination>
+            <!--工具条-->
+            <el-col :span="24" class="toolbar">
+                <el-pagination
+                    @size-change="handleSizeChange"
+                    @current-change="handleCurrentChange"
+                    :page-sizes="[20 , 50 , 80 , 100 , 200]"
+                    :page-size="20"
+                    layout="total, sizes, prev, pager, next"
+                    :total="total"
+                    style="float:right;"
+                ></el-pagination>
+            </el-col>
         </el-col>
 
         <!--新增界面-->
@@ -135,13 +159,13 @@
         data() {
             return {
                 user: JSON.parse(sessionStorage.getItem("user")),
+                 detail: '',
                 //本页模具ID
                 mouldId: null,
                 //模具名字
                 mouldName: null,
                 //模具状态
                 mouldState: 0,
-                options: [{ value: "aaa", label: "123" }, { value: "bbb", label: "456" }],
                 //记录
                 records: [],
                 //警告信息
@@ -192,7 +216,16 @@
                     mouldId: null,
                     equipmentId: null
                 },
-                imageUrl: ""
+                imageUrl: "",
+                openNum: util.formatDate.format(new Date(), 'yyyy-MM-dd'),
+                openCycle: [util.formatDate.format(new Date(), 'yyyy-MM-dd') , util.formatDate.format(new Date(), 'yyyy-MM-dd')],
+                allDetail: {
+                    overflow: 'auto',
+                    padding: '0px 5px',
+                    height: 0
+                },
+                echarts1: {},
+                echarts2: {},
             };
         },
         methods: {
@@ -201,21 +234,26 @@
                 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";
@@ -231,10 +269,12 @@
                 }
                 return rightType && isLt5M;
             },
+
             //显示保养界面
             showMaintenance: function() {
                 this.maintenanceFormVisible = true;
             },
+
             //获取记录
             getList() {
                 this.listLoading = true;
@@ -263,6 +303,7 @@
                     });
                 });
             },
+
             //模具详情 获取模具名字用的
             getDetail() {
                 this.http.post( this.port.mold.moldDetail, {
@@ -270,6 +311,9 @@
                 },
                 res => {
                     if (res.code == "ok") {
+                        this.detail = res.data.vo;
+                        this.getEcharts1();
+                        this.getEcharts2();
                         this.mouldName = res.data.vo.modelName;
                         this.mouldState = res.data.vo.state;
                         this.requirement = res.data.vo.isMaintain == 1;
@@ -299,6 +343,7 @@
                     });
                 });
             },
+
             //模具保养的按钮按下之后(关闭之后也要清理文件但是还没写)
             maintainConfirm() {
                 if (this.$refs.upload.uploadFiles.length == 1) {
@@ -310,6 +355,7 @@
                     });
                 }
             },
+
             //模具保养
             maintain(params) {
                 if (this.type.value != null) {
@@ -356,6 +402,7 @@
                     });
                 }
             },
+
             //获取告警时可以更换的设备列表
             getAlternativeEquipment() {
                 this.http.post( this.port.mold.moldChangeRequirement, {
@@ -381,6 +428,7 @@
                     });
                 });
             },
+
             //告警处理
             warningArrangement() {
                 if (this.warningForm.equipmentId == null) {
@@ -411,11 +459,223 @@
                         });
                     });
                 }
-            }
+            },
+
+            // 绘制折线图
+            getEcharts1() {
+                this.http.post( this.port.base.openingAndClosingTimesChart, {
+                    equipmentNo: this.detail.equipmentNo,//"898602B5191730002945",
+                    time: this.openNum
+                },
+                res => {
+                    if (res.code == "ok") {
+                        var option = {
+                            tooltip: {
+                                trigger: 'axis'
+                            },
+                            // grid: {
+                            //     left: '3%',
+                            //     right: '4%',
+                            //     bottom: '6%',
+                            //     containLabel: true
+                            // },
+                            xAxis: {
+                                type: 'category',
+                                boundaryGap: false,
+                                data: []
+                            },
+                            yAxis: {
+                                name: this.$t('runTest.frequency') + '(‰)',
+                                type: 'value'
+                            },
+                            dataZoom: [{
+                                type: 'inside',
+                                start: 0,
+                                end: 10
+                            }, {
+                                start: 0,
+                                end: 10,
+                                handleIcon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z',
+                                handleSize: '80%',
+                                handleStyle: {
+                                    color: '#fff',
+                                    shadowBlur: 3,
+                                    shadowColor: 'rgba(0, 0, 0, 0.6)',
+                                    shadowOffsetX: 2,
+                                    shadowOffsetY: 2
+                                }
+                            }],
+                            series: [
+                                {
+                                    name: this.$t('runTest.openNum'),
+                                    type: 'line',
+                                    data: [],
+                                    itemStyle : { 
+                                        normal : { 
+                                            color: "#009ad6", //改变折线点的颜色
+                                            lineStyle:{ 
+                                                color: "#009ad6" //改变折线颜色
+                                            } 
+                                        } 
+                                    }
+                                }
+                            ]
+                        },
+                        list = res.data, 
+                        xData = [], 
+                        sData = [];
+
+                        for(var i in list) {
+                            xData.push(i);
+                            sData.push(list[i])
+                        }
+                        option.xAxis.data = xData;
+                        option.series[0].data = sData;
+
+                        this.drawEchart(1,JSON.stringify(option))
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+            
+            getEcharts2() {
+                this.http.post( this.port.base.openingAndClosingTimesChartCycle, {
+                    equipmentNo: this.detail.equipmentNo,//"898602B5191730002945",
+                    startTime: this.openCycle[0],
+                    endTime: this.openCycle[1]
+                },
+                res => {
+                    if (res.code == "ok") {
+                        var option = {
+                            tooltip: {
+                                trigger: 'axis'
+                            },
+                            grid: {
+                                left: '3%',
+                                right: '4%',
+                                bottom: '3%',
+                                containLabel: true
+                            },
+                            xAxis: {
+                                type: 'category',
+                                boundaryGap: false,
+                                data: []
+                            },
+                            yAxis: {
+                                name: this.$t('runTest.sec') + '(s)',
+                                type: 'value'
+                            },
+                            series: [{
+                                name: this.$t('runTest.maxOpenCycle'),
+                                type: 'line',
+                                stack: this.$t('runTest.openCycle'),
+                                data:[],
+                                itemStyle : { 
+                                    normal : { 
+                                        color: "#d93a49", //改变折线点的颜色
+                                        lineStyle:{ 
+                                            color: "#d93a49" //改变折线颜色
+                                        } 
+                                    } 
+                                }
+                            },
+                            {
+                                name: this.$t('runTest.minOpenCycle'),
+                                type:'line',
+                                stack: this.$t('runTest.openCycle'),
+                                data:[],
+                                itemStyle : { 
+                                    normal : { 
+                                        color: "#009ad6", //改变折线点的颜色
+                                        lineStyle:{ 
+                                            color: "#009ad6" //改变折线颜色
+                                        } 
+                                    } 
+                                }
+                            },
+                            {
+                                name: this.$t('runTest.avgOpenCycle'),
+                                type: 'line',
+                                stack: this.$t('runTest.openCycle'),
+                                data:[],
+                                itemStyle : { 
+                                    normal : { 
+                                        color: "#7fb80e", //改变折线点的颜色
+                                        lineStyle:{ 
+                                            color: "#7fb80e" //改变折线颜色
+                                        } 
+                                    } 
+                                }
+                            }]
+                        },
+                        list = res.data, 
+                        xData = [], 
+                        avg = [] , max = [] , min = [];
+
+                        for(var i in list) {
+                            xData.push(list[i].time);
+                            max.push(list[i].maxCycle/1000);
+                            min.push(list[i].minCycle/1000);
+                            avg.push(list[i].avgCycle/1000);
+                        }
+                        option.xAxis.data = xData;
+                        option.series[0].data = max;
+                        option.series[1].data = min;
+                        option.series[2].data = avg;
+
+                        this.drawEchart(2,JSON.stringify(option));
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+            
+
+            drawEchart(type,option) {
+                let myChart = this.echarts.init(document.getElementById("myChart" + type));
+                if(type == 1) {
+                    this.echarts1 = myChart;
+                } else {
+                    this.echarts2 = myChart;
+                }
+                myChart.setOption(JSON.parse(option));
+            },
+
+            changeOpen(type) {
+                if(type == 1) {
+                    this.getEcharts1();
+                } else if(type == 2) {
+                    this.getEcharts2();
+                }
+            },
         },
         created() {
             let height = window.innerHeight;
             this.tableHeight = height - 370;
+            this.allDetail.height = height - 170 + "px";
+            const that = this;
+            window.onresize = function temp() {
+                that.allDetail.height = window.innerHeight - 170;
+            };
         },
         mounted() {
             this.mouldId = this.$route.params.id; //传到当前页面的模具编号
@@ -423,6 +683,12 @@
             this.getList();
             this.getDetail();
             this.getAlternativeEquipment();
+           
+            const that = this
+            window.onresize = function temp() {
+                that.echarts1.resize();
+                that.echarts2.resize();
+            };
         }
     };
 </script>

+ 1 - 1
ys_vue/package.json

@@ -11,7 +11,7 @@
   },
   "dependencies": {
     "axios": "^0.15.3",
-    "echarts": "^3.3.2",
+    "echarts": "^3.8.5",
     "element-ui": "^2.10.1",
     "font-awesome": "^4.7.0",
     "nprogress": "^0.2.0",

+ 3 - 0
ys_vue/src/main.js

@@ -16,6 +16,9 @@ Vue.prototype.http = http
 import port from './port'
 Vue.prototype.port = port
 
+import echarts from 'echarts'
+Vue.prototype.echarts = echarts
+
 import VueClipboard from 'vue-clipboard2'
 Vue.use(VueClipboard)
 

+ 3 - 0
ys_vue/src/port.js

@@ -108,6 +108,9 @@ export default {
         importMouldEquipmentExcel: '/mouldequipment/importMouldEquipmentExcel', //批量导入云模盒
         
         setPacket: '/JSKBT/setPacket.do',// 云平台下行配置数据包接口
+        openingAndClosingTimesChart: '/mouldhistory/openingAndClosingTimesChart', //获取云模盒的每日开合次数图表 (时间/次数)
+        openingAndClosingTimesChartCycle: '/mouldhistory/openingAndClosingTimesChartCycle', //获取云模盒的每日开合次数周期 (时间/次数)
+
     },
     file: {
         view: '/pdffile/getPdfFile' // 文件预览

+ 109 - 73
ys_vue/src/views/base/allocation.vue

@@ -32,27 +32,36 @@
                 <el-form-item style="float: right;">
                     <el-button type="primary" @click="showAllocation">新建</el-button>
                 </el-form-item>
-                <el-form-item style="float: right;">
+                <!-- <el-form-item style="float: right;">
                     <el-button type="primary" @click="issued">下发</el-button>
-                </el-form-item>
+                </el-form-item> -->
             </el-form>
         </el-col>
 
         <!--列表-->
         <el-table :data="allocations" :height="tableHeight" highlight-current-row v-loading="listLoading" @selection-change="handleSelectionChange" style="width: 100%;">
-            <el-table-column type="selection" width="50"></el-table-column>
+            <!-- <el-table-column type="selection" width="50"></el-table-column> -->
             <el-table-column type="index" width="60"></el-table-column>
             <el-table-column prop="equipmentNo" label="云模盒编号" width="180" sortable></el-table-column>
-            <el-table-column prop="hillNumber" label="电量" width="80" align="center" sortable></el-table-column>
+            <el-table-column prop="sim" label="SIM卡号" width="120" sortable></el-table-column>
+            <el-table-column prop="hillNumber" label="电量" width="80" align="center" sortable>
+                <template slot-scope="scope">{{scope.row.hillNumber}}<span v-if="scope.row.hillNumber">%</span></template>
+            </el-table-column>
+            <el-table-column prop="alarmBattery" label="报警电池电量" width="130" align="center" sortable>
+                <template slot-scope="scope">{{scope.row.alarmBattery}}<span v-if="scope.row.alarmBattery">%</span></template>
+            </el-table-column>
+            <el-table-column prop="alarmDegree" label="热报警度数" width="120" align="center" sortable>
+                <template slot-scope="scope">{{scope.row.alarmDegree}}<span v-if="scope.row.alarmDegree">℃</span></template>
+            </el-table-column>
             <el-table-column prop="useLife" label="使用年限" width="100" align="center" sortable>
                 <template slot-scope="scope">{{scope.row.useLife}}年</template>
             </el-table-column>
-            <el-table-column prop="useLife" label="倒计时" width="100" align="center" sortable>
+            <el-table-column prop="diffTime" label="倒计时" width="100" align="center" sortable>
                 <template slot-scope="scope">{{scope.row.diffTime}}</template>
             </el-table-column>
-            <el-table-column prop="modelName" label="模具名称" sortable></el-table-column>
+            <el-table-column prop="modelName" label="模具名称" width="130" sortable></el-table-column>
             <el-table-column prop="modelNo" label="模具编号" width="120" align="center" sortable></el-table-column>
-            <el-table-column prop="companyName" label="公司名称" sortable></el-table-column>
+            <el-table-column prop="companyName" label="公司名称" width="180" sortable></el-table-column>
             <el-table-column prop="agent" label="代理商" width="120" sortable></el-table-column>
             <el-table-column label="云模盒状态" align="center" width="120" sortable>
                 <template slot-scope="scope">
@@ -132,11 +141,25 @@
         </el-dialog>
 
         <!-- 启用弹窗 -->
-        <el-dialog title="启用" :visible.sync="operateDialogVisible" width="400px">
-            <el-form label-width="100px" :rules="formRules" :inline="true" class="demo-form-inline">
-                <!-- <el-form-item label="某个参数">
+        <el-dialog title="启用" :visible.sync="operateDialogVisible" width="450px">
+            <!-- <el-form label-width="100px" :rules="formRules" :inline="true" class="demo-form-inline">
+                <el-form-item label="某个参数">
                     <el-input autocomplete="off" placeholder="填了也不会发生什么"></el-input>
-                </el-form-item> -->
+                </el-form-item>
+            </el-form>
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="operateDialogVisible = false">取消</el-button>
+                <el-button type="primary" @click="enable">启用</el-button>
+            </span> -->
+            <el-form :model="issuedVal" label-width="130px" :rules="formRules" ref="issuedVal" :inline="true" class="demo-form-inline">
+                <el-form-item label="报警电池电量" prop="alarmBattery">
+                    <el-input v-model.number="issuedVal.alarmBattery" type="age" autocomplete="off" placeholder="请输入报警电池电量" style="width:250px;"></el-input>
+                    %
+                </el-form-item>
+                <el-form-item label="热报警度数" prop="alarmDegree">
+                    <el-input v-model.number="issuedVal.alarmDegree" type="age" autocomplete="off" placeholder="请输入热报警度数" style="width:250px;"></el-input>
+                    ℃
+                </el-form-item>
             </el-form>
             <span slot="footer" class="dialog-footer">
                 <el-button @click="operateDialogVisible = false">取消</el-button>
@@ -417,81 +440,97 @@
             //打开启用窗口
             openEnable(index) {
                 this.operateDialogVisible = true;
+                this.issuedVal.alarmBattery = this.allocations[this.activeIndex].alarmBattery;
+                this.issuedVal.alarmDegree = this.allocations[this.activeIndex].alarmDegree;
                 this.activeIndex = index;
             },
 
             //启用设备
             enable() {
-                if(this.allocations[this.activeIndex].belongCompanyId == null){
-                    this.$message({
-                        message: "输入所属公司后才能启用模具",
-                        type: "error"
-                    });
-                }else{
+                // if(this.allocations[this.activeIndex].belongCompanyId == null){
+                //     this.$message({
+                //         message: "输入所属公司后才能启用模具",
+                //         type: "error"
+                //     });
+                // }else{
+                this.allocations[this.activeIndex].isUse = 1;
+                // this.http.post( this.port.base.enableMould, {
+                //     id: this.allocations[this.activeIndex].id,
+                //     isUse: 1
+                // },
+                var str = this.allocations[this.activeIndex].equipmentNo;
+                this.http.post( this.port.base.setPacket, {
+                    lowPowerLimit: this.issuedVal.alarmBattery,//.toString(16),
+                    hotAlarmLimit: this.issuedVal.alarmDegree,//.toString(16),
+                    isUse: 1,
+                    equipmentNo: str
+                },
+                res => {
                     this.operateDialogVisible = false;
-                    this.allocations[this.activeIndex].isUse = 1;
-                    this.http.post( this.port.base.enableMould, {
-                        id: this.allocations[this.activeIndex].id,
-                        isUse: 1
-                    },
-                    res => {
-                        if (res.code == "ok") {
-                            this.$message({
-                                message: "设备已启用",
-                                type: "success"
-                            });
-                            this.getMoulds();
-                        } else {
-                            this.$message({
-                                message: res.msg,
-                                type: "error"
-                            });
-                        }
-                    },
-                    error => {
+                    if (res.code == "ok") {
                         this.$message({
-                            message: error,
+                            message: "设备已启用",
+                            type: "success"
+                        });
+                        this.getMoulds();
+                    } else {
+                        this.$message({
+                            message: res.msg,
                             type: "error"
                         });
+                    }
+                },
+                error => {
+                    this.operateDialogVisible = false;
+                    this.$message({
+                        message: error,
+                        type: "error"
                     });
-                }
+                });
             },
 
             //停用云模盒
             disableEquipment(index) {
-                if(this.allocations[index].belongCompanyId == null){
-                    this.$message({
-                        message: "输入所属公司后才能启用模具",
-                        type: "error"
-                    });
-                }else{
+                // if(this.allocations[index].belongCompanyId == null){
+                //     this.$message({
+                //         message: "输入所属公司后才能启用模具",
+                //         type: "error"
+                //     });
+                // }else{
+                this.allocations[index].isUse = 0;
+                // this.http.post( this.port.base.enableMould, {
+                //     id: this.allocations[index].id,
+                //     isUse: 0
+                // },
+                var str = this.allocations[this.activeIndex].equipmentNo;
+                this.http.post( this.port.base.setPacket, {
+                    lowPowerLimit: this.issuedVal.alarmBattery,//.toString(16),
+                    hotAlarmLimit: this.issuedVal.alarmDegree,//.toString(16),
+                    isUse: 0,
+                    equipmentNo: str
+                },
+                res => {
                     this.operateDialogVisible = false;
-                    this.allocations[index].isUse = 0;
-                    this.http.post( this.port.base.enableMould, {
-                        id: this.allocations[index].id,
-                        isUse: 0
-                    },
-                    res => {
-                        if (res.code == "ok") {
-                            this.$message({
-                                message: "设备已停用",
-                                type: "success"
-                            });
-                            this.getMoulds();
-                        } else {
-                            this.$message({
-                                message: res.msg,
-                                type: "error"
-                            });
-                        }
-                    },
-                    error => {
+                    if (res.code == "ok") {
                         this.$message({
-                            message: error,
+                            message: "设备已停用",
+                            type: "success"
+                        });
+                        this.getMoulds();
+                    } else {
+                        this.$message({
+                            message: res.msg,
                             type: "error"
                         });
+                    }
+                },
+                error => {
+                    this.operateDialogVisible = false;
+                    this.$message({
+                        message: error,
+                        type: "error"
                     });
-                }
+                });
             },
 
             //导入云模盒
@@ -538,10 +577,6 @@
             },
 
             saveIssued() {
-                console.log(this.multipleSelection)
-                console.log(this.issuedVal)
-                console.log(this.issuedVal.alarmBattery.toString(16))
-                console.log(this.issuedVal.alarmDegree.toString(16))
                 if(this.multipleSelection.length == 0) {
                     this.$message({
                         message: "请选择要下发的云模盒",
@@ -554,8 +589,8 @@
                     }
                     str = str.substring(0,str.length-1)
                     this.http.post( this.port.base.setPacket, {
-                        lowPowerLimit: this.issuedVal.alarmBattery.toString(16),
-                        hotAlarmLimit: this.issuedVal.alarmDegree.toString(16),
+                        lowPowerLimit: this.issuedVal.alarmBattery,//.toString(16),
+                        hotAlarmLimit: this.issuedVal.alarmDegree,//.toString(16),
                         equipmentNo: str
                     },
                     res => {
@@ -564,6 +599,7 @@
                                 message: "下发成功",
                                 type: "success"
                             });
+                            this.issuedVisible = false;
                             this.getMoulds();
                         } else {
                             this.$message({

+ 2 - 1
ys_vue/src/views/detection/detection.vue

@@ -29,13 +29,14 @@
                     <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="equipmentNo" label="云模盒编号" width="180" 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="lastOpenTime" label="最后开模时间" align="center" width="150" sortable></el-table-column>
             <el-table-column label="当前状态" align="center" width="100" sortable>
                 <template slot-scope="scope">
                     <span v-if="scope.row.state == 0">静止</span>

Diferenças do arquivo suprimidas por serem muito extensas
+ 661 - 445
ys_vue/src/views/detection/maintenance.vue