15 changed files with 271 additions and 57 deletions
@ -0,0 +1,97 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<a-table :dataSource="datas" :columns="columns" > |
||||
|
<span slot="action" slot-scope="text, record"> |
||||
|
<template> |
||||
|
<a @click="handleEdit(record)">修改</a> |
||||
|
<a-divider type="vertical" /> |
||||
|
<a @click="handleDelete(record)">删除</a> |
||||
|
</template> |
||||
|
</span> |
||||
|
<span slot="platform" slot-scope="text"> |
||||
|
{{text=="0"?"京东":"京东" }} |
||||
|
</span> |
||||
|
|
||||
|
<div slot="ImgUrl" slot-scope="text"> |
||||
|
<img :src="text" style="width: 50px;height: 50px;"> |
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
</a-table> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
|
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
datas: [], |
||||
|
columns:[{ |
||||
|
title: '图片', |
||||
|
dataIndex: 'ImgUrl', |
||||
|
width:'50px', |
||||
|
scopedSlots: { customRender: 'ImgUrl' } |
||||
|
}, |
||||
|
{ |
||||
|
title: 'SKU名称', |
||||
|
dataIndex: 'Title', |
||||
|
width:'280px' |
||||
|
}, |
||||
|
{ |
||||
|
title: '价格', |
||||
|
dataIndex: 'Price', |
||||
|
width:'88px' |
||||
|
}, |
||||
|
{ |
||||
|
title: '评价数', |
||||
|
dataIndex: 'CommentCount', |
||||
|
width:'88px' |
||||
|
}, |
||||
|
{ |
||||
|
title: '竞品链接', |
||||
|
dataIndex: 'ItemUrl', |
||||
|
width:'535px' |
||||
|
}, |
||||
|
{ |
||||
|
title: '平台', |
||||
|
dataIndex: 'Platform', |
||||
|
scopedSlots: { customRender: 'platform' }, |
||||
|
width:'88px' |
||||
|
}, |
||||
|
{ |
||||
|
title: '操作', |
||||
|
dataIndex: 'action', |
||||
|
scopedSlots: { customRender: 'action' }, |
||||
|
width:'209px' |
||||
|
},] |
||||
|
}; |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.getDatas(); |
||||
|
}, |
||||
|
methods: { |
||||
|
getDatas() { |
||||
|
hyCoreModel.getData().then((res) => { |
||||
|
console.log(res, "当前竞品对象"); |
||||
|
this.datas = res; |
||||
|
}); |
||||
|
}, |
||||
|
handleEdit(item){ |
||||
|
|
||||
|
}, |
||||
|
handleDelete(item){ |
||||
|
|
||||
|
}, |
||||
|
saveData() { |
||||
|
hyCoreModel.saveData().then((isOk) => { |
||||
|
if (isOk) { |
||||
|
this.$message.success("成功!"); |
||||
|
} else { |
||||
|
this.$message.error("失败!"); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
}, |
||||
|
}; |
||||
|
</script> |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue