123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- <!-- 整个弹窗 -->
- <template>
- <div>
- <el-dialog
- @close="cancelClick"
- v-model="isOpen"
- width="70vw"
- append-to-body
- draggable
- >
- <template #header>
- <div class="my-header">
- <div class="title">{{ props.checkLabel }}</div>
- </div>
- </template>
- <el-scrollbar height="470px">
- <div class="container">
- <div
- class="cont-item"
- v-for="(item, index) in props.dialogData"
- :key="index"
- @click="clickIed(item)"
- >
- <img :src="devicePng" alt="" />
- <div class="name">{{ item.ied_name }}</div>
- <div class="desc">{{ item.desc }}</div>
- </div>
- </div>
- </el-scrollbar>
- </el-dialog>
- <dialog-index
- :openBig="openBig"
- @done="done"
- :checkDialogData="checkDialogData"
- :iedRelationData="iedRelationData"
- ></dialog-index>
- </div>
- </template>
- <script setup>
- import { watch, ref, inject, onMounted } from "vue";
- import { defineEmits } from "vue";
- import { scdIedRelation } from "@/api/iedNetwork";
- import devicePng from "@/assets/image/instruct/device.png";
- import dialogIndex from "./dialogIndex.vue";
- const scdIdValue = inject("scdId");
- const openBig = ref(false);
- const props = defineProps({
- open: {
- type: Boolean,
- default: false,
- },
- dialogData: {
- type: Object,
- default: () => {},
- },
- checkLabel: {
- type: String,
- default: "",
- },
- iedRelationData:{
- type: Object,
- default: () => {},
- }
- });
- const isOpen = ref(props.open);
- watch(
- () => props.open,
- (newValue) => {
- isOpen.value = newValue;
- }
- );
- //弹窗=============
- const emit = defineEmits(["done", "update:visible"]);
- const cancelClick = () => {
- isOpen.value = false;
- emit("done", false);
- };
- const checkDialogData = ref(null);
- onMounted(() => {
- });
- const clickIed = (value) => {
- openBig.value = true;
- Object.values(props.iedRelationData).find((item) => {
- if (item.ied_name == value.ied_name) {
- checkDialogData.value = item;
- }
- });
- };
- const done = (emits) => {
- openBig.value = emits;
- checkDialogData.value = null;
- };
- // emit('done', data.id);
- // emit('update:visible', value);
- </script>
- <style scoped lang="scss">
- :deep(.el-dialog__header) {
- border-bottom: 1px solid #a3ade0;
- }
- .my-header {
- border-bottom: 1px solid #a3ade0;
- font-size: 16px;
- color: #1a2447;
- .title {
- padding-bottom: 15px;
- }
- }
- .container {
- display: flex;
- flex-wrap: wrap;
- .cont-item {
- display: flex;
- align-items: center;
- flex-direction: column;
- flex-wrap: wrap;
- flex-basis: 20%;
- margin-bottom: 15px;
- cursor: pointer;
- }
- img {
- widows: 65px;
- height: 65px;
- }
- .desc {
- color: #255ce7;
- }
- }
- </style>
|