OpcPosition.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <template>
  2. <a-card :bordered="false" v-show="visible" class="card" :title="modalTitle">
  3. <h1 style="margin:20px auto; text-align: center"> DCS车间-数据展示 </h1>
  4. <a-card v-for="position in treeData" :key="position.key" :title="position.title">
  5. <a-card-grid v-for="child in position.children" :key="child.key" style="cursor: pointer;width:25%;text-align:center" @click="showScreen(child, position.key)">
  6. {{ child.title }}
  7. </a-card-grid>
  8. </a-card>
  9. </a-card>
  10. </template>
  11. <script>
  12. import { getSbPositionTree } from '@/api/sb/position'
  13. export default {
  14. name: 'OpcPosition',
  15. components: {
  16. },
  17. data () {
  18. return {
  19. confirmLoading: false,
  20. modalTitle: null,
  21. treeData: [],
  22. visible: true
  23. }
  24. },
  25. props: {
  26. },
  27. created () {
  28. getSbPositionTree({ opcFlag: 1 }).then(res => {
  29. this.treeData = res.data
  30. })
  31. },
  32. methods: {
  33. showScreen (position, parentId) {
  34. const a = document.createElement('a')
  35. a.href = '/opc?line=' + position.key + '&parentId=' + parentId
  36. a.target = '_blank'
  37. a.click()
  38. }
  39. }
  40. }
  41. </script>