diff --git a/.env.development b/.env.development index 5bbd0a4..84a632c 100644 --- a/.env.development +++ b/.env.development @@ -5,5 +5,5 @@ VITE_APP_TITLE = 运营云后台管理系统 VITE_APP_ENV = 'development' # 开发环境 -VITE_APP_BASE_API = 'http://192.168.18.99:8080' +VITE_APP_BASE_API = 'http://192.168.18.151:8080' VITE_APP_PLATFORM = 'http://localhost:9000/platform' \ No newline at end of file diff --git a/src/api/goods/info.js b/src/api/goods/info.js index 46bbe52..62055e3 100644 --- a/src/api/goods/info.js +++ b/src/api/goods/info.js @@ -8,6 +8,14 @@ export function getGoodManageInfo(query) { params: query }) } +// 获取商品列表页顶部tab中的数据 +export function getGoodManageCount(query) { + return request({ + url: '/goods/goodInfoManage/getGoodManageCount', + method: 'get', + params: query + }) +} // 获取商品分类列表 export function getGoodType(query) { @@ -35,19 +43,18 @@ export function goodEdit(data) { }) } // 商品删除 -export function goodDelete(data) { +export function goodDelete(id) { return request({ - url: '/goods/business/category/remove', - method: 'post', - data: data + url: '/goods/goodInfoManage/deleteGoodInfo/id=' + id, + method: 'delete', }) } -// 商品上下架 +// 商品上架下架 export function goodUpAndDown(data) { return request({ - url: '/goods/goodInfoManage/goodEdit', - method: 'post', + url: '/goods/goodInfoManage/goodOnSale', + method: 'put', data: data }) } @@ -66,4 +73,22 @@ export function getActiveInfos() { url: '/goods/goodInfoManage/getActiveInfos', method: 'get' }) -} \ No newline at end of file +} + + +// 获取商品分类列表 +export function getGoodCategoryInfo(query) { + return request({ + url: '/goods/business/category/list', + method: 'get', + params: query + }) +} +// 新增商品分类 +export function categoryAdd(data) { + return request({ + url: '/goods/business/category/add', + method: 'post', + data: data + }) +} diff --git a/src/components/tableComponent.vue b/src/components/tableComponent.vue index c377ca1..fcfcba2 100644 --- a/src/components/tableComponent.vue +++ b/src/components/tableComponent.vue @@ -185,6 +185,10 @@ const props = defineProps({ type: Function, default: () => "", }, + rowkey: { + type: String, + default: "", + }, }); const emit = defineEmits([ @@ -227,7 +231,7 @@ const handleCurrentChange = (val) => { // 多选框变化 const handleSelectionChange = (selection) => { - const selectedIds = selection.map((row) => row.id); + const selectedIds = selection.map((row) => props.rowkey == "" ? row.id : row[props.rowkey]); emit("selection-change", selection, selectedIds); }; diff --git a/src/views/goods/goodsCategory/index.vue b/src/views/goods/goodsCategory/index.vue index f9cc0c1..154d827 100644 --- a/src/views/goods/goodsCategory/index.vue +++ b/src/views/goods/goodsCategory/index.vue @@ -12,16 +12,16 @@ class="demo-form-inline" :label-width="'auto'" > - + - + @@ -33,7 +33,7 @@ /> -
+
批量删除 - - 添加分类 - + 添加分类 -