Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
psbc_remit
Overview
Overview
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
qianyuheng
psbc_remit
Commits
53922b4e
Commit
53922b4e
authored
Jul 27, 2020
by
YuMengShuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加Ptspta2组件
parent
de29e94a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
153 additions
and
0 deletions
+153
-0
Ptspta2.js
src/views/Public/Ptspta2.js
+153
-0
No files found.
src/views/Public/Ptspta2.js
0 → 100644
View file @
53922b4e
import
React
,
{
Component
,
Fragment
}
from
'react'
import
{
Page
,
Validator
,
Notification
,
FormItem
,
InputItem
,
Input
,
Bind
,
SelectItem
,
Button
,
Label
,
DatePickerItem
,
Section
,
Table
,
TextAreaItem
,
ConfirmButton
,
Steps
}
from
'@/components/Common-Library'
import
Api
from
'@/service/api'
import
CodeTableFactory
from
'@/components/CodeTable'
import
"./index.less"
import
{
inject
,
observer
}
from
'mobx-react'
import
{
action
,
observable
}
from
'mobx'
import
{
Row
,
Col
,
Popconfirm
,
Modal
}
from
'antd'
;
import
{
PtyPicker
}
from
'@/components/Business-Library'
import
{
Link
,
withRouter
}
from
'react-router-dom'
const
{
Pre
,
Next
,
StepWrapper
}
=
Steps
const
CodeTable
=
CodeTableFactory
.
getInstance
()
const
confirm
=
Modal
.
confirm
@
withRouter
@
inject
(
'UserContext'
)
@
inject
(
'i18n'
)
@
observer
export
default
class
PtsptaScreen
extends
Component
{
@
observable
formBlur
=
false
constructor
(
props
)
{
super
(
props
)
this
.
model
=
props
.
model
this
.
bind
=
Bind
.
bind
(
this
)
}
async
componentWillMount
()
{
}
componentWillUnmount
()
{
//this.model.closeValidate()//关闭校验
}
// 1,将字符串val按照 \n 截取为多个字符串保存到数组中
// 2,将数组中长度超过指定长度的字符串分成两个字符串保存到数组中,将长度为0的字符串从数组中删除掉
// 3,将数组以 \n 为连接点 重新 组装成字符串
// 4,将得到的字符串赋值给 this.model..... 进行显示
hasCharOfArray
=
(
array
,
char
)
=>
{
for
(
let
i
=
0
;
i
<
array
.
length
;
i
++
)
{
if
(
char
==
array
[
i
])
{
return
true
;
}
}
return
false
;
}
huan
=
(
val
)
=>
{
const
allowChar
=
[
'.'
,
','
,
'-'
,
'('
,
')'
,
'/'
,
'='
,
"'"
,
'+'
,
':'
,
'?'
,
'!'
,
'"'
,
'%'
,
'&'
,
'*'
,
'<'
,
'>'
,
';'
,
'{'
,
'@'
,
'#'
,
'_'
,
'
\
n'
,
' '
,
'
\
r'
];
for
(
let
i
=
0
;
i
<
val
.
length
;
i
++
)
{
if
(
(
(
val
.
charCodeAt
(
i
)
>=
'0'
.
charCodeAt
(
0
)
&&
val
.
charCodeAt
(
i
)
<=
'9'
.
charCodeAt
(
0
))
||
(
val
.
charCodeAt
(
i
)
>=
'a'
.
charCodeAt
(
0
)
&&
val
.
charCodeAt
(
i
)
<=
'z'
.
charCodeAt
(
0
))
||
(
val
.
charCodeAt
(
i
)
>=
'A'
.
charCodeAt
(
0
)
&&
val
.
charCodeAt
(
i
)
<=
'Z'
.
charCodeAt
(
o
))
||
this
.
hasCharOfArray
(
allowChar
,
val
[
i
])
)
==
false
)
{
console
.
log
(
val
[
i
]);
return
;
}
}
const
MAX
=
35
;
const
COUNT
=
4
;
let
dataArrayTemp
=
[];
let
dataResult
=
[];
// 1,将字符串val按照 \n 截取为多个字符串保存到数组中
dataArrayTemp
=
val
.
split
(
"
\
n"
);
// 2,将数组中长度超过指定长度的字符串分成两个字符串保存到数组中,将长度为0的字符串从数组中删除掉
for
(
let
item
of
dataArrayTemp
)
{
// if (item.length > 0 && item.length <= MAX) {
if
(
item
.
length
<=
MAX
)
{
dataResult
.
push
(
item
);
}
else
if
(
item
.
length
>
MAX
)
{
dataResult
.
push
(
item
.
substr
(
0
,
MAX
));
dataResult
.
push
(
item
.
substr
(
MAX
));
}
}
// 3,将数组以 \n 为连接点 重新 组装成字符串 // 4,将得到的字符串赋值给 this.model...... 进行显示
if
(
dataResult
.
length
>
COUNT
)
{
return
;
}
else
{
this
.
model
[
this
.
props
.
argArr
.
prefix
+
'_adrblk'
]
=
dataResult
.
join
(
"
\
n"
);
}
}
clearTxt
=
()
=>
{
let
prefix
=
this
.
props
.
argArr
.
prefix
if
(
this
.
model
[
prefix
+
'_extkey'
]
==
''
){
this
.
model
[
prefix
+
'_namcn'
]
=
''
this
.
model
[
prefix
+
'_adrcn'
]
=
''
this
.
model
[
prefix
+
'_adrblk'
]
=
''
}
}
childEvevnt
=
childData
=>
{
this
.
child
=
childData
;
}
handleClick
=
()
=>
{
this
.
child
.
handleClick
();
}
render
()
{
const
bind
=
this
.
bind
const
{
argArr
}
=
this
.
props
let
desc
=
argArr
.
desc
let
desc1
=
argArr
.
desc1
let
prefix
=
argArr
.
prefix
let
url
=
argArr
.
url
let
flg
=
argArr
.
flg
let
datakey
=
argArr
.
datakey
let
isDisabled
=
argArr
.
isDisabled
return
(
<
Col
span
=
{
24
}
>
<
Row
className
=
"row"
>
<
Col
span
=
{
5
}
offset
=
{
2
}
>
<
Label
value
=
{
desc
}
/
>
<
/Col
>
<
Col
span
=
{
11
}
>
<
InputItem
InputProps
=
{{...
bind
(
prefix
+
'_extkey'
),
onAfterChange
:
this
.
clearTxt
,
onPressEnter
:
this
.
handleClick
,
formBlur
:
this
.
props
.
formBlur
}}
disabled
=
{
this
.
props
.
isDisabled
}
/
>
<
/Col
>
<
Col
span
=
{
4
}
offset
=
{
1
}
>
<
PtyPicker
url
=
{
url
}
flg
=
{
flg
}
model
=
{
this
.
model
}
extkey
=
{
this
.
model
[
prefix
+
'_extkey'
]}
dataKey
=
{
datakey
}
prefix
=
{
prefix
}
disabled
=
{
this
.
props
.
isDisabled
}
extkey
=
{
this
.
model
[
prefix
+
'_extkey'
]}
childEvevnt
=
{
this
.
childEvevnt
}
/
>
{
/*<PtyPicker url={url} flg={flg} model={this.model} extkey={this.model[prefix + '_extkey']} dataKey={datakey} prefix={prefix} disabled={isDisabled} />*/
}
<
/Col
>
<
/Row
>
<
Row
className
=
"row"
>
<
Col
span
=
{
5
}
offset
=
{
2
}
>
<
Label
value
=
{
desc1
}
/
>
<
/Col
>
<
Col
span
=
{
14
}
>
{
/* <TextAreaItem rows={4} onChange={(val) => { this.huan(val) }} style={{ resize: "none", "word-wrap": "break-word" }} className="section" InputProps={bind(prefix + '_adrblk')} /> */
}
<
TextAreaItem
rows
=
{
2
}
disabled
=
{
true
}
value
=
{
this
.
model
[
prefix
+
'_adrblk'
]}
onChange
=
{(
val
)
=>
{
this
.
huan
(
val
)
}}
disabled
=
{
isDisabled
}
style
=
{{
resize
:
"none"
}}
className
=
"section"
InputProps
=
{
bind
(
prefix
+
'_adrblk'
)}
/
>
<
/Col
>
<
/Row
>
<
/Col
>
)
}
}
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