项目管理更新

This commit is contained in:
Yuanjianghong 2021-11-16 18:05:57 +08:00
parent 0ee7f728f9
commit c55c81c701
5 changed files with 126 additions and 91 deletions

View File

@ -8,14 +8,23 @@ const projectCourseApi = {
// del: 'sys/menu/delete',
// // updateStatus: 'sys/menu/updateStatus',
// list: 'project/pageList',
projectCourseList: '/project/course/list'
projectCourseList: '/project/course/list',
courseList: '/project/course/listByCourseIds'
}
/** 通过项目id查询 */
export function getCourseList (params) {
// console.log("------------{}",params)
return request({
url: projectCourseApi.projectCourseList,
method: 'get',
params: params
})
}
/** 通过课程列表查询 */
export function getCourseListByCourseIds (params) {
return request({
url: projectCourseApi.courseList,
method: 'Post',
params: params
})
}

View File

@ -1,36 +1,50 @@
<template>
<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="$refs.CourseSelect.edit({})">添加课程</a-button>
</a-space>
<s-table ref="table" size="default" rowKey="id" :columns="columns" :data="data1">
<span slot="serial" slot-scope="text, record, index">
{{ index + 1 }}
</span>
<span slot="action" slot-scope="text, record">
<template>
<a-button type="primary" @click="$refs.table.refresh(false)">课程预览</a-button>
<a-button type="primary" @click="$refs.table.refresh(false)">题库预览</a-button>
<a-button type="primary" @click="$refs.table.refresh(false)">必选题设置</a-button>
<a-popconfirm title="是否删除?" @confirm="() => handleDelete(record)">
<a-button type="primary" @click="$refs.table.refresh(true)">删除</a-button>
</a-popconfirm>
</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" @click="toPrep"> 上一步 </a-button>
</a-form-model-item>
<a-space direction="vertical" style="width: 100%">
<a-space direction="horizontal">
<span>总课时{{ totalHours }}, 总学时要求{{ totalLearnHours }}, 总题目数量{{ totalTopicNum }} </span>
课程名:
<a-input v-model="queryParam.courseName" style="width: 100%" />
<a-button type="primary" icon="search" @click="$refs.table.refresh(true)">查询</a-button>
<a-button icon="select" @click="$refs.CourseSelect.edit({})">添加课程</a-button>
</a-space>
<s-table ref="table" size="default" rowKey="id" :columns="columns" :data="loadData" :showPagination="false">
<span slot="serial" slot-scope="text, record, index">
{{ index + 1 }}
</span>
<span slot="action" slot-scope="text, record">
<template>
<a-dropdown>
<a class="ant-dropdown-link"
>操作
<a-icon type="down" />
</a>
<a-menu slot="overlay">
<a-menu-item>
<a href="javascript:;" @click="$refs.table.refresh(false)">课程预览</a>
</a-menu-item>
<a-menu-item>
<a href="javascript:;" @click="$refs.table.refresh(false)">题库预览</a>
</a-menu-item>
<a-menu-item>
<a href="javascript:;" @click="$refs.table.refresh(false)">必选题设置</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="是否删除?" @confirm="() => handleDelete(record)">
<a href="javascript:;" @click="$refs.table.refresh(true)">删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</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" @click="toPrep"> 上一步 </a-button>
</a-form-model-item>
<project-course-select ref="CourseSelect"></project-course-select>
</a-form-model>
</a-space>
</template>
<script>
@ -38,19 +52,19 @@
//import from 's'
import { STable } from '@/components'
import ProjectCourseSelect from './ProjectCourseSelect.vue'
import { getCourseList } from '@/api/project/projectCourse'
import { getCourseList, getCourseListByCourseIds } from '@/api/project/projectCourse'
export default {
//import使
components: {
STable,
ProjectCourseSelect,
getCourseList,
},
props: {},
data() {
//
return {
form: {},
labelCol: {},
wrapperCol: {},
vertical: 'vertical',
@ -58,8 +72,8 @@ export default {
totalLearnHours: 0, //
totalTopicNum: 0, //
queryParam: {
id: 1,
},//
ids: '1,2,3',
}, //
columns: [
{ title: '序号', key: 'id', dataIndex: 'id', width: 60, scopedSlots: { customRender: 'serial' } },
{ title: '课程编号', dataIndex: 'courseNo', key: 'courseNo' },
@ -67,10 +81,22 @@ export default {
{ title: '课时', dataIndex: 'courseHours', key: 'courseHours', customRender: (text) => text + '分' },
{ title: '学时要求', dataIndex: 'learnHours', key: 'learnHours', customRender: (text) => text + '分' },
{ title: '题量', dataIndex: 'topicNumber', key: 'topicNumber' },
{ title: '项目名称', dataIndex: 'projectName', key: 'projectName' },
{ title: '操作', width: 200, align: 'center', scopedSlots: { customRender: 'action' }, },
], //
loadData: parameter => { return getCourseList(Object.assign(parameter, this.queryParam)).then(res => { return res }) }
// { title: '', dataIndex: 'projectName', key: 'projectName' },
{ title: '操作', width: 200, align: 'center', scopedSlots: { customRender: 'action' } },
], //
loadData: (parameter) => {
if (this.$route.query.projectId) {
/** 编辑进来的有项目id */
return getCourseList(this.$route.query.projectId).then((res) => {
return res.data
})
} else {
/** 新建的没有项目id传当前的所选的课程id */
return getCourseListByCourseIds(Object.assign(parameter, this.queryParam)).then((res) => {
return res.data
})
}
},
}
},
// data
@ -82,29 +108,38 @@ export default {
toNext() {
console.log('ProjectCourseSelect-toNext', this.form)
this.$emit('nextStep')
//
// validateFields((err, values) => {
// if (!err) {
// }
// })
},
toPrep() {
console.log('toPrep', this.form)
this.$emit('prevStep', this.form)
},
getProjectCourseList(){
getCourseList(this.queryParam).then((res) => {
if(res.code == 200){
this.data1 = res.rows;
}
})
}
/**查询了列表数据 */
getProjectCourseList() {
// if (this.$route.query.projectId) {
// /** id */
// getCourseList(this.$route.query.projectId).then((res) => {
// if (res.code == 200) {
// // this.data1 = res.data
// return res
// }
// })
// } else {
// /** idid */
// getCourseListByCourseIds(this.queryParam.ids.join(',')).then((res)=>{
// if (res.code == 200) {
// // this.data1 = res.data
// // console.log(this.data1)
// return res
// }
// })
// }
},
},
// - 访this
created() {},
created() {
// this.getProjectCourseList()
},
mounted() {}, // - 访DOM
beforeCreate() {}, // -
beforeMount() {}, // -

View File

@ -84,26 +84,10 @@ import difference from 'lodash/difference'
// const coData = [];
const leftTableColumns = [
{
dataIndex: 'courseCode',
title: '课程编号',
},
{
dataIndex: 'courseName',
title: '课程名称',
},
]
const rightTableColumns = [
{
dataIndex: 'courseCode',
title: '课程编号',
},
{
dataIndex: 'courseName',
title: '课程名称',
},
]
const leftTableColumns = [{dataIndex: 'courseCode', title: '课程编号', },{dataIndex: 'courseName', title: '课程名称', },]
const rightTableColumns = [ {dataIndex: 'courseCode',title: '课程编号',},{dataIndex: 'courseName',title: '课程名称',},]
export default {
//import使
@ -132,7 +116,7 @@ export default {
courseList: {
queryParam: {},
courseData: [],
targetKeys: originTargetKeys,
targetKeys: [],
selectedKeys: [],
disabled: false,
leftColumns: leftTableColumns,
@ -162,6 +146,8 @@ export default {
console.log('课程选择提交了')
this.visible = false
this.formLoading = false
this.$parent.queryParam.ids = this.courseList.selectedKeys.join(",")
this.$parent.$refs.table.refresh(true);
},
onExpand(expandedKeys) {
this.expandedKeys = expandedKeys

View File

@ -2,8 +2,14 @@
<a-form-model :model="form" :label-col="labelCol" :wrapper-col="wrapperCol" layout="horizontal">
<div>
<a-row type="flex" justify="center" align="top">
<a-col :span="4" id="tree"> </a-col>
<a-col :span="20" id="content"> </a-col>
<a-col :span="4" id="tree">
<a-tree>
</a-tree>
</a-col>
<a-col :span="20" id="content">
<h1>人员选择</h1>
</a-col>
</a-row>
<a-button type="primary" @click="toNext">下一步</a-button>
<a-button type="primary" @click="toPrev">上一步</a-button>
@ -59,14 +65,12 @@ export default {
</script>
<style scoped>
#tree {
width: 100%;
height: 100%;
height: 750px;
background-color: beige;
}
#content {
width: 100%;
height: 100%;
height: 750px;
background-color: bisque;
}
/* /project/form/ProjectPersonForm.vue */

View File

@ -138,15 +138,16 @@ export default {
methods: {
toNext() {
console.log('toNext', this.form)
const {
form: { validateFields },
} = this
//
validateFields((err, values) => {
if (!err) {
this.$emit('nextStep',this.form)
}
})
this.$emit('nextStep',this.form)
// const {
// form: { validateFields },
// } = this
// //
// validateFields((err, values) => {
// if (!err) {
// this.$emit('nextStep',this.form)
// }
// })
},
toPrep() {
console.log('toPrep', this.form)