ZengTao
2024-08-15 6bc7ce4b5bb2cbaf458766ac40d9ba8c5d40133d
UI-Project/src/views/largescreen/largescreen.vue
@@ -25,7 +25,7 @@
      </el-table-column>
      </el-table>
</div>  -->
<div id="parent" style="margin-top: 10px;margin-left: 10px; height: 240px;width: 1000px;">
<div id="parent" style="margin-top: 10px;margin-left: 150px; height: 240px;width: 1000px;">
  <img src="../../assets/dpxsa.png" alt="" style="margin-left: -10px; width: 100%;height: 100%;position: relative;"> 
  <div id="lipiana" v-show="woshia"></div>
  <div id="lipianb" v-show="woshia"></div>
@@ -45,14 +45,14 @@
  <div id="xiapianji5" v-show="xiapian5"></div>
  <div id="xiapianji6" v-show="xiapian6"></div>
</div>
<div id="centerright" style="margin-top: 10px;margin-left: 10px; height: 240px;width: 240px;background-color: #911005;">
<!-- <div id="centerright" style="margin-top: 10px;margin-left: 10px; height: 240px;width: 240px;background-color: #911005;">
  <el-table height="240" ref="table" width="340px"
      @selection-change="handleSelectionChange"
      :data="tableDatab" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}">
        <el-table-column prop="projectNo" align="center" :label="$t('large.projectnumber')" min-width="50" />
        <el-table-column prop="projectName" align="center" :label="$t('large.projectname')" min-width="50" />
      </el-table>
</div>
</div>  -->
</div>
<div id="bottom" style="margin-top: 10px;height: 190px;background-color: #911005;">
<el-table height="190" ref="table"
@@ -75,41 +75,29 @@
      </el-tag>  
    </template> 
        </el-table-column>
        <el-table-column prop="deliveryDate" align="center" :label="$t('large.deliveryDate')" min-width="50" />
        <el-table-column prop="deliveryDate" align="center" :label="$t('large.deliveryDate')" min-width="100" />
        <el-table-column fixed="right" :label="$t('large.operate')" align="center" width="100">
          <template #default="scope">
            <el-button size="mini" type="text" plain @click="handleBinda(scope.row)">{{ $t('large.mes') }}</el-button>
          </template>
      </el-table-column>
      </el-table>
</div>
</el-scrollbar>
</el-card>
<el-dialog v-model="blinda" top="5vh" width="80%" :title="$t('large.brokeno')">
<el-dialog v-model="blinda" top="5vh" width="85%">
  <el-table height="400" ref="table" 
      @selection-change="handleSelectionChange"
      :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}">
        <el-table-column prop="reportingWorkTime" fixed align="center" :label="$t('large.time')" min-width="110" />
        <el-table-column prop="orderId" fixed align="center" :label="$t('large.number')" min-width="110" />
        <el-table-column prop="reportingWorkId" align="center" :label="$t('large.jobnumber')" min-width="120" />
        <el-table-column prop="productionId" align="center" :label="$t('large.productionnumber')" min-width="130" />
        <el-table-column prop="processId" align="center" :label="$t('large.cardnumber')" min-width="140" />
        <el-table-column prop="project" align="center" :label="$t('large.projectname')" min-width="110" />
        <el-table-column prop="batch" align="center" :label="$t('large.batch')" min-width="110" />
        <el-table-column prop="reviewer" align="center" :label="$t('large.detailID')" min-width="110" />
        <el-table-column prop="orderSort" align="center" :label="$t('large.serialnumber')" min-width="110" />
        <el-table-column prop="productName" align="center" :label="$t('large.productname')" :show-overflow-tooltip="true" min-width="220" />
        <el-table-column prop="technologyNumber" align="center" :label="$t('large.serial')" min-width="110" />
        <el-table-column prop="glassAddress" align="center" :label="$t('large.slicemarker')" min-width="130" />
        <el-table-column prop="patchNum" align="center" :label="$t('large.numberpatches')" min-width="110" />
        <el-table-column prop="width" align="center" :label="$t('large.width')" min-width="110" />
        <el-table-column prop="height" align="center" :label="$t('large.height')" min-width="110" />
        <el-table-column prop="shape" align="center" :label="$t('large.shape')" min-width="110" />
        <el-table-column prop="responsibleProcess" align="center" :label="$t('large.responsibleprocess')" min-width="110" />
        <el-table-column prop="patchProcesses" align="center" :label="$t('large.process')" min-width="110" />
        <el-table-column prop="breakageQuantity" align="center" :label="$t('large.numberfractions')" min-width="110" />
        <el-table-column prop="patchReason" align="center" :label="$t('large.breakreason')" min-width="110" />
        <el-table-column prop="patchType" align="center" :label="$t('large.breaktype')" min-width="110" />
        <el-table-column prop="responsiblePersonnel" align="center" :label="$t('large.responsiblepersonnel')" min-width="110" />
        <el-table-column prop="responsibleEquipment" align="center" :label="$t('large.responsiblequipment')" min-width="110" />
        <el-table-column prop="responsibleTeam" align="center" :label="$t('large.responsibleteam')" min-width="110" />
        <el-table-column prop="patchArea" align="center" :label="$t('large.area')" min-width="110" />
        <el-table-column prop="qualityInspector" align="center" :label="$t('large.inspector')" min-width="110" />
        <el-table-column prop="orderId" fixed align="center" :label="$t('large.orderId')" min-width="110" />
        <el-table-column prop="project" fixed align="center" :label="$t('large.project')" min-width="110" />
        <el-table-column prop="productName" fixed align="center" :label="$t('large.productname')" min-width="110" />
        <el-table-column prop="width" fixed align="center" :label="$t('large.width')" min-width="100" />
        <el-table-column prop="height" fixed align="center" :label="$t('large.height')" min-width="100" />
        <el-table-column prop="area" fixed align="center" :label="$t('large.are')" min-width="100" />
        <el-table-column prop="quantity" fixed align="center" :label="$t('large.number')" min-width="110" />
        <el-table-column prop="processingNote" fixed align="center" :label="$t('large.method')" min-width="110" />
        <el-table-column prop="deliveryDate" fixed align="center" :label="$t('large.deliveryDate')" min-width="130" />
      </el-table>
  <template #footer>
    <div id="dialog-footer" style="text-align: center;">
