[update] 生成随机数方法改成使用util中的randomUUID
This commit is contained in:
+3
-8
@@ -83,6 +83,7 @@ import { kkFilePreview } from '@/utils/kkFilePreview'
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
import { queryFileInfoByEditId } from '../../../../api/workCenter'
|
||||
import { Base64 } from 'js-base64'
|
||||
import { randomUUID } from '../../../../utils/util'
|
||||
|
||||
export default {
|
||||
name: 'CommentObjectEnterBaseInfo',
|
||||
@@ -178,11 +179,8 @@ export default {
|
||||
}
|
||||
// 给表格赋值,在线编辑不知道要怎么赋值?
|
||||
this.dataSource = data.advices.map(item => {
|
||||
const uidGenerator = () => {
|
||||
return '-' + parseInt(Math.random() * 10000 + 1, 10)
|
||||
}
|
||||
return {
|
||||
uid: uidGenerator(),
|
||||
uid: randomUUID(),
|
||||
...item
|
||||
}
|
||||
})
|
||||
@@ -255,10 +253,7 @@ export default {
|
||||
this.dataSource.splice(dataIndex, 1, value)
|
||||
} else {
|
||||
// 没有下标, 是新增
|
||||
const uidGenerator = () => {
|
||||
return '-' + parseInt(Math.random() * 10000 + 1, 10)
|
||||
}
|
||||
this.dataSource.push({ uid: uidGenerator(), ...value })
|
||||
this.dataSource.push({ uid: randomUUID(), ...value })
|
||||
}
|
||||
},
|
||||
// 在线编辑的查看
|
||||
|
||||
Reference in New Issue
Block a user