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
24e69ecf
authored
Aug 13, 2024
by
黄兆琦
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: 添加TODO注释;以更优雅的方式跳出循环
parent
372e2215
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
src/views/mall/product/spu/form/ProductAttributes.vue
+1
-2
src/views/mall/product/spu/form/ProductPropertyAddForm.vue
+6
-6
src/views/mall/product/spu/form/SkuForm.vue
+1
-0
No files found.
src/views/mall/product/spu/form/ProductAttributes.vue
View file @
24e69ecf
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
class="!w-30"
class="!w-30"
@blur="handleInputConfirm(index, item.id)"
@blur="handleInputConfirm(index, item.id)"
@keyup.enter="handleInputConfirm(index, item.id)"
@keyup.enter="handleInputConfirm(index, item.id)"
@change="handleInputConfirm(index, item.id)"
>
>
<el-option
<el-option
v-for=
"item2 in item.propertyOpts"
v-for=
"item2 in item.propertyOpts"
...
@@ -39,7 +40,6 @@
...
@@ -39,7 +40,6 @@
:value=
"item2.name"
:value=
"item2.name"
/>
/>
</el-select>
</el-select>
<!--
<el-input
:id=
"`input$
{index}`" v-model="inputValue" class="!w-20" /> -->
<el-button
<el-button
v-show=
"!inputVisible(index)"
v-show=
"!inputVisible(index)"
class=
"button-new-tag ml-1"
class=
"button-new-tag ml-1"
...
@@ -54,7 +54,6 @@
...
@@ -54,7 +54,6 @@
</
template
>
</
template
>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
ElInput
}
from
'element-plus'
import
*
as
PropertyApi
from
'@/api/mall/product/property'
import
*
as
PropertyApi
from
'@/api/mall/product/property'
import
{
PropertyAndValues
}
from
'@/views/mall/product/spu/components'
import
{
PropertyAndValues
}
from
'@/views/mall/product/spu/components'
import
{
propTypes
}
from
'@/utils/propTypes'
import
{
propTypes
}
from
'@/utils/propTypes'
...
...
src/views/mall/product/spu/form/ProductPropertyAddForm.vue
View file @
24e69ecf
...
@@ -99,15 +99,14 @@ const submitForm = async () => {
...
@@ -99,15 +99,14 @@ const submitForm = async () => {
values
:
[]
values
:
[]
})
})
// 判断最终提交的属性名称是否是选择的 自己手动输入的属性名称不执行emit
// 判断最终提交的属性名称是否是选择的 自己手动输入的属性名称不执行emit
attrOption
.
value
.
forEach
((
item
)
=>
{
for
(
const
element
of
attrOption
.
value
)
{
if
(
item
.
name
===
formData
.
value
.
name
)
{
if
(
element
.
name
===
formData
.
value
.
name
)
{
emit
(
'success'
,
propertyId
,
item
.
id
)
emit
(
'success'
,
propertyId
,
element
.
id
)
message
.
success
(
t
(
'common.createSuccess'
))
message
.
success
(
t
(
'common.createSuccess'
))
dialogVisible
.
value
=
false
dialogVisible
.
value
=
false
// 中断循环
return
throw
new
Error
()
}
}
}
)
}
message
.
success
(
t
(
'common.createSuccess'
))
message
.
success
(
t
(
'common.createSuccess'
))
dialogVisible
.
value
=
false
dialogVisible
.
value
=
false
}
finally
{
}
finally
{
...
@@ -127,6 +126,7 @@ const resetForm = () => {
...
@@ -127,6 +126,7 @@ const resetForm = () => {
const
getAttrOption
=
async
()
=>
{
const
getAttrOption
=
async
()
=>
{
formLoading
.
value
=
true
formLoading
.
value
=
true
try
{
try
{
// TODO @芋艿:需要增加一个全列表接口
const
data
=
await
PropertyApi
.
getPropertyPage
({
pageNo
:
1
,
pageSize
:
100
})
const
data
=
await
PropertyApi
.
getPropertyPage
({
pageNo
:
1
,
pageSize
:
100
})
attrOption
.
value
=
data
.
list
attrOption
.
value
=
data
.
list
}
finally
{
}
finally
{
...
...
src/views/mall/product/spu/form/SkuForm.vue
View file @
24e69ecf
...
@@ -201,6 +201,7 @@ const generateSkus = (propertyList: any[]) => {
...
@@ -201,6 +201,7 @@ const generateSkus = (propertyList: any[]) => {
const
getPropertyValueList
=
async
(
id
,
propertyId
)
=>
{
const
getPropertyValueList
=
async
(
id
,
propertyId
)
=>
{
formLoading
.
value
=
true
formLoading
.
value
=
true
try
{
try
{
// TODO @芋艿:需要增加一个全列表接口
const
data
=
await
PropertyApi
.
getPropertyValuePage
({
pageNo
:
1
,
pageSize
:
100
,
propertyId
})
const
data
=
await
PropertyApi
.
getPropertyValuePage
({
pageNo
:
1
,
pageSize
:
100
,
propertyId
})
propertyList
.
value
.
find
((
item
)
=>
item
.
id
===
id
).
propertyOpts
=
data
.
list
propertyList
.
value
.
find
((
item
)
=>
item
.
id
===
id
).
propertyOpts
=
data
.
list
}
finally
{
}
finally
{
...
...
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