This commit is contained in:
yanran200730
2023-04-17 14:33:11 +08:00
parent 1320479c39
commit 6be6b2626a

View File

@@ -106,11 +106,12 @@
<el-input-number style="width: 120px;" :precision="0" size="small" type="input" v-model="row.stock" :min="0" clearable placeholder="请输入"></el-input-number>
</template>
</el-table-column>
<el-table-column label="操作" slot="options" align="center" width="120" fixed="right">
<el-table-column label="操作" slot="options" align="center" width="180" fixed="right">
<template v-slot="{ row, $index }">
<div class="table-options">
<el-button v-if="row.id" type="text" :title="row.status === '0' ? '上架' : '下架'" @click="changeStatus(row.status, $index)">{{ row.status === '0' ? '上架' : '下架' }}</el-button>
<el-button type="text" title="删除" @click="remove($index)">删除</el-button>
<el-button type="text" title="复制链接" v-if="row.goods.type === '1'" @click="copy(row.goods.jdUrl)">复制链接</el-button>
</div>
</template>
</el-table-column>
@@ -266,6 +267,19 @@
})
},
copy (url) {
let oInput = document.createElement('input')
oInput.value = url
document.body.appendChild(oInput)
oInput.select()
document.execCommand('Copy')
this.$message({
message: '已复制',
type: 'success'
})
oInput.remove()
},
changeStatus (status, index) {
this.$set(this.form.goodsList[index], 'status', status === '0' ? '1' : '0')
},