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
4f245ab1
Commit
4f245ab1
authored
Nov 29, 2022
by
邓超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改规则光标bug
parent
c1228a00
Pipeline
#64659
passed with stages
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
9 deletions
+18
-9
index.jsx
src/components/RuleConfig/index.jsx
+11
-7
ConfigSubprocess.jsx
...wChartComponents/nodeModalComponents/ConfigSubprocess.jsx
+7
-2
No files found.
src/components/RuleConfig/index.jsx
View file @
4f245ab1
...
@@ -14,13 +14,22 @@ const RuleConfig = props => {
...
@@ -14,13 +14,22 @@ const RuleConfig = props => {
const
[
expandedKey
,
setExpandedKey
]
=
useState
(
''
);
// 默认展开项
const
[
expandedKey
,
setExpandedKey
]
=
useState
(
''
);
// 默认展开项
const
[
currentSelectId
,
setCurrentSelectId
]
=
useState
(
''
);
// 选中得节点
const
[
currentSelectId
,
setCurrentSelectId
]
=
useState
(
''
);
// 选中得节点
const
ruleText
=
useRef
();
const
ruleText
=
useRef
();
const
chooseIndex
=
useRef
(
0
);
const
[
form
]
=
Form
.
useForm
();
const
[
form
]
=
Form
.
useForm
();
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
visible
)
{
if
(
visible
)
{
console
.
log
(
fieldList
,
'fieldList'
);
console
.
log
(
fieldList
,
'fieldList'
);
setExpandedKey
(
fieldList
[
0
].
TableName
);
setExpandedKey
(
fieldList
[
0
].
TableName
);
setRule
(
RuleContent
);
setRule
(
RuleContent
);
setTimeout
(()
=>
{
console
.
log
(
document
.
getElementById
(
'ruleText'
));
console
.
log
(
ruleText
.
current
);
document
.
getElementById
(
'ruleText'
)
.
setSelectionRange
(
RuleContent
.
length
,
RuleContent
.
length
);
// 重新定位光标
},
0
);
}
else
{
}
else
{
chooseIndex
.
current
=
0
;
setExpandedKey
(
''
);
setExpandedKey
(
''
);
setCurrentSelectId
(
''
);
setCurrentSelectId
(
''
);
setRule
(
''
);
setRule
(
''
);
...
@@ -54,17 +63,12 @@ const RuleConfig = props => {
...
@@ -54,17 +63,12 @@ const RuleConfig = props => {
setCurrentSelectId
(
prop
[
0
]);
setCurrentSelectId
(
prop
[
0
]);
};
};
const
insert
=
text
=>
{
const
insert
=
text
=>
{
let
ednIndex
=
document
.
getElementById
(
'ruleText'
).
selectionEnd
;
let
rangeIndex
=
document
.
getElementById
(
'ruleText'
).
selectionStart
;
let
rangeIndex
=
document
.
getElementById
(
'ruleText'
).
selectionStart
;
if
(
rangeIndex
>
0
)
{
console
.
log
(
ednIndex
,
rangeIndex
,
'endene'
);
// console.log(document.getElementById('ruleText').hasFocus());
setRule
(
`
${
rule
.
slice
(
0
,
rangeIndex
)}
${
text
}
${
rule
.
slice
(
rangeIndex
)}
`
);
setRule
(
`
${
rule
.
slice
(
0
,
rangeIndex
)}
${
text
}
${
rule
.
slice
(
rangeIndex
)}
`
);
rangeIndex
+=
text
.
toString
().
length
;
rangeIndex
+=
text
.
toString
().
length
;
ruleText
.
current
.
focus
();
ruleText
.
current
.
focus
();
document
.
getElementById
(
'ruleText'
).
setSelectionRange
(
rangeIndex
,
rangeIndex
);
// 重新定位光标
}
else
{
setRule
(
`
${
rule
}
${
text
}
`
);
ruleText
.
current
.
focus
();
}
};
};
const
insertFn
=
value
=>
{
const
insertFn
=
value
=>
{
insert
(
value
);
insert
(
value
);
...
...
src/pages/bsmanager/workOrder/workflowEdit/workFlowComponents/flowChartComponents/nodeModalComponents/ConfigSubprocess.jsx
View file @
4f245ab1
...
@@ -41,7 +41,11 @@ const ConfigSubprocess = (props, ref) => {
...
@@ -41,7 +41,11 @@ const ConfigSubprocess = (props, ref) => {
console
.
log
(
editMsg
,
'editMsg'
);
console
.
log
(
editMsg
,
'editMsg'
);
form
.
setFieldsValue
({
flowKey
:
''
,
MapFields
:
[]
});
form
.
setFieldsValue
({
flowKey
:
''
,
MapFields
:
[]
});
if
(
editMsg
.
SubFlowInfo
)
{
if
(
editMsg
.
SubFlowInfo
)
{
GetFlowMapFields
({
flowID
,
subFlowID
:
editMsg
.
SubFlowInfo
?.
SubFlowID
}).
then
(
res
=>
{
GetFlowMapFields
({
flowID
,
subFlowID
:
editMsg
.
SubFlowInfo
?.
SubFlowID
,
subFlowID
:
editMsg
.
SubFlowInfo
?.
SubFlowEventConfigID
,
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
res
.
data
.
ParentFlowMapList
.
forEach
(
item
=>
{
res
.
data
.
ParentFlowMapList
.
forEach
(
item
=>
{
item
.
TableFieldNames
=
item
.
TableFieldNames
.
map
(
ele
=>
({
item
.
TableFieldNames
=
item
.
TableFieldNames
.
map
(
ele
=>
({
...
@@ -104,8 +108,9 @@ const ConfigSubprocess = (props, ref) => {
...
@@ -104,8 +108,9 @@ const ConfigSubprocess = (props, ref) => {
console.log(e);
console.log(e);
form.setFieldsValue({ MapFields: [] });
form.setFieldsValue({ MapFields: [] });
const subFlowID = e.split('-')[1];
const subFlowID = e.split('-')[1];
const SubFlowEventConfigID = e.split('-')[0];
console.log(subFlowID, 'afsdfsda');
console.log(subFlowID, 'afsdfsda');
GetFlowMapFields({ flowID, subFlowID }).then(res => {
GetFlowMapFields({ flowID, subFlowID
, SubFlowEventConfigID
}).then(res => {
if (res.code === 0) {
if (res.code === 0) {
res.data.ParentFlowMapList.forEach(item => {
res.data.ParentFlowMapList.forEach(item => {
item.TableFieldNames = item.TableFieldNames.map(ele => ({
item.TableFieldNames = item.TableFieldNames.map(ele => ({
...
...
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