This commit is contained in:
Yuanjianghong 2021-09-01 11:12:32 +08:00
parent 107eca865d
commit ac89753655
3 changed files with 118 additions and 28 deletions

View File

@ -2,7 +2,7 @@ import request from '@/utils/request'
const projectApi = { const projectApi = {
add: 'project/add', add: 'project/add',
getDict:'projecct/getDict', getDict:'project/dict/get',
// get: 'sys/menu/get', // get: 'sys/menu/get',
// update: 'sys/menu/update', // update: 'sys/menu/update',
// del: 'sys/menu/delete', // del: 'sys/menu/delete',

View File

@ -1,38 +1,126 @@
<template> <template>
<div> <div>
<h1>课程选择</h1> <a-form-model :model="form" :label-col="labelCol" :wrapper-col="wrapperCol" :layout="vertical">
</div> <a-space direction="vertical" style="width: 100%">
<a-space direction="horizontal">
<span>总课时{{ totalHours }}, 总学时要求{{ totalLearnHours }}, 总题目数量{{ totalTopicNum }} </span>
课程名:
<a-input v-model="queryParam.projectName" style="width: 100%" />
<a-button type="primary" icon="search" @click="$refs.table.refresh(true)">查询</a-button>
<a-button icon="select" @click="() => (queryParam = {})">添加课程</a-button>
</a-space>
<s-table
ref="table"
size="default"
rowKey="id"
:columns="columns"
:data="loadData"
:rowSelection="options.rowSelection"
>
<span slot="serial" slot-scope="text, record, index">
{{ index + 1 }}
</span>
<!-- slot-scope="text, record" -->
<span slot="action">
<template>
<a-button type="primary" icon="search" @click="$refs.table.refresh(true)">课程预览</a-button>
<a-button type="primary" icon="search" @click="$refs.table.refresh(true)">题库预览</a-button>
<a-button type="primary" icon="search" @click="$refs.table.refresh(true)">必选题设置</a-button>
<!-- <a href="javascript:;" @click="handleEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm title="是否删除?" @confirm="() => handleDelete(record)">
<a href="javascript:;">删除</a>
</a-popconfirm>
<a-divider type="vertical" />
<a href="javascript:;" @click="handleDetail(record)">详情</a>
<a-divider type="vertical" /> -->
</template>
</span>
</s-table>
<a-form-model-item :wrapper-col="{ span: 14, offset: 4 }">
<a-button type="primary" @click="toNext"> 下一步 </a-button>
<a-button style="margin-left: 10px"> 取消 </a-button>
</a-form-model-item>
</a-space>
</a-form-model>
</div>
</template> </template>
<script> <script>
//jsjsjson //jsjsjson
//import from '' //import from ''
import { STable } from '@/components'
export default { export default {
//import使 //import使
components: {}, components: {
props: {}, STable,
data() { },
// props: {},
return {}; data() {
}, //
// data return {
computed: {}, form: {},
//data totalHours: 0, //
watch: {}, totalLearnHours: 0, //
// totalTopicNum: 0, //
methods: {}, //
created() {}, // - 访this queryParam: {},
mounted() {}, // - 访DOM //
beforeCreate() {}, // - columns: [
beforeMount() {}, // - { title: '序号', key: 'id', dataIndex: 'id', width: 60, scopedSlots: { customRender: 'serial' } },
beforeUpdate() {}, // - { title: '课程编号', dataIndex: 'courseNo', key: 'courseNo' },
updated() {}, // - { title: '课程名称', dataIndex: 'courseName', key: 'courseName' },
beforeDestroy() {}, // - { title: '课时', dataIndex: 'courseHours', key: 'courseHours', customRender: (text) => text + '分' },
destroyed() {}, // - { title: '学时要求', dataIndex: 'learnHours', key: 'learnHours', customRender: (text) => text + '分' },
activated() {} //keep-alive { title: '题量', dataIndex: 'topicNumber', key: 'projectName' },
}; { title: '项目名称', dataIndex: 'projectName', key: 'projectName' },
{
title: '操作',
width: 200,
align: 'center',
scopedSlots: { customRender: 'action' },
},
],
// Promise
loadData: (parameter) => {
return getProjectList(Object.assign(parameter, this.queryParam)).then((res) => {
return res
})
},
}
},
// data
computed: {},
//data
watch: {},
//
methods: {
toNext() {
console.log('ProjectCourseSelect-toNext', this.form)
const {
form: { validateFields },
} = this
//
validateFields((err, values) => {
if (!err) {
this.$emit('nextStep')
}
})
},
},
// - 访this
created() {},
mounted() {}, // - 访DOM
beforeCreate() {}, // -
beforeMount() {}, // -
beforeUpdate() {}, // -
updated() {}, // -
beforeDestroy() {}, // -
destroyed() {}, // -
activated() {}, //keep-alive
}
</script> </script>
<style scoped> <style scoped>
</style> </style>

View File

@ -45,11 +45,13 @@ export default {
methods: { methods: {
// handler // handler
//
nextStep () { nextStep () {
if (this.currentTab < 2) { if (this.currentTab < 5) {
this.currentTab += 1 this.currentTab += 1
} }
}, },
//
prevStep () { prevStep () {
if (this.currentTab > 0) { if (this.currentTab > 0) {
this.currentTab -= 1 this.currentTab -= 1