index.html 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7. <title>应急突发事件保障</title>
  8. <link rel="stylesheet" href="/static/bootstrap-3.3.7/css/bootstrap.min.css">
  9. </head>
  10. <body>
  11. <div class="container" id="vueapp">
  12. <h2 class="text-center">{$info['title']}</h2>
  13. <h4>开始时间:{$info['create_time']}</h4>
  14. <div v-for="(item,index) in question" :key="index" style="overflow: hidden;height: auto;">
  15. <div v-if="item.status == 0" class="panel panel-default">
  16. <div class="panel-heading">
  17. <h3 class="panel-title">
  18. 步骤{{index + 1}}:{{item.title}} (响应时间{{item.time}}分钟)
  19. <span v-if="item.status == 0" class="pull-right">未开始</span>
  20. <span v-if="item.status == 1" class="pull-right">进行中</span>
  21. <span v-if="item.status == 2" class="pull-right">已结束</span>
  22. </h3>
  23. </div>
  24. <table class="table">
  25. <tr v-for="(item2,index2) in item.options" :key="index2">
  26. <td v-if="item.status == 2&&item2.status == 0" class="text-danger">{{index2 + 1}}. {{item2.text}}</td>
  27. <td v-else>{{index2 + 1}}. {{item2.text}}</td>
  28. <td v-if="status == 1" style="width: 100px" class="text-center">
  29. <button v-if="item2.status == 0" type="button" class="btn btn-success btn-xs" @click="finish(index,index2)">完成</button>
  30. <span v-if="item2.status == 1">已完成</span>
  31. </td>
  32. <td v-if="status == 2||status == 3" style="width: 100px" class="text-center">
  33. <span v-if="item2.status == 1">已完成</span>
  34. <span v-if="item2.status == 0">未完成</span>
  35. </td>
  36. </tr>
  37. </table>
  38. </div>
  39. <div v-if="item.status == 1" class="panel panel-success">
  40. <div class="panel-heading">
  41. <h3 class="panel-title">
  42. 步骤{{index + 1}}:{{item.title}} (响应时间{{item.time}}分钟)
  43. <span v-if="item.status == 0" class="pull-right">未开始</span>
  44. <span v-if="item.status == 1" class="pull-right">进行中</span>
  45. <span v-if="item.status == 2" class="pull-right">已结束</span>
  46. </h3>
  47. </div>
  48. <table class="table">
  49. <tr v-for="(item2,index2) in item.options" :key="index2">
  50. <td v-if="item.status == 2&&item2.status == 0" class="text-danger">{{index2 + 1}}. {{item2.text}}</td>
  51. <td v-else>{{index2 + 1}}. {{item2.text}}</td>
  52. <td style="width: 100px" class="text-center">
  53. <button v-if="item2.status == 0" type="button" class="btn btn-success btn-xs" @click="finish(index,index2)">完成</button>
  54. <span v-if="item2.status == 1">已完成</span>
  55. </td>
  56. </tr>
  57. </table>
  58. </div>
  59. <div v-if="item.status == 2" class="panel panel-warning">
  60. <div class="panel-heading">
  61. <h3 class="panel-title">
  62. 步骤{{index + 1}}:{{item.title}} (响应时间{{item.time}}分钟)
  63. <span v-if="item.status == 0" class="pull-right">未开始</span>
  64. <span v-if="item.status == 1" class="pull-right">进行中</span>
  65. <span v-if="item.status == 2" class="pull-right">已结束</span>
  66. </h3>
  67. </div>
  68. <table class="table">
  69. <tr v-for="(item2,index2) in item.options" :key="index2">
  70. <td v-if="item.status == 2&&item2.status == 0" class="text-danger">{{index2 + 1}}. {{item2.text}}</td>
  71. <td v-else>{{index2 + 1}}. {{item2.text}}</td>
  72. <td style="width: 100px" class="text-center">
  73. <button v-if="item2.status == 0" type="button" class="btn btn-success btn-xs" @click="finish(index,index2)">完成</button>
  74. <span v-if="item2.status == 1">已完成</span>
  75. </td>
  76. </tr>
  77. </table>
  78. </div>
  79. </div>
  80. </div>
  81. <script src="/static/jquery-1.11.3.min.js"></script>
  82. <script src="/static/layer/layer.js"></script>
  83. <script type="text/javascript" src="/static/elementui2.15.5/vue-2.6.14.js"></script>
  84. <script>
  85. setInterval(function () {
  86. window.location.reload();
  87. },10000);
  88. var question = {$info['content']|raw};
  89. var status = {$info['status']};
  90. var id = {$info['id']};
  91. var vm = new Vue({
  92. el: '#vueapp',
  93. data: {
  94. question: question,
  95. status: status,
  96. id: id,
  97. },
  98. created: function () {
  99. console.log(this.question);
  100. },
  101. methods: {
  102. finish: function (index,index2) {
  103. $.post('{:url("Bursting/finish")}',{id:this.id,index:index,index2:index2},function (res) {
  104. if(res.code == 1){
  105. layer.msg('操作成功',{time:2000},function () {
  106. window.location.reload();
  107. })
  108. }else{
  109. layer.msg(res.msg);
  110. }
  111. });
  112. }
  113. }
  114. })
  115. </script>
  116. </body>
  117. </html>