Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DA-Platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
文档服务地址:
http://47.92.0.57:3000/
周报索引地址:
http://47.92.0.57:3000/s/NruNXRYmV
Open sidebar
Berlin
DA-Platform
Commits
64186f40
Commit
64186f40
authored
Jul 05, 2020
by
李景熙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
在选择了标注的分片后变更任务状态
parent
b215b07a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
1 deletion
+25
-1
Slice.py
DAPlatform/Dao/Slice.py
+10
-0
Task.py
DAPlatform/Dao/Task.py
+12
-0
slice.py
DAPlatform/views/slice.py
+3
-1
No files found.
DAPlatform/Dao/Slice.py
View file @
64186f40
...
...
@@ -158,5 +158,15 @@ def find_slice_annotation_by_task(task_id, type):
return
list
# 通过sliceid查找taskid
def
find_task_by_slice
(
slice_id
):
try
:
s
=
Slice
.
get
(
Slice
.
slice_id
==
slice_id
)
except
:
return
None
else
:
return
s
.
task_id
if
__name__
==
'__main__'
:
Slice
.
create_table
()
DAPlatform/Dao/Task.py
View file @
64186f40
...
...
@@ -153,6 +153,18 @@ def find_task_name(task_id):
return
t
.
task_name
# 修改任务状态
def
set_state
(
task_id
,
state
):
try
:
t
=
Task
.
get
(
Task
.
task_id
==
task_id
)
except
:
return
False
else
:
t
.
state
=
state
t
.
save
()
return
True
if
__name__
==
'__main__'
:
# delete_task(10)
Task
.
drop_table
()
...
...
DAPlatform/views/slice.py
View file @
64186f40
import
json
from
flask
import
Blueprint
from
flask
import
request
from
Dao
import
Data
,
Slice
,
Relation
from
Dao
import
Data
,
Slice
,
Relation
,
Task
slice
=
Blueprint
(
"slice"
,
__name__
,
url_prefix
=
"/api/slice"
)
...
...
@@ -26,6 +26,8 @@ def select_pieces():
data
=
request
.
get_json
(
silent
=
True
)
userId
=
int
(
data
[
'userId'
])
selected
=
list
(
data
[
'selected'
])
task_id
=
Slice
.
find_task_by_slice
(
selected
[
0
])
Task
.
set_state
(
task_id
,
1
)
for
sliceItem
in
selected
:
ret
=
Data
.
find_data_by_slice
(
sliceItem
)
if
ret
.
code
==
0
:
...
...
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