<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.release.main_grid.columns.id')" :width="80"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.release.main_grid.columns.id')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.id}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('name')">
                <el-table-column show-overflow-tooltip :prop="'name'" :label="$t('entities.release.main_grid.columns.name')" :min-width="200"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.release.main_grid.columns.name')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-column-link deKeyField='release' :context="JSON.parse(JSON.stringify(context))" :viewparams="JSON.parse(JSON.stringify(viewparams))" :data="row" :linkview="{viewname: 'release-main-tab-exp-view', height: 0,width: 0,title: $t('entities.release.views.maintabexpview.title'),placement: 'DRAWER_TOP', isRedirectView: false,deResParameters: [
            { pathName: 'products', parameterName: 'product' },
            ]
            ,parameters: [
            { pathName: 'releases', parameterName: 'release' },
            { pathName: 'maintabexpview', parameterName: 'maintabexpview' }
            ]}" valueitem="srfkey">
                            <span>{{row.name}}</span>
                        </app-column-link >
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('buildname')">
                <el-table-column show-overflow-tooltip :prop="'buildname'" :label="$t('entities.release.main_grid.columns.buildname')" :width="150"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.release.main_grid.columns.buildname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-column-link deKeyField='build' :context="JSON.parse(JSON.stringify(context))" :viewparams="JSON.parse(JSON.stringify(viewparams))" :data="row" :linkview="{viewname: 'build-main-tab-exp-view', height: 0,width: 0,title: $t('entities.build.views.maintabexpview.title'),placement: 'DRAWER_TOP', isRedirectView: false,deResParameters: [
            { pathName: 'products', parameterName: 'product' },
            ]
            ,parameters: [
            { pathName: 'builds', parameterName: 'build' },
            { pathName: 'maintabexpview', parameterName: 'maintabexpview' }
            ]}" valueitem="build">
                            <span>{{row.buildname}}</span>
                        </app-column-link >
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('status')">
                <el-table-column show-overflow-tooltip :prop="'status'" :label="$t('entities.release.main_grid.columns.status')" :width="120"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.release.main_grid.columns.status')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.status" tag='Release__status' codelistType='STATIC' ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('date')">
                <el-table-column show-overflow-tooltip :prop="'date'" :label="$t('entities.release.main_grid.columns.date')" :width="120"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.release.main_grid.columns.date')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-format-data format="YYYY-MM-DD" :data="row.date"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('uagridcolumn1')">
                <el-table-column :column-key="'uagridcolumn1'" fixed="right" :label="$t('entities.release.main_grid.columns.uagridcolumn1')" :width="200"  :align="'center'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.release.main_grid.columns.uagridcolumn1')}}
                      </span>
                    </template>
                    <template slot-scope="scope">
                        <div style="text-align: center;">
                          <a v-show="scope.row.linkstory.visabled" :disabled="scope.row.linkstory.disabled" @click="uiAction(scope.row, 'linkstory', $event)" :title="$t('entities.release.main_grid.uiactions.release_linkstory')">
                            <i class='fa fa-link'></i>
                            
                          </a>
                          <divider v-show="scope.row.linkbug.visabled" type='vertical'></divider>
                          <a v-show="scope.row.linkbug.visabled" :disabled="scope.row.linkbug.disabled" @click="uiAction(scope.row, 'linkbug', $event)" :title="$t('entities.release.main_grid.uiactions.release_linkbug')">
                            <i class='fa fa-bug'></i>
                            
                          </a>
                          <divider v-show="scope.row.active.visabled" type='vertical'></divider>
                          <a v-show="scope.row.active.visabled" :disabled="scope.row.active.disabled" @click="uiAction(scope.row, 'active', $event)" :title="$t('entities.release.main_grid.uiactions.release_active')">
                            <i class='fa fa-play'></i>
                            
                          </a>
                          <divider v-show="scope.row.terminal.visabled" type='vertical'></divider>
                          <a v-show="scope.row.terminal.visabled" :disabled="scope.row.terminal.disabled" @click="uiAction(scope.row, 'terminal', $event)" :title="$t('entities.release.main_grid.uiactions.release_terminal')">
                            <i class='fa fa-pause'></i>
                            
                          </a>
                          <divider v-show="scope.row.quickEdit.visabled" type='vertical'></divider>
                          <a v-show="scope.row.quickEdit.visabled" :disabled="scope.row.quickEdit.disabled" @click="uiAction(scope.row, 'quickEdit', $event)" :title="$t('entities.release.main_grid.uiactions.release_quickedit')">
                            <i class='fa fa-edit'></i>
                            
                          </a>
                          <divider v-show="scope.row.remove.visabled" type='vertical'></divider>
                          <a v-show="scope.row.remove.visabled" :disabled="scope.row.remove.disabled" @click="uiAction(scope.row, 'remove', $event)" :title="$t('entities.release.main_grid.uiactions.release_remove')">
                            <i class='fa fa-remove'></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>