update
This commit is contained in:
parent
f2f3f99e8f
commit
651fc7337e
|
|
@ -289,19 +289,36 @@ const data: TableData = {
|
|||
{
|
||||
key: 'weight',
|
||||
name: '权重',
|
||||
width: '100px',
|
||||
width: '120px',
|
||||
sort: 'desc',
|
||||
editor: {
|
||||
type: 'input',
|
||||
subFun(self, data, row) {
|
||||
return self.api?.updateData({
|
||||
id: String(data.id),
|
||||
category_id: String(row.category_id),
|
||||
weight: data.weight,
|
||||
pinned: String(row.pinned),
|
||||
cover_show: row.covers_show
|
||||
})
|
||||
}
|
||||
// editor: {
|
||||
// type: 'input',
|
||||
// subFun(self, data, row) {
|
||||
// return self.api?.updateData({
|
||||
// id: String(data.id),
|
||||
// category_id: String(row.category_id),
|
||||
// weight: data.weight,
|
||||
// pinned: String(row.pinned),
|
||||
// cover_show: row.covers_show
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
renderBodyCell({row, column, rowIndex, self}) {
|
||||
const key = column.columnKey
|
||||
const value = row[key]
|
||||
return <el-input vModel={value} size="small" onBlur={(e: any) => {
|
||||
const v = e.target.value
|
||||
console.log(v, value)
|
||||
if(v !== value) {
|
||||
self.api?.updateData({
|
||||
id: String(row.id),
|
||||
category_id: String(row.category_id),
|
||||
weight: String(v),
|
||||
pinned: String(row.pinned),
|
||||
cover_show: row.covers_show
|
||||
})
|
||||
}
|
||||
}} />
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue