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
0d01993a
Commit
0d01993a
authored
Aug 06, 2024
by
胡占生
🇨🇳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:算法管理,新增修改接口联调
parent
1294ebf8
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
465 additions
and
188 deletions
+465
-188
src/views/algorithmControl/components/algorithmDown.vue
src/views/algorithmControl/components/algorithmDown.vue
+207
-0
src/views/algorithmControl/components/form.vue
src/views/algorithmControl/components/form.vue
+218
-0
src/views/algorithmControl/index.vue
src/views/algorithmControl/index.vue
+25
-175
src/views/algorithmList/index.vue
src/views/algorithmList/index.vue
+15
-13
No files found.
src/views/algorithmControl/components/algorithmDown.vue
0 → 100644
View file @
0d01993a
<
template
>
<el-dialog
v-model=
"open"
width=
"800px"
append-to-body
>
<template
v-slot:header
>
<div
class=
"cleartitle"
style=
"display: flex;justify-content: flex-start;align-items: center;"
>
<img
src=
"@/assets/images/logo_video.png"
width=
"25px"
alt=
""
>
<span>
{{
title
}}
</span>
</div>
</
template
>
<el-row
:gutter=
"10"
class=
"mb8"
>
<div
class=
"form-title"
style=
"display: flex;justify-content: flex-start;align-items: center;"
>
<span>
基础信息
</span>
</div>
</el-row>
<el-form
ref=
"algRef"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"算法名称"
prop=
"postName"
>
<el-input
v-model=
"form.postName"
placeholder=
"请输入岗位名称"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"算法英文"
prop=
"postCode"
>
<el-input
v-model=
"form.postCode"
placeholder=
"请输入编码名称"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"硬件平台"
prop=
"yjpt"
>
<el-select
v-model=
"form.yjpt"
placeholder=
"请选择"
>
<el-option
:label=
"'英伟达'"
:value=
"'英伟达'"
></el-option>
<el-option
:label=
"'登临'"
:value=
"'登临'"
></el-option>
<el-option
:label=
"'灵汐'"
:value=
"'灵汐'"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"告警等级"
prop=
"status"
>
<el-input
v-model=
"form.gjdj"
placeholder=
"请输入告警等级"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-input
v-model=
"form.remark"
type=
"textarea"
:rows=
"8"
placeholder=
"请输入内容"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"卡片图片"
prop=
"status"
>
<ImageUpload
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-row
:gutter=
"10"
class=
"mb8"
style=
"justify-content: space-between;"
>
<el-col
:span=
"1.5"
>
<div
class=
"form-title"
style=
"display: flex;justify-content: flex-start;align-items: center;"
>
<span>
算法维护
</span>
</div>
</el-col>
<el-col
:span=
"6.8"
style=
"display: flex;"
>
<el-button
type=
"primary"
plain
icon=
"Search"
@
click=
"handleAdd"
>
搜索
</el-button>
<el-button
type=
"success"
plain
icon=
"Refresh"
@
click=
"handleUpdate"
>
版本更新
</el-button>
</el-col>
</el-row>
<el-card
class=
"left-list"
>
<el-table
v-loading=
"loading"
:data=
"postList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
label=
"文件名称"
align=
"center"
prop=
"postId"
/>
<el-table-column
label=
"状态"
align=
"center"
prop=
"postCode"
/>
<el-table-column
label=
"MD5核对结果"
align=
"center"
prop=
"postName"
/>
<el-table-column
label=
"文件大小"
align=
"center"
prop=
"postSort"
/>
<el-table-column
label=
"进度"
align=
"center"
prop=
"postSort"
/>
<el-table-column
label=
"操作"
width=
"180"
align=
"center"
class-name=
"small-padding fixed-width"
>
<
template
#default
="
scope
"
>
<el-button
link
type=
"primary"
icon=
"Edit"
@
click=
"handleUpdate(scope.row)"
v-hasPermi=
"['system:post:edit']"
>
修改
</el-button>
<el-button
link
type=
"primary"
icon=
"Delete"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['system:post:remove']"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
</el-card>
<
template
#footer
>
<div
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</
template
>
</el-dialog>
</template>
<
script
setup
>
import
{
listPost
,
addPost
,
delPost
,
getPost
,
updatePost
}
from
"
@/api/system/post
"
;
const
{
proxy
}
=
getCurrentInstance
();
const
emit
=
defineEmits
();
const
open
=
ref
(
false
);
const
title
=
ref
(
""
);
const
data
=
reactive
({
form
:
{},
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
postCode
:
undefined
,
postName
:
undefined
,
status
:
undefined
},
rules
:
{
postName
:
[{
required
:
true
,
message
:
"
岗位名称不能为空
"
,
trigger
:
"
blur
"
}],
postCode
:
[{
required
:
true
,
message
:
"
岗位编码不能为空
"
,
trigger
:
"
blur
"
}],
postSort
:
[{
required
:
true
,
message
:
"
岗位顺序不能为空
"
,
trigger
:
"
blur
"
}],
}
});
const
{
queryParams
,
form
,
rules
}
=
toRefs
(
data
);
/** 表单重置 */
function
reset
()
{
form
.
value
=
{
postId
:
undefined
,
postCode
:
undefined
,
postName
:
undefined
,
postSort
:
0
,
status
:
"
0
"
,
remark
:
undefined
};
proxy
.
resetForm
(
"
algRef
"
);
}
/** 新增按钮操作 */
function
handleAdd
()
{
reset
();
open
.
value
=
true
;
title
.
value
=
"
告警等级列表
"
;
}
/** 修改按钮操作 */
function
handleUpdate
(
row
)
{
reset
();
const
postId
=
row
.
postId
||
ids
.
value
;
getPost
(
postId
).
then
(
response
=>
{
form
.
value
=
response
.
data
;
open
.
value
=
true
;
title
.
value
=
"
修改算法
"
;
});
}
/** 提交按钮 */
function
submitForm
()
{
proxy
.
$refs
[
"
algRef
"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
form
.
value
.
postId
!=
undefined
)
{
updatePost
(
form
.
value
).
then
(
response
=>
{
proxy
.
$modal
.
msgSuccess
(
"
修改成功
"
);
open
.
value
=
false
;
getList
();
});
}
else
{
addPost
(
form
.
value
).
then
(
response
=>
{
proxy
.
$modal
.
msgSuccess
(
"
新增成功
"
);
open
.
value
=
false
;
getList
();
});
}
}
});
}
/** 取消按钮 */
function
cancel
()
{
open
.
value
=
false
;
reset
();
}
defineExpose
({
handleAdd
,
handleUpdate
})
</
script
>
<
style
scoped
lang=
"scss"
>
.form-title
{
display
:
flex
;
align-items
:center
;
/*for vertical align*/
font-size
:
16px
;
font-weight
:
600
;
border-radius
:
5px
;
padding
:
0
;
}
.
form-title
:
:
before
{
content
:
""
;
display
:
inline-block
;
width
:
10px
;
/* 矩形的宽度 */
height
:
30px
;
/* 矩形的高度 */
background-color
:
#1890FF
;
/* 矩形的背景颜色 */
margin-right
:
10px
;
border-radius
:
8px
;
}
</
style
>
\ No newline at end of file
src/views/algorithmControl/components/form.vue
0 → 100644
View file @
0d01993a
<
template
>
<el-dialog
v-model=
"open"
:title=
"title"
width=
"800px"
append-to-body
>
<template
v-slot:header
>
<div
class=
"cleartitle"
style=
"display: flex;justify-content: flex-start;align-items: center;"
>
<img
src=
"@/assets/images/logo_video.png"
width=
"25px"
alt=
""
>
<span>
{{
title
}}
</span>
</div>
</
template
>
<el-row
:gutter=
"10"
class=
"mb8"
>
<div
class=
"form-title"
style=
"display: flex;justify-content: flex-start;align-items: center;"
>
<span>
基础信息
</span>
</div>
</el-row>
<el-form
ref=
"algRef"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"算法名称"
prop=
"algorithmName"
>
<el-input
v-model=
"form.algorithmName"
placeholder=
"请输入岗位名称"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"算法英文"
prop=
"algorithmEnglish"
>
<el-input
v-model=
"form.algorithmEnglish"
placeholder=
"请输入编码名称"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"硬件平台"
prop=
"algorithmPlat"
>
<el-select
v-model=
"form.algorithmPlat"
placeholder=
"请选择硬件平台"
clearable
>
<el-option
:label=
"'英伟达'"
:value=
"'英伟达'"
/>
</el-select>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"算法场景"
prop=
"applicationScenarios"
>
<el-input
v-model=
"form.applicationScenarios"
placeholder=
"请输入算法场景"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label=
"卡片文案"
prop=
"cardCopywriting"
>
<el-input
v-model=
"form.cardCopywriting"
type=
"textarea"
:rows=
"8"
placeholder=
"请输入内容"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"卡片图片"
prop=
"cardImg"
>
<ImageUpload
:modelValue=
"form.cardImg"
:limit=
'1'
:fileSize=
"5"
@
update:modelValue=
"getImageUrl"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-row
:gutter=
"10"
class=
"mb8"
style=
"justify-content: space-between;"
>
<el-col
:span=
"1.5"
>
<div
class=
"form-title"
style=
"display: flex;justify-content: flex-start;align-items: center;"
>
<span>
算法维护
</span>
</div>
</el-col>
<el-col
:span=
"6.8"
style=
"display: flex;"
>
<el-button
type=
"primary"
plain
icon=
"Search"
@
click=
"handleAdd"
>
搜索
</el-button>
<el-button
type=
"success"
plain
icon=
"Refresh"
@
click=
"handleUpdate"
>
版本更新
</el-button>
<el-button
type=
"success"
plain
icon=
"UploadFilled"
@
click=
"handleUpdate"
>
算法上传
</el-button>
</el-col>
</el-row>
<el-card
class=
"left-list"
>
<el-table
v-loading=
"loading"
:data=
"postList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
label=
"文件名称"
align=
"center"
prop=
"postId"
/>
<el-table-column
label=
"状态"
align=
"center"
prop=
"postCode"
/>
<el-table-column
label=
"MD5核对结果"
align=
"center"
prop=
"postName"
/>
<el-table-column
label=
"文件大小"
align=
"center"
prop=
"postSort"
/>
<el-table-column
label=
"进度"
align=
"center"
prop=
"postSort"
/>
<el-table-column
label=
"操作"
width=
"180"
align=
"center"
class-name=
"small-padding fixed-width"
>
<
template
#default
="
scope
"
>
<el-button
link
type=
"primary"
icon=
"Edit"
@
click=
"handleUpdate(scope.row)"
v-hasPermi=
"['system:post:edit']"
>
修改
</el-button>
<el-button
link
type=
"primary"
icon=
"Delete"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['system:post:remove']"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
</el-card>
<
template
#footer
>
<div
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</
template
>
</el-dialog>
</template>
<
script
setup
>
import
{
addAlg
,
updateAlg
,
detailAlg
}
from
"
@/api/algorithmList/index.js
"
;
const
{
proxy
}
=
getCurrentInstance
();
const
emit
=
defineEmits
();
const
open
=
ref
(
false
);
const
title
=
ref
(
""
);
const
ids
=
ref
([]);
const
data
=
reactive
({
form
:
{},
queryParams
:
{
pageNum
:
1
,
pageSize
:
10
,
algorithmEnglish
:
undefined
,
algorithmName
:
undefined
,
status
:
undefined
},
rules
:
{
algorithmName
:
[{
required
:
true
,
message
:
"
算法名称不能为空
"
,
trigger
:
"
blur
"
}],
applicationScenarios
:
[{
required
:
true
,
message
:
"
算法场景不能为空
"
,
trigger
:
"
blur
"
}],
cardCopywriting
:
[{
required
:
true
,
message
:
"
卡片文案不能为空
"
,
trigger
:
"
blur
"
}],
cardImg
:
[{
required
:
true
,
message
:
"
卡片图片不能为空
"
,
trigger
:
"
blur
"
}],
}
});
const
{
queryParams
,
form
,
rules
}
=
toRefs
(
data
);
function
getImageUrl
(
url
){
form
.
value
.
cardImg
=
url
console
.
log
(
"
🚀 ~ getImageUrl ~ orm.cardImg:
"
,
form
)
}
/** 表单重置 */
function
reset
()
{
form
.
value
=
{
id
:
undefined
,
algorithmEnglish
:
undefined
,
algorithmName
:
undefined
,
algorithmPlat
:
''
,
status
:
"
0
"
,
remark
:
undefined
};
proxy
.
resetForm
(
"
algRef
"
);
}
/** 新增按钮操作 */
function
handleAdd
()
{
reset
();
open
.
value
=
true
;
title
.
value
=
"
添加算法
"
;
}
/** 修改按钮操作 */
function
handleUpdate
(
row
)
{
reset
();
const
id
=
row
.
id
||
ids
.
value
;
detailAlg
(
id
).
then
(
response
=>
{
form
.
value
=
response
.
data
;
open
.
value
=
true
;
title
.
value
=
"
修改算法
"
;
});
}
/** 提交按钮 */
function
submitForm
()
{
proxy
.
$refs
[
"
algRef
"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
form
.
value
.
id
!=
undefined
)
{
updateAlg
(
form
.
value
).
then
(
response
=>
{
proxy
.
$modal
.
msgSuccess
(
"
修改成功
"
);
open
.
value
=
false
;
emit
(
"
getList
"
);
});
}
else
{
addAlg
(
form
.
value
).
then
(
response
=>
{
proxy
.
$modal
.
msgSuccess
(
"
新增成功
"
);
open
.
value
=
false
;
emit
(
"
getList
"
);
});
}
}
});
}
/** 取消按钮 */
function
cancel
()
{
open
.
value
=
false
;
reset
();
}
defineExpose
({
handleAdd
,
handleUpdate
})
</
script
>
<
style
scoped
lang=
"scss"
>
.form-title
{
display
:
flex
;
align-items
:center
;
/*for vertical align*/
font-size
:
16px
;
font-weight
:
600
;
border-radius
:
5px
;
padding
:
0
;
}
.
form-title
:
:
before
{
content
:
""
;
display
:
inline-block
;
width
:
10px
;
/* 矩形的宽度 */
height
:
30px
;
/* 矩形的高度 */
background-color
:
#1890FF
;
/* 矩形的背景颜色 */
margin-right
:
10px
;
border-radius
:
8px
;
}
</
style
>
\ No newline at end of file
src/views/algorithmControl/index.vue
View file @
0d01993a
This diff is collapsed.
Click to expand it.
src/views/algorithmList/index.vue
View file @
0d01993a
...
...
@@ -17,8 +17,8 @@
</
template
>
</el-input>
</div>
<
el-button
type=
"primary"
plain
@
click=
"handAdd"
>
新增算法
</el-button
>
<el-button
type=
"primary"
plain
>
告警等级
</el-button>
<
!-- <el-button type="primary" plain @click="handAdd">新增算法</el-button> --
>
<el-button
type=
"primary"
@
click=
"handeAdd"
plain
>
告警等级
</el-button>
</div>
<el-row
:gutter=
"10"
>
<el-col
:xs=
"0"
:sm=
"2"
:md=
"3"
:lg=
"4"
>
...
...
@@ -87,10 +87,12 @@
</div>
</
template
>
<
template
v-slot:default
>
<img
:src=
"item.cardImg"
style=
"width: 100%"
/>
<div
style=
"width: 100%;max-height: 200px;overflow: hidden;"
>
<img
:src=
"'http://192.168.4.206' +item.cardImg"
style=
"width: 100%;"
/>
</div>
<p
style=
"color: #999999;font-size: 12px;"
>
{{
item
.
cardCopywriting
}}
</p>
...
...
@@ -124,19 +126,19 @@
</el-scrollbar>
</el-col>
</el-row>
<alg
Form
ref=
"algFormRef"
@
getList=
"getList"
/>
<alg
orithmDown
ref=
"algorithmDownRef"
/>
</div>
</template>
<
script
setup
name=
"Index"
>
import
{
listAlg
,
detailAlg
,
addAlg
,
updateAlg
,
deleteAlg
,
}
from
"
@/api/algorithmList/index.js
"
;
import
alg
Form
from
'
./components/form
.vue
'
import
alg
orithmDown
from
'
./components/algorithmDown
.vue
'
// import algForm from './components/algorithmDown.vue'
import
{
ArrowDown
}
from
'
@element-plus/icons-vue
'
import
{
Search
}
from
'
@element-plus/icons-vue
'
const
router
=
useRouter
();
const
{
proxy
}
=
getCurrentInstance
();
const
alg
Form
Ref
=
ref
(
null
)
const
alg
orithmDown
Ref
=
ref
(
null
)
const
nowText
=
ref
(
'
算法管理
'
)
const
ids
=
ref
([]);
const
algorithmList
=
reactive
([
...
...
@@ -207,8 +209,8 @@
// loading.value = false;
});
}
function
handAdd
(
row
){
alg
Form
Ref
.
value
.
handleAdd
()
function
hand
e
Add
(
row
){
alg
orithmDown
Ref
.
value
.
handleAdd
()
}
function
handDetails
(
id
){
router
.
push
(
"
/algorithmList/details/info/
"
+
'
123
'
);
...
...
@@ -224,7 +226,7 @@
// });
}
function
handleUpdate
(
row
)
{
alg
Form
Ref
.
value
.
handleUpdate
(
row
)
alg
orithmDown
Ref
.
value
.
handleUpdate
(
row
)
}
/** 删除按钮操作 */
...
...
@@ -250,7 +252,7 @@
position
:
absolute
;
display
:
flex
;
top
:
30px
;
right
:
2
0px
;
right
:
3
0px
;
}
.left-list
{
min-height
:
700px
;
...
...
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