ss.html 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  1. <!DOCTYPE html>
  2. <html lang="zh">
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta http-equv="X-UA-Compatible" content="IE=edge" />
  6. <!-- <meta name="viewport" content="width=device-width, initial-scale=1" /> -->
  7. <meta name="format-detection" content="telephone=no" />
  8. <title>搜索</title>
  9. <meta name="keywords" content="">
  10. <meta name="description" content="">
  11. <script type="text/javascript" src="./static/js/vue.js"></script>
  12. <script type="text/javascript" src="./static/js/index.js"></script>
  13. <script type="text/javascript" src="./static/js/jquery.min.js"></script>
  14. <script type="text/javascript" src="./static/js/custom.js"></script>
  15. <link rel="stylesheet" href="static/css/theme-chalk/index.css">
  16. <link href="./static/css/vendor.css" rel="stylesheet" />
  17. <link href="./static/css/style.css" rel="stylesheet" />
  18. <link href="./static/css/custom.css" rel="stylesheet" />
  19. <link href="static/css/index.css" rel="stylesheet"/>
  20. <link href="./static/css/printstyle.css" rel="stylesheet"/>
  21. <style>
  22. </style>
  23. </head>
  24. <body class="pcs" style="display: none;">
  25. <div id="app">
  26. <header>
  27. <div class='a'>
  28. <div class='container'>
  29. <div class='tool'>
  30. <div class='fr'>
  31. <a href='' target='_blank'></a>
  32. </div>
  33. <!-- <script src='static/js/time.js'></script> -->
  34. <div class='loca'>
  35. <span> 欢迎访问 刷制品质量监督检验中心 ! 今天{{date_show}} {{week}}</span>
  36. </div>
  37. <div class='srch'><input type='text' class='tt' placeholder='输入要查找的信息' v-model="inpute"
  38. @blur="inpubie" /> <img src='static/picture/icon_ztl_ss@2x.png' @click="nhyesee">
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. <div class='b'>
  44. <div class='container'>
  45. <div class='logo'>
  46. <a href='javascript:void(0)'><img src='static/picture/pic_hp_dh_logo@2x.png' alt='' /></a>
  47. </div>
  48. <div class='frs fr' v-if="hyew == true">
  49. <div class='menu _list'>
  50. <ul>
  51. <li v-for="item,index in tablide" :key="index" @mouseover="dheyfr(item.label)">
  52. <div :class="[ nue == item.label ? 'on' : '' , 'i' ]">
  53. <p @click="tabcl(item.id,item.label)"><a href='javascript:void(0)'>{{item.label}}</a></p>
  54. <!-- ulrw -->
  55. <div class='ex' >
  56. <!-- :class="[inhye]" -->
  57. <!-- ulrw -->
  58. <p > <a href='javascript:void(0)' v-for="(items,indexs) in item.children" :key="items.id"
  59. @click.stop="jeuese(items)" >{{items.label}}</a></p>
  60. <!-- jggk.html -->
  61. <!-- <p><a href='zzhjg.html'>组织架构</a></p> -->
  62. </div>
  63. </div>
  64. </li>
  65. </ul>
  66. </div>
  67. </div>
  68. <a href='' class='mbtn pc-hide'></a>
  69. </div>
  70. </div>
  71. </header>
  72. <main>
  73. <div class="u-fullpart">
  74. <div class="p_container">
  75. <!-- 定位 -->
  76. <!-- <div class="pleft">
  77. <ul>
  78. <li class="pleft_tit">党建工作</li>
  79. <li><a href="#" class="act">党建动态</a></li>
  80. <li><a href="#">党史学习</a></li>
  81. <li><a href="#">党风廉政</a></li>
  82. <li><a href="#">党建风采</a></li>
  83. </ul>
  84. </div> -->
  85. <div class="container">
  86. <div class="u-pagepath">
  87. <p>
  88. <a href="index.html">首页</a>
  89. <i>·</i>
  90. <a href="#">搜索</a>
  91. <!-- <i>·</i>
  92. <a href="党建动态.html">党建动态</a> -->
  93. </p>
  94. </div>
  95. <div class="p_box">
  96. <div class="p_box_tit cf"><p class="fl p_box_titl">搜索结果</p></div>
  97. <div class="pd10 pf_list">
  98. <ul>
  99. <li v-for=" item,index in newsleisL" :key="item.newsId" @click="nhueyfr(item.newsId,item)">
  100. <a href="#" class="cf">
  101. <div class="fl">
  102. <h1 v-html="item.newsTitle"></h1>
  103. <p class="overtwo" v-html="item.newsContent"></p>
  104. </div>
  105. <div class="fr" >
  106. <div class="num" style="margin: 0; margin-left: 60%; margin-bottom: 10px;">{{item.times}}</div>
  107. <div class="day">{{item.createTime}}</div>
  108. </div>
  109. </a>
  110. </li>
  111. </ul>
  112. <!-- 分页 -->
  113. <div class="p_page" v-if="nhyuese" >
  114. <el-pagination
  115. background
  116. layout="prev, pager, next"
  117. @size-change="handleSizeChange"
  118. @current-change="handleCurrentChange"
  119. :total="total">
  120. </el-pagination>
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. <!-- 分割 -->
  128. <!-- <div class="foot_line"></div> -->
  129. </main>
  130. </div>
  131. </body>
  132. <!-- <script type="text/javascript" src="static/js/header.js"></script> -->
  133. <script type="text/javascript">
  134. var app = new Vue({
  135. el: '#app',
  136. data: {
  137. message: 'Hello Vue!',
  138. inpute:'',
  139. tablide:[],
  140. hyew:false,
  141. nue:0,
  142. week:'',
  143. date_show:'',
  144. ulrw:'',
  145. mjuede:'',
  146. valdes:{pageNum:1,pageSize:10},
  147. newsleisL:[],
  148. total:0,
  149. nhyuese:true
  150. },
  151. created() {
  152. // this.getdataTime()
  153. this.gettablist()
  154. // Vue.$forceUpdate();
  155. },
  156. mounted() {
  157. // console.log(this.getQueryString("id") == '')
  158. let search = location.search;
  159. let arrd = search.split("?");
  160. // console.log(decodeURI(arrd[1]));//学历
  161. if(arrd !== ''){
  162. this.valdes.newsTitle = decodeURI(arrd[1])
  163. }
  164. // console.log(this.getQueryString("title"))
  165. // console.log(this.valdes)
  166. this.gettablists(this.valdes)
  167. },
  168. methods:{
  169. // 跳转详情页面
  170. nhueyfr(index,e){
  171. if(e&&e.reprintUrl){
  172. window.location.href=e.reprintUrl
  173. }else if(e&&index){
  174. window.location.href="jgjj.html?id=" + index
  175. }
  176. },
  177. gettablists(val){
  178. var that = this
  179. $.ajax({
  180. url:'https://jyzx.qs163.cn/prod-api/gateway/query/getNewS',
  181. type:'post',
  182. data:val,
  183. dataType:'json',
  184. success:function(res){
  185. if(res.code == 200){
  186. if(res.rows.length !== 0){
  187. res.rows.filter(rou =>{
  188. rou.times = rou.createTime.slice(0,10).split('-')[1]
  189. // console.log(rou.createTime.slice(0,10).split('-')[1])
  190. if(rou.newsTitle !== null){
  191. rou.newsTitle = that.hfeys(rou.newsTitle)
  192. }
  193. if(rou.newsContent !== null){
  194. rou.newsContent = that.hfeys(rou.newsContent)
  195. }
  196. // console.log(rou.newsTitle)
  197. })
  198. }else{
  199. hyews=[{newsTitle:'暂无数据',newsContent:'暂无数据',createTime:'暂无数据'}]
  200. res.rows = hyews
  201. }
  202. that.newsleisL = res.rows
  203. that.total = res.total
  204. if(that.total>0){
  205. that.nhyuese = true
  206. }else{
  207. that.nhyuese = false
  208. }
  209. // that.hyew = true
  210. }else{
  211. that.$message({
  212. message: res.msg,
  213. type: 'error'
  214. });
  215. }
  216. }
  217. })
  218. },
  219. gettablist(){
  220. var that = this
  221. $.ajax({
  222. url:'https://jyzx.qs163.cn/prod-api/gateway/query/treeselect',
  223. type:'get',
  224. data:'',
  225. dataType:'json',
  226. success:function(res){
  227. if(res.code == 200){
  228. that.tablide = res.data
  229. that.hyew = true
  230. }else{
  231. that.$message({
  232. message: res.msg,
  233. type: 'error'
  234. });
  235. }
  236. }
  237. })
  238. },
  239. inpubie(){
  240. },
  241. nhyesee(){
  242. this.valdes.newsTitle = this.inpute
  243. this.gettablists(this.valdes)
  244. },
  245. tabcl(index,val){
  246. this.nue = index
  247. if(val == "首页"){
  248. window.location.href = "index.html?ntitel=首页"
  249. }
  250. },
  251. jeuese(index,val){
  252. // console.log(index)
  253. if(index.label=='报告查询'){
  254. window.location.href="bgcx.html"
  255. }else if(index.label=='网上送检'){
  256. window.location.href="wshsj.html"
  257. }else{
  258. window.location.href="djdt.html?id=" + index.id +'&titel=' + index.label + '&ntitel=' + this.hyesfr + '&openMode=' + index.openMode
  259. }
  260. // window.location.href="djdt.html?id=" + index.id +'&titel=' + index.label + '&ntitel=' + this.hyesfr + '&openMode=' + index.openMode
  261. },
  262. dheyfr(val){
  263. this.hyesfr = val
  264. },
  265. // 获取路由参数
  266. getQueryString(name) {
  267. try {
  268. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  269. var r = window.location.href.split('?')[1].match(reg);
  270. if(r != null) {
  271. return r[2];
  272. }
  273. return "";//如果此处只写return;则返回的是undefined
  274. } catch(e) {
  275. return "";//如果此处只写return;则返回的是undefined
  276. }
  277. },
  278. hfeys(nju){
  279. var that = this
  280. if (that.valdes.newsTitle && that.valdes.newsTitle.length > 0) {
  281. // 匹配关键字正则
  282. let replaceReg = new RegExp(that.valdes.newsTitle, 'g');
  283. // 高亮替换v-html值
  284. let replaceString = '<span style="color:#007bff">' + that.valdes.newsTitle + '</span>';
  285. // 开始替换
  286. nju = nju.replace(replaceReg, replaceString);
  287. }
  288. return nju
  289. },
  290. handleSizeChange(){
  291. },
  292. handleCurrentChange(){
  293. this.valdes.pageNum = val
  294. this.gettablists(this.valdes)
  295. }
  296. }
  297. })
  298. </script>
  299. <!--移动'vendor'目录后,注意修改'vendor\vendor.js'内引用文件的'src'路径以匹配该html-->
  300. <script src="static/js/footer.js" type="text/javascript" charset="utf-8"></script>
  301. <script src="./vendor/vendor.js"></script>
  302. <script src="static/js/script.js"></script>
  303. <script src="static/js/custom.js"></script>
  304. <script>
  305. $(document).ready(function() {
  306. $(".pleft a").click(function(){
  307. $(this).addClass('act')
  308. $(this).parent().siblings().find('a').removeClass('act')
  309. })
  310. });
  311. </script>
  312. </html>