index.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <template>
  2. <div class="container-bg">
  3. <el-container class="main-layout">
  4. <el-aside class="left-plate"><tree-list /></el-aside>
  5. <el-container class="right-plate">
  6. <el-header class="main-top">Header</el-header>
  7. <el-main class="main-cont">
  8. <div>
  9. home
  10. <button @click="detailsModal = true">测试打开模态框</button>
  11. <!-- 详细信息 -->
  12. <div>
  13. <el-dialog :visible.sync="detailsModal" width="98%" top="1vh" :height="ceshi">
  14. <div class="detailsTittle">
  15. <span>xxx-详细信息</span>
  16. </div>
  17. <div class="inDetailsBox">
  18. <div class="inBoxLeft">
  19. <el-input style="width: 300px;margin-top: 10px;" v-model="searchFast"
  20. placeholder="快速查找"></el-input>
  21. <template v-for="(item, index) in modelLeftList">
  22. <div class="leftMes" @click="insideBox(item)">
  23. <span class="leftMesSpan">{{ item.ied_name }}</span>
  24. <span>{{ item.desc }}</span>
  25. </div>
  26. </template>
  27. </div>
  28. <div class="inBoxRight">
  29. <!-- 导航栏 -->
  30. <div class="navigationBox">
  31. <template v-for="(item, index) in modalList">
  32. <p :class="['tabCard', { active: selectedIndex === index }]"
  33. @click="goUrl(item, index)">
  34. {{ item.name }}
  35. </p>
  36. </template>
  37. </div>
  38. </div>
  39. </div>
  40. <!-- <span slot="footer" class="dialog-footer">
  41. <el-button @click="detailsModal = false">取 消</el-button>
  42. <el-button type="primary" @click="detailsModal = false">确 定</el-button>
  43. </span> -->
  44. </el-dialog>
  45. </div>
  46. </div>
  47. </el-main>
  48. </el-container>
  49. </el-container>
  50. <!-- 测试弹窗 注释掉即可隐藏弹窗 -->
  51. <!-- <BulletBox :windowWidth="'150rem'" :windowHeight="'72rem'"></BulletBox> -->
  52. </div>
  53. </template>
  54. <script>
  55. import { getscdlist, getiedmse } from "@/api/ied/ied"
  56. import { forGround } from "@/api/basic/basic"
  57. export default {
  58. name: 'ScdProjectIndex',
  59. data() {
  60. return {
  61. detailsModal: false,
  62. searchFast: "",//详情模态框内快速搜索
  63. modalList: [
  64. {
  65. name: "装置关联关系",
  66. url: "1"
  67. },
  68. {
  69. name: "输入输出控制块",
  70. url: "2"
  71. },
  72. {
  73. name: "虚端子关系",
  74. url: "3"
  75. },
  76. {
  77. name: "基础信息",
  78. url: "4",
  79. },
  80. {
  81. name: "定值条目",
  82. url: "5"
  83. },
  84. {
  85. name: "信息点表",
  86. url: "6"
  87. },
  88. {
  89. name: "源文件",
  90. url: '7'
  91. }
  92. ],
  93. selectedIndex: 0,//选中的背景
  94. ceshi: "500px",
  95. modelLeftList: [],//模态框内列表
  96. stationCid: "",
  97. };
  98. },
  99. mounted() {
  100. },
  101. created() {
  102. this.forMesTo()
  103. this.getAllIedLink()
  104. },
  105. methods: {
  106. goUrl(item, index) {
  107. this.selectedIndex = index;
  108. // 执行你的跳转逻辑
  109. },
  110. // 拿到首页左侧站点
  111. async forMesTo() {
  112. let res = await forGround({ pid: "0" })
  113. this.modelLeftList = res.data
  114. },
  115. // 根据站点id拿到站点信息
  116. async getAllIedLink() {
  117. let res = await getscdlist({ ischeckinscd: '1', stationid: "888", pageno: "1" })
  118. this.stationCid = res.data[0].id
  119. this.getIdBy()
  120. },
  121. // 根据站点id拿到站点下列表
  122. async getIdBy() {
  123. let res = await getiedmse({ scd_id: this.stationCid })
  124. this.modelLeftList = res.data
  125. },
  126. // 切换盒子
  127. insideBox(row) {
  128. console.log(row, 'row');
  129. }
  130. },
  131. }
  132. </script>
  133. <style scoped>
  134. /* 模态框内左侧盒子 */
  135. .inBoxLeft {
  136. width: 320px;
  137. height: 530px;
  138. background-color: #F3F5FA;
  139. text-align: center;
  140. overflow-y: auto;
  141. }
  142. .inDetailsBox {
  143. margin-top: 10px;
  144. display: flex;
  145. justify-content: space-around;
  146. }
  147. /* 模态框内表头 */
  148. .detailsTittle {
  149. width: 1400px;
  150. height: 50px;
  151. border-bottom: 1px solid blue;
  152. margin: 0 auto;
  153. text-align: center;
  154. }
  155. /* 名称和信息 */
  156. .leftMes {
  157. margin: 5px 0;
  158. display: flex;
  159. justify-content: flex-start;
  160. align-items: center;
  161. }
  162. .leftMes span {
  163. display: block;
  164. text-align: center;
  165. }
  166. .leftMes span:nth-child(1) {
  167. width: 65px;
  168. margin-right: 20px;
  169. }
  170. .leftMes span:nth-child(2) {
  171. width: 220px;
  172. }
  173. /* 内导航栏 */
  174. .tabCard {
  175. width: 100px;
  176. height: 25px;
  177. margin: 20px 0;
  178. cursor: pointer;
  179. }
  180. .tabCard:hover {
  181. color: skyblue;
  182. }
  183. .active {
  184. width: 100px;
  185. height: 25px;
  186. background-color: blue;
  187. color: white;
  188. border-radius: 20px;
  189. }
  190. /* 内导航栏盒子 */
  191. .navigationBox {
  192. width: 850px;
  193. height: 30px;
  194. border: 1px solid blue;
  195. text-align: center;
  196. line-height: 30px;
  197. border-radius: 20px;
  198. display: flex;
  199. justify-content: space-around;
  200. align-items: center;
  201. }
  202. </style>