InsideModule.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. <template>
  2. <div>
  3. <div class="bigBox">
  4. <div style="text-align: center;">
  5. <h2 style="font-size: 20px;">装置关联模型管理</h2>
  6. </div>
  7. <div style="display: flex;justify-content: flex-start;align-items: center;height: 100%;">
  8. <div style="height: 100%;width: calc(100% - 0px);position: relative;">
  9. <div class="setBox">
  10. <div style="width: 70%;display: flex;justify-content: flex-start;align-items: center;">
  11. <div style="width: calc(50%);">
  12. <span style="font-size: 20px;color: #7484AB;">连接线:</span>
  13. <span class="sv" @click="svClick">SV</span>
  14. <span class="goose" @click="gooseClick">GOOSE</span>
  15. </div>
  16. <div style="display: flex;width: calc(30%);">
  17. <span style="font-size: 20px;color: #7484AB;margin-left: 20px;">操作:</span>
  18. <div class="cutPoint">
  19. <!-- <img style="width: 22px;height: 22px;display: block;"
  20. src="../../../assets/icon/iorn_pen.png" alt="">
  21. <span style="display: block;">控点</span> -->
  22. </div>
  23. <div class="deletePoint" @click="delClick">
  24. <img style="width: 22px;height: 22px;display: block;"
  25. src="../../../assets/icon/cut_knief.png" alt="">
  26. <span style="display: block;">删除</span>
  27. </div>
  28. </div>
  29. <div style="display: flex;width: 20%;">
  30. <div>
  31. <span>X:</span>
  32. <el-input class="coord" v-model="fatX" @input="limitNumX" @change="xChange"></el-input>
  33. </div>
  34. <div>
  35. <span>Y:</span>
  36. <el-input class="coord" v-model="fatY" @input="limitNumY" @change="yChange"></el-input>
  37. </div>
  38. </div>
  39. </div>
  40. <div style="width: calc(30%);">
  41. <div style="width: calc(100%);">
  42. <el-button type="primary" @click="cleanAll" plain>取消</el-button>
  43. <el-button type="primary" @click="saveMap">保存</el-button>
  44. </div>
  45. </div>
  46. </div>
  47. <div class="tableBox">
  48. <!-- <FeelLoad></FeelLoad> -->
  49. <!-- <FatherMap></FatherMap> -->
  50. <!-- 建议使用这个 -->
  51. <DrawDesigns ref="designsRef" :lineMenuColor="lineMenuColor" :fatX="fatX" :fatY="fatY"
  52. @backxy="backxy"></DrawDesigns>
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. </template>
  59. <script>
  60. import { ref, onMounted, toRefs, watch } from 'vue';
  61. import { ElMessage } from 'element-plus';
  62. import FeelLoad from '@/pages/feelLoad/FeelLoad.vue'//bmnp
  63. import FatherMap from '@/pages/mapLoad/FatherMap.vue';//jsplumb
  64. import DrawDesigns from '@/pages/components/draw/DrawDesigns.vue';//logicflow
  65. export default {
  66. setup() {
  67. let moduleList = ref([])
  68. let lineMenuColor = ref('#255CE7')
  69. let designsRef = ref(null)
  70. let fatX = ref()
  71. let fatY = ref()
  72. function searchModule() {
  73. }
  74. function svClick() {
  75. lineMenuColor.value = '#255CE7'
  76. designsRef.value.blue()//切换为sv
  77. }
  78. function gooseClick() {
  79. lineMenuColor.value = 'orange'
  80. designsRef.value.orange()//切换为goose
  81. }
  82. function delClick() {
  83. designsRef.value.delLine()//删除连接线
  84. }
  85. function saveMap() {
  86. designsRef.value.saveLine()//保存为图片
  87. }
  88. function cleanAll() {
  89. designsRef.value.cleanMap()//清除画布
  90. }
  91. function limitNumX(e) {//强制转换为数字
  92. let types = e.replace(/\D/g, '');
  93. fatX.value = types - 0
  94. }
  95. function limitNumY(e) {//强制转换为数字
  96. let types = e.replace(/\D/g, '');
  97. fatY.value = types - 0
  98. }
  99. function xChange(e) {
  100. fatX.value = e - 0
  101. designsRef.value.momal()
  102. }
  103. function yChange(e) {
  104. fatY.value = e - 0
  105. designsRef.value.momal()
  106. }
  107. function backxy(x, y) {
  108. fatX.value = x
  109. fatY.value = y
  110. }
  111. onMounted(() => {
  112. searchModule()
  113. })
  114. return {
  115. moduleList,
  116. searchModule,
  117. lineMenuColor,
  118. svClick,
  119. gooseClick,
  120. designsRef,
  121. delClick,
  122. saveMap,
  123. cleanAll,
  124. fatX,
  125. fatY,
  126. backxy,
  127. xChange,
  128. yChange,
  129. limitNumX,//只能输入数字
  130. limitNumY,
  131. }
  132. },
  133. components: {
  134. FeelLoad,
  135. FatherMap,
  136. DrawDesigns
  137. }
  138. }
  139. </script>
  140. <style scoped>
  141. .bigBox {
  142. width: 100%;
  143. height: calc(100vh - 150px);
  144. border: 1px solid blue;
  145. }
  146. .tableBox {
  147. width: 100%;
  148. height: calc(100% - 10%);
  149. }
  150. .setBox {
  151. width: calc(100% - 14%);
  152. height: calc(100% - 90%);
  153. border: 1px solid #A3ADE0;
  154. position: absolute;
  155. top: 0px;
  156. left: calc(100% - 86.5%);
  157. z-index: 1;
  158. background-color: #F7F8FB;
  159. line-height: calc(600%);
  160. display: flex;
  161. justify-content: space-around;
  162. align-items: center;
  163. /* margin-top: 1px; */
  164. }
  165. .moduleBox {
  166. width: 10%;
  167. height: 100%;
  168. border: 1px solid green;
  169. }
  170. .sv {
  171. display: inline-block;
  172. width: calc(100% - 82%);
  173. height: 24px;
  174. text-align: center;
  175. line-height: 24px;
  176. border-top: 2px solid #255CE7;
  177. font-size: 20px;
  178. margin-right: 5px;
  179. cursor: pointer;
  180. }
  181. .goose {
  182. display: inline-block;
  183. width: 75px;
  184. height: 24px;
  185. text-align: center;
  186. line-height: 24px;
  187. border-top: 2px solid #FF7C03;
  188. font-size: 20px;
  189. cursor: pointer;
  190. }
  191. .cutPoint {
  192. display: flex;
  193. justify-content: space-around;
  194. align-items: center;
  195. font-size: 20px;
  196. text-align: center;
  197. margin-right: 10px;
  198. cursor: pointer;
  199. }
  200. .deletePoint {
  201. display: flex;
  202. justify-content: space-around;
  203. align-items: center;
  204. font-size: 20px;
  205. text-align: center;
  206. cursor: pointer;
  207. }
  208. :deep(.lf-dndpanel) {
  209. height: auto;
  210. overflow-y: auto;
  211. background-color: #F7F8FB;
  212. }
  213. :deep(.lf-dnd-shape) {
  214. display: none;
  215. }
  216. :deep(.lf-dnd-text) {
  217. width: calc(100% - 8px);
  218. height: 42px;
  219. border: 1px solid #255CE7;
  220. margin-left: 2px;
  221. color: #255CE7;
  222. text-align: center;
  223. line-height: 22px;
  224. }
  225. .coord {
  226. width: 50px;
  227. height: 30px;
  228. background-color: transparent;
  229. border: none;
  230. }
  231. </style>