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

Commit c3e0a951 by Wang Yuhang

跳转到标注页面时传递文件信息

parent 291aedae
......@@ -7,7 +7,7 @@
<el-divider></el-divider>
<pieces-table :task-id="task.id" showProgress>
<template v-slot:option='slotProps'>
<el-button type="primary" size="mini" plain @click='doOption(slotProps.file)'>审核</el-button>
<el-button type="primary" size="mini" plain @click='doOption(slotProps.file,slotProps.type)'>审核</el-button>
</template>
</pieces-table>
</div>
......@@ -31,14 +31,22 @@ export default {
this.task = JSON.parse(decodeURIComponent(this.$route.params.task))
},
methods: {
doOption () {
console.log(this.isCheck)
this.$router.push({
path: '/selected',
query: {
isCheck: this.isCheck
}
})
doOption (file, type) {
var params = {file: encodeURIComponent(JSON.stringify(file))}
var self = this
function goto (path) {
self.$router.push({ name: path, params })
}
switch (type) {
case '文本':
goto('SelectedText')
break
case '图片':
goto('image')
break
case '图层':
goto('layer')
}
}
}
}
......
......@@ -7,7 +7,7 @@
<el-divider></el-divider>
<pieces-table :task-id="task.id">
<template v-slot:option='slotProps'>
<el-button type="primary" size="mini" plain @click='doOption(slotProps.file)'>详情</el-button>
<el-button type="primary" size="mini" plain @click='doOption(slotProps.file,slotProps.type)'>详情</el-button>
</template>
</pieces-table>
</div>
......@@ -32,14 +32,22 @@ export default {
this.task = JSON.parse(decodeURIComponent(this.$route.params.task))
},
methods: {
doOption (file) {
console.log(file)
this.$router.push({
path: '/selected',
query: {
isCheck: this.isCheck
}
})
doOption (file, type) {
var params = {file: encodeURIComponent(JSON.stringify(file))}
var self = this
function goto (path) {
self.$router.push({ name: path, params })
}
switch (type) {
case '文本':
goto('SelectedText')
break
case '图片':
goto('image')
break
case '图层':
goto('layer')
}
}
}
}
......
......@@ -32,11 +32,20 @@ export default {
},
methods: {
doOption (file, type) {
console.log(file, type)
if (type === '文本') {
this.$router.push('/select')
} else {
this.$router.push('/image')
var params = {file: encodeURIComponent(JSON.stringify(file))}
var self = this
function goto (path) {
self.$router.push({ name: path, params })
}
switch (type) {
case '文本':
goto('SelectText')
break
case '图片':
goto('image')
break
case '图层':
goto('layer')
}
}
}
......
......@@ -24,7 +24,7 @@
<div class="file" v-for="item in map[props.row.id]" :key="item.id">
<i class="el-icon-document"></i>
<span class="file-name">{{item.name}}</span>{{item.size}}KB
<slot name='option' :file='item.id' :type='props.row.type'></slot>
<slot name='option' :file='item' :type='props.row.type'></slot>
</div>
</div>
</template>
......
......@@ -84,12 +84,12 @@ export default new Router({
component: checkdetail
},
{
path: '/select',
path: '/select/:file',
name: 'SelectText',
component: SelectText
},
{
path: '/selected',
path: '/selected/:file',
name: 'SelectedText',
component: SelectedText
},
......@@ -99,12 +99,12 @@ export default new Router({
component: Table
},
{
path: '/image',
path: '/image/:file',
name: 'image',
component: imageAnnotiation
},
{
path: '/layer',
path: '/layer/:file',
name: 'layer',
component: layerAnnotation
}
......
......@@ -8,7 +8,7 @@ Vue.use(Vuex)
export default new Vuex.Store({
state: {
userInfo: null,
imageData: null,
imageData: null
},
mutations: {
setUserInfo (state, userInfo) {
......
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