handleAffairs.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <view>
  3. <!-- 搜索栏 -->
  4. <view class="input-view">
  5. <uni-icons type="search" size="20" class="search-icon" @tap="confirm"></uni-icons>
  6. <input confirm-type="search" class="nav-bar-input" type="text" placeholder="输入搜索关键词" @confirm="confirm" v-model="title"/>
  7. </view>
  8. <!-- 网格配置列表滑动 -->
  9. <view>
  10. <uni-swiper-dot :info="info" :current="current" field="content" :mode="mode">
  11. <swiper class="swiper-box">
  12. <swiper-item v-for="(item ,index) in gridtType" :key="index">
  13. <!-- <ul class="mainNav" >
  14. <li v-for="(dataitem,dataindex) in item.dataList" :key="dataitem.id">
  15. <image class="uni-header-image" :src="'http://127.0.0.1:8080'+dataitem.fileUrl"
  16. @click="querygrid(dataitem)"></image>
  17. <text>{{dataitem.name}}</text>
  18. </li>
  19. </ul> -->
  20. <uni-grid :column="5" :highlight="true" :showBorder="false">
  21. <uni-grid-item v-for="(dataitem,dataindex) in item" :key="dataitem.id">
  22. <view>
  23. <image class="uni-header-image" :src="'http://127.0.0.1:8080'+dataitem.fileUrl"
  24. @click="querygrid(dataitem)"></image>
  25. <uni-title type="h5" :title="dataitem.name" align="center"></uni-title>
  26. </view>
  27. </uni-grid-item>
  28. </uni-grid>
  29. </swiper-item>
  30. </swiper>
  31. </uni-swiper-dot>
  32. </view>
  33. <view>
  34. <uni-row class="demo-uni-row" :width="nvueWidth">
  35. <uni-col :span="12">
  36. <button align="center" @click="topic">主题导航</button>
  37. </uni-col>
  38. <uni-col :span="12">
  39. <button align="center" @click="dept">部门导航</button>
  40. </uni-col>
  41. </uni-row>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. import {
  47. listGridType
  48. } from '@/api/handleAffairs/gridType.js';
  49. export default {
  50. data() {
  51. return {
  52. title:"",
  53. gridtType: [], //是一个list<map>数据 [{0,[1,2,3]}]
  54. };
  55. },
  56. created() {
  57. this.getList();
  58. },
  59. methods: {
  60. confirm(){
  61. if (!this.title.trim()) {//去除前后空格,在判断是否为空
  62. return
  63. }
  64. console.log(this.title)
  65. uni.setStorageSync('data', {title:this.title,examine:1})
  66. uni.navigateTo({
  67. url: '/pages/matterAll/matterAll',
  68. });
  69. },
  70. //主题导航跳转
  71. topic(){
  72. uni.navigateTo({
  73. url: '/pages/topic/topic',
  74. });
  75. },
  76. //部门导航跳转
  77. dept(){
  78. },
  79. querygrid(item) {
  80. console.log(item)
  81. uni.setStorageSync('id', item.id)
  82. uni.navigateTo({
  83. url: '/pages/gridQuery/gridQuery?titleText='+item.name
  84. });
  85. },
  86. getList() {
  87. const _that = this
  88. let query = {
  89. yesOrNoShow: "0"
  90. };
  91. listGridType(query).then(res => {
  92. let gridtTypeLits = res.rows
  93. let dataList = []
  94. for (var i = 0; i < gridtTypeLits.length; i++) {
  95. dataList.push(gridtTypeLits[i])
  96. if (((i + 1) % 5 == 0) || i == gridtTypeLits.length - 1) {
  97. _that.gridtType.push(dataList)
  98. dataList = []
  99. }
  100. }
  101. });
  102. },
  103. }
  104. }
  105. </script>
  106. <style scoped>
  107. .uni-header-image {
  108. width: 30px;
  109. height: 30px;
  110. display: block;
  111. margin: 0 auto;
  112. }
  113. /* 主导航 */
  114. .mainNav {
  115. width: 100%;
  116. background: #fff;
  117. }
  118. .input-view {
  119. /* #ifndef APP-PLUS-NVUE */
  120. display: flex;
  121. /* #endif */
  122. flex-direction: row;
  123. // width: 500rpx;
  124. flex: 1;
  125. background-color: #f8f8f8;
  126. height: $nav-height;
  127. border-radius: 15px;
  128. padding: 0 15px;
  129. flex-wrap: nowrap;
  130. margin: 7px 0;
  131. line-height: $nav-height;
  132. }
  133. </style>