Commit 01a9ca75 by zhangquan

样式修改&focus指令

1 parent bcaebcfc
...@@ -429,4 +429,24 @@ ...@@ -429,4 +429,24 @@
height: 6px; height: 6px;
border-radius: 50%; border-radius: 50%;
background-color: #999; 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 \ No newline at end of file
...@@ -10,7 +10,10 @@ ...@@ -10,7 +10,10 @@
<div class="table-wrap"> <div class="table-wrap">
<GLTable ref="tableRef" :pageConf="pageConf" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn"> <GLTable ref="tableRef" :pageConf="pageConf" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn">
<div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope"> <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>
<div slot="userInfoSlot" class="userInfoSlot" slot-scope="scope"> <div slot="userInfoSlot" class="userInfoSlot" slot-scope="scope">
<p class="name">{{ scope.scope.accountName || '--' }}</p> <p class="name">{{ scope.scope.accountName || '--' }}</p>
...@@ -125,6 +128,7 @@ export default { ...@@ -125,6 +128,7 @@ export default {
tableColumns: [ tableColumns: [
{ {
label: '商品名称', label: '商品名称',
width: 300,
addHtml: 'goodsNameSlot' addHtml: 'goodsNameSlot'
}, },
{ {
...@@ -152,7 +156,7 @@ export default { ...@@ -152,7 +156,7 @@ export default {
}, },
{ {
label: '订单编号', label: '订单编号',
width: 250, width: 300,
addHtml: 'orderNoSlot' addHtml: 'orderNoSlot'
}, },
{ {
...@@ -225,14 +229,6 @@ export default { ...@@ -225,14 +229,6 @@ export default {
margin-top: 16px; margin-top: 16px;
.table-wrap{ .table-wrap{
padding: 20px; padding: 20px;
.goodsNameSlot{
img{
width: 36px;
height: 36px;
vertical-align: middle;
margin-right: 8px;
}
}
.userInfoSlot{ .userInfoSlot{
.name{ .name{
font-size: 14px; font-size: 14px;
......
...@@ -21,10 +21,13 @@ ...@@ -21,10 +21,13 @@
</div> </div>
<GLTable ref="tableRef" :pageConf="pageConf" @sortChange="sortChange" :searchForm="goodsFormObj" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn"> <GLTable ref="tableRef" :pageConf="pageConf" @sortChange="sortChange" :searchForm="goodsFormObj" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn">
<div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope"> <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>
<div class="setPriceSlot" slot="setPriceSlot" slot-scope="scope"> <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> .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> <span class="unedited" v-else>
{{scope.scope.salePrice}} {{scope.scope.salePrice}}
...@@ -113,12 +116,13 @@ export default { ...@@ -113,12 +116,13 @@ export default {
tableColumns: [ tableColumns: [
{ {
label: '商品名称', label: '商品名称',
width: 300,
addHtml: 'goodsNameSlot' addHtml: 'goodsNameSlot'
}, },
{ {
label: '商品分类', label: '商品分类',
prop: 'goodsName', prop: 'goodsName',
width: 200, width: 250,
formatter: cellValue => { formatter: cellValue => {
return `${cellValue.firstCategoryName}/${cellValue.secondCategoryName}/${cellValue.lastCategoryName}` return `${cellValue.firstCategoryName}/${cellValue.secondCategoryName}/${cellValue.lastCategoryName}`
} }
...@@ -187,7 +191,14 @@ export default { ...@@ -187,7 +191,14 @@ export default {
categoryCascader, categoryCascader,
setPriceDialog setPriceDialog
}, },
directives: {
// focus指令名称
focus: {
inserted(el) {
el.querySelector('input').focus()
},
},
},
mounted() { mounted() {
}, },
...@@ -328,14 +339,6 @@ export default { ...@@ -328,14 +339,6 @@ export default {
.ctnr{ .ctnr{
background-color: #fff; background-color: #fff;
padding: 20px; padding: 20px;
.goodsNameSlot{
img{
width: 36px;
height: 36px;
vertical-align: middle;
margin-right: 8px;
}
}
.setPriceSlot{ .setPriceSlot{
.unedited{ .unedited{
display: flex; display: flex;
......
...@@ -22,7 +22,10 @@ ...@@ -22,7 +22,10 @@
</div> </div>
<GLTable ref="tableRef" :pageConf="pageConf" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn"> <GLTable ref="tableRef" :pageConf="pageConf" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn">
<div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope"> <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>
<div slot="setPriceSlot" slot-scope="scope"> <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('.', '$#$') <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 { ...@@ -117,7 +120,7 @@ export default {
{ {
label: '商品分类', label: '商品分类',
prop: 'goodsName', prop: 'goodsName',
width: 200, width: 250,
formatter: cellValue => { formatter: cellValue => {
return `${cellValue.firstCategoryName}/${cellValue.secondCategoryName}/${cellValue.lastCategoryName}` return `${cellValue.firstCategoryName}/${cellValue.secondCategoryName}/${cellValue.lastCategoryName}`
} }
...@@ -317,14 +320,6 @@ export default { ...@@ -317,14 +320,6 @@ export default {
.ctnr{ .ctnr{
background-color: #fff; background-color: #fff;
padding: 20px; padding: 20px;
.goodsNameSlot{
img{
width: 36px;
height: 36px;
vertical-align: middle;
margin-right: 8px;
}
}
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -10,7 +10,10 @@ ...@@ -10,7 +10,10 @@
<div class="table-wrap"> <div class="table-wrap">
<GLTable ref="tableRef" :pageConf="pageConf" :searchForm="orderFormObj" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn"> <GLTable ref="tableRef" :pageConf="pageConf" :searchForm="orderFormObj" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn">
<div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope"> <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>
<div slot="userInfoSlot" class="userInfoSlot" slot-scope="scope"> <div slot="userInfoSlot" class="userInfoSlot" slot-scope="scope">
<p class="name">{{ scope.scope.receiveName || '--' }}</p> <p class="name">{{ scope.scope.receiveName || '--' }}</p>
...@@ -138,6 +141,7 @@ export default { ...@@ -138,6 +141,7 @@ export default {
tableColumns: [ tableColumns: [
{ {
label: '商品名称', label: '商品名称',
width: 300,
addHtml: 'goodsNameSlot' addHtml: 'goodsNameSlot'
}, },
{ {
...@@ -168,7 +172,7 @@ export default { ...@@ -168,7 +172,7 @@ export default {
}, },
{ {
label: '售后编号', label: '售后编号',
width: 250, width: 300,
addHtml: 'orderNoSlot' addHtml: 'orderNoSlot'
}, },
{ {
...@@ -241,14 +245,6 @@ export default { ...@@ -241,14 +245,6 @@ export default {
margin-top: 16px; margin-top: 16px;
.table-wrap{ .table-wrap{
padding: 20px; padding: 20px;
.goodsNameSlot{
img{
width: 36px;
height: 36px;
vertical-align: middle;
margin-right: 8px;
}
}
.userInfoSlot{ .userInfoSlot{
.name{ .name{
font-size: 14px; font-size: 14px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!