diff --git a/src/setting.js b/src/setting.js index 7e868c8..1f71347 100644 --- a/src/setting.js +++ b/src/setting.js @@ -13,9 +13,9 @@ if (isDev) { // jumpPath = "http://39.108.250.202/judgmentPoint/"; jumpPath = "http://192.168.31.125:8087/"; // 本地调试-需要启动本地判分点系统 // host = "http://www.huorantech.cn:9000";//线上 - host = "http://39.108.250.202:9000/";//测试 + // host = "http://39.108.250.202:9000/";//测试 // host = 'http://192.168.31.151:9000/'// 榕 - // host = 'http://192.168.31.137:9000'// 赓 + host = 'http://192.168.31.137:9000/'// 赓 } else if (isTest) { // jumpPath = "http://124.71.12.62/judgmentPoint/"; jumpPath = "http://39.108.250.202/judgmentPoint/"; diff --git a/src/utils/api.js b/src/utils/api.js index 7656723..c56cd8c 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -1,6 +1,7 @@ import Setting from "@/setting"; const uploadURL = Setting.uploadURL +const host = 'http://39.108.250.202:9000/' export default { @@ -217,17 +218,17 @@ export default { getKeywordByCategoryId: `data/keyword/getKeywordByCategoryId`, // 后台账号 - deleteArch: `nakadai/staffAccountArchitecture/delete`, - saveArch: `nakadai/staffAccountArchitecture/save`, - treeListArch: `nakadai/staffAccountArchitecture/treeList`, - updateArch: `nakadai/staffAccountArchitecture/update`, - delStaff: `nakadai/backstageStaff/delStaff`, - modifyStaff: `nakadai/backstageStaff/modifyStaff`, - saveStaff: `nakadai/backstageStaff/saveStaff`, - staffDetail: `nakadai/backstageStaff/staffDetail`, - staffList: `nakadai/backstageStaff/staffList`, - importStaff: `nakadai/backstageStaff/importStaff`, - exportFailure: `nakadai/backstageStaff/exportFailure`, + deleteArch: `${host}nakadai/staffAccountArchitecture/delete`, + saveArch: `${host}nakadai/staffAccountArchitecture/save`, + treeListArch: `${host}nakadai/staffAccountArchitecture/treeList`, + updateArch: `${host}nakadai/staffAccountArchitecture/update`, + delStaff: `${host}nakadai/backstageStaff/delStaff`, + modifyStaff: `${host}nakadai/backstageStaff/modifyStaff`, + saveStaff: `${host}nakadai/backstageStaff/saveStaff`, + staffDetail: `${host}nakadai/backstageStaff/staffDetail`, + staffList: `${host}nakadai/backstageStaff/staffList`, + importStaff: `${host}nakadai/backstageStaff/importStaff`, + exportFailure: `${host}nakadai/backstageStaff/exportFailure`, // 角色管理 batchRemove: `users/role/batchRemove`, //批量删除角色 diff --git a/src/views/Login.vue b/src/views/Login.vue index b0b03be..d6c44d2 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -75,7 +75,8 @@ - + +

依据国家政策法规,需绑定手机号进行网络实名才可登录使用本平台

@@ -424,4 +425,10 @@ img{ border-bottom: 0; background-color: transparent; } +.tips { + margin: -20px 0 20px 5px; + font-size: 14px; + text-align: center; + color: #666; +} \ No newline at end of file diff --git a/src/views/course/AddCurriculum.vue b/src/views/course/AddCurriculum.vue index 4a35cbf..db44aba 100644 --- a/src/views/course/AddCurriculum.vue +++ b/src/views/course/AddCurriculum.vue @@ -78,7 +78,7 @@ - + 1) { - this.$message.warning("最多只能选择一个系统!"); - return; } else { this.getConfigData(); this.configVisible = false; diff --git a/src/views/serve/addModel.vue b/src/views/serve/addModel.vue index 0261018..d7c34da 100644 --- a/src/views/serve/addModel.vue +++ b/src/views/serve/addModel.vue @@ -2,7 +2,7 @@
-
+
返回 @@ -66,9 +66,19 @@ export default { value: 'id' }, codeKey: 1, - submiting: false + submiting: false, + updateTime: 0 }; }, + watch: { + // 监听信息是否有更改,有的话页面离开的时候要询问是否要保存 + form: { + handler(){ + this.updateTime++ + }, + deep:true + }, + }, mounted() { this.getType() }, @@ -91,6 +101,7 @@ export default { list.map(e => { // 取得父级id跟子级id的集合 if (id === e.id) { + parentId.shift() // 全部的id要去掉 this.categoryIdCus = [...parentId, e.id] } else { e.children && this.handleId(e.children, id, [...parentId, e.id]) @@ -112,7 +123,7 @@ export default { }) } handleLeaf(data) - this.categoryList = data + this.categoryList = data[0].children if (this.id) { this.getData() } else { @@ -121,13 +132,13 @@ export default { }).catch(res => {}) }, // 保存 - submit(postStatus){ + submit(postStatus, fromBack){ if (this.submiting) return false const { modelName, categoryId, modelDemo } = this.form const categoryIdCus = this.categoryIdCus const id = this.id if (!modelName) return this.$message.error('请输入模型名称') - if (!categoryIdCus.length) return this.$message.error('请选择模型分类') + if (categoryIdCus[0] === 1) return this.$message.error('请选择模型分类') if (postStatus) { if (!modelDemo) return this.$message.error('请输入模型代码') } @@ -142,19 +153,41 @@ export default { data.id = id this.$post(this.api.updateSysModelDemo, data).then(res => { this.$message.success('编辑成功') - this.$router.back() + fromBack || this.$router.back() }).catch(res => { this.submiting = false }) } else { this.$post(this.api.saveSysModelDemo, data).then(res => { this.$message.success('新增成功') - this.$router.back() + fromBack || this.$router.back() }).catch(res => { this.submiting = false }) } }, + // 返回上一页 + backPage() { + this.$router.back() + }, + // 返回 + back() { + const id = this.id + const updateTime = this.updateTime + // 更改了信息才需要提示 + if ((id && updateTime > 1) || (!id && updateTime)) { + this.$confirm(`编辑的内容未保存,是否保存?`, '提示', { + type: 'warning' + }).then(() => { + this.submit(this.postStatus ? 1 : 0, 1) + this.backPage() + }).catch(() => { + this.backPage() + }) + } else { + this.backPage() + } + } } }; diff --git a/src/views/serve/backstage/index.vue b/src/views/serve/backstage/index.vue index f745b46..61d2897 100644 --- a/src/views/serve/backstage/index.vue +++ b/src/views/serve/backstage/index.vue @@ -9,7 +9,7 @@
- +
@@ -42,7 +42,8 @@ export default { path: 'backstage', query: { ...this.$route.query, - type: index + type: index, + categoryId: '' } }) }, diff --git a/src/views/serve/backstage/model.vue b/src/views/serve/backstage/model.vue index fef7277..75021f9 100644 --- a/src/views/serve/backstage/model.vue +++ b/src/views/serve/backstage/model.vue @@ -127,6 +127,7 @@ export default { // 导入模型 add() { if (!this.$refs.tree.orgList.length) return this.$message.error('请先添加模型分类') + if (this.isTopLevel) return this.$message.error('请选择子分类进入导入模型') this.modelVisible = true this.modelLoading = true // 获取模型列表,用以跟源模型列表作比对,重复的不再显示 @@ -163,7 +164,7 @@ export default { // 如果有未导入的模型,则添加到子级,否则设置为disabled if (modelChildren.length) { e.children = [...e.children, ...modelChildren] - } else { + } else if (records.length) { e.disabled = true } resolve() @@ -188,7 +189,7 @@ export default { } Promise.all(promises).then(_ => { data = handleType(data) - this.modelData = data + this.modelData = (data.length && data[0].children && data[0].children.length) ? data : [] this.modelLoading = false }).catch(res => {}) }).catch(res => {}) diff --git a/src/views/serve/backstage/modelType.vue b/src/views/serve/backstage/modelType.vue index 38ad741..42d6504 100644 --- a/src/views/serve/backstage/modelType.vue +++ b/src/views/serve/backstage/modelType.vue @@ -9,6 +9,7 @@ 添加
+
暂无数据,请点击添加按钮添加模型分类
@@ -91,7 +93,8 @@ export default { const { data } = res this.orgList = data data.length && this.$nextTick(() => { - this.$refs.tree.setCurrentKey(data[0].id) + const categoryId = this.$route.query.categoryId + this.$refs.tree.setCurrentKey(categoryId || data[0].id) this.getSingle() }) }).catch(res => {}) @@ -107,7 +110,14 @@ export default { this.$post(`${this.api.modifyIsShowState}?systemId=${this.systemId}&isShow=${val}`).then(res => {}).catch(res => {}) }, getSingle() { - this.$emit('initData') + this.$router.push({ + path: 'backstage', + query: { + ...this.$route.query, + categoryId: this.$refs.tree.getCurrentKey() + } + }).catch(err => {}) + this.$emit('initData') }, syncModelData() { // 同步原始模型前删除原有数据 @@ -128,25 +138,6 @@ export default { this.syncModelData() } }, - // 同步原始模型 - syncModel1() { - this.$confirm('同步后当前的组织架构将会被删除,是否继续?', '提示', { - type: 'warning' - }).then(() => { - // 同步原始模型前删除原有数据 - this.$post(`${this.api.delModelInfoBySystemId}?systemId=${this.systemId}`).then(res => { - // 先新增一个首级分类,固定分类名为全部 - this.$post(this.api.saveReferenceCategory, { - categoryName: '全部', - systemId: this.systemId, - level: 0, - parentId: 0 - }).then(res => { - this.addData(res.referenceCategoryId) - }).catch(res => {}) - }).catch(() => {}) - }).catch(() => {}) - }, // 添加分类和模型 async addData(id) { // 查询源模型分类 @@ -277,7 +268,7 @@ export default { }).then(() => { this.$post(`${this.api.deleteModelClass}?categoryId=${item.id}`).then(res => { this.$message.success("删除成功") - this.$emit("getData") + this.$emit('initData') this.getType() }).catch(res => {}) }).catch(() => {}) @@ -291,4 +282,10 @@ export default { margin-bottom: 5px; border-bottom: 1px solid #f0f0f0; } +.none { + margin-top: 20px; + text-align: center; + color: #909399; + font-size: 12px; +} diff --git a/src/views/serve/backstage/sourceType.vue b/src/views/serve/backstage/sourceType.vue index 6fa7eeb..7efd745 100644 --- a/src/views/serve/backstage/sourceType.vue +++ b/src/views/serve/backstage/sourceType.vue @@ -83,13 +83,21 @@ export default { const { data } = res this.orgList = data data.length && this.$nextTick(() => { - this.$refs.tree.setCurrentKey(data[0].id) + const categoryId = this.$route.query.categoryId + this.$refs.tree.setCurrentKey(categoryId || data[0].id) this.getSingle() }) }).catch(res => {}) }, getSingle() { - this.$emit('initData') + this.$router.push({ + path: 'backstage', + query: { + ...this.$route.query, + categoryId: this.$refs.tree.getCurrentKey() + } + }).catch(err => {}) + this.$emit('initData') }, // 添加分类 addType(node, data) { @@ -147,7 +155,7 @@ export default { }).then(() => { this.$post(`${this.api.deleteSourceModelCategory}?categoryId=${item.id}`).then(res => { this.$message.success("删除成功") - this.$emit("getData") + this.$emit('initData') this.getType() }).catch(res => {}) }).catch(() => {}) diff --git a/src/views/system/staff.vue b/src/views/system/staff.vue index d426915..25854c3 100644 --- a/src/views/system/staff.vue +++ b/src/views/system/staff.vue @@ -134,12 +134,6 @@ - - - - - -