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
863630c9
Commit
863630c9
authored
2 years ago
by
涂伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: '维保模板SQL过滤规则优化'
parent
653dfdf1
Pipeline
#67727
failed with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
24 deletions
+1
-24
AddModal.jsx
...ages/bsmanager/patrolMaintenance/maintenance/AddModal.jsx
+1
-24
No files found.
src/pages/bsmanager/patrolMaintenance/maintenance/AddModal.jsx
View file @
863630c9
...
...
@@ -726,35 +726,12 @@ const AddModal = props => {
validator
:
(
rule
,
value
)
=>
{
let
filterValue
=
form
.
getFieldsValue
().
filterCondition
;
if
(
filterValue
)
{
let
filterArr
=
[];
filterArr
.
push
(
filterValue
.
indexOf
(
'+'
)
!=
-
1
);
filterArr
.
push
(
filterValue
.
indexOf
(
'='
)
!=
-
1
);
filterArr
.
push
(
filterValue
.
indexOf
(
'-'
)
!=
-
1
);
filterArr
.
push
(
filterValue
.
indexOf
(
'*'
)
!=
-
1
);
filterArr
.
push
(
filterValue
.
indexOf
(
'/'
)
!=
-
1
);
filterArr
.
push
(
filterValue
.
indexOf
(
'>'
)
!=
-
1
);
filterArr
.
push
(
filterValue
.
indexOf
(
'<'
)
!=
-
1
);
filterArr
.
push
(
filterValue
.
indexOf
(
'!='
)
!=
-
1
);
filterArr
.
push
(
filterValue
.
indexOf
(
'<='
)
!=
-
1
);
filterArr
.
push
(
filterValue
.
indexOf
(
'>-'
)
!=
-
1
);
// console.log(bb);
let
re
=
/
[
`~,.<>;:”“‘’
\/\[\]\、
{}()_@$%^,。;?
]
/
;
// console.log(re.test(aa));
if
(
filterValue
.
substring
(
0
,
3
)
!==
'and'
&&
filterValue
.
substring
(
0
,
3
)
!==
'AND'
)
{
return
Promise
.
reject
(
'请以and开头'
);
}
if
(
filterArr
.
indexOf
(
true
)
==
-
1
)
{
return
Promise
.
reject
(
'支持英文模式下运算符(+、-、*、/、>、<、=、!=、<=、>=)'
,
);
}
// if (re.test(aa))
{
// return Promise.reject('禁止输入特殊字符');
//
}
return
Promise
.
resolve
();
}
return
Promise
.
resolve
();
...
...
@@ -762,7 +739,7 @@ const AddModal = props => {
},
]
}
>
<
TextArea
placeholder=
"例如:and 泵房品牌='熊猫'"
/>
<
TextArea
placeholder=
"例如:and 泵房品牌='熊猫'
(SQL表达式)
"
/>
</
Item
>
</
Col
>
</
Row
>
...
...
This diff is collapsed.
Click to expand it.
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