项目课程更新
This commit is contained in:
parent
a64454afa4
commit
6d14449113
|
@ -1,15 +1,10 @@
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
const coursewareApi = {
|
const coursewareApi = {
|
||||||
add: '/courseManagement/xmCourseCourseware/addOrUpdate',
|
add: '/courseManagement/xmCourseCourseware/addOrUpdate',
|
||||||
get: '/courseManagement/xmCourseCourseware/details',
|
get: '/courseManagement/xmCourseCourseware/details',
|
||||||
// update: 'sys/menu/update',
|
del: 'courseManagement/xmCourseCourseware/delete',
|
||||||
del: 'courseManagement/xmCourseCourseware/delete',
|
classList: '/courseManagement/coursewareClassify/listPage'
|
||||||
// updateStatus: 'sys/menu/updateStatus',
|
|
||||||
// list: '/courseManagement/course/listPage',
|
|
||||||
// coursewareList:'/courseManagement/course/courseware/details',
|
|
||||||
// questionList:'/courseManagement/course/questionList'
|
|
||||||
classList: '/courseManagement/coursewareClassify/listPage'
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,37 +12,37 @@ const coursewareApi = {
|
||||||
|
|
||||||
//删除课件
|
//删除课件
|
||||||
export function deleteCourseware(params) {
|
export function deleteCourseware(params) {
|
||||||
return request({
|
return request({
|
||||||
url: coursewareApi.del,
|
url: coursewareApi.del,
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
params: params
|
params: params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 课件新增
|
// 课件新增
|
||||||
export function coursewareAdd(params) {
|
export function coursewareAdd(params) {
|
||||||
return request({
|
return request({
|
||||||
url: coursewareApi.add,
|
url: coursewareApi.add,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 课件分类列表
|
// 课件分类列表
|
||||||
export function coursewareClassList(params) {
|
export function coursewareClassList(params) {
|
||||||
return request({
|
return request({
|
||||||
url: coursewareApi.classList,
|
url: coursewareApi.classList,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: params
|
params: params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 课件详情
|
// 课件详情
|
||||||
export function coursewareDeatil(params) {
|
export function coursewareDeatil(params) {
|
||||||
return request({
|
return request({
|
||||||
url: coursewareApi.get,
|
url: coursewareApi.get,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: params
|
params: params
|
||||||
})
|
})
|
||||||
}
|
}
|
|
@ -12,19 +12,9 @@
|
||||||
<a-select-option value="3">未发布</a-select-option>
|
<a-select-option value="3">未发布</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
开始时间:
|
开始时间:
|
||||||
<a-date-picker
|
<a-date-picker v-model="queryParam.startDate" style="width: 100%" placeholder="请输入开始时间" valueFormat="YYYY-MM-DD HH:mm:ss" />
|
||||||
v-model="queryParam.startDate"
|
|
||||||
style="width: 100%"
|
|
||||||
placeholder="请输入开始时间"
|
|
||||||
valueFormat="YYYY-MM-DD HH:mm:ss"
|
|
||||||
/>
|
|
||||||
结束时间:
|
结束时间:
|
||||||
<a-date-picker
|
<a-date-picker v-model="queryParam.endDate" style="width: 100%" placeholder="请输入结束时间" valueFormat="YYYY-MM-DD HH:mm:ss" />
|
||||||
v-model="queryParam.endDate"
|
|
||||||
style="width: 100%"
|
|
||||||
placeholder="请输入结束时间"
|
|
||||||
valueFormat="YYYY-MM-DD HH:mm:ss"
|
|
||||||
/>
|
|
||||||
培训方式:
|
培训方式:
|
||||||
<a-select v-model="queryParam.trainWay" placeholder="请选择" default-value="null" style="width: 120px">
|
<a-select v-model="queryParam.trainWay" placeholder="请选择" default-value="null" style="width: 120px">
|
||||||
<a-select-option value="null">全部</a-select-option>
|
<a-select-option value="null">全部</a-select-option>
|
||||||
|
@ -39,28 +29,23 @@
|
||||||
</a-space>
|
</a-space>
|
||||||
|
|
||||||
<a-space class="table-operator" direction="horizontal">
|
<a-space class="table-operator" direction="horizontal">
|
||||||
<a-button v-if="hasPerm('project:add')" type="primary" icon="plus" @click="handledCreate">新增项目</a-button>
|
<a-button v-if="hasPerm(power.add)" type="primary" icon="plus" @click="handledCreate">新增项目</a-button>
|
||||||
</a-space>
|
</a-space>
|
||||||
|
|
||||||
<s-table
|
<s-table ref="table" size="default" rowKey="id" :columns="columns" :data="loadData" :pageNum="Number(this.$route.query.projectPageNum) || 1">
|
||||||
ref="table"
|
|
||||||
size="default"
|
|
||||||
rowKey="id"
|
|
||||||
:columns="columns"
|
|
||||||
:data="loadData"
|
|
||||||
:pageNum="Number(this.$route.query.projectPageNum) || 1"
|
|
||||||
>
|
|
||||||
<span slot="serial" slot-scope="text, record, index">
|
<span slot="serial" slot-scope="text, record, index">
|
||||||
{{ index + 1 }}
|
{{ index + 1 }}
|
||||||
</span>
|
</span>
|
||||||
<span slot="action" slot-scope="text, record">
|
<span slot="action" slot-scope="text, record">
|
||||||
<template>
|
<template>
|
||||||
<a v-if="hasPerm('project:edit')" href="javascript:;" @click="handledCreate(record)">修改</a>
|
<a v-if="hasPerm(power.release) && record.status == 1" href="javascript:;" @click="handledRelease(record)">发布</a>
|
||||||
<a-divider type="vertical" />
|
<a-divider type="vertical" v-if="hasPerm(power.edit) && hasPerm('project:list')" />
|
||||||
<a v-if="hasPerm('project:list')" href="javascript:;" @click="getDetail(record)">详情</a>
|
<a v-if="hasPerm('project:list')" href="javascript:;" @click="getDetail(record)">详情</a>
|
||||||
<a-divider type="vertical" />
|
<a-divider type="vertical" v-if="hasPerm(power.edit) && hasPerm('project:list')" />
|
||||||
|
<a v-if="hasPerm(power.edit)" href="javascript:;" @click="handledCreate(record)">修改</a>
|
||||||
|
<a-divider type="vertical" v-if="hasPerm(power.del) && hasPerm('project:list')" />
|
||||||
<a-popconfirm title="是否删除?" @confirm="() => handleDelete(record)">
|
<a-popconfirm title="是否删除?" @confirm="() => handleDelete(record)">
|
||||||
<a v-if="hasPerm('project:del')" href="javascript:;">删除</a>
|
<a v-if="hasPerm(power.del)" href="javascript:;">删除</a>
|
||||||
</a-popconfirm>
|
</a-popconfirm>
|
||||||
</template>
|
</template>
|
||||||
</span>
|
</span>
|
||||||
|
@ -79,6 +64,12 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
power: {
|
||||||
|
add: '',
|
||||||
|
del: '',
|
||||||
|
edit: '',
|
||||||
|
release: '',
|
||||||
|
},
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParam: {
|
queryParam: {
|
||||||
projectName: null,
|
projectName: null,
|
||||||
|
@ -129,7 +120,7 @@ export default {
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
width: 200,
|
width: 200,
|
||||||
align: 'center',
|
align: 'right',
|
||||||
scopedSlots: { customRender: 'action' },
|
scopedSlots: { customRender: 'action' },
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -147,7 +138,7 @@ export default {
|
||||||
this.changeType()
|
this.changeType()
|
||||||
},
|
},
|
||||||
//生命周期 - 销毁完成
|
//生命周期 - 销毁完成
|
||||||
destroyed() {},
|
destroyed() { },
|
||||||
// 监控data中的数据变化
|
// 监控data中的数据变化
|
||||||
watch: {
|
watch: {
|
||||||
$route(to, from) { //to是前往的路由 from是去往的路由 同一个组件只会渲染一次
|
$route(to, from) { //to是前往的路由 from是去往的路由 同一个组件只会渲染一次
|
||||||
|
@ -156,12 +147,17 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getDetail(record){
|
//发布项目
|
||||||
|
handledRelease(record){
|
||||||
|
|
||||||
|
},
|
||||||
|
//编辑时获取详情
|
||||||
|
getDetail(record) {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: '/project/detail',
|
path: '/project/detail',
|
||||||
query: {
|
query: {
|
||||||
id: record.id, //自主项目还是系统项目,控制路由跳转
|
id: record.id, //自主项目还是系统项目,控制路由跳转
|
||||||
t:this.queryParam.type,
|
t: this.queryParam.type,
|
||||||
projectId: record.id, //项目id
|
projectId: record.id, //项目id
|
||||||
projectPageNum: this.$refs.table.localPagination.current, //当前页
|
projectPageNum: this.$refs.table.localPagination.current, //当前页
|
||||||
},
|
},
|
||||||
|
@ -181,14 +177,23 @@ export default {
|
||||||
//变更类型
|
//变更类型
|
||||||
changeType(path) {
|
changeType(path) {
|
||||||
var arr = []
|
var arr = []
|
||||||
if(path){
|
if (path) {
|
||||||
arr = path.split('/')
|
arr = path.split('/')
|
||||||
}else{
|
} else {
|
||||||
arr = this.$route.path.split('/')
|
arr = this.$route.path.split('/')
|
||||||
}
|
}
|
||||||
this.queryParam.type = arr[arr.length - 1]
|
let str = arr[arr.length - 1]
|
||||||
|
this.queryParam.type = str
|
||||||
|
//权限
|
||||||
|
str === 'sys' ? this.power.add = 'project:sys:add' : this.power.add = 'project:add'
|
||||||
|
str === 'sys' ? this.power.del = 'project:sys:del' : this.power.del = 'project:del'
|
||||||
|
str === 'sys' ? this.power.edit = 'project:sys:edit' : this.power.edit = 'project:edit'
|
||||||
|
str === 'sys' ? this.power.release = 'project:sys:release' : this.power.release = 'project:release'
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<a-card class="coures" :bordered="false" title="项目课程信息">
|
<a-card class="coures" :bordered="false" title="项目课程信息">
|
||||||
<!-- <template slot="extra">
|
|
||||||
<a-button type="primary" size="default" @click="toNext">下一步</a-button>
|
|
||||||
</template>
|
|
||||||
<template slot="extra">
|
|
||||||
<a-button type="primary" size="default" @click="toPrep">上一步</a-button>
|
|
||||||
</template> -->
|
|
||||||
<a-space direction="vertical" style="width: 100%">
|
<a-space direction="vertical" style="width: 100%">
|
||||||
<a-space direction="horizontal">
|
<a-space direction="horizontal">
|
||||||
<span>总课时:{{ form.totalCourseHours }}H , 总学时要求:{{ form.totalLearnHours }}H , 总题目数量:{{ form.totalTopicNumber }} </span>
|
<span>总课时:{{ form.totalCourseHours }}H , 总学时要求:{{ form.totalLearnHours }}H , 总题目数量:{{ form.totalTopicNumber }} </span>
|
||||||
|
@ -111,7 +105,6 @@ export default {
|
||||||
{ title: '课时', dataIndex: 'courseHours', key: 'courseHours', customRender: (text) => text + 'H' },
|
{ title: '课时', dataIndex: 'courseHours', key: 'courseHours', customRender: (text) => text + 'H' },
|
||||||
{ title: '学时要求', dataIndex: 'learnHours', key: 'learnHours', customRender: (text) => text + 'H' },
|
{ title: '学时要求', dataIndex: 'learnHours', key: 'learnHours', customRender: (text) => text + 'H' },
|
||||||
{ title: '题量', dataIndex: 'topicNumber', key: 'topicNumber' },
|
{ title: '题量', dataIndex: 'topicNumber', key: 'topicNumber' },
|
||||||
// { title: '项目名称', dataIndex: 'projectName', key: 'projectName' },
|
|
||||||
{ title: '操作', width: 200, align: 'center', scopedSlots: { customRender: 'action' } },
|
{ title: '操作', width: 200, align: 'center', scopedSlots: { customRender: 'action' } },
|
||||||
], // 表头
|
], // 表头
|
||||||
loadData: (parameter) => {
|
loadData: (parameter) => {
|
||||||
|
@ -119,7 +112,6 @@ export default {
|
||||||
/** 编辑进来的有项目id */
|
/** 编辑进来的有项目id */
|
||||||
return getCourseList({id:this.$route.query.projectId}).then((res) => {
|
return getCourseList({id:this.$route.query.projectId}).then((res) => {
|
||||||
this.selData = res.data;
|
this.selData = res.data;
|
||||||
|
|
||||||
this.calc(res.data)
|
this.calc(res.data)
|
||||||
return res.data
|
return res.data
|
||||||
})
|
})
|
||||||
|
@ -127,7 +119,6 @@ export default {
|
||||||
/** 新建的没有项目id,传当前的所选的课程id */
|
/** 新建的没有项目id,传当前的所选的课程id */
|
||||||
return getCourseListByCourseIds(Object.assign(parameter, this.queryParam)).then((res) => {
|
return getCourseListByCourseIds(Object.assign(parameter, this.queryParam)).then((res) => {
|
||||||
this.selData = res.data;
|
this.selData = res.data;
|
||||||
// console.log('list页面----selData',this.selData)
|
|
||||||
this.calc(res.data)
|
this.calc(res.data)
|
||||||
return res.data
|
return res.data
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,24 +1,17 @@
|
||||||
<template>
|
<template>
|
||||||
<a-modal
|
<a-modal id="modal" :title="modalTitle" :width="1500" height="auto" :visible="visible" @ok="handleSubmit" @cancel="handleCancel">
|
||||||
id="modal"
|
|
||||||
:title="modalTitle"
|
|
||||||
:width="1500"
|
|
||||||
height="auto"
|
|
||||||
:visible="visible"
|
|
||||||
@ok="handleSubmit"
|
|
||||||
@cancel="handleCancel"
|
|
||||||
>
|
|
||||||
<a-card :bordered="false" title="项目课程选择">
|
<a-card :bordered="false" title="项目课程选择">
|
||||||
<a-row type="flex" justify="center" align="top">
|
<a-row type="flex" justify="center" align="top">
|
||||||
<a-col :span="4" id="tree">
|
<a-col :span="4" id="tree">
|
||||||
<a-page-header title="单位列表" sub-title="" />
|
<a-menu v-model="menuKey" mode="horizontal" @click="menuChack()">
|
||||||
<a-tree
|
<a-menu-item key="sys">
|
||||||
:treeData="treeData"
|
系统课程
|
||||||
@select="onSelect"
|
</a-menu-item>
|
||||||
:defaultExpandAll="true"
|
<a-menu-item key="self">
|
||||||
:defaultExpandedKeys="defaultExpandedKeys"
|
自主课程
|
||||||
:replaceFields="replaceFields"
|
</a-menu-item>
|
||||||
>
|
</a-menu>
|
||||||
|
<a-tree :treeData="treeData" @select="onSelect" :defaultExpandAll="true" :defaultExpandedKeys="defaultExpandedKeys" :replaceFields="replaceFields">
|
||||||
<a-icon slot="switcherIcon" type="down" />
|
<a-icon slot="switcherIcon" type="down" />
|
||||||
</a-tree>
|
</a-tree>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
@ -33,13 +26,7 @@
|
||||||
<a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
|
<a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
|
||||||
</a-row>
|
</a-row>
|
||||||
</a-form>
|
</a-form>
|
||||||
<s-table
|
<s-table ref="table" :columns="columns" :data="loadData" :rowKey="(record) => record.id" :rowSelection="{ selectedRowKeys: selectedRowKeys, selectedRows: selectedRows, onChange: onSelectChange }">
|
||||||
ref="table"
|
|
||||||
:columns="columns"
|
|
||||||
:data="loadData"
|
|
||||||
:rowKey="(record) => record.id"
|
|
||||||
:rowSelection="{ selectedRowKeys: selectedRowKeys, selectedRows: selectedRows, onChange: onSelectChange }"
|
|
||||||
>
|
|
||||||
<span slot="serial" slot-scope="text, record, index">
|
<span slot="serial" slot-scope="text, record, index">
|
||||||
{{ index + 1 }}
|
{{ index + 1 }}
|
||||||
</span>
|
</span>
|
||||||
|
@ -83,6 +70,8 @@ export default {
|
||||||
visible: false, //是否显示弹框
|
visible: false, //是否显示弹框
|
||||||
modalTitle: '',
|
modalTitle: '',
|
||||||
|
|
||||||
|
menuKey: ['sys'], //默认系统课程
|
||||||
|
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParam: { name: '', classType: 0 },
|
queryParam: { name: '', classType: 0 },
|
||||||
replaceFields: { children: 'children', title: 'name', key: 'id', value: 'id' },
|
replaceFields: { children: 'children', title: 'name', key: 'id', value: 'id' },
|
||||||
|
@ -116,6 +105,14 @@ export default {
|
||||||
watch: {},
|
watch: {},
|
||||||
// 方法集合
|
// 方法集合
|
||||||
methods: {
|
methods: {
|
||||||
|
//菜单改变,
|
||||||
|
menuChack(){
|
||||||
|
console.log('menuKey',this.menuKey)
|
||||||
|
let type = 0;
|
||||||
|
if(this.menuKey[0] === 'self') type = 1;
|
||||||
|
this.getCourseTreeData(type);
|
||||||
|
this.$refs.table.refresh();
|
||||||
|
},
|
||||||
// 编辑打开页面初始化
|
// 编辑打开页面初始化
|
||||||
edit(record) {
|
edit(record) {
|
||||||
console.log('课程选择打开了', record)
|
console.log('课程选择打开了', record)
|
||||||
|
@ -188,6 +185,7 @@ export default {
|
||||||
this.expandedKeys = expandedKeys
|
this.expandedKeys = expandedKeys
|
||||||
this.autoExpandParent = false
|
this.autoExpandParent = false
|
||||||
},
|
},
|
||||||
|
|
||||||
//查询课程列表
|
//查询课程列表
|
||||||
queryCourseList() {
|
queryCourseList() {
|
||||||
console.log('this.treeDataOne-------', this.treeDataOne)
|
console.log('this.treeDataOne-------', this.treeDataOne)
|
||||||
|
@ -195,9 +193,10 @@ export default {
|
||||||
this.courseData = res.data
|
this.courseData = res.data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
//获取课程分类数据,转换成树结构
|
//获取课程分类数据,转换成树结构
|
||||||
getCourseTreeData(key) {
|
getCourseTreeData(type) {
|
||||||
coursewareClassList().then((res) => {
|
coursewareClassList({type:type}).then((res) => {
|
||||||
//list转🌲
|
//list转🌲
|
||||||
const list2tree1 = (list, parentId) => {
|
const list2tree1 = (list, parentId) => {
|
||||||
return list.filter((item) => {
|
return list.filter((item) => {
|
||||||
|
@ -216,24 +215,24 @@ export default {
|
||||||
},
|
},
|
||||||
// 生命周期 - 创建完成(可以访问当前this实例)
|
// 生命周期 - 创建完成(可以访问当前this实例)
|
||||||
created() {
|
created() {
|
||||||
this.getCourseTreeData()
|
this.getCourseTreeData(0) //进来首先获取系统课程
|
||||||
},
|
},
|
||||||
// 生命周期 - 挂载完成(可以访问DOM元素)
|
// 生命周期 - 挂载完成(可以访问DOM元素)
|
||||||
mounted() {},
|
mounted() { },
|
||||||
// 生命周期 - 创建之前
|
// 生命周期 - 创建之前
|
||||||
beforeCreate() {},
|
beforeCreate() { },
|
||||||
// 生命周期 - 挂载之前
|
// 生命周期 - 挂载之前
|
||||||
beforeMount() {},
|
beforeMount() { },
|
||||||
// 生命周期 - 更新之前
|
// 生命周期 - 更新之前
|
||||||
beforeUpdate() {},
|
beforeUpdate() { },
|
||||||
// 生命周期 - 更新之后
|
// 生命周期 - 更新之后
|
||||||
updated() {},
|
updated() { },
|
||||||
// 生命周期 - 销毁之前
|
// 生命周期 - 销毁之前
|
||||||
beforeDestroy() {},
|
beforeDestroy() { },
|
||||||
// 生命周期 - 销毁完成
|
// 生命周期 - 销毁完成
|
||||||
destroyed() {},
|
destroyed() { },
|
||||||
// 如果页面有keep-alive缓存功能,这个函数会触发
|
// 如果页面有keep-alive缓存功能,这个函数会触发
|
||||||
activated() {},
|
activated() { },
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
Loading…
Reference in New Issue