TestPaperList.vue
4.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<template>
<div class="app-container">
<el-table :data="testpaperlist" id="QuestionTable" border
style="width: 100%;border-radius: 5px;box-shadow: 0 0 10px #efefef;margin-top: 10px;"
:header-cell-class-name="headerStyle" :stripe=true>
<el-table-column prop="date" label="ID" width="50">
<template slot-scope="scope">
<span>{{ scope.row.id }}</span>
</template>
</el-table-column>
<el-table-column prop="date" label="试卷标题" width="250">
<template slot-scope="scope">
<span>{{ scope.row.TestPaperTitle }}</span>
</template>
</el-table-column>
<el-table-column prop="date" label="试卷总分" width="80">
<template slot-scope="scope">
<span>{{ scope.row.TotalScore }}</span>
</template>
</el-table-column>
<el-table-column prop="date" label="单选题数量" width="100">
<template slot-scope="scope">
<span>{{ scope.row.SingleNumber }}</span>
</template>
</el-table-column>
<el-table-column prop="date" label="多选题数量" width="100">
<template slot-scope="scope">
<span>{{ scope.row.MultipleNumber }}</span>
</template>
</el-table-column>
<el-table-column prop="date" label="主观题数量" width="100">
<template slot-scope="scope">
<span>{{ scope.row.SubjectiveNumber }}</span>
</template>
</el-table-column>
<el-table-column prop="TestPaperClassId" label="分类" width="100">
<template slot-scope="scope">
<span>{{ scope.row.TestPaperClassId }}</span>
</template>
</el-table-column>
<el-table-column prop="name" label="原价" width="80">
<template slot-scope="scope">
<span>{{ scope.row.OriginalPrice/100 }}</span>
</template>
</el-table-column>
<el-table-column prop="name" label="现价" width="80">
<template slot-scope="scope">
<span>{{ scope.row.PresentPrice/100 }}</span>
</template>
</el-table-column>
<el-table-column prop="name" label="会员价" width="80">
<template slot-scope="scope">
<span>{{ scope.row.MembershipPrice/100 }}</span>
</template>
</el-table-column>
<el-table-column prop="name" label="试卷说明" :show-overflow-tooltip=true>
<template slot-scope="scope">
<span>{{ scope.row.Describe }}</span>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="150">
<template slot-scope="scope">
<el-dropdown @command="(e)=>{handleCommand(e,scope.row.id)}">
<span class="el-dropdown-link">
操作<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item command="update">编辑</el-dropdown-item>
<!-- <el-dropdown-item command="b">锁定</el-dropdown-item> -->
<el-dropdown-item command="del">删除</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<el-pagination background @current-change="currentchange"
style="position:static;bottom: 3px;text-align: center;margin-top: 5px;" :page-size="this.parameter.pageSize"
layout="total,prev, pager, next" :total="Count">
</el-pagination>
</div>
</template>
<script>
import {
getTestPaperList
} from '@/api/TestPaper'
export default {
data() {
return {
parameter: {
pageIndex: 1,
pageSize: 12,
sort: "id",
sortOrder: 1,
keyword: "",
QuestionClassId: 0,
status: 1
},
Count: 0,
testpaperlist: [],
}
},
computed: {
},
created() {
},
mounted() {
let ContentAreaHight = window.innerHeight - document.getElementById("QuestionTable").offsetTop;
let lineNumber = ContentAreaHight - 50 - 40;
this.parameter.pageSize = Math.floor(lineNumber / 49)
this.getTestPaperListHeadler();
},
methods: {
getTestPaperListHeadler() {
getTestPaperList(this.parameter).then(res => {
this.testpaperlist = res.data.data;
this.Count = res.data.totalCount;
});
},
currentchange(page) {
this.parameter.pageIndex = page;
this.getTestPaperListHeadler();
},
}
}
</script>
<style>
</style>