From d3385102f2793ac607db394166dfbd7e04410ed4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=87=AA=E5=B8=A6=E5=A4=A7=E4=BD=AC=E6=B0=94=E5=9C=BA?=
<188633308@qq.com>
Date: Thu, 17 Jun 2021 18:07:33 +0800
Subject: [PATCH] =?UTF-8?q?update=20=E5=A4=A7=E9=87=8F=E7=BB=86=E8=8A=82?=
=?UTF-8?q?=E5=A4=84=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/assets/style/lib/authority-view.less | 7 +-
.../src/assets/style/lib/text-color.less | 3 +
.../src/components/authority-view/index.jsx | 196 ++++++++---------
.../src/components/icon-selector/index.jsx | 6 +-
web-react/src/components/image/index.jsx | 10 +-
web-react/src/components/modal-form/index.jsx | 102 ++++-----
web-react/src/components/query-list/index.jsx | 82 +++----
.../components/query-table-actions/index.jsx | 34 +--
.../src/components/query-table/index.jsx | 96 ++++-----
.../components/query-tree-layout/index.jsx | 200 +++++++++---------
web-react/src/pages/system/app/index.jsx | 66 +++---
.../src/views/main/_layout/content/index.jsx | 15 +-
12 files changed, 424 insertions(+), 393 deletions(-)
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 (
+