diff --git a/web-react/src/assets/style/lib/authority-view.less b/web-react/src/assets/style/lib/authority-view.less
index fac0029..7fd6b37 100644
--- a/web-react/src/assets/style/lib/authority-view.less
+++ b/web-react/src/assets/style/lib/authority-view.less
@@ -1,5 +1,10 @@
@import (reference) '../extend.less';
.yo-authority-view {
+ &--container {
+ >.ant-descriptions-view {
+ border: 0;
+ }
+ }
.ant-descriptions-item-label {
width: 150px;
}
@@ -11,7 +16,7 @@
}
.ant-descriptions-item-content {
padding: @padding-sm @padding-md;
- >.yo-authority-view--checkbox {
+ .yo-authority-view--checkbox {
display: inline-block;
width: 150px;
diff --git a/web-react/src/assets/style/lib/text-color.less b/web-react/src/assets/style/lib/text-color.less
index f1b835b..f1cd8ae 100644
--- a/web-react/src/assets/style/lib/text-color.less
+++ b/web-react/src/assets/style/lib/text-color.less
@@ -21,6 +21,9 @@
.text-warning {
color: @warning-color;
}
+.text-gray {
+ color: gray;
+}
.text-normal {
color: @normal-color;
}
diff --git a/web-react/src/components/authority-view/index.jsx b/web-react/src/components/authority-view/index.jsx
index 2fcddd7..adabbe9 100644
--- a/web-react/src/components/authority-view/index.jsx
+++ b/web-react/src/components/authority-view/index.jsx
@@ -3,6 +3,94 @@ import { Checkbox, Descriptions, Empty, Spin, Tooltip } from 'antd'
import { AntIcon } from 'components'
import { EMPTY_ID } from 'util/global'
+function generateList(data) {
+ data.forEach(item => {
+ if (item.children && item.children.length) {
+ generateList.call(this, item.children)
+ }
+ this.list.push(item)
+ })
+}
+
+function getVisible() {
+ const checked = this.list.filter(item => item.checked)
+ const caseChildren = checked.filter(item => item.visibleParent || item.type != 2)
+ const visibleParents = []
+ // 递归寻找父级
+ const findVisibleParents = (children) => {
+ const parents = []
+ children.forEach(item => {
+ if (item.parentId) {
+ const parent = this.list.find(item => item.id === item.parentId)
+ if (parent) {
+ parents.push(parent)
+ visibleParents.push(parent)
+ }
+ }
+ })
+ if (parents.length) {
+ findVisibleParents(parents)
+ }
+ }
+
+ findVisibleParents(caseChildren)
+
+ const checkedIds = checked.map(item => item.id)
+ const visibleParentsIds = visibleParents.map(item => item.id)
+
+ const result = checkedIds
+ visibleParentsIds.forEach(item => {
+ if (!result.includes(item)) {
+ result.push(item)
+ }
+ })
+
+ return result
+}
+
+function renderDescriptions(data) {
+ return data.map(item => {
+ return item.children && item.children.length ? renderItem.call(this, item) : renderCheckbox.call(this, item)
+ })
+}
+
+function renderItem(data) {
+ return (
+