dataBank.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <My_listbox ref="List" @getlist="getList" :isShowEmpty="false" :bottomHeight="70">
  3. <view class="box">
  4. <navigator class="nav-box" v-for="item in appList" :key="item.name" :url="item.path"
  5. hover-class="navigator-hover">
  6. <image v-if="item.cover" class="image" :src="item.cover" mode="aspectFill" lazy-load="false" />
  7. <text v-else>{{ item.remark }}</text>
  8. </navigator>
  9. <navigator class="nav-box" v-for="item in list" :url="'/packageA/resourceLibrary/index?id=' + item.parentid"
  10. :key="item.name" hover-class="navigator-hover">
  11. <image v-if="item.cover" class="image" :src="item.cover" mode="aspectFill" lazy-load="false" />
  12. <text v-else>{{ item.title }}</text>
  13. </navigator>
  14. </view>
  15. </My_listbox>
  16. </template>
  17. <script>
  18. export default {
  19. data() {
  20. return {
  21. appList: [],
  22. list: [],
  23. "content": {
  24. "pageNumber": 1,
  25. "pageSize": 20,
  26. "isDataAuth": true,//小程序默认传true
  27. "where": {
  28. "condition": "",
  29. "sat_sharematerial_classids": [],
  30. }
  31. }
  32. }
  33. },
  34. methods: {
  35. init(callBack) {
  36. try {
  37. this.appList = this.getApps('资料库')
  38. } catch (error) {
  39. console.log("未获取到授权")
  40. }
  41. this.getList().then(res => {
  42. callBack()
  43. })
  44. },
  45. getList(init = false) {
  46. return new Promise((resolve, reject) => {
  47. if (this.paging(this.content, init)) return resolve();
  48. this.$Http.basic({
  49. "id": "20240407094702",
  50. content: this.content
  51. }).then(res => {
  52. console.log("获取装备资源库一级分类", res)
  53. this.$refs.List.RefreshToComplete()
  54. resolve()
  55. if (this.cutoff(res.msg)) return;
  56. res.data = res.data.map(v => {
  57. v.cover = v.attinfos.length ? this.getSpecifiedImage(v.attinfos.find(s => v.usetype == "avatar")) : "";
  58. return v
  59. });
  60. this.list = res.pageNumber == 1 ? res.data : this.list.concat(res.data);
  61. this.content = this.$refs.List.paging(this.content, res)
  62. })
  63. })
  64. },
  65. },
  66. }
  67. </script>
  68. <style lang="scss">
  69. .box {
  70. padding: 0 10px;
  71. box-sizing: border-box;
  72. display: flex;
  73. justify-content: space-between;
  74. flex-wrap: wrap;
  75. .nav-box {
  76. width: 172.5px;
  77. height: 104px;
  78. flex-shrink: 0;
  79. margin-top: 10px;
  80. .image {
  81. width: 100%;
  82. height: 100%;
  83. }
  84. }
  85. }
  86. </style>