haoxuan
2023-11-02 7f75dd84169320720d72434247508386ca9c4f15
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
<template>
  <div class="input-out-material-info">
    <div class="card-t">
      <div class="card-t-t card_drop">
        <el-popover :width="200" placement="top-start" trigger="click">
          <template #reference>
            {{ item.materialId }}
          </template>
          {{ item.materialId }}
        </el-popover>
      </div>
      <div class="card-t-b">
        设备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>
            {{ item.materialName }}
          </template>
          {{ item.materialName }}
        </el-popover>
      </div>
      <div class="card-b-r">
        <el-popover v-if="item.date" popper-class="card-info" :width="110" placement="top" trigger="click">
          <template #reference> {{ item.amount }} {{ item.unit }} </template>
          预计{{ item.date }}分钟送达
        </el-popover>
        <div v-else>{{ item.amount }} {{ item.unit }}</div>
      </div>
    </div>
  </div>
</template>
<script setup lang="ts">
import type { inputMaterial } from '@/api/task'
import { Right } from '@element-plus/icons-vue'
import { toRefs } from 'vue'
 
export interface InputOutMaterialInfoProps {
  item: inputMaterial
  background?: string
}
 
const props = withDefaults(defineProps<InputOutMaterialInfoProps>(), {
  background: '#ffcc00'
})
const { item, background } = toRefs(props)
</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;
 
  .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;
    background-color: v-bind(background);
    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: 0px;
  border-radius: 10px;
  // height:20px!important;
  line-height: 8px !important;
  .el-popper__arrow::before {
    background: red !important;
    border-color: red;
  }
}
</style>