ss.html 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  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.releaseTime||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. if(rou.releaseTime){
  189. rou.times = rou.releaseTime.slice(0,10).split('-')[1]
  190. }else{
  191. rou.times = rou.createTime.slice(0,10).split('-')[1]
  192. }
  193. // console.log(rou.createTime.slice(0,10).split('-')[1])
  194. if(rou.newsTitle !== null){
  195. rou.newsTitle = that.hfeys(rou.newsTitle)
  196. }
  197. if(rou.newsContent !== null){
  198. rou.newsContent = that.hfeys(rou.newsContent)
  199. }
  200. // console.log(rou.newsTitle)
  201. })
  202. }else{
  203. hyews=[{newsTitle:'暂无数据',newsContent:'暂无数据',createTime:'暂无数据'}]
  204. res.rows = hyews
  205. }
  206. that.newsleisL = res.rows
  207. that.total = res.total
  208. if(that.total>0){
  209. that.nhyuese = true
  210. }else{
  211. that.nhyuese = false
  212. }
  213. // that.hyew = true
  214. }else{
  215. that.$message({
  216. message: res.msg,
  217. type: 'error'
  218. });
  219. }
  220. }
  221. })
  222. },
  223. gettablist(){
  224. var that = this
  225. $.ajax({
  226. url:'https://jyzx.qs163.cn/prod-api/gateway/query/treeselect',
  227. type:'get',
  228. data:'',
  229. dataType:'json',
  230. success:function(res){
  231. if(res.code == 200){
  232. that.tablide = res.data
  233. that.hyew = true
  234. }else{
  235. that.$message({
  236. message: res.msg,
  237. type: 'error'
  238. });
  239. }
  240. }
  241. })
  242. },
  243. inpubie(){
  244. },
  245. nhyesee(){
  246. this.valdes.newsTitle = this.inpute
  247. this.gettablists(this.valdes)
  248. },
  249. tabcl(index,val){
  250. this.nue = index
  251. if(val == "首页"){
  252. window.location.href = "index.html?ntitel=首页"
  253. }
  254. },
  255. jeuese(index,val){
  256. // console.log(index)
  257. if(index.label=='报告查询'){
  258. window.location.href="bgcx.html"
  259. }else if(index.label=='网上送检'){
  260. window.location.href="wshsj.html"
  261. }else{
  262. window.location.href="djdt.html?id=" + index.id +'&titel=' + index.label + '&ntitel=' + this.hyesfr + '&openMode=' + index.openMode
  263. }
  264. // window.location.href="djdt.html?id=" + index.id +'&titel=' + index.label + '&ntitel=' + this.hyesfr + '&openMode=' + index.openMode
  265. },
  266. dheyfr(val){
  267. this.hyesfr = val
  268. },
  269. // 获取路由参数
  270. getQueryString(name) {
  271. try {
  272. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  273. var r = window.location.href.split('?')[1].match(reg);
  274. if(r != null) {
  275. return r[2];
  276. }
  277. return "";//如果此处只写return;则返回的是undefined
  278. } catch(e) {
  279. return "";//如果此处只写return;则返回的是undefined
  280. }
  281. },
  282. hfeys(nju){
  283. var that = this
  284. if (that.valdes.newsTitle && that.valdes.newsTitle.length > 0) {
  285. // 匹配关键字正则
  286. let replaceReg = new RegExp(that.valdes.newsTitle, 'g');
  287. // 高亮替换v-html值
  288. let replaceString = '<span style="color:#007bff">' + that.valdes.newsTitle + '</span>';
  289. // 开始替换
  290. nju = nju.replace(replaceReg, replaceString);
  291. }
  292. return nju
  293. },
  294. handleSizeChange(){
  295. },
  296. handleCurrentChange(){
  297. this.valdes.pageNum = val
  298. this.gettablists(this.valdes)
  299. }
  300. }
  301. })
  302. </script>
  303. <!--移动'vendor'目录后,注意修改'vendor\vendor.js'内引用文件的'src'路径以匹配该html-->
  304. <script src="static/js/footer.js" type="text/javascript" charset="utf-8"></script>
  305. <script src="./vendor/vendor.js"></script>
  306. <script src="static/js/script.js"></script>
  307. <script src="static/js/custom.js"></script>
  308. <script>
  309. $(document).ready(function() {
  310. $(".pleft a").click(function(){
  311. $(this).addClass('act')
  312. $(this).parent().siblings().find('a').removeClass('act')
  313. })
  314. });
  315. </script>
  316. </html>