Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-web
/
glsx-oss-ai-manager
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 56b0a7fb
authored
Jan 29, 2019
by
liimin
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
完善子组件逻辑
1 parent
c61c62c1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
17 deletions
src/views/customer/components/src/manufacturers.vue
src/views/customer/voice/Edit.vue
src/views/customer/components/src/manufacturers.vue
View file @
56b0a7f
...
...
@@ -175,7 +175,7 @@ export default {
this
.
$validator
.
errors
.
clear
()
})
__eventBus
.
$on
(
'reset'
,
()
=>
{
this
.
reset
()
this
.
__
reset
()
})
}
},
...
...
@@ -187,6 +187,17 @@ export default {
__sAction
&&
(
this
.
action
=
__sAction
)
},
immediate
:
true
},
default_value
:
{
handler
(
__value
)
{
if
(
__value
)
{
this
.
__setDefault
(
__value
)
// this.model.merchantId = __value.merchantId
// this.model.manufacturerId = __value.manufacturerId
}
},
immediate
:
true
,
deep
:
true
}
},
data
()
{
...
...
@@ -260,7 +271,7 @@ export default {
onRemove_grayscaleuser
()
{
this
.
model
.
grayscaleUserList
=
''
},
reset
()
{
__
reset
()
{
//初始化
this
.
model
.
manufacturerId
=
null
this
.
model
.
merchantId
=
null
...
...
@@ -271,20 +282,28 @@ export default {
influenceScope
:
''
//用户类型
}
this
.
$emit
(
'update:value'
,
this
.
result
)
},
__setDefault
(
__default
)
{
this
.
model
.
merchantId
=
__default
.
merchantId
this
.
model
.
manufacturerId
=
__default
.
manufacturerId
this
.
result
.
influenceScope
=
__default
.
influenceScope
this
.
model
.
file_list
=
__default
.
file_list
this
.
result
.
grayscaleUserList
=
__default
.
grayscaleuser
this
.
default_value
=
__default
}
},
created
()
{
if
(
this
.
default_value
)
{
this
.
model
.
merchantId
=
this
.
default_value
.
merchantId
this
.
model
.
manufacturerId
=
this
.
default_value
.
manufacturerId
this
.
result
.
influenceScope
=
this
.
default_value
.
influenceScope
this
.
model
.
file_list
=
this
.
default_value
.
file_list
this
.
result
.
grayscaleUserList
=
this
.
default_value
.
grayscaleuser
/**
* file_list
* [{name: 'food.jpg', url: 'https://xxx.cdn.com/xxx.jpg'}]
*/
}
//
if (this.default_value) {
//
this.model.merchantId = this.default_value.merchantId
//
this.model.manufacturerId = this.default_value.manufacturerId
//
this.result.influenceScope = this.default_value.influenceScope
//
this.model.file_list = this.default_value.file_list
//
this.result.grayscaleUserList = this.default_value.grayscaleuser
//
/**
//
* file_list
//
* [{name: 'food.jpg', url: 'https://xxx.cdn.com/xxx.jpg'}]
//
*/
//
}
Promise
.
all
([
this
.
get_manufacturer_list
(),
this
.
get_merchant_list
()])
.
then
(
result
=>
{
this
.
manufacturer_list
=
manufacturer_list_back_up
.
concat
(
result
[
0
])
...
...
src/views/customer/voice/Edit.vue
View file @
56b0a7f
...
...
@@ -29,7 +29,10 @@
</span>
</gl-form-item>
<gl-row>
<gl-col
:span=
"24"
>
<gl-col
:span=
"24"
v-if=
"showManufacturers"
>
<Manufacturers
width=
"100%"
:eventBus=
"eventBus"
...
...
@@ -306,13 +309,17 @@ export default {
}
this
.
editForm
.
time
=
[
beginTime
,
endTime
]
//设置时间
this
.
editForm
.
count
=
this
.
editForm
.
count
||
1
//触发次数暂时没有 默认 1 触发次数暂时不能选择
this
.
setCouponsData
(
this
.
$deep_clone
(
JSON
.
parse
(
activityConfig
)
))
this
.
setCouponsData
(
JSON
.
parse
(
activityConfig
))
}
setTimeout
(()
=>
{
this
.
eventBus
.
$emit
(
'clear_error'
)
//
},
100
)
})
this
.
eventBus
.
$on
(
'clear_error'
,
()
=>
this
.
$validator
.
errors
.
clear
())
//箭头事件 清除页面错误信息
this
.
eventBus
.
$on
(
'clear_error'
,
()
=>
this
.
$validator
.
errors
.
clear
())
//监听事件 清除页面错误信息
this
.
eventBus
.
$on
(
'reset'
,
()
=>
{
this
.
coupons
.
data
=
[]
this
.
default_value
=
{}
})
//监听事件 清除页面数据
}
}
// 'editForm.activityConfig.giftId': {
...
...
@@ -327,6 +334,7 @@ export default {
return
{
//弹出框标题
title
:
''
,
showManufacturers
:
true
,
//子组件默认值
default_value
:
{
// // merchantId: 19180001,
...
...
@@ -394,12 +402,15 @@ export default {
this.giftVisible = true
},
setCouponsData(data) {
console.log(data)
const { giftName, giftId, giftType } = data
this.editForm.activityConfig = JSON.parse(this.editForm.activityConfig)
this.editForm.activityConfig.giftName = giftName
this.editForm.activityConfig.giftId = giftId
this.editForm.activityConfig.giftType = giftType
this.coupons.data = [this.editForm.activityConfig]
this.editForm.activityConfig = JSON.stringify(
this.editForm.activityConfig
)
}
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment