Mr.Zhang
2023-08-24 7550fb636fec7a84dbdea55196d97ed635d7ab10
screen_standard/src/components/AppLayout.vue
@@ -16,10 +16,10 @@
          </template>
        </el-dropdown>
        <img v-else src="@/assets/img/btn_back@2x.png" style="width: 108px;height: 34px; margin-top: 14px;" @click="router.go(-1)">
        <img v-else src="@/assets/img/btn_back@2x.png" style="width: 108px;height: 34px; margin-top: 14px;" @click="back">
      </div>
      
      <div class="title">DM云工厂车间大屏</div>
      <div class="title">{{ title }}</div>
      <div class="header-item right">
        <img v-if="!isFull" src="@/assets/img/ic_fullscreen@2x.png" class="full-ic" @click="fullChange">
@@ -47,7 +47,7 @@
      </div>
    </div>
    <KeepAlive>
      <RouterView />
      <router-view></router-view>
    </KeepAlive>
  </div>
</template>
@@ -58,7 +58,7 @@
import { getDepartmentList } from '@/utils/api.js'
import { reactive, toRefs, onMounted, computed } from 'vue';
import { useCounterStore } from '@/stores/counter.js'
import { RouterView, useRoute, useRouter } from 'vue-router'
import { useRoute, useRouter } from 'vue-router'
const enterprise = useCounterStore()
const route = useRoute()
const router = useRouter()
@@ -82,9 +82,11 @@
    return enterprise.deviceNum
})
const unqualifiedRate = computed(() => {
    return enterprise.unqualifiedRate
    return +enterprise.unqualifiedRate.toFixed(2)
})
const title = computed(() => {
    return enterprise.procedureName ? `${enterprise.procedureName}工序数据看板` :  'DM云工厂车间大屏'
})
const data = reactive({
  tempCom: { name: '豆米科技' },
  isFull: false,
@@ -113,9 +115,9 @@
}
const fullChange = () => {
  data.isFull = !data.isFull
  // data.isFull = !data.isFull
  let element = document.documentElement;
  if (data.isFull) {   // 全屏
  if (!data.isFull) {   // 全屏
    if (element.requestFullscreen) {
      element.requestFullscreen();
    } else if (element.webkitRequestFullScreen) {
@@ -137,10 +139,11 @@
      document.msExitFullscreen();
    }
  }
  // data.isFull = !data.isFull
  data.isFull = !data.isFull
}
onMounted(() => {
  enterprise.setDepartId()
  getDepartmentList(enterprise.companyId)
    .then(res => {
      data.comList = res
@@ -148,36 +151,55 @@
      enterprise.setDepartId(data.tempCom.id)
    })
    .catch(err => {})
  const week = ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日',]
  // fullChange()
  const week = ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日']
  setInterval(() => {
    let date = new Date()
    let tempDate = new Date()
    let month = tempDate.getMonth()+1
    let day = tempDate.getDate()
    let hours = tempDate.getHours()
    let minute = tempDate.getMinutes()
    let seconds = tempDate.getSeconds()
    data.tempDate = {
      time: `${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`,
      date: `${date.getFullYear()}/${date.getMonth()+1}/${date.getDate()}`,
      day: week[date.getDay()-1]
      time: `${hours<10?`0${hours}`:hours}:${minute<10?`0${minute}`:minute}:${seconds<10?`0${seconds}`:seconds}`,
      date: `${tempDate.getFullYear()}/${month<10?`0${month}`:month}/${day<10?`0${day}`:day}`,
      day: week[tempDate.getDay()-1]
    }
  }, 1000)
  // console.log(date.getDay());
})
const back = () => {
  enterprise.setProcedureName('')
  router.go(-1)
}
</script>
<style lang="scss" scoped>
.content {
  background-image: url('@/assets/img/bg@2x.png');
  background-image: url('@/assets/img/bg.png');
  background-position: center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  // width: 100%;
  // height: 100%;
  padding: 30px;
  // overflow-y: scroll;
  // width: 1920px;
  // height: 1080px;
  width: 100%;
  height: 100%;
  padding: 20px 30px;
  overflow-y: scroll;
  scrollbar-width:none;
  -ms-overflow-style:none;
  &::-webkit-scrollbar{
    width: 0;
  }
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  .header {
    background-image: url('@/assets/img/bg_maintitle@2x.png');
    background-size: 100% 74px;
    background-size: 100% 70px;
    width: 100%;
    height: 74px;
    height: 70px;
    display: flex;
    padding-top: 1px;
    padding-left: 20px;
@@ -245,14 +267,15 @@
    }
  }
  .num-list {
    margin-top: 24px;
    margin-bottom: 27px;
    margin-top: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    height: 88px;
    height: 80px;
    color: white;
    .num-item {
      width: calc(25% - 50px);
      height: 80px;
      background-size: 100% 100%;
      margin-right: 25px;
      padding-left: 30px;