Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivManage
Commits
29c41829
Commit
29c41829
authored
Feb 21, 2023
by
涂伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: '1.新建表类型隐藏事件表;2.新建表字段校验内置字段逻辑优化;3.新建表校验提示样式优化'
parent
863630c9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
8 deletions
+16
-8
addTable.jsx
...bsmanager/base/tablemanager/components/Field/addTable.jsx
+4
-4
TableView.jsx
...ages/bsmanager/base/tablemanager/components/TableView.jsx
+7
-1
TableView.less
...ges/bsmanager/base/tablemanager/components/TableView.less
+1
-1
index.jsx
src/pages/bsmanager/base/tablemanager/index.jsx
+4
-2
No files found.
src/pages/bsmanager/base/tablemanager/components/Field/addTable.jsx
View file @
29c41829
...
...
@@ -40,7 +40,7 @@ const editor = props => {
if
(
validate
)
{
setLoading
(
true
);
let
obj
=
form
.
getFieldsValue
();
obj
.
tableName
=
obj
.
tableType
.
substr
(
0
,
obj
.
tableType
.
length
-
1
)
+
'_'
+
obj
.
tableName
;
obj
.
tableName
=
`
${
obj
.
tableType
.
substr
(
0
,
obj
.
tableType
.
length
-
1
)}
_
${
obj
.
tableName
}
`
;
createTable
({
...
obj
,
})
...
...
@@ -56,8 +56,8 @@ const editor = props => {
setChartName
(
res
.
data
.
tableInfo
.
Name
);
loadTableFields
({
tableName
:
res
.
data
.
tableInfo
.
Name
}).
then
(
response
=>
{
if
(
response
.
data
.
root
.
length
)
{
let
arr
=
[]
,
newArr
=
[];
let
arr
=
[]
;
let
newArr
=
[];
response
.
data
.
root
.
map
(
item
=>
{
newArr
.
push
(
item
.
fieldName
);
if
(
item
.
isCheck
)
{
...
...
@@ -185,7 +185,7 @@ const editor = props => {
{
...
props
}
onOk=
{
()
=>
onSubmit
()
}
confirmLoading=
{
loading
}
forceRender
=
{
true
}
forceRender
getContainer=
{
false
}
>
<
Form
form=
{
form
}
{
...
layout
}
>
...
...
src/pages/bsmanager/base/tablemanager/components/TableView.jsx
View file @
29c41829
...
...
@@ -62,6 +62,7 @@ const EditableCell = ({
width
,
dataSource
,
tableDataCount
,
defaultData
,
...
restProps
})
=>
{
const
[
editing
,
setEditing
]
=
useState
(
false
);
...
...
@@ -218,9 +219,13 @@ const EditableCell = ({
},
{
validator
:
(
rule
,
value
)
=>
{
let
list
=
JSON
.
parse
(
JSON
.
stringify
(
dataSource
));
// 合并内置字段
if
(
value
&&
dataSource
.
some
((
item
,
i
)
=>
item
.
Name
===
value
&&
item
.
keyIndex
!==
record
.
keyIndex
)
[...
defaultData
,
...
list
].
some
(
(
item
,
i
)
=>
item
.
Name
===
value
&&
item
.
keyIndex
!==
record
.
keyIndex
,
)
)
{
return
Promise
.
reject
(
new
Error
(
'字段名称重复,请重新输入'
));
}
...
...
@@ -643,6 +648,7 @@ const TableView = props => {
align
:
col
.
align
,
dataSource
,
tableDataCount
,
defaultData
,
handleSave
,
}),
};
...
...
src/pages/bsmanager/base/tablemanager/components/TableView.less
View file @
29c41829
...
...
@@ -39,7 +39,7 @@
// width: 180px;
padding: 0 5px;
background-color: #ff4d4f;
top:
-5
0px;
top:
4
0px;
left: 50%;
transform: translateX(-50%);
border-radius: 5px;
...
...
src/pages/bsmanager/base/tablemanager/index.jsx
View file @
29c41829
...
...
@@ -96,8 +96,10 @@ const TableManager = props => {
GetDefaultTableFields
().
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
let
list
=
[];
setDefaultFieldsList
(
res
.
data
);
res
.
data
.
forEach
(
item
=>
{
// 过滤掉事件表
let
resList
=
res
.
data
.
filter
(
item
=>
item
.
value
!==
'事件表'
);
setDefaultFieldsList
(
resList
);
resList
.
forEach
(
item
=>
{
list
.
push
(
item
.
value
);
});
setDefaultFields
(
list
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment