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 = {
add: 'project/add',
getDict:'projecct/getDict',
getDict:'project/dict/get',
// get: 'sys/menu/get',
// update: 'sys/menu/update',
// del: 'sys/menu/delete',

View File

@ -1,38 +1,126 @@
<template>
<div>
<h1>课程选择</h1>
</div>
<div>
<a-form-model :model="form" :label-col="labelCol" :wrapper-col="wrapperCol" :layout="vertical">
<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>
<script>
//jsjsjson
//import from ''
import { STable } from '@/components'
export default {
//import使
components: {},
props: {},
data() {
//
return {};
},
// data
computed: {},
//data
watch: {},
//
methods: {},
created() {}, // - 访this
mounted() {}, // - 访DOM
beforeCreate() {}, // -
beforeMount() {}, // -
beforeUpdate() {}, // -
updated() {}, // -
beforeDestroy() {}, // -
destroyed() {}, // -
activated() {} //keep-alive
};
//import使
components: {
STable,
},
props: {},
data() {
//
return {
form: {},
totalHours: 0, //
totalLearnHours: 0, //
totalTopicNum: 0, //
//
queryParam: {},
//
columns: [
{ title: '序号', key: 'id', dataIndex: 'id', width: 60, scopedSlots: { customRender: 'serial' } },
{ title: '课程编号', dataIndex: 'courseNo', key: 'courseNo' },
{ title: '课程名称', dataIndex: 'courseName', key: 'courseName' },
{ title: '课时', dataIndex: 'courseHours', key: 'courseHours', customRender: (text) => text + '分' },
{ title: '学时要求', dataIndex: 'learnHours', key: 'learnHours', customRender: (text) => text + '分' },
{ 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>
<style scoped>
</style>

View File

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