dataBank.vue 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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"
  10. :url="'/packageA/resourceLibrary/index?id=' + item.sat_sharematerial_classid + '&name=' + item.classname"
  11. :key="item.sat_sharematerial_classid" hover-class="navigator-hover">
  12. <image v-if="item.cover" class="image" :src="item.cover" mode="aspectFill" lazy-load="false" />
  13. <text v-else>{{ item.classname }}</text>
  14. </navigator>
  15. </view>
  16. </My_listbox>
  17. </template>
  18. <script>
  19. export default {
  20. data() {
  21. return {
  22. updatePage: true,
  23. appList: [],
  24. list: [],
  25. "content": {
  26. "parentid": 0,
  27. "where": {
  28. "isenable": 1
  29. }
  30. }
  31. }
  32. },
  33. methods: {
  34. init(callBack) {
  35. try {
  36. this.appList = this.getApps('资料库')
  37. } catch (error) {
  38. console.log("未获取到授权")
  39. }
  40. this.getList(true).then(res => {
  41. this.updatePage = false
  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": "20221102143202",
  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. console.log("avatar", v.attinfos.find(s => s.usetype == "avatar"))
  58. v.cover = v.attinfos.length ? this.getSpecifiedImage(v.attinfos.find(s => s.usetype == "avatar")) : (uni.getStorageSync("site").logo || '');
  59. return v
  60. });
  61. this.list = res.pageNumber == 1 ? res.data : this.list.concat(res.data);
  62. this.content = this.$refs.List.paging(this.content, res)
  63. })
  64. })
  65. },
  66. },
  67. }
  68. </script>
  69. <style lang="scss">
  70. .box {
  71. padding: 0 10px;
  72. box-sizing: border-box;
  73. display: flex;
  74. justify-content: space-between;
  75. flex-wrap: wrap;
  76. .nav-box {
  77. width: 172.5px;
  78. height: 104px;
  79. flex-shrink: 0;
  80. margin-top: 10px;
  81. .image {
  82. width: 100%;
  83. height: 100%;
  84. }
  85. }
  86. }
  87. </style>