Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
micro-customization-system
/
oEshield
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 d24d7bc9
authored
Apr 16, 2022
by
张杰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
v1.6.0版本需求
1 parent
e25b4b63
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
11 deletions
src/components/area/index.vue
src/pages/monitor/addFence.vue
src/components/area/index.vue
View file @
d24d7bc
...
...
@@ -59,23 +59,70 @@ export default {
// 初始化
init
()
{
let
o
=
this
.
value
;
let
o
=
this
.
value
.
toString
()
;
let
list
=
this
.
cityList
;
let
arr
=
[];
if
(
!
o
)
{
return
false
;
}
let
m
=
list
.
find
((
k
)
=>
{
let
n
=
k
.
children
.
find
((
j
)
=>
(
j
.
name
==
o
||
j
.
code
==
o
));
if
(
n
)
{
//let b = n.children.find(h => (h.name == n.name || h.code == n.code) )
// for(let i =0,len=list.length;i<len;i++){
// let k = list[i]
// if(k.code == o){
// arr.push(k.code)
// return false;
// }
// }
list
.
forEach
((
k
)
=>
{
// 只有省份
if
(
k
.
code
==
o
)
{
arr
.
push
(
k
.
code
);
arr
.
push
(
n
.
code
);
return
;
}
if
(
k
.
children
)
{
k
.
children
.
forEach
((
j
)
=>
{
// 只有省市
if
(
j
.
code
==
o
)
{
arr
.
push
(
k
.
code
);
arr
.
push
(
j
.
code
);
return
;
}
j
.
children
&&
j
.
children
.
forEach
((
h
)
=>
{
// 只有省市区
if
(
h
.
code
==
o
)
{
arr
.
push
(
k
.
code
);
arr
.
push
(
j
.
code
);
arr
.
push
(
h
.
code
);
return
;
}
});
});
}
});
// let m = list.find((k) => {
// let n = k.children.find((j) => j.name == o || j.code == o);
// if (n) {
// arr.push(k.code);
// arr.push(n.code);
// return false;
// }
// });
this
.
city
=
arr
;
console
.
log
(
arr
);
},
// 展开数组
unfoldTree
(
arr
,
afterArray
=
[])
{
let
_this
=
this
;
arr
.
map
((
k
)
=>
{
afterArray
.
push
(
k
);
if
(
k
.
children
)
{
_this
.
unfoldTree
(
k
.
children
,
afterArray
);
}
});
return
afterArray
;
},
},
};
</
script
>
...
...
src/pages/monitor/addFence.vue
View file @
d24d7bc
...
...
@@ -50,8 +50,8 @@
</el-radio-group>
<div
class=
"shape_tip"
v-show=
"form.shapeType==3"
>
*注:地图任意位置,单击新增双击结束绘制。
</div>
</el-form-item>
<el-form-item
label=
"省市区"
class=
"is-required"
v-if=
"form.shapeType==4"
prop=
"area
Nam
e"
>
<city-select
v-model=
"form.area
Nam
e"
:checkStrictly=
"true"
@
change=
"changeArea"
></city-select>
<el-form-item
label=
"省市区"
class=
"is-required"
v-if=
"form.shapeType==4"
prop=
"area
Cod
e"
>
<city-select
v-model=
"form.area
Cod
e"
:checkStrictly=
"true"
@
change=
"changeArea"
></city-select>
</el-form-item>
<el-form-item
label=
"围栏类型"
prop=
"bizFenceType"
>
<el-radio
:label=
"14"
v-model=
"form.bizFenceType"
>
报警型
</el-radio>
...
...
@@ -208,7 +208,7 @@ export default {
timeType
:
[
{
required
:
true
,
message
:
"请选择监控周期"
,
trigger
:
"change"
},
],
area
Nam
e
:
[{
validator
:
checkArea
,
trigger
:
"blur"
}],
area
Cod
e
:
[{
validator
:
checkArea
,
trigger
:
"blur"
}],
bizFenceType
:
[
{
required
:
true
,
message
:
"请选择围栏类型"
,
trigger
:
"change"
},
],
...
...
@@ -596,11 +596,11 @@ export default {
}
list
.
map
((
k
)
=>
{
arr
.
push
(
k
.
sn
s
);
arr
.
push
(
k
.
sn
);
});
let
oParams
=
{};
oParams
.
linkSns
=
arr
;
oParams
.
linkSns
=
arr
.
toString
()
;
oParams
.
fenceId
=
_this
.
fenceId
;
REMOVE_ELECFENCE_LINKEDDEVICES
(
oParams
).
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
...
...
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