refactor: 项目规范
This commit is contained in:
@@ -141,7 +141,7 @@ export default {
|
||||
getDeptDatas(tree, treeNode, resolve) {
|
||||
const params = { pid: tree.id }
|
||||
setTimeout(() => {
|
||||
crudDept.describeDeptList(params).then(res => {
|
||||
crudDept.queryDeptList(params).then(res => {
|
||||
resolve(res.content)
|
||||
})
|
||||
}, 100)
|
||||
@@ -161,7 +161,7 @@ export default {
|
||||
}
|
||||
},
|
||||
getSupDepts(id) {
|
||||
crudDept.describeDeptSuperiorTree(id, true).then(res => {
|
||||
crudDept.queryDeptSuperiorTree(id, true).then(res => {
|
||||
const data = res.content
|
||||
this.buildDepts(data)
|
||||
this.depts = data
|
||||
@@ -178,7 +178,7 @@ export default {
|
||||
})
|
||||
},
|
||||
getDepts() {
|
||||
crudDept.describeDeptList({ enabled: true }).then(res => {
|
||||
crudDept.queryDeptList({ enabled: true }).then(res => {
|
||||
this.depts = res.content.map(function(obj) {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
@@ -190,7 +190,7 @@ export default {
|
||||
// 获取弹窗内部门数据
|
||||
loadDepts({ action, parentNode, callback }) {
|
||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||
crudDept.describeDeptList({ enabled: true, pid: parentNode.id }).then(res => {
|
||||
crudDept.queryDeptList({ enabled: true, pid: parentNode.id }).then(res => {
|
||||
parentNode.children = res.content.map(function(obj) {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
|
||||
@@ -208,7 +208,7 @@ export default {
|
||||
}, 100)
|
||||
},
|
||||
getSupDepts(id) {
|
||||
crudMenu.describeMenuSuperior(id).then(res => {
|
||||
crudMenu.queryMenuSuperior(id).then(res => {
|
||||
const children = res.map(function(obj) {
|
||||
if (!obj.leaf && !obj.children) {
|
||||
obj.children = null
|
||||
|
||||
@@ -122,8 +122,8 @@
|
||||
|
||||
<script>
|
||||
import crudRoles from '@/api/system/role'
|
||||
import { describeDeptList, describeDeptSuperiorTree } from '@/api/system/dept'
|
||||
import { describeMenuListByPid, describeChildMenuSet } from '@/api/system/menu'
|
||||
import { queryDeptList, queryDeptSuperiorTree } from '@/api/system/dept'
|
||||
import { queryMenuListByPid, queryChildMenuSet } from '@/api/system/menu'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
@@ -168,7 +168,7 @@ export default {
|
||||
methods: {
|
||||
getMenuDatas(node, resolve) {
|
||||
setTimeout(() => {
|
||||
describeMenuListByPid(node.data.id ? node.data.id : 0).then(res => {
|
||||
queryMenuListByPid(node.data.id ? node.data.id : 0).then(res => {
|
||||
resolve(res)
|
||||
})
|
||||
}, 100)
|
||||
@@ -232,7 +232,7 @@ export default {
|
||||
},
|
||||
menuChange(menu) {
|
||||
// 获取该节点的所有子节点,id 包含自身
|
||||
describeChildMenuSet(menu.id).then(childIds => {
|
||||
queryChildMenuSet(menu.id).then(childIds => {
|
||||
// 判断是否在 menuIds 中,如果存在则删除,否则添加
|
||||
if (this.menuIds.indexOf(menu.id) !== -1) {
|
||||
for (let i = 0; i < childIds.length; i++) {
|
||||
@@ -284,7 +284,7 @@ export default {
|
||||
},
|
||||
// 获取部门数据
|
||||
getDepts() {
|
||||
describeDeptList({ enabled: true }).then(res => {
|
||||
queryDeptList({ enabled: true }).then(res => {
|
||||
this.depts = res.content.map(function(obj) {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
@@ -298,7 +298,7 @@ export default {
|
||||
depts.forEach(dept => {
|
||||
ids.push(dept.id)
|
||||
})
|
||||
describeDeptSuperiorTree(ids).then(res => {
|
||||
queryDeptSuperiorTree(ids).then(res => {
|
||||
const date = res.content
|
||||
this.buildDepts(date)
|
||||
this.depts = date
|
||||
@@ -317,7 +317,7 @@ export default {
|
||||
// 获取弹窗内部门数据
|
||||
loadDepts({ action, parentNode, callback }) {
|
||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||
describeDeptList({ enabled: true, pid: parentNode.id }).then(res => {
|
||||
queryDeptList({ enabled: true, pid: parentNode.id }).then(res => {
|
||||
parentNode.children = res.content.map(function(obj) {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
|
||||
@@ -183,8 +183,8 @@
|
||||
<script>
|
||||
import crudUser from '@/api/system/user'
|
||||
import { isvalidPhone } from '@/utils/validate'
|
||||
import { describeDeptList, describeDeptSuperiorTree } from '@/api/system/dept'
|
||||
import { describeRoleList, getLevel } from '@/api/system/role'
|
||||
import { queryDeptList, queryDeptSuperiorTree } from '@/api/system/dept'
|
||||
import { queryRoleList, getLevel } from '@/api/system/role'
|
||||
import { getAllJob } from '@/api/system/job'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
@@ -376,7 +376,7 @@ export default {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
getDepts() {
|
||||
describeDeptList({ enabled: true }).then(res => {
|
||||
queryDeptList({ enabled: true }).then(res => {
|
||||
this.depts = res.content.map(function(obj) {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
@@ -386,7 +386,7 @@ export default {
|
||||
})
|
||||
},
|
||||
getSupDepts(deptId) {
|
||||
describeDeptSuperiorTree(deptId).then(res => {
|
||||
queryDeptSuperiorTree(deptId).then(res => {
|
||||
const date = res.content
|
||||
this.buildDepts(date)
|
||||
this.depts = date
|
||||
@@ -405,7 +405,7 @@ export default {
|
||||
// 获取弹窗内部门数据
|
||||
loadDepts({ action, parentNode, callback }) {
|
||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||
describeDeptList({ enabled: true, pid: parentNode.id }).then(res => {
|
||||
queryDeptList({ enabled: true, pid: parentNode.id }).then(res => {
|
||||
parentNode.children = res.content.map(function(obj) {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
@@ -436,7 +436,7 @@ export default {
|
||||
},
|
||||
// 获取弹窗内角色数据
|
||||
getRoles() {
|
||||
describeRoleList().then(res => {
|
||||
queryRoleList().then(res => {
|
||||
this.roles = res
|
||||
}).catch(() => { })
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user