|
@@ -21,10 +21,11 @@
|
|
|
<div class="triangle"></div>
|
|
|
<div v-for="(p,index) in compProctList" style="margin-top:10px">
|
|
|
<span style="margin-right: 5px;">产线</span><el-select style="width: 100px;" v-model="p.ai_prouct_no"><el-option v-for="item in cxList" :key="item.index" :label="item.name" :value="item.index"></el-option> </el-select>
|
|
|
- <span style="margin-right: 5px;margin-left: 5px;">日期</span><el-date-picker v-model="p.compDate" type="date" :value-format="'YYYY-MM-DD'" placeholder="选择日期"></el-date-picker>
|
|
|
- <span style="margin-right: 5px;margin-left: 5px;">时点</span><el-select style="width: 100px;" v-model="p.compDateHour1"><el-option v-for="item in hourList" :key="item.code" :label="item.name" :value="item.code"></el-option> </el-select>
|
|
|
- <!--<span> 到 </span>
|
|
|
- <el-select style="width: 100px;" v-model="p.compDateHour2"><el-option v-for="item in hourList" :key="item.code" :label="item.name" :value="item.code"></el-option> </el-select>
|
|
|
+ <span style="margin-right: 5px;margin-left: 5px;">时段</span><el-date-picker v-model="p.compDateHour1" type="datetime" date-format="YYYY-MM-DD" time-format="HH" format="YYYY-MM-DD HH" :value-format="'YYYY-MM-DD HH'" placeholder="开始时间"></el-date-picker>
|
|
|
+ <!--<span style="margin-right: 5px;margin-left: 5px;">时点</span><el-select style="width: 100px;" v-model="p.compDateHour1"><el-option v-for="item in hourList" :key="item.code" :label="item.name" :value="item.code"></el-option> </el-select>-->
|
|
|
+ <span> 到 </span>
|
|
|
+ <el-date-picker v-model="p.compDateHour2" type="datetime" date-format="YYYY-MM-DD" time-format="HH" format="YYYY-MM-DD HH" :value-format="'YYYY-MM-DD HH'" placeholder="结束时间"></el-date-picker>
|
|
|
+ <!--<el-select style="width: 100px;" v-model="p.compDateHour2"><el-option v-for="item in hourList" :key="item.code" :label="item.name" :value="item.code"></el-option> </el-select>
|
|
|
|
|
|
<el-button v-if="index==compProctList.length-1 && compProctList.length<cxList.length" style="margin:10px" @click="addAILine" title="添加产线">+</el-button>
|
|
|
<el-button v-else style="margin:10px" @click="removeAILine(index)" title="移除该产线">-</el-button>-->
|
|
@@ -216,11 +217,13 @@ export default {
|
|
|
const compProctList=ref([{
|
|
|
ai_prouct_no:'',
|
|
|
compDate:new Date().Format("yyyy-MM-dd"),
|
|
|
- compDateHour1:''
|
|
|
+ compDateHour1:new Date().Format("yyyy-MM-dd hh")+":00:00",
|
|
|
+ compDateHour2:new Date().Format("yyyy-MM-dd hh")+":00:00"
|
|
|
},{
|
|
|
ai_prouct_no:'',
|
|
|
compDate:new Date().Format("yyyy-MM-dd"),
|
|
|
- compDateHour1:''
|
|
|
+ compDateHour1:new Date().Format("yyyy-MM-dd hh")+":00:00",
|
|
|
+ compDateHour2:new Date().Format("yyyy-MM-dd hh")+":00:00"
|
|
|
}]);
|
|
|
const hourList=ref([]);
|
|
|
let lines={};
|
|
@@ -792,7 +795,8 @@ export default {
|
|
|
compProctList.value.push({
|
|
|
ai_prouct_no:'',
|
|
|
compDate:'',
|
|
|
- compDateHour1:''
|
|
|
+ compDateHour1:'',
|
|
|
+ compDateHour2:''
|
|
|
});
|
|
|
}
|
|
|
function removeAILine(ind){
|
|
@@ -805,7 +809,17 @@ export default {
|
|
|
compProctList.value = tmpList;
|
|
|
}
|
|
|
async function compAILine(){
|
|
|
- if(compProctList.value[0].ai_prouct_no=='' || compProctList.value[1].ai_prouct_no==''){
|
|
|
+ var lineNo1 = compProctList.value[0].ai_prouct_no*1;
|
|
|
+ var lineNo2 = compProctList.value[1].ai_prouct_no*1;
|
|
|
+ var v={
|
|
|
+ line1:lineNo1,
|
|
|
+ line2:lineNo2,
|
|
|
+ s1:compProctList.value[0].compDateHour1,
|
|
|
+ e1:compProctList.value[0].compDateHour2,
|
|
|
+ s2:compProctList.value[1].compDateHour1,
|
|
|
+ e2:compProctList.value[1].compDateHour2,
|
|
|
+ };
|
|
|
+ if(v.line1=='' || v.line2==''){
|
|
|
ElMessage({
|
|
|
message:'请选择需要分析的产线!',
|
|
|
type:'error',
|
|
@@ -813,7 +827,7 @@ export default {
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
- if(compProctList.value[0].compDate=='' || compProctList.value[1].compDate==''|| compProctList.value[0].compDateHour1==''|| compProctList.value[1].compDateHour1==''){
|
|
|
+ if(v.s1==''|| v.s2==''){
|
|
|
ElMessage({
|
|
|
message:'请选择需要分析的日期和时点!',
|
|
|
type:'error',
|
|
@@ -821,11 +835,15 @@ export default {
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
- var lineNo1 = compProctList.value[0].ai_prouct_no*1;
|
|
|
- var lineNo2 = compProctList.value[1].ai_prouct_no*1;
|
|
|
- if(lineNo1==lineNo2 && compProctList.value[0].compDate==compProctList.value[1].compDate && compProctList.value[0].compDateHour1==compProctList.value[1].compDateHour1){
|
|
|
+ if(v.s1.indexOf("00:00")==-1) v.s1=v.s1+":00:00"
|
|
|
+ if(v.s2.indexOf("00:00")==-1) v.s2=v.s2+":00:00"
|
|
|
+ if(v.e1=="") v.e1 = v.s1;
|
|
|
+ if(v.e2=="") v.e2 = v.s2;
|
|
|
+ if(v.e1.indexOf("00:00")==-1) v.e1=v.e1+":00:00"
|
|
|
+ if(v.e2.indexOf("00:00")==-1) v.e2=v.e2+":00:00"
|
|
|
+ if(lineNo1==lineNo2 && v.s1==v.s2 && v.e1==v.e2){
|
|
|
ElMessage({
|
|
|
- message:'对比分析的产线、日期及时点不能完全相同!',
|
|
|
+ message:'对比分析的产线、时段不能完全相同!',
|
|
|
type:'error',
|
|
|
customClass: 'custom-message'
|
|
|
});
|
|
@@ -842,13 +860,15 @@ export default {
|
|
|
});
|
|
|
compMarkerts = {};
|
|
|
///api/yr/compare?line1=1&line2=2&time1=2025-05-13%2008:00:00&time2=2025-05-13%2009:00:00
|
|
|
- var v={
|
|
|
- line1:lineNo1,
|
|
|
- line2:lineNo2,
|
|
|
- time1:compProctList.value[0].compDate+" "+compProctList.value[0].compDateHour1+":00:00",
|
|
|
- time2:compProctList.value[1].compDate+" "+compProctList.value[1].compDateHour1+":00:00",
|
|
|
- };
|
|
|
- api.GetYrGyComper(v).then((res)=>{
|
|
|
+ fetch(process.env.VUE_APP_API+'/api/yr/compare', {
|
|
|
+ method: 'POST', // 指定请求方法为POST
|
|
|
+ headers: {
|
|
|
+ 'Content-Type': 'application/json', // 设置请求头为JSON格式
|
|
|
+ },
|
|
|
+ body: JSON.stringify(v) // 将数据转换为JSON字符串作为请求体
|
|
|
+ })
|
|
|
+ .then(response => response.json()) // 解析JSON格式的响应数据
|
|
|
+ .then(res => {
|
|
|
loadingMsg.close();
|
|
|
if(res.code!=200 || res.data==null){
|
|
|
ElMessage({
|
|
@@ -860,34 +880,65 @@ export default {
|
|
|
}
|
|
|
var line1Data=res.data[0];
|
|
|
var line2Data=res.data[1];
|
|
|
- MarkLineComper(line1Data,line2Data);
|
|
|
- })
|
|
|
+ MarkLineComper(line1Data,line2Data,v);
|
|
|
+ }).catch((error) => {
|
|
|
+ console.error('请求失败:', error);
|
|
|
+ });
|
|
|
}
|
|
|
- async function MarkLineComper(line1Data,line2Data){
|
|
|
+ async function MarkLineComper(line1Data,line2Data,v){
|
|
|
player.Native.Camera.moveTo([-94.61742308377592, -231.88112394996935, 91.21216074507522],
|
|
|
[-80.69618225097656,21.59876251220703,11.815500259399414],
|
|
|
[-0.0033254334820971166, 0.29907134022370024, 0.9542249603468546], 1);
|
|
|
var lineNo1 = compProctList.value[0].ai_prouct_no*1;
|
|
|
var lineNo2 = compProctList.value[1].ai_prouct_no*1;
|
|
|
+ var dt = "";
|
|
|
var imgid = await player.Native.GisMarker.loadImage(lineNo1==lineNo2?"data://icon/qietu/tip-m.png":"data://icon/qietu/tip-r.png");
|
|
|
var tipText = "";
|
|
|
- if(lineNo1!=lineNo2){
|
|
|
- tipText = lineNo1+"#产线("+compProctList.value[0].compDate+")\r "+compProctList.value[0].compDateHour1
|
|
|
- +"时 \r 合格率(%):"+line1Data.rate
|
|
|
+ if(lineNo1!=lineNo2){
|
|
|
+ if(v.s1==v.e1) dt = v.s1.substring(5).replace(":00:00","")+"时";
|
|
|
+ else if(v.s1.substring(0,10)==v.e1.substring(0,10)){
|
|
|
+ dt = v.s1.substring(5).replace(":00:00","")+"时 到 "+v.e1.substring(10).replace(":00:00","")+"时";
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ dt = v.s1.substring(5).replace(":00:00","")+"时 到 "+v.e1.substring(5).replace(":00:00","")+"时";
|
|
|
+ }
|
|
|
+ tipText = lineNo1+"#产线\r"+dt
|
|
|
+ +" \r 合格率(%):"+line1Data.rate
|
|
|
+" \r 重 量(T):"+line1Data.weight
|
|
|
+" \r 米 长(m):"+line1Data.length
|
|
|
+" \r 水(m3) :"+line1Data.water
|
|
|
+" \r 电(kWh) :"+line1Data.electricity
|
|
|
+" \r 气(GJ) :"+line1Data.gas;
|
|
|
}else{
|
|
|
+ var dt1="";
|
|
|
+ var dt2="";
|
|
|
+ var dtPadLen = 19;
|
|
|
+ var dataPadLen = 5;
|
|
|
+ var tipWidth = 340;
|
|
|
+ if(v.s1==v.e1) dt1 = v.s1.substring(5).replace(":00:00","")+"时";
|
|
|
+ else if(v.s1.substring(0,10)==v.e1.substring(0,10)){
|
|
|
+ dt1 = v.s1.substring(5).replace(":00:00","")+"时 到 "+v.e1.substring(11).replace(":00:00","")+"时";
|
|
|
+ dataPadLen = 7;
|
|
|
+ }else{
|
|
|
+ dt1 = v.s1.substring(5).replace(":00:00","")+"时 到 "+v.e1.substring(5).replace(":00:00","")+"时";
|
|
|
+ dtPadLen = 24;
|
|
|
+ dataPadLen = 12;
|
|
|
+ tipWidth = 430;
|
|
|
+ }
|
|
|
+ if(v.s2==v.e2) dt2 = v.s2.substring(5).replace(":00:00","")+"时";
|
|
|
+ else if(v.s2.substring(0,10)==v.e2.substring(0,10)){
|
|
|
+ dt2 = v.s2.substring(5).replace(":00:00","")+"时 到 "+v.e2.substring(11).replace(":00:00","")+"时";
|
|
|
+ }else{
|
|
|
+ dt2 = v.s2.substring(5).replace(":00:00","")+"时 到 "+v.e2.substring(5).replace(":00:00","")+"时";
|
|
|
+ }
|
|
|
tipText = lineNo1+"#产线\r"+
|
|
|
- compProctList.value[0].compDate+" "+compProctList.value[0].compDateHour1+"时 "+
|
|
|
- compProctList.value[1].compDate+" "+compProctList.value[1].compDateHour1+"时\r合格率(%):"+line1Data.rate+" 合格率(%):"+line2Data.rate
|
|
|
- +" \r重 量(T):"+line1Data.weight.toString().padEnd(5," ")+" 重 量(T):"+line2Data.weight.toString().padEnd(5," ")
|
|
|
- +" \r米 长(m):"+line1Data.length.toString().padEnd(5," ")+" 米 长(m):"+line2Data.length.toString().padEnd(5," ")
|
|
|
- +" \r水(m3) :"+line1Data.water.toString().padEnd(5," ")+" 水(m3) :"+line2Data.water.toString().padEnd(5," ")
|
|
|
- +" \r电(kWh) :"+line1Data.electricity.toString().padEnd(5," ")+" 电(kWh) :"+line2Data.electricity.toString().padEnd(5," ")
|
|
|
- +" \r气(GJ) :"+line1Data.gas.toString().padEnd(5," ")+" 气(GJ) :"+line2Data.gas.toString().padEnd(5," ");
|
|
|
+ dt1.padEnd(dtPadLen," ")+
|
|
|
+ dt2+"\r合格率(%):"+line1Data.rate.toString().padEnd(dataPadLen," ")+" 合格率(%):"+line2Data.rate
|
|
|
+ +" \r重 量(T):"+line1Data.weight.toString().padEnd(dataPadLen," ")+" 重 量(T):"+line2Data.weight.toString().padEnd(5," ")
|
|
|
+ +" \r米 长(m):"+line1Data.length.toString().padEnd(dataPadLen," ")+" 米 长(m):"+line2Data.length.toString().padEnd(5," ")
|
|
|
+ +" \r水(m3) :"+line1Data.water.toString().padEnd(dataPadLen," ")+" 水(m3) :"+line2Data.water.toString().padEnd(5," ")
|
|
|
+ +" \r电(kWh) :"+line1Data.electricity.toString().padEnd(dataPadLen," ")+" 电(kWh) :"+line2Data.electricity.toString().padEnd(5," ")
|
|
|
+ +" \r气(GJ) :"+line1Data.gas.toString().padEnd(dataPadLen," ")+" 气(GJ) :"+line2Data.gas.toString().padEnd(5," ");
|
|
|
}
|
|
|
var options = {
|
|
|
"text": tipText,
|
|
@@ -902,13 +953,20 @@ export default {
|
|
|
};
|
|
|
options.pos = lineNo1==lineNo2 ? markerPos[lineNo1-1][0] : markerPos[lineNo1-1][1];
|
|
|
options.imgId = imgid
|
|
|
- options.imgSize = lineNo1!=lineNo2 ? [260, 170] :[310, 170];
|
|
|
+ options.imgSize = lineNo1!=lineNo2 ? [260, 170] :[tipWidth, 170];
|
|
|
var ptr = await player.Native.GisMarker.create(options);
|
|
|
compMarkerts[ptr] = options;
|
|
|
if(lineNo1!=lineNo2){
|
|
|
+ if(v.s2==v.e2) dt = v.s2.substring(5).replace(":00:00","")+"时";
|
|
|
+ else if(v.s2.substring(0,10)==v.e2.substring(0,10)){
|
|
|
+ dt = v.s2.substring(5).replace(":00:00","")+"时 到 "+v.e2.substring(11).replace(":00:00","")+"时";
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ dt = v.s2.substring(5).replace(":00:00","")+"时 到 "+v.e2.substring(5).replace(":00:00","")+"时";
|
|
|
+ }
|
|
|
var options = {
|
|
|
- "text": lineNo2+"#产线("+compProctList.value[1].compDate+")\r "+compProctList.value[1].compDateHour1
|
|
|
- +"时 \r 合格率(%):"+line2Data.rate
|
|
|
+ "text": lineNo2+"#产线\r"+dt
|
|
|
+ +" \r 合格率(%):"+line2Data.rate
|
|
|
+" \r 重 量(T):"+line2Data.weight
|
|
|
+" \r 米 长(m):"+line2Data.length
|
|
|
+" \r 水(m3) :"+line2Data.water
|
|
@@ -998,6 +1056,12 @@ export default {
|
|
|
.el-popper{
|
|
|
z-index: 99999 !important;
|
|
|
}
|
|
|
+.el-time-spinner__wrapper{
|
|
|
+ width: 100% !important;
|
|
|
+}
|
|
|
+.el-scrollbar:nth-of-type(2){
|
|
|
+ display: none !important;
|
|
|
+}
|
|
|
.bg20{
|
|
|
z-index: 1; pointer-events: none;position: absolute;
|
|
|
top: calc(22px * var(--hRate));
|
|
@@ -1088,7 +1152,7 @@ export default {
|
|
|
background: rgb(0 85 102 / 40%);
|
|
|
}
|
|
|
.aiPanel{
|
|
|
- width: 460px;
|
|
|
+ width: 500px;
|
|
|
height: auto;
|
|
|
right: 2%;
|
|
|
top: 7.5% !important;
|