项目管理更新
This commit is contained in:
parent
0ee7f728f9
commit
c55c81c701
|
@ -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
|
||||
})
|
||||
}
|
|
@ -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 {
|
||||
// /** 新建的没有项目id,传当前的所选的课程id */
|
||||
// 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() {}, //生命周期 - 挂载之前
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue