|
@@ -3,13 +3,13 @@ import type { BasicForm, ICRUD } from '@/types/form'
|
|
|
import { getDictList, getDictValue, saveDict, deleteDict, saveDictValue, deleteDictValue } from '@/api/dict'
|
|
|
|
|
|
const CRUD: ICRUD = {
|
|
|
- create(data: any) {
|
|
|
+ create(data) {
|
|
|
return saveDict(data)
|
|
|
},
|
|
|
- update(data: any) {
|
|
|
+ update(data) {
|
|
|
return saveDict(data)
|
|
|
},
|
|
|
- getList(data: any) {
|
|
|
+ getList(data) {
|
|
|
return getDictList(data).then((res: any) => {
|
|
|
if (res.rows.length) {
|
|
|
curRow.value = res.rows[0]
|
|
@@ -20,20 +20,20 @@ const CRUD: ICRUD = {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- delete(data: any) {
|
|
|
+ delete(data) {
|
|
|
return deleteDict({ ids: data.id })
|
|
|
},
|
|
|
- deleteBatch(data: any) {
|
|
|
+ deleteBatch(data) {
|
|
|
return deleteDict(data)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
const itemCRUD: ICRUD = {
|
|
|
- create(data: any) {
|
|
|
+ create(data) {
|
|
|
data['dictType.id'] = curRow.value.id
|
|
|
return saveDictValue(data)
|
|
|
},
|
|
|
- update(data: any) {
|
|
|
+ update(data) {
|
|
|
data['dictType.id'] = curRow.value.id
|
|
|
return saveDictValue({
|
|
|
dictValueId: data.id,
|
|
@@ -46,7 +46,7 @@ const itemCRUD: ICRUD = {
|
|
|
getList() {
|
|
|
return getDictValue(curRow.value.id)
|
|
|
},
|
|
|
- delete(data: any) {
|
|
|
+ delete(data) {
|
|
|
return deleteDictValue({ dictValueId: data.id, dictTypeId: curRow.value.id })
|
|
|
}
|
|
|
}
|