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

Commit 75e089fc by Wang Yuhang

跳转传递分片信息

parent f49b7072
...@@ -40,8 +40,7 @@ export default { ...@@ -40,8 +40,7 @@ export default {
dialogVisible: false, dialogVisible: false,
executors: [], executors: [],
file: undefined, file: undefined,
type: undefined, piece: undefined,
pieceId: undefined,
loading: false loading: false
} }
}, },
...@@ -49,15 +48,15 @@ export default { ...@@ -49,15 +48,15 @@ export default {
this.task = JSON.parse(decodeURIComponent(this.$route.params.task)) this.task = JSON.parse(decodeURIComponent(this.$route.params.task))
}, },
methods: { methods: {
doOption (file, type, pieceId) { doOption (file, piece) {
// 打开模态框 // 打开模态框
this.file = file; this.type = type; this.pieceId = pieceId this.file = file; this.piece = piece
this.dialogVisible = true this.dialogVisible = true
}, },
getExecutors () { getExecutors () {
this.loading = true this.loading = true
var self = this, params = { var self = this, params = {
pieceId: this.pieceId, pieceId: this.piece.pieceId,
fileId: this.file.id fileId: this.file.id
} }
this.axios.get('/file/getExecutors', { this.axios.get('/file/getExecutors', {
...@@ -67,17 +66,18 @@ export default { ...@@ -67,17 +66,18 @@ export default {
}) })
}, },
goto (executor) { goto (executor) {
var self = this, {file, type} = this var self = this, {file, piece} = this
var params = { var params = {
file, file,
task: self.task, task: self.task,
relationId: executor.relation_id, relationId: executor.relation_id,
executor executor,
piece
} }
function goto (path) { function goto (path) {
self.$router.push({ name: path, params }) self.$router.push({ name: path, params })
} }
switch (type) { switch (piece.type) {
case '文本': case '文本':
if (file.url.endsWith('xlsx')) { goto('tabledCheck') } if (file.url.endsWith('xlsx')) { goto('tabledCheck') }
if (file.url.endsWith('txt')) { goto('SelectedCheck') } if (file.url.endsWith('txt')) { goto('SelectedCheck') }
......
...@@ -37,16 +37,17 @@ export default { ...@@ -37,16 +37,17 @@ export default {
this.task = JSON.parse(decodeURIComponent(this.$route.params.task)) this.task = JSON.parse(decodeURIComponent(this.$route.params.task))
}, },
methods: { methods: {
doOption (file, type) { doOption (file, piece) {
var self = this, params = { var self = this, params = {
file, file,
task: this.task, task: this.task,
relationId: file.relation_id relationId: file.relation_id,
piece
} }
function goto (path) { function goto (path) {
self.$router.push({ name: path, params }) self.$router.push({ name: path, params })
} }
switch (type) { switch (piece.type) {
case '文本': case '文本':
if (file.url.endsWith('xlsx')) { goto('tabled') } if (file.url.endsWith('xlsx')) { goto('tabled') }
if (file.url.endsWith('txt')) { goto('SelectedText') } if (file.url.endsWith('txt')) { goto('SelectedText') }
......
...@@ -8,10 +8,10 @@ ...@@ -8,10 +8,10 @@
<pieces-table :task-id="task.id" showProgress> <pieces-table :task-id="task.id" showProgress>
<template v-slot:option="slotProps"> <template v-slot:option="slotProps">
<el-button v-if="!slotProps.file.state" type="primary" size="mini" plain <el-button v-if="!slotProps.file.state" type="primary" size="mini" plain
@click="doOption(slotProps.file,slotProps.type)" @click="doOption(slotProps.file,slotProps.piece)"
>标注</el-button> >标注</el-button>
<el-button v-else type="success" size="mini" plain <el-button v-else type="success" size="mini" plain
@click="doOption(slotProps.file,slotProps.type)" @click="doOption(slotProps.file,slotProps.piece)"
>修改</el-button> >修改</el-button>
</template> </template>
</pieces-table> </pieces-table>
...@@ -36,16 +36,17 @@ export default { ...@@ -36,16 +36,17 @@ export default {
this.task = JSON.parse(decodeURIComponent(this.$route.params.task)) this.task = JSON.parse(decodeURIComponent(this.$route.params.task))
}, },
methods: { methods: {
doOption (file, type) { doOption (file, piece) {
var self = this, params = { var self = this, params = {
file, file,
task: this.task, task: this.task,
relationId: file.relation_id relationId: file.relation_id,
piece
} }
function goto (path) { function goto (path) {
self.$router.push({ name: path, params }) self.$router.push({ name: path, params })
} }
switch (type) { switch (piece.type) {
case '文本': case '文本':
if (file.url.endsWith('xlsx')) { goto('table') } if (file.url.endsWith('xlsx')) { goto('table') }
if (file.url.endsWith('txt')) { goto('SelectText') } if (file.url.endsWith('txt')) { goto('SelectText') }
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<div class="file" v-for="item in map[props.row.id]" :key="item.id"> <div class="file" v-for="item in map[props.row.id]" :key="item.id">
<i class="el-icon-document"></i> <i class="el-icon-document"></i>
<span class="file-name">{{item.name}}</span>{{item.size}} <span class="file-name">{{item.name}}</span>{{item.size}}
<slot name='option' :file='item' :type='props.row.type' :pieceId='props.row.id'></slot> <slot name='option' :file='item' :piece='props.row'></slot>
</div> </div>
</div> </div>
</template> </template>
......
...@@ -89,52 +89,52 @@ export default new Router({ ...@@ -89,52 +89,52 @@ export default new Router({
component: checkdetail component: checkdetail
}, },
{ {
path: '/select/:file/:task/:relationId/:executor', path: '/select/:file/:task/:relationId/:piece',
name: 'SelectText', name: 'SelectText',
component: SelectText component: SelectText
}, },
{ {
path: '/selected/:file/:task/:relationId/:executor', path: '/selected/:file/:task/:relationId/:executor/:piece',
name: 'SelectedText', name: 'SelectedText',
component: SelectedText component: SelectedText
}, },
{ {
path: '/selectedCheck/:file/:task/:relationId/:executor', path: '/selectedCheck/:file/:task/:relationId/:executor/:piece',
name: 'SelectedCheck', name: 'SelectedCheck',
component: SelectedCheck component: SelectedCheck
}, },
{ {
path: '/table/:file/:task/:relationId/:executor', path: '/table/:file/:task/:relationId/:piece',
name: 'table', name: 'table',
component: Table component: Table
}, },
{ {
path: '/tabled/:file/:task/:relationId/:executor', path: '/tabled/:file/:task/:relationId/:executor/:piece',
name: 'tabled', name: 'tabled',
component: Tabled component: Tabled
}, },
{ {
path: '/tabledCheck/:file/:task/:relationId/:executor', path: '/tabledCheck/:file/:task/:relationId/:executor/:piece',
name: 'tabledCheck', name: 'tabledCheck',
component: TabledCheck component: TabledCheck
}, },
{ {
path: '/image/:file/:task/:relationId/:executor', path: '/image/:file/:task/:relationId/:piece',
name: 'image', name: 'image',
component: imageAnnotiation component: imageAnnotiation
}, },
{ {
path: '/layer/:file/:task/:relationId/:executor', path: '/layer/:file/:task/:relationId/:piece',
name: 'layer', name: 'layer',
component: layerAnnotation component: layerAnnotation
}, },
{ {
path: '/imageshow', path: '/imageshow/:file/:task/:relationId/:executor/:piece',
name: 'images', name: 'images',
component: imageShow component: imageShow
}, },
{ {
path: '/layershow', path: '/layershow/:file/:task/:relationId/:executor/:piece',
name: 'layers', name: 'layers',
component: layerShow component: layerShow
} }
......
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