index.vue 6.7 KB

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