Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ai-yunshou-vue
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云守
ai-yunshou-vue
Commits
ceeba9a6
Commit
ceeba9a6
authored
Aug 15, 2024
by
胡占生
🇨🇳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复项目中出现的小问题,比如:删除接口的联调,左侧菜单的点击事件
parent
98ace9f0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
28 deletions
+61
-28
src/views/algorithmControl/components/form.vue
src/views/algorithmControl/components/form.vue
+5
-5
src/views/algorithmControl/index.vue
src/views/algorithmControl/index.vue
+5
-5
src/views/algorithmList/components/details.vue
src/views/algorithmList/components/details.vue
+25
-7
src/views/algorithmList/components/websockt.js
src/views/algorithmList/components/websockt.js
+11
-8
src/views/algorithmList/index.vue
src/views/algorithmList/index.vue
+15
-3
No files found.
src/views/algorithmControl/components/form.vue
View file @
ceeba9a6
...
@@ -64,7 +64,7 @@
...
@@ -64,7 +64,7 @@
</el-col>
</el-col>
</el-row>
</el-row>
</el-form>
</el-form>
<el-row
:gutter=
"10"
class=
"mb8"
style=
"justify-content: space-between;"
>
<
!-- <
el-row :gutter="10" class="mb8" style="justify-content: space-between;">
<el-col :span="1.5">
<el-col :span="1.5">
<div class="form-title" style="display: flex;justify-content: flex-start;align-items: center;">
<div class="form-title" style="display: flex;justify-content: flex-start;align-items: center;">
<span>算法维护</span>
<span>算法维护</span>
...
@@ -105,7 +105,7 @@
...
@@ -105,7 +105,7 @@
</template>
</template>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
</el-card>
</el-card>
-->
</div>
</div>
<el-form
ref=
"algRef"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
v-else
>
<el-form
ref=
"algRef"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
v-else
>
...
@@ -139,7 +139,7 @@
...
@@ -139,7 +139,7 @@
</el-col>
</el-col>
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"算法场景"
prop=
"applicationScenarios"
>
<el-form-item
label=
"算法场景"
prop=
"applicationScenarios"
>
<el-select
v-model=
"form.applicationScenarios"
placeholder=
"请选择
硬件平台
"
clearable
>
<el-select
v-model=
"form.applicationScenarios"
placeholder=
"请选择
算法场景
"
clearable
>
<el-option
<el-option
v-for=
"disc in algorithm_scen"
v-for=
"disc in algorithm_scen"
:key=
"disc.value"
:key=
"disc.value"
...
@@ -162,7 +162,7 @@
...
@@ -162,7 +162,7 @@
</el-form-item>
</el-form-item>
</el-col>
</el-col>
</el-row>
</el-row>
<el-row
:gutter=
"10"
class=
"mb8"
style=
"justify-content: space-between;"
>
<
!-- <
el-row :gutter="10" class="mb8" style="justify-content: space-between;">
<el-col :span="1.5">
<el-col :span="1.5">
<div class="form-title" style="display: flex;justify-content: flex-start;align-items: center;">
<div class="form-title" style="display: flex;justify-content: flex-start;align-items: center;">
<span>算法维护</span>
<span>算法维护</span>
...
@@ -203,7 +203,7 @@
...
@@ -203,7 +203,7 @@
</template>
</template>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
</el-card>
</el-card>
-->
</el-tab-pane>
</el-tab-pane>
<el-tab-pane
label=
"算法详情"
name=
"算法详情"
>
<el-tab-pane
label=
"算法详情"
name=
"算法详情"
>
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-row
:gutter=
"10"
class=
"mb8"
>
...
...
src/views/algorithmControl/index.vue
View file @
ceeba9a6
...
@@ -89,9 +89,9 @@
...
@@ -89,9 +89,9 @@
<el-table-column
label=
"操作"
align=
"center"
width=
"200"
class-name=
"small-padding fixed-width"
>
<el-table-column
label=
"操作"
align=
"center"
width=
"200"
class-name=
"small-padding fixed-width"
>
<template
#default
="
scope
"
>
<template
#default
="
scope
"
>
<el-tooltip
content=
"导入算法包"
placement=
"top"
>
<
!--
<
el-tooltip
content=
"导入算法包"
placement=
"top"
>
<el-button
link
type=
"primary"
icon=
"UploadFilled"
@
click=
"handleUpdate(scope.row)"
></el-button>
<el-button
link
type=
"primary"
icon=
"UploadFilled"
@
click=
"handleUpdate(scope.row)"
></el-button>
</el-tooltip>
</el-tooltip>
-->
<el-tooltip
content=
"修改"
placement=
"top"
>
<el-tooltip
content=
"修改"
placement=
"top"
>
<el-button
link
type=
"primary"
icon=
"Edit"
@
click=
"handleUpdate(scope.row)"
></el-button>
<el-button
link
type=
"primary"
icon=
"Edit"
@
click=
"handleUpdate(scope.row)"
></el-button>
</el-tooltip>
</el-tooltip>
...
@@ -306,9 +306,9 @@
...
@@ -306,9 +306,9 @@
/** 删除按钮操作 */
/** 删除按钮操作 */
function
handleDelete
(
row
)
{
function
handleDelete
(
row
)
{
const
jobIds
=
row
.
jobI
d
||
ids
.
value
;
const
id
=
row
.
i
d
||
ids
.
value
;
proxy
.
$modal
.
confirm
(
'
是否确认删除定时任务编号为"
'
+
jobIds
+
'
"的数据项?
'
).
then
(
function
()
{
proxy
.
$modal
.
confirm
(
'
是否确认删除算法名称为"
'
+
row
.
algorithmName
+
'
"的数据项?
'
).
then
(
function
()
{
return
del
Job
(
jobIds
);
return
del
eteAlg
(
id
);
}).
then
(()
=>
{
}).
then
(()
=>
{
getList
();
getList
();
proxy
.
$modal
.
msgSuccess
(
"
删除成功
"
);
proxy
.
$modal
.
msgSuccess
(
"
删除成功
"
);
...
...
src/views/algorithmList/components/details.vue
View file @
ceeba9a6
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
<el-col
:xs=
"4"
:sm=
"4"
:md=
"4"
:lg=
"4"
>
<el-col
:xs=
"4"
:sm=
"4"
:md=
"4"
:lg=
"4"
>
图片上传
图片上传
<div
class=
"upload-box"
>
<div
class=
"upload-box"
>
<ImageUpload
:defaultUrl=
"'/uploa
d-api'"
:limit=
'1'
:fileSize=
"5"
:isShowTip=
"false"
@
update:modelObj=
"getImgObj"
/>
<ImageUpload
:defaultUrl=
"'/upload-api'"
:defaultBaseUrl=
"'http://192.168.3.71:9081'+ '/pro
d-api'"
:limit=
'1'
:fileSize=
"5"
:isShowTip=
"false"
@
update:modelObj=
"getImgObj"
/>
</div>
</div>
</el-col>
</el-col>
<el-col
:xs=
"10"
:sm=
"10"
:md=
"10"
:lg=
"10"
>
<el-col
:xs=
"10"
:sm=
"10"
:md=
"10"
:lg=
"10"
>
...
@@ -57,6 +57,7 @@
...
@@ -57,6 +57,7 @@
<el-col
:xs=
"10"
:sm=
"10"
:md=
"10"
:lg=
"10"
>
<el-col
:xs=
"10"
:sm=
"10"
:md=
"10"
:lg=
"10"
>
算法识别结果
算法识别结果
<div
class=
"img-box"
v-if=
"outFilePath.length==0"
>
<div
class=
"img-box"
v-if=
"outFilePath.length==0"
>
<div>
{{ resultStr }}
</div>
<img
src=
"@/assets/images/default.png"
height=
"100%"
/>
<img
src=
"@/assets/images/default.png"
height=
"100%"
/>
</div>
</div>
<div
class=
"img-box"
v-else
>
<div
class=
"img-box"
v-else
>
...
@@ -72,15 +73,31 @@
...
@@ -72,15 +73,31 @@
<el-row
:gutter=
"10"
>
<el-row
:gutter=
"10"
>
<el-col
:xs=
"12"
:sm=
"12"
:md=
"12"
:lg=
"12"
>
<el-col
:xs=
"12"
:sm=
"12"
:md=
"12"
:lg=
"12"
>
有效的拍摄方式:
有效的拍摄方式:
<div
class=
"img-box"
>
<div
class=
"img-box"
v-if=
"effectiveList.length==0"
>
<img
src=
"@/assets/images/default.png"
height=
"100%"
/>
<img
src=
"@/assets/images/default.png"
height=
"100%"
/>
</div>
</div>
<div
class=
"img-box"
v-else
>
<div
v-for=
"item in effectiveList"
:key=
"item.id"
>
<p>
{{item.remark}}
</p>
<ImagePreview
style=
"width: 400px;height: 225px;"
:src=
"item.caseFile"
/>
</div>
</div>
</el-col>
</el-col>
<el-col
:xs=
"12"
:sm=
"12"
:md=
"12"
:lg=
"12"
>
<el-col
:xs=
"12"
:sm=
"12"
:md=
"12"
:lg=
"12"
>
无效的拍摄方式:
无效的拍摄方式:
<div
class=
"img-box"
>
<div
class=
"img-box"
v-if=
"invalidList.length==0"
>
<img
src=
"@/assets/images/default.png"
height=
"100%"
/>
<img
src=
"@/assets/images/default.png"
height=
"100%"
/>
</div>
</div>
<div
class=
"img-box"
v-else
>
<div
v-for=
"item in invalidList"
:key=
"item.id"
>
<p>
{{item.remark}}
</p>
<ImagePreview
style=
"width: 400px;height: 225px;"
:src=
"item.caseFile"
/>
</div>
</div>
</el-col>
</el-col>
</el-row>
</el-row>
</div>
</div>
...
@@ -97,7 +114,7 @@ import { detailAlg} from "@/api/algorithmList/index.js";
...
@@ -97,7 +114,7 @@ import { detailAlg} from "@/api/algorithmList/index.js";
import
{
listScene
,
detailScene
}
from
"
@/api/algorithmList/scene.js
"
;
import
{
listScene
,
detailScene
}
from
"
@/api/algorithmList/scene.js
"
;
import
{
listBoundary
,
detailBoundary
}
from
"
@/api/algorithmList/boundary.js
"
;
import
{
listBoundary
,
detailBoundary
}
from
"
@/api/algorithmList/boundary.js
"
;
import
{
useWebSockets
}
from
'
./websockt.js
'
;
// 注意文件路径可能需要调整
import
{
useWebSockets
}
from
'
./websockt.js
'
;
// 注意文件路径可能需要调整
const
{
handeUpload
,
outFilePath
}
=
useWebSockets
();
const
{
handeUpload
,
outFilePath
,
resultStr
}
=
useWebSockets
();
const
router
=
useRouter
();
const
router
=
useRouter
();
const
route
=
useRoute
()
const
route
=
useRoute
()
const
nowImg
=
ref
(
''
)
const
nowImg
=
ref
(
''
)
...
@@ -105,6 +122,8 @@ const { roleId } =route.params
...
@@ -105,6 +122,8 @@ const { roleId } =route.params
const
{
proxy
}
=
getCurrentInstance
();
const
{
proxy
}
=
getCurrentInstance
();
const
algFormRef
=
ref
(
null
)
const
algFormRef
=
ref
(
null
)
const
applicationList
=
ref
([])
const
applicationList
=
ref
([])
const
effectiveList
=
ref
([])
const
invalidList
=
ref
([])
const
nowText
=
ref
(
'
算法详情
'
)
const
nowText
=
ref
(
'
算法详情
'
)
const
data
=
reactive
({
const
data
=
reactive
({
form
:
{},
form
:
{},
...
@@ -127,15 +146,14 @@ function getDetials(){
...
@@ -127,15 +146,14 @@ function getDetials(){
form
.
value
=
res
.
data
form
.
value
=
res
.
data
})
})
listScene
({
algorithmId
:
roleId
}).
then
(
res
=>
{
listScene
({
algorithmId
:
roleId
}).
then
(
res
=>
{
console
.
log
(
"
🚀 ~ listScene ~ res:
"
,
res
)
applicationList
.
value
=
res
.
rows
applicationList
.
value
=
res
.
rows
})
})
listBoundary
({
algorithmId
:
roleId
}).
then
(
res
=>
{
listBoundary
({
algorithmId
:
roleId
}).
then
(
res
=>
{
console
.
log
(
"
🚀 ~ listBoundary ~ res:
"
,
res
)
effectiveList
.
value
=
res
.
rows
.
filter
(
item
=>
item
.
caseType
===
'
0
'
)
invalidList
.
value
=
res
.
rows
.
filter
(
item
=>
item
.
caseType
===
'
1
'
)
})
})
}
}
function
getImgObj
(
obj
){
function
getImgObj
(
obj
){
console
.
log
(
"
🚀 ~ getImgObj ~ obj:
"
,
obj
)
nowImg
.
value
=
obj
.
url
nowImg
.
value
=
obj
.
url
handeUpload
(
obj
)
handeUpload
(
obj
)
}
}
...
...
src/views/algorithmList/components/websockt.js
View file @
ceeba9a6
...
@@ -8,12 +8,12 @@ export function useWebSockets() {
...
@@ -8,12 +8,12 @@ export function useWebSockets() {
const
uploadData
=
ref
({})
//上传成功后返回的数据
const
uploadData
=
ref
({})
//上传成功后返回的数据
const
id
=
ref
(
null
)
const
id
=
ref
(
null
)
const
client
=
ref
(
null
)
const
client
=
ref
(
null
)
const
resultStr
=
ref
(
''
)
const
outFilePath
=
ref
(
''
)
//算法处理后的图片
const
outFilePath
=
ref
(
''
)
//算法处理后的图片
const
route
=
useRoute
()
const
route
=
useRoute
()
const
{
roleId
}
=
route
.
params
const
{
roleId
}
=
route
.
params
const
{
proxy
}
=
getCurrentInstance
();
// 定义点击事件 myFn
// 定义点击事件 myFn
function
handeUpload
(
e
){
function
handeUpload
(
e
){
uploadData
.
value
=
e
uploadData
.
value
=
e
console
.
log
(
"
🚀 ~ handeUpload ~ uploadData.value:
"
,
uploadData
.
value
)
console
.
log
(
"
🚀 ~ handeUpload ~ uploadData.value:
"
,
uploadData
.
value
)
...
@@ -32,14 +32,17 @@ export function useWebSockets() {
...
@@ -32,14 +32,17 @@ export function useWebSockets() {
fileName
:
uploadData
.
value
.
fileName
fileName
:
uploadData
.
value
.
fileName
})
})
}
else
if
(
result
.
type
==
2
)
{
}
else
if
(
result
.
type
==
2
)
{
console
.
log
(
'
123
'
,
123
)
const
queue
=
result
.
data
.
queue
.
indexOf
(
'
[
'
)
==
-
1
?
result
.
data
.
queue
:
JSON
.
parse
(
result
.
data
.
queue
);
const
queue
=
result
.
data
.
queue
.
indexOf
(
'
[
'
)
==
-
1
?
result
.
data
.
queue
:
JSON
.
parse
(
result
.
data
.
queue
);
// this.result = queue;
console
.
log
(
"
🚀 ~ websocketMessage ~ queue:
"
,
queue
)
if
(
!
queue
.
length
)
{
if
(
!
queue
.
length
)
{
console
.
log
(
'
err
'
,
err
)
proxy
.
$modal
.
msgWarning
(
"
未检测到预警
"
);
resultStr
.
value
=
'
未检测到预警
'
;
outFilePath
.
value
=
''
}
else
{
outFilePath
.
value
=
'
http://192.168.3.71:9081
'
+
'
/prod-api
'
+
'
/profile/endfile
'
+
result
.
data
.
outFilePath
;
proxy
.
$modal
.
msgSuccess
(
"
算法处理成功
"
);
}
}
outFilePath
.
value
=
'
http://192.168.3.71:9081
'
+
'
/prod-api
'
+
'
/profile/endfile
'
+
result
.
data
.
outFilePath
;
// this.uploading = false;
client
.
value
.
disconnect
();
client
.
value
.
disconnect
();
}
}
}
}
...
@@ -49,5 +52,5 @@ export function useWebSockets() {
...
@@ -49,5 +52,5 @@ export function useWebSockets() {
});
});
// 外部使用组合API中定义的变量或方法,在模板中可用。
// 外部使用组合API中定义的变量或方法,在模板中可用。
return
{
handeUpload
,
outFilePath
}
// 返回的函数与方法的行为相同
return
{
handeUpload
,
outFilePath
,
resultStr
}
// 返回的函数与方法的行为相同
}
}
\ No newline at end of file
src/views/algorithmList/index.vue
View file @
ceeba9a6
...
@@ -27,10 +27,14 @@
...
@@ -27,10 +27,14 @@
default-active=
"2"
default-active=
"2"
class=
"el-menu-vertical-demo"
class=
"el-menu-vertical-demo"
>
>
<el-menu-item
:index=
"'我的算法'"
>
<el-menu-item
:index=
"''"
@
click=
"handMenuClick"
>
<span>
全部
</span>
</el-menu-item>
<el-menu-item
:index=
"'我的算法'"
@
click=
"handMenuClick"
>
<span>
我的算法
</span>
<span>
我的算法
</span>
</el-menu-item>
</el-menu-item>
<el-menu-item
v-for=
"item in algorithm_scen"
:key=
"item.value"
:index=
"item.value"
>
<el-menu-item
v-for=
"item in algorithm_scen"
:key=
"item.value"
:index=
"item.value"
@
click=
"handMenuClick"
>
<span>
{{ item.label }}
</span>
<span>
{{ item.label }}
</span>
</el-menu-item>
</el-menu-item>
</el-menu>
</el-menu>
...
@@ -41,7 +45,7 @@
...
@@ -41,7 +45,7 @@
<el-card
class=
"right-list"
>
<el-card
class=
"right-list"
>
<
template
v-slot:header
>
<
template
v-slot:header
>
<div
class=
"cleartitle"
style=
"justify-content: flex-start"
>
<div
class=
"cleartitle"
style=
"justify-content: flex-start"
>
<img
src=
"@/assets/images/logo_video.png"
width=
"25px"
alt=
""
>
<span>
我的算法
</span>
<img
src=
"@/assets/images/logo_video.png"
width=
"25px"
alt=
""
>
<span>
{{
nowTopTitle
}}
</span>
</div>
</div>
</
template
>
</
template
>
<el-row
:gutter=
"10"
class=
"mb8"
style=
"justify-content: flex-start;"
>
<el-row
:gutter=
"10"
class=
"mb8"
style=
"justify-content: flex-start;"
>
...
@@ -145,6 +149,7 @@
...
@@ -145,6 +149,7 @@
const
router
=
useRouter
();
const
router
=
useRouter
();
const
algorithmDownRef
=
ref
(
null
)
const
algorithmDownRef
=
ref
(
null
)
const
nowText
=
ref
(
'
算法管理
'
)
const
nowText
=
ref
(
'
算法管理
'
)
const
nowTopTitle
=
ref
(
'
算法管理
'
)
const
ids
=
ref
([]);
const
ids
=
ref
([]);
const
algorithmList
=
reactive
([
const
algorithmList
=
reactive
([
{
{
...
@@ -235,6 +240,13 @@
...
@@ -235,6 +240,13 @@
algorithmDownRef
.
value
.
handleUpdate
(
row
)
algorithmDownRef
.
value
.
handleUpdate
(
row
)
}
}
function
handMenuClick
(
row
)
{
queryParams
.
value
.
applicationScenarios
=
row
.
index
nowTopTitle
.
value
=
row
.
index
getList
()
console
.
log
(
"
🚀 ~ handMenuClick ~ row:
"
,
row
)
}
/** 删除按钮操作 */
/** 删除按钮操作 */
function
handleDelete
(
row
)
{
function
handleDelete
(
row
)
{
const
id
=
row
.
id
||
ids
.
value
;
const
id
=
row
.
id
||
ids
.
value
;
...
...
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