123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- <template>
- <div class="home">
- <div class="part-box part-box-pad part-box-flex">
- <div></div>
- <div>
- <el-button type="primary" icon="el-icon-refresh" @click="toAdd"
- >新增标准题卡</el-button
- >
- <el-button type="success" icon="el-icon-refresh" @click="toFreeAdd"
- >新增自由题卡</el-button
- >
- </div>
- </div>
- <div class="part-box part-box-pad">
- <el-table ref="TableList" :data="cards">
- <el-table-column type="index" label="序号" width="70"></el-table-column>
- <el-table-column prop="name" label="名称"></el-table-column>
- <el-table-column class-name="action-column" label="操作" width="200px">
- <template slot-scope="scope">
- <el-button
- class="btn-primary"
- type="text"
- @click="toEdit(scope.row)"
- >编辑</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- <div class="part-page">
- <el-pagination
- background
- layout="total,prev, pager, next"
- :current-page="current"
- :total="total"
- :page-size="size"
- @current-change="toPage"
- >
- </el-pagination>
- </div>
- </div>
- </div>
- </template>
- <script>
- export default {
- name: "home",
- data() {
- return {
- current: 1,
- size: 10,
- total: 10,
- cards: []
- };
- },
- mounted() {
- this.getList();
- },
- methods: {
- getList() {
- this.cards = [
- {
- id: "1111",
- name: "题卡001"
- },
- {
- id: "2222",
- name: "题卡002"
- }
- ];
- this.total = this.cards.length;
- },
- toPage(page) {
- this.current = page;
- this.getList();
- },
- toEdit(row) {
- this.$ls.set("prepareTcPCard", {
- examTaskId: "1111",
- courseCode: "数学",
- courseName: "sx001",
- makeMethod: "SELF",
- cardRuleId: "1"
- });
- this.$router.push({
- name: "CardFreeDesign",
- params: {
- cardId: row.id
- }
- });
- },
- toAdd() {
- this.$ls.set("prepareTcPCard", {
- examTaskId: "1111",
- courseCode: "数学",
- courseName: "sx001",
- makeMethod: "SELF",
- cardRuleId: "1"
- });
- this.$router.push({
- name: "CardDesign"
- });
- },
- toFreeAdd() {
- this.$ls.set("prepareTcPCard", {
- examTaskId: "1111",
- courseCode: "数学",
- courseName: "sx001",
- makeMethod: "SELF",
- cardRuleId: "1"
- });
- this.$router.push({
- name: "CardFreeDesign"
- });
- }
- }
- };
- </script>
- <style scoped>
- .home {
- background: #eff0f5;
- padding: 20px;
- }
- </style>
|