Commit 8dd3ab07 authored by 左玲玲's avatar 左玲玲 😬

左右样式修改

parent 107b7d55
...@@ -448,7 +448,7 @@ function TreeRender({ ...@@ -448,7 +448,7 @@ function TreeRender({
onChange={onChange} onChange={onChange}
/> />
<div style={{ overflow: 'auto' }}> <div className='boxcontianbox'>
<Tree <Tree
onSelect={(selectedKeys, e) => { onSelect={(selectedKeys, e) => {
cselectedKeys(selectedKeys); cselectedKeys(selectedKeys);
......
...@@ -12,6 +12,7 @@ import AutoTable from '@/components/AutoTable'; ...@@ -12,6 +12,7 @@ import AutoTable from '@/components/AutoTable';
import PremButton from '@/components/PremButton'; import PremButton from '@/components/PremButton';
import getcolumns from './columns'; import getcolumns from './columns';
import { doFetch } from '@/utils/doFetch'; import { doFetch } from '@/utils/doFetch';
import styles from "./index.less";
import { import {
message, message,
Dropdown, Dropdown,
...@@ -2287,8 +2288,8 @@ function Model(props) { ...@@ -2287,8 +2288,8 @@ function Model(props) {
}; };
const containderef = useRef(); const containderef = useRef();
return ( return (<div className={styles.ledgerbox}>
<div> <div className={styles.ledgerheader}>
<div className="ant-card-head" style={{ backgroundColor: 'white' }}> <div className="ant-card-head" style={{ backgroundColor: 'white' }}>
<div className="ant-card-head-wrapper"> <div className="ant-card-head-wrapper">
<div className="ant-card-head-title"> <div className="ant-card-head-title">
...@@ -2296,11 +2297,12 @@ function Model(props) { ...@@ -2296,11 +2297,12 @@ function Model(props) {
</div> </div>
</div> </div>
</div> </div>
<Layout style={{ height: '100%' }} ref={containderef}> </div>
<Sider theme="light" width={300}> <div className={styles.ledgercontent}>
<TreeRender url="/auth/sysFactory/getTree" onselected={onselecteTree} noaction={true} /> <div className={`${styles.ledgerleft} boxcontianbox`}>
</Sider> <TreeRender url="/auth/sysFactory/getTree" onselected={onselecteTree} noaction={true} maxWidth={215} />
<Content> </div>
<div className={`${styles.ledgerright} boxcontianbox`} ref={containderef}>
<AutoTable <AutoTable
pagetitle={<h3 style={{ marginBottom: 0, fontWeight: 400 }}>设备台账</h3>} pagetitle={<h3 style={{ marginBottom: 0, fontWeight: 400 }}>设备台账</h3>}
columns={columns} columns={columns}
...@@ -2320,25 +2322,7 @@ function Model(props) { ...@@ -2320,25 +2322,7 @@ function Model(props) {
item: null, item: null,
title: '新增', title: '新增',
val: 'only', val: 'only',
type: 'add', type: 'add'
// onFinish: async (vals) => {
// //console.log(vals);
// let params = {
// ...vals,
// };
// let res = await doFetch({
// url: urlParams.save,
// params,
// });
// if (res.code === '0000') {
// message.success('新增成功!');
// setDrawer((s) => ({
// ...s,
// visible: false,
// }));
// actionRef.current.reload();
// }
// },
})); }));
}, },
}, },
...@@ -2346,8 +2330,8 @@ function Model(props) { ...@@ -2346,8 +2330,8 @@ function Model(props) {
x={1500} x={1500}
extraparams={extraparams} extraparams={extraparams}
/> />
</Content> </div>
</Layout> </div>
<DrawerPro <DrawerPro
fields={columns} fields={columns}
formRef={formRef} formRef={formRef}
......
.ledgerbox {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
.ledgerheader {
width: 100%;
border-bottom: 1px solid #f0f0f0;
flex-shrink: 0;
}
.ledgercontent {
background-color: #fff;
flex: 1;
width: 100%;
overflow: hidden;
display: flex;
justify-content: space-between;
.ledgerleft {
width: 300px;
display: flex;
flex-direction: column;
height: 100%;
overflow-y: auto;
padding: 0 16px;
flex-shrink: 0;
}
.ledgerright {
padding: 0 16px;
flex: 1;
border-left: 1px solid #f0f0f0;
overflow: hidden;
overflow-y: auto;
}
}
}
\ No newline at end of file
...@@ -3,6 +3,12 @@ import { Tooltip, Tabs } from 'antd'; ...@@ -3,6 +3,12 @@ import { Tooltip, Tabs } from 'antd';
import Filedetail from "@/components/Filedetail"; import Filedetail from "@/components/Filedetail";
import DetailPro from '@/components/DetailPro'; import DetailPro from '@/components/DetailPro';
import AutoTable from '@/components/AutoTable/mtable'; import AutoTable from '@/components/AutoTable/mtable';
const statusColors = {
1: '#7ac143',
2: 'orange',
3: '#6a737b',
4: '#fa4659'
};
const columns = [ const columns = [
{ {
title: '设备编号', title: '设备编号',
...@@ -58,7 +64,10 @@ const columns = [ ...@@ -58,7 +64,10 @@ const columns = [
{ label: '待机', value: 2 }, { label: '待机', value: 2 },
{ label: '关机', value: 3 }, { label: '关机', value: 3 },
{ label: '报警', value: 4 } { label: '报警', value: 4 }
] ],
render: (_, row) => {
return <span style={{ color: statusColors[row.collectStatus] }}>{row.collectStatusName}</span>
}
}, },
]; ];
const Devices = ({ drawer }) => { const Devices = ({ drawer }) => {
......
...@@ -14,12 +14,7 @@ const Basemsg = ({ drawer, activeKey, setdrawer }) => { ...@@ -14,12 +14,7 @@ const Basemsg = ({ drawer, activeKey, setdrawer }) => {
return res?.data?.data ?? {}; return res?.data?.data ?? {};
}, { }, {
refreshDeps: [drawer?.item?.id] refreshDeps: [drawer?.item?.id]
}) });
return <DetailPro return <DetailPro
fields={columns} fields={columns}
detailData={detailData?.data ?? {}} detailData={detailData?.data ?? {}}
......
...@@ -2,7 +2,7 @@ import { Tooltip, Image, Tag } from 'antd'; ...@@ -2,7 +2,7 @@ import { Tooltip, Image, Tag } from 'antd';
import { doFetch } from '@/utils/doFetch'; import { doFetch } from '@/utils/doFetch';
const statusColors = { const statusColors = {
1: '#7ac143', 1: '#7ac143',
2: '#00bce4', 2: 'orange',
3: '#6a737b', 3: '#6a737b',
4: '#fa4659' 4: '#fa4659'
}; };
......
...@@ -158,10 +158,10 @@ const Devicedata = () => { ...@@ -158,10 +158,10 @@ const Devicedata = () => {
</div> </div>
</div> </div>
<div className={styles.ledgercontent}> <div className={styles.ledgercontent}>
<div className={styles.ledgerleft}> <div className={`${styles.ledgerleft} boxcontianbox`}>
<TreeRender url="/auth/sysFactory/getTree" onselected={onselecteTree} noaction={true} /> <TreeRender url="/auth/sysFactory/getTree" onselected={onselecteTree} noaction={true} maxWidth={215} />
</div> </div>
<div className={`${styles.ledgerright} ledgerf`}> <div className={`${styles.ledgerright} ledgerf boxcontianbox`}>
<Tabs destroyInactiveTabPane activeKey={activeKey} onChange={(key) => { <Tabs destroyInactiveTabPane activeKey={activeKey} onChange={(key) => {
catk(key); catk(key);
}} items={tableItems} /> }} items={tableItems} />
......
.ledgerbox { .ledgerbox {
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: hidden;
background-color: #fff;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
position: relative;
.ledgerheader { .ledgerheader {
width: 100%; width: 100%;
...@@ -14,6 +11,7 @@ ...@@ -14,6 +11,7 @@
} }
.ledgercontent { .ledgercontent {
background-color: #fff;
flex: 1; flex: 1;
width: 100%; width: 100%;
overflow: hidden; overflow: hidden;
...@@ -25,7 +23,7 @@ ...@@ -25,7 +23,7 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100%; height: 100%;
overflow-y: hidden; overflow-y: auto;
padding: 0 16px; padding: 0 16px;
flex-shrink: 0; flex-shrink: 0;
} }
...@@ -35,6 +33,7 @@ ...@@ -35,6 +33,7 @@
flex: 1; flex: 1;
border-left: 1px solid #f0f0f0; border-left: 1px solid #f0f0f0;
overflow: hidden; overflow: hidden;
overflow-y: auto;
} }
} }
} }
\ No newline at end of file
...@@ -92,7 +92,7 @@ const columnsa = [ ...@@ -92,7 +92,7 @@ const columnsa = [
key: 'standbyRate', key: 'standbyRate',
search: false, search: false,
render: (_, row) => { render: (_, row) => {
return <span style={{ color: "#00bce4" }}>{row.standbyRate}%</span> return <span style={{ color: "orange" }}>{row.standbyRate}%</span>
} }
}, },
{ {
......
...@@ -221,17 +221,23 @@ const Devicestatus = ({ drawer }) => { ...@@ -221,17 +221,23 @@ const Devicestatus = ({ drawer }) => {
return option; return option;
}, [chartdata?.data]); }, [chartdata?.data]);
const optionbData = useMemo(() => { const optionbData = useMemo(() => {
let colors = []; let colors = [], allData = chartdata?.data?.data?.datalist ?? [], tableData = [];
let data = chartdata?.data?.data?.datalist?.length > 0 ? [{ let data = allData?.length > 0 ? [{
name: '', name: '',
value: chartdata?.data?.data?.datalist?.map(it => { value: allData?.map(it => {
return { return {
name: it.status, name: it.status,
value: [it.start, it.end] value: [it.start, it.end]
} }
}) ?? [] }) ?? []
}] : []; }] : [];
tableData = allData?.sort(compareTimeDesc);
tableData = tableData?.map((it, i) => {
return {
...it,
id: i
}
}) ?? [];
for (let i in statusColors) { for (let i in statusColors) {
colors.push({ colors.push({
type: i, type: i,
...@@ -241,14 +247,21 @@ const Devicestatus = ({ drawer }) => { ...@@ -241,14 +247,21 @@ const Devicestatus = ({ drawer }) => {
}; };
return { return {
statusData: data, statusData: data,
statusColorList: colors statusColorList: colors,
tableData
} }
}, [chartdata?.data]); }, [chartdata?.data]);
return <div style={{ display: "flex", justifyContent: "space-between", position: "relative" }}> function compareTimeDesc(a, b) {
<div style={{ width: 300, padding: '0 16px', flexShrink: 0 }}> const timeA = dayjs(a.start).valueOf();
<TreeRender dataSource={device?.data} onselected={onselecteTree} noaction={true} isSelectFirst={true} maxWidth={240} /> const timeB = dayjs(b.start).valueOf();
return timeB - timeA;
}
return <div className={styles.ledgerbox}>
<div className={styles.ledgercontent}>
<div className={`${styles.ledgerleft} boxcontianbox`}>
<TreeRender dataSource={device?.data} onselected={onselecteTree} noaction={true} isSelectFirst={true} maxWidth={215} />
</div> </div>
<div style={{ padding: 16, flex: 1, borderLeft: '1px solid #f0f0f0' }}> <div className={`${styles.ledgerright} boxcontianbox`} style={{ padding: 16, flex: 1, borderLeft: '1px solid #f0f0f0' }}>
<div style={{ marginBottom: 30 }}> <div style={{ marginBottom: 30 }}>
<RangePicker <RangePicker
showTime={{ showTime={{
...@@ -256,7 +269,7 @@ const Devicestatus = ({ drawer }) => { ...@@ -256,7 +269,7 @@ const Devicestatus = ({ drawer }) => {
}} }}
format={format} format={format}
onChange={(val, dateString) => { onChange={(val, dateString) => {
cdate(dateString)
}} }}
value={dateTimeRange?.length > 0 ? [dayjs(dateTimeRange?.[0]), dayjs(dateTimeRange?.[1])] : []} value={dateTimeRange?.length > 0 ? [dayjs(dateTimeRange?.[0]), dayjs(dateTimeRange?.[1])] : []}
/> />
...@@ -278,15 +291,13 @@ const Devicestatus = ({ drawer }) => { ...@@ -278,15 +291,13 @@ const Devicestatus = ({ drawer }) => {
title: '采集状态', title: '采集状态',
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
search: false search: false,
render: (_, row) => {
return <span style={{ color: statusColors[row.status]?.color }}>{row.name}</span>
}
}, },
]} ]}
dataSource={chartdata?.data?.data?.datalist?.map((it, i) => { dataSource={optionbData?.tableData}
return {
...it,
id: i
}
}) ?? []}
resizeable={false} resizeable={false}
pageextra="none" pageextra="none"
options={false} options={false}
...@@ -304,5 +315,7 @@ const Devicestatus = ({ drawer }) => { ...@@ -304,5 +315,7 @@ const Devicestatus = ({ drawer }) => {
</div> </div>
</div> </div>
</div> </div>
</div>
} }
export default Devicestatus; export default Devicestatus;
\ No newline at end of file
...@@ -341,10 +341,10 @@ const Ledger = () => { ...@@ -341,10 +341,10 @@ const Ledger = () => {
</div> </div>
</div> </div>
<div className={styles.ledgercontent}> <div className={styles.ledgercontent}>
<div className={styles.ledgerleft}> <div className={`${styles.ledgerleft} boxcontianbox`}>
<TreeRender url="/auth/sysFactory/getTree" onselected={onselecteTree} noaction={true} maxWidth={240} /> <TreeRender url="/auth/sysFactory/getTree" onselected={onselecteTree} noaction={true} maxWidth={215} />
</div> </div>
<div className={styles.ledgerright}> <div className={`${styles.ledgerright} boxcontianbox`}>
<AutoTable <AutoTable
pagetitle={'设备列表'} pagetitle={'设备列表'}
columns={columns} columns={columns}
......
.ledgerbox { .ledgerbox {
width: 100%; width: 100%;
height: 100%; height: 100%;
// overflow: hidden;
background-color: #fff;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
// position: relative;
.ledgerheader { .ledgerheader {
width: 100%; width: 100%;
...@@ -14,9 +11,10 @@ ...@@ -14,9 +11,10 @@
} }
.ledgercontent { .ledgercontent {
background-color: #fff;
flex: 1; flex: 1;
width: 100%; width: 100%;
// overflow: hidden; overflow: hidden;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
...@@ -25,12 +23,13 @@ ...@@ -25,12 +23,13 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100%; height: 100%;
overflow-y: hidden; overflow-y: auto;
padding: 0 16px; padding: 0 16px;
flex-shrink: 0; flex-shrink: 0;
} }
.ledgerright { .ledgerright {
padding: 0 16px;
flex: 1; flex: 1;
border-left: 1px solid #f0f0f0; border-left: 1px solid #f0f0f0;
overflow: hidden; overflow: hidden;
......
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