项目管理更新

This commit is contained in:
Yuanjianghong 2021-11-12 14:16:05 +08:00
parent 20f2408aec
commit e64c479139
6 changed files with 128 additions and 70 deletions

View File

@ -9,6 +9,7 @@ const coursewareApi = {
// list: '/courseManagement/course/listPage', // list: '/courseManagement/course/listPage',
// coursewareList:'/courseManagement/course/courseware/details', // coursewareList:'/courseManagement/course/courseware/details',
// questionList:'/courseManagement/course/questionList' // questionList:'/courseManagement/course/questionList'
classList: '/courseManagement/coursewareClassify/listPage'
} }
@ -31,3 +32,12 @@ export function deleteCourseware (params) {
data: params data: params
}) })
} }
// 课件分类列表
export function coursewareClassList(params) {
return request({
url: coursewareApi.classList,
method: 'get',
params: params
})
}

View File

@ -85,3 +85,19 @@ export function listToTree (list, tree, parentId) {
}) })
return tree return tree
} }
//列表转🌲
// export function list2Tree(list, parentId) {
// let obj = []
// list.forEach(item => {
// item.children = []
// obj[item.id] = item
// })
// return list.filter(item => {
// if (item.parentId !== parentId) {
// obj[item.parentId].children.push(item)
// return false
// }
// return true
// })
// }

View File

@ -10,11 +10,13 @@
<a-step title="完成" /> <a-step title="完成" />
</a-steps> </a-steps>
<div class="content"> <div class="content">
<keep-alive>
<step1 v-if="currentTab === 0" @nextStep="nextStep" /> <step1 v-if="currentTab === 0" @nextStep="nextStep" />
<step2 v-if="currentTab === 1" @nextStep="nextStep" @prevStep="prevStep" /> <step2 v-if="currentTab === 1" @nextStep="nextStep" @prevStep="prevStep" />
<step3 v-if="currentTab === 2" @nextStep="nextStep" @prevStep="prevStep" /> <step3 v-if="currentTab === 2" @nextStep="nextStep" @prevStep="prevStep" />
<step4 v-if="currentTab === 3" @nextStep="nextStep" @prevStep="prevStep" /> <step4 v-if="currentTab === 3" @nextStep="nextStep" @prevStep="prevStep" />
<step5 v-if="currentTab === 4" @prevStep="prevStep" @finish="finish" /> <step5 v-if="currentTab === 4" @prevStep="prevStep" @finish="finish" />
</keep-alive>
</div> </div>
</a-card> </a-card>
</template> </template>
@ -67,6 +69,7 @@ export default {
// handler // handler
// //
nextStep() { nextStep() {
console.log('1111', this)
if (this.currentTab < 5) { if (this.currentTab < 5) {
this.currentTab += 1 this.currentTab += 1
} }

View File

@ -11,53 +11,56 @@
> >
<a-row type="flex" justify="center" align="top"> <a-row type="flex" justify="center" align="top">
<a-col :span="6"> <a-col :span="6">
<a-menu v-model="current" mode="horizontal"> <a-menu v-model="current" mode="horizontal" @click="handleMenuClick">
<a-menu-item key="sys"> <a-icon type="mail" />系统课程</a-menu-item> <a-menu-item key="sys"> <a-icon type="sys" />系统课程</a-menu-item>
<a-menu-item key="self"> <a-icon type="appstore" />自制课程</a-menu-item> <a-menu-item key="self"> <a-icon type="self" />自制课程</a-menu-item>
</a-menu> </a-menu>
<a-input-search style="margin-bottom: 8px" placeholder="Search" @change="onChange" />
<a-tree <a-tree
:replace-fields="replaceFields"
:expanded-keys="expandedKeys" :expanded-keys="expandedKeys"
:auto-expand-parent="autoExpandParent" :auto-expand-parent="autoExpandParent"
:tree-data="gData" :tree-data="treeData"
@expand="onExpand" @expand="onExpand"
@select="onSelect"
> >
<template slot="title" slot-scope="{ title }">
<span v-if="title.indexOf(searchValue) > -1">
{{ title.substr(0, title.indexOf(searchValue)) }}
<span style="color: #f50">{{ searchValue }}</span>
{{ title.substr(title.indexOf(searchValue) + searchValue.length) }}
</span>
<span v-else>{{ title }}</span>
</template>
</a-tree> </a-tree>
</a-col> </a-col>
<a-col :span="18"> <a-col :span="18">
<p class="height-50">col-4</p> <div id="content">
<p>dsfdsfdsfdsfds</p>
</div>
</a-col> </a-col>
</a-row> </a-row>
</a-modal> </a-modal>
</template> </template>
<script> <script>
import { coursewareClassList } from '@/api/course/courseware'
//jsjsjson //jsjsjson
//import from '' //import from ''
export default { export default {
//import使 //import使
components: {}, components: {
coursewareClassList,
},
props: {}, props: {},
data() { data() {
// //
return { return {
replaceFields: {
children: 'children',
title: 'name',
key: 'id'
},
visible: false, visible: false,
confirmLoading: false, confirmLoading: false,
current: ['mail'], current: ['sys'],
modalTitle: '', modalTitle: '',
expandedKeys: [], expandedKeys: [],
searchValue: '', searchValue: '',
autoExpandParent: true, autoExpandParent: true,
gData: [], treeData: [],
} }
}, },
// data // data
@ -87,25 +90,36 @@ export default {
this.expandedKeys = expandedKeys this.expandedKeys = expandedKeys
this.autoExpandParent = false this.autoExpandParent = false
}, },
onChange(e) { //
console.log(this.gData) handleMenuClick(e) {
const value = e.target.value console.log('key============', e.key)
const expandedKeys = dataList this.getCourseTreeData(e.key)
.map((item) => { console.log(this.treeData)
if (item.title.indexOf(value) > -1) { },
return getParentKey(item.key, gData) //
getCourseTreeData(key) {
coursewareClassList().then((res) => {
//list🌲
const list2tree1 = (list, parentId) => {
return list.filter((item) => {
if (item.parentId === parentId) {
item.children = list2tree1(list, item.id)
return true
} }
return null return false
}) })
.filter((item, i, self) => item && self.indexOf(item) === i) }
Object.assign(this, {
expandedKeys, this.treeData = list2tree1(res.data, -1)
searchValue: value,
autoExpandParent: true,
}) })
}, },
onSelect(selectedKeys, e){
}
}, },
created() {}, // - 访this created() {
this.handleMenuClick()
}, // - 访this
mounted() {}, // - 访DOM mounted() {}, // - 访DOM
beforeCreate() {}, // - beforeCreate() {}, // -
beforeMount() {}, // - beforeMount() {}, // -
@ -117,4 +131,9 @@ export default {
} }
</script> </script>
<style scoped> <style scoped>
#content {
background-color: aquamarine;
width: 100%;
height: 500px;
}
</style> </style>

View File

@ -140,6 +140,7 @@ export default {
ClassList, ClassList,
}, },
created(ClassList) { created(ClassList) {
console.log('第一个表单创建了');
this.fetchTemplateData() this.fetchTemplateData()
}, },
methods: { methods: {
@ -185,5 +186,8 @@ export default {
this.form.resitNumber = Math.floor(Math.random() * (5 - 1) + 1) this.form.resitNumber = Math.floor(Math.random() * (5 - 1) + 1)
}, },
}, },
destroyed() {
console.log('第一个表单销毁了')
}
} }
</script> </script>

View File

@ -122,6 +122,9 @@ export default {
}, },
} }
}, },
created(){
console.log('第2个表单创建了')
},
computed: { computed: {
treeData() { treeData() {
return handleTreeData(treeData, this.targetKeys) return handleTreeData(treeData, this.targetKeys)
@ -172,5 +175,8 @@ export default {
} }
}, },
}, },
destroyed() {
console.log('第2个表单销毁了')
},
} }
</script> </script>