<template>
  <div>
    <div style="height: 72vh;overflow: auto;">
        <el-form ref="form1" :model="addForm" :rules="taskRules" label-width="100px">
            <!--子任务需要选择任务列表 -->
            <el-form-item :label="$t('tasklist')" prop="stages" v-if="addForm.parentTid != null">
                <el-select v-model="addForm.stagesId" style="width:100%;" >
                    <el-option v-for="item in stageList" :key="item.id" :label="item.stagesName" :value="item.id"></el-option>
                </el-select>
            </el-form-item>
            <el-form-item :label="$t('types')">
                <!-- <el-button @click="test">test</el-button> -->
                <!-- 0011 -->
                <!-- {{groupResponsibleId == user.id}} -->
                <el-select v-model="addForm.taskType" style="width:100%;" :disabled="((this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement) && !(groupResponsibleId == user.id)" @change="selchg()">
                    <el-option v-for="item in taskTypeList" :key="item.id" :label="item.name" :value="item.id">
                        <i :class="item.icon" ></i>
                        <span>{{item.name}}</span>
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item :label="$t('taskdefinition')" prop="name">
                <el-input v-model="addForm.name" :maxlength="40" :disabled="(this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" :placeholder="$t('enterthetaskcontent')" clearable></el-input>
            </el-form-item>
            <!-- {{timelabel}}{{mileageCup}} -->
            <el-form-item :label="!timelabel ? $t('starttimes') : $t('jie-zhi-shi-jian')" prop="startDate">
                <el-date-picker v-model="addForm.startDate" type="date" style="width:40%;" value-format="yyyy-MM-dd"  
                :placeholder="$t('pleaseselectadate')" :disabled="(this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" @change="DateChange()" v-if="!timelabel"></el-date-picker>
                <span style="margin-left:30px;margin-right:10px;" v-if="!timelabel">{{ $t('deadline') }}</span>
                <el-date-picker style="width:40%;" v-model="addForm.endDate" type="date" value-format="yyyy-MM-dd"  
                :placeholder="$t('pleaseselectadate')" :disabled="(this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" @change="DateChange()"></el-date-picker>
                <span style="margin-left:30px;margin-right:10px;" v-if="timelabel && mileageCup">{{ $t('wan-cheng-shi-jian') }}</span>
                <el-date-picker style="width:40%;" v-if="timelabel && mileageCup" v-model="addForm.finishDate" type="date" value-format="yyyy-MM-dd"  
                :placeholder="$t('pleaseselectadate')" :disabled="(this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" @change="DateChange()"></el-date-picker>
                </el-form-item>
            <div style="border: 1px solid #ddd;margin:5px 0;padding:5px 0;">
            <el-form-item :label="$t('zhi-hang-ren') + (index+1)" v-for="(executorItem, index) in addForm.executorListFront" :key="index">
                <el-select v-if="user.userNameNeedTranslate != 1" v-model="executorItem.executorId" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" size="small" filterable clearable :placeholder="$t('pleaseselectanexecutor')" style="width:40%;" @change="$forceUpdate()">
                    <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id">
                        <span style="float: left">{{ item.name }}</span>
                        <span style="float: right; color: #8492a6; font-size: 13px;margin-left: 20px" v-if="item.jobNumber">{{ item.jobNumber }}</span>
                    </el-option>
                </el-select>
                <selectCat v-if="user.userNameNeedTranslate == 1" :size="'mini'" :subject="users" :subjectId="executorItem.executorId" :distinction="'1'" @selectCal="selectCal" :index="index" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)"></selectCat>
                <!-- <selectCat v-if="user.userNameNeedTranslate == '1'" :wxCope="true" :size="'size'" :subjectId="executorItem.executorId" :distinction="'1'" :subject="users"  @selectCal="selectCal" :index="index" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)"></selectCat> -->
                <span style="margin-left:30px;margin-right:10px;">{{ $t('plantime') }}</span>
                <el-input-number size="small" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" v-model="gstimday[index]" style="width:16%;" :min="1" :max="100"  :placeholder="$t('danweitian')" @change="chggstim(0,index)"></el-input-number ><span style="margin-left:5px;">{{ $t('time.day') }}</span>
                <el-input-number size="small" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !(groupResponsibleId == user.id)" v-model="gstimhour[index]" style="width:16%;" :min="1" :max="100"  :placeholder="$t('pleaseentertheplannedworking')" @change="chggstim(1,index)"></el-input-number ><span style="margin-left:5px;">{{ $t('time.hour') }}</span>
                <!--移除执行人 -->
                <i class="el-icon-delete" v-if="index>0 && (addForm.id == null|| user.id == addForm.createrId || currentProject.inchargerId == user.id|| permissions.projectManagement || groupResponsibleId == user.id)" style="margin-left:5px" @click="removeExecutorLine(index)"></i>
            </el-form-item>
            <el-link type="primary" v-if="(((addForm.executorListFront == null || addForm.executorListFront.length<10) && 
            (addForm.id == null|| user.id == addForm.createrId || currentProject.inchargerId == user.id || permissions.projectManagement)) || 
            groupResponsibleId == user.id)" 
            style="margin-left:35px;" @click="addExecutorLine">{{ $t('addinganexecutor') }}</el-link>
            </div>
            <el-form-item :label="$t('priority')">
                <el-select v-model="addForm.taskLevel" style="width:100%;" >
                    <el-option v-for="item in importanceList" :key="item.id" :label="item.name" :value="item.id"></el-option>
                </el-select>
            </el-form-item>
            <!-- 富文本 -->
            <el-form-item :label="$t('detaileddescription')" style="height: 200px">
                <!-- <Editor id="tinymce" v-model="tinymceHtml" :init="editorInit"></Editor> -->
                <!-- <el-input type="textarea" v-model="addForm.taskDesc" :rows="3"></el-input> -->
                <!-- <quill-edito v-model="addForm.taskDesc"></quill-edito> -->
                <quill-editor style="height: 150px" ref="text" v-model="addForm.taskDesc" class="myQuillEditor" :options="editorOption" @blur="onEditorBlur($event)" @focus="onEditorFocus($event)"/>
            </el-form-item>
            <!-- 富文本 -->
            <div v-if="addForm.id != null">
                <el-divider ></el-divider>
                <!-- 任务进展 -->
                <template v-if="!timelabel || isRelationItem">
                
                <p ><i class="iconfont firerock-icontree" style="color:#20A0ff;margin-left:10px;">{{ $t('taskprogress') }}</i>
                    <span ref="addPro" style="display: block; float:right;"><el-link @click="addprogress">{{ $t('addtaskprogress') }}</el-link></span>
                </p>
                <!-- 任务进展展示 -->
                <div style="display: none;" ref="proBox" class="progress">
                    <!-- <el-form :model="> -->
                    <el-radio-group v-model="radio">
                        <el-radio :label="0" class="rala1">{{ $t('normals') }}</el-radio>
                        <el-radio :label="1" class="rala2">{{ $t('atrisk') }}</el-radio>
                        <el-radio :label="2" class="rala3">{{ $t('withinthetimelimit') }}</el-radio>
                    </el-radio-group>
                    <el-input
                    type="textarea"
                    border="0"
                    :autosize="{ minRows: 2, maxRows: 6}"
                    :placeholder="$t('detailedprogressdescription')"
                    v-model="text2"
                    style="margin:10px 0 0 0">
                    </el-input>
                    <h4 style="font-weight: normal;">{{ $t('tixiang') }}{{checkLists.length}}</h4>
                    <i class="el-icon-circle-plus pron_i" style="font-size: 28px;color: #409EFF;" @click="addI(0)"></i>
                    <div class="remind" ref="addRem" style="display: none">
                        <el-checkbox-group v-model="checkboxGrounp" v-for="item in users" :key="item.id">
                            <p>
                                <el-checkbox :label="item.name" @change="kkk(item)">
                                    <span>
                                        <span v-if="user.userNameNeedTranslate != '1'">
                                            {{item.name}}
                                        </span>
                                        <span v-if="user.userNameNeedTranslate == '1'">
                                            <ww-open-data type='userName' :openid='item.name'></ww-open-data>
                                        </span>
                                    </span>
                                </el-checkbox>
                            </p>
                        </el-checkbox-group>
                    </div>
                    <div class="ssp" @click="sss"></div>
                    <!-- </el-form> -->
                    <div class="pro_btn">
                        <el-button size="mini" @click="shutPro">{{ $t('btn.cancel') }}</el-button>
                        <el-button size="mini" type="primary" @click="addTaskProgress">{{ $t('fa-bu') }}</el-button>
                    </div>
                </div>
                
                <div class="ddl" v-if="recentProgressInfo != null && recentProgressInfo.id != null">
                    <div class="elCard" style="margin-bottom: 10px; height:" >
                        <i class="el-icon-success" style="color: #43d14f;" v-if="recentProgressInfo.status == 0"></i>
                        <i class="el-icon-success" style="color: #fd7624;" v-else-if="recentProgressInfo.status == 1"></i>
                        <i class="el-icon-success" style="color: #fd4d47;" v-else></i>
                        <span v-if="recentProgressInfo.status == 0">{{ $t('normals') }}</span>
                        <span v-else-if="recentProgressInfo.status == 1">{{ $t('normals') }}</span>
                        <span v-else>{{ $t('withinthetimelimit') }}</span>
                        <el-dropdown trigger="click" style="float:right;cursor:pointer; float: right;">
                                <i class="el-icon-more" ></i>
                                <el-dropdown-menu slot="dropdown">
                                    <el-dropdown-item divided>
                                        <span @click="deleteTaskProgress(recentProgressInfo.id)"><i class="el-icon-delete"></i>{{ $t('deleteList ') }}</span></el-dropdown-item>
                                </el-dropdown-menu>
                        </el-dropdown>
                        <!-- <div class="elCard_qu">{{recentProgressInfo.creatorName}}{{ $t('geng-xin-yu') }}{{recentProgressInfo.indate | relativeTime}}</div> -->
                        <div class="elCard_qu">
                            <span>
                                <span v-if="user.userNameNeedTranslate != '1'">
                                    {{recentProgressInfo.creatorName}}
                                </span>
                                <span v-if="user.userNameNeedTranslate == '1'">
                                    <ww-open-data type='userName' :openid='recentProgressInfo.creatorName'></ww-open-data>
                                </span>
                            </span>
                            {{ $t('geng-xin-yu') }}{{recentProgressInfo.indate | relativeTime}}
                        </div>
                        <p style="padding-left: 20px;">{{recentProgressInfo.content}}</p>
                        <div class="examine"><el-button type="text" @click="innerVisibless = true" style="color: #8F87A3;">{{ $t('viewingHistory') }}</el-button></div>
                    </div>
                </div>
                <!-- 任务列表没有数据的时候展示 -->
                <div class="nones" v-if="ProgressList.length <= 0">
                    {{ $t('nodata') }} 
                </div>
                <!-- 任务进展完整状态 -->
                <el-dialog :title="$t('other.prompts')" :visible.sync="innerVisibless" append-to-body width="500px">
                <div class="integrity">
                    <h3 style="font-weight: normal;display: inline-block;margin: 0 0 20px 0;">{{ $t('taskprogress') }} ：{{ProgressList.length}}</h3>
                    <!-- <span class="write"><i class="el-icon-circle-plus"></i>填写进展</span> -->
                    <el-divider></el-divider>
                    <!--  -->
                        <div class="block" style="height: 200px;">
                            <el-timeline style="padding:20px 0 0 0;">
                                <el-timeline-item
                                v-for="(activity, index) in ProgressList"
                                :key="index">
                                <div class="tb">
                                    <span v-if="activity.status == 0" style="color: #43D14F" class="icon"></span>
                                    <span v-if="activity.status == 1" style="color: #FD7624" class="icon"></span>
                                    <span v-if="activity.status == 2" style="color: red" class="icon"></span>
                                    <div>
                                        <span v-if="activity.status == 0" style="color: #43D14F">{{ $t('normals') }}</span>
                                        <span v-if="activity.status == 1" style="color: #FD7624">{{ $t('atrisk') }}</span>
                                        <span v-if="activity.status == 2" style="color: red">{{ $t('withinthetimelimit') }}</span>
                                        <span style="display: inline-block; float: right; color: #8C8C8C">{{activity.indate | relativeTime}}</span>
                                    </div>
                                    <p style="color: #8C8C8C">{{activity.content}}</p>
                                    
                                </div>
                                </el-timeline-item>
                            </el-timeline>
                        </div>
                    <!--  -->
                </div>
                <span slot="footer" class="dialog-footer">
                    <el-button type="primary" @click="innerVisibless = false">{{ $t('Shutdown') }}</el-button>
                </span>
                </el-dialog>
                </template>
                <!-- 子任务/关联任务 -->
                <p ><i class="iconfont firerock-icontree" style="color:#20A0ff;margin-left:10px;">{{timelabel && !isRelationItem ? $t('guanlian') : $t('zirwu')}}</i>
                    <el-link style="float:right;" @click="addRelation" v-if="timelabel && !isRelationItem">{{ $t('associatedTask') }}</el-link>
                    <el-link style="float:right;" @click="addSubTask" v-else>{{ $t('addingsubtask') }}</el-link>
                </p>
                <!-- 关联任务列表 -->
                <el-table key="guanlian" :data="relationSubTaskList" v-if="timelabel && !isRelationItem"
                :header-cell-style="{'font-weight':'normal'}"
                highlight-current-row
                v-loading="listLoading"
                style="width: 100%;margin-top:10px;"
                @row-click="relationTaskClick">
                    <el-table-column prop="taskStatus" :label="$t('wan-cheng')" width="50" >
                        <template slot-scope="scope">
                            <el-checkbox :disabled="scope.row.taskStatus==2" :checked="scope.row.taskStatus==1?true:false" size="large" class="cb" @change="relationFinishTask(scope.row)" @click.stop.native=""></el-checkbox>
                        </template>
                    </el-table-column>
                    <el-table-column prop="taskName" :label="$t('biao-ti')" >
                        <template slot-scope="scope">
                            <el-tooltip class="item" effect="dark" :content="scope.row.taskName" placement="top" style="cursor:pointer;color:#409eff;">
                                <span style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;" > {{scope.row.taskName}}</span>
                            </el-tooltip>
                        </template>
                    </el-table-column>
                    <el-table-column :label="$t('operation')" width="130" align="left">
                        <template slot-scope="scope">
                            <el-button @click.stop.native="deleteRelationItem(scope.row.id)" size="mini">{{ $t('dissociated') }}</el-button>
                        </template>
                    </el-table-column>
                </el-table>
                <!--子任务列表 -->
                <el-table key="zi" :data="addForm.subTaskList" v-else
                        :header-cell-style="{'font-weight':'normal'}"
                        highlight-current-row v-loading="listLoading" style="width: 100%;margin-top:10px;" @row-click="taskLineClick">
                            <el-table-column prop="taskStatus" :label="$t('wan-cheng')" width="50" >
                            <template slot-scope="scope">
                            <el-checkbox :disabled="scope.row.taskStatus==2" :checked="scope.row.taskStatus==1?true:false" size="large" class="cb"  
                                            @click.stop.native=""
                                            @change="finishTask(scope.row)"
                                            ></el-checkbox>
                            </template>
                        </el-table-column>
                        <el-table-column prop="name" :label="$t('biao-ti')" >
                            <template slot-scope="scope">
                                <el-tooltip class="item" effect="dark" :content="scope.row.name" placement="top">
                                <span style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;" > {{scope.row.name}}</span>
                                </el-tooltip>
                            </template>
                        </el-table-column>
                        <el-table-column prop="executorName" :label="$t('zhi-hang-ren')" width="100" >
                            <template slot-scope="scope">
                                <span v-if="user.userNameNeedTranslate != 1">
                                    {{scope.row.executorName == null?$t('dai-fen-pei'):scope.row.executorName}}
                                </span>
                                <span v-if="user.userNameNeedTranslate == 1">
                                    <span v-if="scope.row.executorName == null">
                                        {{$t('dai-fen-pei')}}
                                    </span>
                                    <span v-else>
                                        <span v-for="item,index in scope.row.executorName" :key="index">
                                            <ww-open-data type='userName' :openid='item'></ww-open-data>
                                            <span v-if="index < scope.row.executorName.length - 1">,</span>
                                        </span>
                                    </span>
                                </span>
                            </template>
                        </el-table-column>
                        <el-table-column prop="endDate" :label="$t('deadline')" width="100" >
                            <template slot-scope="scope">
                                <p v-if="scope.row.endDate >= times">{{scope.row.endDate}}</p>
                                <p v-else style="background: #e62412; color: #fff;text-align: center; border-radius: 3px;">{{scope.row.endDate}}</p>
                            </template>
                        </el-table-column>
                </el-table>
            </div>
        </el-form>
        <!-- 关联文件列表 -->
        <template v-if="isEditFile">
            <div style="width:100%;margin:1em 0;">
                <i class="iconfont firerock-icontree" style="color:#20A0ff;margin-left:10px;">{{ $t('jiafuchengguo') }}</i>
                <el-link @click="relationFileClick()" style="float:right;margin-left:10px">{{ $t('associatedfiles') }}</el-link>
                <el-upload style="float:right;" action="#" :http-request="uploadFileClick" :show-file-list="false" :multiple="false">
                    <el-link>{{ $t('uoloadFiles') }}</el-link>
                </el-upload>
                
            </div>
            <el-table
                v-loading="fileListLoading"
                ref="filetable"
                :data="taskFileList"
                :header-cell-style="{'font-weight':'normal'}"
                highlight-current-row
                max-height="240"
                style="width: 100%;margin-top:10px;margin-bottom:15px">
                <el-table-column :label="$t('headerTop.serialNumber')" prop="documentType" min-width="40" align="center">
                    <template slot-scope="scope">
                        <div>
                            {{scope.$index + 1}}
                        </div>
                    </template>
                </el-table-column>
                <el-table-column :label="$t('filenames')" prop="documentName" min-width="180"></el-table-column>
                <el-table-column :label="$t('filesize')" prop="size" min-width="60" align="center"></el-table-column>
                <el-table-column :label="$t('founder')" prop="creatorName" min-width="60" align="center">
                    <template slot-scope="scope">
                        <div>
                            <span v-if="user.userNameNeedTranslate != 1">{{scope.row.creatorName}}</span>
                            <span v-if="user.userNameNeedTranslate == 1">
                                <ww-open-data type='userName' :openid='scope.row.creatorName'></ww-open-data>
                            </span>
                        </div>
                    </template>
                </el-table-column>
                <el-table-column :label="$t('creationtime')" prop="indate" min-width="120" align="center">
                    <template slot-scope="scope">
                        <span>{{scope.row.indate[0] + '-' + scope.row.indate[1] + '-' + scope.row.indate[2] + '\u0020\u0020' + scope.row.indate[3] + ':' + scope.row.indate[4] + ':' + scope.row.indate[5]}}</span>
                    </template>
                </el-table-column>
                <el-table-column :label="$t('operation')" min-width="90">
                    <template slot-scope="scope">
                        <el-link :href="scope.row.url" :download="scope.row.documentName" type="primary" style="margin-right:7px">{{ $t('other.download') }}</el-link>
                        <el-link @click="taskFileDelete(scope.row.id)">{{ $t('btn.delete') }}</el-link>
                    </template>
                </el-table-column>
            </el-table>
        </template>
        <!-- 关联文件dialog -->
        <el-dialog v-if="relationFileDialog" :visible.sync="relationFileDialog" :title="$t('associatedfiles')" append-to-body>
            <span>{{ $t('wenjian1guanli') }}</span>
            <div>
                <span>{{ $t('xuanzwenjian') }}</span>
                <el-select v-model="addFileId" filterable >
                    <el-option
                        v-for="item in projectFileList"
                        :key="item.id"
                        :label="item.documentName"
                        :value="item.id"
                    ></el-option>
                </el-select>
                <el-button @click="addTaskFile()">{{ $t('btn.determine') }}</el-button>
                <!-- <el-button @click="relationFileDialog = false">取消</el-button> -->
            </div>
        </el-dialog>
        <el-dialog v-if="isRelationTab" :visible.sync="isRelationTab" :title="$t('associatedTask')" width="800px" append-to-body>
            <el-form ref="relationItemForm" label-width="100px">
                <el-form-item :label="$t('selecttask')" prop="taskType">
                    <el-select v-model="relationvalue" multiple style="width:80%">
                        <el-option
                        v-for="item in relationdata"
                        :key="item.id"
                        :label="item.name"
                        :value="item.id"
                        ></el-option>
                    </el-select>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="isRelationTab = false">{{ $t('btn.cancel') }}</el-button>
                <el-button type="primary" @click="addRelationTask()">{{ $t('btn.determine') }}</el-button>
            </div>
        </el-dialog>
    </div>
    <div slot="footer" class="dialog-footer">
        <el-button v-if="(user.id == addForm.createrId || currentProject.inchargerId == user.id || currentProject.creatorId == user.id || permissions.projectManagement) && canAddTask" @click.native="deleteTask()" style="float:left;">{{ $t('btn.delete') }}</el-button>
        <el-button @click.native="closeBounced()">{{ $t('btn.cancel') }}</el-button>
        <el-button type="primary" @click="submitInsert" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
    </div>
    <div slot="title" v-if="addForm.parentTid != null || isRelationItem" >
        <!-- <el-link @click="backToParentTask"><i class="el-icon-arrow-left single_line">返回父级任务</i> | {{addForm.parentTname}}</el-link> -->
        <el-page-header  @back="backToParentTask" :title="timelabel ? $t('returnmilestone') : $t('parenttask')" :content="timelabel ? relationPar.name : addForm.parentTname"></el-page-header>
    </div>
    <!-- 评论 -->
    <div class="remark" v-show="addForm.id != null">
        <span class="zh">
                <div class="player">
                    <p>{{ $t('participantin') }}</p>
                    <div class="bj">
                        <span  v-for="(pl, i) in critic" :key="i">
                        <span style="background: #778899" v-if="user.userNameNeedTranslate != 1">{{pl.length > 2 ? pl.substring(pl.length - 2, pl.length) : pl}}</span>
                        <span v-if="user.userNameNeedTranslate == 1">
                            <ww-open-data type='userName' :openid='pl'></ww-open-data>
                        </span>
                        </span>
                        <!-- <span style="background: #778899">{{pl.length}}</span> -->
                    </div>
                </div>
            <div class="subject">
                <div class="sub-all">
                    <div :class="dynamicTab ? 'subOn' : ''" @click="dynamicTab = true">{{ $t('alldynamic') }}</div>
                    <div :class="dynamicTab ? '' : 'subOn'" @click="dynamicTab = false">{{ $t('xiang-guan-ri-bao') }}</div>
                </div>
                <div class="sub-details" ref="main" v-if="dynamicTab">
                    <ul class="infinite-list" v-infinite-scroll="load" ref="contRoll">
                        <div style="width: 100%" v-if="commentList.length <= 0">
                            <img src="../assets/image/xiao.png" alt="">
                        </div>
                        <li v-for="i in count" class="infinite-list-item counli" :key="i">
                            <p><i class="el-icon-s-fold"></i> <em>{{ $t('managerQucompletedthedependencytask') }}</em><span>{{ $t('onApril20') }}</span></p>
                        </li>
                        <li class="carts" v-for="item in commentList" :key="item.id">
                            <!-- <el-image style="width: 30px; height: 30px" :src="url" :fit="fit"></el-image> -->
                            <!-- <i :style="'background' + item.userColor"> -->
                            <i :style="'background' + item.userColor">
                                <i v-if="user.userNameNeedTranslate != 1">
                                    {{item.userName.length > 2 ? item.userName.substring(item.userName.length - 2, item.userName.length) : item.userName}}
                                </i>   
                                <i v-if="user.userNameNeedTranslate == 1">
                                    <ww-open-data type='userName' :openid='item.userName'></ww-open-data>
                                </i>
                            </i>
                            <div>
                                <!-- <p>{{item.userName}}</p> -->
                                <!-- <p> -->
                                    <p v-if="user.userNameNeedTranslate != 1">
                                        {{item.userName}}
                                    </p>
                                    <p v-if="user.userNameNeedTranslate == 1">
                                        <ww-open-data type='userName' :openid='item.userName'></ww-open-data>
                                    </p>
                                <!-- </p> -->
                                <em>
                                    <!-- {{item.content}} -->
                                    <p style="display: inline-block;padding: 0;margin: 0;" v-if="user.userNameNeedTranslate == 1">
                                        {{item.content.msg1}}
                                        <ww-open-data type='userName' :openid='item.content.msg2'></ww-open-data>
                                        {{item.content.msg3}}
                                    </p>
                                    <p style="display: inline-block;padding: 0;margin: 0;" v-if="user.userNameNeedTranslate != 1">{{item.content}}</p>
                                </em>
                            </div>
                            <span>{{item.createTime | relativeTime}}</span>
                        </li>
                    </ul>
                </div>
                <div class="Daily" v-if="!dynamicTab">
                    <div class="one_daily_body DailyBody">
                        <el-card shadow="never" v-for="(item2,index2) in dailyList" :key="index2" style="margin-bottom: 20px;">
                            <p>
                                {{ $t('tian-bao-ren') }}： <span v-if="user.userNameNeedTranslate != 1">{{item2.userName}}</span>
                                <span v-if="user.userNameNeedTranslate == 1">
                                    <ww-open-data type='userName' :openid='item2.userName'></ww-open-data>
                                </span>
                                <span style="float: right;">{{item2.createDate}}</span>
                            </p>
                            <p>{{ $t('other.approvalStatus') }}：
                                <span v-if="user.company.packageEngineering == 0">
                                    <span style="margin-left:15px;color:#DAA520;"  v-if="item2.state == 0">
                                        <span v-if="item2.isDeptAudit==0">
                                            <span v-if="item2.projectAuditState==0">
                                                <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
                                                <span v-if="item2.projectAuditorName != null">(
                                                    <span v-if="user.userNameNeedTranslate == '1'">
                                                        <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
                                                    </span>
                                                    <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
                                                    )</span> 
                                                <!-- 审核 --> {{$t('other.audit')}}
                                            </span>
                                            <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
                                                <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
                                                <span v-if="item2.projectAuditorName != null">(
                                                    <!-- {{item2.projectAuditorName}} -->
                                                    <span v-if="user.userNameNeedTranslate == '1'">
                                                        <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
                                                    </span>
                                                    <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
                                                    )</span>
                                                <!-- 审核通过 --> {{$t('state.approved')}}
                                            </span>
                                        </span>
                                        <span v-else-if="item2.isDeptAudit==1">
                                            ({{$t('other.await')}}
                                            <span v-if="user.userNameNeedTranslate == '1'">
                                                <ww-open-data type='departmentName' :openid='item2.auditDeptName'></ww-open-data>
                                            </span>
                                            <span v-if="user.userNameNeedTranslate != '1'">{{item2.auditDeptName}}</span>
                                            {{$t('other.audit')}})
                                        </span>
                                        </span> 
                                    <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">{{$t('other.importWaitingForReview')}}</span>
                                    <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">{{$t('state.alreadyPassed')}}
                                        <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1">{{$t('other.automaticReview')}}</span>
                                    </span>
                                    
                                    <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">{{$t('state.rejected')}} {{$t('other.reason')}}:{{item2.rejectReason}}</span>
                                    <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">{{$t('state.waitingsubmit')}}</span>
                                </span>
                                <span v-if="user.company.packageEngineering == 1">
                                    <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">{{$t('other.importWaitingForReview')}}</span>
                                    <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">{{$t('other.waitingForProfessionalReview')}}</span>
                                    <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">{{$t('other.waitingForDepartmentReview')}}</span>
                                    <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">{{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
                                        (
                                            <span v-if="user.userNameNeedTranslate != 1">
                                                {{item2.projectAuditorName}}
                                            </span>
                                            <span v-if="user.userNameNeedTranslate == 1">
                                                <ww-open-data type='userName' :openid='item2.projectAuditorName'></ww-open-data>
                                            </span>
                                        )
                                    </span>{{$t('other.audit')}}</span>
                                    <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">{{$t('state.alreadyPassed')}}</span>
                                    <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">{{$t('state.rejected')}} {{$t('other.reason')}}:{{item2.rejectReason}}</span>
                                    <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">{{$t('state.waitingsubmit')}}</span>
                                </span>
                            </p>
                            <p v-if="user.timeType.customDegreeActive==1 && item2.degree_id != null && item2.degree_id != -1">{{user.timeType.customDegreeName}}：{{item2.degreeName}}</p>
                            <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}：{{item2.customData}}</p>
                            <!-- 自定义日报文本 -->
                            <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}：{{item2.customText}}</p>
                            <p v-if="user.company.packageEngineering == 1">
                                {{$t('other.professionalProgress')}}：
                                <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%) 
                                    <el-tooltip v-if="progressItem.auditState == 0"  :content="$t('state.WaitingAudit')" effect="light" placement="top">
                                    <i class="iconfont firerock-icondaibandengdaishenhe"></i>
                                    </el-tooltip>
                                    <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
                                    <i  class="iconfont firerock-iconshenhetongguo"></i>
                                    </el-tooltip>
                                    <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
                                    <i  class="iconfont firerock-iconshenhebohui"></i>
                                    </el-tooltip>
                                    </span>
                            </p>
                            <div v-if="item2.multiWorktime==0">
                            <p style="display: inline-block;">{{$t('time.duration')}}：
                                <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
                                <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
                            {{item2.time.toFixed(1)}}h  
                            <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">{{$t('other.WorkOvertime')}}<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag>
                            </p>
                            <p>{{$t('other.matters')}}：<span v-html="item2.content"></span></p>
                            </div>
                            <div v-if="item2.multiWorktime==1" >
                                <p>{{$t('other.projectDuration')}}：{{item2.time.toFixed(1)}}h  <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">{{ $t('other.WorkOvertime') }}<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag></p>
                                <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
                                    style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
                                    <p style="display: inline-block;">{{$t('time.duration')}}：
                                        <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
                                    {{timeItem.time.toFixed(1)}}h  
                                    </p>
                                    <p>{{$t('other.matters')}}：<span v-html="timeItem.content"></span></p>
                                </div>
                            </div>
                            <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}：<span v-html="item2.evaluate"></span></p>
                            
                            <!--照片的显示 -->
                            <p v-if="item2.pics != null && item2.pics.length > 0"> 
                                <el-image v-for="(pic, index) in item2.pics" :key="index"
                                    style="width: 100px; height: 100px; margin-right:10px;"
                                    :src="pic" 
                                    :preview-src-list="item2.pics">
                                </el-image>
                            </p>
                        </el-card>
                    </div>
                </div>
            </div>
            <div class="issue" v-if="dynamicTab">
                <!-- <el-input type="textarea" class="textareays" label-width="100%" label-height="140px"></el-input> -->
                <div class="issue_fixation">
                    <div class="inputDeep"><el-input
                    type="textarea"
                    :placeholder="$t('pleaseentercontent')"
                    :autosize="{ minRows: 6, maxRows: 6}"
                    v-model="textarea2"
                    class="inputDeeps"
                    >
                    </el-input></div>
                    <el-button class="issue-button" type="primary" @click="release()">{{ $t('fa-bu') }}</el-button>
                </div>
            </div>
        </span>
    </div>
  </div>
</template>

<script>
// 富文本样式
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
// 导入富文本
import { quillEditor } from 'vue-quill-editor'
export default {
  props: {
    integrationTask:{
        type: Object,
        default: {}
    },
  },
  components: {
    quillEditor, // 富文本
  },
  data() {
    return {
        user: JSON.parse(sessionStorage.getItem("user")),
        permissions: JSON.parse(sessionStorage.getItem("permissions")),
        date: new Date(),
        editorOption: { // 富文本框里面的默认值
            placeholder: this.$t('pleaseentethetext'),
             modules: {
                toolbar:[
                    ['bold', 'italic', 'underline', 'strike'],    //加粗，斜体，下划线，删除线
                    // ['blockquote', 'code-block'],     //引用，代码块
            
                    [{ 'header': 1 }, { 'header': 2 }],        // 标题，键值对的形式；1、2表示字体大小
                    // [{ 'list': 'ordered'}, { 'list': 'bullet' }],     //列表
                    // [{ 'script': 'sub'}, { 'script': 'super' }],   // 上下标
                    // [{ 'indent': '-1'}, { 'indent': '+1' }],     // 缩进
                    // [{ 'direction': 'rtl' }],             // 文本方向
            
                    [{ 'size': ['small', false, 'large', 'huge'] }], // 字体大小
                    [{ 'header': [1, 2, 3, 4, 5, 6, false] }],     //几级标题
            
                    [{ 'color': [] }, { 'background': [] }],     // 字体颜色，字体背景颜色
                    // [{ 'font': [] }],     //字体
                    [{ 'align': [] }],    //对齐方式
            
                    ['clean'],    //清除字体样式
                    // ['image','video']    //上传图片、上传视频
                    ['image']    //上传图片、上传视频
                ], //工具栏设置
            },
            theme: 'snow',
        },

        taskTypeList:[{id:0,name:this.$t('other.task'), icon:"iconfont firerock-iconrenwu"},{id:1,name:this.$t('other.milestone'),icon:"iconfont firerock-iconicon-"},{id:2,name:this.$t('risk'),icon:"iconfont firerock-iconfengxian"}],
        
        addForm: {},
        currentProject: {},
        checkLists: {}
    };
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {
    console.log('我获取到的数据', this.integrationTask)
    this.addForm = this.integrationTask.addForm
    this.currentProject = this.integrationTask.currentProject
    this.checkLists = this.integrationTask.checkLists
  },
  methods: {
    // 关闭最外层弹窗
    closeBounced() {
        this.$emit('closeBounced')
    }
  },
};
</script>

<style scoped>

</style>
