Compare commits

...

6 Commits

3 changed files with 21 additions and 18 deletions

View File

@ -1,8 +1,8 @@
###
# @Author: Do not edit
# @Date: 2023-08-29 09:40:39
# @LastEditTime: 2024-01-04 15:50:26
# @LastEditors: zhp
# @LastEditTime: 2024-01-08 16:23:54
# @LastEditors: DY
# @Description:
###
# 开发环境配置
@ -15,9 +15,7 @@ VUE_APP_TITLE = MES系统
# VUE_APP_BASE_API = 'http://100.64.0.26:48082'
VUE_APP_BASE_API = 'http://192.168.0.33:48082'
# VUE_APP_BASE_API = 'http://10.70.2.2:8080'
# VUE_APP_BASE_API = 'http://192.168.1.101:8080'
# VUE_APP_BASE_API = 'http://192.168.4.173:48080'
# VUE_APP_BASE_API = 'http://192.168.2.173:48080'
# VUE_APP_BASE_API = 'http://192.168.1.49:48082'
@ -26,9 +24,12 @@ VUE_APP_BASE_API = 'http://192.168.0.33:48082'
# VUE_APP_BASE_API = 'http://192.168.1.104:48082'
# VUE_APP_BASE_API = 'http://192.168.1.62:48082'
# VUE_APP_BASE_API = 'http://192.168.1.78:48082'
<<<<<<< HEAD
# dcs地址
VUE_APP_Socket_Dcs_API = 'ws://10.70.180.10:8081'
=======
>>>>>>> projects/mesxc-test
# socket地址
VUE_APP_Socket_API = 'ws://10.70.2.2:8080'
# VUE_APP_Socket_API = 'ws://192.168.0.33:48082'

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-12-06 10:36:56
* @LastEditTime: 2024-01-08 16:11:03
* @Description:
-->
<template>
@ -253,6 +253,7 @@ export default {
dataRule: {
code: [{ required: true, message: "产品编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "产品名称不能为空", trigger: "blur" }],
specifications: [{ required: true, message: "规格不能为空", trigger: "blur" }],
materialType: [{ required: true, message: "物料类型不能为空", trigger: "change" }],
productType: [{ required: true, message: "产品类型不能为空", trigger: "change" }],
processTime: [{ required: true, message: "产线生产单位用时不能为空", trigger: "blur" }]

View File

@ -51,10 +51,10 @@ export default {
components: {},
props: {},
data() {
const now = new Date();
// const now = new Date().getTime();
// const [y, m, d] = [now.getFullYear(), now.getMonth(), now.getDate()];
const today = new Date().getTime();
const tenminAgo = today - (10 * 60 * 1000);
const tenminAgo = new Date(today - (10 * 60 * 1000)).getTime();
return {
searchBarFormConfig: [
{
@ -77,7 +77,7 @@ export default {
dateType: 'datetimerange', // datetimerange
format: 'yyyy-MM-dd HH:mm:ss',
// valueFormat: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'timestamp',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
@ -94,8 +94,8 @@ export default {
},
],
queryParams: {
id: null,
time: [tenminAgo, today],
equipmentId: null,
recordTime: [parseTime(tenminAgo), parseTime(today)],
},
tableList: [
// {
@ -118,7 +118,7 @@ export default {
beforeRouteEnter(to, from, next) {
if (Object.keys(to.params).length > 0) {
next((vm) => {
vm.$set(vm.queryParams, 'id', to.params.equipmentId);
vm.$set(vm.queryParams, 'equipmentId', to.params.equipmentId);
vm.$set(
vm.searchBarFormConfig[0],
'defaultSelect',
@ -132,7 +132,7 @@ export default {
vm.$set(
vm.searchBarFormConfig[2],
'defaultSelect',
vm.queryParams.time
vm.queryParams.recordTime
);
vm.handleQuery();
});
@ -167,7 +167,7 @@ export default {
},
beforeRouteLeave(to, from, next) {
// clean job
this.$set(this.queryParams, 'id', null);
this.$set(this.queryParams, 'equipmentId', null);
this.$set(this.searchBarFormConfig[0], 'defaultSelect', null);
this.$set(this.searchBarFormConfig[1], 'defaultSelect', null);
this.tableList = [];
@ -204,7 +204,7 @@ export default {
props.push({
label: item.name,
prop: item.name,
width: 128,
// width: 128,
});
firstLineData[item.name] = `${item.minValue ?? ''}-${
item.maxValue ?? ''
@ -280,14 +280,15 @@ export default {
async handleSearchBarBtnClick({ btnName, timeVal }) {
if (timeVal && timeVal.length > 0) {
if (timeVal[1] - timeVal[0] <= 10 * 60 * 1000) {
this.queryParams.time = timeVal;
console.log('nihc ', timeVal)
if (new Date(timeVal[1]).getTime() - new Date(timeVal[0]).getTime() <= 10 * 60 * 1000) {
this.queryParams.recordTime = timeVal;
await this.handleQuery();
} else {
this.$message.warning('时间范围最大一小时限制!')
}
} else {
this.queryParams.time = [];
this.queryParams.recordTime = [];
this.$message.warning('时间段必选!')
}