项目管理更新
This commit is contained in:
parent
0ee7f728f9
commit
c55c81c701
|
@ -8,14 +8,23 @@ const projectCourseApi = {
|
||||||
// del: 'sys/menu/delete',
|
// del: 'sys/menu/delete',
|
||||||
// // updateStatus: 'sys/menu/updateStatus',
|
// // updateStatus: 'sys/menu/updateStatus',
|
||||||
// list: 'project/pageList',
|
// list: 'project/pageList',
|
||||||
projectCourseList: '/project/course/list'
|
projectCourseList: '/project/course/list',
|
||||||
|
courseList: '/project/course/listByCourseIds'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 通过项目id查询 */
|
||||||
export function getCourseList (params) {
|
export function getCourseList (params) {
|
||||||
// console.log("------------{}",params)
|
|
||||||
return request({
|
return request({
|
||||||
url: projectCourseApi.projectCourseList,
|
url: projectCourseApi.projectCourseList,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: params
|
params: params
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
/** 通过课程列表查询 */
|
||||||
|
export function getCourseListByCourseIds (params) {
|
||||||
|
return request({
|
||||||
|
url: projectCourseApi.courseList,
|
||||||
|
method: 'Post',
|
||||||
|
params: params
|
||||||
|
})
|
||||||
}
|
}
|
|
@ -1,36 +1,50 @@
|
||||||
<template>
|
<template>
|
||||||
<a-form-model :model="form" :label-col="labelCol" :wrapper-col="wrapperCol" :layout="vertical">
|
<a-space direction="vertical" style="width: 100%">
|
||||||
<a-space direction="vertical" style="width: 100%">
|
<a-space direction="horizontal">
|
||||||
<a-space direction="horizontal">
|
<span>总课时:{{ totalHours }}, 总学时要求:{{ totalLearnHours }}, 总题目数量:{{ totalTopicNum }} </span>
|
||||||
<span>总课时:{{ totalHours }}, 总学时要求:{{ totalLearnHours }}, 总题目数量:{{ totalTopicNum }} </span>
|
课程名:
|
||||||
课程名:
|
<a-input v-model="queryParam.courseName" style="width: 100%" />
|
||||||
<a-input v-model="queryParam.projectName" style="width: 100%" />
|
<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 icon="select" @click="$refs.CourseSelect.edit({})">添加课程</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>
|
</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>
|
<project-course-select ref="CourseSelect"></project-course-select>
|
||||||
</a-form-model>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -38,19 +52,19 @@
|
||||||
//例如:import 《组件名称》 from '《s组件路径》'
|
//例如:import 《组件名称》 from '《s组件路径》'
|
||||||
import { STable } from '@/components'
|
import { STable } from '@/components'
|
||||||
import ProjectCourseSelect from './ProjectCourseSelect.vue'
|
import ProjectCourseSelect from './ProjectCourseSelect.vue'
|
||||||
import { getCourseList } from '@/api/project/projectCourse'
|
import { getCourseList, getCourseListByCourseIds } from '@/api/project/projectCourse'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
//import引入的组件需要注入到对象中才能使用
|
//import引入的组件需要注入到对象中才能使用
|
||||||
components: {
|
components: {
|
||||||
STable,
|
STable,
|
||||||
ProjectCourseSelect,
|
ProjectCourseSelect,
|
||||||
getCourseList,
|
|
||||||
},
|
},
|
||||||
props: {},
|
props: {},
|
||||||
data() {
|
data() {
|
||||||
//这里存放数据
|
//这里存放数据
|
||||||
return {
|
return {
|
||||||
|
form: {},
|
||||||
labelCol: {},
|
labelCol: {},
|
||||||
wrapperCol: {},
|
wrapperCol: {},
|
||||||
vertical: 'vertical',
|
vertical: 'vertical',
|
||||||
|
@ -58,8 +72,8 @@ export default {
|
||||||
totalLearnHours: 0, //总学时
|
totalLearnHours: 0, //总学时
|
||||||
totalTopicNum: 0, //题目数量
|
totalTopicNum: 0, //题目数量
|
||||||
queryParam: {
|
queryParam: {
|
||||||
id: 1,
|
ids: '1,2,3',
|
||||||
},//查询数据
|
}, //查询数据
|
||||||
columns: [
|
columns: [
|
||||||
{ title: '序号', key: 'id', dataIndex: 'id', width: 60, scopedSlots: { customRender: 'serial' } },
|
{ title: '序号', key: 'id', dataIndex: 'id', width: 60, scopedSlots: { customRender: 'serial' } },
|
||||||
{ title: '课程编号', dataIndex: 'courseNo', key: 'courseNo' },
|
{ title: '课程编号', dataIndex: 'courseNo', key: 'courseNo' },
|
||||||
|
@ -67,10 +81,22 @@ export default {
|
||||||
{ title: '课时', dataIndex: 'courseHours', key: 'courseHours', customRender: (text) => text + '分' },
|
{ title: '课时', dataIndex: 'courseHours', key: 'courseHours', customRender: (text) => text + '分' },
|
||||||
{ title: '学时要求', dataIndex: 'learnHours', key: 'learnHours', customRender: (text) => text + '分' },
|
{ title: '学时要求', dataIndex: 'learnHours', key: 'learnHours', customRender: (text) => text + '分' },
|
||||||
{ title: '题量', dataIndex: 'topicNumber', key: 'topicNumber' },
|
{ title: '题量', dataIndex: 'topicNumber', key: 'topicNumber' },
|
||||||
{ title: '项目名称', dataIndex: 'projectName', key: 'projectName' },
|
// { title: '项目名称', dataIndex: 'projectName', key: 'projectName' },
|
||||||
{ title: '操作', width: 200, align: 'center', scopedSlots: { customRender: 'action' }, },
|
{ title: '操作', width: 200, align: 'center', scopedSlots: { customRender: 'action' } },
|
||||||
], // 表头
|
], // 表头
|
||||||
loadData: parameter => { return getCourseList(Object.assign(parameter, this.queryParam)).then(res => { return res }) }
|
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概念
|
//计算属性 类似于data概念
|
||||||
|
@ -82,29 +108,38 @@ export default {
|
||||||
toNext() {
|
toNext() {
|
||||||
console.log('ProjectCourseSelect-toNext', this.form)
|
console.log('ProjectCourseSelect-toNext', this.form)
|
||||||
this.$emit('nextStep')
|
this.$emit('nextStep')
|
||||||
// 先校验,通过表单校验后,才进入下一步
|
|
||||||
// validateFields((err, values) => {
|
|
||||||
// if (!err) {
|
|
||||||
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
},
|
},
|
||||||
toPrep() {
|
toPrep() {
|
||||||
console.log('toPrep', this.form)
|
console.log('toPrep', this.form)
|
||||||
this.$emit('prevStep', this.form)
|
this.$emit('prevStep', this.form)
|
||||||
},
|
},
|
||||||
getProjectCourseList(){
|
/**查询了列表数据 */
|
||||||
getCourseList(this.queryParam).then((res) => {
|
getProjectCourseList() {
|
||||||
if(res.code == 200){
|
// if (this.$route.query.projectId) {
|
||||||
this.data1 = res.rows;
|
// /** 编辑景来的有项目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实例)
|
//生命周期 - 创建完成(可以访问当前this实例)
|
||||||
created() {},
|
created() {
|
||||||
|
// this.getProjectCourseList()
|
||||||
|
},
|
||||||
mounted() {}, //生命周期 - 挂载完成(可以访问DOM元素)
|
mounted() {}, //生命周期 - 挂载完成(可以访问DOM元素)
|
||||||
beforeCreate() {}, //生命周期 - 创建之前
|
beforeCreate() {}, //生命周期 - 创建之前
|
||||||
beforeMount() {}, //生命周期 - 挂载之前
|
beforeMount() {}, //生命周期 - 挂载之前
|
||||||
|
|
|
@ -84,26 +84,10 @@ import difference from 'lodash/difference'
|
||||||
|
|
||||||
// const coData = [];
|
// const coData = [];
|
||||||
|
|
||||||
const leftTableColumns = [
|
const leftTableColumns = [{dataIndex: 'courseCode', title: '课程编号', },{dataIndex: 'courseName', title: '课程名称', },]
|
||||||
{
|
const rightTableColumns = [ {dataIndex: 'courseCode',title: '课程编号',},{dataIndex: 'courseName',title: '课程名称',},]
|
||||||
dataIndex: 'courseCode',
|
|
||||||
title: '课程编号',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
dataIndex: 'courseName',
|
|
||||||
title: '课程名称',
|
|
||||||
},
|
|
||||||
]
|
|
||||||
const rightTableColumns = [
|
|
||||||
{
|
|
||||||
dataIndex: 'courseCode',
|
|
||||||
title: '课程编号',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
dataIndex: 'courseName',
|
|
||||||
title: '课程名称',
|
|
||||||
},
|
|
||||||
]
|
|
||||||
export default {
|
export default {
|
||||||
//import引入的组件需要注入到对象中才能使用
|
//import引入的组件需要注入到对象中才能使用
|
||||||
|
|
||||||
|
@ -132,7 +116,7 @@ export default {
|
||||||
courseList: {
|
courseList: {
|
||||||
queryParam: {},
|
queryParam: {},
|
||||||
courseData: [],
|
courseData: [],
|
||||||
targetKeys: originTargetKeys,
|
targetKeys: [],
|
||||||
selectedKeys: [],
|
selectedKeys: [],
|
||||||
disabled: false,
|
disabled: false,
|
||||||
leftColumns: leftTableColumns,
|
leftColumns: leftTableColumns,
|
||||||
|
@ -162,6 +146,8 @@ export default {
|
||||||
console.log('课程选择提交了')
|
console.log('课程选择提交了')
|
||||||
this.visible = false
|
this.visible = false
|
||||||
this.formLoading = false
|
this.formLoading = false
|
||||||
|
this.$parent.queryParam.ids = this.courseList.selectedKeys.join(",")
|
||||||
|
this.$parent.$refs.table.refresh(true);
|
||||||
},
|
},
|
||||||
onExpand(expandedKeys) {
|
onExpand(expandedKeys) {
|
||||||
this.expandedKeys = expandedKeys
|
this.expandedKeys = expandedKeys
|
||||||
|
|
|
@ -2,8 +2,14 @@
|
||||||
<a-form-model :model="form" :label-col="labelCol" :wrapper-col="wrapperCol" layout="horizontal">
|
<a-form-model :model="form" :label-col="labelCol" :wrapper-col="wrapperCol" layout="horizontal">
|
||||||
<div>
|
<div>
|
||||||
<a-row type="flex" justify="center" align="top">
|
<a-row type="flex" justify="center" align="top">
|
||||||
<a-col :span="4" id="tree"> </a-col>
|
<a-col :span="4" id="tree">
|
||||||
<a-col :span="20" id="content"> </a-col>
|
<a-tree>
|
||||||
|
|
||||||
|
</a-tree>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="20" id="content">
|
||||||
|
<h1>人员选择</h1>
|
||||||
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
<a-button type="primary" @click="toNext">下一步</a-button>
|
<a-button type="primary" @click="toNext">下一步</a-button>
|
||||||
<a-button type="primary" @click="toPrev">上一步</a-button>
|
<a-button type="primary" @click="toPrev">上一步</a-button>
|
||||||
|
@ -59,14 +65,12 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
#tree {
|
#tree {
|
||||||
width: 100%;
|
height: 750px;
|
||||||
height: 100%;
|
|
||||||
background-color: beige;
|
background-color: beige;
|
||||||
}
|
}
|
||||||
|
|
||||||
#content {
|
#content {
|
||||||
width: 100%;
|
height: 750px;
|
||||||
height: 100%;
|
|
||||||
background-color: bisque;
|
background-color: bisque;
|
||||||
}
|
}
|
||||||
/* /project/form/ProjectPersonForm.vue */
|
/* /project/form/ProjectPersonForm.vue */
|
||||||
|
|
|
@ -138,15 +138,16 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
toNext() {
|
toNext() {
|
||||||
console.log('toNext', this.form)
|
console.log('toNext', this.form)
|
||||||
const {
|
this.$emit('nextStep',this.form)
|
||||||
form: { validateFields },
|
// const {
|
||||||
} = this
|
// form: { validateFields },
|
||||||
// 先校验,通过表单校验后,才进入下一步
|
// } = this
|
||||||
validateFields((err, values) => {
|
// // 先校验,通过表单校验后,才进入下一步
|
||||||
if (!err) {
|
// validateFields((err, values) => {
|
||||||
this.$emit('nextStep',this.form)
|
// if (!err) {
|
||||||
}
|
// this.$emit('nextStep',this.form)
|
||||||
})
|
// }
|
||||||
|
// })
|
||||||
},
|
},
|
||||||
toPrep() {
|
toPrep() {
|
||||||
console.log('toPrep', this.form)
|
console.log('toPrep', this.form)
|
||||||
|
|
Loading…
Reference in New Issue