添加离校环节编辑审核人及编辑负责人功能
diff --git a/leave-school-vue/src/mock/index.js b/leave-school-vue/src/mock/index.js
index 34a75e5..6faf31e 100644
--- a/leave-school-vue/src/mock/index.js
+++ b/leave-school-vue/src/mock/index.js
@@ -125,6 +125,13 @@
Mock.mock(/\/api\/procedures\/node\/create-node/, 'post', leaveschoolnodeApi.createData)
Mock.mock(/\/api\/procedures\/node\/delete-node/, 'delete', leaveschoolnodeApi.deleteData)
Mock.mock(/\/api\/procedures\/node\/get-item/, 'get', leaveschoolnodeApi.getItem)
+Mock.mock(/\/api\/procedures\/node\/get-user/, 'get', leaveschoolnodeApi.getUser)
+Mock.mock(/\/api\/procedures\/node\/auditor-list/, 'get', leaveschoolnodeApi.getAuditorList)
+Mock.mock(/\/api\/procedures\/node\/create-node-auditor/, 'post', leaveschoolnodeApi.createNodeAuditor)
+Mock.mock(/\/api\/procedures\/node\/delete-node-auditor/, 'delete', leaveschoolnodeApi.deleteNodeAuditor)
+Mock.mock(/\/api\/procedures\/node\/principal-list/, 'get', leaveschoolnodeApi.getPrincipalList)
+Mock.mock(/\/api\/procedures\/node\/create-node-principal/, 'post', leaveschoolnodeApi.createNodeAuditor)
+Mock.mock(/\/api\/procedures\/node\/delete-node-principal/, 'delete', leaveschoolnodeApi.deleteNodeAuditor)
// 用户管理
Mock.mock(/\/api\/system\/user\/list-api/, 'get', userApi.getPage)
diff --git a/leave-school-vue/src/mock/leaveschoolnode.js b/leave-school-vue/src/mock/leaveschoolnode.js
index 10c7257..914b82a 100644
--- a/leave-school-vue/src/mock/leaveschoolnode.js
+++ b/leave-school-vue/src/mock/leaveschoolnode.js
@@ -42,6 +42,47 @@
}
]
+const userList = [
+ {
+ 'id': '1',
+ 'xm': '张三',
+ 'xb': { 'value': 'male', 'label': '男' },
+ 'ghxh': '11'
+ },
+ {
+ 'id': '2',
+ 'xm': '李四',
+ 'xb': { 'value': 'female', 'label': '女' },
+ 'ghxh': '22'
+ }
+]
+
+const auditorList = [
+ {
+ 'id': '11',
+ 'auditNode': { 'id': '26', 'name': '后勤处' },
+ 'user': { 'id': '3', 'ghxh': '33', 'xm': '王五', 'xb': { 'value': 'male', 'label': '男' }}
+ },
+ {
+ 'id': '22',
+ 'auditNode': { 'id': '28', 'name': '图书馆' },
+ 'user': { 'id': '4', 'ghxh': '44', 'xm': '赵六', 'xb': { 'value': 'female', 'label': '女' }}
+ }
+]
+
+const principalList = [
+ {
+ 'id': '11',
+ 'auditNode': { 'id': '26', 'name': '后勤处' },
+ 'user': { 'id': '3', 'ghxh': '33', 'xm': '王六', 'xb': { 'value': 'male', 'label': '男' }}
+ },
+ {
+ 'id': '11',
+ 'auditNode': { 'id': '28', 'name': '图书馆' },
+ 'user': { 'id': '4', 'ghxh': '44', 'xm': '赵七', 'xb': { 'value': 'female', 'label': '女' }}
+ }
+]
+
export default{
getList: config => {
const { name, auditType, pageIndex = 1, pageSize = 20 } = param2Obj(config.url)
@@ -99,5 +140,97 @@
return {
code: 200
}
+ },
+ getUser: config => {
+ const { ghxh } = param2Obj(config.url)
+ const mockList = userList.filter(item => item.ghxh + '' === ghxh + '')
+ return {
+ data: mockList.length > 0 ? mockList[0] : null,
+ code: 200
+ }
+ },
+ getAuditorList: config => {
+ const { nodeId } = param2Obj(config.url)
+ const mockList = auditorList.filter(item => item.auditNode.id + '' === nodeId + '')
+ return {
+ items: mockList,
+ code: 200
+ }
+ },
+ createNodeAuditor: config => {
+ const nodeAuditor = JSON.parse(config.body)
+ if (!nodeAuditor.id) {
+ nodeAuditor.id = '' + parseInt(Math.random() * 100) + 1024 // mock a id
+ auditorList.unshift(nodeAuditor)
+ } else {
+ for (let i = 0; i < auditorList.length; i++) {
+ if (auditorList[i].id + '' === nodeAuditor.id + '') {
+ auditorList.splice(i, 1, nodeAuditor)
+ break
+ }
+ }
+ }
+ return {
+ item: nodeAuditor,
+ code: 200
+ }
+ },
+ deleteNodeAuditor: config => {
+ const nodeAuditor = JSON.parse(config.body)
+ let index = -1
+ for (let i = 0; i < auditorList.length; i++) {
+ if (auditorList[i].id + '' === nodeAuditor.id + '') {
+ index = i
+ break
+ }
+ }
+ if (index > -1) {
+ auditorList.splice(index, 1)
+ }
+ return {
+ code: 200
+ }
+ },
+ getPrincipalList: config => {
+ const { nodeId } = param2Obj(config.url)
+ const mockList = principalList.filter(item => item.auditNode.id + '' === nodeId + '')
+ return {
+ items: mockList,
+ code: 200
+ }
+ },
+ createNodePrincipal: config => {
+ const nodePrincipal = JSON.parse(config.body)
+ if (!nodePrincipal.id) {
+ nodePrincipal.id = '' + parseInt(Math.random() * 100) + 1024 // mock a id
+ principalList.unshift(nodePrincipal)
+ } else {
+ for (let i = 0; i < principalList.length; i++) {
+ if (principalList[i].id + '' === nodePrincipal.id + '') {
+ principalList.splice(i, 1, nodePrincipal)
+ break
+ }
+ }
+ }
+ return {
+ item: nodePrincipal,
+ code: 200
+ }
+ },
+ deleteNodePrincipal: config => {
+ const nodePrincipal = JSON.parse(config.body)
+ let index = -1
+ for (let i = 0; i < principalList.length; i++) {
+ if (principalList[i].id + '' === nodePrincipal.id + '') {
+ index = i
+ break
+ }
+ }
+ if (index > -1) {
+ principalList.splice(index, 1)
+ }
+ return {
+ code: 200
+ }
}
}