文档服务地址:http://47.92.0.57:3000/ 周报索引地址:http://47.92.0.57:3000/s/NruNXRYmV

Commit 55743292 by Wang Yuhang

对接获取分片接口

parent 7c88f243
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="task-panel"> <div class="task-panel">
<h2>{{task.name}}</h2> <h2>{{task.name}}</h2>
<p>发布者:{{task.creator}}</p> <p>发布者:{{task.creator}}</p>
<p>发布时间:{{task.date}}</p> <p>发布时间:{{task.date|formatDate}}</p>
<el-divider></el-divider> <el-divider></el-divider>
<pieces-table :task-id="task.id" showProgress> <pieces-table :task-id="task.id" showProgress>
<template v-slot:option='slotProps'> <template v-slot:option='slotProps'>
...@@ -32,13 +32,13 @@ export default { ...@@ -32,13 +32,13 @@ export default {
}, },
methods: { methods: {
doOption () { doOption () {
console.log(this.isCheck), console.log(this.isCheck)
this.$router.push({ this.$router.push({
path:'/selected', path: '/selected',
query:{ query: {
isCheck : this.isCheck, isCheck: this.isCheck
} }
}) })
} }
} }
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="task-panel"> <div class="task-panel">
<h2>{{task.name}}</h2> <h2>{{task.name}}</h2>
<p>发布者:{{task.creator}}</p> <p>发布者:{{task.creator}}</p>
<p>发布时间:{{task.date}}</p> <p>发布时间:{{task.date|formatDate}}</p>
<el-divider></el-divider> <el-divider></el-divider>
<pieces-table :task-id="task.id"> <pieces-table :task-id="task.id">
<template v-slot:option='slotProps'> <template v-slot:option='slotProps'>
...@@ -25,7 +25,7 @@ export default { ...@@ -25,7 +25,7 @@ export default {
data () { data () {
return { return {
task: null, task: null,
isCheck:'0' isCheck: '0'
} }
}, },
beforeMount () { beforeMount () {
...@@ -34,12 +34,12 @@ export default { ...@@ -34,12 +34,12 @@ export default {
methods: { methods: {
doOption (file) { doOption (file) {
console.log(file) console.log(file)
this.$router.push({ this.$router.push({
path:'/selected', path: '/selected',
query:{ query: {
isCheck : this.isCheck isCheck: this.isCheck
} }
}) })
} }
} }
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="task-panel"> <div class="task-panel">
<h2>{{task.name}}</h2> <h2>{{task.name}}</h2>
<p>发布者:{{task.creator}}</p> <p>发布者:{{task.creator}}</p>
<p>发布时间:{{task.date}}</p> <p>发布时间:{{task.date|formatDate}}</p>
<el-divider></el-divider> <el-divider></el-divider>
<pieces-table :task-id="task.id" showProgress> <pieces-table :task-id="task.id" showProgress>
<template v-slot:option='slotProps'> <template v-slot:option='slotProps'>
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<el-table-column prop="id" label="分片id" width="120"></el-table-column> <el-table-column prop="id" label="分片id" width="120"></el-table-column>
<el-table-column prop="type" label="文件类别" width="120"></el-table-column> <el-table-column prop="type" label="文件类别" width="120"></el-table-column>
<el-table-column prop="fileNum" label="文件数量" width="120"></el-table-column> <el-table-column prop="fileNum" label="文件数量" width="120"></el-table-column>
<el-table-column prop="template" label="模板" :width="showProgress ? 240 : ''"></el-table-column> <el-table-column prop="template" label="模板/说明" :width="showProgress ? 240 : ''"></el-table-column>
<el-table-column v-if="showProgress" label="进度"> <el-table-column v-if="showProgress" label="进度">
<template> <template>
<el-progress :percentage="50" style="width:150px" :format="format"></el-progress> <el-progress :percentage="50" style="width:150px" :format="format"></el-progress>
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
</template> </template>
<script> <script>
import '@/mock/api.js'
export default { export default {
name: 'pieces-table', name: 'pieces-table',
props: { props: {
...@@ -54,10 +55,10 @@ export default { ...@@ -54,10 +55,10 @@ export default {
}, },
beforeMount () { beforeMount () {
// 根据任务id,拉取分片信息 // 根据任务id,拉取分片信息
var id = this.taskId var taskId = this.taskId
var self = this var self = this
this.axios.get('/getPieces', { this.axios.get('/slice/getPieces', {
params: { id } params: { taskId }
}).then(res => { }).then(res => {
self.tableData = res.data self.tableData = res.data
// 拉取每个分片下的文件 // 拉取每个分片下的文件
......
<<<<<<< HEAD
import Mock from 'mockjs' import Mock from 'mockjs'
Mock.mock('http://localhost:9100/api/getTasks', { // Mock.mock('http://localhost:9100/api/getTasks', {
'status': 0, // 'status': 0,
'data|10': [{ // 'data|10': [{
'id|1-9999': 1, // 'id|1-9999': 1,
'name|1': ['冰箱物品标注', '新通路图片', '人脸识别', '客服语音', '行人十字画框', '动物打点标注'], // 'name|1': ['冰箱物品标注', '新通路图片', '人脸识别', '客服语音', '行人十字画框', '动物打点标注'],
'creator|1': ['王强', '赵信良', '李轩辕', '田予欢', '张三', '李斯'], // 'creator|1': ['王强', '赵信良', '李轩辕', '田予欢', '张三', '李斯'],
'date': Mock.Random.date('yyyy/MM/dd') // 'date': Mock.Random.date('yyyy/MM/dd')
}] // }]
}) // })
Mock.mock('http://localhost:9100/api/image', { Mock.mock('http://localhost:9100/api/image', {
code: 1, code: 1,
...@@ -59,15 +58,15 @@ Mock.mock('http://localhost:9100/api/image', { ...@@ -59,15 +58,15 @@ Mock.mock('http://localhost:9100/api/image', {
}] }]
}) })
Mock.mock(/\/api\/getPieces\?id=[0-9]+/, { // Mock.mock(/http:\/\/localhost:9100\/api\/getPieces\?id=[0-9]+/, {
'status': 0, // 'status': 0,
'data|5-10': [{ // 'data|5-10': [{
'id|1-65535': 1, // 'id|1-65535': 1,
'fileNum|10-50': 1, // 'fileNum|10-50': 1,
'template|1': ['人脸识别标注模板', '动物标注模板', '本文标注模板', '桥梁标注模板', '植物标注模板'], // 'template|1': ['人脸识别标注模板', '动物标注模板', '本文标注模板', '桥梁标注模板', '植物标注模板'],
'type|1': ['文本', '图片', '图层'] // 'type|1': ['文本', '图片', '图层']
}] // }]
}) // })
Mock.mock(/\/api\/file\/getFiles\?pieceId=[0-9]+/, { Mock.mock(/\/api\/file\/getFiles\?pieceId=[0-9]+/, {
'status': 0, 'status': 0,
...@@ -78,36 +77,3 @@ Mock.mock(/\/api\/file\/getFiles\?pieceId=[0-9]+/, { ...@@ -78,36 +77,3 @@ Mock.mock(/\/api\/file\/getFiles\?pieceId=[0-9]+/, {
'state|0-1': 1 'state|0-1': 1
}] }]
}) })
=======
import Mock from 'mockjs'
// Mock.mock('http://localhost:9100/api/task/getTasks', {
// 'status': 0,
// 'data|10': [{
// 'id|1-9999': 1,
// 'name|1': ['冰箱物品标注', '新通路图片', '人脸识别', '客服语音', '行人十字画框', '动物打点标注'],
// 'creator|1': ['王强', '赵信良', '李轩辕', '田予欢', '张三', '李斯'],
// 'date': Mock.Random.date('yyyy/MM/dd')
// }]
// })
Mock.mock(/\/api\/getPieces\?id=[0-9]+/, {
'status': 0,
'data|5-10': [{
'id|1-65535': 1,
'fileNum|10-50': 1,
'template|1': ['人脸识别标注模板', '动物标注模板', '本文标注模板', '桥梁标注模板', '植物标注模板'],
'type|1': ['文本', '图片', '图层']
}]
})
Mock.mock(/\/api\/file\/getFiles\?pieceId=[0-9]+/, {
'status': 0,
'data|1-5': [{
'id|1-65535': 1,
'name': '标注文件.xxx',
'size|10-30': 1,
'state|0-1': 1
}]
})
>>>>>>> 60b27bd547f3588270c6c1978b5d5d6f37ad8567
...@@ -89,10 +89,10 @@ def find_slice_by_task(task_id): ...@@ -89,10 +89,10 @@ def find_slice_by_task(task_id):
index = 0 index = 0
list = [] list = []
while index < len(find): while index < len(find):
if find[index].type == 0: if find[index].type == '0':
t = "文本" t = "文本"
elif find[index].type == 1: elif find[index].type == '1':
t = "图" t = "图"
else: else:
t = "图层" t = "图层"
list.append( list.append(
...@@ -111,5 +111,7 @@ def find_slice_by_task(task_id): ...@@ -111,5 +111,7 @@ def find_slice_by_task(task_id):
if __name__ == '__main__': if __name__ == '__main__':
create_pic_slice(6, "标注坐标(30,100)") create_text_slice(1,1)
create_layer_slice(7, "。。。。。。") create_pic_slice(1, "标注坐标(30,100)")
create_layer_slice(1, "。。。。。。")
# Slice.create_table()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment