提交 1a5a9f94 authored 作者: matian's avatar matian

fix:查看详情打开新窗口

上级 670ebe15
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
<el-button type="primary" icon="el-icon-plus" @click="handleCreatePaper">新建试卷</el-button> <el-button type="primary" icon="el-icon-plus" @click="handleCreatePaper">新建试卷</el-button>
</template> </template>
<template v-slot:table-x="{ row }"> <template v-slot:table-x="{ row }">
<el-button type="text" @click="handleDetail(row)">查看详情</el-button> <router-link :to="{ path: 'examDetail', query: { exam_id: row.exam_id } }" target="_blank">
<el-button type="text">查看详情</el-button>
</router-link>
<el-button type="text" @click="handleDelete(row)">删除</el-button> <el-button type="text" @click="handleDelete(row)">删除</el-button>
</template> </template>
</app-list> </app-list>
...@@ -100,15 +102,6 @@ export default { ...@@ -100,15 +102,6 @@ export default {
}) })
}, },
// 查看详情
handleDetail(row) {
this.$router.push({
path: 'examDetail',
query: {
exam_id: row.exam_id
}
})
},
// 单个删除 // 单个删除
handleDelete(row) { handleDelete(row) {
this.$confirm('确认删除改考试吗?删除后不可恢复').then(_ => { this.$confirm('确认删除改考试吗?删除后不可恢复').then(_ => {
......
...@@ -12,7 +12,9 @@ ...@@ -12,7 +12,9 @@
</template> </template>
<template v-slot:table-x="{ row }"> <template v-slot:table-x="{ row }">
<el-button type="text" @click="handleUpdate(row)">编辑</el-button> <el-button type="text" @click="handleUpdate(row)">编辑</el-button>
<el-button type="text" @click="handleView(row)">查看详情</el-button> <router-link :to="{ name: 'viewPaper', params: { id: row.id } }" target="_blank">
<el-button type="text">查看详情</el-button>
</router-link>
<el-button type="text" @click="handleDelete(row)">删除</el-button> <el-button type="text" @click="handleDelete(row)">删除</el-button>
</template> </template>
</app-list> </app-list>
...@@ -126,10 +128,6 @@ export default { ...@@ -126,10 +128,6 @@ export default {
handleUpdate(row) { handleUpdate(row) {
this.$router.push({ name: 'editPaper', params: { id: row.id } }) this.$router.push({ name: 'editPaper', params: { id: row.id } })
}, },
// 查看详情
handleView(row) {
this.$router.push({ name: 'viewPaper', params: { id: row.id } })
},
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val this.multipleSelection = val
}, },
......
...@@ -24,8 +24,12 @@ ...@@ -24,8 +24,12 @@
> >
</div> </div>
<template v-slot:table-x="{ row }"> <template v-slot:table-x="{ row }">
<el-button type="text" @click="handleSettings(row)">编辑</el-button> <router-link :to="{ path: '/question/editQuestion', query: { id: row.id, type: 'edit' } }" target="_blank">
<el-button type="text" @click="handleView(row)">查看详情</el-button> <el-button type="text">编辑</el-button>
</router-link>
<router-link :to="{ path: '/question/questionDetail', query: { id: row.id, type: 'view' } }" target="_blank">
<el-button type="text">查看详情</el-button>
</router-link>
<el-button type="text" @click="handleDelete(row.id)">删除</el-button> <el-button type="text" @click="handleDelete(row.id)">删除</el-button>
</template> </template>
</app-list> </app-list>
...@@ -183,14 +187,6 @@ export default { ...@@ -183,14 +187,6 @@ export default {
handleCreateSuccess() { handleCreateSuccess() {
this.$refs.list.refetch() this.$refs.list.refetch()
}, },
// 查看
handleView(row) {
this.$router.push({ path: '/question/questionDetail', query: { id: row.id, type: 'view' } })
},
// 编辑
handleSettings(row) {
this.$router.push({ path: '/question/editQuestion', query: { id: row.id, type: 'edit' } })
},
radioChange() { radioChange() {
this.$refs.list.refetch() this.$refs.list.refetch()
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论