@@ -133,46 +121,50 @@
const tableDatac = ref([])
const adjustedRects = ref([]);  
const chartRefs = ref([]);  
// const flake = ref(false)
// const flakeb = ref(false)
// const flakec = ref(false)
// const flaked = ref(false)
// const woshia = ref(false)
// const woshic = ref(false)
// const dalipiana = ref(false)
// const dalipianb = ref(false)
// const shangpian = ref(false)
// const xiapian1 = ref(false)
// const xiapian2 = ref(false)
// const xiapian3 = ref(false)
// const xiapian4 = ref(false)
// const xiapian5 = ref(false)
// const xiapian6 = ref(false)
const flake = ref(true)
const flakeb = ref(true)
const flakec = ref(true)
const flaked = ref(true)
const woshia = ref(true)
const woshic = ref(true)
const dalipiana = ref(true)
const dalipianb = ref(true)
const shangpian = ref(true)
const xiapian1 = ref(true)
const xiapian2 = ref(true)
const xiapian3 = ref(true)
const xiapian4 = ref(true)
const xiapian5 = ref(true)
const xiapian6 = ref(true)
const flake = ref(false)
const flakeb = ref(false)
const flakec = ref(false)
const flaked = ref(false)
const woshia = ref(false)
const woshic = ref(false)
const dalipiana = ref(false)
const dalipianb = ref(false)
const shangpian = ref(false)
const xiapian1 = ref(false)
const xiapian2 = ref(false)
const xiapian3 = ref(false)
const xiapian4 = ref(false)
const xiapian5 = ref(false)
const xiapian6 = ref(false)
const thisProcess = ref(); // 用于存储process_id的响应式引用 
// 定义一个响应式引用来存储图表实例    
const chartDom = ref(null);  
let chartInstance = null;  
const blinda = ref(false)
const handleBinda = (row) => {
blinda.value = true;
};
const handleBinda = async (row) => {
  blinda.value = true;
  await fetchFlowCardId(row.orderId);
};
const processesData = ref([]);
const fetchFlowCardId = async (orderId) => {
  try  {
    const response = await request.post('/loadGlass/order/order/selectOrderdetail',{
      orderId: orderId
    })
    if (response.code == 200) {
      ElMessage.success(response.message);
      tableData.value = response.data;
      console.log(tableData.value);
    } else {
      ElMessage.error(response.message);
    }
}
catch (error) {
    // 处理错误
    console.error(error);
  }
}
function getStatusType(warehousing) {  
switch (warehousing) {  
  case 0:  
@@ -201,7 +193,7 @@
let socket6 = null;
const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/screen`;
const handleMessage = (data) => {
tableData.value = data.awaitingRepairs[0]
// tableData.value = data.awaitingRepairs[0]
tableDatab.value = data.DoingTask[0]
tableDatac.value = data.orders[0]
  socket.onmessage = (event) => {  
@@ -224,50 +216,48 @@
const socketUrl2 = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/temperingIsRun`;
const handleMessage2 = (data) => {
  // const tasks = data.temperingTaskType[0];
  // if (tasks && tasks.length >= 4) {
  //   flake.value = tasks[0].state === 1;
  //   flakeb.value = tasks[1].state === 2;
  //   flakec.value = tasks[2].state === 3;
  //   flaked.value = tasks[3].state === 4;
  // }
  const tasks = data.temperingTaskType[0];
    flake.value = tasks.some(task => task.state == 1);
    flakeb.value = tasks.some(task => task.state == 2);
    flakec.value = tasks.some(task => task.state == 3);
    flaked.value = tasks.some(task => task.state == 4);
};
// 卧式理片
const socketUrl3 = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlassIsRun`;
const handleMessage3 = (data) => {
  // const tasks = data.taskCaches[0];
  // woshia.value = tasks.some(task => task.line == 2001);
  // woshic.value = tasks.some(task => task.line == 2002);
  // console.log(tasks);
  const tasks = data.taskCaches[0];
  woshia.value = tasks.some(task => task.line == 2001);
  woshic.value = tasks.some(task => task.line == 2002);
  console.log(tasks);
  
};
// 大理片笼
const socketUrl4 = `ws://${WebSocketHost}:${host}/api/cacheVerticalGlass/api/talk/isRun`;
const handleMessage4 = (data) => {
//   const tasks = data.bigStorageCageDetailsOutTask[0];
//   const taskss = data.bigStorageCageDetailsFeedTask[0];
//     dalipiana.value = tasks.some(task => task.slot !== null && task.slot !== undefined);
// dalipianb.value = taskss.some(task => task.slot !== null && task.slot !== undefined);
  const tasks = data.bigStorageCageDetailsOutTask[0];
  const taskss = data.bigStorageCageDetailsFeedTask[0];
    dalipiana.value = tasks.some(task => task.slot !== null && task.slot !== undefined);
dalipianb.value = taskss.some(task => task.slot !== null && task.slot !== undefined);
};
// 上片
const socketUrl5 = `ws://${WebSocketHost}:${host}/api/loadGlass/api/talk/loadGlassIsRun`;
const handleMessage5 = (data) => {
//   if(data.engineering.length !==0 ){
//     shangpian.value = true;
// }
  if(data.engineering.length !==0 ){
    shangpian.value = true;
}
};
// 下片
const socketUrl6 = `ws://${WebSocketHost}:${host}/api/unLoadGlass/api/talk/unLoadGlassIsRun`;
const handleMessage6 = (data) => {
  const tasks = data.downWorkstation[0];  
  // if (tasks && tasks.length >= 6) {
  //   xiapian1.value = tasks[0].racksNumber !== 0;
  //   xiapian2.value = tasks[1].racksNumber !== 0;
  //   xiapian3.value = tasks[2].racksNumber !== 0;
  //   xiapian4.value = tasks[3].racksNumber !== 0;
  //   xiapian5.value = tasks[4].racksNumber !== 0;
  //   xiapian6.value = tasks[5].racksNumber !== 0;
  // }
  if (tasks && tasks.length >= 6) {
    xiapian1.value = tasks[0].racksNumber !== 0;
    xiapian2.value = tasks[1].racksNumber !== 0;
    xiapian3.value = tasks[2].racksNumber !== 0;
    xiapian4.value = tasks[3].racksNumber !== 0;
    xiapian5.value = tasks[4].racksNumber !== 0;
    xiapian6.value = tasks[5].racksNumber !== 0;
  }
};
const renderPieCharts = () => {
processesData.value.forEach((data, index) => {
@@ -445,20 +435,20 @@
#longa{
  position: absolute;
  z-index: 1;
  width: 29px;
  width: 33px;
  height: 5px;
  background-color: #529b2e;
  margin-top: -20px;
  margin-left: 80px;
  margin-left: 130px;
}
#longb{
  position: absolute;
  z-index: 1;
  width: 29px;
  width: 33px;
  height: 5px;
  background-color: #529b2e;
  margin-top: -20px;
  margin-left: 150px;
  margin-left: 235px;
}
#shangpianji{
  position: absolute;
@@ -467,60 +457,60 @@
  height: 10px;
  background-color: #529b2e;
  margin-top: -90px;
  margin-left: 568px;
  margin-left: 868px;
}
#xiapianji1{
  position: absolute;
  z-index: 1;
  width: 10px;
  width: 12px;
  height: 7px;
  background-color: #529b2e;
  margin-top: -213px;
  margin-left: 111px;
  margin-left: 173px;
}
#xiapianji2{
  position: absolute;
  z-index: 1;
  width: 10px;
  width: 12px;
  height: 7px;
  background-color: #529b2e;
  margin-top: -213px;
  margin-left: 140px;
  margin-left: 217px;
}
#xiapianji3{
  position: absolute;
  z-index: 1;
  width: 10px;
  width: 12px;
  height: 7px;
  background-color: #529b2e;
  margin-top: -202px;
  margin-left: 126px;
  margin-left: 196px;
}
#xiapianji4{
  position: absolute;
  z-index: 1;
  width: 10px;
  width: 12px;
  height: 7px;
  background-color: #529b2e;
  margin-top: -213px;
  margin-left: 175px;
  margin-left: 270px;
}
#xiapianji5{
  position: absolute;
  z-index: 1;
  width: 10px;
  width: 12px;
  height: 7px;
  background-color: #529b2e;
  margin-top: -213px;
  margin-left: 204px;
  margin-left: 314px;
}
#xiapianji6{
  position: absolute;
  z-index: 1;
  width: 10px;
  width: 12px;
  height: 7px;
  background-color: #529b2e;
  margin-top: -202px;
  margin-left: 190px;
  margin-left: 293px;
}
</style>