Commit b704f1d6 authored by 左玲玲's avatar 左玲玲 😬

1740

parent a155993d
......@@ -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 = {
......
......@@ -100,10 +100,12 @@ function getcolumns(setdrawer) {
{
title: '所属区域',
dataIndex: 'regionName',
key: 'regionId',
key: 'regionIdList',
colProps: { span: 8 },
valueType: 'select',
mode: 'multiple',
fieldProps: {
mode: 'multiple'
},
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
options: { path: '/lease/umLeaseCustomer/getAllShopSelection', params: {} },
hideInSearch: true,
......
......@@ -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') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment