accessPageNodeBtn.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <template>
  2. <div class="accessPageNodeBtn" :class="['accessPageNodeBtn'+nodeItem.algorithmlibraryid+'']">
  3. <template v-if="!nodeItem.startid && !nodeItem.endid">
  4. <div class="accessPageNodeBtn-txt">
  5. <el-button @click="handleEdit" round>{{ nodeTxt }}</el-button>
  6. </div>
  7. <div v-if="isLine" class="accessPageNodeBtn-line">
  8. <div @click="handleAdd" class="accessPageNodeBtn-line-add">
  9. <i class="el-icon-circle-plus"></i>
  10. </div>
  11. <div v-if="isDel" @click="handleDel" class="accessPageNodeBtn-line-del">
  12. <i class="el-icon-error"></i>
  13. </div>
  14. </div>
  15. <div class="accessPageNodeBtn-sck">
  16. <i class="el-icon-caret-bottom"></i>
  17. </div>
  18. </template>
  19. <template v-else>
  20. <data-line :node-item="nodeItem" @handleEdit="handleEdit" @handleDel="handleDel" />
  21. </template>
  22. </div>
  23. </template>
  24. <script>
  25. import PublicPageDialog from '@/components/PublicPageDialog'
  26. import dataLine from './accessPageNodeLine.vue'
  27. export default {
  28. name: 'AccessPageNodeBtn',
  29. components: { PublicPageDialog, dataLine },
  30. props: {
  31. nodeTxt: {
  32. type: String,
  33. default: '开始'
  34. },
  35. nodeIndex: {
  36. type: Number,
  37. default: 0
  38. },
  39. nodeItem: {
  40. type: Object,
  41. default: () => new Object()
  42. },
  43. isLine: {
  44. type: Boolean,
  45. default: true
  46. },
  47. isDel: {
  48. type: Boolean,
  49. default: true
  50. }
  51. },
  52. data () {
  53. return {
  54. }
  55. },
  56. methods: {
  57. handleAdd () {
  58. this.$emit('handleAdd', { flag: true, index: this.nodeIndex })
  59. },
  60. handleDel () {
  61. this.$emit('handleDel', this.nodeItem)
  62. },
  63. handleEdit () {
  64. this.$emit('handleEdit', this.nodeItem)
  65. }
  66. }
  67. }
  68. </script>
  69. <style lang="scss" scoped>
  70. .accessPageNodeBtn {
  71. position: relative;
  72. &-txt {
  73. margin-bottom: 76px;
  74. }
  75. &-line {
  76. position: absolute;
  77. width: 2px;
  78. height: 74px;
  79. z-index: 1;
  80. background-color: #dcdfe6;
  81. top: 46px;
  82. left: calc(50% - 1px);
  83. &-add {
  84. position: absolute;
  85. top: 26px;
  86. left: -48px;
  87. font-size: 24px;
  88. cursor: pointer;
  89. color: #ccc;
  90. transition: all 0.3s;
  91. &:hover {
  92. color: #66b1ff;
  93. }
  94. }
  95. &-del {
  96. position: absolute;
  97. top: 26px;
  98. left: 26px;
  99. font-size: 24px;
  100. cursor: pointer;
  101. color: #ccc;
  102. transition: all 0.3s;
  103. &:hover {
  104. color: rgb(243, 37, 9);
  105. }
  106. }
  107. }
  108. &-sck {
  109. text-align: center;
  110. color: #dcdfe6;
  111. font-size: 16px;
  112. }
  113. }
  114. </style>