File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed
src/views/mall/product/spu/form Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 31
31
class =" !w-30"
32
32
@blur =" handleInputConfirm(index, item.id)"
33
33
@keyup.enter =" handleInputConfirm(index, item.id)"
34
+ @change =" handleInputConfirm(index, item.id)"
34
35
>
35
36
<el-option
36
37
v-for =" item2 in item.propertyOpts"
39
40
:value =" item2.name"
40
41
/>
41
42
</el-select >
42
- <!-- <el-input :id="`input${index}`" v-model="inputValue" class="!w-20" /> -->
43
43
<el-button
44
44
v-show =" !inputVisible(index)"
45
45
class =" button-new-tag ml-1"
54
54
</template >
55
55
56
56
<script lang="ts" setup>
57
- import { ElInput } from ' element-plus'
58
57
import * as PropertyApi from ' @/api/mall/product/property'
59
58
import { PropertyAndValues } from ' @/views/mall/product/spu/components'
60
59
import { propTypes } from ' @/utils/propTypes'
Original file line number Diff line number Diff line change @@ -99,15 +99,14 @@ const submitForm = async () => {
99
99
values: []
100
100
})
101
101
// 判断最终提交的属性名称是否是选择的 自己手动输入的属性名称不执行emit
102
- attrOption .value . forEach (( item ) => {
103
- if (item .name === formData .value .name ) {
104
- emit (' success' , propertyId , item .id )
102
+ for ( const element of attrOption .value ) {
103
+ if (element .name === formData .value .name ) {
104
+ emit (' success' , propertyId , element .id )
105
105
message .success (t (' common.createSuccess' ))
106
106
dialogVisible .value = false
107
- // 中断循环
108
- throw new Error ()
107
+ return
109
108
}
110
- })
109
+ }
111
110
message .success (t (' common.createSuccess' ))
112
111
dialogVisible .value = false
113
112
} finally {
@@ -127,6 +126,7 @@ const resetForm = () => {
127
126
const getAttrOption = async () => {
128
127
formLoading .value = true
129
128
try {
129
+ // TODO @芋艿:需要增加一个全列表接口
130
130
const data = await PropertyApi .getPropertyPage ({ pageNo: 1 , pageSize: 100 })
131
131
attrOption .value = data .list
132
132
} finally {
Original file line number Diff line number Diff line change @@ -201,6 +201,7 @@ const generateSkus = (propertyList: any[]) => {
201
201
const getPropertyValueList = async (id , propertyId ) => {
202
202
formLoading .value = true
203
203
try {
204
+ // TODO @芋艿:需要增加一个全列表接口
204
205
const data = await PropertyApi .getPropertyValuePage ({ pageNo: 1 , pageSize: 100 , propertyId })
205
206
propertyList .value .find ((item ) => item .id === id ).propertyOpts = data .list
206
207
} finally {
You can’t perform that action at this time.
0 commit comments