diff --git a/src/layouts/header/index.vue b/src/layouts/header/index.vue index e55aed4..3d76b27 100644 --- a/src/layouts/header/index.vue +++ b/src/layouts/header/index.vue @@ -128,7 +128,7 @@ export default { }).then(res => { this.notices = res.notificationList }).catch(res => { }); - }, 1000) + }, 5000) } }, // 前往评论列表 diff --git a/src/pages/expSystem/backstage/index.vue b/src/pages/expSystem/backstage/index.vue index 968ec90..21dc01c 100644 --- a/src/pages/expSystem/backstage/index.vue +++ b/src/pages/expSystem/backstage/index.vue @@ -34,7 +34,7 @@ export default { systemId: this.$route.query.systemId, active: this.$route.query.type || 'model', tabs: { - model: "模型列表管理", + model: "本校模型列表管理", sourceModel: "源模型管理", compiler: '编译器管理' }, @@ -72,7 +72,8 @@ export default { ...this.$route.query, page: 1, type: index, - categoryId: '' + categoryId: '', + isSystem: 0 } }) }, diff --git a/src/pages/expSystem/backstage/model.vue b/src/pages/expSystem/backstage/model.vue index 506462f..796b318 100644 --- a/src/pages/expSystem/backstage/model.vue +++ b/src/pages/expSystem/backstage/model.vue @@ -56,7 +56,7 @@ - - + -->
暂无可导入的模型
@@ -162,7 +162,7 @@ export default { this.isTopLevel = !curNode.level // 如果是首级,要调另一个接口 if (this.isTopLevel) { - this.$post(this.api.teacherModelList, { + this.$post(this.api.getAllModelList, { founder: 1, modelName: this.keyword, pageNum: this.page, @@ -212,6 +212,15 @@ export default { if (this.isTopLevel) return this.$message.error('请选择子分类进入导入模型') this.modelVisible = true this.modelLoading = true + // 获取模型列表,用以跟源模型列表作比对,重复的不再显示 + const res = await this.$post(this.api.getAllModelList, { + founder: 1, + pageNum: 1, + pageSize: 10000, + systemId: this.systemId, + isOpen: 0 + }) + const modelList = res.data.records // 本校分类模型跟系统内置分类模型的接口不一样,分开处理 // 查询源模型分类 @@ -236,8 +245,10 @@ export default { const modelChildren = [] // 判重,重复的模型不再显示,通过模型的copyId和源模型的id作比对 records.map(n => { - n.categoryName = n.modelName - modelChildren.push(n) + if (!modelList.find(e => e.copyId === n.id)) { + n.categoryName = n.modelName + modelChildren.push(n) + } }) // 如果有未导入的模型,则添加到子级,否则设置为disabled if (modelChildren.length) { @@ -256,14 +267,14 @@ export default { addType(data) // 系统内置模型 - const res = await this.$post(`${this.api.builtInClassificationByNakadai}?systemId=${this.systemId}`) - addType(res.data, 1) + // const res = await this.$post(`${this.api.builtInClassificationByNakadai}?systemId=${this.systemId}`) + // addType(res.data, 1) Promise.all(promises).then(_ => { data = this.handleType(data) - const systemData = this.handleType(res.data) + // const systemData = this.handleType(res.data) this.schoolModels = (data.length && data[0].children && data[0].children.length) ? data : [] - this.systemModels = (systemData.length && systemData[0].children && systemData[0].children.length) ? systemData : [] + // this.systemModels = (systemData.length && systemData[0].children && systemData[0].children.length) ? systemData : [] this.modelLoading = false }).catch(res => { }) }, @@ -281,7 +292,7 @@ export default { // 查看模型 show (row) { - this.$router.push(`/addModel?categoryId=${this.$refs.tree.$refs.tree.getCurrentKey()}&id=${row.id}&show=1&model=1`) + this.$router.push(`addModel?categoryId=${this.$refs.tree.$refs.tree.getCurrentKey()}&id=${row.id}&show=1&model=1&founder=1`) }, // 删除模型 del (row) { @@ -330,9 +341,9 @@ export default { if (this.submiting) return false const data = [] const { systemId } = this - const { schoolModel, systemModel } = this.$refs - if (schoolModel || systemModel) { - const list = [...schoolModel.getCheckedNodes(), ...systemModel.getCheckedNodes()] // 获取选择的分类模型 + const { schoolModel } = this.$refs + if (schoolModel) { + const list = schoolModel.getCheckedNodes() // 获取选择的分类模型 const categoryId = this.$refs.tree.$refs.tree.getCurrentKey() // 获取当前分类 if (!list.length) return this.$message.error('请选择模型') this.submiting = true diff --git a/src/pages/expSystem/backstage/modelType.vue b/src/pages/expSystem/backstage/modelType.vue index d98b601..bd8a673 100644 --- a/src/pages/expSystem/backstage/modelType.vue +++ b/src/pages/expSystem/backstage/modelType.vue @@ -13,6 +13,7 @@ icon="el-icon-refresh" @click="syncModel">同步原始模型列表 添加 @@ -167,19 +168,19 @@ export default { * 然后接口会返回“全部”这个分类的id,然后把本校分类及模型全部加到全部这个分类下 */ const { id } = await this.$post(`${this.api.synchronizationMdelByOccupationlab}?systemId=${this.systemId}`) - - const { data } = await this.$post(this.api.sourceModelClassification + '?founder=1') // 本校分类 - this.handleCatetory(data[0].children, id) - Promise.all(this.promises).then(() => { - this.getType() - this.$router.push({ - path: 'backstage', - query: { - ...this.$route.query, - categoryId: '' - } - }) - }).catch(e => { }) + this.getType() + // const { data } = await this.$post(this.api.sourceModelClassification + '?founder=1') // 本校分类 + // this.handleCatetory(data[0].children, id) + // Promise.all(this.promises).then(() => { + // this.getType() + // this.$router.push({ + // path: 'backstage', + // query: { + // ...this.$route.query, + // categoryId: '' + // } + // }) + // }).catch(e => { }) }, // 递归添加分类及模型 handleCatetory (list, parentId) { diff --git a/src/pages/expSystem/backstage/sourceModel.vue b/src/pages/expSystem/backstage/sourceModel.vue index 8fa6660..34c1ea1 100644 --- a/src/pages/expSystem/backstage/sourceModel.vue +++ b/src/pages/expSystem/backstage/sourceModel.vue @@ -17,15 +17,17 @@ clearable> -
- 新增模型 - 批量删除 +
+ { }) + }).catch(res => { + this.getList() + }) }).catch(() => { }) } else { this.$message.error("请先选择模型 !") } }, // 本校禁用 - switchOff (val, row,) { + switchOff (val, row) { this.$post(this.api.disableModelDemo, [{ isOpen: val, modelId: row.id, type: 1 }]).then(res => { this.$message.success(val ? '禁用成功' : '启用成功') - }).catch(res => { }) + }).catch(res => { + this.getList() + }) }, // 系统内置禁用 switchOffSystem (val, row) { this.$post(this.api[val ? 'demoHiddenClose' : 'demoHiddenOpen'], [row.id]).then(res => { this.$message.success(val ? '禁用成功' : '启用成功') - }).catch(res => { }) + }).catch(res => { + this.getList() + }) }, handleSelectionChange (val) { this.multipleSelection = val diff --git a/src/pages/expSystem/backstage/sourceType.vue b/src/pages/expSystem/backstage/sourceType.vue index 3fabc14..baf062a 100644 --- a/src/pages/expSystem/backstage/sourceType.vue +++ b/src/pages/expSystem/backstage/sourceType.vue @@ -1,6 +1,17 @@