Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-skynet-admin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
najiu-frontend
najiu-skynet-admin
Commits
7ea960c9
Commit
7ea960c9
authored
Oct 26, 2021
by
朱松文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
切换选择组件
parent
f5abc10d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
20 deletions
+51
-20
main.ts
src/main.ts
+2
-1
index.vue
src/views/aiSearch/index.vue
+49
-19
No files found.
src/main.ts
View file @
7ea960c9
...
...
@@ -3,7 +3,7 @@ import App from "./App.vue";
import
router
from
"
./router
"
;
import
store
from
"
./store
"
;
import
"
@/utils/rem
"
;
import
{
Message
,
Table
,
TableColumn
,
Button
,
Dialog
,
Form
,
FormItem
,
Input
,
InputNumber
,
Pagination
,
Loading
,
DatePicker
,
Empty
,
Tooltip
,
Select
,
Option
,
OptionGroup
}
from
'
element-ui
'
;
import
{
Message
,
Table
,
TableColumn
,
Button
,
Dialog
,
Form
,
FormItem
,
Input
,
InputNumber
,
Pagination
,
Loading
,
DatePicker
,
Empty
,
Tooltip
,
Select
,
Option
,
OptionGroup
,
Cascader
}
from
'
element-ui
'
;
Vue
.
config
.
productionTip
=
false
;
...
...
@@ -23,6 +23,7 @@ Vue.use(Tooltip)
Vue
.
use
(
Select
)
Vue
.
use
(
Option
)
Vue
.
use
(
OptionGroup
)
Vue
.
use
(
Cascader
)
Vue
.
prototype
.
$loading
=
Loading
.
service
;
Vue
.
prototype
.
$message
=
Message
;
...
...
src/views/aiSearch/index.vue
View file @
7ea960c9
...
...
@@ -57,16 +57,14 @@
<div
class=
"row"
>
<div
class=
"col-label"
>
摄像头:
</div>
<div>
<el-select
v-model=
"queryData.cameraList"
filterable
multiple
placeholder=
"请选择"
>
<el-option-group
v-for=
"group in cameraGroup"
:key=
"group.label"
:label=
"group.label"
>
<el-option
v-for=
"item in group.options"
:key=
"item.cameraId"
:label=
"item.cameraName"
:value=
"item.cameraId"
></el-option>
</el-option-group>
</el-select>
<el-cascader
:options=
"cameraGroup"
:props=
"
{ multiple: true }"
filterable
collapse-tags
clearable
@change="cameraChange"
>
</el-cascader>
</div>
</div>
<div
class=
"btn-container"
>
...
...
@@ -194,10 +192,20 @@ export default class AiSearch extends BaseVue {
this
.
query
();
const
data
=
await
getCameraDogFormate
({});
if
(
data
)
{
const
ar
=
[];
Object
.
keys
(
data
).
forEach
((
key
)
=>
{
this
.
cameraGroup
.
push
({
label
:
key
,
options
:
[...
data
[
key
]]
});
ar
.
push
({
value
:
key
,
label
:
key
,
children
:
data
[
key
].
map
((
d
)
=>
({
label
:
d
.
cameraName
,
value
:
d
.
cameraId
,
})),
});
});
this
.
cameraGroup
=
ar
;
}
console
.
log
(
"
aaaa
"
,
this
.
cameraGroup
);
}
mounted
()
{
this
.
$nextTick
(()
=>
{
...
...
@@ -210,7 +218,7 @@ export default class AiSearch extends BaseVue {
...
this
.
queryData
,
});
this
.
dogs
=
rp
.
data
.
records
;
this
.
dogs
=
rp
.
data
?.
records
||
[]
;
this
.
total
=
rp
.
data
.
total
;
}
handleQuery
()
{
...
...
@@ -246,6 +254,16 @@ export default class AiSearch extends BaseVue {
this
.
showVideo
=
false
;
this
.
myVideo
.
player
.
pause
();
}
cameraChange
(
data
:
any
)
{
if
(
data
.
length
==
0
)
{
this
.
queryData
.
cameraList
=
[];
return
;
}
data
.
forEach
((
item
)
=>
{
this
.
queryData
.
cameraList
.
push
(
item
[
1
]);
});
console
.
log
(
"
cameraChange
"
,
this
.
queryData
);
}
}
</
script
>
...
...
@@ -425,13 +443,25 @@ export default class AiSearch extends BaseVue {
.el-table--group
{
border
:
$border-color
;
}
}
.el-date-editor.el-input
,
.el-date-editor.el-input__inner
{
width
:
100%
;
}
.el-select
{
width
:
100%
;
.el-date-editor.el-input
,
.el-date-editor.el-input__inner
{
width
:
100%
;
}
.el-select
{
width
:
100%
;
}
.el-cascader
{
width
:
100%
;
}
.el-cascader__search-input
{
color
:
#fff
;
background-color
:
$item-background-color
;
}
.el-tag.el-tag--info
{
background-color
:
$item-background-color
;
border-color
:
#e9e9eb
;
color
:
#fff
;
}
}
}
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment