release(custom): i
This commit is contained in:
@@ -14,8 +14,9 @@
|
||||
|
||||
<script setup>
|
||||
import { useRouter } from 'vue-router'
|
||||
import { NButton, NEllipsis } from 'naive-ui'
|
||||
import { NButton, NEllipsis, NImage, NSwitch } from 'naive-ui'
|
||||
import api from './api'
|
||||
import api1 from '../add/api'
|
||||
import { useGoodsStore } from '@/store/modules/goods'
|
||||
|
||||
const loading = ref(false)
|
||||
@@ -31,12 +32,9 @@ const columns = ref([
|
||||
align: 'center',
|
||||
slot: 'cover',
|
||||
render(row) {
|
||||
return h('img', {
|
||||
return h(NImage, {
|
||||
width: '50',
|
||||
src: row.cover,
|
||||
style: {
|
||||
width: '30px',
|
||||
height: '30px',
|
||||
},
|
||||
})
|
||||
},
|
||||
},
|
||||
@@ -74,13 +72,34 @@ const columns = ref([
|
||||
key: 'stock',
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
title: '审核状态',
|
||||
align: 'center',
|
||||
slot: 'status',
|
||||
render(row) {
|
||||
return h('span', row.status === 1 ? '已审核' : row.status === 2 ? '已拒绝' : '待审核')
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '是否上架',
|
||||
align: 'center',
|
||||
slot: 'state',
|
||||
render(row) {
|
||||
return [
|
||||
h(NSwitch, {
|
||||
checkedValue: 1,
|
||||
uncheckedValue: 2,
|
||||
value: row.state,
|
||||
onUpdateValue: async (val) => {
|
||||
await api1.addGoods({
|
||||
...row,
|
||||
state: val,
|
||||
})
|
||||
getList()
|
||||
},
|
||||
}),
|
||||
]
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
key: 'notes',
|
||||
@@ -91,19 +110,17 @@ const columns = ref([
|
||||
align: 'center',
|
||||
slot: 'action',
|
||||
render(row) {
|
||||
if (row.status === 1 || row.status === 2) {
|
||||
return [
|
||||
h(
|
||||
NButton,
|
||||
{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
onClick: () => toEdit(row),
|
||||
},
|
||||
() => '编辑'
|
||||
),
|
||||
]
|
||||
}
|
||||
return [
|
||||
h(
|
||||
NButton,
|
||||
{
|
||||
type: 'primary',
|
||||
size: 'small',
|
||||
onClick: () => toEdit(row),
|
||||
},
|
||||
() => '编辑'
|
||||
),
|
||||
]
|
||||
},
|
||||
},
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user