4 changed files with 347 additions and 150 deletions
@ -0,0 +1,128 @@ |
|||
<template> |
|||
<div class="search"> |
|||
<Card> |
|||
<Row type="flex" justify="space-between"> |
|||
<Table :loading="loading" border :columns="columns" :data="data" :size="tableSize" sortable="custom" |
|||
ref="table"></Table> |
|||
<Row type="flex" justify="end" class="page"> |
|||
<Page :current="searchForm.pageNum" :total="total" :page-size="searchForm.pageSize" |
|||
@on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" |
|||
size="small" show-total show-elevator show-sizer></Page> |
|||
</Row> |
|||
</Col> |
|||
</Row> |
|||
</Card> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
getShareList |
|||
} from "@/api/app"; |
|||
export default { |
|||
name: "dic-manage", |
|||
data() { |
|||
return { |
|||
searchForm:{ |
|||
categoryId: "", |
|||
delFlag: 1, |
|||
pageNum: 1, |
|||
pageSize: "100", |
|||
shopId: "" |
|||
}, |
|||
columns: [ |
|||
// 表头 |
|||
{ |
|||
type: "selection", |
|||
width: 60, |
|||
align: "center", |
|||
}, |
|||
{ |
|||
type: "index", |
|||
width: 60, |
|||
align: "center", |
|||
}, |
|||
{ |
|||
title: "图片", |
|||
key: "productPicture", |
|||
minWidth: 60, |
|||
render: (h, params) => { |
|||
return h("img", { |
|||
attrs: { |
|||
src: params.row.productPicture, |
|||
}, |
|||
style: { |
|||
cursor: "zoom-in", |
|||
width: "80px", |
|||
height: "60px", |
|||
margin: "10px 0", |
|||
"object-fit": "contain", |
|||
}, |
|||
on: { |
|||
click: () => { |
|||
this.showPic(params.row); |
|||
}, |
|||
}, |
|||
}); |
|||
}, |
|||
}, |
|||
{ |
|||
title: "名称", |
|||
key: "productName", |
|||
minWidth: 60, |
|||
}, |
|||
{ |
|||
title: "排名", |
|||
key: "orderFiled", |
|||
width: 100, |
|||
}, |
|||
{ |
|||
title: "操作", |
|||
key: "action", |
|||
width: 350, |
|||
align: "center", |
|||
fixed: "right", |
|||
render: (h, params) => { |
|||
return h("div", [ |
|||
h( |
|||
"a", { |
|||
on: { |
|||
click: () => { |
|||
this.checkGoods(params.row); |
|||
}, |
|||
}, |
|||
}, |
|||
"选择" |
|||
), |
|||
]); |
|||
}, |
|||
}, |
|||
], |
|||
data: [], //表单数据 |
|||
total: 0, // 表单数据总数 |
|||
}; |
|||
}, |
|||
methods: { |
|||
init(v) { |
|||
console.log(v) |
|||
this.searchForm.shopId = JSON.parse(v).id |
|||
this.getDataList() |
|||
}, |
|||
getDataList() { |
|||
getShareList(this.searchForm).then((res) => { |
|||
if (res.success) { |
|||
this.data = res.result.records; |
|||
this.total = res.result.total; |
|||
if (this.data.length == 0 && this.searchForm.pageNum > 1) { |
|||
this.searchForm.pageNum -= 1; |
|||
this.getDataList(); |
|||
} |
|||
} |
|||
}); |
|||
}, |
|||
checkGoods(v){ |
|||
this.$emit('on-submit1',v) |
|||
} |
|||
}, |
|||
}; |
|||
</script> |
|||
Loading…
Reference in new issue