<div :class="{ 'grid': true, 'show-paging-bar': isEnablePagingBar, 'hidden-paging-bar': !isEnablePagingBar }">
    <i-form>
    <el-table v-if="isDisplay === true"
        :default-sort="{ prop: minorSortPSDEF, order: Object.is(minorSortDir, 'ASC') ? 'ascending' : Object.is(minorSortDir, 'DESC') ? 'descending' : '' }"  
        @sort-change="onSortChange($event)"  
        :border="isDragendCol"
        :highlight-current-row ="isSingleSelect"
        :row-class-name="getRowClassName.bind(_self)"
        :cell-class-name="getCellClassName.bind(_self)"
        size="mini"
        stripe
        :height="tableHeight"
        @row-click="rowClick($event)"  
        @select-all="selectAll($event)"  
        @select="select($event)"  
        @row-class-name="onRowClassName($event)"  
        @row-dblclick="rowDBLClick($event)"  
        ref='multipleTable' :data="items" :show-header="!isHideHeader">
            <template slot="empty">
                无数据 
                <span class="quick-toolbar">
                </span>
            </template>
            <template v-if="!isSingleSelect">
                <el-table-column align="center" type='selection' :width="checkboxColWidth"></el-table-column>
            </template>
            <template v-if="getColumnState('id')">
                <el-table-column show-overflow-tooltip :prop="'id'" :label="$t('entities.task.myfavoritemain_grid.columns.id')" :width="80"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.task.myfavoritemain_grid.columns.id')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.id}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('pri')">
                <el-table-column show-overflow-tooltip :prop="'pri'" :label="$t('entities.task.myfavoritemain_grid.columns.pri')" :width="80"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.task.myfavoritemain_grid.columns.pri')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.pri" tag='Task__pri' codelistType='STATIC' ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('productname')">
                <el-table-column show-overflow-tooltip :prop="'productname'" :label="$t('entities.task.myfavoritemain_grid.columns.productname')" :min-width="200"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.task.myfavoritemain_grid.columns.productname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.productname}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('projectname')">
                <el-table-column show-overflow-tooltip :prop="'projectname'" :label="$t('entities.task.myfavoritemain_grid.columns.projectname')" :min-width="200"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.task.myfavoritemain_grid.columns.projectname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-column-link deKeyField='project' :context="JSON.parse(JSON.stringify(context))" :viewparams="JSON.parse(JSON.stringify(viewparams))" :data="row" :linkview="{viewname: 'project-main-tab-exp-view', height: 0,width: 0,title: $t('entities.project.views.maintabexpview.title'),placement: '', isRedirectView: false,deResParameters: [
            ]
            ,parameters: [
            { pathName: 'projects', parameterName: 'project' },
            { pathName: 'maintabexpview', parameterName: 'maintabexpview' }
            ]}" valueitem="project">
                            <span>{{row.projectname}}</span>
                        </app-column-link >
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('name')">
                <el-table-column show-overflow-tooltip :prop="'name'" :label="$t('entities.task.myfavoritemain_grid.columns.name')" :min-width="200"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.task.myfavoritemain_grid.columns.name')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-column-link deKeyField='task' :context="JSON.parse(JSON.stringify(context))" :viewparams="JSON.parse(JSON.stringify(viewparams))" :data="row" :linkview="{viewname: 'task-main-dashboard-view', height: 0,width: 1360,title: $t('entities.task.views.maindashboardview.title'),placement: 'DRAWER_TOP', isRedirectView: false,deResParameters: [
            { pathName: 'stories', parameterName: 'story' },
            ]
            ,parameters: [
            { pathName: 'tasks', parameterName: 'task' },
            { pathName: 'maindashboardview', parameterName: 'maindashboardview' }
            ]}" valueitem="srfkey">
                            <span>{{row.name}}</span>
                        </app-column-link >
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('status1')">
                <el-table-column show-overflow-tooltip :prop="'status1'" :label="$t('entities.task.myfavoritemain_grid.columns.status1')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.task.myfavoritemain_grid.columns.status1')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.status1" tag='TaskStatusCK' codelistType='STATIC' ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('assignedto')">
                <el-table-column show-overflow-tooltip :prop="'assignedto'" :label="$t('entities.task.myfavoritemain_grid.columns.assignedto')" :width="150"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                          <i class='fa fa-hand-o-right'></i>
                        {{$t('entities.task.myfavoritemain_grid.columns.assignedto')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
                            <a @click="uiAction(row, 'AssignTask', $event)">
            <codelist :value="row.assignedto" tag='UserRealName' codelistType='DYNAMIC' renderMode="STR" valueSeparator="," textSeparator="," ></codelist>
                            </a>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('finishedby')">
                <el-table-column show-overflow-tooltip :prop="'finishedby'" :label="$t('entities.task.myfavoritemain_grid.columns.finishedby')" :width="150"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.task.myfavoritemain_grid.columns.finishedby')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.finishedby" tag='UserRealName' codelistType='DYNAMIC' renderMode="STR" valueSeparator="," textSeparator="," ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('estimate')">
                <el-table-column show-overflow-tooltip :prop="'estimate'" :label="$t('entities.task.myfavoritemain_grid.columns.estimate')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.task.myfavoritemain_grid.columns.estimate')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data dataType="FLOAT" precision="0" :data="row.estimate"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('consumed')">
                <el-table-column show-overflow-tooltip :prop="'consumed'" :label="$t('entities.task.myfavoritemain_grid.columns.consumed')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.task.myfavoritemain_grid.columns.consumed')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data dataType="FLOAT" precision="0" :data="row.consumed"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('left')">
                <el-table-column show-overflow-tooltip :prop="'left'" :label="$t('entities.task.myfavoritemain_grid.columns.left')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.task.myfavoritemain_grid.columns.left')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data dataType="FLOAT" precision="0" :data="row.left"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('deadline')">
                <el-table-column show-overflow-tooltip :prop="'deadline'" :label="$t('entities.task.myfavoritemain_grid.columns.deadline')" :width="120"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.task.myfavoritemain_grid.columns.deadline')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-format-data format="YYYY-MM-DD" :data="row.deadline"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('uagridcolumn1')">
                <el-table-column :column-key="'uagridcolumn1'" fixed="right" :label="$t('entities.task.myfavoritemain_grid.columns.uagridcolumn1')" :width="200"  :align="'center'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.task.myfavoritemain_grid.columns.uagridcolumn1')}}
                      </span>
                    </template>
                    <template slot-scope="scope">
                        <div style="text-align: center;">
                          <a v-show="scope.row.confirmStoryChange.visabled" :disabled="scope.row.confirmStoryChange.disabled" @click="uiAction(scope.row, 'confirmStoryChange', $event)" :title="$t('entities.task.myfavoritemain_grid.uiactions.task_confirmstorychange')">
                            <i class='fa fa-search'></i>
                            
                          </a>
                          <divider v-show="scope.row.StartTask.visabled" type='vertical'></divider>
                          <a v-show="scope.row.StartTask.visabled" :disabled="scope.row.StartTask.disabled" @click="uiAction(scope.row, 'StartTask', $event)" :title="$t('entities.task.myfavoritemain_grid.uiactions.task_starttask')">
                            <i class='fa fa-play-circle-o'></i>
                            
                          </a>
                          <divider v-show="scope.row.CloseTask.visabled" type='vertical'></divider>
                          <a v-show="scope.row.CloseTask.visabled" :disabled="scope.row.CloseTask.disabled" @click="uiAction(scope.row, 'CloseTask', $event)" :title="$t('entities.task.myfavoritemain_grid.uiactions.task_closetask')">
                            <i class='fa fa-power-off'></i>
                            
                          </a>
                          <divider v-show="scope.row.DoneTask.visabled" type='vertical'></divider>
                          <a v-show="scope.row.DoneTask.visabled" :disabled="scope.row.DoneTask.disabled" @click="uiAction(scope.row, 'DoneTask', $event)" :title="$t('entities.task.myfavoritemain_grid.uiactions.task_donetask')">
                            <i class='fa fa-check-square-o'></i>
                            
                          </a>
                          <divider v-show="scope.row.MainEdit.visabled" type='vertical'></divider>
                          <a v-show="scope.row.MainEdit.visabled" :disabled="scope.row.MainEdit.disabled" @click="uiAction(scope.row, 'MainEdit', $event)" :title="$t('entities.task.myfavoritemain_grid.uiactions.task_mainedit')">
                            <i class='fa fa-edit'></i>
                            
                          </a>
                          <divider v-show="scope.row.NewSubTask.visabled" type='vertical'></divider>
                          <a v-show="scope.row.NewSubTask.visabled" :disabled="scope.row.NewSubTask.disabled" @click="uiAction(scope.row, 'NewSubTask', $event)" :title="$t('entities.task.myfavoritemain_grid.uiactions.task_newsubtask')">
                            <i class='iconfont studio-icon-subnets'></i>
                            
                          </a>
                          <divider v-show="scope.row.TaskFavorites.visabled" type='vertical'></divider>
                          <a v-show="scope.row.TaskFavorites.visabled" :disabled="scope.row.TaskFavorites.disabled" @click="uiAction(scope.row, 'TaskFavorites', $event)" :title="$t('entities.task.myfavoritemain_grid.uiactions.task_taskfavorites')">
                            <i class='fa fa-star-o'></i>
                            
                          </a>
                          <divider v-show="scope.row.TaskNFavorites.visabled" type='vertical'></divider>
                          <a v-show="scope.row.TaskNFavorites.visabled" :disabled="scope.row.TaskNFavorites.disabled" @click="uiAction(scope.row, 'TaskNFavorites', $event)" :title="$t('entities.task.myfavoritemain_grid.uiactions.task_tasknfavorites')">
                            <i class='fa fa-star'></i>
                            
                          </a>
                        </div>
                    </template>
                </el-table-column>
            </template>
            <template v-if="adaptiveState">
                <el-table-column></el-table-column>
            </template>
    </el-table>
    <row class='grid-pagination' v-show="items.length > 0">
        <page class='pull-right' @on-change="pageOnChange($event)" 
            @on-page-size-change="onPageSizeChange($event)"
            :transfer="true" :total="totalRecord"
            show-sizer :current="curPage" :page-size="limit"
            :page-size-opts="[10, 20, 30, 40, 50, 60, 70, 80, 90, 100]" show-elevator show-total>
            <span>
                <span class="page-column">
                    <poptip transfer placement="top-start">
                        <i-button icon="md-menu">{{$t('app.gridpage.choicecolumns')}}</i-button>
                        <div slot="content">
                            <template v-for="col in allColumns">
                                <div :key="col.name"><el-checkbox v-model="col.show" @change="onColChange()">{{$t(col.langtag)}}</el-checkbox></div>
                            </template>
                        </div>
                    </poptip>
                </span>
                <span v-if="selections.length > 0" class="batch-toolbar">
                </span>
                <span class="page-button"><i-button icon="md-refresh" :title="$t('app.gridpage.refresh')" @click="pageRefresh()"></i-button></span>&nbsp;
                <span>
                    {{$t('app.gridpage.show')}}&nbsp;
                    <span>
                        <template v-if="items.length === 1">
                        1
                        </template>
                        <template v-else>
                            <span>{{(curPage - 1) * limit + 1}}&nbsp;-&nbsp;{{totalRecord > curPage * limit ? curPage * limit : totalRecord}}</span>
                        </template>
                    </span>&nbsp;
                    {{$t('app.gridpage.records')}}，{{$t('app.gridpage.totle')}}&nbsp;{{totalRecord}}&nbsp;{{$t('app.gridpage.records')}}
                </span>
            </span>
        </page>
    </row>
  </i-form>
</div>