diff --git a/src/utils/api.js b/src/utils/api.js index 5c5101d..f176971 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -102,12 +102,15 @@ export default { modelClassList: `${host}/nakadai/model/reference/modelClassList`, saveReferenceCategory: `${host}/nakadai/model/reference/saveReferenceCategory`, updateModelClass: `${host}/nakadai/model/reference/updateModelClass`, + checkIsShowBySystemId: `${host}/nakadai/model/reference/checkIsShowBySystemId`, + modifyIsShowState: `${host}/nakadai/model/reference/modifyIsShowState`, delModelInfoBySystemId: `${host}/nakadai/model/reference/demo/delModelInfoBySystemId`, deleteReferenceDemo: `${host}/nakadai/model/reference/demo/deleteReferenceDemo`, referenceFindById: `${host}/nakadai/model/reference/demo/findById`, saveReferenceDemo: `${host}/nakadai/model/reference/demo/saveReferenceDemo`, referenceDemoList: `${host}/nakadai/model/reference/demo/referenceDemoList`, + getAllModelList: `${host}/nakadai/model/reference/demo/getAllModelList`, deleteSourceModelCategory: `${host}/nakadai/model/category/deleteSourceModelCategory`, categorySave: `${host}/nakadai/model/category/save`, @@ -121,6 +124,7 @@ export default { sysModelDemoList: `${host}/nakadai/model/demo/sysModelDemoList`, updateSysModelDemo: `${host}/nakadai/model/demo/updateSysModelDemo`, runPythonCode: `${host}/nakadai/model/demo/runPythonCode`, + getAllModelListBySys: `${host}/nakadai/model/demo/getAllModelListBySys`, // 课程管理三级联查 courseDiscipline: `${host}/nakadai/nakadai/subject/courseDiscipline`, //课程学科类别 diff --git a/src/views/serve/backstage/model.vue b/src/views/serve/backstage/model.vue index 4277035..fda96e4 100644 --- a/src/views/serve/backstage/model.vue +++ b/src/views/serve/backstage/model.vue @@ -87,15 +87,28 @@ export default { mounted() {}, methods: { getData() { + const curNode = this.$refs.tree.$refs.tree.getCurrentNode() // 获取当前选中的分类 + // 如果是首级,要调另一个接口 + if (!curNode.level) { + this.$post(this.api.getAllModelList, { + pageNum: this.page, + pageSize: this.pageSize, + systemId: this.systemId + }).then(res => { + this.listData = res.data.records + this.total = res.data.total + }).catch(res => {}) + } else { this.$post(this.api.referenceDemoList, { - modelName: this.keyword, - pageNum: this.page, - pageSize: this.pageSize, - categoryId: this.$refs.tree.$refs.tree.getCurrentKey() + modelName: this.keyword, + pageNum: this.page, + pageSize: this.pageSize, + categoryId: curNode.id }).then(res => { - this.listData = res.data.records - this.total = res.data.total + this.listData = res.data.records + this.total = res.data.total }).catch(res => {}) + } }, initData() { this.$refs.table.clearSelection() @@ -138,7 +151,6 @@ export default { } }) e.children = [...e.children, ...modelChildren] - // console.log(11, e) resolve() }).catch(res => { reject() @@ -148,8 +160,6 @@ export default { }) } addType(data) - // debugger - console.log(data, promises) Promise.all(promises).then(_ => { this.modelData = data }).catch(res => {}) diff --git a/src/views/serve/backstage/modelType.vue b/src/views/serve/backstage/modelType.vue index 95b6b31..ed088cc 100644 --- a/src/views/serve/backstage/modelType.vue +++ b/src/views/serve/backstage/modelType.vue @@ -2,7 +2,7 @@
- +
同步原始模型列表 @@ -61,7 +61,7 @@ export default { data() { return { systemId: this.$route.query.systemId, - frontShow: false, + modelIsShow: false, orgList: [], typeVisible: false, Form: { @@ -82,8 +82,10 @@ export default { }, mounted() { this.getType() + this.getModelStatus() }, methods: { + // 获取分类 getType() { this.$post(`${this.api.modelClassList}?systemId=${this.systemId}`).then(res => { const { data } = res @@ -94,6 +96,16 @@ export default { }) }).catch(res => {}) }, + // 获取内置模型按钮展示状态 + getModelStatus() { + this.$post(`${this.api.checkIsShowBySystemId}?systemId=${this.systemId}`).then(res => { + this.modelIsShow = res.isShow // 0为展示 1为不展示 + }).catch(res => {}) + }, + // 改变内置模型按钮展示状态 + changeModelStatus(val) { + this.$post(`${this.api.modifyIsShowState}?systemId=${this.systemId}&isShow=${val}`).then(res => {}).catch(res => {}) + }, getSingle() { this.$emit('initData') }, @@ -124,10 +136,10 @@ export default { const systemId = this.systemId const promises = [] // 递归添加源模型分类及模型 - const addType = (list, refId) => { - list.map(e => { + const addType = async (list, refId) => { + for (const e of list) { // 用promise储存以添加完后更新数据 - promises.push(new Promise(async (resolve, reject) => { + // promises.push(new Promise(async (resolve, reject) => { // 新增分类 await this.$post(this.api.saveReferenceCategory, { id: '', @@ -159,18 +171,18 @@ export default { }) // 新增模型 this.$post(this.api.saveReferenceDemo, modelData).then(res => { - resolve() + // resolve() resolve1() }).catch(res => { - reject() + // reject() reject1() }) } else { - resolve() + // resolve() } e.children = [...e.children, ...records] }).catch(res => { - reject() + // reject() }) })) @@ -179,10 +191,10 @@ export default { e.children && e.children.length && addType(e.children, res.referenceCategoryId) }) }).catch(res => { - reject() + // reject() }) - })) - }) + // })) + } } addType(data[0].children, id) Promise.all(promises).then(_ => { diff --git a/src/views/serve/backstage/sourceModel.vue b/src/views/serve/backstage/sourceModel.vue index a427ca3..5bc85bf 100644 --- a/src/views/serve/backstage/sourceModel.vue +++ b/src/views/serve/backstage/sourceModel.vue @@ -13,7 +13,7 @@
- 新增 + 新增 批量删除 批量禁用 批量开启 @@ -51,12 +51,13 @@ import org from "./sourceType" export default { data() { return { - listData: [], // 员工列表数据 - keyword: "", - page: 1, - pageSize: 10, - total: 0, - multipleSelection: [] + isTopLevel: true, // 是否是在顶级分类 + listData: [], + keyword: "", + page: 1, + pageSize: 10, + total: 0, + multipleSelection: [] }; }, components: { @@ -76,15 +77,28 @@ export default { methods: { // 获取列表 getData() { + const curNode = this.$refs.tree.$refs.tree.getCurrentNode() // 获取当前选中的分类 + this.isTopLevel = !curNode.level + // 如果是首级,要调另一个接口 + if (!curNode.level) { + this.$post(this.api.getAllModelListBySys, { + pageNum: this.page, + pageSize: this.pageSize + }).then(res => { + this.listData = res.data.records + this.total = res.data.total + }).catch(res => {}) + } else { this.$post(this.api.sysModelDemoList, { - modelName: this.keyword, - pageNum: this.page, - pageSize: this.pageSize, - categoryId: this.$refs.tree.$refs.tree.getCurrentKey() + modelName: this.keyword, + pageNum: this.page, + pageSize: this.pageSize, + categoryId: curNode.id }).then(res => { - this.listData = res.data.records - this.total = res.data.total + this.listData = res.data.records + this.total = res.data.total }).catch(res => {}) + } }, initData() { this.$refs.table.clearSelection() diff --git a/src/views/system/manageLog.vue b/src/views/system/manageLog.vue index 00d0fb7..1d6817b 100644 --- a/src/views/system/manageLog.vue +++ b/src/views/system/manageLog.vue @@ -1,45 +1,55 @@ @@ -127,9 +137,6 @@ export default { h6 { font-size: 18px; } - .filter { - margin-left: 100px; - } } .timeline { margin-left: 20%;