<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.user.main_grid.columns.id')" :width="70"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.user.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('realname')">
                <el-table-column show-overflow-tooltip :prop="'realname'" :label="$t('entities.user.main_grid.columns.realname')" :width="150"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.user.main_grid.columns.realname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-column-link deKeyField='user' :context="JSON.parse(JSON.stringify(context))" :viewparams="JSON.parse(JSON.stringify(viewparams))" :data="row" :linkview="{viewname: 'user-infoedit-view', height: 0,width: 750,title: $t('entities.user.views.infoeditview.title'),placement: 'DRAWER_LEFT', isRedirectView: false,deResParameters: [
            ]
            ,parameters: [
            { pathName: 'users', parameterName: 'user' },
            { pathName: 'infoeditview', parameterName: 'infoeditview' }
            ]}" valueitem="srfkey">
                            <span>{{row.realname}}</span>
                        </app-column-link >
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('account')">
                <el-table-column show-overflow-tooltip :prop="'account'" :label="$t('entities.user.main_grid.columns.account')" :width="150"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.user.main_grid.columns.account')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.account}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('role')">
                <el-table-column show-overflow-tooltip :prop="'role'" :label="$t('entities.user.main_grid.columns.role')" :width="150"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.user.main_grid.columns.role')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.role" tag='Role' codelistType='DYNAMIC' ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('email')">
                <el-table-column show-overflow-tooltip :prop="'email'" :label="$t('entities.user.main_grid.columns.email')" :width="200"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.user.main_grid.columns.email')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.email}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('gender')">
                <el-table-column show-overflow-tooltip :prop="'gender'" :label="$t('entities.user.main_grid.columns.gender')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.user.main_grid.columns.gender')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.gender" tag='User__gender' codelistType='STATIC' ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('phone')">
                <el-table-column show-overflow-tooltip :prop="'phone'" :label="$t('entities.user.main_grid.columns.phone')" :width="150"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.user.main_grid.columns.phone')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.phone}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('qq')">
                <el-table-column show-overflow-tooltip :prop="'qq'" :label="$t('entities.user.main_grid.columns.qq')" :width="200"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.user.main_grid.columns.qq')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.qq}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('address')">
                <el-table-column show-overflow-tooltip :prop="'address'" :label="$t('entities.user.main_grid.columns.address')" :min-width="200"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.user.main_grid.columns.address')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.address}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('last')">
                <el-table-column show-overflow-tooltip :prop="'last'" :label="$t('entities.user.main_grid.columns.last')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.user.main_grid.columns.last')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.last}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('visits')">
                <el-table-column show-overflow-tooltip :prop="'visits'" :label="$t('entities.user.main_grid.columns.visits')" :width="120"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.user.main_grid.columns.visits')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.visits}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('uagridcolumn1')">
                <el-table-column :column-key="'uagridcolumn1'" fixed="right" :label="$t('entities.user.main_grid.columns.uagridcolumn1')" :width="150"  :align="'center'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.user.main_grid.columns.uagridcolumn1')}}
                      </span>
                    </template>
                    <template slot-scope="scope">
                        <div style="text-align: center;">
                          <a v-show="scope.row.Edit.visabled" :disabled="scope.row.Edit.disabled" @click="uiAction(scope.row, 'Edit', $event)" :title="$t('entities.user.main_grid.uiactions.user_edit')">
                            <i class='fa fa-edit'></i>
                            
                          </a>
                          <divider v-show="scope.row.Delete.visabled" type='vertical'></divider>
                          <a v-show="scope.row.Delete.visabled" :disabled="scope.row.Delete.disabled" @click="uiAction(scope.row, 'Delete', $event)" :title="$t('entities.user.main_grid.uiactions.user_delete')">
                            <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>