Y-Steps.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. <template>
  2. <!-- 获取一个数组,结构为[{date:'时间',info:'内容内容'}] -->
  3. <!-- @click事件返回点击标签元素的索引值 第一项为0 -->
  4. <view class="bg">
  5. <view class="steps">
  6. <view class="steps_item" v-for="(i,index) in infoList" :key='i.key'>
  7. <view class="s_r">
  8. <view class="line" :style="{backgroundColor:index != 0?'#e61916':'rgba(0,0,0,0)'}"></view>
  9. <view class="index-border">
  10. <view class="index" :style="{backgroundColor:'#e61916',color:' #ffd8d8'}">
  11. {{ index + 1 }}
  12. </view>
  13. </view>
  14. <view class="line" :style="{backgroundColor:index != infoList.length-1?'#e61916':'rgba(0,0,0,0)'}"></view>
  15. </view>
  16. <view class="s_l">
  17. <view class="info_item" @tap="topage(index)">
  18. <uni-collapse>
  19. <uni-collapse-item :title="i.name" class="child">
  20. <view class="child-body">
  21. <view class="child_list" v-for="item in i.child" :key='item.key'>
  22. <text @click="stepChild(item)">{{item.name}}</text>
  23. <text style="margin-left: 15px;" @click="downLoad(item)">(下载模板)</text>
  24. </view>
  25. </view>
  26. </uni-collapse-item>
  27. </uni-collapse>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. var app = getApp()
  36. export default {
  37. name: 'YSteps',
  38. data() {
  39. return {
  40. infoList: [],
  41. url:''
  42. };
  43. },
  44. created() {
  45. this.getSteps();
  46. },
  47. onLoad(e) {
  48. },
  49. methods: {
  50. getSteps: function() {
  51. uni.showLoading()
  52. let date = {
  53. // type:1
  54. }
  55. app.request('/organization-flow', date, 'get').then(res => {
  56. console.log(res, '----------------------------------------------index')
  57. let dataList = res.data.data
  58. let arr = [];
  59. let list = [];
  60. let nodelist = [];
  61. let data = [];
  62. let data1 = [];
  63. dataList.map(item => {
  64. data.push(item.child);
  65. item.child.map(item1 => {
  66. data1.push(item1);
  67. });
  68. });
  69. this.infoList = data1
  70. uni.hideLoading()
  71. })
  72. },
  73. //跳转子页面
  74. stepChild(item) {
  75. uni.setStorageSync('steps', item)
  76. uni.navigateTo({
  77. url: '../../pages/index/fileList'
  78. })
  79. },
  80. topage(e) {
  81. this.$emit('click', e);
  82. },
  83. downLoad(item){
  84. let key=item.key
  85. app.request('/templates',{key:key}).then(res=>{
  86. console.log(res.data.data.data,'点击下载')
  87. if(res.data.data.data.length>0){
  88. let url=res.data.data.data[0].resource
  89. this.url=url
  90. window.location.href=url
  91. }else{
  92. uni.showToast({
  93. title:'暂无模板',
  94. icon:'none'
  95. })
  96. }
  97. })
  98. }
  99. }
  100. };
  101. </script>
  102. <style lang="scss" scoped>
  103. page {
  104. background-color: #FFFFFF;
  105. }
  106. .bg {
  107. background-color: #FFFFFF;
  108. display: flex;
  109. }
  110. .steps {
  111. display: flex;
  112. flex-direction: column;
  113. .steps_item {
  114. display: flex;
  115. .s_r {
  116. padding: 0 20rpx;
  117. display: flex;
  118. flex-direction: column;
  119. align-items: center;
  120. margin-right: 10upx;
  121. .line {
  122. flex: 1;
  123. width: 5rpx;
  124. background-color: #fff;
  125. }
  126. .index-border {
  127. height: 50upx;
  128. width: 50upx;
  129. border-radius: 50upx;
  130. // line-height: 60upx;
  131. text-align: center;
  132. background-color: #ffe1e1;
  133. .index {
  134. width: 30upx;
  135. margin: 12upx 0 0 12upx;
  136. height: 30upx;
  137. font-size: 10px;
  138. text-align: center;
  139. line-height: 30upx;
  140. border-radius: 50upx;
  141. // background-color: #e61916;
  142. }
  143. }
  144. }
  145. .s_l {
  146. display: flex;
  147. flex-direction: column;
  148. padding: 30rpx 0;
  149. border-radius: 10upx;
  150. .info_item {
  151. margin-right: 30upx;
  152. display: flex;
  153. flex-direction: column;
  154. justify-content: center;
  155. box-shadow: 0 10rpx 30rpx #ddd;
  156. border-radius: 10upx;
  157. min-width: 550upx;
  158. // padding-bottom: 30upx;
  159. .child {
  160. // background-color: #e61916;
  161. // color: #e61916;
  162. color: #FFFFFF;
  163. border-radius: 10upx;
  164. }
  165. .border {
  166. border-radius: 10upx;
  167. background-color: #FFFFFF;
  168. }
  169. .child-body {
  170. padding: 20upx 30upx 15upx;
  171. background-color: #FFFFFF;
  172. .child_list {
  173. background-color: #FFFFFF;
  174. // height:60upx;
  175. line-height: 40upx;
  176. font-size: 30upx;
  177. // padding-left: 30upx;
  178. // padding-right: 10px;
  179. word-wrap: break-word;
  180. word-break: break-all;
  181. overflow: hidden;
  182. padding: 20upx 0;
  183. border-bottom: 1px solid #F3F3F3;
  184. &:last-child{
  185. border-bottom: none;
  186. }
  187. text{
  188. line-height: 40upx;
  189. font-size: 30upx;
  190. color: #333333;
  191. }
  192. }
  193. }
  194. text {
  195. font-size: 18px;
  196. font-weight: 500;
  197. color: #FFFFFF;
  198. line-height: 25px;
  199. }
  200. view {
  201. font-size: 14px;
  202. font-weight: 400;
  203. color: rgba(102, 102, 102, 1);
  204. line-height: 20px;
  205. overflow: hidden;
  206. text-overflow: ellipsis;
  207. flex-direction: column;
  208. }
  209. }
  210. .info_item:active {
  211. background-color: #e61916 !important;
  212. }
  213. }
  214. }
  215. }
  216. </style>