Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ems3.3
Project
Project
Details
Activity
Releases
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
wuhao
ems3.3
Commits
b704f1d6
Commit
b704f1d6
authored
Oct 26, 2023
by
左玲玲
😬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1740
parent
a155993d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
51 deletions
+54
-51
FormItems.jsx
src/components/InitForm/FormItems.jsx
+1
-1
columns.js
src/pages/lease/custom/columns.js
+4
-2
index.jsx
src/pages/lease/devicedata/index.jsx
+49
-48
No files found.
src/components/InitForm/FormItems.jsx
View file @
b704f1d6
...
...
@@ -628,7 +628,7 @@ function NolinkSelect({ item, colProps, curindex = 0 }) {
if (Array.isArray(curoption)) {
options = {
options: item.showAll ? [{ label: '全部', value: 'all' }] : [...curoption],
options: item.showAll ? [{ label: '全部', value: 'all' }
, ...curoption
] : [...curoption],
};
} else if (curoption) {
options = {
...
...
src/pages/lease/custom/columns.js
View file @
b704f1d6
...
...
@@ -100,10 +100,12 @@ function getcolumns(setdrawer) {
{
title
:
'所属区域'
,
dataIndex
:
'regionName'
,
key
:
'regionId'
,
key
:
'regionId
List
'
,
colProps
:
{
span
:
8
},
valueType
:
'select'
,
mode
:
'multiple'
,
fieldProps
:
{
mode
:
'multiple'
},
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
options
:
{
path
:
'/lease/umLeaseCustomer/getAllShopSelection'
,
params
:
{}
},
hideInSearch
:
true
,
...
...
src/pages/lease/devicedata/index.jsx
View file @
b704f1d6
...
...
@@ -20,8 +20,8 @@ const Devicedata = () => {
[
extraparams
,
setextraparams
]
=
useState
({}),
[
activeKey
,
catk
]
=
useState
(
'item-1'
),
[
item2extraparams
,
citp
]
=
useState
({}),
[
searchParams
,
csp
]
=
useState
({})
,
[
leaseList
,
clea
]
=
useState
([]);
[
searchParams
,
csp
]
=
useState
({})
;
//
[leaseList, clea] = useState([]);
const
{
allWebsocket
:
{
commonWebsocket
,
commonWebmsg
}
}
=
useModel
(
'useGlobal'
);
const
{
run
,
loading
,
runAsync
}
=
useRequest
(
doFetch
,
{
manual
:
true
,
...
...
@@ -34,43 +34,43 @@ const Devicedata = () => {
}));
}
},
})
,
tableData
=
useRequest
(()
=>
doFetch
({
url
:
'/lease/umLeaseLedger/queryLeaseList'
,
params
:
{
...
searchParams
,
...
extraparams
}
}),
{
refreshDeps
:
[
extraparams
,
searchParams
],
onSuccess
:
(
res
,
params
)
=>
{
if
(
res
.
code
==
'0000'
)
{
clea
(
res
?.
data
?.
dataList
??
[])
}
}
});
})
;
//
tableData = useRequest(() => doFetch({ url: '/lease/umLeaseLedger/queryLeaseList', params: { ...searchParams, ...extraparams } }), {
//
refreshDeps: [extraparams, searchParams],
//
onSuccess: (res, params) => {
//
if (res.code == '0000') {
//
clea(res?.data?.dataList ?? [])
//
}
//
}
//
});
useEffect
(()
=>
{
const
msg
=
commonWebmsg
?.
msg
;
if
(
commonWebmsg
?.
wsMsgModel
==
'LEASE'
)
{
let
newList
=
JSON
.
parse
(
JSON
.
stringify
(
leaseList
));
newList
=
newList
?.
map
(
it
=>
{
if
(
it
.
id
==
msg
.
id
)
{
it
.
collectStatusName
=
msg
.
collectStatusName
;
it
.
collectStatus
=
msg
.
collectStatus
;
}
return
it
});
clea
(
newList
);
}
},
[
commonWebmsg
]);
useEffect
(()
=>
{
try
{
commonWebsocket
&&
commonWebsocket
.
emit
(
"sendMessage"
,
{
"wsMsgModel"
:
"LEASE"
,
"subId"
:
dayjs
().
valueOf
(),
param
:
''
,
unsubscribe
:
false
,
});
}
catch
(
error
)
{
//
useEffect(() => {
//
const msg = commonWebmsg?.msg;
//
if (commonWebmsg?.wsMsgModel == 'LEASE') {
//
let newList = JSON.parse(JSON.stringify(leaseList));
//
newList = newList?.map(it => {
//
if (it.id == msg.id) {
//
it.collectStatusName = msg.collectStatusName;
//
it.collectStatus = msg.collectStatus;
//
}
//
return it
//
});
//
clea(newList);
//
}
//
}, [commonWebmsg]);
//
useEffect(() => {
//
try {
//
commonWebsocket && commonWebsocket.emit("sendMessage", {
//
"wsMsgModel": "LEASE",
//
"subId": dayjs().valueOf(),
//
param: '',
//
unsubscribe: false,
//
});
//
} catch (error) {
}
},
[]);
//
}
//
}, []);
const
columns
=
useMemo
(()
=>
{
let
defcolumn
=
getcolumns
(
setdrawer
,
activeKey
)?.
columns
??
[];
return
defcolumn
;
...
...
@@ -83,23 +83,24 @@ const Devicedata = () => {
key
:
'item-1'
,
children
:
<
AutoTable
columns=
{
columns
}
dataSource=
{
leaseList
}
// dataSource={leaseList}
path=
'/lease/umLeaseLedger/queryList'
actionRef=
{
actionRef
}
resizeable=
{
false
}
bordered=
{
false
}
x=
{
1500
}
formRef=
{
formRef
}
dataSourceFieldsChange=
{
(
val
)
=>
{
csp
({
...
val
})
}
}
//
dataSourceFieldsChange={(val) => {
//
csp({ ...val })
//
}}
extraparams=
{
extraparams
}
pagination=
{
false
}
toolBarRender=
{
true
}
options=
{
{
reload
:
()
=>
{
tableData
.
run
()
}
}
}
//
pagination={false}
//
toolBarRender={true}
//
options={{
//
reload: () => {
//
tableData.run()
//
}
//
}}
/>
},
{
...
...
@@ -108,7 +109,7 @@ const Devicedata = () => {
children
:
<
Account
boxRef=
{
boxRef
}
extraparams=
{
item2extraparams
}
/>
}
]
},
[
extraparams
,
leaseList
]);
},
[
extraparams
]);
const
items
=
useMemo
(()
=>
{
if
(
drawer
.
val
==
'only'
)
{
if
(
activeKey
==
'item-1'
)
{
...
...
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