Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
RuoYi-Vue-ui
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
AI算法平台
RuoYi-Vue-ui
Commits
c48a4063
Commit
c48a4063
authored
May 17, 2023
by
胡占生
🇨🇳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 算法场景模块 复制启停操作,回显校验操作,接口联调
parent
ccf68a8a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
87 additions
and
13 deletions
+87
-13
src/api/algorithm/scene.js
src/api/algorithm/scene.js
+15
-0
src/views/algorithm/scene/index.vue
src/views/algorithm/scene/index.vue
+72
-13
No files found.
src/api/algorithm/scene.js
View file @
c48a4063
...
...
@@ -81,3 +81,18 @@ export function variableList(id) {
method
:
'
get
'
})
}
// 复制算法
export
function
copyAlgorithm
(
id
)
{
return
request
({
url
:
'
/system/algorithm/scene/base/
'
+
id
,
method
:
'
post
'
})
}
// 复制算法
export
function
editStatus
(
data
)
{
return
request
({
url
:
'
/system/algorithm/scene/base/editStatus
'
,
method
:
'
put
'
,
data
:
data
})
}
src/views/algorithm/scene/index.vue
View file @
c48a4063
...
...
@@ -67,9 +67,13 @@
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
label=
"主键id"
align=
"center"
prop=
"id"
/>
<el-table-column
label=
"场景名称"
align=
"center"
prop=
"sceneName"
/>
<el-table-column
label=
"分流预警类型"
align=
"center"
prop=
"alarmTypes"
/>
<el-table-column
label=
"分流预警类型"
align=
"center"
prop=
"alarmTypes"
>
<template
slot-scope=
"scope"
>
<span
v-for=
"item in scope.row.alarmTypes"
>
{{
item
.
typeName
}}
,
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"每秒帧数"
align=
"center"
prop=
"frameSecond"
/>
<el-table-column
label=
"场景摄像头"
align=
"center"
prop=
"camera
s
"
/>
<el-table-column
label=
"场景摄像头"
align=
"center"
prop=
"camera
IdList
"
/>
<el-table-column
label=
"算法"
align=
"center"
prop=
"algorithmName"
/>
<el-table-column
label=
"创建人"
align=
"center"
prop=
"createBy"
/>
<el-table-column
label=
"创建时间"
align=
"center"
prop=
"createTime"
width=
"160"
>
...
...
@@ -86,20 +90,34 @@
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"editStatus(scope.row)"
v-hasPermi=
"['system:algorithmScene:editStatus']"
>
{{
scope
.
row
.
status
==
1
?
'
启用
'
:
'
禁用
'
}}
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleUpdate(scope.row)"
v-hasPermi=
"['system:
bas
e:edit']"
v-hasPermi=
"['system:
algorithmScen
e:edit']"
>
修改
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['system:
bas
e:remove']"
v-hasPermi=
"['system:
algorithmScen
e:remove']"
>
删除
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-document-copy"
@
click=
"copyAlgorithm(scope.row)"
v-hasPermi=
"['system:algorithmScene:copy']"
>
复制
</el-button>
</
template
>
</el-table-column>
</el-table>
...
...
@@ -119,7 +137,7 @@
<el-input
v-model=
"form.sceneName"
placeholder=
"请输入场景名称"
/>
</el-form-item>
<el-form-item
label=
"场景算法"
prop=
"algorithmId"
>
<el-select
@
change=
"sceneChange"
v-model=
"form.algorithmId"
placeholder=
"请选择
分流预警类型
"
>
<el-select
@
change=
"sceneChange"
v-model=
"form.algorithmId"
placeholder=
"请选择
场景算法
"
>
<el-option
v-for=
"item in sceneOptions"
:key=
"item.id"
...
...
@@ -152,7 +170,7 @@
</el-select>
</el-form-item>
<el-form-item
label=
"算法块"
prop=
"pieceDtos"
>
<el-table
v-loading=
"loading"
:data=
"form.pieceDtos
"
>
<el-table
v-loading=
"loading"
ref=
"multipleTable"
:data=
"form.pieceDtos"
:key=
"'id'
"
>
<el-table-column
label=
"算法块名称"
align=
"center"
prop=
"id"
>
<
template
slot-scope=
"scope"
>
<div>
...
...
@@ -213,7 +231,6 @@
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleAlgUpdate(scope.row)"
v-hasPermi=
"['system:base:edit']"
>
修改
</el-button>
<el-button
v-if=
"scope.row.isEdit"
...
...
@@ -221,7 +238,6 @@
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleAlgSave(scope.row)"
v-hasPermi=
"['system:base:edit']"
>
保存
</el-button>
<el-button
v-if=
"scope.row.isEdit"
...
...
@@ -229,7 +245,6 @@
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleAlgDelete(scope.$index,scope.row)"
v-hasPermi=
"['system:base:remove']"
>
删除
</el-button>
</
template
>
</el-table-column>
...
...
@@ -246,7 +261,7 @@
</template>
<
script
>
import
{
listBase
,
getBase
,
delBase
,
addBase
,
updateBase
,
pieceList
,
cameraList
,
typeList
,
sceneList
,
variableList
,
}
from
"
@/api/algorithm/scene
"
;
import
{
listBase
,
getBase
,
delBase
,
addBase
,
updateBase
,
pieceList
,
cameraList
,
typeList
,
sceneList
,
variableList
,
copyAlgorithm
,
editStatus
}
from
"
@/api/algorithm/scene
"
;
export
default
{
name
:
"
Base
"
,
...
...
@@ -357,7 +372,19 @@
this
.
reset
();
const
id
=
row
.
id
||
this
.
ids
getBase
(
id
).
then
(
response
=>
{
this
.
form
=
response
.
data
;
var
arr
=
[]
this
.
getOption
()
this
.
sceneChange
(
response
.
data
.
algorithmId
)
this
.
form
=
JSON
.
parse
(
JSON
.
stringify
(
response
.
data
))
arr
=
response
.
data
.
pieceDtos
this
.
form
.
pieceDtos
=
[]
this
.
form
.
alarmTypes
=
this
.
form
.
alarmTypes
.
split
(
'
,
'
)
this
.
form
.
cameraIdList
=
this
.
form
.
cameraIdList
.
split
(
'
,
'
)
this
.
form
.
cameraIdList
=
this
.
changeArr
(
this
.
form
.
cameraIdList
)
arr
.
forEach
(
item
=>
{
item
.
isEdit
=
false
this
.
form
.
pieceDtos
.
push
(
item
)
});
this
.
open
=
true
;
this
.
title
=
"
修改算法场景
"
;
});
...
...
@@ -386,6 +413,16 @@
sort
:
''
,
isEdit
:
true
,
})
},
//表格内校验
checkFrom
(
data
){
var
state
=
true
data
.
forEach
(
item
=>
{
if
(
item
.
isEdit
){
state
=
false
}
})
return
state
},
// 获取option
getOption
(){
...
...
@@ -407,14 +444,26 @@
},
pieceChange
(
e
){
variableList
(
e
.
id
).
then
(
res
=>
{
console
.
log
(
'
%c [ res ]-411
'
,
'
font-size:13px; background:pink; color:#bf2c9f;
'
,
res
)
e
.
variables
=
res
.
data
// this.typeOptions=res.data
})
},
copyAlgorithm
(
row
){
copyAlgorithm
(
row
.
id
).
then
(
res
=>
{
this
.
getList
();
console
.
log
(
'
%c [ res ]-432
'
,
'
font-size:13px; background:pink; color:#bf2c9f;
'
,
res
)
})
},
editStatus
(
row
){
editStatus
({
id
:
row
.
id
,
status
:
row
.
status
==
1
?
0
:
1
}).
then
(
res
=>
{
this
.
getList
();
console
.
log
(
'
%c [ res ]-432
'
,
'
font-size:13px; background:pink; color:#bf2c9f;
'
,
res
)
})
},
/** 提交按钮 */
submitForm
()
{
this
.
$refs
[
"
form
"
].
validate
(
valid
=>
{
if
(
this
.
checkFrom
(
this
.
form
.
pieceDtos
)){
this
.
$refs
[
"
form
"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
form
.
id
!=
null
)
{
updateBase
(
this
.
form
).
then
(
response
=>
{
...
...
@@ -431,6 +480,16 @@
}
}
});
}
else
{
this
.
$message
.
error
(
'
请保存表格内容
'
);
}
},
changeArr
(
data
){
var
arr
=
[]
data
.
forEach
(
item
=>
{
arr
.
push
(
item
*
1
)
})
return
arr
},
/** 删除按钮操作 */
handleDelete
(
row
)
{
...
...
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