select_result.blade.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. @extends('module.layouts.content')
  2. @push('meta')
  3. @endpush
  4. @push('css')
  5. <style >
  6. .operation{
  7. width: 100%;
  8. float: left;
  9. text-align: center;
  10. margin-top: 30px;
  11. }
  12. .result {
  13. width: 60%;
  14. float: left;
  15. margin: 20px 0 0;
  16. border: 1px solid #ccc;
  17. }
  18. .tips{
  19. float: right;
  20. width: 35%;
  21. margin: 20px 0 0;
  22. border: 1px solid #ccc;
  23. }
  24. h3{
  25. width: 100%;
  26. text-align: center;
  27. line-height: 40px;
  28. }
  29. .process{
  30. margin-top: 20px;
  31. width: 100%;
  32. float: left;
  33. text-align: center;
  34. font-size: 30px;
  35. color: #30B08F;
  36. }
  37. .area-row{
  38. line-height: 60px;
  39. border-top: 1px solid #ccc;
  40. display: flex;
  41. }
  42. .area-row div{
  43. flex: 1;
  44. text-align: center;
  45. font-size: 30px;
  46. }
  47. .area-row .area-name{
  48. font-size: 20px;
  49. }
  50. .area-row .area-value{
  51. color: #30B08F;
  52. transition: all 2s ease-in;
  53. }
  54. </style>
  55. @endpush
  56. @push('js')
  57. <link href="{{ theme_asset('app/css/common.css') }}" rel="stylesheet">
  58. <link href="{{theme_asset('app/css/recruit/recruit.css')}}" rel="stylesheet" type="text/css"/>
  59. <link rel="stylesheet" href="{{ theme_asset('app/css/element.css') }}">
  60. @endpush
  61. @section('content')
  62. <div id="app">
  63. <div class="recruit_container clearfix">
  64. <div class="recruit_show_content" style="margin-top: 10px;width: 100%">
  65. <div class="title" style="text-align: center"><h2>晋江市公开招聘第十三批村务(社区)专职工作者择岗系统</h2></div>
  66. <div class="clearfix">
  67. <div class="operation">
  68. <el-button type="primary" @click="getResult()" :disabled="disabled" v-text="start_button"></el-button>
  69. <el-button type="primary" @click="test()">测试</el-button>
  70. </div>
  71. <div class="process clearfix" ref="process" v-if="init">
  72. 择岗进度:<count-to ref='count' class='count' :start-val=startval :end-val=endval :duration=4000></count-to>/<span class="count" v-text="count"></span>
  73. </div>
  74. <div class="result">
  75. <h3>择岗结果</h3>
  76. <el-divider></el-divider>
  77. <el-table :data="result" style="width: 100%">
  78. <el-table-column
  79. prop="realname"
  80. label="姓名"
  81. width="100"
  82. align="center">
  83. </el-table-column>
  84. <el-table-column
  85. prop="ex_number"
  86. label="准考证号"
  87. width="150"
  88. align="center">
  89. </el-table-column>
  90. <el-table-column
  91. prop="select_result"
  92. label="择岗结果"
  93. width="100"
  94. align="center">
  95. </el-table-column>
  96. <el-table-column
  97. prop="result"
  98. label="择岗意愿"
  99. align="center">
  100. </el-table-column>
  101. </el-table>
  102. </div>
  103. <div class="tips" ref="tips">
  104. <h3>各镇街剩余名额</h3>
  105. {{-- <el-table--}}
  106. {{-- :data="quota"--}}
  107. {{-- style="width: 100%">--}}
  108. {{-- <el-table-column--}}
  109. {{-- prop="name"--}}
  110. {{-- label="地区"--}}
  111. {{-- align="center">--}}
  112. {{-- </el-table-column>--}}
  113. {{-- <el-table-column--}}
  114. {{-- prop="value"--}}
  115. {{-- label="剩余名额"--}}
  116. {{-- width="180"--}}
  117. {{-- align="center">--}}
  118. {{-- </el-table-column>--}}
  119. {{-- </el-table>--}}
  120. <div v-for="(item, index) in quota" class="area-row clearfix">
  121. <div class="area-name">
  122. @{{ item.name }}
  123. </div>
  124. <div class="area-value" :ref="'area_'+index">
  125. <count-to class='count' :start-val=item.old_value :end-val=item.new_value :duration=4000></count-to>
  126. </div>
  127. </div>
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. </div>
  133. @endsection
  134. @section('script')
  135. <script src="{{theme_asset('app/js/vue.min.js')}}"></script>
  136. <script src="{{theme_asset('app/js/qs.min.js')}}"></script>
  137. <script src="{{theme_asset('app/js/axios.js')}}"></script>
  138. <script src="{{theme_asset('app/js/Sortable.min.js')}}"></script>
  139. <script src="{{theme_asset('app/js/vuedraggable.umd.min.js')}}"></script>
  140. <script src="{{theme_asset('app/js/element.js')}}"></script>
  141. <script src="{{theme_asset('app/js/vue-count-to.min.js')}}"></script>
  142. <script>
  143. const app = new Vue({
  144. el: '#app',
  145. data: {
  146. quota:[],
  147. result: [],
  148. post_data: {
  149. limit: 1
  150. },
  151. disabled: false,
  152. start_button: "开始分析择岗结果",
  153. init:false,
  154. startval: 0,
  155. endval: 0,
  156. count: 0
  157. },
  158. methods: {
  159. getResult: function(){
  160. this.disabled = true;
  161. this.start_button = "择岗排序中";
  162. setInterval(this.getSelectResult,2000);
  163. },
  164. getInitInfo: function(){
  165. axios.post("{{route('recruit.select_init')}}").then(response => {
  166. let result = response.data;
  167. if(result.data.count > 0){
  168. this.init = true;
  169. this.count = result.data.count;
  170. let quota = eval(result.data.quota);
  171. for(let i = 0;i < quota.length;i++){
  172. let item = new Object();
  173. item.name = quota[i].name;
  174. item.old_value = quota[i].value;
  175. item.new_value = quota[i].value;
  176. this.quota.push(item)
  177. }
  178. this.result = result.data.list;
  179. //this.quota = eval(result.data.quota);
  180. }
  181. });
  182. },
  183. getSelectResult: function(){
  184. var that = this;
  185. axios.post("{{route('recruit.get_select_result')}}",Qs.stringify(this.post_data)).then(response => {
  186. var result = response.data;
  187. if(result.status){
  188. //加入一条结果记录
  189. this.result.push(result.data.list[0]);
  190. //修改进度结果
  191. this.endval++;
  192. this.$refs.count.start();
  193. this.startval = this.endval;
  194. //名额减
  195. let index = result.data.quota.index;
  196. this.$refs['area_'+index][0].style.background = "#fff611";
  197. var that = this;
  198. setTimeout(function (){
  199. that.$refs['area_'+index][0].style.background = "#fff"
  200. }, 2000);
  201. this.quota[index].old_value = result.data.quota.old_value;
  202. this.quota[index].new_value = result.data.quota.new_value;
  203. }
  204. });
  205. },
  206. handleScroll: function(){
  207. let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
  208. if(scrollTop > 300){
  209. this.$refs.process.style.position = "fixed";
  210. this.$refs.process.style.top = "0";
  211. this.$refs.process.style.background = "#fff666";
  212. this.$refs.process.style.zIndex = "9";
  213. this.$refs.tips.style.position = "fixed";
  214. this.$refs.tips.style.top = "60px";
  215. this.$refs.tips.style.right = "35px";
  216. }else{
  217. this.$refs.process.style.position = "static";
  218. this.$refs.process.style.background = "#fff";
  219. this.$refs.tips.style.position = "static";
  220. }
  221. console.log(scrollTop, '滚动距离')
  222. },
  223. test: function(){
  224. let i = Math.round(Math.random()*19);;
  225. this.$refs['area_'+i][0].style.background = "#fff611"
  226. var that = this;
  227. setTimeout(function (){
  228. that.$refs['area_'+i][0].style.background = "#fff"
  229. }, 2000);
  230. }
  231. },
  232. created(){
  233. this.getInitInfo();
  234. window.addEventListener('scroll', this.handleScroll)
  235. }
  236. })
  237. </script>
  238. @endsection