Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
AI_VUE2_Ruoyi
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
lei
AI_VUE2_Ruoyi
Commits
d175353f
Commit
d175353f
authored
May 10, 2025
by
lei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add:视频分析任务接口联调
parent
c31afea9
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
299 additions
and
102 deletions
+299
-102
videoanalysistasks.js
src/api/business/videoanalysistasks.js
+34
-0
index.vue
src/views/VideoAnalysisTasks/index.vue
+89
-26
addVideoAnlysisTasks.vue
...views/VideoAnalysisTasks/modules/addVideoAnlysisTasks.vue
+176
-76
No files found.
src/api/business/videoanalysistasks.js
0 → 100644
View file @
d175353f
import
request
from
'
@/utils/request
'
// 获取视频分析任务列表
export
function
getVideoAnalysisTaskList
(
query
)
{
return
request
({
url
:
'
/system/task/list
'
,
method
:
'
get
'
,
params
:
query
})
}
// 新增视频分析任务
export
function
addVideoAnalysisTask
(
data
)
{
return
request
({
url
:
'
/system/task
'
,
method
:
'
post
'
,
data
:
data
})
}
// 修改视频分析任务
export
function
updateVideoAnalysisTask
(
data
)
{
return
request
({
url
:
'
/system/task
'
,
method
:
'
put
'
,
data
:
data
})
}
// 删除视频分析任务
export
function
delVideoAnalysisTask
(
id
)
{
return
request
({
url
:
'
/system/task/
'
+
id
,
method
:
'
delete
'
})
}
\ No newline at end of file
src/views/VideoAnalysisTasks/index.vue
View file @
d175353f
...
@@ -33,24 +33,29 @@
...
@@ -33,24 +33,29 @@
<el-table-column
<el-table-column
label=
"任务ID"
label=
"任务ID"
align=
"center"
align=
"center"
prop=
"
i
d"
prop=
"
taskI
d"
></el-table-column>
></el-table-column>
<el-table-column
<el-table-column
label=
"任务名称"
label=
"任务名称"
align=
"center"
align=
"center"
prop=
"name"
prop=
"taskName"
></el-table-column>
<el-table-column
label=
"关联算法"
align=
"center"
prop=
"aboutAslgorithm"
></el-table-column>
></el-table-column>
<el-table-column
label=
"关联算法"
align=
"center"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
algorithmNames
|
ftNames
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"任务启用状态"
align=
"center"
>
<el-table-column
label=
"任务启用状态"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-switch
<el-switch
v-model=
"scope.row.
s
tatus"
v-model=
"scope.row.
taskS
tatus"
active-color=
"#13ce66"
active-color=
"#13ce66"
inactive-color=
"#ff4949"
inactive-color=
"#ff4949"
active-value=
"1"
inactive-value=
"0"
@
change=
"(value) => handleSwitchChange(scope.row, value)"
></el-switch>
></el-switch>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
...
@@ -93,7 +98,13 @@
...
@@ -93,7 +98,13 @@
</template>
</template>
<
script
>
<
script
>
import
addVideoAnlysisTasks
from
"
@/views/VideoAnalysisTasks/modules/addVideoAnlysisTasks.vue
"
;
import
addVideoAnlysisTasks
from
"
./modules/addVideoAnlysisTasks.vue
"
;
import
{
getVideoAnalysisTaskList
,
addVideoAnalysisTask
,
updateVideoAnalysisTask
,
delVideoAnalysisTask
,
}
from
"
@/api/business/videoanalysistasks.js
"
;
export
default
{
export
default
{
name
:
"
VideoAnalysisTasks
"
,
name
:
"
VideoAnalysisTasks
"
,
props
:
{},
props
:
{},
...
@@ -101,14 +112,7 @@ export default {
...
@@ -101,14 +112,7 @@ export default {
data
()
{
data
()
{
return
{
return
{
searchValue
:
""
,
// 搜索框的值
searchValue
:
""
,
// 搜索框的值
tableList
:
[
tableList
:
[],
{
id
:
1
,
name
:
"
视频分析任务1
"
,
aboutAslgorithm
:
"
这是一个视频分析任务
"
,
status
:
0
,
// 0:禁用 1:启用
},
],
queryParams
:
{
queryParams
:
{
pageNum
:
1
,
// 当前页码
pageNum
:
1
,
// 当前页码
pageSize
:
10
,
// 每页显示的数量
pageSize
:
10
,
// 每页显示的数量
...
@@ -121,30 +125,75 @@ export default {
...
@@ -121,30 +125,75 @@ export default {
},
},
computed
:
{},
computed
:
{},
watch
:
{},
watch
:
{},
created
()
{},
created
()
{
this
.
getList
();
},
mounted
()
{},
mounted
()
{},
filters
:
{
// 过滤算法名称
ftNames
(
algorithmNames
)
{
if
(
algorithmNames
)
{
return
algorithmNames
.
join
(
"
,
"
);
// 将数组转换为逗号分隔的字符串
}
else
{
return
"
无关联算法
"
;
// 如果数组为空,返回空字符串
}
},
},
methods
:
{
methods
:
{
// 新增
// 新增
append
()
{
append
()
{
this
.
currentRow
=
""
;
// 存储当前行数据
this
.
currentRow
=
null
;
// 存储当前行数据
this
.
drawer
=
true
;
// 打开抽屉
this
.
drawer
=
true
;
// 打开抽屉
},
},
// 搜索
// 搜索
search
()
{},
search
()
{},
// 分页
// 分页
getList
()
{},
getList
()
{
getVideoAnalysisTaskList
(
this
.
queryParams
).
then
((
res
)
=>
{
if
(
res
.
code
!==
200
)
{
this
.
$modal
.
msgError
(
res
.
msg
);
return
;
}
this
.
tableList
=
res
.
rows
;
// 表格数据
this
.
total
=
res
.
total
;
// 总数量
});
},
// 删除
// 删除
deleteBut
(
row
)
{
deleteBut
(
row
)
{
this
.
$confirm
(
"
确认删除吗?
"
,
"
提示
"
,
{
delVideoAnalysisTask
(
row
.
taskId
).
then
((
res
)
=>
{
confirmButtonText
:
"
确定
"
,
if
(
res
.
code
!==
200
)
{
cancelButtonText
:
"
取消
"
,
this
.
$modal
.
msgError
(
res
.
msg
);
type
:
"
warning
"
,
return
;
}
else
{
this
.
$modal
.
msgSuccess
(
res
.
msg
);
this
.
getList
();
// 重新获取列表数据
}
});
});
},
},
// 编辑
// 编辑
editBut
(
row
)
{
editBut
(
row
)
{
if
(
row
.
taskStatus
==
1
)
{
this
.
$modal
.
confirm
(
"
启用状态下无法编辑,是否关闭任务?
"
)
.
then
((
res
)
=>
{
updateVideoAnalysisTask
({
taskId
:
row
.
taskId
,
taskStatus
:
0
}).
then
(
(
res
)
=>
{
if
(
res
.
code
!==
200
)
{
this
.
$modal
.
msgError
(
res
.
msg
);
return
;
}
else
{
this
.
currentRow
=
row
;
// 存储当前行数据
this
.
$nextTick
(()
=>
{
this
.
drawer
=
true
;
});
}
}
);
// 切换状态为禁用
});
}
else
{
this
.
currentRow
=
row
;
// 存储当前行数据
this
.
currentRow
=
row
;
// 存储当前行数据
this
.
drawer
=
true
;
// 打开抽屉
this
.
drawer
=
true
;
// 打开抽屉
}
},
},
// 关闭抽屉
// 关闭抽屉
closeDrawer
()
{
closeDrawer
()
{
...
@@ -152,6 +201,20 @@ export default {
...
@@ -152,6 +201,20 @@ export default {
//需要重新获取列表数据
//需要重新获取列表数据
this
.
getList
();
this
.
getList
();
},
},
// 切换状态
handleSwitchChange
(
row
,
value
)
{
updateVideoAnalysisTask
({
taskId
:
row
.
taskId
,
taskStatus
:
value
}).
then
(
(
res
)
=>
{
if
(
res
.
code
!==
200
)
{
this
.
$modal
.
msgError
(
res
.
msg
);
return
;
}
else
{
this
.
$modal
.
msgSuccess
(
res
.
msg
);
this
.
getList
();
// 重新获取列表数据
}
}
);
},
},
},
};
};
</
script
>
</
script
>
...
...
src/views/VideoAnalysisTasks/modules/addVideoAnlysisTasks.vue
View file @
d175353f
This diff is collapsed.
Click to expand it.
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