文档服务地址: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 @@ ...@@ -7,7 +7,7 @@
<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'>
<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> </template>
</pieces-table> </pieces-table>
</div> </div>
...@@ -31,14 +31,22 @@ export default { ...@@ -31,14 +31,22 @@ export default {
this.task = JSON.parse(decodeURIComponent(this.$route.params.task)) this.task = JSON.parse(decodeURIComponent(this.$route.params.task))
}, },
methods: { methods: {
doOption () { doOption (file, type) {
console.log(this.isCheck) var params = {file: encodeURIComponent(JSON.stringify(file))}
this.$router.push({ var self = this
path: '/selected', function goto (path) {
query: { self.$router.push({ name: path, params })
isCheck: this.isCheck }
} switch (type) {
}) case '文本':
goto('SelectedText')
break
case '图片':
goto('image')
break
case '图层':
goto('layer')
}
} }
} }
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<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'>
<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> </template>
</pieces-table> </pieces-table>
</div> </div>
...@@ -32,14 +32,22 @@ export default { ...@@ -32,14 +32,22 @@ export default {
this.task = JSON.parse(decodeURIComponent(this.$route.params.task)) this.task = JSON.parse(decodeURIComponent(this.$route.params.task))
}, },
methods: { methods: {
doOption (file) { doOption (file, type) {
console.log(file) var params = {file: encodeURIComponent(JSON.stringify(file))}
this.$router.push({ var self = this
path: '/selected', function goto (path) {
query: { self.$router.push({ name: path, params })
isCheck: this.isCheck }
} switch (type) {
}) case '文本':
goto('SelectedText')
break
case '图片':
goto('image')
break
case '图层':
goto('layer')
}
} }
} }
} }
......
...@@ -32,11 +32,20 @@ export default { ...@@ -32,11 +32,20 @@ export default {
}, },
methods: { methods: {
doOption (file, type) { doOption (file, type) {
console.log(file, type) var params = {file: encodeURIComponent(JSON.stringify(file))}
if (type === '文本') { var self = this
this.$router.push('/select') function goto (path) {
} else { self.$router.push({ name: path, params })
this.$router.push('/image') }
switch (type) {
case '文本':
goto('SelectText')
break
case '图片':
goto('image')
break
case '图层':
goto('layer')
} }
} }
} }
......
...@@ -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}}KB <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>
</div> </div>
</template> </template>
......
...@@ -84,12 +84,12 @@ export default new Router({ ...@@ -84,12 +84,12 @@ export default new Router({
component: checkdetail component: checkdetail
}, },
{ {
path: '/select', path: '/select/:file',
name: 'SelectText', name: 'SelectText',
component: SelectText component: SelectText
}, },
{ {
path: '/selected', path: '/selected/:file',
name: 'SelectedText', name: 'SelectedText',
component: SelectedText component: SelectedText
}, },
...@@ -99,12 +99,12 @@ export default new Router({ ...@@ -99,12 +99,12 @@ export default new Router({
component: Table component: Table
}, },
{ {
path: '/image', path: '/image/:file',
name: 'image', name: 'image',
component: imageAnnotiation component: imageAnnotiation
}, },
{ {
path: '/layer', path: '/layer/:file',
name: 'layer', name: 'layer',
component: layerAnnotation component: layerAnnotation
} }
......
...@@ -8,7 +8,7 @@ Vue.use(Vuex) ...@@ -8,7 +8,7 @@ Vue.use(Vuex)
export default new Vuex.Store({ export default new Vuex.Store({
state: { state: {
userInfo: null, userInfo: null,
imageData: null, imageData: null
}, },
mutations: { mutations: {
setUserInfo (state, userInfo) { 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