doWorkArea.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <template>
  2. <div class="doWork">
  3. <div class="dw_header">
  4. <div class="dw_h_left">
  5. <img :src="require('../../../../assets/icon/pblCourse/phaseIcon.png')">
  6. <span>阶段{{ phase.atPhase+1 }}:{{ task?task.name:'' }}</span>
  7. </div>
  8. <div class="dw_h_right">
  9. <span class="dw_h_r_back" @click.stop="back()"></span>
  10. <span class="dw_h_r_down" @click.stop="down()"></span>
  11. </div>
  12. </div>
  13. <div class="dw_work">
  14. <work v-if="task" :task="task" @submitTask="down" @choiceAnswer="choiceAnswer" @getTaskList="getTaskList" :phase="phase" @lookFile="lookFile" @deleteFile="deleteFile" @addFile="addFile"/>
  15. <div v-else>
  16. <h3>等待生成数据...</h3>
  17. </div>
  18. </div>
  19. <!-- <div class="dw_bottom">
  20. <div class="dw_b_btn" @click.stop="submitTask()">
  21. <img :src="require('../../../../assets/icon/pblCourse/bookIcon.png')">
  22. <span>提交作业</span>
  23. </div>
  24. </div> -->
  25. </div>
  26. </template>
  27. <script>
  28. import work from './work'
  29. export default {
  30. emits:["changePhase","choiceAnswer","submitTask","getTaskList","deleteFile","addFile","lookFile"],
  31. props:{
  32. phase:{
  33. type:Object,
  34. default:()=>{
  35. return {
  36. doPhase:0,
  37. atPhase:0,
  38. }
  39. }
  40. },
  41. task:{
  42. type:Object,
  43. require:true,
  44. },
  45. },
  46. computed:{
  47. isOk(){
  48. return !(this.phase.doPhase>this.phase.atPhase)
  49. }
  50. },
  51. components:{
  52. work,
  53. },
  54. methods:{
  55. submitTask(){
  56. this.$emit("submitTask")
  57. },
  58. down(){
  59. if(this.isOk)return this.submitTask();
  60. if(this.phase.atPhase>=4)return this.$message.info("已经是最后一个阶段啦")
  61. this.$emit("changePhase",'atPhase',(this.phase.atPhase+1))
  62. },
  63. back(){
  64. if(this.phase.atPhase<=0)return this.$message.info("已经是第一个阶段啦")
  65. this.$emit("changePhase",'atPhase',(this.phase.atPhase-1))
  66. },
  67. choiceAnswer(arr){
  68. this.$emit("choiceAnswer",arr)
  69. },
  70. getTaskList(_data){
  71. this.$emit("getTaskList",_data)
  72. },
  73. deleteFile(index){
  74. this.$emit("deleteFile",index)
  75. },
  76. lookFile(index){
  77. this.$emit("lookFile",index)
  78. },
  79. addFile(obj){
  80. this.$emit("addFile",obj)
  81. },
  82. }
  83. }
  84. </script>
  85. <style scoped>
  86. .doWork{
  87. width: 100%;
  88. height: 100%;
  89. border-radius: 12px;
  90. overflow: hidden;
  91. background-color: white;
  92. }
  93. .dw_header{
  94. width: 100%;
  95. height: 60px;
  96. background-color: #FFF3EA;
  97. margin-bottom: 15px;
  98. display: flex;
  99. justify-content: space-between;
  100. align-items: center;
  101. box-sizing: border-box;
  102. padding: 0 20px;
  103. }
  104. .dw_h_left{
  105. display: flex;
  106. align-items: center;
  107. }
  108. .dw_h_left>img{
  109. width: 40px;
  110. height: 40px;
  111. margin-right: 10px;
  112. }
  113. .dw_h_left>span{
  114. font-size: 24px;
  115. font-weight: bold;
  116. }
  117. .dw_h_right{
  118. display: flex;
  119. align-items: center;
  120. }
  121. .dw_h_right>span{
  122. display: block;
  123. width: 30px;
  124. height: 30px;
  125. background: url("../../../../assets/icon/pblCourse/backIcon.png") no-repeat;
  126. background-size: 100% 100%;
  127. margin-right: 10px;
  128. margin-left: 5px;
  129. cursor: pointer;
  130. }
  131. .dw_h_r_down{
  132. transform: rotate(180deg);
  133. }
  134. .dw_work{
  135. width: 100%;
  136. /* height: auto; */
  137. height: calc(100% - 60px - 30px);
  138. box-sizing: border-box;
  139. /* margin: 0 15px; */
  140. padding: 0 15px;
  141. border-radius: 8px;
  142. overflow: auto;
  143. /* background-color: #F3F7FD; */
  144. }
  145. .dw_bottom{
  146. margin-top: 15px;
  147. width: 100%;
  148. height: 100px;
  149. display: flex;
  150. justify-content: center;
  151. align-items: center;
  152. box-sizing: border-box;
  153. padding: 0 15px 15px 15px;
  154. }
  155. .dw_b_btn{
  156. width: 100%;
  157. height: 100%;
  158. background-color: #F3F7FD;
  159. border-radius: 8px;
  160. display: flex;
  161. justify-content: center;
  162. align-items: center;
  163. transition: .3s;
  164. cursor: pointer;
  165. }
  166. .dw_b_btn:hover{
  167. background-color: #eaeef5;
  168. }
  169. .dw_b_btn>img{
  170. width: 50px;
  171. height: 50px;
  172. margin-right: 10px;
  173. cursor: pointer;
  174. }
  175. .dw_b_btn>span{
  176. font-size: 22px;
  177. background: linear-gradient(to right, #3673E8, #AD88FD);
  178. -webkit-background-clip: text;
  179. color: transparent;
  180. }
  181. </style>