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. // console.log(234)
  66. this.getdataTime()
  67. this.gettablist()
  68. // Vue.$forceUpdate();
  69. },
  70. mounted(optio) {
  71. this.tiles = decodeURI(this.getQueryString("titel"))
  72. this.heyseks = decodeURI(this.getQueryString("ntitel"))
  73. this.nue = this.heyseks
  74. // console.log(this.getQueryString("id"))
  75. // this.gettablist()
  76. },
  77. methods:{
  78. gettablist(){
  79. var that = this
  80. $.ajax({
  81. url:'http://118.31.23.65:5001/dev-api/gateway/query/treeselect',
  82. type:'get',
  83. data:'',
  84. dataType:'json',
  85. success:function(res){
  86. console.log(res,765)
  87. if(res.code == 200){
  88. that.tablide = res.data
  89. that.hyew = true
  90. }else{
  91. that.$message({
  92. message: res.msg,
  93. type: 'error'
  94. });
  95. }
  96. console.log(that.tablide,765)
  97. }
  98. })
  99. },
  100. inpubie(){
  101. console.log(this.inpute)
  102. },
  103. nhyesee(){
  104. console.log(this.inpute)
  105. let nhye= this.inpute + ''
  106. // let iyew = JSON.parse(nhye)
  107. // console.log(iyew)
  108. window.location.href = "ss.html?" + encodeURI(nhye)
  109. },
  110. tabcl(val,index){
  111. this.nue = index
  112. if(index == "首页"){
  113. window.location.href="index.html?ntitel=首页"
  114. }
  115. console.log(val,index)
  116. },
  117. jeuese(index){
  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. // console.log(index.label)
  126. // if(index == 25 || index == 26 ||index ==33 || index ==33 || index == 20 || index ==21 || index==24){
  127. // window.location.href="jgjj.html?id=" + index +'&titel=' + val + '&ntitel=' + this.hyesfr
  128. // }else if(index == 32){
  129. // window.location.href="jcfanw.html?id=" + index +'&titel=' + val + '&ntitel=' + this.hyesfr
  130. // }else if(index == 34){
  131. // window.location.href="zzhnl.html?id=" + index +'&titel=' + val + '&ntitel=' + this.hyesfr
  132. // }
  133. // else {
  134. // window.location.href="djdt.html?id=" + index.id +'&titel=' + index.label + '&ntitel=' + this.hyesfr + '&openMode=' + index.openMode
  135. // }
  136. // if(index == 1){
  137. // // this.$router.push('/index.html');
  138. // this.ulrw = index.html
  139. // }else{
  140. // this.ulrw = 'djdt.html?id=' + index
  141. // }
  142. },
  143. dheyfr(val){
  144. console.log(val)
  145. this.hyesfr = val
  146. },
  147. getdataTime(){
  148. let wk = new Date().getDay()
  149. let yy = new Date().getFullYear();
  150. let mm = new Date().getMonth() + 1;
  151. let dd = new Date().getDate();
  152. let weeks = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
  153. this.week = weeks[wk]
  154. this.date_show = yy + "年" + mm + "月" + dd + "日"
  155. },
  156. // 获取路由参数
  157. getQueryString(name) {
  158. try {
  159. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  160. var r = window.location.href.split('?')[1].match(reg);
  161. console.log(reg,r)
  162. if(r != null) {
  163. return r[2];
  164. }
  165. return "";//如果此处只写return;则返回的是undefined
  166. } catch(e) {
  167. return "";//如果此处只写return;则返回的是undefined
  168. }
  169. },
  170. }
  171. })