|
@@ -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>
|