songshankun
2023-11-03 bcb8d1e446e0292bf551073ed66c76997b9bdb18
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<template>
  <div class="input-out-material-info" @click="materialInfoClick">
    <div class="card-t">
      <div class="card-t-t card_drop">
        <el-popover :width="200" placement="top-start" trigger="click">
          <template #reference>
            {{ material.materialId }}
          </template>
          {{ material.materialId }}
        </el-popover>
      </div>
      <div class="card-t-b">
        <!--        TODO: 接口缺失数据, 待添加-->
        <!--        设备12-->
        <!--        <el-icon class="right-arrow">-->
        <!--          <Right />-->
        <!--        </el-icon>-->
        <!--        设备13-->
      </div>
    </div>
    <div class="card-b">
      <div class="card_drop card-b-l">
        <el-popover :width="200" placement="top-start" trigger="click">
          <template #reference>
            {{ material.materialName }}
          </template>
          {{ material.materialName }}
        </el-popover>
      </div>
      <div class="card-b-r">
        <el-popover v-if="material.date" popper-class="card-info" :width="110" placement="top" trigger="click">
          <template #reference> {{ material.amount }} {{ material.unit }} </template>
          预计{{ material.date }}分钟送达
        </el-popover>
        <div v-else>{{ material.amount }} {{ material.unit }}</div>
      </div>
    </div>
  </div>
</template>
<script setup lang="ts">
import type { Material } from '@/api/task'
import { toRefs } from 'vue'
export interface InputOutMaterialInfoProps {
  material: Material
  // TODO: 接口还不支持, 预留
  type?: '已送达' | '运输中'
}
 
const props = defineProps<InputOutMaterialInfoProps>()
const { material } = toRefs(props)
const emits = defineEmits<{
  detailClick: [material: Material]
}>()
function materialInfoClick() {
  emits('detailClick', material.value)
}
</script>
 
<style scoped lang="scss">
$status-default: #13235a;
$status-running: #f76c0f;
$status-ready: #13235a;
$status-done: #ffcc00;
 
.input-out-material-info {
  width: calc(50% - 10px);
  height: auto;
  border-radius: 4px;
  color: #333;
  overflow: hidden;
  float: left;
  font-size: 15px;
  background: #fff;
  margin-right: 10px;
  margin-bottom: 10px;
  position: relative;
  cursor: pointer;
 
  .card_drop {
    width: 100%;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
  }
  .card-t {
    width: 100%;
    height: auto;
    line-height: 18px;
    font-size: 12px;
    color: #333;
    padding: 3px 5px;
    background: $status-done;
    text-align: left;
    .card-t-t {
      width: 100%;
      font-size: 16px;
    }
  }
  .card-b {
    width: 100%;
    height: 36px;
    line-height: 20px;
    font-size: 14px;
    padding: 8px 5px;
    .card-b-l {
      width: calc(100% - 70px);
      float: left;
      font-size: 13px;
    }
    .card-b-r {
      width: 70px;
      float: right;
      text-align: right;
    }
  }
}
</style>
<style lang="scss">
.el-popover.el-popper.card-info {
  min-width: 110px;
  background: red !important;
  font-size: 12px;
  color: #fff;
  border: 0;
  border-radius: 10px;
  // height:20px!important;
  line-height: 8px !important;
  .el-popper__arrow::before {
    background: red !important;
    border-color: red;
  }
}
</style>