移动端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

256 lines
6.5 KiB

  1. <template>
  2. <div class="app-container">
  3. <div class="header_main">
  4. 执法依据
  5. <div class="return_btn" @click="onClickLeftIndex"></div>
  6. </div>
  7. <div class="jg"></div>
  8. <div class="search_box">
  9. <van-popover
  10. v-model="showPopover"
  11. trigger="click"
  12. :actions="enforceNewsTypeOptions"
  13. placement="bottom-start"
  14. @select="popChange"
  15. >
  16. <template #reference>
  17. <div class="select_box">
  18. <p>{{popValue}}</p>
  19. <van-icon name="arrow-down" color="#1D6FE9" />
  20. </div>
  21. </template>
  22. </van-popover>
  23. <div class="search">
  24. <input type="text" v-model="searchInput" placeholder="请输入执法依据名称" />
  25. <img src="../../../../static/images/lawEnforcement/new/index_icon_04.png" @click="goSearch">
  26. </div>
  27. </div>
  28. <div class="main_box">
  29. <van-list
  30. v-model="loading"
  31. :finished="finished"
  32. finished-text="没有更多了"
  33. @load="getList"
  34. >
  35. <div class="peopleList">
  36. <van-row v-for="(item,index) in list" :key="index" @click="$router.push({name:'lawEnforcementBasisDetail',query: {content:item}})" >
  37. <van-col :span="24">
  38. <img src="../../../../static/images/lawEnforcement/icon/record_icon_03.png"/>
  39. <p>{{item.title}}</p>
  40. </van-col>
  41. </van-row>
  42. </div>
  43. </van-list>
  44. </div>
  45. </div>
  46. </template>
  47. <script>
  48. import { getNewsList , enforceNewsType } from "@/api/lawEnforcement/index";
  49. export default {
  50. name: "programmeDetail",
  51. data() {
  52. return {
  53. showPopover: false,
  54. // 通过 actions 属性来定义菜单选项
  55. enforceNewsTypeOptions: [],
  56. loading: false,
  57. finished: false,
  58. searchInput:'',
  59. queryParams: {
  60. // 分页
  61. pageNum: 1,
  62. pageSize: 10,
  63. // 查询排序
  64. orderByColumn: "id",
  65. isAsc: "desc",
  66. number: "002",
  67. deptId: null,
  68. title:''
  69. },
  70. list:[],
  71. popValue:'执法依据'
  72. };
  73. },
  74. created() {
  75. enforceNewsType().then(response => {
  76. for (var i = 0; i < response.data.length; i++) {
  77. this.enforceNewsTypeOptions.push({text: response.data[i].dictLabel, value: response.data[i].dictValue});
  78. }
  79. });
  80. if (this.$route.query.searchInput){
  81. this.searchInput = this.$route.query.searchInput;
  82. this.goSearch();
  83. }
  84. },
  85. methods: {
  86. getList(){
  87. console.log('aaaa')
  88. var _this = this;
  89. getNewsList(_this.queryParams).then(response => {
  90. response.rows.map(res=>{
  91. // res.businessType = res.businessType == '' ? '' : this.selectDictLabel(this.businessTypeOptions, res.businessType);
  92. this.list.push(res);
  93. })
  94. if(this.list.length >= response.total){
  95. this.finished = true;
  96. return;
  97. }else{
  98. this.loading = false;
  99. this.queryParams.pageNum += 1 ;
  100. }
  101. });
  102. },
  103. popChange(action,index){
  104. console.log(action,index)
  105. this.popValue = action.text;
  106. this.queryParams.number = action.value;
  107. this.list = [];
  108. this.queryParams.pageNum = 1 ;
  109. this.finished = false;
  110. this.loading = false;
  111. this.getList();
  112. },
  113. goSearch(){
  114. if (this.searchInput == ''){
  115. let path = this.$route.path; //先获取路由路径
  116. this.$router.push(path); //再跳转路由路径,query参数没带过去,所以被清除了
  117. }
  118. this.list = [];
  119. this.finished = false;
  120. this.loading = false;
  121. this.queryParams.title = this.searchInput;
  122. this.queryParams.pageNum = 1;
  123. // this.getList();
  124. },
  125. onClickLeftIndex(){
  126. this.$router.push('/lawEnforcement/index_new')
  127. }
  128. },
  129. }
  130. </script>
  131. <style scoped lang="scss">
  132. .app-container {
  133. padding: 0 0 0.2rem;
  134. }
  135. .jg{
  136. height: 116px;
  137. }
  138. .search_box{
  139. display: flex;
  140. justify-content: space-between;
  141. align-items: center;
  142. width: 92%;
  143. margin: 10PX auto;
  144. .van-popover__wrapper{
  145. flex: 1;
  146. margin-right: 10PX;
  147. }
  148. .select_box{
  149. border: 1px solid #1D6FE9;
  150. border-radius: 50PX;
  151. padding: 0 12PX ;
  152. background: #ffffff;
  153. height: 30PX;
  154. line-height: 30PX;
  155. display: flex;
  156. justify-content: space-around;
  157. align-items: center;
  158. p{
  159. display: -webkit-box;
  160. -webkit-box-orient: vertical;
  161. -webkit-line-clamp: 1;
  162. word-break: break-all;
  163. overflow: hidden;
  164. }
  165. }
  166. .search{
  167. background: #ffffff;
  168. display: flex;
  169. justify-content: space-between;
  170. align-items: center;
  171. width: 70%;
  172. border: 1px solid #1D6FE9;
  173. padding: 1PX 1PX 1PX 12PX ;
  174. border-radius: 50PX;
  175. input{
  176. flex: 1;
  177. background: transparent;
  178. }
  179. }
  180. }
  181. .header_main{
  182. height: 116px;
  183. background: url('../../../../static/images/lawEnforcement/new/list_head.png') no-repeat;
  184. background-size: 100% 100%;
  185. position: fixed;
  186. top: 0;
  187. left: 0;
  188. width: 100%;
  189. font-size: 36px;
  190. line-height: 116px;
  191. text-align: center;
  192. color: #fff;
  193. z-index: 999;
  194. .return_btn{
  195. width: 24px;
  196. height: 43.2px;
  197. background: url('../../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
  198. background-size: 20px 36px;
  199. position: absolute;
  200. left: 38px;
  201. top: 36px;
  202. }
  203. .add_btn{
  204. width: 56.4px;
  205. height: 40.8px;
  206. background: url('../../../assets/images/sunVillage_info/list_icon_9.png') center center no-repeat;
  207. background-size: 47px 34px;
  208. position: absolute;
  209. right: 38px;
  210. top: 36px;
  211. }
  212. }
  213. .peopleList{
  214. padding: 0 3%;
  215. text-align: left;
  216. .van-row{
  217. border-bottom: 1px solid #dddddd;
  218. display: flex;
  219. align-items: center;
  220. &:last-child{
  221. border: none;
  222. }
  223. .van-col--24{
  224. display: flex;
  225. align-items: center;
  226. p{
  227. margin-left: 10PX;
  228. }
  229. }
  230. .van-col{
  231. text-align: left;
  232. font-size: 14PX;
  233. color: #333333;
  234. padding: 15PX 0;
  235. img{
  236. display: block;
  237. }
  238. }
  239. }
  240. }
  241. .main_box{
  242. width: 96%;
  243. margin: 0 auto;
  244. border-radius: 10PX;
  245. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  246. overflow: hidden;
  247. background-color: #FFF;
  248. }
  249. </style>