header.js 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. // document.writeln("<div id = app>");
  2. // document.writeln(" <header>");
  3. // document.writeln(" <div class=\'a\'>");
  4. // document.writeln(" <div class=\'container\'>");
  5. // document.writeln(" <div class=\'tool\'>");
  6. // document.writeln(" <div class=\'fr\'>");
  7. // document.writeln(" <a href=\'\' target=\'_blank\'></a>");
  8. // document.writeln(" ");
  9. // document.writeln(" </div>");
  10. // document.writeln(" ");
  11. // document.writeln(" <!-- <script src=\'static/js/time.js\'></script> -->");
  12. // document.writeln(" <div class=\'loca\'>");
  13. // document.writeln(" <span> 欢迎访问 安徽省刷制品质量监督检验中心 ! 今天{{date_show}} {{week}}</span>");
  14. // document.writeln(" </div>");
  15. // document.writeln(" <div class=\'srch\'><input type=\'text\' class=\'tt\' placeholder=\'输入要查找的信息\' v-model=\'inpute\' @blur=\'inpubie\'/> <img");
  16. // document.writeln(" src=\'static/picture/icon_ztl_ss@2x.png\' @click=\'nhyesee\'> </div>");
  17. // document.writeln(" </div>");
  18. // document.writeln(" </div>");
  19. // document.writeln(" </div>");
  20. // document.writeln(" <div class=\'b\'>");
  21. // document.writeln(" <div class=\'container\'>");
  22. // document.writeln(" <div class=\'logo\'>");
  23. // document.writeln(" <a href=\'javascript:void(0)\'><img src=\'static/picture/pic_hp_dh_logo@2x.png\' alt=\'\' /></a>");
  24. // document.writeln(" </div>");
  25. // document.writeln(" <div class=\'frs fr\' v-if=\'hyew == true\' >");
  26. // document.writeln(" <div class= \'menu _list\'>");
  27. // document.writeln(" <ul>");
  28. // document.writeln(" <li v-for=\'item,index in tablide\' :key=\'index\' @click=\'tabcl(index,item.id)\'>");
  29. // document.writeln(" <div :class=\'[ nue == index ? \'on\' : \'\' , \'i\' ]\'>");
  30. // document.writeln(" <p><a :href=\'ulrw\'>{{item.label}}</a></p>");
  31. // document.writeln(" <div class=\'ex\' v-for=\'(items,indexs) in item.children\' :key=\'indexs + \'y\'\' v-if=\'item.children\' @click.stop=\'jeuese(items.id)\'>");
  32. // document.writeln(" <p><a :href=\'ulrw\'>{{items.label}}</a></p>");
  33. // document.writeln(" <!-- jggk.html -->");
  34. // document.writeln(" <!-- <p><a href=\'zzhjg.html\'>组织架构</a></p> -->");
  35. // document.writeln(" </div>");
  36. // document.writeln(" </div>");
  37. // document.writeln(" </li>");
  38. // document.writeln(" ");
  39. // document.writeln(" </ul>");
  40. // document.writeln(" </div>");
  41. // document.writeln(" </div>");
  42. // document.writeln(" <a href=\'\' class=\'mbtn pc-hide\'></a>");
  43. // document.writeln(" </div>");
  44. // document.writeln(" </div>");
  45. // document.writeln(" </header>");
  46. // document.writeln(" </div>");
  47. // <script type="text/javascript">
  48. var app = new Vue({
  49. el: '#appse',
  50. data: {
  51. message: 'Hello Vue!',
  52. inpute:'',
  53. tablide:[],
  54. hyew:false,
  55. nue:"首页",
  56. week:'',
  57. date_show:'',
  58. ulrw:'',
  59. mjuede:'',
  60. hyesfr:'',
  61. tiles:'',
  62. heyseks:'',
  63. },
  64. created() {
  65. this.getdataTime()
  66. this.gettablist()
  67. // Vue.$forceUpdate();
  68. },
  69. mounted(optio) {
  70. this.tiles = decodeURI(this.getQueryString("titel"))
  71. this.heyseks = decodeURI(this.getQueryString("ntitel"))
  72. this.nue = this.heyseks
  73. // console.log(this.getQueryString("id"))
  74. // this.gettablist()
  75. },
  76. methods:{
  77. gettablist(){
  78. var that = this
  79. $.ajax({
  80. url:'https://jyzx.qs163.cn/prod-api/gateway/query/treeselect',
  81. type:'get',
  82. data:'',
  83. dataType:'json',
  84. success:function(res){
  85. // console.log(res,765)
  86. if(res.code == 200){
  87. that.tablide = res.data
  88. that.hyew = true
  89. }else{
  90. that.$message({
  91. message: res.msg,
  92. type: 'error'
  93. });
  94. }
  95. // console.log(that.tablide,765)
  96. }
  97. })
  98. },
  99. inpubie(){
  100. console.log(this.inpute)
  101. },
  102. nhyesee(){
  103. console.log(this.inpute)
  104. let nhye= this.inpute + ''
  105. // let iyew = JSON.parse(nhye)
  106. // console.log(iyew)
  107. window.location.href = "ss.html?" + encodeURI(nhye)
  108. },
  109. tabcl(val,index){
  110. this.nue = index
  111. if(index == "首页"){
  112. window.location.href="index.html?ntitel=首页"
  113. }
  114. // console.log(val,index)
  115. },
  116. jeuese(index){
  117. // console.log(index.label)
  118. if(index.label=='报告查询'){
  119. window.location.href="bgcx.html"
  120. }else if(index.label=='送检登记'){
  121. window.location.href="wshsj.html"
  122. }else{
  123. window.location.href="djdt.html?id=" + index.id +'&titel=' + index.label + '&ntitel=' + this.hyesfr + '&openMode=' + index.openMode
  124. }
  125. // if(index == 25 || index == 26 ||index ==33 || index ==33 || index == 20 || index ==21 || index==24){
  126. // window.location.href="jgjj.html?id=" + index +'&titel=' + val + '&ntitel=' + this.hyesfr
  127. // }else if(index == 32){
  128. // window.location.href="jcfanw.html?id=" + index +'&titel=' + val + '&ntitel=' + this.hyesfr
  129. // }else if(index == 34){
  130. // window.location.href="zzhnl.html?id=" + index +'&titel=' + val + '&ntitel=' + this.hyesfr
  131. // }
  132. // else {
  133. // window.location.href="djdt.html?id=" + index.id +'&titel=' + index.label + '&ntitel=' + this.hyesfr + '&openMode=' + index.openMode
  134. // }
  135. // if(index == 1){
  136. // // this.$router.push('/index.html');
  137. // this.ulrw = index.html
  138. // }else{
  139. // this.ulrw = 'djdt.html?id=' + index
  140. // }
  141. },
  142. dheyfr(val){
  143. // console.log(val)
  144. this.hyesfr = val
  145. },
  146. getdataTime(){
  147. let wk = new Date().getDay()
  148. let yy = new Date().getFullYear();
  149. let mm = new Date().getMonth() + 1;
  150. let dd = new Date().getDate();
  151. let weeks = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
  152. this.week = weeks[wk]
  153. this.date_show = yy + "年" + mm + "月" + dd + "日"
  154. },
  155. // 获取路由参数
  156. getQueryString(name) {
  157. try {
  158. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  159. var r = window.location.href.split('?')[1].match(reg);
  160. // console.log(reg,r)
  161. if(r != null) {
  162. return r[2];
  163. }
  164. return "";//如果此处只写return;则返回的是undefined
  165. } catch(e) {
  166. return "";//如果此处只写return;则返回的是undefined
  167. }
  168. },
  169. }
  170. })