SclUpdate.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <script setup>
  2. import { ref, defineEmits, watch, onMounted } from "vue";
  3. import CidTree from "./CidTree.vue";
  4. import Gsix from "./Gsix.vue";
  5. import virtualnformation from "./virtualnformation.vue"; //虚端
  6. import { useRoute } from "vue-router";
  7. let route = useRoute();
  8. const props = defineProps({
  9. openScl: {
  10. type: Boolean,
  11. default: false,
  12. },
  13. iedRelationData: {
  14. type: Object,
  15. default: () => {},
  16. },
  17. clickRowData: {
  18. type: Object,
  19. default: () => {},
  20. },
  21. checkDialogData: {
  22. type: Object,
  23. default: () => {},
  24. },
  25. });
  26. const UPdate = ref("update");
  27. const newChicken = route.query.stationName;
  28. const OpensclTrue = ref(false);
  29. const emit = defineEmits(["doneScl"]);
  30. const iedRelation = ref(null);
  31. //装置列表数据
  32. watch(
  33. () => props.iedRelationData,
  34. (newValue) => {
  35. console.log("iedRelationscllll", newValue);
  36. iedRelation.value = newValue;
  37. //如果没有点击装置列表直接点击了code的默认装置第一个装置列表的数据
  38. clickList.value = Object.values(props.iedRelationData)[0];
  39. }
  40. );
  41. //打开文件
  42. watch(
  43. () => props.openScl,
  44. (newValue) => {
  45. if (newValue) {
  46. OpensclTrue.value = newValue;
  47. }
  48. }
  49. );
  50. //所点击对比的数据
  51. const clickRowDatas = ref(null);
  52. watch(
  53. () => props.clickRowData,
  54. (newValue) => {
  55. console.log("newValue", newValue);
  56. if (newValue) {
  57. clickRowDatas.value = newValue;
  58. }
  59. }
  60. );
  61. const checkData = ref(props.checkDialogData);
  62. watch(
  63. () => props.checkDialogData,
  64. (newValue, oldValue) => {
  65. console.log("props.checkDialogData", newValue, oldValue);
  66. checkData.value = newValue;
  67. }
  68. );
  69. const cancelClick = () => {
  70. OpensclTrue.value = false;
  71. clickCodeValue.value = "";
  72. emit("doneScl");
  73. };
  74. const clickList = ref(null);
  75. const treeBack = (data, val) => {
  76. clickList.value = data;
  77. console.log("data====", data);
  78. };
  79. const treeBackDefalut = (data) => {
  80. // clickList.value = data;
  81. };
  82. const clickCodeValue = ref(null);
  83. const clickCode = (code) => {
  84. clickCodeValue.value = code;
  85. };
  86. const result = (newData) => {
  87. checkData.value = newData;
  88. };
  89. const virtualScd = ref(true); //是scd对比的虚回路信息
  90. onMounted(() => {});
  91. </script>
  92. <template>
  93. <div>
  94. <el-dialog
  95. @close="cancelClick"
  96. v-model="OpensclTrue"
  97. width="93vw"
  98. append-to-body
  99. draggable
  100. top="5vh"
  101. style="height: 92vh"
  102. >
  103. <template #header>
  104. <div class="my-header">
  105. <div class="title">一致性对比结果</div>
  106. </div>
  107. </template>
  108. <div class="right-main">
  109. <CidTree
  110. :UPdate="UPdate"
  111. @treeBack="treeBack"
  112. @treeBackDefalut="treeBackDefalut"
  113. @clickCode="clickCode"
  114. :OpensclTrue="OpensclTrue"
  115. :iedRelation="iedRelation"
  116. ></CidTree>
  117. <div class="right-title">
  118. <div class="abBox">
  119. <div>
  120. <span style="border-right: 1px solid #516380; padding-right: 30px"
  121. >基准文件:{{ checkDialogData }}
  122. <span style="color: #09162c">{{ newChicken }}</span></span
  123. >
  124. </div>
  125. <div style="padding-left: 30px">
  126. <span
  127. >对比文件:<span style="color: #09162">{{
  128. clickRowDatas.target_name
  129. }}</span></span
  130. >
  131. </div>
  132. </div>
  133. <Gsix
  134. v-if="clickCodeValue != 'scd.ied.Relation'"
  135. :clickRowDatas="clickRowDatas"
  136. :iedRelation="iedRelation"
  137. :clickList="clickList"
  138. :clickCodeValue="clickCodeValue"
  139. ></Gsix>
  140. <!--
  141. :isOpen="isOpen"
  142. @result = "result"
  143. -->
  144. <div
  145. v-else-if="clickCodeValue == 'scd.ied.Relation'"
  146. style="height: 67vh; overflow-y: auto"
  147. >
  148. <virtualnformation
  149. :virtualScd="virtualScd"
  150. :clickRowDatas="clickRowDatas"
  151. :clickList="clickList"
  152. :clickCodeValue="clickCodeValue"
  153. :checkData="checkData"
  154. :OpensclTrue="OpensclTrue"
  155. @result="result"
  156. ></virtualnformation>
  157. </div>
  158. </div>
  159. </div>
  160. </el-dialog>
  161. </div>
  162. </template>
  163. <style scoped lang="scss">
  164. .my-header {
  165. border-bottom: 1px solid #a3ade0;
  166. font-size: 16px;
  167. color: #1a2447;
  168. .title {
  169. padding-bottom: 15px;
  170. }
  171. }
  172. .right-main {
  173. display: flex;
  174. .right-title {
  175. width: 85%;
  176. margin: 20px 0 0 16px;
  177. background: #f7f8fb;
  178. }
  179. .abBox {
  180. width: 95%;
  181. height: 40px;
  182. position: relative;
  183. margin: 10px auto;
  184. display: flex;
  185. font-size: 14px;
  186. background: #fff;
  187. justify-content: center;
  188. align-items: center;
  189. color: #516380;
  190. }
  191. }
  192. </style>