Skip to content

Commit

Permalink
fixd bug
Browse files Browse the repository at this point in the history
  • Loading branch information
黄书伟 committed Oct 11, 2017
1 parent 4756599 commit 1af0e6b
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 52 deletions.
6 changes: 3 additions & 3 deletions libs/themes-base/v-table.css
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
/*font-size:16px;*/
width:16px;
height: 19px;
margin-left: -8px;
margin-left: -5px;
overflow: hidden;
cursor: pointer;
}
Expand All @@ -150,11 +150,11 @@
}

.v-table-sort-icon i:first-child {
top: -4px;
top: -5px;
}

.v-table-sort-icon i:last-child {
bottom: -0px;
bottom: 1px;
}

.v-table-header .cursorPointer{
Expand Down
54 changes: 31 additions & 23 deletions libs/v-table/src/table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@
@mouseout.stop="handleTitleMouseOut()">
<div :class="['v-table-title-cell',showVerticalBorder?'vertical-border':'',showHorizontalBorder?'horizontal-border':'']"
:style="{'width':titleColumnWidth(col.fields)+'px','height':titleColumnHeight(col.rowspan)+'px','text-align':col.titleAlign}">
<span class="table-title" v-html="col.title"></span>
<span @click.stop="sortControl(col.fields[0],col.orderBy)"
class="v-table-sort-icon" v-if="enableSort(col.orderBy)">
<i :class='["v-icon-up-dir",col.orderBy ==="asc" ? "checked":""]'></i>
<i :class='["v-icon-down-dir",col.orderBy ==="desc" ? "checked":""]'></i>
<span class="table-title">
<span v-html="col.title"></span>
<span @click.stop="sortControl(col.fields[0],col.orderBy)"
class="v-table-sort-icon" v-if="enableSort(col.orderBy)">
<i :class='["v-icon-up-dir",col.orderBy ==="asc" ? "checked":""]'></i>
<i :class='["v-icon-down-dir",col.orderBy ==="desc" ? "checked":""]'></i>
</span>
</span>
</div>
</td>
Expand All @@ -40,12 +42,14 @@
@mouseout.stop="handleTitleMouseOut()">
<div :class="['v-table-title-cell',showVerticalBorder?'vertical-border':'',showHorizontalBorder?'horizontal-border':'']"
:style="{'width':col.width+'px','height':titleRowHeight+'px','text-align':col.titleAlign}">
<span class="table-title" v-html="col.title"></span>
<span @click.stop="sortControl(col.field,col.orderBy)"
class="v-table-sort-icon" v-if="enableSort(col.orderBy)">
<i :class='["v-icon-up-dir",col.orderBy ==="asc" ? "checked":""]'></i>
<i :class='["v-icon-down-dir",col.orderBy ==="desc" ? "checked":""]'></i>
</span>
<span class="table-title">
<span v-html="col.title"></span>
<span @click.stop="sortControl(col.field,col.orderBy)"
class="v-table-sort-icon" v-if="enableSort(col.orderBy)">
<i :class='["v-icon-up-dir",col.orderBy ==="asc" ? "checked":""]'></i>
<i :class='["v-icon-down-dir",col.orderBy ==="desc" ? "checked":""]'></i>
</span>
</span>
</div>
</td>
</tr>
Expand Down Expand Up @@ -95,7 +99,8 @@
>
<template
v-if="typeof col.componentName ==='string' && col.componentName.length > 0">
<component :rowData="item" :field="col.field ? col.field : ''" :index="rowIndex"
<component :rowData="item" :field="col.field ? col.field : ''"
:index="rowIndex"
:is="col.componentName"></component>
</template>
<template v-else>
Expand Down Expand Up @@ -135,13 +140,14 @@
@mouseout.stop="handleTitleMouseOut()">
<div :class="['v-table-title-cell',showVerticalBorder?'vertical-border':'',showHorizontalBorder?'horizontal-border':'']"
:style="{'width':titleColumnWidth(col.fields)+'px','height':titleColumnHeight(col.rowspan)+'px','text-align':col.titleAlign}">
<span class="table-title" v-html="col.title"></span>
<span @click.stop="sortControl(col.fields[0],col.orderBy)"
class="v-table-sort-icon" v-if="enableSort(col.orderBy)">
<i :class='["v-icon-up-dir",col.orderBy ==="asc" ? "checked":""]'></i>
<i :class='["v-icon-down-dir",col.orderBy ==="desc" ? "checked":""]'></i>
<span class="table-title">
<span v-html="col.title"></span>
<span @click.stop="sortControl(col.fields[0],col.orderBy)"
class="v-table-sort-icon" v-if="enableSort(col.orderBy)">
<i :class='["v-icon-up-dir",col.orderBy ==="asc" ? "checked":""]'></i>
<i :class='["v-icon-down-dir",col.orderBy ==="desc" ? "checked":""]'></i>
</span>
</span>

</div>
</td>
</tr>
Expand All @@ -156,11 +162,13 @@
@mouseout.stop="handleTitleMouseOut()">
<div :class="['v-table-title-cell',showVerticalBorder?'vertical-border':'',showHorizontalBorder?'horizontal-border':'']"
:style="{'width':col.width+'px','height':titleRowHeight+'px','text-align':col.titleAlign}">
<span class="table-title" v-html="col.title"></span>
<span @click.stop="sortControl(col.field,col.orderBy)" class="v-table-sort-icon"
v-if="enableSort(col.orderBy)">
<i :class='["v-icon-up-dir",col.orderBy ==="asc" ? "checked":""]'></i>
<i :class='["v-icon-down-dir",col.orderBy ==="desc" ? "checked":""]'></i>
<span class="table-title">
<span v-html="col.title"></span>
<span @click.stop="sortControl(col.field,col.orderBy)" class="v-table-sort-icon"
v-if="enableSort(col.orderBy)">
<i :class='["v-icon-up-dir",col.orderBy ==="asc" ? "checked":""]'></i>
<i :class='["v-icon-down-dir",col.orderBy ==="desc" ? "checked":""]'></i>
</span>
</span>
</div>
</td>
Expand Down
6 changes: 3 additions & 3 deletions packages/themes-base/v-table.css
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
/*font-size:16px;*/
width:16px;
height: 19px;
margin-left: -8px;
margin-left: -5px;
overflow: hidden;
cursor: pointer;
}
Expand All @@ -150,11 +150,11 @@
}

