123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <template>
- <div class="card-box card-box-list">
- <div class="card-box-title">预警列表</div>
- <ul class="card-box-list-content">
- <li
- class="card-box card-box-list-item"
- v-for="item in list"
- :key="item.warningId"
- @click="$emit('warnClick', item)"
- >
- <span class="icon icon-warn"></span>
- <span class="ellipsis card-box-list-item-user">
- {{ item.name }}
- </span>
- <span class="ellipsis early-warning-reason" :title="item.info">
- {{ item.info }}
- </span>
- </li>
- </ul>
- </div>
- </template>
- <script>
- export default {
- name: "EarlyWarningList",
- props: {
- list: {
- type: Array,
- default: () => [],
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .ellipsis {
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .card-box-list {
- padding: 0 10px 10px;
- list-style: none;
- .card-box-title {
- font-size: 14px;
- font-weight: bold;
- color: #ffffff;
- line-height: 1;
- padding: 20px 0;
- }
- .card-box-list-content {
- margin: 0;
- padding: 0;
- padding-right: 10px;
- height: 500px; // 7
- overflow-y: auto;
- .card-box-list-item {
- width: unset;
- background-color: #3f444d;
- padding: 10px;
- line-height: 1;
- display: flex;
- align-items: center;
- color: #fff;
- font-size: 12px;
- &:not(:last-child) {
- margin-bottom: 6px;
- }
- .icon {
- width: 24px;
- height: 24px;
- }
- .card-box-list-item-user {
- font-weight: bold;
- margin: 0 10px;
- width: 48px;
- }
- .early-warning-reason {
- color: #a1a8b3;
- margin-left: auto;
- flex: 1;
- text-align: right;
- }
- }
- }
- }
- </style>
|