孟加拉大屏更新 工位屏更新 计划产量页面更新
This commit is contained in:
parent
9a7df0b5ef
commit
aacd5124a8
@ -1,4 +1,4 @@
|
||||
import {get,post} from "@/utils/http"
|
||||
import {get,post} from "@/utils/http_custom"
|
||||
|
||||
//获取设备在线状态、设备列表
|
||||
export function getStatus(data){
|
||||
|
@ -86,11 +86,11 @@ export default {
|
||||
'QiCheDevSchedule':'AIAIM Division\n Equipment Complete Schedule',
|
||||
'InPlantProductsDevList':'Equipment List',
|
||||
'SerialNum':'Serial Number',
|
||||
'RackNum':'Machine Number',
|
||||
'DevName':'Machine Name',
|
||||
'JiqiName':'Machine Name',
|
||||
'RackNum':'Machine number',
|
||||
'DevName':'Machine name',
|
||||
'JiqiName':'Machine name',
|
||||
'ofLegion':'Affiliated Division',
|
||||
'DevStatus':'Device Status',
|
||||
'DevStatus':'Device status',
|
||||
'JiqiStatus':'Machine Status',
|
||||
"RunTime":'Working hours',
|
||||
'finishSchedule':'Complete Schedule',
|
||||
@ -160,7 +160,7 @@ export default {
|
||||
'haltTime':'Emergency Stop hours',
|
||||
'DevRunComparison':'Running Comparison Diagram',
|
||||
'TimeUtilizationRate':'Time Utilization',
|
||||
'UtilizationRate':'Utilization Rate',
|
||||
'UtilizationRate':'Utilization rate',
|
||||
'MicrofactoriesDevChart':'Micro-Factory Equipment IoT',
|
||||
'MicrofactoriesDevinfo':'Micro-Factory Equipment Information',
|
||||
'DevRunNum':'Running Equipment Quantity',
|
||||
|
208
src/utils/http_custom.ts
Normal file
208
src/utils/http_custom.ts
Normal file
@ -0,0 +1,208 @@
|
||||
// http.ts
|
||||
import axios, { AxiosRequestConfig, AxiosResponse } from 'axios'
|
||||
// import {development,production} from "@/utils/devSever"
|
||||
import qs from 'qs'
|
||||
// import MD5 from 'js-md5';
|
||||
import { open4 } from "./hint"
|
||||
import Router from '../router/index'
|
||||
// const router = Router; //路由全局对象
|
||||
// import "./dateRormat" //导出时间原型添加事件
|
||||
let url = process.env.VUE_APP_BASE_API
|
||||
// if (process.env.NODE_ENV === 'development') {
|
||||
// url = development.xhr//开发环境
|
||||
|
||||
// } else if (process.env.NODE_ENV === 'production') {
|
||||
// url = production.xhr;//生产环境 //正式环境+
|
||||
// }
|
||||
|
||||
// 3.创建自定义axios 限制响应时间
|
||||
axios.create({
|
||||
|
||||
// baseURL: url,
|
||||
timeout: 3000,
|
||||
})
|
||||
|
||||
|
||||
//请求拦截器
|
||||
axios.interceptors.request.use((config: AxiosRequestConfig | any) => {
|
||||
// console.group("本次请求地址为", config) //请求提示
|
||||
// 在发送请求之前做些什么,例如加入token
|
||||
// if (config.data) {
|
||||
// console.group("本次请求地址为", config.data.split("&")[0].split("=")[1]) //请求提示
|
||||
// } else {
|
||||
// console.group("本次请求地址为", config.params.code) //请求提示
|
||||
// }
|
||||
return config;
|
||||
}, function (error) {
|
||||
// 对请求错误做些什么
|
||||
return Promise.reject(error);
|
||||
});
|
||||
|
||||
//响应拦截器
|
||||
axios.interceptors.response.use(function (response: AxiosResponse) {
|
||||
// 在接收响应做些什么,例如跳转到登录页
|
||||
// console.log(response, "我是响应拦截器")
|
||||
const router = Router; //路由全局对象
|
||||
|
||||
let status = response.status;
|
||||
// console.log(response,"sssssssfafafafafaaaf");
|
||||
|
||||
// if (status === 200) {
|
||||
// let code = response.data.Code;
|
||||
|
||||
// if (code == "") {
|
||||
// // console.log("调用成功")
|
||||
// } else if (code == -10000) {
|
||||
// open4("接口调用失败:" + response.data.Message)
|
||||
// return;
|
||||
// } else if (code == 'user login Error') {
|
||||
// open4("登陆过期:" + response.data.Message)
|
||||
// setTimeout(() => {
|
||||
// router.push('/Login')
|
||||
// }, 1000);
|
||||
// return;
|
||||
// }
|
||||
// } else if (status === 401) {
|
||||
// open4("接口调用失败:" + response.data.Message)
|
||||
// return;
|
||||
|
||||
// } else if (status === 500) {
|
||||
// open4("接口调用失败:" + response.data.Message)
|
||||
// return;
|
||||
// }
|
||||
|
||||
// if (response.data.success == 'false') {
|
||||
// open4("接口调用失败:" + response.data.Message)
|
||||
// return;
|
||||
// }
|
||||
return response;
|
||||
}, function (error) {
|
||||
// 对响应错误做点什么
|
||||
return Promise.reject(error);
|
||||
});
|
||||
|
||||
|
||||
export function get(staurl: string, data: any = '') {
|
||||
// let strTime = (<any>new Date()).Format("yyyyMMddhhmmss")
|
||||
// let strPara = '{"datetime":"' + strTime + '",' + data + '}';
|
||||
// console.log(strPara);
|
||||
// let password = "RicardPwd";
|
||||
// let strSign = password + strPara + password;
|
||||
// console.log(strSign);
|
||||
// strSign = MD5(strSign);
|
||||
// let strData = 'code=' + code + '&sign=' + strSign + '¶=' + strPara;
|
||||
|
||||
let _url = staurl //"?" + strData;
|
||||
|
||||
return new Promise((resolve, rejects) => {
|
||||
let header = { //请求头设置
|
||||
"Access-Control-Allow-Origin": "*"
|
||||
}
|
||||
axios({
|
||||
url: _url,//在线跨域请求
|
||||
method: "get",//默认是get请求
|
||||
headers: header,
|
||||
params: data
|
||||
}).then(function (val) {
|
||||
// console.log(val) // axios会对我们请求来的结果进行再一次的封装( 让安全性提高 )
|
||||
resolve(val.data)
|
||||
}).catch(function (err) {
|
||||
// console.log(err)
|
||||
rejects(err)
|
||||
})
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function put(staurl: string, data: any = '') {
|
||||
// let strTime = (<any>new Date()).Format("yyyyMMddhhmmss")
|
||||
// let strPara = '{"datetime":"' + strTime + '",' + data + '}';
|
||||
// console.log(strPara);
|
||||
// let password = "RicardPwd";
|
||||
// let strSign = password + strPara + password;
|
||||
// console.log(strSign);
|
||||
// strSign = MD5(strSign);
|
||||
// let strData = 'code=' + code + '&sign=' + strSign + '¶=' + strPara;
|
||||
|
||||
let _url = staurl //"?" + strData;
|
||||
|
||||
return new Promise((resolve, rejects) => {
|
||||
let header = { //请求头设置
|
||||
"Access-Control-Allow-Origin": "*"
|
||||
}
|
||||
axios({
|
||||
url: _url,//在线跨域请求
|
||||
method: "put",//默认是get请求
|
||||
headers: header,
|
||||
params: data
|
||||
}).then(function (val) {
|
||||
// console.log(val) // axios会对我们请求来的结果进行再一次的封装( 让安全性提高 )
|
||||
resolve(val.data)
|
||||
}).catch(function (err) {
|
||||
// console.log(err)
|
||||
rejects(err)
|
||||
})
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function post(staurl: string, data: any = "", method: string = "POST") {
|
||||
|
||||
// strData = 'code=' + code + '&sign=' + strSign + '¶=' + tmpPara;
|
||||
// console.log(strData);
|
||||
let _url = staurl //+ "?" + strData;
|
||||
let METHOD = method || "POST"
|
||||
return new Promise((resolve, rejects) => {
|
||||
let params: any = {}
|
||||
// 处理表单结果中文件的操作
|
||||
|
||||
axios({
|
||||
url: _url,
|
||||
method: METHOD,
|
||||
data: data
|
||||
}).then(function (res) {
|
||||
// console.log(val) // axios会对我们请求来的结果进行再一次的封装( 让安全性提高 )
|
||||
resolve(res.data)
|
||||
}).catch(function (err) {
|
||||
// console.log(err)
|
||||
rejects(err)
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
export function postupLoad(staurl: string, data: any = "", method: string = "POST") {
|
||||
|
||||
|
||||
let _url = staurl //+ "?" + strData;
|
||||
let METHOD = method || "POST"
|
||||
let header = { //请求头设置
|
||||
"Content-Type": "multipart/form-data"
|
||||
}
|
||||
return new Promise((resolve, rejects) => {
|
||||
let params: any = {}
|
||||
// 处理表单结果中文件的操作
|
||||
|
||||
axios({
|
||||
url: _url,
|
||||
method: METHOD,
|
||||
data: data,
|
||||
headers: header
|
||||
}).then(function (res) {
|
||||
// console.log(val) // axios会对我们请求来的结果进行再一次的封装( 让安全性提高 )
|
||||
resolve(res.data)
|
||||
}).catch(function (err) {
|
||||
// console.log(err)
|
||||
rejects(err)
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -68,9 +68,9 @@ onMounted(() => {
|
||||
position: absolute;
|
||||
top: 25px;
|
||||
line-height: 50px;
|
||||
font-weight: 400;
|
||||
font-weight: 700;
|
||||
font-style: normal;
|
||||
font-size: 30px;
|
||||
font-size: 36px;
|
||||
color: rgba(0, 255, 255, 0.996078431372549);
|
||||
}
|
||||
|
||||
|
@ -34,9 +34,9 @@
|
||||
</div>
|
||||
<div class="center">
|
||||
<div class="ctop">
|
||||
<!-- <video controls loop autoplay="true" ref="videoElement" width="780">
|
||||
<video controls loop autoplay="true" ref="videoElement" width="780">
|
||||
<source :src="videoUrl" type="video/mp4" />
|
||||
</video> -->
|
||||
</video>
|
||||
</div>
|
||||
<div class="cbottom">
|
||||
<BorderVue :title="t('messages.富怡多功能绣花机')">
|
||||
@ -124,8 +124,6 @@ import Header from './component/Header.vue'
|
||||
import BorderVue from './component/Border.vue'
|
||||
import DevCard from './component/DevCard.vue'
|
||||
import BarChart from './component/BarChart.vue'
|
||||
|
||||
import { getmDeviceList, getmDeviceProduction } from '@/http/MicroExhibition'
|
||||
import { ref, onMounted, onUnmounted, getCurrentInstance, watch, onUpdated, computed, reactive } from 'vue'
|
||||
|
||||
import { mjlDeviceList, mjlDeviceProduction } from '@/http/Exhibition/Bengal'
|
||||
@ -142,7 +140,7 @@ if (lang && languageHash(lang) && languageHash(lang) != getStoredLanguage()) {
|
||||
window.location.reload()
|
||||
}
|
||||
|
||||
let videoUrl = ref('https://d.tufting222.cn/video/yzy/GEDOS_merge.mp4')
|
||||
let videoUrl = ref('https://d.tufting222.cn/video/yzy/micor_edos_english.mp4')
|
||||
const videoElement = ref(null)
|
||||
let timer = null
|
||||
let timers = null
|
||||
@ -243,11 +241,11 @@ function getWebsocket(val) {
|
||||
xhj_data[1].value = msg.WorkingState
|
||||
}
|
||||
//JUKI
|
||||
if (msg.RackNumber == 'JUKI高速直驱平缝机') {
|
||||
if (msg.RackNumber == 'DDL-900C') {
|
||||
juki_data[1].value = msg.WorkingState
|
||||
}
|
||||
//Yamato
|
||||
if (msg.RackNumber == 'Yamato包缝机') {
|
||||
if (msg.RackNumber == 'AZ7000SD') {
|
||||
yamato_data[1].value = msg.WorkingState
|
||||
}
|
||||
|
||||
@ -425,11 +423,11 @@ onUnmounted(() => {
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
padding: 0 20px;
|
||||
/* padding: 0 20px; */
|
||||
}
|
||||
|
||||
.key-text {
|
||||
width: 60%;
|
||||
width: 50%;
|
||||
font-size: 18px;
|
||||
color: #02c1d7;
|
||||
font-weight: 700;
|
||||
@ -437,7 +435,7 @@ onUnmounted(() => {
|
||||
}
|
||||
|
||||
.value-text {
|
||||
width: 40%;
|
||||
width: 50%;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: #AEEEFAFE;
|
||||
|
@ -1,16 +1,7 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<div class="left">
|
||||
<!-- <img class="image" src="./../../../assets/images/bf_logo.png" alt=""> -->
|
||||
<div class="title">北京服装学院</div>
|
||||
</div>
|
||||
<div class="right">
|
||||
<!-- <button class="btn" @click="toLogin">登录</button> -->
|
||||
</div>
|
||||
<div class="back" @click="back()">
|
||||
<i class="iconfont icon-back"></i>
|
||||
</div>
|
||||
<div class="title">再登软件工况物联系统</div>
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="content-item">
|
||||
@ -48,7 +39,7 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, onMounted, onUnmounted } from "vue";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { getStatus, setOpen, setClose } from "@/http/Exhibition/station"
|
||||
@ -56,7 +47,7 @@ import { ElNotification, ElMessageBox, ElMessage, ElLoading } from 'element-plus
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter()
|
||||
let device_id = route.query.id
|
||||
let device_id = route.params.id
|
||||
|
||||
let deviceList = ref()
|
||||
let image = ref()
|
||||
@ -68,7 +59,7 @@ let isShow = true
|
||||
//获取当前设备状态
|
||||
async function getDeviceStatus(query) {
|
||||
try {
|
||||
const result = await getStatus(query)
|
||||
const result:any = await getStatus(query)
|
||||
if (result.code == 200) {
|
||||
let data = result.data
|
||||
deviceList.value = [
|
||||
@ -76,7 +67,7 @@ async function getDeviceStatus(query) {
|
||||
{ val: data.model },
|
||||
{ val: data.label },
|
||||
]
|
||||
image.value = import.meta.env.VITE_APP_BASE_API + data.img
|
||||
image.value = process.env.VUE_APP_BASE_API + data.img
|
||||
isOn.value = data.open
|
||||
isOff.value = data.close
|
||||
if (!isOn.value && !isOff.value) {
|
||||
@ -98,7 +89,7 @@ async function openDevice() {
|
||||
if (!isOn.value) return
|
||||
clearInterval(timer)
|
||||
let queryData = { id: device_id }
|
||||
let result = await setOpen(queryData)
|
||||
let result:any = await setOpen(queryData)
|
||||
if (result.code == 200) {
|
||||
let data = result.data
|
||||
isOn.value = data.open
|
||||
@ -115,7 +106,7 @@ async function closeDevice() {
|
||||
if (!isOff.value) return
|
||||
clearInterval(timer)
|
||||
let queryData = { id: device_id }
|
||||
let result = await setClose(queryData)
|
||||
let result:any = await setClose(queryData)
|
||||
if (result.code == 200) {
|
||||
let data = result.data
|
||||
isOn.value = data.open
|
||||
@ -131,10 +122,7 @@ async function closeDevice() {
|
||||
|
||||
}
|
||||
|
||||
//去登录页
|
||||
function toLogin() {
|
||||
window.location.href = WS_URL.EDOS_LOGIN
|
||||
}
|
||||
|
||||
|
||||
|
||||
//返回
|
||||
@ -186,7 +174,7 @@ onUnmounted(() => {
|
||||
|
||||
}
|
||||
|
||||
.container .header .left {
|
||||
.container .header .title {
|
||||
width: 50%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
|
@ -136,7 +136,7 @@ function getDeviceProduction() {
|
||||
data: item.data
|
||||
}
|
||||
})
|
||||
let xDataArr = thisLang == "简体中文"?data.xData:data.exData
|
||||
let xDataArr = thisLang != "简体中文"?data.exData:data.xData
|
||||
xData.value = xDataArr
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user