listProject.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. <template>
  2. <view>
  3. <image src="https://cczdsz.cn/app/images//background.png" mode="" class="background"></image>
  4. <view class="" style="padding-top: 0rpx;">
  5. <!-- <back></back> -->
  6. </view>
  7. <view >
  8. <u-grid :col="6" style="font-size: 12px;">
  9. <u-grid-item @click="getProjectList(index1)" v-for="(item, index1) in viewList" :bg-color="index1==index ? '#6aabff':''" :index="index1">
  10. <image :src="item.src" mode="" style="height: 80rpx;width: 80rpx;"></image>
  11. <view class="grid-text">{{item.name}}</view>
  12. </u-grid-item>
  13. </u-grid>
  14. <view>
  15. <u-search placeholder="请输入搜索内容" v-model="value1" shape="square" :show-action="false" :action-style="{'font-size':'40rpx'}" @search="gethosList()"></u-search>
  16. </view>
  17. <view v-for="(item,index) in list" :key="index" >
  18. <view class="project-content" @click="gotoindex(item)">
  19. <view>
  20. <view class="font-forty-eight blue">
  21. 项目名称:{{item.name}}
  22. </view>
  23. <view class="font-forty-eight blue">
  24. 项目时间:{{item.time}}
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. import service from '@/api/index.js'
  34. export default {
  35. data() {
  36. return {
  37. list:[],
  38. value:'',
  39. value1:'',
  40. nameValue:'',
  41. civilPower:'',
  42. userId:'',
  43. index:-1,
  44. ReachBottom:true,
  45. page:1,
  46. viewList:[{name:'抢险维修',src:'https://cczdsz.cn/app/images/qxwx.png'},{name:'调压箱管理',src:'https://cczdsz.cn/app/images/xxdy.png'},{name:'庭院网管',src:'https://cczdsz.cn/app/images/tywg.png'},{name:'路段巡查',src:'https://cczdsz.cn/app/images/luduan.png'},{name:'阀井巡查',src:'https://cczdsz.cn/app/images/fajing.png'},{name:'输配站',src:'https://cczdsz.cn/app/images/spzxc.png'}]
  47. }
  48. },
  49. onLoad(e) {
  50. console.log(e)
  51. this.nameValue = e.nameValue
  52. //this.getProjectList();
  53. this.getUserName();
  54. uni.setNavigationBarTitle({
  55. title: '历史记录',
  56. });
  57. uni.setNavigationBarColor({
  58. frontColor: '#ffffff',
  59. backgroundColor: '#2d95f4',
  60. })
  61. },
  62. onTabItemTap(e)
  63. {
  64. console.log(e)
  65. uni.removeStorageSync('type')
  66. },
  67. onReachBottom(){
  68. console.log('触底')
  69. this.getReachBottom()
  70. },
  71. onPullDownRefresh()
  72. {
  73. console.log('下拉刷新')
  74. this.getvalueproject()
  75. },
  76. methods: {
  77. getReachBottom()
  78. {
  79. if (this.ReachBottom) {
  80. this.page+=1
  81. this.getvalueproject()
  82. }else
  83. {
  84. this.page=1
  85. this.ReachBottom=false
  86. }
  87. },
  88. gotoindex(item){
  89. console.log(item)
  90. if(this.index==1)
  91. {//调压箱
  92. console.log(item)
  93. uni.navigateTo({
  94. url: `/pages/noLogin/PressureRegulatingBox/PressureRegulatingBox?type=1&id=${item.id}`
  95. })
  96. }else if(this.index==2)
  97. {//庭院管理
  98. uni.navigateTo({
  99. url: `/pages/noLogin/CourtyardNetworkManagement/CourtyardNetworkManagement?type=1&id=${item.id}`
  100. })
  101. }else if(this.index==0)
  102. {//抢险维修
  103. uni.navigateTo({
  104. url: `/pages/noLogin/emergencyRepairOrder/emergencyRepairOrder?type=1&id=${item.id}`
  105. })
  106. }else if(this.index==3)
  107. {//路段
  108. console.log(item)
  109. let url1= `/pages/noLogin/roadSection/roadSection?type=1&id=${item.id}`
  110. uni.navigateTo({
  111. url: url1
  112. })
  113. }
  114. else if(this.index==4)
  115. {//警示桩
  116. console.log(item)
  117. let url1= `/pages/noLogin/valveWellInspection/valveWellInspection?type=1&id=${item.id}`
  118. uni.navigateTo({
  119. url: url1
  120. })
  121. }else if(this.index==5)
  122. {//警示桩
  123. console.log(item)
  124. let url1= `/pages/noLogin/LNGStation/LNGStation?type=1&id=${item.id}`
  125. uni.navigateTo({
  126. url: url1
  127. })
  128. }
  129. // uni.switchTab({
  130. // url:'/pages/index/index'
  131. // })
  132. },
  133. topage(url){
  134. uni.navigateTo({
  135. url
  136. })
  137. },
  138. getvalueproject()
  139. {
  140. service.getSearch({type:this.index,userId:this.userId,page:this.page,size:10,value:this.value1}).then(res=>{
  141. console.log('getProjectType', res)
  142. if(null==res){
  143. //this.$UTILS.showPrompt('暂无历史记录!')
  144. return
  145. }
  146. let list1=[]
  147. list1=res
  148. this.list.push(...list1)
  149. // list1.forEach(item=>{
  150. // this.list.push(item)
  151. // })
  152. //this.list = res;
  153. })
  154. },
  155. gethosList()
  156. {
  157. service.getSearch({type:this.index,userId:this.userId,page:this.page,size:10,value:this.value1}).then(res=>{
  158. console.log('getProjectType', res)
  159. if(res.length == 0){
  160. this.list=[]
  161. this.$UTILS.showPrompt('暂无历史记录!')
  162. return
  163. }
  164. let list1=[]
  165. list1=res
  166. list1.forEach(item=>{
  167. this.list.push(item)
  168. })
  169. this.list = res;
  170. })
  171. },
  172. getProjectList(val) {
  173. this.page=1
  174. this.value1=''
  175. this.ReachBottom=true
  176. console.log(val,'11111111')
  177. if(val==this.index)
  178. {
  179. this.index=-1
  180. return
  181. }
  182. this.index=val
  183. this.list=[]
  184. if(val==3)
  185. {
  186. service.getroadSectionInspectionList({discoverProblems:this.value1,userId:this.userId,createBy:this.userId}).then(res=>{
  187. console.log('getProjectType', res)
  188. if(res.length == 0){
  189. this.$UTILS.showPrompt('暂无历史记录!')
  190. return
  191. }
  192. let list1=[]
  193. list1=res
  194. list1.forEach(item=>{
  195. item.type=3
  196. item.name=item.sectionName
  197. item.time=item.findTime
  198. this.list.push(item)
  199. })
  200. })
  201. }else if(val==4)
  202. {
  203. service.getvalveWellPositionList({discoverProblems:this.value1,userId:this.userId,createBy:this.userId}).then(res=>{
  204. console.log('getProjectType', res)
  205. if(res.length == 0){
  206. this.$UTILS.showPrompt('暂无历史记录!')
  207. return
  208. }
  209. let list1=[]
  210. list1=res
  211. list1.forEach(item=>{
  212. item.type=4
  213. item.name=item.position.valveWellName
  214. item.time=item.discoverTime
  215. this.list.push(item)
  216. })
  217. })
  218. }
  219. else if(val==5)
  220. {
  221. service.gettransmissionStationList({name:this.value1,userId:this.userId,createBy:this.userId}).then(res=>{
  222. console.log('getProjectType', res)
  223. if(res.length == 0){
  224. this.$UTILS.showPrompt('暂无历史记录!')
  225. return
  226. }
  227. let list1=[]
  228. list1=res.rows
  229. list1.forEach(item=>{
  230. item.type=5
  231. item.name=item.name
  232. item.time=item.createTime
  233. this.list.push(item)
  234. })
  235. })
  236. }
  237. else
  238. {
  239. service.getSearch({type:val,userId:this.userId,page:this.page,size:10,value:this.value1}).then(res=>{
  240. console.log('getProjectType', res)
  241. if(res.length == 0){
  242. this.$UTILS.showPrompt('暂无历史记录!')
  243. return
  244. }
  245. let list1=[]
  246. list1=res
  247. list1.forEach(item=>{
  248. if(item.type==1)
  249. {
  250. item.typeValue='调压箱'
  251. }else if(item.type==2)
  252. {
  253. item.typeValue='庭院管网'
  254. }
  255. else if(item.type==3)
  256. {
  257. item.typeValue='抢险维修'
  258. }else if(item.type==4)
  259. {
  260. item.typeValue='警示桩'
  261. }
  262. this.list.push(item)
  263. })
  264. //this.list = res;
  265. })
  266. }
  267. },
  268. getUserName(){
  269. service.getUserName().then(res=>{
  270. this.userId=res.id
  271. this.civilPower = res.civilPower;
  272. })
  273. },
  274. },
  275. }
  276. </script>
  277. <style lang="scss" scoped>
  278. .background {
  279. z-index: -1;
  280. position: fixed;
  281. width: 100%;
  282. height: 100%;
  283. background-size: 100% 100%;
  284. }
  285. .project {
  286. border-radius: 72rpx;
  287. padding: 25rpx 0;
  288. text-align: center;
  289. margin: 170rpx 55rpx 0;
  290. }
  291. .project-content {
  292. border: 4rpx solid #3857F3;
  293. margin: 40rpx 55rpx 0;
  294. padding: 30rpx 20rpx;
  295. border-radius: 48rpx;
  296. }
  297. .position{
  298. position: absolute;
  299. bottom: 100rpx;
  300. right: 50rpx;
  301. .arrow{
  302. width: 152rpx;
  303. height: 152rpx;
  304. border-radius: 50%;
  305. padding: 25rpx;
  306. margin-left: 20rpx;
  307. }
  308. }
  309. </style>