dataBank.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <My_listbox ref="List" @getlist="getList" :isShowEmpty="false" :bottomHeight="70">
  3. <slideshow ref="slideshow" />
  4. <view class="box">
  5. <view class="head" />
  6. <navigator class="nav-box" v-for="item in appList " :key="item.name" :url="item.path"
  7. hover-class="navigator-hover">
  8. <view class="classname u-line-1">
  9. {{ item.classname || '' }}
  10. </view>
  11. <view class="remark u-line-3">
  12. {{ item.remarks || '' }}
  13. </view>
  14. <view class="line" :style="{ background: item.color }" />
  15. </navigator>
  16. <navigator class="nav-box" v-for="item in list"
  17. :url="'/packageA/resourceLibrary/index?id=' + item.sat_sharematerial_classid + '&name=' + item.classname"
  18. :key="item.sat_sharematerial_classid" hover-class="navigator-hover">
  19. <view class="classname u-line-1">
  20. {{ item.classname || '' }}
  21. </view>
  22. <view class="remark u-line-3">
  23. {{ item.remarks || '' }}
  24. </view>
  25. <view class="line" :style="{ background: item.color }" />
  26. </navigator>
  27. </view>
  28. </My_listbox>
  29. </template>
  30. <script>
  31. export default {
  32. data() {
  33. return {
  34. updatePage: true,
  35. appList: [],
  36. list: [],
  37. "content": {
  38. "parentid": 0,
  39. "where": {
  40. "isenable": 1
  41. }
  42. },
  43. colors: ['#F9E3FF', "#FFE6E8", "#DDF3FD"],
  44. }
  45. },
  46. methods: {
  47. init(callBack) {
  48. try {
  49. this.appList = this.dye(this.getApps('资料库').map(v => {
  50. v.classname = v.remark;
  51. switch (v.name) {
  52. case "affiche":
  53. v.remarks = '新品上市 / 停产 / 变更类 / 事件类'
  54. break;
  55. case "dailyYttendance":
  56. v.remarks = '效果图 / 实景图 / 产品图\n励志海报等'
  57. break;
  58. }
  59. return v
  60. }), this.colors, 1)
  61. } catch (error) {
  62. console.log("未获取到授权")
  63. }
  64. Promise.all([this.getList(true), this.$refs.slideshow.getBanners(['databaseTop'])]).then(res => {
  65. callBack()
  66. this.updatePage = false;
  67. })
  68. },
  69. getList(init = false) {
  70. return new Promise((resolve, reject) => {
  71. if (this.paging(this.content, init)) return resolve();
  72. this.$Http.basic({
  73. "id": "20221102143202",
  74. content: this.content
  75. }).then(res => {
  76. console.log("获取装备资源库一级分类", res)
  77. this.$refs.List.RefreshToComplete()
  78. resolve()
  79. if (this.cutoff(res.msg)) return;
  80. this.list = this.dye(res.pageNumber == 1 ? res.data : this.list.concat(res.data), this.colors, 1);
  81. this.content = this.$refs.List.paging(this.content, res)
  82. })
  83. })
  84. },
  85. },
  86. }
  87. </script>
  88. <style lang="scss">
  89. .box {
  90. position: relative;
  91. padding: 0 10px;
  92. box-sizing: border-box;
  93. display: flex;
  94. justify-content: space-between;
  95. flex-wrap: wrap;
  96. .head {
  97. position: absolute;
  98. height: 10px;
  99. width: 100vw;
  100. border-radius: 8px 8px 0 0;
  101. background: #F7F7F7;
  102. top: -10px;
  103. left: 0;
  104. z-index: 1;
  105. }
  106. .nav-box {
  107. position: relative;
  108. padding: 15px;
  109. padding-right: 3px;
  110. width: 172.5px;
  111. height: 104px;
  112. flex-shrink: 0;
  113. margin-bottom: 10px;
  114. box-sizing: border-box;
  115. background: #fff;
  116. border-radius: 8px;
  117. overflow: hidden;
  118. .classname {
  119. height: 24px;
  120. font-family: Source Han Sans SC, Source Han Sans SC;
  121. font-weight: bold;
  122. font-size: 16px;
  123. color: #333333;
  124. }
  125. .remark {
  126. margin-top: 10px;
  127. line-height: 17px;
  128. font-family: Source Han Sans SC, Source Han Sans SC;
  129. font-size: 10px;
  130. color: #999999;
  131. white-space: pre-wrap;
  132. }
  133. .line {
  134. position: absolute;
  135. left: 0;
  136. top: 0;
  137. width: 4px;
  138. height: 100%;
  139. }
  140. }
  141. }
  142. </style>