<template>
    <div class='app-wf-approval'>
        <div class="app-wf-approval-header">
            <span class="approval-header-left">{{data.startTime}}</span>
            <span>{{data.startUserName}}提交</span>
        </div>
        <div class="app-wf-approval-content" v-if="data.usertasks.length >0">
            <div class="approval-content-item" v-for="(usertask,index) in data.usertasks" :key="index">
                <div class="approval-content-item-left">
                    {{usertask.userTaskName}}
                </div>
                <div class="approval-content-item-right">
                    <div class="approval-content-item-wait" v-if="usertask.identitylinks.length >0">
                        等待<span v-for="(identitylink,inx) in usertask.identitylinks" :key="inx">{{identitylink.displayname}}<span v-if="inx >0">、</span></span>处理
                    </div>
                    <div class="approval-content-item-info" v-if="usertask.comments.length >0">
                        <div v-for="(comment,commentInx) in usertask.comments" :key="commentInx">
                            <div class="approval-content-item-info-item approval-content-item-info-top">
                                {{`【${comment.type}】${comment.fullMessage}`}}
                            </div>
                             <div class="approval-content-item-info-item approval-content-item-info-bottom">
                                <span class="info-bottom-name">{{comment.authorName}}</span>
                                <span>{{comment.time}}</span>
                            </div>
                        </div>
                    </div>
                    <div class="approval-content-item-memo" v-if="usertask.userTaskId === 'tid-2-c60d498abacb47b510e0aa9d64a55e57'">
                        <el-input type="textarea"  :rows="2" v-model="input" placeholder="请输入内容"></el-input>
                    </div>
                </div>
            </div>
        </div>
         <div class="app-wf-approval-bottom">
            <span v-if="data.endTime">{{data.endTime}}结束</span>
        </div>
    </div>
</template>
<script lang = 'ts'>
import { Vue, Component } from 'vue-property-decorator';

@Component({
})
export default class AppWFApproval extends Vue {

    public input:any ="";

    /**
     * 传入数据
     * 
     *  @memberof AppWFApproval
     */
    public data:any = {
    "id": "40833204-9be4-11ea-9c94-0242130d84ce",
    "name": null,
    "processDefinitionKey": null,
    "processDefinitionName": null,
    "businessKey": "DC20200522022",
    "startTime": "2020-05-22 12:25:22",
    "endTime": null,
    "startUserId": "001-004_0001",
    "startUserName": "隆俊杰",
    "usertasks": [{
        "userTaskId": "tid-1-1f3eda90105907e25e6f2e8c0f82b903",
        "userTaskName": "管理员审批",
        "processDefinitionKey": null,
        "processDefinitionName": null,
        "identitylinks": [],
        "comments": [{
            "id": "44eddf40-9be4-11ea-9c94-0242130d84ce",
            "author": "001-004_0001",
            "authorName": "隆俊杰",
            "fullMessage": "",
            "time": "2020-05-22 12:25:29",
            "type": "审批不通过",
            "taskId": "40844383-9be4-11ea-9c94-0242130d84ce",
            "processInstanceId": "40833204-9be4-11ea-9c94-0242130d84ce",
            "processInstanceBusinessKey": "DC20200522022"
        }, {
            "id": "b39cfc68-9be4-11ea-9c94-0242130d84ce",
            "author": "450000-000",
            "authorName": "ibzadmin",
            "fullMessage": "",
            "time": "2020-05-22 12:28:35",
            "type": "审批不通过",
            "taskId": "a6c57ad1-9be4-11ea-9c94-0242130d84ce",
            "processInstanceId": "40833204-9be4-11ea-9c94-0242130d84ce",
            "processInstanceBusinessKey": "DC20200522022"
        }]
    }, {
        "userTaskId": "tid-2-c60d498abacb47b510e0aa9d64a55e57",
        "userTaskName": "被驳回",
        "processDefinitionKey": null,
        "processDefinitionName": null,
        "identitylinks": [{
            "id": "001-004_0001",
            "firstname": null,
            "displayname": "隆俊杰"
        }],
        "comments": [{
            "id": "a6c21f6e-9be4-11ea-9c94-0242130d84ce",
            "author": "001-004_0001",
            "authorName": "隆俊杰",
            "fullMessage": "",
            "time": "2020-05-22 12:28:14",
            "type": "提交",
            "taskId": "44f09e63-9be4-11ea-9c94-0242130d84ce",
            "processInstanceId": "40833204-9be4-11ea-9c94-0242130d84ce",
            "processInstanceBusinessKey": "DC20200522022"
        }]
    }]
    };

   
}
</script>

<style lang="less">
@import './app-wf-approval.less';
</style>