Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-web
/
glsx-oss-carowner
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 b3b79cbc
authored
Mar 30, 2021
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
新增场景、编辑场景
1 parent
5acbd295
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
95 additions
and
11 deletions
src/api/productType.js
src/views/customer/productList/index.vue
src/views/customer/productManagement/index.vue
src/views/customer/scenarioManagement/addScenario.vue
src/views/customer/scenarioManagement/index.vue
src/api/productType.js
View file @
b3b79cb
...
@@ -3,7 +3,7 @@ import axios from './axios'
...
@@ -3,7 +3,7 @@ import axios from './axios'
const
path
=
'/smartAdmin/productType/'
const
path
=
'/smartAdmin/productType/'
// 产品类型列表
// 产品类型列表
function
getList
(
params
)
{
function
get
Type
List
(
params
)
{
return
GlAxios
.
get
(
`
${
path
}
getPageList`
,
{
params
})
return
GlAxios
.
get
(
`
${
path
}
getPageList`
,
{
params
})
}
}
...
@@ -21,4 +21,4 @@ function save(data, baseURl) {
...
@@ -21,4 +21,4 @@ function save(data, baseURl) {
})
})
}
}
export
{
getList
,
getShopTagList
,
save
}
export
{
get
Type
List
,
getShopTagList
,
save
}
src/views/customer/productList/index.vue
View file @
b3b79cb
...
@@ -74,7 +74,7 @@
...
@@ -74,7 +74,7 @@
<el-option
<el-option
v-for=
"i in item.options"
v-for=
"i in item.options"
:key=
"i.value"
:key=
"i.value"
:label=
"i.dictValue || i.
product
Name"
:label=
"i.dictValue || i.
type
Name"
:value=
"i.dictKey || i.id"
:value=
"i.dictKey || i.id"
>
>
</el-option>
</el-option>
...
@@ -115,6 +115,8 @@ import sign from '@/api/sign'
...
@@ -115,6 +115,8 @@ import sign from '@/api/sign'
import
qs
from
'qs'
import
qs
from
'qs'
import
{
getList
,
putOnOff
,
checkShopProductId
,
save
}
from
'@/api/product'
import
{
getList
,
putOnOff
,
checkShopProductId
,
save
}
from
'@/api/product'
import
{
getDict
,
batchSaveFile
}
from
'@/api/common'
import
{
getDict
,
batchSaveFile
}
from
'@/api/common'
import
{
getTypeList
}
from
'@/api/productType'
export
default
{
export
default
{
data
()
{
data
()
{
const
validatePass
=
(
rule
,
value
,
callback
)
=>
{
const
validatePass
=
(
rule
,
value
,
callback
)
=>
{
...
@@ -240,7 +242,7 @@ export default {
...
@@ -240,7 +242,7 @@ export default {
}
}
},
},
created
()
{
created
()
{
getList
({}).
then
(
res
=>
{
get
Type
List
({}).
then
(
res
=>
{
for
(
let
i
=
this
.
productFormList
.
length
;
i
>
0
;
i
--
)
{
for
(
let
i
=
this
.
productFormList
.
length
;
i
>
0
;
i
--
)
{
if
(
this
.
productFormList
[
i
]
&&
this
.
productFormList
[
i
].
prop
===
'typeId'
)
return
(
this
.
productFormList
[
i
].
options
=
res
.
list
)
if
(
this
.
productFormList
[
i
]
&&
this
.
productFormList
[
i
].
prop
===
'typeId'
)
return
(
this
.
productFormList
[
i
].
options
=
res
.
list
)
}
}
...
...
src/views/customer/productManagement/index.vue
View file @
b3b79cb
...
@@ -97,7 +97,7 @@
...
@@ -97,7 +97,7 @@
<
script
>
<
script
>
import
{
getDict
}
from
'@/api/common'
import
{
getDict
}
from
'@/api/common'
import
{
getList
,
getShopTagList
,
save
}
from
'@/api/productType'
import
{
get
Type
List
,
getShopTagList
,
save
}
from
'@/api/productType'
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
...
@@ -133,7 +133,7 @@ export default {
...
@@ -133,7 +133,7 @@ export default {
}
}
]
]
},
},
prodectTypeApi
:
getList
,
prodectTypeApi
:
get
Type
List
,
visible
:
false
,
visible
:
false
,
ruleForm
:
{},
ruleForm
:
{},
rules
:
{
rules
:
{
...
...
src/views/customer/scenarioManagement/addScenario.vue
View file @
b3b79cb
This diff is collapsed.
Click to expand it.
src/views/customer/scenarioManagement/index.vue
View file @
b3b79cb
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<div>
<div>
<el-button
<el-button
type=
"primary"
type=
"primary"
@
click=
"
hideDialog
"
@
click=
"
create
"
>
添加场景
</el-button>
>
添加场景
</el-button>
<d2-table
<d2-table
ref=
"scenarioTable"
ref=
"scenarioTable"
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
_
from
'lodash'
import
{
getList
,
updateStatus
,
getById
}
from
'@/api/scenario'
import
{
getList
,
updateStatus
,
getById
}
from
'@/api/scenario'
import
{
getDict
}
from
'@/api/common'
import
{
getDict
}
from
'@/api/common'
import
AddScenario
from
'./addScenario'
import
AddScenario
from
'./addScenario'
...
@@ -81,20 +82,101 @@ export default {
...
@@ -81,20 +82,101 @@ export default {
getListApi
:
getList
,
getListApi
:
getList
,
typeList
:
[],
typeList
:
[],
visible
:
false
,
visible
:
false
,
scenarioParams
:
{}
scenarioParams
:
{
basicForm
:
{
id
:
''
,
backPic
:
''
,
backPicUrl
:
''
,
description
:
''
,
icon
:
''
,
iconUrl
:
''
,
sceneName
:
''
,
typeKey
:
''
},
scenarioRuleForm
:
{
conditionRule
:
''
,
executeCycle
:
''
},
conditionList
:
[],
contentList
:
[]
},
defalutScenarioParams
:
{
basicForm
:
{
id
:
''
,
backPic
:
''
,
backPicUrl
:
''
,
description
:
''
,
icon
:
''
,
iconUrl
:
''
,
sceneName
:
''
,
typeKey
:
''
},
scenarioRuleForm
:
{
conditionRule
:
''
,
executeCycle
:
''
},
conditionList
:
[
{
key
:
parseInt
(
Math
.
random
()
*
1000
),
type
:
1
,
paramKey
:
''
,
paramValue
:
{
date
:
''
,
select
:
''
,
order
:
''
,
value
:
''
}
}
],
contentList
:
[
{
key
:
parseInt
(
Math
.
random
()
*
1000
),
type
:
2
,
paramKey
:
''
,
paramValue
:
{
msg
:
''
,
select
:
''
,
order
:
''
,
orderVal
:
''
}
}
]
}
}
}
},
},
created
()
{
created
()
{
getDict
({
dictType
:
'scene_classification'
}).
then
(
res
=>
(
this
.
typeList
=
res
))
getDict
({
dictType
:
'scene_classification'
}).
then
(
res
=>
(
this
.
typeList
=
res
))
},
},
methods
:
{
methods
:
{
hideDialog
()
{
hideDialog
(
t
)
{
this
.
visible
=
!
this
.
visible
this
.
visible
=
!
this
.
visible
if
(
t
)
this
.
$refs
.
scenarioTable
.
refreshTable
()
},
create
()
{
this
.
scenarioParams
=
_
.
cloneDeep
(
this
.
defalutScenarioParams
)
this
.
hideDialog
()
},
},
handleEdit
(
scope
)
{
handleEdit
(
scope
)
{
getById
({
id
:
scope
.
id
},
this
.
baseURL
).
then
(
res
=>
{
getById
({
id
:
scope
.
id
},
this
.
baseURL
).
then
(
res
=>
{
console
.
log
(
res
)
const
{
scenarioParams
}
=
this
this
.
scenarioParams
=
res
for
(
const
i
in
scenarioParams
.
basicForm
)
{
scenarioParams
.
basicForm
[
i
]
=
res
[
i
]
}
for
(
const
i
in
scenarioParams
.
scenarioRuleForm
)
{
if
(
i
===
'conditionRule'
)
scenarioParams
.
scenarioRuleForm
[
i
]
=
''
+
res
[
i
]
else
scenarioParams
.
scenarioRuleForm
[
i
]
=
res
[
i
]
}
scenarioParams
.
basicForm
.
id
=
res
.
id
const
templateList
=
res
.
templateList
scenarioParams
.
conditionList
=
[]
scenarioParams
.
contentList
=
[]
if
(
templateList
.
length
!==
0
)
{
templateList
.
forEach
(
item
=>
{
item
.
paramValue
=
JSON
.
parse
(
item
.
paramValue
)
if
(
item
.
type
===
1
)
scenarioParams
.
conditionList
.
push
(
item
)
else
if
(
item
.
type
===
2
)
scenarioParams
.
contentList
.
push
(
item
)
})
}
this
.
hideDialog
()
this
.
hideDialog
()
})
})
},
},
...
...
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