<template>
	<view>
		<uni-list>
			<uni-list-item v-for="(item, index) in listData" :key="index" @click="goDetail(item)" clickable >
				<view slot="body" class="slot-box">
					<view class="row">
						<view class="column-left">流程名称：</view>
						<view class="column-right">{{item.description}}</view>
					</view>
					<view class="row">
						<view class="column-left">索引：</view>
						<view class="column-right">{{item.procedureName}}</view>
					</view>
					<view class="row">
						<view class="column-left">版本号：</view>
						<view class="column-right">{{item.versionNumber}}</view>
					</view>
				</view>
			</uni-list-item>
		</uni-list>
		 
	</view>
</template>

<script>
	import {
		GetWorkFlowProcedureList
	} from "@/common/api/commonApi.js";
	 
	 

	export default {
		 
		data() {
			return {
				listData: [], 
			};
		},
		onLoad() {
			console.info("当前登录状态:" + this.$store.state.isLogin);
			//console.info(this);
			this.$util.persistLogin(this);
			 
            
		},
		onPullDownRefresh() {
			this.reload = true;
			this.last_id = '';

			 
		},
		onReachBottom() {
			this.status = 'more';
			 
		},
		created: function() {
			this.getList();
		},
		methods: {

			getList() {
				let that = this;
				let procedureName=this.$util.getQuery("procedureName");
				let projectCode=this.$util.getState(this,'projectCode');
				let activity=1;
				GetWorkFlowProcedureList(procedureName,projectCode,activity).then((res) => {
					console.info('res',res);
					 
					res.forEach(function(item, index, array) {
						that.$set(that.listData, index, item);
					});
					console.info(that.listData);
				});
			},
			goDetail: function(item) {
				console.info('godetail');
				 
			    let procedureName=this.$util.getQuery("procedureName");
				let applicationCode=this.$util.getQuery("applicationCode");
				let projectCode=this.$util.getState(this,"projectCode");
				let procedureCode=item.procedureCode;
				uni.navigateTo({
					
					url: '../WorkFlowAudit/WorkFlowAudit?procedureName=' + procedureName+'&applicationCode='+applicationCode+'&procedureCode='+procedureCode
				});
			},
			
		}
	};
</script>

<style scoped>
	.uni-media-list-body {
		height: auto;		
		justify-content: space-around;
	}

	.uni-media-list-text-top {
		 
		height:35px;
		line-height: 35px;
		font-size: 15rpx;
		font-weight: 500;
		letter-spacing:1px;
		overflow: hidden;
	}
    .uni-media-list-text-body{
		 
		flex-direction: row;		
		height:50px;
		font-size: 13px;
		color: #8f8f94;
		letter-spacing:1px;
	}
	.uni-media-list-text-bottom {
		display: flex;
		justify-content: space-between;
		height:35px;
		line-height: 35px;
		font-size: 13px;
		color: #8f8f94;
		letter-spacing:1px;
		padding-bottom: 0;
	}
</style>
