Commit 01a9ca75 by zhangquan

样式修改&focus指令

1 parent bcaebcfc
......@@ -429,4 +429,24 @@
height: 6px;
border-radius: 50%;
background-color: #999;
}
.goodsNameSlot {
display: flex;
align-items: center;
img {
width: 36px;
height: 36px;
vertical-align: middle;
margin-right: 8px;
}
.name {
width: 200px;
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
\ No newline at end of file
......@@ -10,7 +10,10 @@
<div class="table-wrap">
<GLTable ref="tableRef" :pageConf="pageConf" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn">
<div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope">
<img :src="scope.scope.goodsImageUrl" alt="">{{ scope.scope.goodsSkuName }}
<img :src="scope.scope.goodsImageUrl" alt="">
<el-tooltip class="item" effect="dark" :content="scope.scope.goodsSkuName" placement="top">
<span class="name">{{ scope.scope.goodsSkuName || '--' }}</span>
</el-tooltip>
</div>
<div slot="userInfoSlot" class="userInfoSlot" slot-scope="scope">
<p class="name">{{ scope.scope.accountName || '--' }}</p>
......@@ -125,6 +128,7 @@ export default {
tableColumns: [
{
label: '商品名称',
width: 300,
addHtml: 'goodsNameSlot'
},
{
......@@ -152,7 +156,7 @@ export default {
},
{
label: '订单编号',
width: 250,
width: 300,
addHtml: 'orderNoSlot'
},
{
......@@ -225,14 +229,6 @@ export default {
margin-top: 16px;
.table-wrap{
padding: 20px;
.goodsNameSlot{
img{
width: 36px;
height: 36px;
vertical-align: middle;
margin-right: 8px;
}
}
.userInfoSlot{
.name{
font-size: 14px;
......
......@@ -21,10 +21,13 @@
</div>
<GLTable ref="tableRef" :pageConf="pageConf" @sortChange="sortChange" :searchForm="goodsFormObj" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn">
<div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope">
<img :src="scope.scope.goodsImgUrl" alt="">{{ scope.scope.goodsSkuName }}
<img :src="scope.scope.goodsImgUrl" alt="">
<el-tooltip class="item" effect="dark" :content="scope.scope.goodsSkuName" placement="top">
<span class="name">{{ scope.scope.goodsSkuName }}</span>
</el-tooltip>
</div>
<div class="setPriceSlot" slot="setPriceSlot" slot-scope="scope">
<el-input ref="priceRef" autofocus v-if="curEditId==scope.scope.id" v-model="scope.scope.salePrice" onkeyup="value = value ? value.replace(/^0\d/g, '0').replace(/[^\d.]/g, '').replace(/^\./g, '').replace(/\.{2,}/g, '').replace('.', '$#$')
<el-input ref="priceRef" v-focus v-if="curEditId==scope.scope.id" v-model="scope.scope.salePrice" onkeyup="value = value ? value.replace(/^0\d/g, '0').replace(/[^\d.]/g, '').replace(/^\./g, '').replace(/\.{2,}/g, '').replace('.', '$#$')
.replace(/\./g, '').replace('$#$', '.').replace(/^(-)*(\d+)\.(\d\d).*$/, '$1$2.$3') : value" type="text" clearable @blur="setPriceFn($event, scope.scope)"></el-input>
<span class="unedited" v-else>
{{scope.scope.salePrice}}
......@@ -113,12 +116,13 @@ export default {
tableColumns: [
{
label: '商品名称',
width: 300,
addHtml: 'goodsNameSlot'
},
{
label: '商品分类',
prop: 'goodsName',
width: 200,
width: 250,
formatter: cellValue => {
return `${cellValue.firstCategoryName}/${cellValue.secondCategoryName}/${cellValue.lastCategoryName}`
}
......@@ -187,7 +191,14 @@ export default {
categoryCascader,
setPriceDialog
},
directives: {
// focus指令名称
focus: {
inserted(el) {
el.querySelector('input').focus()
},
},
},
mounted() {
},
......@@ -328,14 +339,6 @@ export default {
.ctnr{
background-color: #fff;
padding: 20px;
.goodsNameSlot{
img{
width: 36px;
height: 36px;
vertical-align: middle;
margin-right: 8px;
}
}
.setPriceSlot{
.unedited{
display: flex;
......
......@@ -22,7 +22,10 @@
</div>
<GLTable ref="tableRef" :pageConf="pageConf" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn">
<div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope">
<img :src="scope.scope.goodsImgUrl" alt="">{{ scope.scope.goodsSkuName }}
<img :src="scope.scope.goodsImgUrl" alt="">
<el-tooltip class="item" effect="dark" :content="scope.scope.goodsSkuName" placement="top">
<span class="name">{{ scope.scope.goodsSkuName }}</span>
</el-tooltip>
</div>
<div slot="setPriceSlot" slot-scope="scope">
<el-input type="text" v-model="scope.scope.salePrice" onkeyup="value = value ? value.replace(/^0\d/g, '0').replace(/[^\d.]/g, '').replace(/^\./g, '').replace(/\.{2,}/g, '').replace('.', '$#$')
......@@ -117,7 +120,7 @@ export default {
{
label: '商品分类',
prop: 'goodsName',
width: 200,
width: 250,
formatter: cellValue => {
return `${cellValue.firstCategoryName}/${cellValue.secondCategoryName}/${cellValue.lastCategoryName}`
}
......@@ -317,14 +320,6 @@ export default {
.ctnr{
background-color: #fff;
padding: 20px;
.goodsNameSlot{
img{
width: 36px;
height: 36px;
vertical-align: middle;
margin-right: 8px;
}
}
}
</style>
\ No newline at end of file
......@@ -10,7 +10,10 @@
<div class="table-wrap">
<GLTable ref="tableRef" :pageConf="pageConf" :searchForm="orderFormObj" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn">
<div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope">
<img v-if="scope.scope.goodsImageUrl" :src="scope.scope.goodsImageUrl" alt="">{{ scope.scope.goodsSkuName || '--' }}
<img :src="scope.scope.goodsImageUrl" alt="">
<el-tooltip class="item" effect="dark" :content="scope.scope.goodsSkuName" placement="top">
<span class="name">{{ scope.scope.goodsSkuName || '--' }}</span>
</el-tooltip>
</div>
<div slot="userInfoSlot" class="userInfoSlot" slot-scope="scope">
<p class="name">{{ scope.scope.receiveName || '--' }}</p>
......@@ -138,6 +141,7 @@ export default {
tableColumns: [
{
label: '商品名称',
width: 300,
addHtml: 'goodsNameSlot'
},
{
......@@ -168,7 +172,7 @@ export default {
},
{
label: '售后编号',
width: 250,
width: 300,
addHtml: 'orderNoSlot'
},
{
......@@ -241,14 +245,6 @@ export default {
margin-top: 16px;
.table-wrap{
padding: 20px;
.goodsNameSlot{
img{
width: 36px;
height: 36px;
vertical-align: middle;
margin-right: 8px;
}
}
.userInfoSlot{
.name{
font-size: 14px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!