smartSearchList.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <template>
  2. <view>
  3. <!-- 头部搜索框 -->
  4. <view class="fixed cu-bar search bg-blue" :style="style">
  5. <view class="action" @click="back()">
  6. <image class="login-img" src="/static/user/bask.png"></image>
  7. </view>
  8. <view class="search-form round">
  9. <image src="/static/index/search-gray.png" class="login-img margin-left margin-right"></image>
  10. <input disabled="" type="text" @click="back()" placeholder="请输入关键字搜索" v-model="searchValue" confirm-type="search"></input>
  11. <image style="padding: 0;" @click="back()" src="/static/index/delete-gray.png" class="login-img margin-right-sm"></image>
  12. </view>
  13. </view>
  14. <scroll-view scroll-y class="bg-white">
  15. <view :style="paddingTop"></view>
  16. <!-- 内容 -->
  17. <view class="cu-card article no-card">
  18. <view class="cu-item shadow solid-bottom" v-for="(item,index) in data" :key="item.id" @click="navTo(item)">
  19. <view class="content">
  20. <view class="desc">
  21. <view class="text-black text-lg padding-top">
  22. {{item.name}}
  23. </view>
  24. <view class="padding-top-sm flex justify-between">
  25. <view class="" v-for="(items,index2) in item.projectFilesTypeChildren" :key="index2">
  26. <image v-if="items.fileType==1" class="menuImageTask margin-right-sm" src="/static/task/excel.png"></image>
  27. <image v-if="items.fileType==2" class="menuImageTask margin-right-sm" src="/static/task/word.png"></image>
  28. <image v-if="items.fileType==3" class="menuImageTask margin-right-sm" src="/static/task/pdf.png"></image>
  29. <image v-if="items.fileType==4" class="menuImageTask margin-right-sm" src="/static/task/image.png"></image>
  30. </view>
  31. <view class="margin-top">
  32. <text class="text-gray">共{{item.projectFilesChildren !=null ? item.projectFilesChildren.length:0}}个文件</text>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. <view v-if="data.length!=0 && show" class="flex justify-center text-gray margin-top-lg" >没有更多内容了~</view>
  40. <view v-if="data.length==0 && show" class="text-center">
  41. <view>
  42. <image class="menuImageNoTask" src="../../static/task/noTask.png"></image>
  43. </view>
  44. <view style="padding:28rpx 0 132rpx;font-size: 26rpx;color: #8A8A8A;">没有找到符合条件的记录~</view>
  45. </view>
  46. </scroll-view>
  47. </view>
  48. </template>
  49. <script>
  50. export default {
  51. computed: {
  52. style() {
  53. var StatusBar = this.StatusBar;
  54. var CustomBar = this.CustomBar;
  55. var bgImage = this.bgImage;
  56. var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`;
  57. if (this.bgImage) {
  58. style = `${style}background-image:url(${bgImage});`;
  59. }
  60. return style
  61. }
  62. },
  63. data() {
  64. return {
  65. searchValue:"",
  66. paddingTop:"height:"+(this.StatusBar+50)+"px",
  67. data:[],
  68. show:false
  69. }
  70. },
  71. onLoad(e) {
  72. this.searchValue=e.searchValue;
  73. this.findFileBack();
  74. },
  75. methods: {
  76. navTo(data){
  77. uni.navigateTo({
  78. url:"/pages/documentList/documentList?title="+data.name+"&id="+data.id
  79. })
  80. },
  81. back(){
  82. uni.$emit("clear")
  83. uni.navigateBack({
  84. delta:1
  85. })
  86. },
  87. findFileBack(){
  88. var that =this;
  89. var projectId = uni.getStorageSync("porject"+"_"+uni.getStorageSync("userInfo").id).id;
  90. var fileId = uni.getStorageSync("fileId");
  91. that.http.request("/app/divideClient/findFileBack",{name:that.searchValue,parentId:fileId}).then((res)=>{
  92. if(res.datas.length!=0){
  93. console.log(res)
  94. that.data=res.datas;
  95. }else{
  96. that.$prompt.none("无数据");
  97. }
  98. that.show=true;
  99. })
  100. }
  101. },
  102. }
  103. </script>
  104. <style>
  105. page{
  106. background-color: white;
  107. }
  108. .text-black{
  109. color:#101010;
  110. }
  111. .menuImageNoTask{width:162rpx;height: 105rpx;margin-top: 60rpx;}
  112. </style>