Skip to content

Commit 760bab7

Browse files
committed
【修复】全局:id=0导致sqlserver的insert失败
1 parent 3976e49 commit 760bab7

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

src/api/erp/product/category/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ export interface ProductCategoryVO {
1313
// ERP 产品分类 API
1414
export const ProductCategoryApi = {
1515
// 查询产品分类列表
16-
getProductCategoryList: async (params) => {
17-
return await request.get({ url: `/erp/product-category/list`, params })
16+
getProductCategoryList: async () => {
17+
return await request.get({ url: `/erp/product-category/list` })
1818
},
1919

2020
// 查询产品分类精简列表

src/api/infra/demo/demo02/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ export interface Demo02CategoryVO {
77
}
88

99
// 查询示例分类列表
10-
export const getDemo02CategoryList = async (params) => {
11-
return await request.get({ url: `/infra/demo02-category/list`, params })
10+
export const getDemo02CategoryList = async () => {
11+
return await request.get({ url: `/infra/demo02-category/list` })
1212
}
1313

1414
// 查询示例分类详情

src/views/erp/product/category/ProductCategoryForm.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
</template>
4747
<script setup lang="ts">
4848
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
49-
import { ProductCategoryApi } from '@/api/erp/product/category'
49+
import { ProductCategoryApi, ProductCategoryVO } from '@/api/erp/product/category'
5050
import { defaultProps, handleTree } from '@/utils/tree'
5151
import { CommonStatusEnum } from '@/utils/constants'
5252
@@ -66,7 +66,7 @@ const formData = ref({
6666
name: undefined,
6767
code: undefined,
6868
sort: undefined,
69-
status: undefined
69+
status: CommonStatusEnum.ENABLE
7070
})
7171
const formRules = reactive({
7272
parentId: [{ required: true, message: '上级编号不能为空', trigger: 'blur' }],
@@ -105,7 +105,7 @@ const submitForm = async () => {
105105
// 提交请求
106106
formLoading.value = true
107107
try {
108-
const data = formData.value as unknown as ProductCategoryApi.ProductCategoryVO
108+
const data = formData.value as unknown as ProductCategoryVO
109109
if (formType.value === 'create') {
110110
await ProductCategoryApi.createProductCategory(data)
111111
message.success(t('common.createSuccess'))
@@ -138,7 +138,7 @@ const resetForm = () => {
138138
const getProductCategoryTree = async () => {
139139
productCategoryTree.value = []
140140
const data = await ProductCategoryApi.getProductCategoryList()
141-
const root: Tree = { id: undefined, name: '顶级产品分类', children: [] }
141+
const root: Tree = { id: 0, name: '顶级产品分类', children: [] }
142142
root.children = handleTree(data, 'id', 'parentId')
143143
productCategoryTree.value.push(root)
144144
}

src/views/infra/demo/demo02/Demo02CategoryForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ const resetForm = () => {
107107
const getDemo02CategoryTree = async () => {
108108
demo02CategoryTree.value = []
109109
const data = await Demo02CategoryApi.getDemo02CategoryList()
110-
const root: Tree = { id: undefined, name: '顶级示例分类', children: [] }
110+
const root: Tree = { id: 0, name: '顶级示例分类', children: [] }
111111
root.children = handleTree(data, 'id', 'parentId')
112112
demo02CategoryTree.value.push(root)
113113
}

src/views/system/dept/DeptForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ const resetForm = () => {
167167
const getTree = async () => {
168168
deptTree.value = []
169169
const data = await DeptApi.getSimpleDeptList()
170-
let dept: Tree = { id: undefined, name: '顶级部门', children: [] }
170+
let dept: Tree = { id: 0, name: '顶级部门', children: [] }
171171
dept.children = handleTree(data)
172172
deptTree.value.push(dept)
173173
}

src/views/system/menu/MenuForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ const menuTree = ref<Tree[]>([]) // 树形结构
223223
const getTree = async () => {
224224
menuTree.value = []
225225
const res = await MenuApi.getSimpleMenusList()
226-
let menu: Tree = { id: undefined, name: '主类目', children: [] }
226+
let menu: Tree = { id: 0, name: '主类目', children: [] }
227227
menu.children = handleTree(res)
228228
menuTree.value.push(menu)
229229
}

0 commit comments

Comments
 (0)