diff --git a/src/api/product/attribute.js b/src/api/product/attribute.js index 1be14df..638696a 100644 --- a/src/api/product/attribute.js +++ b/src/api/product/attribute.js @@ -1,8 +1,8 @@ import request from '@/utils/request' // 查询属性列表 -export function list(name) { +export function list(attributeId) { return request({ - url: '/product/attributeInfo/list?name='+name, + url: '/product/attributeInfo/list?attributeId='+attributeId, method: 'get' }) } @@ -24,9 +24,9 @@ export function deleteById(attributeInfoId) { }) } //获取属性组列表 -export function getAttributeGroupList(attributeName) { +export function getAttributeGroupList(attributeGroupId) { return request({ - url: '/product/attributeGroup/getAttributeGroupList?attributeName='+attributeName, + url: '/product/attributeGroup/getAttributeGroupList?attributeGroupId='+attributeGroupId, method: 'get' }) } diff --git a/src/api/product/brand.js b/src/api/product/brand.js index 2c9799d..f8d7ff3 100644 --- a/src/api/product/brand.js +++ b/src/api/product/brand.js @@ -8,9 +8,9 @@ export function insertBrand(brandInfo) { }) } -export function getBrandList(likeName) { +export function getBrandList(brandId) { return request({ - url: '/product/brandInfo/getBrandList?likeName='+likeName, + url: '/product/brandInfo/getBrandList?brandId='+brandId, method: 'get' }) } diff --git a/src/api/product/category.js b/src/api/product/category.js index 3523757..ba0f4d7 100644 --- a/src/api/product/category.js +++ b/src/api/product/category.js @@ -7,3 +7,12 @@ export function getCategoryList(likeName) { data: likeName }) } + +export function insertCategory(insertCategoryReq) { + return request({ + url: '/product/category/insertCategory', + method: 'post', + data: insertCategoryReq + }) +} + diff --git a/src/components/CheckAttribute/index.vue b/src/components/CheckAttribute/index.vue new file mode 100644 index 0000000..cdfdb7e --- /dev/null +++ b/src/components/CheckAttribute/index.vue @@ -0,0 +1,115 @@ + + + + diff --git a/src/components/CheckAttributeGroup/index.vue b/src/components/CheckAttributeGroup/index.vue new file mode 100644 index 0000000..5276525 --- /dev/null +++ b/src/components/CheckAttributeGroup/index.vue @@ -0,0 +1,116 @@ + + + + diff --git a/src/components/CheckBrand/index.vue b/src/components/CheckBrand/index.vue index cd5723d..4664919 100644 --- a/src/components/CheckBrand/index.vue +++ b/src/components/CheckBrand/index.vue @@ -3,30 +3,31 @@
- 选择属性关联关系 + 选择品牌关联关系
- +
- 已选属性 + 已选品牌
+ type="success" + @close="handleClose(brand)"> {{brand.name}}
- +
- 可选属性 + 可选品牌
{{brand.name}} @@ -54,7 +55,7 @@ export default { //所有brandList brandList: [], //已选中brand属性 - selectBrandIdList: [ + selectBrandList: [ ], //父类选中的brand属性 parentSelectBrandList: [] @@ -63,11 +64,24 @@ export default { //计算属性 类似于data概念", computed: {}, //监控data中的数据变化", - watch: {}, + watch: { + selectBrandList: { + handler(newVal, oldVal) { + this.setBrandListToParent(newVal) + } + } + }, //方法集合", methods: { + //像父组件中传递数据的方法 + setBrandListToParent(newVal) { + this.$emit("setCheckBrandList",newVal) + }, + handleClose(tag) { + this.selectBrandList.splice(this.selectBrandList.indexOf(tag), 1); + }, getBrandList() { - getBrandList("").then( + getBrandList(0).then( res => { this.brandList = res.data } diff --git a/src/utils/generator/config.js b/src/utils/generator/config.js index 11af897..e1a4f85 100644 --- a/src/utils/generator/config.js +++ b/src/utils/generator/config.js @@ -3,7 +3,7 @@ export const formConf = { formModel: 'formData', size: 'medium', labelPosition: 'right', - labelWidth: 100, + labelWidth: "100", formRules: 'rules', gutter: 15, disabled: false, diff --git a/src/views/product/category/index.vue b/src/views/product/category/index.vue index 0eabadd..02424b1 100644 --- a/src/views/product/category/index.vue +++ b/src/views/product/category/index.vue @@ -1,64 +1,85 @@