diff --git a/src/utils/api.js b/src/utils/api.js
index 691bcfc..475d300 100644
--- a/src/utils/api.js
+++ b/src/utils/api.js
@@ -99,9 +99,15 @@ export default {
updateProjectJudgment: `${host}/occupationlab/projectJudgment/updateProjectJudgment`, // 判分点中间表批量更新
deleteProjectJudgment: `${host}/occupationlab/projectJudgment/deleteProjectJudgment`, // 判分点中间表批量删除
// 系统后台
+ deleteModelClass: `${host}/nakadai/model/reference/deleteModelClass`,
+ modelClassList: `${host}/nakadai/model/reference/modelClassList`,
+ saveReferenceCategory: `${host}/nakadai/model/reference/saveReferenceCategory`,
+ updateModelClass: `${host}/nakadai/model/reference/updateModelClass`,
+
deleteSourceModelCategory: `${host}/nakadai/model/category/deleteSourceModelCategory`,
categorySave: `${host}/nakadai/model/category/save`,
sourceModelClassification: `${host}/nakadai/model/category/sourceModelClassification`,
+ updateSourceModelCategory: `${host}/nakadai/model/category/updateSourceModelCategory`,
bulkDisable: `${host}/nakadai/model/demo/bulkDisable`,
deleteSysModelDemo: `${host}/nakadai/model/demo/deleteSysModelDemo`,
diff --git a/src/views/serve/backstage/modelType.vue b/src/views/serve/backstage/modelType.vue
index 52a44e6..1bc6531 100644
--- a/src/views/serve/backstage/modelType.vue
+++ b/src/views/serve/backstage/modelType.vue
@@ -1,20 +1,21 @@
+
+
+
同步原始模型列表
- 添加
+ 添加
@@ -23,33 +24,32 @@
handleEdit(node, data)">
+ @click="editType(data)">
handleAdd(node, data)">
+ @click="addType(node, data)">
handleDel(node, data)">
+ @click="delType(data)">
-
+
-
-
+
+
@@ -60,12 +60,15 @@ export default {
props: ["Data"],
data() {
return {
+ systemId: this.$route.query.systemId,
+ frontShow: false,
orgList: [],
typeVisible: false,
- depVisible: false,
Form: {
+ id: '',
parentId: '',
- categoryName: ''
+ categoryName: '',
+ level: ''
},
rules: {
categoryName: [
@@ -78,286 +81,93 @@ export default {
OrgTree
},
mounted() {
- // this.getStaff()
+ this.getType()
},
methods: {
- getStaff() {
- this.$post(this.api.sourceModelClassification).then(res => {
- this.orgList = res.data
+ getType() {
+ this.$post(`${this.api.modelClassList}?systemId=${this.systemId}`).then(res => {
+ const { data } = res
+ this.orgList = data
+ data.length && this.$nextTick(() => {
+ this.$refs.tree.setCurrentKey(data[0].id)
+ this.getSingle()
+ })
}).catch(res => {})
},
- closeAdd() {
- this.$refs.Form.resetFields()
- },
- getSingle(data) {
- this.$emit('getSingle', data)
- },
- getCheck(data, checked) {
- this.$emit('getCheck', checked.checkedNodes)
- },
- // 新增编辑专业
- addMajor() {
- this.Form.staffArchitectureId = ''
- this.Form.staffArchitectureName = ''
- this.typeVisible = true
+ getSingle() {
+ this.$emit('initData')
},
// 同步原始模型
syncModel() {
- this.$confirm('同步后当前的组织架构将会被删除,是否继续?', '提示', {
- type: "warning"
- }).then(() => {
- // let ids = this.multipleSelection.map(item => {
- // return item.accountId;
- // });
- // this.$post(`${this.api.delStaff}?accountIds=${ids.toString()}`).then(res => {
- // this.$refs.table.clearSelection();
- // this.$message.success("删除成功");
- // this.getData();
- // }).catch(res => {})
- }).catch(() => {})
- },
- sure(Form) { // 提交新增/修改专业
- this.$refs[Form].validate((valid) => {
- if (valid) {
- let data = {
- staffArchitectureName: this.Form.staffArchitectureName,
- staffArchitectureId: this.Form.staffArchitectureId,
- isDel: 0 // 是否删除(0、未删除 1、已删除)
- };
- if (this.Form.staffArchitectureId) {
- this.$post(this.api.updateProfessional, data).then(res => {
- this.$message.success("编辑成功");
- this.typeVisible = false;
- this.orgList.map(e => {
- if (e.staffArchitectureId == this.Form.staffArchitectureId) {
- e.staffArchitectureName = this.Form.staffArchitectureName;
- e.label = this.Form.staffArchitectureName;
- }
- });
- this.$emit("getData");
- }).catch(res => {
- });
- } else {
- this.$post(this.api.saveProfessional, data).then(res => {
- this.$message.success("添加成功");
- this.typeVisible = false;
- let newData = {
- staffArchitectureId: res.staffArchitectureId,
- staffArchitectureName: this.Form.staffArchitectureName,
- label: this.Form.staffArchitectureName,
- value: res.staffArchitectureId,
- ifVisible: false,
- ischeck: false,
- children: []
- };
- this.orgList.push(newData);
- }).catch(res => {
- });
- }
- } else {
- return false;
- }
- });
+
},
- handleAdd(node, data) { // 添加分类
+ // 添加分类
+ addType(node, data) {
this.typeVisible = true
- this.Form.parentId = data.id
+ this.Form.parentId = data ? data.id : 0
+ this.Form.level = node ? node.level : 0
},
- handleEdit(node, data) { // 编辑分类
- if (node.level === 1) {
- this.Form.staffArchitectureId = data.staffArchitectureId
- this.Form.staffArchitectureName = data.staffArchitectureName
- this.typeVisible = true
- } else {
- this.Form.gradeId = data.gradeId
- this.Form.gradeName = data.gradeName
- this.depVisible = true
- }
- for (let j = 0; j < this.orgList.length; j++) {
- for (let k = 0; k < this.orgList[j].children.length; k++) {
- if (this.orgList[j].children[k].gradeName == data.gradeName) {
- this.Form.staffArchitectureId = this.orgList[j].staffArchitectureId;
- }
- }
- }
+ // 编辑分类
+ editType(data) {
+ this.Form.id = data.id
+ this.Form.categoryName = data.categoryName
+ this.typeVisible = true
},
- sureDepartment(Form) { // 提交新增编辑分类
- this.$refs[Form].validate((valid) => {
+ // 保存分类
+ submit() {
+ this.$refs['Form'].validate((valid) => {
if (valid) {
- let data = {
- gradeId: this.Form.gradeId,
- gradeName: this.Form.gradeName,
- staffArchitectureId: this.Form.staffArchitectureId
- };
- if (this.Form.gradeId) {
- this.$post(this.api.updateGrade, data).then(res => {
- this.$message.success("编辑成功");
- this.depVisible = false;
- this.orgList.map(e => {
- e.children.map(r => {
- if (r.gradeId == this.Form.gradeId) {
- r.gradeName = this.Form.gradeName;
- r.label = this.Form.gradeName;
- }
- });
- });
- }).catch(res => {
- });
+ const form = this.Form
+ const data = {
+ id: form.id,
+ categoryName: form.categoryName,
+ systemId: this.systemId
+ }
+ if (data.id) {
+ this.$post(this.api.updateModelClass, data).then(res => {
+ this.$message.success("编辑成功")
+ this.typeVisible = false
+ this.getType()
+ }).catch(res => {})
} else {
- this.$post(this.api.saveGrade, data).then(res => {
- this.$message.success("添加成功");
- this.depVisible = false;
- let newData = {
- gradeId: res.gradeId,
- gradeName: this.Form.gradeName,
- label: this.Form.gradeName,
- value: res.gradeId,
- ifVisible: false,
- ischeck: false
- };
- this.orgList.map(e => {
- if (e.staffArchitectureId == this.Form.staffArchitectureId) {
- e.ifVisible = true;
- e.children.push(newData);
- }
- });
- }).catch(res => {
- });
+ data.level = form.level
+ data.parentId = form.parentId
+ this.$post(this.api.saveReferenceCategory, data).then(res => {
+ this.$message.success("添加成功")
+ this.typeVisible = false
+ this.getType()
+ }).catch(res => {})
}
- } else {
- return false;
}
- });
- },
- handleDel(node, data) {
- node.level === 1 ? this.delMajor(data) : this.delDepartment(data)
+ })
},
- delMajor(item) {
- this.$confirm("确定要删除该专业吗?该操作将会删除该组织下的用户账号。", "提示", {
- type: "warning"
- }).then(() => {
- this.$post(`${this.api.deleteProfessional}?staffArchitectureId=${item.staffArchitectureId}`).then(res => {
- this.$message.success("删除成功")
- this.$emit("getData")
- this.getStaff()
- }).catch(res => {})
- }).catch(() => {})
+ closeDia() {
+ this.$refs.Form.resetFields()
+ this.Form = {
+ id: '',
+ parentId: '',
+ categoryName: ''
+ }
},
- delDepartment(item) {
- this.$confirm("确定要删除该分类吗?该操作将会删除该组织下的用户账号。", "提示", {
+ // 删除分类
+ delType(item) {
+ this.$confirm("确定要删除分类吗?", "提示", {
type: "warning"
}).then(() => {
- this.$post(`${this.api.deleteGrade}?gradeId=${item.gradeId}`).then(res => {
+ this.$post(`${this.api.deleteModelClass}?categoryId=${item.id}`).then(res => {
this.$message.success("删除成功")
- this.getStaff()
- this.$emit("delDep", item, this.orgList)
this.$emit("getData")
+ this.getType()
}).catch(res => {})
}).catch(() => {})
}
}
};
-
diff --git a/src/views/serve/backstage/sourceType.vue b/src/views/serve/backstage/sourceType.vue
index f880107..7a7f9b7 100644
--- a/src/views/serve/backstage/sourceType.vue
+++ b/src/views/serve/backstage/sourceType.vue
@@ -92,9 +92,6 @@ export default {
getSingle() {
this.$emit('initData')
},
- getCheck(data, checked) {
- this.$emit('getCheck', checked.checkedNodes)
- },
// 添加分类
addType(node, data) {
this.typeVisible = true
@@ -118,8 +115,7 @@ export default {
systemId: this.systemId
}
if (data.id) {
- debugger
- this.$post(this.api.updateProfessional, data).then(res => {
+ this.$post(this.api.updateSourceModelCategory, data).then(res => {
this.$message.success("编辑成功")
this.typeVisible = false
this.getType()
@@ -159,106 +155,6 @@ export default {
}
};
-
diff --git a/src/views/system/log.vue b/src/views/system/log.vue
index c0ad681..b83800d 100644
--- a/src/views/system/log.vue
+++ b/src/views/system/log.vue
@@ -9,8 +9,7 @@
-
-
+
@@ -19,47 +18,17 @@
- 管理
+ 管理
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file