代码规范性调整

This commit is contained in:
蒋吉兆
2021-09-21 17:55:18 +08:00
parent 51e26a00a4
commit 2c06ca34c0
19 changed files with 32 additions and 33 deletions
+1 -1
View File
@@ -212,7 +212,7 @@ export default {
this.apis = val
},
async onDelete() {
const ids = this.apis.map(item => item.ID)
const ids = this.apis.forEach(item => item.ID)
const res = await deleteApisByIds({ ids })
if (res.code === 0) {
this.$message({
@@ -321,7 +321,7 @@ export default {
setAuthorityOptions(AuthorityData, optionsData, disabled) {
this.form.authorityId = String(this.form.authorityId)
AuthorityData &&
AuthorityData.map(item => {
AuthorityData.forEach(item => {
if (item.children && item.children.length) {
const option = {
authorityId: item.authorityId,
@@ -52,7 +52,7 @@ export default {
})
this.activeUserId = this.row.authorityId
this.apiTreeIds = []
res.data.paths && res.data.paths.map(item => {
res.data.paths && res.data.paths.forEach(item => {
this.apiTreeIds.push('p:' + item.path + 'm:' + item.method)
})
},
@@ -68,7 +68,7 @@ export default {
buildApiTree(apis) {
const apiObj = {}
apis &&
apis.map(item => {
apis.forEach(item => {
item.onlyId = 'p:' + item.path + 'm:' + item.method
if (Object.prototype.hasOwnProperty.call(apiObj, item.apiGroup)) {
apiObj[item.apiGroup].push(item)
@@ -91,7 +91,7 @@ export default {
async authApiEnter() {
const checkArr = this.$refs.apiTree.getCheckedNodes(true)
var casbinInfos = []
checkArr && checkArr.map(item => {
checkArr && checkArr.forEach(item => {
var casbinInfo = {
path: item.path,
method: item.method
@@ -45,7 +45,7 @@ export default {
this.authoritys = []
this.dataAuthorityId = []
this.roundAuthority(this.authority)
this.row.dataAuthorityId && this.row.dataAuthorityId.map(item => {
this.row.dataAuthorityId && this.row.dataAuthorityId.forEach(item => {
const obj = this.authoritys && this.authoritys.filter(au => au.authorityId === item.authorityId) && this.authoritys.filter(au => au.authorityId === item.authorityId)[0]
this.dataAuthorityId.push(obj)
})
@@ -74,7 +74,7 @@ export default {
},
getChildrenId(row, arrBox) {
arrBox.push(row.authorityId)
row.children && row.children.map(item => {
row.children && row.children.forEach(item => {
this.getChildrenId(item, arrBox)
})
},
@@ -87,7 +87,7 @@ export default {
},
// 平铺角色
roundAuthority(authoritys) {
authoritys && authoritys.map(item => {
authoritys && authoritys.forEach(item => {
const obj = {}
obj.authorityId = item.authorityId
obj.authorityName = item.authorityName
@@ -70,7 +70,7 @@ export default {
const res1 = await getMenuAuthority({ authorityId: this.row.authorityId })
const menus = res1.data.menus
const arr = []
menus.map(item => {
menus.forEach(item => {
// 防止直接选中父级造成全选
if (!menus.some(same => same.parentId === item.menuId)) {
arr.push(Number(item.menuId))
@@ -53,7 +53,7 @@
<template #default="scope">
<el-button size="mini" icon="el-icon-document" type="text" @click="toDetile(scope.row)">详情</el-button>
<el-button size="mini" icon="el-icon-edit" type="text" @click="updateSysDictionary(scope.row)">变更</el-button>
<el-popover v-model:visible="scope.row.visible" placement="top" width="160">
<el-popover :visible="scope.row.visible" placement="top" width="160">
<p>确定要删除吗?</p>
<div style="text-align: right; margin-top: 8px;">
<el-button size="mini" type="text" @click="scope.row.visible = false">取消</el-button>
@@ -49,7 +49,7 @@
<el-table-column align="center" label="按钮组">
<template #default="scope">
<el-button size="small" type="text" icon="el-icon-edit" @click="updateSysDictionaryDetail(scope.row)">变更</el-button>
<el-popover v-model:visible="scope.row.visible" placement="top" width="160">
<el-popover :visible="scope.row.visible" placement="top" width="160">
<p>确定要删除吗?</p>
<div style="text-align: right; margin-top: 8px;">
<el-button size="mini" type="text" @click="scope.row.visible = false">取消</el-button>
+1 -1
View File
@@ -277,7 +277,7 @@ export default {
},
setMenuOptions(menuData, optionsData, disabled) {
menuData &&
menuData.map(item => {
menuData.forEach(item => {
if (item.children && item.children.length) {
const option = {
title: item.meta.title,
@@ -91,7 +91,7 @@
</el-table-column>
<el-table-column align="center" label="按钮组">
<template #default="scope">
<el-popover v-model:visible="scope.row.visible" placement="top" width="160">
<el-popover :visible="scope.row.visible" placement="top" width="160">
<p>确定要删除吗?</p>
<div style="text-align: right; margin-top: 8px;">
<el-button size="mini" type="text" @click="scope.row.visible = false">取消</el-button>
@@ -168,7 +168,7 @@ export default {
async onDelete() {
const ids = []
this.multipleSelection &&
this.multipleSelection.map(item => {
this.multipleSelection.forEach(item => {
ids.push(item.ID)
})
const res = await deleteSysOperationRecordByIds({ ids })
+3 -3
View File
@@ -29,7 +29,7 @@
</el-table-column>
<el-table-column align="center" label="操作" min-width="150">
<template #default="scope">
<el-popover v-model:visible="scope.row.visible" placement="top" width="160">
<el-popover :visible="scope.row.visible" placement="top" width="160">
<p>确定要删除此用户吗</p>
<div style="text-align: right; margin-top: 8px;">
<el-button size="mini" type="text" @click="scope.row.visible = false">取消</el-button>
@@ -162,7 +162,7 @@ export default {
methods: {
setAuthorityIds() {
this.tableData && this.tableData.forEach((user) => {
const authorityIds = user.authorities && user.authorities.map(i => {
const authorityIds = user.authorities && user.authorities.forEach(i => {
return i.authorityId
})
user.authorityIds = authorityIds
@@ -177,7 +177,7 @@ export default {
},
setAuthorityOptions(AuthorityData, optionsData) {
AuthorityData &&
AuthorityData.map(item => {
AuthorityData.forEach(item => {
if (item.children && item.children.length) {
const option = {
authorityId: item.authorityId,