<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
        @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('accountname')">
                <el-table-column show-overflow-tooltip :prop="'accountname'" :label="$t('entities.account.main_grid.columns.accountname')" :width="250"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.account.main_grid.columns.accountname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-column-link deKeyField='account' :context="JSON.parse(JSON.stringify(context))" :viewparams="JSON.parse(JSON.stringify(viewparams))" :data="row" :linkview="{viewname: 'account-info', height: 0,width: 0,title: $t('entities.account.views.info.title'),placement: '', isRedirectView: false,deResParameters: [
            ]
            ,parameters: [
            { pathName: 'accounts', parameterName: 'account' },
            { pathName: 'info', parameterName: 'info' }
            ]}" valueitem="srfkey">
                            <span>{{row.accountname}}</span>
                        </app-column-link >
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('telephone1')">
                <el-table-column show-overflow-tooltip :prop="'telephone1'" :label="$t('entities.account.main_grid.columns.telephone1')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.account.main_grid.columns.telephone1')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.telephone1}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('address1_city')">
                <el-table-column show-overflow-tooltip :prop="'address1_city'" :label="$t('entities.account.main_grid.columns.address1_city')" :width="120"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.account.main_grid.columns.address1_city')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.address1_city}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('primarycontactname')">
                <el-table-column show-overflow-tooltip :prop="'primarycontactname'" :label="$t('entities.account.main_grid.columns.primarycontactname')" :width="120"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.account.main_grid.columns.primarycontactname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-column-link deKeyField='contact' :context="JSON.parse(JSON.stringify(context))" :viewparams="JSON.parse(JSON.stringify(viewparams))" :data="row" :linkview="{viewname: 'contact-info', height: 0,width: 0,title: $t('entities.contact.views.info.title'),placement: '', isRedirectView: false,deResParameters: [
            { pathName: 'accounts', parameterName: 'account' },
            ]
            ,parameters: [
            { pathName: 'contacts', parameterName: 'contact' },
            { pathName: 'info', parameterName: 'info' }
            ]}" valueitem="primarycontactid">
                            <span>{{row.primarycontactname}}</span>
                        </app-column-link >
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('emailaddress1')">
                <el-table-column show-overflow-tooltip :prop="'emailaddress1'" :label="$t('entities.account.main_grid.columns.emailaddress1')" :width="120"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.account.main_grid.columns.emailaddress1')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.emailaddress1}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('revenue')">
                <el-table-column show-overflow-tooltip :prop="'revenue'" :label="$t('entities.account.main_grid.columns.revenue')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.account.main_grid.columns.revenue')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.revenue}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('parentaccountname')">
                <el-table-column show-overflow-tooltip :prop="'parentaccountname'" :label="$t('entities.account.main_grid.columns.parentaccountname')" :width="200"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.account.main_grid.columns.parentaccountname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-column-link deKeyField='account' :context="JSON.parse(JSON.stringify(context))" :viewparams="JSON.parse(JSON.stringify(viewparams))" :data="row" :linkview="{viewname: 'account-info', height: 0,width: 0,title: $t('entities.account.views.info.title'),placement: '', isRedirectView: false,deResParameters: [
            ]
            ,parameters: [
            { pathName: 'accounts', parameterName: 'account' },
            { pathName: 'info', parameterName: 'info' }
            ]}" valueitem="parentaccountid">
                            <span>{{row.parentaccountname}}</span>
                        </app-column-link >
                    </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>