Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a9400c51
authored
Jan 12, 2024
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
MALL:简化 SPU 属性的维护逻辑
parent
10afbe8e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
12 deletions
+6
-12
src/api/mall/product/property.ts
+0
-5
src/views/mall/product/property/value/index.vue
+2
-2
src/views/mall/product/spu/form/DescriptionForm.vue
+1
-1
src/views/mall/product/spu/form/OtherForm.vue
+1
-1
src/views/mall/product/spu/form/SkuForm.vue
+2
-3
No files found.
src/api/mall/product/property.ts
View file @
a9400c51
...
@@ -65,11 +65,6 @@ export const getPropertyPage = (params: PageParam) => {
...
@@ -65,11 +65,6 @@ export const getPropertyPage = (params: PageParam) => {
return
request
.
get
({
url
:
'/product/property/page'
,
params
})
return
request
.
get
({
url
:
'/product/property/page'
,
params
})
}
}
// 获得属性项列表
export
const
getPropertyList
=
(
params
:
any
)
=>
{
return
request
.
get
({
url
:
'/product/property/list'
,
params
})
}
// ------------------------ 属性值 -------------------
// ------------------------ 属性值 -------------------
// 获得属性值分页
// 获得属性值分页
...
...
src/views/mall/product/property/value/index.vue
View file @
a9400c51
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
label-width=
"68px"
label-width=
"68px"
>
>
<el-form-item
label=
"属性项"
prop=
"propertyId"
>
<el-form-item
label=
"属性项"
prop=
"propertyId"
>
<el-select
v-model=
"queryParams.propertyId"
class=
"!w-240px"
>
<el-select
v-model=
"queryParams.propertyId"
class=
"!w-240px"
disabled
>
<el-option
<el-option
v-for=
"item in propertyOptions"
v-for=
"item in propertyOptions"
:key=
"item.id"
:key=
"item.id"
...
@@ -158,6 +158,6 @@ const handleDelete = async (id: number) => {
...
@@ -158,6 +158,6 @@ const handleDelete = async (id: number) => {
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
await
getList
()
await
getList
()
// 属性项下拉框数据
// 属性项下拉框数据
propertyOptions
.
value
=
await
PropertyApi
.
getPropertyList
({}
)
propertyOptions
.
value
.
push
(
await
PropertyApi
.
getProperty
(
queryParams
.
propertyId
)
)
})
})
</
script
>
</
script
>
src/views/mall/product/spu/form/DescriptionForm.vue
View file @
a9400c51
...
@@ -70,7 +70,7 @@ const validate = async () => {
...
@@ -70,7 +70,7 @@ const validate = async () => {
try
{
try
{
await
unref
(
formRef
)?.
validate
()
await
unref
(
formRef
)?.
validate
()
// 校验通过更新数据
// 校验通过更新数据
Object
.
assign
(
props
.
propFormData
,
formData
)
Object
.
assign
(
props
.
propFormData
,
formData
.
value
)
}
catch
(
e
)
{
}
catch
(
e
)
{
message
.
error
(
'【商品详情】不完善,请填写相关信息'
)
message
.
error
(
'【商品详情】不完善,请填写相关信息'
)
emit
(
'update:activeName'
,
'description'
)
emit
(
'update:activeName'
,
'description'
)
...
...
src/views/mall/product/spu/form/OtherForm.vue
View file @
a9400c51
...
@@ -80,7 +80,7 @@ const validate = async () => {
...
@@ -80,7 +80,7 @@ const validate = async () => {
try
{
try
{
await
unref
(
formRef
)?.
validate
()
await
unref
(
formRef
)?.
validate
()
// 校验通过更新数据
// 校验通过更新数据
Object
.
assign
(
props
.
propFormData
,
formData
)
Object
.
assign
(
props
.
propFormData
,
formData
.
value
)
}
catch
(
e
)
{
}
catch
(
e
)
{
message
.
error
(
'【其它设置】不完善,请填写相关信息'
)
message
.
error
(
'【其它设置】不完善,请填写相关信息'
)
emit
(
'update:activeName'
,
'other'
)
emit
(
'update:activeName'
,
'other'
)
...
...
src/views/mall/product/spu/form/SkuForm.vue
View file @
a9400c51
...
@@ -135,11 +135,10 @@ watch(
...
@@ -135,11 +135,10 @@ watch(
/** 表单校验 */
/** 表单校验 */
const
emit
=
defineEmits
([
'update:activeName'
])
const
emit
=
defineEmits
([
'update:activeName'
])
const
validate
=
async
()
=>
{
const
validate
=
async
()
=>
{
// 校验 sku
skuListRef
.
value
.
validateSku
()
// 校验表单
if
(
!
formRef
)
return
if
(
!
formRef
)
return
try
{
try
{
// 校验 sku
skuListRef
.
value
.
validateSku
()
await
unref
(
formRef
).
validate
()
await
unref
(
formRef
).
validate
()
// 校验通过更新数据
// 校验通过更新数据
Object
.
assign
(
props
.
propFormData
,
formData
)
Object
.
assign
(
props
.
propFormData
,
formData
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment