|
@@ -1,7 +1,7 @@
|
|
<template>
|
|
<template>
|
|
<div class="app-container">
|
|
<div class="app-container">
|
|
- <form-search :searchformShow="searchformShow" :coursewareUpload="coursewareUpload" @handleQuery="handleQuery"
|
|
|
|
- @change="formChange" @resetQuery="resetQuery"></form-search>
|
|
|
|
|
|
+ <form-search :searchformShow="searchformShow" :validate-rules="searchRules" :coursewareUpload="coursewareUpload"
|
|
|
|
+ @handleQuery="handleQuery" @resetQuery="resetQuery"></form-search>
|
|
<el-card class="box-card" style="margin-bottom: 30px">
|
|
<el-card class="box-card" style="margin-bottom: 30px">
|
|
<el-row :gutter="24">
|
|
<el-row :gutter="24">
|
|
<el-col :span="4" v-if="viewName != 'Custom'">
|
|
<el-col :span="4" v-if="viewName != 'Custom'">
|
|
@@ -186,6 +186,7 @@ export default {
|
|
coursewareUpload: false,
|
|
coursewareUpload: false,
|
|
treeLoading: false,
|
|
treeLoading: false,
|
|
searchformShow: {},
|
|
searchformShow: {},
|
|
|
|
+ searchRules: {},
|
|
dialogVisible: false,
|
|
dialogVisible: false,
|
|
img: {
|
|
img: {
|
|
ship: require('@/assets/images/ship.png')
|
|
ship: require('@/assets/images/ship.png')
|
|
@@ -294,6 +295,7 @@ export default {
|
|
edition: '',
|
|
edition: '',
|
|
slipid: ''
|
|
slipid: ''
|
|
}
|
|
}
|
|
|
|
+ this.searchRules = {}
|
|
} else if (this.viewName == 'Personal') {
|
|
} else if (this.viewName == 'Personal') {
|
|
this.coursewareUpload = true
|
|
this.coursewareUpload = true
|
|
this.searchformShow = {
|
|
this.searchformShow = {
|
|
@@ -302,15 +304,15 @@ export default {
|
|
slipid: '',
|
|
slipid: '',
|
|
coursewareType: ''
|
|
coursewareType: ''
|
|
}
|
|
}
|
|
|
|
+ this.searchRules = this.createCoursewareRules()
|
|
} else {
|
|
} else {
|
|
this.coursewareUpload = true
|
|
this.coursewareUpload = true
|
|
this.searchformShow = {
|
|
this.searchformShow = {
|
|
subjectid: '',
|
|
subjectid: '',
|
|
resourceType: ''
|
|
resourceType: ''
|
|
}
|
|
}
|
|
|
|
+ this.searchRules = {}
|
|
}
|
|
}
|
|
- this.handleQuery(this.searchformShow)
|
|
|
|
- // this.getTreeselect();
|
|
|
|
this.getDicts('resource_type').then((response) => {
|
|
this.getDicts('resource_type').then((response) => {
|
|
this.typeOptions = response.data
|
|
this.typeOptions = response.data
|
|
})
|
|
})
|
|
@@ -584,15 +586,15 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
/** 搜索按钮操作 */
|
|
/** 搜索按钮操作 */
|
|
- handleQuery(data, type) {
|
|
|
|
|
|
+ async handleQuery(data, type) {
|
|
this.pageNum = 1
|
|
this.pageNum = 1
|
|
this.queryParams = Object.assign(this.queryParams, data)
|
|
this.queryParams = Object.assign(this.queryParams, data)
|
|
this.queryParams.wayType = data.wayType || '1'
|
|
this.queryParams.wayType = data.wayType || '1'
|
|
|
|
+ await this.getTreeselect(type)
|
|
this.getList()
|
|
this.getList()
|
|
- // this.getTreeselect()
|
|
|
|
},
|
|
},
|
|
/** 重置按钮操作 */
|
|
/** 重置按钮操作 */
|
|
- resetQuery(data) {
|
|
|
|
|
|
+ resetQuery(data, type) {
|
|
this.queryParams = data
|
|
this.queryParams = data
|
|
this.queryParams.chapterId = ''
|
|
this.queryParams.chapterId = ''
|
|
this.pageNum = 1
|
|
this.pageNum = 1
|
|
@@ -606,25 +608,12 @@ export default {
|
|
this.single = selection.length !== 1
|
|
this.single = selection.length !== 1
|
|
this.multiple = !selection.length
|
|
this.multiple = !selection.length
|
|
},
|
|
},
|
|
- formChange(data, type) {
|
|
|
|
- this.queryParams = data
|
|
|
|
- this.queryParams.wayType = data.wayType || '1'
|
|
|
|
- if (this.viewName == 'Index' && this.queryParams.wayType == 2) {
|
|
|
|
- this.searchformShow = {
|
|
|
|
- wayType: '1',
|
|
|
|
- subjectid: ''
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- this.searchformShow = {
|
|
|
|
- wayType: '1',
|
|
|
|
- subjectid: '',
|
|
|
|
- edition: '',
|
|
|
|
- slipid: '',
|
|
|
|
- coursewareType: '',
|
|
|
|
- resourceType: ''
|
|
|
|
- }
|
|
|
|
|
|
+ createCoursewareRules() {
|
|
|
|
+ return {
|
|
|
|
+ subjectid: [{ required: true, message: '科目必选' }],
|
|
|
|
+ edition: [{ required: true, message: '版本必选' }],
|
|
|
|
+ slipid: [{ required: true, message: '学册必选' }]
|
|
}
|
|
}
|
|
- if (type != 'coursewareType') this.getTreeselect(type)
|
|
|
|
},
|
|
},
|
|
/** 新增按钮操作 */
|
|
/** 新增按钮操作 */
|
|
handleAdd() {
|
|
handleAdd() {
|
|
@@ -699,9 +688,9 @@ export default {
|
|
this.exportLoading = false
|
|
this.exportLoading = false
|
|
})
|
|
})
|
|
},
|
|
},
|
|
-
|
|
|
|
/** 查询章节下拉树结构 */
|
|
/** 查询章节下拉树结构 */
|
|
- getTreeselect(type) {
|
|
|
|
|
|
+ async getTreeselect(type) {
|
|
|
|
+ if (type == 'coursewareType') return
|
|
if (this.queryParams.wayType == 1) {
|
|
if (this.queryParams.wayType == 1) {
|
|
if (
|
|
if (
|
|
(type != 'slipid' && type != 'wayType') ||
|
|
(type != 'slipid' && type != 'wayType') ||
|
|
@@ -722,14 +711,10 @@ export default {
|
|
this.deptOptions = []
|
|
this.deptOptions = []
|
|
if (!Ajax.gradeId) return
|
|
if (!Ajax.gradeId) return
|
|
this.treeLoading = true
|
|
this.treeLoading = true
|
|
- treeList(Ajax)
|
|
|
|
- .then((response) => {
|
|
|
|
- this.deptOptions = response.data
|
|
|
|
- this.treeLoading = false
|
|
|
|
- })
|
|
|
|
- .catch((response) => {
|
|
|
|
- this.treeLoading = false
|
|
|
|
- })
|
|
|
|
|
|
+ this.queryParams.chapterId = ''
|
|
|
|
+ const resTree = await treeList(Ajax)
|
|
|
|
+ this.deptOptions = resTree.data
|
|
|
|
+ this.treeLoading = false
|
|
} else {
|
|
} else {
|
|
if (
|
|
if (
|
|
(type != 'subjectid' && type != 'wayType') ||
|
|
(type != 'subjectid' && type != 'wayType') ||
|
|
@@ -747,15 +732,11 @@ export default {
|
|
this.KnowledgeOptions = []
|
|
this.KnowledgeOptions = []
|
|
if (!Ajax.subjectId) return
|
|
if (!Ajax.subjectId) return
|
|
this.treeLoading = true
|
|
this.treeLoading = true
|
|
- knowledgeTree(Ajax)
|
|
|
|
- .then((response) => {
|
|
|
|
- let list = this.filterData(response.data, 0)
|
|
|
|
- this.KnowledgeOptions = list
|
|
|
|
- this.treeLoading = false
|
|
|
|
- })
|
|
|
|
- .catch((response) => {
|
|
|
|
- this.treeLoading = false
|
|
|
|
- })
|
|
|
|
|
|
+ this.queryParams.chapterId = ''
|
|
|
|
+ const resTree = await knowledgeTree(Ajax)
|
|
|
|
+ let list = this.filterData(resTree.data, 0)
|
|
|
|
+ this.KnowledgeOptions = list
|
|
|
|
+ this.treeLoading = false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
filterData(data, index) {
|
|
filterData(data, index) {
|