dataBank.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <template>
  2. <My_listbox ref="List" @getlist="getList" :isShowEmpty="false" :bottomHeight="70">
  3. <slideshow ref="slideshow" empty />
  4. <view class="box">
  5. <view class="head" />
  6. <view v-if="affiches.length" class="affiche">
  7. <view class="iconfont icon-tonggao" />
  8. <swiper class="swiper" autoplay circular vertical>
  9. <swiper-item class="swiper-item" v-for="item in affiches" :key="item.sat_noticeid">
  10. <navigator class="title u-line-1" :url="'/packageA/affiche/detail?id=' + item.sat_noticeid">
  11. {{ item.title }}
  12. </navigator>
  13. </swiper-item>
  14. </swiper>
  15. </view>
  16. <view class="list">
  17. <navigator class="nav-box" v-for="item in appList " :key="item.name" :url="item.path"
  18. 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. <navigator class="nav-box" v-for="item in list"
  28. :url="'/packageA/resourceLibrary/index?id=' + item.sat_sharematerial_classid + '&name=' + item.classname"
  29. :key="item.sat_sharematerial_classid" hover-class="navigator-hover">
  30. <view class="classname u-line-1">
  31. {{ item.classname || '' }}
  32. </view>
  33. <view class="remark u-line-3">
  34. {{ item.remarks || '' }}
  35. </view>
  36. <view class="line" :style="{ background: item.color }" />
  37. </navigator>
  38. </view>
  39. </view>
  40. </My_listbox>
  41. </template>
  42. <script>
  43. export default {
  44. data() {
  45. return {
  46. updatePage: true,
  47. appList: [],
  48. list: [],
  49. "content": {
  50. "parentid": 0,
  51. "where": {
  52. "isenable": 1
  53. }
  54. },
  55. colors: ['#F9E3FF', "#FFE6E8", "#DDF3FD"],
  56. affiches: [],
  57. }
  58. },
  59. methods: {
  60. init(callBack) {
  61. try {
  62. this.appList = this.dye(this.getApps('资料库').map(v => {
  63. v.classname = v.remark;
  64. switch (v.name) {
  65. case "affiche":
  66. v.remarks = '新品上市 / 停产 / 变更类 / 事件类';
  67. break;
  68. case "dailyYttendance":
  69. v.remarks = '效果图 / 实景图 / 产品图\n励志海报等';
  70. break;
  71. }
  72. return v
  73. }), this.colors, 1)
  74. } catch (error) {
  75. console.log("未获取到授权")
  76. }
  77. Promise.all([this.getList(true), this.$refs.slideshow.getBanners(['databaseTop'])]).then(res => {
  78. callBack()
  79. this.updatePage = false;
  80. })
  81. },
  82. getList(init = false) {
  83. if (init && this.appList.some(v => v.name == 'affiche')) this.getNewAffiche();
  84. return new Promise((resolve, reject) => {
  85. if (this.paging(this.content, init)) return resolve();
  86. this.$Http.basic({
  87. "id": "20221102143202",
  88. content: this.content
  89. }).then(res => {
  90. console.log("获取装备资源库一级分类", res)
  91. this.$refs.List.RefreshToComplete()
  92. resolve()
  93. if (this.cutoff(res.msg)) return;
  94. this.list = this.dye(res.pageNumber == 1 ? res.data : this.list.concat(res.data), this.colors, 1);
  95. this.content = this.$refs.List.paging(this.content, res)
  96. })
  97. })
  98. },
  99. getNewAffiche() {
  100. this.$Http.basic({
  101. "id": "20221111090904",
  102. "content": {
  103. "where": { "condition": "", "sat_notice_classid": "", "isread": "" },
  104. "pageNumber": 1,
  105. "pageSize": 3
  106. }
  107. }).then(res => {
  108. console.log('获取最新通告', res)
  109. if (this.cutoff(res.msg)) return;
  110. this.affiches = res.data;
  111. })
  112. }
  113. },
  114. }
  115. </script>
  116. <style lang="scss">
  117. .box {
  118. position: relative;
  119. padding: 0 10px;
  120. box-sizing: border-box;
  121. .head {
  122. position: absolute;
  123. height: 10px;
  124. width: 100vw;
  125. border-radius: 8px 8px 0 0;
  126. background: #F7F7F7;
  127. top: -10px;
  128. left: 0;
  129. z-index: 1;
  130. }
  131. .affiche {
  132. margin-bottom: 10px;
  133. display: flex;
  134. height: 17px;
  135. align-items: center;
  136. .iconfont {
  137. color: #C30D23;
  138. font-size: 14px;
  139. flex-shrink: 0;
  140. }
  141. .swiper {
  142. flex: 1;
  143. margin-left: 5px;
  144. height: 17px;
  145. .swiper-item {
  146. .title {
  147. line-height: 17px;
  148. font-family: Source Han Sans SC, Source Han Sans SC;
  149. font-size: 12px;
  150. color: #333333;
  151. }
  152. }
  153. }
  154. }
  155. .list {
  156. display: flex;
  157. justify-content: space-between;
  158. flex-wrap: wrap;
  159. .nav-box {
  160. position: relative;
  161. padding: 15px;
  162. padding-right: 3px;
  163. width: 172.5px;
  164. height: 104px;
  165. flex-shrink: 0;
  166. margin-bottom: 10px;
  167. box-sizing: border-box;
  168. background: #fff;
  169. border-radius: 8px;
  170. overflow: hidden;
  171. .classname {
  172. height: 24px;
  173. font-family: Source Han Sans SC, Source Han Sans SC;
  174. font-weight: bold;
  175. font-size: 16px;
  176. color: #333333;
  177. }
  178. .remark {
  179. margin-top: 10px;
  180. line-height: 17px;
  181. font-family: Source Han Sans SC, Source Han Sans SC;
  182. font-size: 10px;
  183. color: #999999;
  184. white-space: pre-wrap;
  185. }
  186. .line {
  187. position: absolute;
  188. left: 0;
  189. top: 0;
  190. width: 4px;
  191. height: 100%;
  192. }
  193. }
  194. }
  195. }
  196. </style>