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
4dcefc1b
Commit
4dcefc1b
authored
Sep 06, 2024
by
胡占生
🇨🇳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 我的算法接口联调
parent
961d388e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
15 deletions
+72
-15
src/api/algorithmList/index.js
src/api/algorithmList/index.js
+44
-0
src/views/algorithmList/index.vue
src/views/algorithmList/index.vue
+28
-15
No files found.
src/api/algorithmList/index.js
View file @
4dcefc1b
...
...
@@ -39,6 +39,15 @@ export function listAlgFile(query) {
params
:
query
})
}
// 查询我的算法列表
export
function
listMyAlg
(
query
)
{
return
request
({
url
:
'
/yunshou/userAlgorithm/list
'
,
method
:
'
get
'
,
params
:
query
})
}
// 查询算法列表x详情
export
function
detailAlg
(
id
)
{
...
...
@@ -58,6 +67,15 @@ export function addAlg(data) {
})
}
// 新增我的算法列表
export
function
addMyAlg
(
data
)
{
return
request
({
url
:
'
/yunshou/userAlgorithm
'
,
method
:
'
post
'
,
data
:
data
})
}
// 修改算法列表
export
function
updateAlg
(
data
)
{
return
request
({
...
...
@@ -67,6 +85,24 @@ export function updateAlg(data) {
})
}
// 修改我的算法列表
export
function
updateMyAlg
(
data
)
{
return
request
({
url
:
'
/yunshou/userAlgorithm
'
,
method
:
'
put
'
,
data
:
data
})
}
// 修改我的算法状态
export
function
updateMyAlgState
(
data
)
{
return
request
({
url
:
'
/yunshou/userAlgorithm/updateRunningState
'
,
method
:
'
post
'
,
data
:
data
})
}
// 删除算法列表
export
function
deleteAlg
(
ids
)
{
...
...
@@ -76,6 +112,14 @@ export function deleteAlg(ids) {
})
}
// 删除我的算法列表
export
function
deleteMyAlg
(
ids
)
{
return
request
({
url
:
`/yunshou/userAlgorithm/
${
ids
}
`
,
method
:
'
delete
'
})
}
// 启用禁用算法
export
function
updateAlgState
(
data
)
{
...
...
src/views/algorithmList/index.vue
View file @
4dcefc1b
...
...
@@ -27,7 +27,7 @@
default-active=
"2"
class=
"el-menu-vertical-demo"
>
<el-menu-item
:index=
"'我的算法'"
@
click=
"
handMenuClick
"
>
<el-menu-item
:index=
"'我的算法'"
@
click=
"
getMyList
"
>
<span><el-icon
style=
"color: #7F8184;"
><component
:is=
"'HomeFilled'"
/></el-icon>
我的算法
</span>
</el-menu-item>
<el-divider
style=
"margin: 5px 0;"
/>
...
...
@@ -71,7 +71,7 @@
type=
"primary"
plain
@
click=
"handState('1')"
>
已
禁
用
</el-button>
>
已
停
用
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
...
...
@@ -94,10 +94,11 @@
<div
class=
"cleartitle"
>
<span
class=
"ellipsis"
>
{{
item
.
algorithmName
}}
</span>
<el-tag
v-if=
"listState"
:type=
" item.algorithmStatus=='0'?'success':'danger'"
effect=
"dark"
>
{{
item
.
algorithmStatus
==
'
0
'
?
'
已启用
'
:
'
已
禁
用
'
}}
{{
item
.
algorithmStatus
==
'
0
'
?
'
已启用
'
:
'
已
停
用
'
}}
</el-tag>
</div>
</
template
>
...
...
@@ -116,9 +117,9 @@
{{
item
.
cardCopywriting
}}
</div>
<div
style=
"display: flex;justify-content: flex-end;position: absolute;right: 15px;bottom: 10px;"
>
<el-button
link
type=
"primary"
icon=
"Bottom"
@
click.stop=
"handleUpdate(item)"
>
下载
</el-button>
<el-button
link
type=
"primary"
icon=
"Edit"
@
click.stop=
"handleEnable(item)"
>
{{
item
.
algorithmStatus
==
'
0
'
?
'
禁
用
'
:
'
启用
'
}}
</el-button>
<el-button
link
type=
"primary"
icon=
"Delete"
@
click.stop=
"handleDelete(item)"
>
删除
</el-button>
<el-button
link
type=
"primary"
icon=
"Bottom"
@
click.stop=
"handleUpdate(item)"
v-if=
"!listState"
>
添加
</el-button>
<el-button
link
type=
"primary"
icon=
"Edit"
@
click.stop=
"handleEnable(item)"
v-if=
"listState"
>
{{
item
.
algorithmStatus
==
'
0
'
?
'
停
用
'
:
'
启用
'
}}
</el-button>
<el-button
link
type=
"primary"
icon=
"Delete"
@
click.stop=
"handleDelete(item)"
v-if=
"listState"
>
删除
</el-button>
<!--
<el-dropdown
trigger=
"click"
@
command.stop=
"handleSetSize"
>
<el-button
link
type=
"primary"
>
<el-icon
class=
"el-icon--right"
>
...
...
@@ -151,7 +152,7 @@
</template>
<
script
setup
name=
"Index"
>
import
{
listAlg
,
detailAlg
,
addAlg
,
update
Alg
,
deleteAlg
,
updateAlgState
}
from
"
@/api/algorithmList/index.js
"
;
import
{
listAlg
,
listMyAlg
,
detailAlg
,
addMyAlg
,
updateMyAlgState
,
deleteMy
Alg
,
deleteAlg
,
updateAlgState
}
from
"
@/api/algorithmList/index.js
"
;
import
algorithmDown
from
'
./components/algorithmDown.vue
'
// import algForm from './components/algorithmDown.vue'
const
{
proxy
}
=
getCurrentInstance
();
...
...
@@ -163,6 +164,7 @@
const
algorithmDownRef
=
ref
(
null
)
const
nowText
=
ref
(
'
算法管理
'
)
const
nowTopTitle
=
ref
(
'
算法管理
'
)
const
listState
=
ref
(
false
)
const
ids
=
ref
([]);
// const iconComponent = ref('');
// setTimeout(() => {
...
...
@@ -189,13 +191,20 @@
/** 查询算法列表 */
function
getList
()
{
// loading.value = true;
listAlg
(
queryParams
.
value
).
then
(
response
=>
{
// console.log("🚀 ~ listAlg ~ response:", response)
algList
.
value
=
response
.
rows
// loading.value = false;
listState
.
value
=
false
});
}
/** 查询我的算法列表 */
function
getMyList
()
{
nowTopTitle
.
value
=
'
我的算法
'
listMyAlg
(
queryParams
.
value
).
then
(
response
=>
{
algList
.
value
=
response
.
rows
listState
.
value
=
true
});
}
function
handeAdd
(
row
){
algorithmDownRef
.
value
.
handleAdd
()
}
...
...
@@ -207,8 +216,12 @@
queryParams
.
value
.
algorithmStatus
=
state
getList
()
}
function
handleUpdate
(
row
)
{
algorithmDownRef
.
value
.
handleUpdate
(
row
)
function
handleUpdate
(
row
)
{
addMyAlg
({
algorithmId
:
row
.
id
}).
then
((
res
)
=>
{
proxy
.
$modal
.
msgSuccess
(
"
添加成功
"
);
console
.
log
(
"
🚀 ~ addMyAlg ~ res:
"
,
res
)
})
// algorithmDownRef.value.handleUpdate(row)
}
function
handMenuClick
(
row
)
{
...
...
@@ -240,11 +253,11 @@
/** 删除按钮操作 */
function
handleDelete
(
row
)
{
const
id
=
row
.
i
d
||
ids
.
value
;
const
id
=
row
.
userAlgorithmI
d
||
ids
.
value
;
proxy
.
$modal
.
confirm
(
'
是否确认删除算法名称为"
'
+
row
.
algorithmName
+
'
"的数据项?
'
).
then
(
function
()
{
return
deleteAlg
(
id
);
return
delete
My
Alg
(
id
);
}).
then
(()
=>
{
getList
();
get
My
List
();
proxy
.
$modal
.
msgSuccess
(
"
删除成功
"
);
}).
catch
(()
=>
{});
}
...
...
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