.v-table-sort-icon i:first-child {
top: -4px;
top: -5px;
}

.v-table-sort-icon i:last-child {
bottom: -0px;
bottom: 1px;
}

.v-table-header .cursorPointer{
Expand Down
54 changes: 31 additions & 23 deletions packages/v-table/src/table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@
@mouseout.stop="handleTitleMouseOut()">
<div :class="['v-table-title-cell',showVerticalBorder?'vertical-border':'',showHorizontalBorder?'horizontal-border':'']"
:style="{'width':titleColumnWidth(col.fields)+'px','height':titleColumnHeight(col.rowspan)+'px','text-align':col.titleAlign}">
<span class="table-title" v-html="col.title"></span>
<span @click.stop="sortControl(col.fields[0],col.orderBy)"
class="v-table-sort-icon" v-if="enableSort(col.orderBy)">
<i :class='["v-icon-up-dir",col.orderBy ==="asc" ? "checked":""]'></i>
<i :class='["v-icon-down-dir",col.orderBy ==="desc" ? "checked":""]'></i>
<span class="table-title">
<span v-html="col.title"></span>
<span @click.stop="sortControl(col.fields[0],col.orderBy)"
class="v-table-sort-icon" v-if="enableSort(col.orderBy)">
<i :class='["v-icon-up-dir",col.orderBy ==="asc" ? "checked":""]'></i>
<i :class='["v-icon-down-dir",col.orderBy ==="desc" ? "checked":""]'></i>
</span>
</span>
</div>
</td>
Expand All @@ -40,12 +42,14 @@
@mouseout.stop="handleTitleMouseOut()">
<div :class="['v-table-title-cell',showVerticalBorder?'vertical-border':'',showHorizontalBorder?'horizontal-border':'']"
:style="{'width':col.width+'px','height':titleRowHeight+'px','text-align':col.titleAlign}">
<span class="table-title" v-html="col.title"></span>
<span @click.stop="sortControl(col.field,col.orderBy)"
class="v-table-sort-icon" v-if="enableSort(col.orderBy)">
<i :class='["v-icon-up-dir",col.orderBy ==="asc" ? "checked":""]'></i>
<i :class='["v-icon-down-dir",col.orderBy ==="desc" ? "checked":""]'></i>
</span>
<span class="table-title">
<span v-html="col.title"></span>
<span @click.stop="sortControl(col.field,col.orderBy)"
class="v-table-sort-icon" v-if="enableSort(col.orderBy)">
<i :class='["v-icon-up-dir",col.orderBy ==="asc" ? "checked":""]'></i>
<i :class='["v-icon-down-dir",col.orderBy ==="desc" ? "checked":""]'></i>
</span>
</span>
</div>
</td>
</tr>
Expand Down Expand Up @@ -95,7 +99,8 @@
>
<template
v-if="typeof col.componentName ==='string' && col.componentName.length > 0">
<component :rowData="item" :field="col.field ? col.field : ''" :index="rowIndex"
<component :rowData="item" :field="col.field ? col.field : ''"
:index="rowIndex"
:is="col.componentName"></component>
</template>
<template v-else>
Expand Down Expand Up @@ -135,13 +140,14 @@
@mouseout.stop="handleTitleMouseOut()">
<div :class="['v-table-title-cell',showVerticalBorder?'vertical-border':'',showHorizontalBorder?'horizontal-border':'']"
:style="{'width':titleColumnWidth(col.fields)+'px','height':titleColumnHeight(col.rowspan)+'px','text-align':col.titleAlign}">
<span class="table-title" v-html="col.title"></span>
<span @click.stop="sortControl(col.fields[0],col.orderBy)"
class="v-table-sort-icon" v-if="enableSort(col.orderBy)">
<i :class='["v-icon-up-dir",col.orderBy ==="asc" ? "checked":""]'></i>
<i :class='["v-icon-down-dir",col.orderBy ==="desc" ? "checked":""]'></i>
<span class="table-title">
<span v-html="col.title"></span>
<span @click.stop="sortControl(col.fields[0],col.orderBy)"
class="v-table-sort-icon" v-if="enableSort(col.orderBy)">
<i :class='["v-icon-up-dir",col.orderBy ==="asc" ? "checked":""]'></i>
<i :class='["v-icon-down-dir",col.orderBy ==="desc" ? "checked":""]'></i>
</span>
</span>

</div>
</td>
</tr>
Expand All @@ -156,11 +162,13 @@
@mouseout.stop="handleTitleMouseOut()">
<div :class="['v-table-title-cell',showVerticalBorder?'vertical-border':'',showHorizontalBorder?'horizontal-border':'']"
:style="{'width':col.width+'px','height':titleRowHeight+'px','text-align':col.titleAlign}">
<span class="table-title" v-html="col.title"></span>
<span @click.stop="sortControl(col.field,col.orderBy)" class="v-table-sort-icon"
v-if="enableSort(col.orderBy)">
<i :class='["v-icon-up-dir",col.orderBy ==="asc" ? "checked":""]'></i>
<i :class='["v-icon-down-dir",col.orderBy ==="desc" ? "checked":""]'></i>
<span class="table-title">
<span v-html="col.title"></span>
<span @click.stop="sortControl(col.field,col.orderBy)" class="v-table-sort-icon"
v-if="enableSort(col.orderBy)">
<i :class='["v-icon-up-dir",col.orderBy ==="asc" ? "checked":""]'></i>
<i :class='["v-icon-down-dir",col.orderBy ==="desc" ? "checked":""]'></i>
</span>
</span>
</div>
</td>
Expand Down

0 comments on commit 1af0e6b

Please sign in to comment.