index.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <template>
  2. <div ref="pointStep" class="h100 saga-maintenance">
  3. <!-- <bread class="bread-view"></bread> -->
  4. <div class="saga-btns-view">
  5. <template v-for="(item,index) in jsonTitle">
  6. <div
  7. :key="index"
  8. @click="changeStep(index)"
  9. class="saga-steps-btn pointer saga-size3"
  10. >
  11. <div class="border-view">
  12. <div class="point-step">{{index + 1}}</div>
  13. <div class="jiao"></div>
  14. <div class="point-title">{{item}}</div>
  15. </div>
  16. </div>
  17. </template>
  18. </div>
  19. <div class="main-view">
  20. <step1 ref="step" v-if="activeStep == 1"></step1>
  21. <step2 ref="step" v-if="activeStep == 2"></step2>
  22. <step3 ref="step" v-if="activeStep == 3"></step3>
  23. <step4 ref="step" v-if="activeStep == 4"></step4>
  24. </div>
  25. </div>
  26. </template>
  27. <script>
  28. // import bread from "components/common/bread_crumb"
  29. import step1 from "./step1"
  30. import step2 from "./step2"
  31. import step3 from "./step3"
  32. import step4 from "./step4"
  33. export default {
  34. data() {
  35. return {
  36. activeStep: 1, //活跃的step
  37. jsonTitle: [
  38. "原始点位表收集", "原始点位描述关键内同识别", "原始点位描述标准化", "点位表处理结果检查"
  39. ],
  40. activeHeight: 0
  41. }
  42. },
  43. created() {},
  44. mounted() {
  45. // console.log(this.$refs.pointStep.parentElement.parentElement.offsetHeight,'pointStep')
  46. this.resize()
  47. // document.addEventListener("resize",this.resize)
  48. window.onresize = this.resize
  49. },
  50. methods: {
  51. resize() {
  52. console.log(222)
  53. this.activeHeight = this.$refs.pointStep.parentElement.parentElement.parentElement.offsetHeight - 10
  54. },
  55. stepClick() {
  56. console.log("test")
  57. },
  58. changeStep(index) {
  59. console.log()
  60. let step = this.$refs.step
  61. let flag = step.hasOwnProperty('noSaveData') ? step.noSaveData() : false
  62. if (flag || this.activeStep == 4 || this.activeStep == 3) {
  63. this.activeStep = index + 1
  64. } else {
  65. this.$confirm('存在数据未保存, 是否继续?', '提示', {
  66. confirmButtonText: '确定',
  67. cancelButtonText: '取消',
  68. type: 'warning'
  69. }).then(() => {
  70. this.activeStep = index + 1
  71. }).catch(() => {
  72. return false
  73. });
  74. }
  75. }
  76. },
  77. components: {
  78. // bread,
  79. step1,
  80. step2,
  81. step3,
  82. step4
  83. },
  84. }
  85. </script>
  86. <style lang="scss">
  87. .h100 {
  88. background-color: #fff;
  89. padding: 0 10px;
  90. box-sizing: border-box;
  91. display: flex;
  92. flex-flow: column;
  93. .bread-view {
  94. height: 45px;
  95. }
  96. .main-view {
  97. flex: 1;
  98. display: flex;
  99. flex-flow: column;
  100. }
  101. .saga-btns-view {
  102. background-color: #fff;
  103. display: flex;
  104. justify-content: space-around;
  105. padding: 20px 0;
  106. box-sizing: border-box;
  107. height: 80px;
  108. .saga-steps-btn {
  109. height: 40px;
  110. background: #EEFAFF;
  111. box-shadow: 0 0 2px 0 #DDD;
  112. border-radius: 6px;
  113. font-size: 14px;
  114. line-height: 40px;
  115. color: #666;
  116. box-sizing: border-box;
  117. .border-view {
  118. border: 1px solid #C2CEDB;
  119. border-radius: 6px;
  120. height: 34px;
  121. line-height: 34px;
  122. overflow: hidden;
  123. margin: 2px 5px;
  124. box-sizing: border-box;
  125. position: relative;
  126. flex: 1;
  127. .jiao{
  128. display: inline-block;
  129. border-top: 17px solid transparent;
  130. border-left: 17px solid #C2CEDB;
  131. border-bottom: 17px solid transparent;
  132. position: relative;
  133. float: left;
  134. &::after{
  135. content: '';
  136. position: absolute;
  137. top: -17px;
  138. left: -18px;
  139. border-top: 17px solid transparent;
  140. border-left: 17px solid #EEFAFF;
  141. border-bottom: 17px solid transparent;
  142. }
  143. }
  144. .point-step {
  145. font-size: 24px;
  146. padding: 0 9px;
  147. float: left;
  148. }
  149. .point-title{
  150. float: left;
  151. padding-left: 10px;
  152. padding-right: 22px;
  153. width: 168px;
  154. }
  155. } // height: 80px;
  156. // text-align: center;
  157. // /*设置文本水平居中*/
  158. // display: table-cell;
  159. // vertical-align: middle;
  160. // padding: 0 30px;
  161. }
  162. }
  163. }
  164. </style>