dataBank.vue 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. appList: [],
  23. list: [],
  24. "content": {
  25. "parentid": 0,
  26. "where": {
  27. "isenable": 1
  28. }
  29. }
  30. }
  31. },
  32. methods: {
  33. init(callBack) {
  34. try {
  35. this.appList = this.getApps('资料库')
  36. } catch (error) {
  37. console.log("未获取到授权")
  38. }
  39. this.getList(true).then(res => {
  40. callBack()
  41. })
  42. },
  43. getList(init = false) {
  44. return new Promise((resolve, reject) => {
  45. if (this.paging(this.content, init)) return resolve();
  46. this.$Http.basic({
  47. "id": "20221102143202",
  48. content: this.content
  49. }).then(res => {
  50. console.log("获取装备资源库一级分类", res)
  51. this.$refs.List.RefreshToComplete()
  52. resolve()
  53. if (this.cutoff(res.msg)) return;
  54. res.data = res.data.map(v => {
  55. v.cover = v.attinfos.length ? this.getSpecifiedImage(v.attinfos.find(s => v.usetype == "avatar")) : "";
  56. return v
  57. });
  58. this.list = res.pageNumber == 1 ? res.data : this.list.concat(res.data);
  59. this.content = this.$refs.List.paging(this.content, res)
  60. })
  61. })
  62. },
  63. },
  64. }
  65. </script>
  66. <style lang="scss">
  67. .box {
  68. padding: 0 10px;
  69. box-sizing: border-box;
  70. display: flex;
  71. justify-content: space-between;
  72. flex-wrap: wrap;
  73. .nav-box {
  74. width: 172.5px;
  75. height: 104px;
  76. flex-shrink: 0;
  77. margin-top: 10px;
  78. .image {
  79. width: 100%;
  80. height: 100%;
  81. }
  82. }
  83. }
  84. </style>