From 2017774e038068f5ab06a37c2ba85247c2874e16 Mon Sep 17 00:00:00 2001 From: dt_2916866708 <> Date: Tue, 16 Jan 2024 10:13:50 +0800 Subject: [PATCH] 12 --- src/api/product/productAttr.js | 33 +- src/components/Category/edit.vue | 3 +- src/utils/validate.js | 8 +- .../product/brand/components/AddOrEdit.vue | 71 +++ src/views/product/brand/index.vue | 117 ++-- src/views/product/productAdd/newIndex.vue | 564 ++++++++---------- 6 files changed, 424 insertions(+), 372 deletions(-) create mode 100644 src/views/product/brand/components/AddOrEdit.vue diff --git a/src/api/product/productAttr.js b/src/api/product/productAttr.js index db7a5ef..c37ea2a 100644 --- a/src/api/product/productAttr.js +++ b/src/api/product/productAttr.js @@ -1,10 +1,39 @@ import request from '@/utils/request' var service_name = 'oil-mall' export default { - brandGetByPage() { + brandGetAll(data) { + return request({ + url: `/${service_name}/mallProductBrands/getAll`, + method: 'post', + data + }) + }, + brandUpdate(data) { + return request({ + url: `/${service_name}/mallProductBrands/update`, + method: 'post', + data + }) + }, + brandDelete(data) { + return request({ + url: `/${service_name}/mallProductBrands/delete`, + method: 'post', + data + }) + }, + brandSave(data) { + return request({ + url: `/${service_name}/mallProductBrands/save`, + method: 'post', + data + }) + }, + brandGetByPage(data) { return request({ url: `/${service_name}/mallProductBrands/getByPage`, - method: 'get', + method: 'post', + data }) }, getAllAttributesType() { diff --git a/src/components/Category/edit.vue b/src/components/Category/edit.vue index fdbba53..05fbdc5 100644 --- a/src/components/Category/edit.vue +++ b/src/components/Category/edit.vue @@ -86,8 +86,7 @@ export default { }, addTreeListLabelForCasCard(arr, child) { }, - handlerSubmit() { - console.log(this.model,'454545') + handlerSubmit() { productApi[this.model](this.editPram).then((result) => { if(result.code==20000){ this.$parent.$parent.editDialogConfig.visible=false; diff --git a/src/utils/validate.js b/src/utils/validate.js index 794ed9b..21ce833 100644 --- a/src/utils/validate.js +++ b/src/utils/validate.js @@ -156,12 +156,14 @@ export function isStrictPromise(value) { && typeof value.then === 'function' && typeof value.finally === 'function'; } -export function loadingFn(loading, callback) { +export function loadingFn(loading, callback,minTimes=0) { this[loading] = true if (isStrictPromise(callback)) { callback.finally(() => { - console.log("运行") - this[loading] = false + console.log("运行"); + setTimeout(() => { + this[loading] = false + }, minTimes); }) }; } \ No newline at end of file diff --git a/src/views/product/brand/components/AddOrEdit.vue b/src/views/product/brand/components/AddOrEdit.vue new file mode 100644 index 0000000..7e79769 --- /dev/null +++ b/src/views/product/brand/components/AddOrEdit.vue @@ -0,0 +1,71 @@ + + + + + \ No newline at end of file diff --git a/src/views/product/brand/index.vue b/src/views/product/brand/index.vue index 77c9cab..9b4498e 100644 --- a/src/views/product/brand/index.vue +++ b/src/views/product/brand/index.vue @@ -5,7 +5,7 @@ - @@ -15,7 +15,7 @@ - 添加品牌 + 添加品牌 @@ -27,57 +27,47 @@ - - - - - - + +
- +
+ + + diff --git a/src/views/product/productAdd/newIndex.vue b/src/views/product/productAdd/newIndex.vue index 0a1faca..dabce7d 100644 --- a/src/views/product/productAdd/newIndex.vue +++ b/src/views/product/productAdd/newIndex.vue @@ -5,7 +5,7 @@ - + @@ -14,14 +14,14 @@ - - + + - - + + @@ -29,18 +29,35 @@
- + + + + + + + + + + - +
@@ -68,17 +85,6 @@
- - 多规格 - - - 单独设置 - 默认设置 - - @@ -103,7 +102,7 @@ 确认 - 添加规格 + @@ -111,44 +110,19 @@
{{ item.attributeName }}
- + {{ j }} - - + 添加
- - - - - - - - - - - - - - 确定 - 取消 - - - - - 添加新规格 -
- + + -