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 f516c8a2
authored
Apr 13, 2021
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改配网方式
1 parent
8aae353c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
401 deletions
src/views/customer/addScenario/app.js
src/views/customer/addScenario/index.vue
src/views/customer/productList/index.vue
src/views/customer/productManagement/index.vue
src/views/index/app.vue
src/views/customer/addScenario/app.js
deleted
100644 → 0
View file @
8aae353
import
App
from
'./index.vue'
import
base
from
'@/base'
import
GlsxVueCommon
from
'glsx-vue-common'
base
.
getConfig
().
then
(
data
=>
{
const
{
vue
,
config
}
=
data
vue
.
use
(
GlsxVueCommon
,
config
)
base
.
render
(
App
)
})
src/views/customer/addScenario/index.vue
deleted
100644 → 0
View file @
8aae353
<
template
>
<div>
<el-steps
:active=
"active"
simple
finish-status=
"success"
>
<el-step
icon=
"el-icon-edit"
title=
"场景基础信息"
></el-step>
<el-step
icon=
"el-icon-edit"
title=
"场景规则"
></el-step>
</el-steps>
<el-form
v-if=
"active == 1"
style=
"margin: 20px 0;"
:model=
"basicForm"
:rules=
"basicRules"
ref=
"basicForm"
label-width=
"100px"
>
<el-form-item
label=
"场景名称"
prop=
"name"
>
<el-input
class=
"w-217"
v-model=
"basicForm.name"
show-word-limit
maxlength=
"10"
></el-input>
</el-form-item>
<el-form-item
label=
"场景类型"
prop=
"name"
>
<el-select
v-model=
"basicForm.region"
placeholder=
"请选择活动区域"
>
<el-option
label=
"区域一"
value=
"shanghai"
></el-option>
<el-option
label=
"区域二"
value=
"beijing"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"场景图标"
prop=
"name"
>
<el-select
v-model=
"value"
placeholder=
"请选择"
>
<el-option
v-for=
"item in cities"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
<span
style=
"float: left"
>
{{
item
.
label
}}
</span>
<img
style=
"float: right;width: 30px;height: 30px;margin-top: 2px;"
src=
"../../../assets/auth-bg.jpg"
alt=
""
>
</el-option>
</el-select>
<img
style=
"width: 50px;height: 50px; vertical-align: middle;margin-left: 20px;"
src=
"../../../assets/auth-bg.jpg"
alt=
""
>
</el-form-item>
<el-form-item
label=
"场景背景图"
prop=
"name"
>
<!--
<img
:src=
"imgUrl"
alt=
""
>
-->
<el-image>
<div
slot=
"error"
class=
"image-slot"
>
<i
class=
"el-icon-picture-outline"
></i>
</div>
</el-image>
<el-button
class=
"import-btn"
style=
"display: block;"
type=
"primary"
>
上传图片
<input
type=
"file"
id=
"fileUpload"
class=
"import-input"
multiple=
"3"
accept=
"image/png, image/jpeg, image/jpg"
@
change=
"uploadImg($event)"
/>
</el-button>
</el-form-item>
<el-form-item
label=
"场景描述"
prop=
"name"
>
<el-input
type=
"textarea"
placeholder=
"请输入内容"
v-model=
"basicForm.textarea"
:rows=
"5"
maxlength=
"500"
show-word-limit
>
</el-input>
</el-form-item>
</el-form>
<el-form
v-if=
"active == 2"
:model=
"ruleForm"
:rules=
"scenarioRules"
ref=
"scenarioForm"
label-width=
"150px"
>
<el-form-item
label=
"场景触发条件规则"
prop=
"name"
>
<el-radio
v-model=
"ruleForm.radio"
label=
"1"
>
满足任一条件触发
</el-radio>
<el-radio
v-model=
"radio"
label=
"2"
>
满足全部条件触发
</el-radio>
</el-form-item>
<el-form-item
label=
"场景触发条件"
prop=
"name"
>
<el-select
v-model=
"value"
placeholder=
"请选择"
>
<el-option
v-for=
"item in options"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
</el-option>
</el-select>
<el-select
class=
"m-l-20"
v-model=
"value"
placeholder=
"请选择"
>
<el-option
v-for=
"item in options"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
</el-option>
</el-select>
<el-select
class=
"m-l-20"
v-model=
"value"
placeholder=
"请选择"
>
<el-option
v-for=
"item in options"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
</el-option>
</el-select>
<el-select
class=
"m-l-20"
v-model=
"value"
placeholder=
"请选择"
>
<el-option
v-for=
"item in options"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"场景执行周期"
prop=
"name"
>
<el-select
v-model=
"value"
placeholder=
"请选择"
>
<el-option
v-for=
"item in options"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-form>
<!--
<img
:src=
"imgUrl"
alt=
""
>
<el-button
class=
"import-btn"
style=
"display: block;"
type=
"primary"
>
上传图片
<input
type=
"file"
id=
"fileUpload"
class=
"import-input"
multiple=
"3"
accept=
"image/png, image/jpeg, image/jpg"
@
change=
"uploadImg($event)"
/>
</el-button>
<el-upload
class=
"avatar-uploader"
action=
"https://jsonplaceholder.typicode.com/posts/"
:show-file-list=
"false"
:on-success=
"handleAvatarSuccess"
:before-upload=
"beforeAvatarUpload"
>
<img
v-if=
"imageUrl"
:src=
"imageUrl"
class=
"avatar"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
-->
<el-button
style=
"margin-top: 12px;"
@
click=
"last"
>
上一步
</el-button>
<el-button
style=
"margin-top: 12px;"
@
click=
"next"
>
下一步
</el-button>
</div>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
active
:
2
,
basicForm
:
{},
basicRules
:
{},
cities
:
[{
value
:
'Beijing'
,
label
:
'北京'
},
{
value
:
'Shanghai'
,
label
:
'上海'
},
{
value
:
'Nanjing'
,
label
:
'南京'
},
{
value
:
'Chengdu'
,
label
:
'成都'
},
{
value
:
'Shenzhen'
,
label
:
'深圳'
},
{
value
:
'Guangzhou'
,
label
:
'广州'
}],
value
:
''
,
ruleForm
:
{},
scenarioRules
:
{}
// imageUrl: '',
// imgUrl: ''
}
},
methods
:
{
last
()
{
this
.
active
=
1
},
next
()
{
this
.
active
=
2
}
// handleAvatarSuccess(res, file) {
// this.imageUrl = URL.createObjectURL(file.raw)
// },
// beforeAvatarUpload(file) {
// console.log(file)
// const isJPG = file.type === 'image/jpeg'
// const isLt2M = file.size / 1024 / 1024 < 2
// if (!isJPG) {
// this.$message.error('上传头像图片只能是 JPG 格式!')
// }
// if (!isLt2M) {
// this.$message.error('上传头像图片大小不能超过 2MB!')
// }
// return isJPG && isLt2M
// },
// uploadImg(e) {
// console.log(e)
// const file = e.target.files[0]
// this.imgUrl = window.URL.createObjectURL(file)
// }
}
}
</
script
>
<
style
>
.avatar-uploader
.el-upload
{
border
:
1px
dashed
#d9d9d9
;
border-radius
:
6px
;
cursor
:
pointer
;
position
:
relative
;
overflow
:
hidden
;
}
.avatar-uploader
.el-upload
:hover
{
border-color
:
#409eff
;
}
.avatar-uploader-icon
{
font-size
:
28px
;
color
:
#8c939d
;
width
:
178px
;
height
:
178px
;
line-height
:
178px
;
text-align
:
center
;
}
.avatar
{
width
:
178px
;
height
:
178px
;
display
:
block
;
}
.import-btn
{
position
:
relative
;
}
.import-input
{
opacity
:
0
;
position
:
absolute
;
right
:
0
;
top
:
0
;
width
:
70px
;
height
:
36px
;
cursor
:
pointer
;
font-size
:
0
;
}
.w-217
{
width
:
217px
!important
;
}
.m-l-20
{
margin-left
:
20px
;
}
</
style
>
\ No newline at end of file
\ No newline at end of file
src/views/customer/productList/index.vue
View file @
f516c8a
...
@@ -70,6 +70,7 @@
...
@@ -70,6 +70,7 @@
<el-select
<el-select
v-model=
"productRuleForm[item.prop]"
v-model=
"productRuleForm[item.prop]"
:placeholder=
"item.placeholder || '请选择'"
:placeholder=
"item.placeholder || '请选择'"
@
change=
"change(productRuleForm[item.prop], item.prop)"
>
>
<el-option
<el-option
v-for=
"i in item.options"
v-for=
"i in item.options"
...
@@ -166,14 +167,18 @@ export default {
...
@@ -166,14 +167,18 @@ export default {
label
:
'接入平台'
,
label
:
'接入平台'
,
prop
:
'platformKey'
,
prop
:
'platformKey'
,
formatter
:
(
cellValue
)
=>
{
formatter
:
(
cellValue
)
=>
{
return
this
.
platformList
.
find
(
item
=>
item
.
dictKey
===
cellValue
.
platformKey
).
dictValue
const
item
=
this
.
platformList
.
find
(
item
=>
item
.
dictKey
===
cellValue
.
platformKey
)
if
(
item
)
return
item
.
dictValue
else
return
null
}
}
},
},
{
{
label
:
'配网方式'
,
label
:
'配网方式'
,
prop
:
'networkKey'
,
prop
:
'networkKey'
,
formatter
:
(
cellValue
)
=>
{
formatter
:
(
cellValue
)
=>
{
return
this
.
networkList
.
find
(
item
=>
item
.
dictKey
===
cellValue
.
networkKey
).
dictValue
const
item
=
this
.
networkList
.
find
(
item
=>
item
.
dictKey
===
cellValue
.
networkKey
)
if
(
item
)
return
item
.
dictValue
else
return
null
}
}
},
},
{
{
...
@@ -240,13 +245,13 @@ export default {
...
@@ -240,13 +245,13 @@ export default {
type
:
'input'
,
type
:
'input'
,
maxlength
:
15
,
maxlength
:
15
,
limit
:
true
limit
:
true
},
{
label
:
'配网方式:'
,
prop
:
'networkKey'
,
type
:
'select'
,
options
:
[]
}
}
// {
// label: '配网方式:',
// prop: 'networkKey',
// type: 'select',
// options: []
// }
],
],
formParams
:
{},
formParams
:
{},
platformList
:
[],
platformList
:
[],
...
@@ -383,6 +388,26 @@ export default {
...
@@ -383,6 +388,26 @@ export default {
message
:
'已取消操作'
message
:
'已取消操作'
})
})
})
})
},
change
(
e
,
prop
)
{
if
(
prop
===
'platformKey'
)
{
// 配网方式
if
(
e
===
'access_platform_didihu'
)
{
this
.
productFormList
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
prop
===
'networkKey'
)
this
.
productFormList
.
splice
(
index
,
1
)
})
}
else
{
const
value
=
this
.
productFormList
.
find
(
item
=>
item
.
prop
===
'networkKey'
)
if
(
!
value
)
{
this
.
productFormList
.
push
({
label
:
'配网方式:'
,
prop
:
'networkKey'
,
type
:
'select'
,
options
:
this
.
networkList
})
}
}
}
}
}
}
}
}
}
...
...
src/views/customer/productManagement/index.vue
View file @
f516c8a
...
@@ -117,14 +117,18 @@ export default {
...
@@ -117,14 +117,18 @@ export default {
label
:
'一级分类'
,
label
:
'一级分类'
,
prop
:
'firstCategory'
,
prop
:
'firstCategory'
,
formatter
:
(
cellValue
)
=>
{
formatter
:
(
cellValue
)
=>
{
return
this
.
firstDeviceList
.
find
(
item
=>
item
.
dictKey
===
cellValue
.
firstCategory
).
dictValue
const
item
=
this
.
firstDeviceList
.
find
(
item
=>
item
.
dictKey
===
cellValue
.
firstCategory
)
if
(
item
)
return
item
.
dictValue
else
return
null
}
}
},
},
{
{
label
:
'二级分类'
,
label
:
'二级分类'
,
prop
:
'categoryKey'
,
prop
:
'categoryKey'
,
formatter
:
(
cellValue
)
=>
{
formatter
:
(
cellValue
)
=>
{
return
this
.
secondDevice
.
find
(
item
=>
item
.
dictKey
===
cellValue
.
categoryKey
).
dictValue
const
item
=
this
.
secondDevice
.
find
(
item
=>
item
.
dictKey
===
cellValue
.
categoryKey
)
if
(
item
)
return
item
.
dictValue
else
return
null
}
}
},
},
{
{
...
...
src/views/index/app.vue
View file @
f516c8a
...
@@ -9,14 +9,6 @@
...
@@ -9,14 +9,6 @@
<ul>
<ul>
<li>
<li>
<a
<a
href=
"../customer/addScenario.html"
target=
"_self"
>
添加场景
</a>
</li>
<li>
<a
href=
"../customer/scenarioManagement.html"
href=
"../customer/scenarioManagement.html"
target=
"_self"
target=
"_self"
>
>
...
...
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