ll
liukangdong
2024-09-26 6d3886ba1e4b3630da947a7a046433feb3759d17
admin/src/views/platform/index.vue
@@ -6,16 +6,11 @@
          v-for="(item, i) in PlatGroupList" :key="i">
          {{ item.name }}
        </div>
        <!-- <el-tabs v-model="activeGroup.id" @tab-click="platgroupClick">
          <el-tab-pane
            v-for="item,i in PlatGroupList"
            :key="i"
            :label="item.name"
            :name="String(item.id)"
          />
        </el-tabs> -->
      </div>
      <el-button type="primary" class="ml20" @click="handleSet">配置月台</el-button>
      <div class="btns">
        <!-- <el-button type="primary" @click="handleSet">刷新</el-button> -->
        <el-button type="primary" class="ml20" @click="handleSet">配置月台</el-button>
      </div>
    </div>
    <!--  -->
    <div v-if="activeGroup.platformList" class="platform_list">
@@ -43,7 +38,8 @@
          <el-button type="primary" @click="handleQueuing(item, 2)">月台叫号</el-button>
        </div>
        <div class="list" v-if="item.platformWorkVO && item.platformWorkVO.platformJobList">
          <div class="info" :class="{err: task.status == 8}" v-for="task in item.platformWorkVO.platformJobList" :key="task.id">
          <div class="info" :class="{ err: task.status == 8 }" v-for="task in item.platformWorkVO.platformJobList"
            :key="task.id">
            <div class="line">
              <div class="left">
                <div v-if="task.carCodeFront" class="code">
@@ -120,7 +116,7 @@
    <GlobalWindow title="配置显示月台" :visible.sync="isShowSet" :confirm-working="setLoading" @confirm="handleSetSub"
      width="560px">
      <div class="set_modal">
        <div class="mb10" v-for="group in PlatGroupList" :key="group.id">
        <div class="mb10" v-for="group in PlatGroupListSet" :key="group.id">
          <div class="title">{{ group.name }}</div>
          <div class="list">
            <div class="item" @click="platformSetClick(item.id)" :class="{ active: item.showConfig }"
@@ -186,6 +182,7 @@
      statusMap,
      activeGroup: {},
      PlatGroupList: [],
      PlatGroupListSet: [],
      platList: [],
      platCallList: [],
      isShowTransform: false,
@@ -203,8 +200,10 @@
    }
  },
  created() {
    setInterval(() => {
      this.getPlatGroupList()
    }, 1000 * 20)
    this.getPlatGroupList()
    // this.getList()
  },
  methods: {
    handleWork(item) {
@@ -288,16 +287,16 @@
        this.activeGroup.platformList.forEach(plat => {
          if (plat.platformWorkVO.platformJobList && plat.platformWorkVO.platformJobList.length > 0) {
            plat.platformWorkVO.platformJobList.forEach(item => {
              if (item.callDate) {
                const timeNum = time.getTime() - new Date(item.callDate).getTime()
              if (item.newCallDate) {
                const timeNum = time.getTime() - new Date(item.newCallDate).getTime()
                if (timeNum > 3600000) {
                  item.callDateTemp = dayjs.duration(timeNum).format('H小时m分s秒')
                } else {
                  item.callDateTemp = dayjs.duration(timeNum).format('m分s秒')
                }
              }
              if (item.startDate) {
                const timeNum = time.getTime() - new Date(item.startDate).getTime()
              if (item.newStartDate) {
                const timeNum = time.getTime() - new Date(item.newStartDate).getTime()
                if (timeNum > 3600000) {
                  item.startDateTemp = dayjs.duration(timeNum).format('H小时m分ss秒')
                } else {
@@ -336,11 +335,17 @@
    },
    handleSet() {
      this.isShowSet = true
      getPlatformGroupList({
        queryData: 0,
        queryType: 1
      }).then(res => {
        this.PlatGroupListSet = res || []
      })
    },
    handleSetSub() {
      const { PlatGroupList } = this
      const { PlatGroupListSet } = this
      const ids = []
      PlatGroupList.forEach(item => {
      PlatGroupListSet.forEach(item => {
        item.platformList.forEach(platform => {
          if (platform.showConfig) {
            ids.push(platform.id)
@@ -358,8 +363,8 @@
      })
    },
    platformSetClick(id) {
      const { PlatGroupList } = this
      PlatGroupList.forEach(item => {
      const { PlatGroupListSet } = this
      PlatGroupListSet.forEach(item => {
        item.platformList.forEach(platform => {
          if (platform.id === id) {
            platform.showConfig = !platform.showConfig
@@ -431,6 +436,7 @@
      margin-top: 10px;
      padding: 16px;
      width: calc(100% - 0);
      .info {
        background: #f4fafb;
        border-radius: 2px;
@@ -485,12 +491,14 @@
              border-radius: 4px;
              border: 1px solid $primaryColor;
              padding-right: 4px;
              span {
                &:nth-of-type(1) {
                  background: $primaryColor;
                  padding: 0 8px;
                  color: #fff;
                }
                &:nth-of-type(2) {
                  padding-left: 4px;
                }
@@ -504,6 +512,7 @@
          }
        }
      }
      .jobing {
        background: #effbf5;
@@ -573,12 +582,14 @@
    }
  }
  .ml20 {
  .btns {
    position: absolute;
    width: 120px;
    width: 180px;
    height: 36px;
    right: 0;
    top: -4px;
    display: flex;
    justify-content: flex-end;
  }
}