Commit 586260ec by zhangzhen

驾驶舱内容优化

parent ca864c64
...@@ -106,8 +106,7 @@ ...@@ -106,8 +106,7 @@
<script src="${iPlatStaticURL}/iplatui/assets/js/iplat.ui.bootstrap.min.js"></script> <script src="${iPlatStaticURL}/iplatui/assets/js/iplat.ui.bootstrap.min.js"></script>
<script src="${iPlatStaticURL}/iplatui/js/iplat.ui.min.js"></script> <script src="${iPlatStaticURL}/iplatui/js/iplat.ui.min.js"></script>
<script src="${ctx}/common/js/dayjs.min.js"></script>
<script src="${ctx}/common/js/vue-2.6.10.js"></script> <script src="${ctx}/common/js/vue-2.6.10.js"></script>
<script src="${ctx}/common/js/httpVueLoader.js"></script> <script src="${ctx}/common/js/httpVueLoader.js"></script>
<link rel="stylesheet" href="${ctx}/common/css/element-ui.css"> <link rel="stylesheet" href="${ctx}/common/css/element-ui.css">
...@@ -206,24 +205,29 @@ ...@@ -206,24 +205,29 @@
getByProcessWtDate:[], getByProcessWtDate:[],
getByProcessDayWtList:[], getByProcessDayWtList:[],
getByProcessDayWtDate:[], getByProcessDayWtDate:[],
timer: ''
}; };
}, },
mounted() { mounted() {
this.getYesterdayDateFormatted();
setInterval(() => { setInterval(() => {
this.date = new Date(); // 更新日期时间 this.date = new Date(); // 更新日期时间
}, 1000); }, 1000);
this.getYesterdayDateFormatted();
this.getRoleFactory(); this.getRoleFactory();
this.getByProcessWt();
this.setOption();
this.getByProcessDayWt();
this.setOption2();
setInterval(()=> {
this.initPage(); this.initPage();
}, 60000); this.onSetInterval()
}, },
methods: { methods: {
onSetInterval(){
if(this.timer){
clearInterval(this.timer)
this.timer = ''
}
this.timer = setInterval(()=>{
this.getYesterdayDateFormatted();
this.initPage();
},60000)
},
initPage(){ initPage(){
this.getByProcessWt(); this.getByProcessWt();
this.setOption(); this.setOption();
...@@ -232,19 +236,11 @@ ...@@ -232,19 +236,11 @@
}, },
handledataPicker(){ handledataPicker(){
this.getByProcessWt(); this.initPage();
this.setOption(); this.onSetInterval()
this.getByProcessDayWt();
this.setOption2();
}, },
getYesterdayDateFormatted() { getYesterdayDateFormatted() {
const today = new Date(); this.dataPicker = dayjs().format("YYYYMMDD");
today.setDate(today.getDate() - 1);
const year = today.getFullYear();
const month = String(today.getMonth() + 1).padStart(2, '0'); // 月份从0开始,所以要加1
const day = String(today.getDate()).padStart(2, '0');
const formattedDate = year+month+day;
this.dataPicker = formattedDate;
}, },
getRoleFactory(){ getRoleFactory(){
let _this = this; let _this = this;
...@@ -253,11 +249,9 @@ ...@@ -253,11 +249,9 @@
onSuccess: function (res) { onSuccess: function (res) {
_this.factoryList = res.extAttr.result _this.factoryList = res.extAttr.result
_this.factory = res.extAttr.result[0].factoryCode _this.factory = res.extAttr.result[0].factoryCode
console.log('_this.factoryList',_this.factoryList)
console.log('factory',_this.factory)
}, },
onFail: function (err) { onFail: function (err) {
console.error('request_tools----------------->错误信息', err);
} }
}, },
{async: false} {async: false}
...@@ -266,22 +260,17 @@ ...@@ -266,22 +260,17 @@
getByProcessWt(){ getByProcessWt(){
let _this = this; let _this = this;
var inInfo = new EiInfo(); var inInfo = new EiInfo();
console.log('factory',this.factory)
console.log('dataPicker',this.dataPicker)
inInfo.set('inqu_status-0-factoryCode',this.factory) inInfo.set('inqu_status-0-factoryCode',this.factory)
inInfo.set('inqu_status-0-depositDate',this.dataPicker) inInfo.set('inqu_status-0-depositDate',this.dataPicker)
IPLAT.EiCommunicator.send('HGSC007', 'getByProcessWt', inInfo, { IPLAT.EiCommunicator.send('HGSC007', 'getByProcessWt', inInfo, {
onSuccess: function (res) { onSuccess: function (res) {
console.log('getByProcessWt',res)
if(undefined != res.blocks.result.extAttr){ if(undefined != res.blocks.result.extAttr){
_this.getByProcessWtList = res.blocks.result.extAttr.processNameList _this.getByProcessWtList = res.blocks.result.extAttr.processNameList
console.log('getByProcessWtList',_this.getByProcessWtList)
_this.getByProcessWtDate = res.blocks.result.extAttr.totalWeightList _this.getByProcessWtDate = res.blocks.result.extAttr.totalWeightList
console.log('getByProcessWtDate',_this.getByProcessWtDate)
} }
}, },
onFail: function (err) { onFail: function (err) {
console.error('request_tools----------------->错误信息', err);
} }
}, },
{async: false} {async: false}
...@@ -338,22 +327,17 @@ ...@@ -338,22 +327,17 @@
getByProcessDayWt(){ getByProcessDayWt(){
let _this = this; let _this = this;
var inInfo = new EiInfo(); var inInfo = new EiInfo();
console.log('factory',this.factory)
console.log('dataPicker',this.dataPicker)
inInfo.set('inqu_status-0-factoryCode',this.factory) inInfo.set('inqu_status-0-factoryCode',this.factory)
inInfo.set('inqu_status-0-depositDate',this.dataPicker) inInfo.set('inqu_status-0-depositDate',this.dataPicker)
IPLAT.EiCommunicator.send('HGSC007', 'getByProcessDayWt', inInfo, { IPLAT.EiCommunicator.send('HGSC007', 'getByProcessDayWt', inInfo, {
onSuccess: function (res) { onSuccess: function (res) {
console.log('七日综合产量')
if(undefined != res.blocks.result.extAttr){ if(undefined != res.blocks.result.extAttr){
_this.getByProcessDayWtList = res.blocks.result.extAttr.depositDateList; _this.getByProcessDayWtList = res.blocks.result.extAttr.depositDateList;
console.log('_this.getByProcessDayWtList',_this.getByProcessDayWtList)
_this.getByProcessDayWtDate = res.blocks.result.extAttr.totalWeightList; _this.getByProcessDayWtDate = res.blocks.result.extAttr.totalWeightList;
console.log('_this.getByProcessDayWtDate',_this.getByProcessDayWtDate)
} }
}, },
onFail: function (err) { onFail: function (err) {
console.error('request_tools----------------->错误信息', err);
} }
}, },
{async: false} {async: false}
......
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
<script src="${iPlatStaticURL}/iplatui/assets/js/iplat.ui.bootstrap.min.js"></script> <script src="${iPlatStaticURL}/iplatui/assets/js/iplat.ui.bootstrap.min.js"></script>
<script src="${iPlatStaticURL}/iplatui/js/iplat.ui.min.js"></script> <script src="${iPlatStaticURL}/iplatui/js/iplat.ui.min.js"></script>
<script src="${ctx}/common/js/dayjs.min.js"></script>
<script src="${ctx}/common/js/vue-2.6.10.js"></script> <script src="${ctx}/common/js/vue-2.6.10.js"></script>
<script src="${ctx}/common/js/httpVueLoader.js"></script> <script src="${ctx}/common/js/httpVueLoader.js"></script>
<link rel="stylesheet" href="${ctx}/common/css/element-ui.css"> <link rel="stylesheet" href="${ctx}/common/css/element-ui.css">
...@@ -252,59 +252,41 @@ ...@@ -252,59 +252,41 @@
querySbYesDate:[], querySbYesDate:[],
querySbNoList:[], querySbNoList:[],
querySbNODate:[], querySbNODate:[],
currentTime:dayjs().format("YYYY-MM-DD HH:mm:ss"),
lineOption1:'',
lineOption2:''
}; };
}, },
mounted() { mounted() {
this.getYesterdayDateFormatted();
setInterval(() => { setInterval(() => {
this.date = new Date(); // 更新日期时间 this.currentTime = dayjs().format("YYYY-MM-DD HH:mm:ss")
}, 1000); }, 1000);
this.getYesterdayDateFormatted();
this.getRoleFactory(); this.getRoleFactory();
this.queryBySbStatus(); this.initPage();
this.querySbYes();
this.querySbNo();
this.setOption(); this.setOption();
this.setOption2(); this.setOption2();
// var self = this; this.onSetInterval()
// setTimeout(function() {
// self.init();
// }, 60000);
setInterval(()=> {
this.initPage();
}, 60000);
}, },
methods: { methods: {
initPage(){ onSetInterval(){
if(this.timer){
clearInterval(this.timer)
this.timer = ''
}
this.timer = setInterval(()=>{
this.getYesterdayDateFormatted(); this.getYesterdayDateFormatted();
this.initPage();
},60000)
},
initPage(){
this.queryBySbStatus(); this.queryBySbStatus();
this.querySbYes(); this.querySbYes();
this.querySbNo(); this.querySbNo();
}, },
formatTime(currentTime) {
const formattedTime =
currentTime.getFullYear() +
"-" +
(currentTime.getMonth() + 1) +
"-" +
currentTime.getDate() +
" " +
currentTime.getHours() +
":" +
currentTime.getMinutes() +
":" +
currentTime.getSeconds();
return formattedTime;
},
getYesterdayDateFormatted() { getYesterdayDateFormatted() {
const today = new Date(); this.dataPicker = dayjs().format("YYYYMMDD");
today.setDate(today.getDate() - 1);
const year = today.getFullYear();
const month = String(today.getMonth() + 1).padStart(2, '0'); // 月份从0开始,所以要加1
const day = String(today.getDate()).padStart(2, '0');
const formattedDate = year+month+day;
this.dataPicker = formattedDate;
console.log('ctx',this.ctx)
}, },
getRoleFactory(){ getRoleFactory(){
let _this = this; let _this = this;
...@@ -313,20 +295,17 @@ ...@@ -313,20 +295,17 @@
onSuccess: function (res) { onSuccess: function (res) {
_this.factoryList = res.extAttr.result _this.factoryList = res.extAttr.result
_this.factory = res.extAttr.result[0].factoryCode _this.factory = res.extAttr.result[0].factoryCode
console.log('_this.factoryList',_this.factoryList)
console.log('factory',_this.factory)
}, },
onFail: function (err) { onFail: function (err) {
console.error('request_tools----------------->错误信息', err);
} }
}, },
{async: false} {async: false}
); );
}, },
handledataPicker(){ handledataPicker(){
this.queryBySbStatus(); this.initPage();
this.querySbYes(); this.onSetInterval()
this.querySbNo();
}, },
queryBySbStatus(){ queryBySbStatus(){
let _this = this; let _this = this;
...@@ -335,7 +314,7 @@ ...@@ -335,7 +314,7 @@
inInfo.set('inqu_status-0-date',this.dataPicker) inInfo.set('inqu_status-0-date',this.dataPicker)
IPLAT.EiCommunicator.send('HGSB010', 'queryBySbStatus', inInfo, { IPLAT.EiCommunicator.send('HGSB010', 'queryBySbStatus', inInfo, {
onSuccess: function (res) { onSuccess: function (res) {
console.log('queryBySbStatus',res)
if(undefined != res.extAttr.result){ if(undefined != res.extAttr.result){
_this.queryBySbStatusList = res.extAttr.result; _this.queryBySbStatusList = res.extAttr.result;
} }
...@@ -351,7 +330,7 @@ ...@@ -351,7 +330,7 @@
}) })
}, },
onFail: function (err) { onFail: function (err) {
console.error('request_tools----------------->错误信息', err);
} }
}, },
{async: false} {async: false}
...@@ -364,7 +343,7 @@ ...@@ -364,7 +343,7 @@
inInfo.set('inqu_status-0-date',this.dataPicker) inInfo.set('inqu_status-0-date',this.dataPicker)
IPLAT.EiCommunicator.send('HGSB010', 'querySbYes', inInfo, { IPLAT.EiCommunicator.send('HGSB010', 'querySbYes', inInfo, {
onSuccess: function (res) { onSuccess: function (res) {
console.log('querySbYes',res)
if(undefined != res.extAttr.result[0]){ if(undefined != res.extAttr.result[0]){
const dataList = res.extAttr.result; const dataList = res.extAttr.result;
_this.querySbYesDate = res.extAttr.date; _this.querySbYesDate = res.extAttr.date;
...@@ -433,10 +412,10 @@ ...@@ -433,10 +412,10 @@
_this.querySbYesList = [] _this.querySbYesList = []
_this.querySbYesDate = [] _this.querySbYesDate = []
} }
console.log('querySbYesList',_this.querySbYesList)
}, },
onFail: function (err) { onFail: function (err) {
console.error('request_tools----------------->错误信息', err);
} }
}, },
{async: false} {async: false}
...@@ -449,7 +428,7 @@ ...@@ -449,7 +428,7 @@
inInfo.set('inqu_status-0-date',this.dataPicker) inInfo.set('inqu_status-0-date',this.dataPicker)
IPLAT.EiCommunicator.send('HGSB010', 'querySbNo', inInfo, { IPLAT.EiCommunicator.send('HGSB010', 'querySbNo', inInfo, {
onSuccess: function (res) { onSuccess: function (res) {
console.log('querySbNo',res)
if(undefined != res.extAttr.result[0]){ if(undefined != res.extAttr.result[0]){
const dataList = res.extAttr.result; const dataList = res.extAttr.result;
_this.querySbNODate = res.extAttr.date; _this.querySbNODate = res.extAttr.date;
...@@ -518,7 +497,7 @@ ...@@ -518,7 +497,7 @@
} }
}, },
onFail: function (err) { onFail: function (err) {
console.error('request_tools----------------->错误信息', err);
} }
}, },
{async: false} {async: false}
...@@ -526,7 +505,7 @@ ...@@ -526,7 +505,7 @@
}, },
setOption(){ setOption(){
this.testOption1 = { this.lineOption1 = {
title: { title: {
left: 'left', left: 'left',
text: '设备作业时长/分钟', text: '设备作业时长/分钟',
...@@ -577,7 +556,7 @@ ...@@ -577,7 +556,7 @@
} }
}, },
setOption2(){ setOption2(){
this.testOption2 ={ this.lineOption2 ={
title: { title: {
left: 'left', left: 'left',
text: '设备故障次数/分钟', text: '设备故障次数/分钟',
...@@ -628,19 +607,6 @@ ...@@ -628,19 +607,6 @@
} }
}, },
},
computed:{
lineOption1() {
// 这里我们不需要再次调用 setOption,因为 Vue 会自动处理绑定
return this.testOption1;
},
lineOption2() {
// 这里我们不需要再次调用 setOption,因为 Vue 会自动处理绑定
return this.testOption2;
},
currentTime() {
return this.formatTime(this.date);
},
} }
}) })
</script> </script>
......
...@@ -124,7 +124,6 @@ module.exports = { ...@@ -124,7 +124,6 @@ module.exports = {
}, },
watch:{ watch:{
factory(newVal) { factory(newVal) {
console.log(1)
this.getByProcessSumWt(); this.getByProcessSumWt();
this.queryBySunWt(); this.queryBySunWt();
}, },
...@@ -143,15 +142,11 @@ module.exports = { ...@@ -143,15 +142,11 @@ module.exports = {
var inInfo = new EiInfo(); var inInfo = new EiInfo();
// inInfo.set('inqu_status-0-factoryCode','R24070364') // inInfo.set('inqu_status-0-factoryCode','R24070364')
// inInfo.set('inqu_status-0-depositDate','20241019') // inInfo.set('inqu_status-0-depositDate','20241019')
console.log('this.factory',this.factory)
console.log('this.factory',this.datapicker)
inInfo.set('inqu_status-0-factoryCode',this.factory) inInfo.set('inqu_status-0-factoryCode',this.factory)
inInfo.set('inqu_status-0-depositDate',this.datapicker) inInfo.set('inqu_status-0-depositDate',this.datapicker)
IPLAT.EiCommunicator.send('HGSC007', 'getByProcessSumWt', inInfo, { IPLAT.EiCommunicator.send('HGSC007', 'getByProcessSumWt', inInfo, {
onSuccess: function (res) { onSuccess: function (res) {
if(undefined != res.extAttr.result[0]){ if(undefined != res.extAttr.result[0]){
console.log('累计产量',res.extAttr.result[0])
console.log('getByProcessSumWt',res)
_this.getByProcessSumWtList = res.extAttr.result[0] _this.getByProcessSumWtList = res.extAttr.result[0]
}else { }else {
_this.getByProcessSumWtList.push({ _this.getByProcessSumWtList.push({
...@@ -163,7 +158,7 @@ module.exports = { ...@@ -163,7 +158,7 @@ module.exports = {
}, },
onFail: function (err) { onFail: function (err) {
console.error('request_tools----------------->错误信息', err);
} }
}, },
{async: false} {async: false}
...@@ -172,19 +167,14 @@ module.exports = { ...@@ -172,19 +167,14 @@ module.exports = {
queryBySunWt(){ queryBySunWt(){
let _this = this; let _this = this;
var inInfo = new EiInfo(); var inInfo = new EiInfo();
console.log('this.factory',this.factory)
console.log('this.factory',this.datapicker)
inInfo.set('inqu_status-0-factoryCode',this.factory) inInfo.set('inqu_status-0-factoryCode',this.factory)
inInfo.set('inqu_status-0-depositDate',this.dataPicker) inInfo.set('inqu_status-0-depositDate',this.dataPicker)
IPLAT.EiCommunicator.send('HGSC007', 'queryBySunWt', inInfo, { IPLAT.EiCommunicator.send('HGSC007', 'queryBySunWt', inInfo, {
onSuccess: function (res) { onSuccess: function (res) {
console.log('-------------------------')
console.log('累计工序',res.blocks.result.extAttr.processNameList)
console.log('累计工序',res)
_this.queryBySunWtList = res.blocks.result.extAttr.processNameList _this.queryBySunWtList = res.blocks.result.extAttr.processNameList
}, },
onFail: function (err) { onFail: function (err) {
console.error('request_tools----------------->错误信息', err);
} }
}, },
{async: false} {async: false}
......
...@@ -60,18 +60,14 @@ module.exports = { ...@@ -60,18 +60,14 @@ module.exports = {
getByProjCodewt(){ getByProjCodewt(){
let _this = this; let _this = this;
var inInfo = new EiInfo(); var inInfo = new EiInfo();
console.log('this.factory',this.factory)
console.log('this.factory',this.datapicker)
inInfo.set('inqu_status-0-factoryCode',this.factory) inInfo.set('inqu_status-0-factoryCode',this.factory)
inInfo.set('inqu_status-0-depositDate',this.dataPicker) inInfo.set('inqu_status-0-depositDate',this.dataPicker)
IPLAT.EiCommunicator.send('HGSC007', 'getByProjCodeWt', inInfo, { IPLAT.EiCommunicator.send('HGSC007', 'getByProjCodeWt', inInfo, {
onSuccess: function (res) { onSuccess: function (res) {
_this.getByProjCodewtWtList = res.extAttr.result _this.getByProjCodewtWtList = res.extAttr.result
console.log('项目生产',res.extAttr.result)
console.log('项目生产',res)
}, },
onFail: function (err) { onFail: function (err) {
console.error('request_tools----------------->错误信息', err);
} }
}, },
{async: false} {async: false}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment