QingXiCheAndQvProcessEvent.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <script setup>
  2. import { QingXiCheAndQvProcessEventStore } from "../event/store/QingXiCheAndQvProcessEventStore.js";
  3. import { computed, onMounted, onUnmounted, ref, watch } from "vue";
  4. // 监听某个参数发生变化
  5. watch(
  6. () => QingXiCheAndQvProcessEventStore().obj.downTime,
  7. (newVal, oldVal) => {
  8. console.log("触发组件的UI下一步逻辑");
  9. downEvent();
  10. }
  11. )
  12. // 定义发射给父组件的方法
  13. const emits = defineEmits([
  14. // 实时回调当前对话的内容
  15. 'callbackProcess',
  16. ]);
  17. /**
  18. * 回调接下来的进度
  19. * type up - 上一步, down - 下一步
  20. * json 返回的参数, 如果是 null ,说明不触发生成
  21. */
  22. const callbackProcessEvent = (type, json) => {
  23. emits('callbackProcess', {
  24. "type" : type,
  25. "config" : json,
  26. });
  27. }
  28. /**
  29. * 下一步逻辑触发
  30. */
  31. const downEvent = () => {
  32. QingXiCheAndQvProcessEventStore().obj.listIndex += 1;
  33. // 说明执行到最后一步了
  34. if (QingXiCheAndQvProcessEventStore().obj.listIndex >= QingXiCheAndQvProcessEventStore().obj.list.length) {
  35. QingXiCheAndQvProcessEventStore().obj.listIndex -= 1;
  36. return;
  37. }
  38. QingXiCheAndQvProcessEventStore().obj.btnUp = false;
  39. QingXiCheAndQvProcessEventStore().obj.btnDown = false;
  40. let thisJson = QingXiCheAndQvProcessEventStore().obj.list[QingXiCheAndQvProcessEventStore().obj.listIndex];
  41. callbackProcessEvent("down", thisJson);
  42. // console.log("下一步", thisJson);
  43. }
  44. </script>
  45. <template>
  46. <div class="ProcessEvent">
  47. <img class="role" src="../../../assets/res/img/main/processEvent/role.png" />
  48. <div
  49. v-if="
  50. QingXiCheAndQvProcessEventStore().obj.list[QingXiCheAndQvProcessEventStore().obj.listIndex] != null
  51. && QingXiCheAndQvProcessEventStore().obj.list[QingXiCheAndQvProcessEventStore().obj.listIndex] != undefined
  52. "
  53. class="main">
  54. <div class="txt">{{ QingXiCheAndQvProcessEventStore().obj.list[QingXiCheAndQvProcessEventStore().obj.listIndex].note }}</div>
  55. <div class="comBtn" v-show="QingXiCheAndQvProcessEventStore().obj.btnUp == true" >上一步</div>
  56. <div class="comBtn" v-show="QingXiCheAndQvProcessEventStore().obj.btnDown == true" v-on:click="downEvent()" >下一步</div>
  57. <img class="downPrompt" v-show="QingXiCheAndQvProcessEventStore().obj.btnDown == true"
  58. src="../../../assets/res/img/main/processEvent/prompt.png" />
  59. </div>
  60. </div>
  61. </template>
  62. <style lang="less" scoped>
  63. .ProcessEvent * {
  64. -moz-user-select: none;
  65. -webkit-user-select: none;
  66. -ms-user-select: none;
  67. -khtml-user-select: none;
  68. user-select: none;
  69. }
  70. .ProcessEvent {
  71. position: fixed;
  72. top: 0px;
  73. right: 0px;
  74. width: 0px;
  75. height: 0px;
  76. .role {
  77. position: relative;
  78. width: 6.42rem;
  79. position: fixed;
  80. left: 5rem;
  81. bottom: 5rem;
  82. z-index: 31;
  83. }
  84. .main {
  85. position: fixed;
  86. z-index: 30;
  87. width: 100%;
  88. height: 4.285rem;
  89. // background: linear-gradient(86deg, #3a649642, #3a6496 17%, #3a6496 59%, #3a649600 90%);
  90. background: linear-gradient(90deg, rgba(58, 150, 136, 0.26) 0.01%, #3A9688 19.06%, #3A9688 65.77%, rgba(58, 150, 136, 0) 100%);
  91. padding: 0px 0px 0px 13rem;
  92. bottom: 5rem;
  93. left: 0px;
  94. float: left;
  95. .txt {
  96. height: 4.285rem;
  97. line-height: 4.285rem;
  98. font-size: 1.5rem;
  99. color: #ffffff;
  100. font-weight: 500;
  101. margin: 0px 0.71rem 0px 0.71rem;
  102. float: left;
  103. }
  104. .comBtn {
  105. margin: 0.75rem;
  106. font-size: 1.3rem;
  107. // background-color: #3583d1;
  108. background-color: #49DC9E;
  109. color: #ffffff;
  110. padding: 0.35rem 2rem 0.35rem 2rem;
  111. border-radius: 0.35rem;
  112. // 手势
  113. cursor:pointer;
  114. float: left;
  115. }
  116. .downPrompt {
  117. width: 7.14rem;
  118. position: relative;
  119. left: -8rem;
  120. top: -7rem;
  121. }
  122. }
  123. }
  124. </style>