edbHistoryDialog.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <!-- ETA1.5.4 将该组件作为一个页面,若上线后无回滚需求可删除 -->
  3. <el-dialog
  4. :visible.sync="isOpenDialog"
  5. :close-on-click-modal="false"
  6. :modal-append-to-body='false'
  7. custom-class="edb-hitory-dialog dialog"
  8. :title="treeData.EdbName"
  9. @close="cancelHandle"
  10. center
  11. width="1200px"
  12. top="5vh"
  13. v-dialogDrag
  14. >
  15. <div class="main">
  16. <vue2-org-tree
  17. :data="treeData"
  18. :props="{
  19. label: 'EdbName',
  20. children: 'Child',
  21. }"
  22. :horizontal="false"
  23. :render-content="renderContent"
  24. @on-node-click="handleClickNode"
  25. />
  26. <!-- @on-node-mouseover="showWholeName"
  27. @on-node-mouseout="hideWholeName" -->
  28. </div>
  29. </el-dialog>
  30. </template>
  31. <script>
  32. import { dataBaseInterface } from '@/api/api.js';
  33. export default {
  34. props: {
  35. isOpenDialog: {
  36. type: Boolean
  37. },
  38. edbId: {
  39. type: Number
  40. }
  41. },
  42. watch: {
  43. isOpenDialog(newval) {
  44. newval&&this.getData()
  45. }
  46. },
  47. data() {
  48. return {
  49. treeData: {}
  50. }
  51. },
  52. methods: {
  53. renderContent(h,data) {
  54. return (
  55. <el-tooltip content={data.RuleTitle} placement='top' popper-class='node-tooltip'>
  56. <span class='node'>{data.EdbName}</span>
  57. </el-tooltip>
  58. )
  59. },
  60. handleClickNode(e,data){
  61. //console.log(data)
  62. //EdbInfoType=1 跳预测指标详情,=0跳指标库详情
  63. const {ClassifyId,UniqueCode,EdbInfoId,EdbInfoType} = data
  64. let {href} = this.$router.resolve({path:EdbInfoType===1?'/predictEdb':'/database',query:{code:UniqueCode,id:EdbInfoId,classifyId:ClassifyId}});
  65. window.open(href,'_blank');
  66. },
  67. async getData() {
  68. const res = await dataBaseInterface.getEdbCreateHistory({EdbInfoId: Number(this.edbId)})
  69. if(res.Ret!==200) return
  70. this.treeData = res.Data;
  71. },
  72. cancelHandle() {
  73. this.$emit('update:isOpenDialog',false)
  74. }
  75. }
  76. }
  77. </script>
  78. <style lang="scss" scoped>
  79. .main {
  80. text-align: center;
  81. }
  82. </style>
  83. <style lang="scss">
  84. .edb-hitory-dialog {
  85. .org-tree-container {
  86. margin: 0 auto;
  87. /* .org-tree-node-label { } */
  88. .org-tree-node-label-inner{
  89. cursor: pointer;
  90. background-color: #F2F6FA;
  91. color: #333333;
  92. padding:20px;
  93. border-radius: 4px;
  94. font-size: 16px;
  95. &:hover{
  96. color:#409EFF;
  97. text-decoration: underline;
  98. }
  99. }
  100. .org-tree{
  101. >.org-tree-node{
  102. >.org-tree-node-label{
  103. .org-tree-node-label-inner{
  104. background-color: #409EFF;
  105. color: white;
  106. }
  107. }
  108. }
  109. }
  110. .org-tree-node-children {
  111. .org-tree-node ~ .org-tree-node{
  112. padding-left: 40px;
  113. }
  114. }
  115. }
  116. .el-dialog__body {
  117. height: 600px;
  118. overflow-y: auto;
  119. }
  120. }
  121. .node-tooltip{
  122. font-size: 14px;
  123. padding:10px;
  124. text-align: center;
  125. }
  126. </style>