This commit is contained in:
zhangjianjun 2026-04-23 12:01:56 +08:00
parent 651fc7337e
commit 40da6e3193
2 changed files with 21 additions and 6 deletions

View File

@ -209,11 +209,27 @@ const data: TableData = {
key: 'weight',
name: '权重',
sort: "desc",
editor: {
type: "input",
subFun(self, data, row) {
return self.api?.updateData({ ...data, id: String(data.id), })
},
width: '200px',
// editor: {
// type: "input",
// subFun(self, data, row) {
// return self.api?.updateData({ ...data, id: String(data.id), })
// },
// },
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
if(v !== value) {
self.api?.updateData({
...row,
category_id: String(row.category_id),
id: String(row.id),
weight: String(v),
})
}
}} />
}
},
{

View File

@ -308,7 +308,6 @@ const data: TableData = {
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),