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

Commit 2b726157 by Wang Yuhang

路由传参

parent b912a45b
......@@ -67,16 +67,23 @@ export default {
})
},
goto (executor) {
var {file, type} = this, self = this
var params = { file, executor }
var self = this, {file, type} = this
var params = {
file,
task: self.task,
relationId: executor.relation_id,
executor
}
function goto (path) {
self.$router.push({ name: path, params })
}
switch (type) {
case '文本': goto('SelectedText'); break
case '文本':
if (file.url.endsWith('xlsx')) { goto('table') }
if (file.url.endsWith('txt')) { goto('SelectTexted') }
break
case '图片': goto('image'); break
case '图层': goto('layer'); break
case '表格': goto('table')
case '图层': goto('layer')
}
}
}
......
......@@ -35,37 +35,21 @@ export default {
},
methods: {
doOption (file, type) {
var params = { file, task: this.task }, self = this
var self = this, params = {
file,
task: this.task,
relationId: file.relation_id
}
function goto (path) {
self.$router.push({ name: path, params })
}
switch (type) {
case '文本':
if (
file.url
.split('')
.reverse()
.join('')
.substring(0, 4)
.split('')
.reverse()
.join('') == 'xlsx'
) { goto('table') } else if (
file.url
.split('')
.reverse()
.join('')
.substring(0, 3)
.split('')
.reverse()
.join('') == 'txt'
) { goto('SelectText') }
break
case '图片':
goto('image')
if (file.url.endsWith('xlsx')) { goto('table') }
if (file.url.endsWith('txt')) { goto('SelectText') }
break
case '图层':
goto('layer')
case '图片': goto('image'); break
case '图层': goto('layer')
}
}
}
......
......@@ -84,27 +84,27 @@ export default new Router({
component: checkdetail
},
{
path: '/select/:file/:task',
path: '/select/:file/:task/:relationId/:executor',
name: 'SelectText',
component: SelectText
},
{
path: '/selected/:file/:task',
path: '/selected/:file/:task/:relationId/:executor',
name: 'SelectedText',
component: SelectedText
},
{
path: '/table/:file/:task',
path: '/table/:file/:task/:relationId/:executor',
name: 'table',
component: Table
},
{
path: '/image/:file/:task',
path: '/image/:file/:task/:relationId/:executor',
name: 'image',
component: imageAnnotiation
},
{
path: '/layer/:file/:task',
path: '/layer/:file/:task/:relationId/:executor',
name: 'layer',
component: layerAnnotation
}
......
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