Update
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useBoilers } from '../hooks/swrHooks'
|
||||
import { Badge, ScrollAreaAutosize, Table, Text } from '@mantine/core'
|
||||
import { IBoiler } from '../interfaces/fuel'
|
||||
import { Stack, Text } from '@mantine/core'
|
||||
import CustomTable from '../components/CustomTable'
|
||||
|
||||
function Boilers() {
|
||||
const [boilersPage, setBoilersPage] = useState(1)
|
||||
@ -24,21 +24,43 @@ function Boilers() {
|
||||
setBoilerSearch("")
|
||||
}, [])
|
||||
|
||||
const boilersColumns = [
|
||||
{ field: 'id_object', headerName: 'ID', type: "number" },
|
||||
{ field: 'boiler_name', headerName: 'Название', type: "string", flex: 1 },
|
||||
{ field: 'boiler_code', headerName: 'Код', type: "string", flex: 1 },
|
||||
{ field: 'id_city', headerName: 'Город', type: "string", flex: 1 },
|
||||
{ field: 'activity', headerName: 'Активен', type: "boolean", flex: 1 },
|
||||
]
|
||||
|
||||
return (
|
||||
<ScrollAreaAutosize w={'100%'} h={'100%'} p='sm'>
|
||||
<Stack w={'100%'} h={'100%'} p='sm'>
|
||||
<Text size="xl" fw={600}>
|
||||
Котельные
|
||||
</Text>
|
||||
|
||||
{boilers &&
|
||||
<CustomTable data={boilers} columns={[
|
||||
{
|
||||
accessorKey: 'id_object',
|
||||
header: 'ID',
|
||||
cell: (info) => info.getValue(),
|
||||
},
|
||||
{
|
||||
accessorKey: 'boiler_name',
|
||||
header: 'Название',
|
||||
cell: (info) => info.getValue(),
|
||||
},
|
||||
{
|
||||
accessorKey: 'boiler_code',
|
||||
header: 'Код',
|
||||
cell: (info) => info.getValue(),
|
||||
},
|
||||
{
|
||||
accessorKey: 'id_city',
|
||||
header: 'Город',
|
||||
cell: (info) => info.getValue(),
|
||||
},
|
||||
{
|
||||
accessorKey: 'activity',
|
||||
header: 'Активен',
|
||||
cell: (info) => info.getValue(),
|
||||
},
|
||||
]} />
|
||||
}
|
||||
|
||||
{/* {boilers &&
|
||||
<Table highlightOnHover>
|
||||
<Table.Thead>
|
||||
<Table.Tr>
|
||||
@ -77,8 +99,8 @@ function Boilers() {
|
||||
))}
|
||||
</Table.Tbody>
|
||||
</Table>
|
||||
}
|
||||
</ScrollAreaAutosize>
|
||||
} */}
|
||||
</Stack>
|
||||
)
|
||||
}
|
||||
|
||||
|
78
client/src/pages/DBManager.tsx
Normal file
78
client/src/pages/DBManager.tsx
Normal file
@ -0,0 +1,78 @@
|
||||
import { Button, Card, Flex, Grid, Group, ScrollAreaAutosize, Stack, Tabs, Text } from '@mantine/core'
|
||||
import useSWR from 'swr'
|
||||
import { BASE_URL } from '../constants'
|
||||
import { fetcher } from '../http/axiosInstance'
|
||||
import { useEffect, useState } from 'react'
|
||||
import CustomTable from '../components/CustomTable'
|
||||
|
||||
const DBManager = () => {
|
||||
const { data: tablesData } = useSWR(`/db/tables`, (key) => fetcher(key, BASE_URL.ems), {
|
||||
revalidateOnFocus: false
|
||||
})
|
||||
|
||||
return (
|
||||
<Stack w={'100%'} h={'100%'} p='xs'>
|
||||
{tablesData && Array.isArray(tablesData) && tablesData.length > 0 &&
|
||||
<Tabs w='100%' h='80%'>
|
||||
<Stack h='100%'>
|
||||
<Tabs.List>
|
||||
{tablesData.map(table => (
|
||||
<Tabs.Tab key={table.tablename} value={table.tablename}>
|
||||
{table.tablename}
|
||||
</Tabs.Tab>
|
||||
))}
|
||||
</Tabs.List>
|
||||
|
||||
{tablesData.map(table => (
|
||||
<Tabs.Panel h='100%' key={table.tablename} value={table.tablename} w='100%'>
|
||||
<TableData tablename={table.tablename} />
|
||||
</Tabs.Panel>
|
||||
))}
|
||||
</Stack>
|
||||
|
||||
</Tabs>
|
||||
}
|
||||
{/* <Card withBorder radius='sm'>
|
||||
<Stack>
|
||||
<Group justify='flex-start'>
|
||||
<Text fw='bold'>Figures</Text>
|
||||
</Group>
|
||||
<Grid>
|
||||
<Button>Import from New_Gis (erases data)</Button>
|
||||
</Grid>
|
||||
</Stack>
|
||||
</Card> */}
|
||||
</Stack>
|
||||
)
|
||||
}
|
||||
|
||||
const TableData = ({
|
||||
tablename
|
||||
}: { tablename: string }) => {
|
||||
const [offset, setOffset] = useState(0)
|
||||
const [limit, setLimit] = useState(20)
|
||||
|
||||
const { data: columnsData } = useSWR(`/db/columns/${tablename}`, (key) => fetcher(key, BASE_URL.ems), {
|
||||
revalidateOnFocus: false
|
||||
})
|
||||
|
||||
const { data: rowsData } = useSWR(columnsData ? `/db/rows/${tablename}?offset=${offset}&limit=${limit}` : null, (key) => fetcher(key, BASE_URL.ems), {
|
||||
revalidateOnFocus: false
|
||||
})
|
||||
|
||||
return (
|
||||
<>
|
||||
{columnsData && rowsData && Array.isArray(columnsData) && Array.isArray(rowsData) && columnsData.length > 0 &&
|
||||
<CustomTable data={rowsData} columns={columnsData.map(column => (
|
||||
{
|
||||
accessorKey: column.column_name,
|
||||
header: column.column_name,
|
||||
cell: (info) => JSON.stringify(info.getValue()).length > 30 ? [JSON.stringify(info.getValue()).substring(0, 30), '...'].join('') : JSON.stringify(info.getValue()),
|
||||
}
|
||||
))} />
|
||||
}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default DBManager
|
@ -1,8 +1,81 @@
|
||||
import { Container, Stack, Tabs } from '@mantine/core'
|
||||
import MapComponent from '../components/map/MapComponent'
|
||||
import { useEffect } from 'react'
|
||||
import { initializeObjectsState } from '../store/objects'
|
||||
import { deleteMapTab, setCurrentTab, useAppStore } from '../store/app'
|
||||
import { initializeMapState, useMapStore } from '../store/map'
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
|
||||
function MapTest() {
|
||||
const { mapTab, currentTab } = useAppStore()
|
||||
const { id } = useMapStore()
|
||||
|
||||
const tabs = [
|
||||
{
|
||||
id: uuidv4(),
|
||||
year: 2023,
|
||||
region: 11,
|
||||
district: 145,
|
||||
},
|
||||
{
|
||||
id: uuidv4(),
|
||||
year: 2023,
|
||||
region: 11,
|
||||
district: 146,
|
||||
},
|
||||
]
|
||||
|
||||
useEffect(() => {
|
||||
tabs.map(tab => useAppStore.setState((state) => {
|
||||
initializeObjectsState(tab.id, tab.region, tab.district, null, tab.year)
|
||||
initializeMapState(tab.id)
|
||||
|
||||
return {
|
||||
mapTab: {
|
||||
...state.mapTab,
|
||||
[tab.id]: {
|
||||
year: tab.year,
|
||||
region: tab.region,
|
||||
district: tab.district
|
||||
}
|
||||
}
|
||||
}
|
||||
}))
|
||||
|
||||
setCurrentTab(tabs[0].id)
|
||||
|
||||
return () => {
|
||||
tabs.map(tab => deleteMapTab(tab.id))
|
||||
}
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<MapComponent />
|
||||
<Container fluid w='100%' pos='relative' p={0}>
|
||||
<Tabs h='100%' variant='default' value={currentTab} onChange={setCurrentTab} keepMounted={true}>
|
||||
<Stack gap={0} h='100%'>
|
||||
<Tabs.List>
|
||||
{Object.entries(mapTab).map(([key]) => (
|
||||
<Tabs.Tab value={key} key={key}>
|
||||
{id[key]?.mapLabel}
|
||||
</Tabs.Tab>
|
||||
))}
|
||||
</Tabs.List>
|
||||
|
||||
{Object.entries(mapTab).map(([key]) => (
|
||||
<Tabs.Panel value={key} key={key} h='100%' pos='relative'>
|
||||
<MapComponent
|
||||
key={key}
|
||||
id={key}
|
||||
active={currentTab === key}
|
||||
/>
|
||||
|
||||
</Tabs.Panel>
|
||||
))}
|
||||
</Stack>
|
||||
|
||||
</Tabs>
|
||||
|
||||
</Container>
|
||||
)
|
||||
}
|
||||
|
||||
|
967
client/src/pages/PrintReport.tsx
Normal file
967
client/src/pages/PrintReport.tsx
Normal file
@ -0,0 +1,967 @@
|
||||
import { Button, Flex } from "@mantine/core";
|
||||
|
||||
const xslTemplate = `<?xml version="1.0" encoding="utf-8"?>
|
||||
<xsl:stylesheet version="1.0" xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<!-- <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Шаблон >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -->
|
||||
<xsl:template match="/">
|
||||
<xsl:processing-instruction name="mso-application">
|
||||
<xsl:text>progid="Excel.Sheet"</xsl:text>
|
||||
</xsl:processing-instruction>
|
||||
<Workbook>
|
||||
<!-- <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Стили шаблона >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -->
|
||||
<Styles>
|
||||
<Style ss:ID="Bordered1">
|
||||
<Borders>
|
||||
<Border ss:LineStyle="Continuous" ss:Position="Bottom" ss:Weight="1" />
|
||||
<Border ss:LineStyle="Continuous" ss:Position="Left" ss:Weight="1" />
|
||||
<Border ss:LineStyle="Continuous" ss:Position="Right" ss:Weight="1" />
|
||||
<Border ss:LineStyle="Continuous" ss:Position="Top" ss:Weight="1" />
|
||||
</Borders>
|
||||
</Style>
|
||||
<Style ss:ID="Bordered2">
|
||||
<Borders>
|
||||
<Border ss:LineStyle="Continuous" ss:Position="Bottom" ss:Weight="2" />
|
||||
<Border ss:LineStyle="Continuous" ss:Position="Left" ss:Weight="2" />
|
||||
<Border ss:LineStyle="Continuous" ss:Position="Right" ss:Weight="2" />
|
||||
<Border ss:LineStyle="Continuous" ss:Position="Top" ss:Weight="2" />
|
||||
</Borders>
|
||||
</Style>
|
||||
<Style ss:ID="Column" ss:Parent="Bordered2">
|
||||
<Alignment ss:Horizontal="Center" ss:Vertical="Center" ss:WrapText="1" />
|
||||
<Font ss:Color="#000000" ss:FontName="Arial Cyr" x:CharSet="204" />
|
||||
</Style>
|
||||
<Style ss:ID="Cell1" ss:Parent="Bordered1">
|
||||
<Font ss:Bold="1" ss:Color="#000000" ss:FontName="Arial Cyr" x:CharSet="204" />
|
||||
<Interior ss:Color="#47FF19" ss:Pattern="Solid" />
|
||||
</Style>
|
||||
<Style ss:ID="Cell2" ss:Parent="Bordered1">
|
||||
<Font ss:Bold="1" ss:Color="#003366" ss:FontName="Arial Cyr" x:CharSet="204" />
|
||||
<Interior ss:Color="#F2FF02" ss:Pattern="Solid" />
|
||||
</Style>
|
||||
<Style ss:ID="Cell3" ss:Parent="Bordered1">
|
||||
<Font ss:Bold="1" ss:Color="#333333" ss:FontName="Arial Cyr" x:CharSet="204" />
|
||||
<Interior ss:Color="#C0C0C0" ss:Pattern="Solid" />
|
||||
</Style>
|
||||
<Style ss:ID="Cell4" ss:Parent="Bordered1">
|
||||
<Font ss:Color="#000000" ss:FontName="Arial Cyr" x:CharSet="204" />
|
||||
</Style>
|
||||
|
||||
<Style ss:ID="CellReg" ss:Parent="Bordered1">
|
||||
<Font ss:Color="#003366" ss:FontName="Arial Cyr" x:CharSet="204" />
|
||||
|
||||
</Style>
|
||||
<Style ss:ID="CellCity" ss:Parent="Bordered1">
|
||||
<Font ss:Color="#333333" ss:FontName="Arial Cyr" x:CharSet="204" />
|
||||
|
||||
</Style>
|
||||
</Styles>
|
||||
<Worksheet ss:Name="Жилищний фонд">
|
||||
<Table>
|
||||
<Column ss:Width="100" />
|
||||
<Column ss:Width="100" />
|
||||
<Column ss:Width="100" />
|
||||
<Column ss:Width="150" />
|
||||
<Column ss:Width="50" />
|
||||
<Column ss:Width="50" />
|
||||
<Column ss:Width="50" />
|
||||
<Column ss:Width="50" />
|
||||
<Column ss:Width="70" />
|
||||
<Column ss:Width="70" />
|
||||
<Column ss:Width="70" />
|
||||
<Column ss:Width="70" />
|
||||
<Column ss:Width="70" />
|
||||
<Column ss:Width="70" />
|
||||
<Column ss:Width="70" />
|
||||
<Column ss:Width="70" />
|
||||
<Column ss:Width="80" />
|
||||
<!-- <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Столбцы таблицы >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -->
|
||||
<Row>
|
||||
<Cell ss:MergeDown="1" ss:StyleID="Column">
|
||||
<Data ss:Type="String">Регион</Data>
|
||||
</Cell>
|
||||
<Cell ss:MergeDown="1" ss:StyleID="Column">
|
||||
<Data ss:Type="String">Нас. пункт</Data>
|
||||
</Cell>
|
||||
<Cell ss:MergeDown="1" ss:StyleID="Column">
|
||||
<Data ss:Type="String">Котельная</Data>
|
||||
</Cell>
|
||||
<Cell ss:MergeDown="1" ss:StyleID="Column">
|
||||
<Data ss:Type="String">Адрес</Data>
|
||||
</Cell>
|
||||
<Cell ss:MergeDown="1" ss:StyleID="Column">
|
||||
<Data ss:Type="String">Кол-во домов</Data>
|
||||
</Cell>
|
||||
<Cell ss:MergeDown="1" ss:StyleID="Column">
|
||||
<Data ss:Type="String">Этаж.</Data>
|
||||
</Cell>
|
||||
<Cell ss:MergeDown="1" ss:StyleID="Column">
|
||||
<Data ss:Type="String">Общая пл.</Data>
|
||||
</Cell>
|
||||
<Cell ss:MergeDown="1" ss:StyleID="Column">
|
||||
<Data ss:Type="String">Кол-во прожив.</Data>
|
||||
</Cell>
|
||||
<Cell ss:MergeAcross="1" ss:StyleID="Column">
|
||||
<Data ss:Type="String">Отопление</Data>
|
||||
</Cell>
|
||||
<Cell ss:MergeAcross="1" ss:StyleID="Column">
|
||||
<Data ss:Type="String">ГВС</Data>
|
||||
</Cell>
|
||||
<Cell ss:MergeAcross="1" ss:StyleID="Column">
|
||||
<Data ss:Type="String">ХВС</Data>
|
||||
</Cell>
|
||||
<Cell ss:MergeAcross="1" ss:StyleID="Column">
|
||||
<Data ss:Type="String">Канализация</Data>
|
||||
</Cell>
|
||||
<Cell ss:MergeDown="1" ss:StyleID="Column">
|
||||
<Data ss:Type="String">Сальдо исход.</Data>
|
||||
</Cell>
|
||||
</Row>
|
||||
<Row>
|
||||
<Cell ss:Index="9" ss:StyleID="Column">
|
||||
<Data ss:Type="String">Объем</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Column">
|
||||
<Data ss:Type="String">Сумма</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Column">
|
||||
<Data ss:Type="String">Объем</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Column">
|
||||
<Data ss:Type="String">Сумма</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Column">
|
||||
<Data ss:Type="String">Объем</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Column">
|
||||
<Data ss:Type="String">Сумма</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Column">
|
||||
<Data ss:Type="String">Объем</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Column">
|
||||
<Data ss:Type="String">Сумма</Data>
|
||||
</Cell>
|
||||
</Row>
|
||||
<!-- <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Данные таблицы >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -->
|
||||
<xsl:apply-templates select="//Kvp" />
|
||||
</Table>
|
||||
<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
|
||||
<FreezePanes />
|
||||
<FrozenNoSplit />
|
||||
<SplitHorizontal>2</SplitHorizontal>
|
||||
<TopRowBottomPane>2</TopRowBottomPane>
|
||||
<ActivePane>2</ActivePane>
|
||||
</WorksheetOptions>
|
||||
</Worksheet>
|
||||
<Worksheet ss:Name="Договорные подключения">
|
||||
<Table>
|
||||
<Column ss:Width="100" />
|
||||
<Column ss:Width="100" />
|
||||
<Column ss:Width="100" />
|
||||
<Column ss:Width="150" />
|
||||
<Column ss:Width="50" />
|
||||
<Column ss:Width="50" />
|
||||
<Column ss:Width="50" />
|
||||
<Column ss:Width="50" />
|
||||
<Column ss:Width="50" />
|
||||
<Column ss:Width="50" />
|
||||
<Column ss:Width="50" />
|
||||
<Column ss:Width="50" />
|
||||
<Column ss:Width="50" />
|
||||
<Column ss:Width="50" />
|
||||
<Column ss:Width="70" />
|
||||
<!-- <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Столбцы таблицы >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -->
|
||||
<Row>
|
||||
<Cell ss:MergeDown="1" ss:StyleID="Column">
|
||||
<Data ss:Type="String">Регион</Data>
|
||||
</Cell>
|
||||
<Cell ss:MergeDown="1" ss:StyleID="Column">
|
||||
<Data ss:Type="String">Нас. пункт</Data>
|
||||
</Cell>
|
||||
<Cell ss:MergeDown="1" ss:StyleID="Column">
|
||||
<Data ss:Type="String">Котельная</Data>
|
||||
</Cell>
|
||||
<Cell ss:MergeDown="1" ss:StyleID="Column">
|
||||
<Data ss:Type="String">Наименование</Data>
|
||||
</Cell>
|
||||
<Cell ss:MergeDown="1" ss:StyleID="Column">
|
||||
<Data ss:Type="String">Кол-во объектов</Data>
|
||||
</Cell>
|
||||
<Cell ss:MergeDown="1" ss:StyleID="Column">
|
||||
<Data ss:Type="String">Объем здания</Data>
|
||||
</Cell>
|
||||
<Cell ss:MergeAcross="1" ss:StyleID="Column">
|
||||
<Data ss:Type="String">Отопление</Data>
|
||||
</Cell>
|
||||
<Cell ss:MergeAcross="1" ss:StyleID="Column">
|
||||
<Data ss:Type="String">Подогрев</Data>
|
||||
</Cell>
|
||||
<Cell ss:MergeAcross="1" ss:StyleID="Column">
|
||||
<Data ss:Type="String">ГВС</Data>
|
||||
</Cell>
|
||||
<Cell ss:MergeAcross="1" ss:StyleID="Column">
|
||||
<Data ss:Type="String">ХВС</Data>
|
||||
</Cell>
|
||||
<Cell ss:MergeAcross="1" ss:StyleID="Column">
|
||||
<Data ss:Type="String">Канализация</Data>
|
||||
</Cell>
|
||||
<Cell ss:MergeDown="1" ss:StyleID="Column">
|
||||
<Data ss:Type="String">Итого</Data>
|
||||
</Cell>
|
||||
</Row>
|
||||
<Row>
|
||||
<Cell ss:Index="7" ss:StyleID="Column">
|
||||
<Data ss:Type="String">Объем</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Column">
|
||||
<Data ss:Type="String">Сумма</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Column">
|
||||
<Data ss:Type="String">Объем</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Column">
|
||||
<Data ss:Type="String">Сумма</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Column">
|
||||
<Data ss:Type="String">Объем</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Column">
|
||||
<Data ss:Type="String">Сумма</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Column">
|
||||
<Data ss:Type="String">Объем</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Column">
|
||||
<Data ss:Type="String">Сумма</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Column">
|
||||
<Data ss:Type="String">Объем</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Column">
|
||||
<Data ss:Type="String">Сумма</Data>
|
||||
</Cell>
|
||||
</Row>
|
||||
<!-- <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Данные таблицы >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -->
|
||||
<xsl:apply-templates select="//Jur" />
|
||||
</Table>
|
||||
</Worksheet>
|
||||
</Workbook>
|
||||
</xsl:template>
|
||||
<!-- <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Шаблон данных >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -->
|
||||
<xsl:template match="Kvp">
|
||||
<xsl:choose>
|
||||
<xsl:when test="style_id = 1">
|
||||
<!-- <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Строка с улусом >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -->
|
||||
<Row>
|
||||
<Cell ss:MergeAcross="3" ss:StyleID="Cell1">
|
||||
<Data ss:Type="String">
|
||||
<xsl:value-of select="region" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell1">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="house_count" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell1">
|
||||
<Data ss:Type="String" />
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell1">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="square" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell1">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="people_count" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell1">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="volume_heat" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell1">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="sum_heat" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell1">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="volume_hwater" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell1">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="sum_hwater" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell1">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="volume_cwater" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell1">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="sum_cwater" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell1">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="volume_sewers" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell1">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="sum_sewers" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell1">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="saldo_out" />
|
||||
</Data>
|
||||
</Cell>
|
||||
</Row>
|
||||
</xsl:when>
|
||||
<xsl:when test="style_id = 2">
|
||||
<!-- <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Строка с населенным пунктом >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -->
|
||||
<Row>
|
||||
<Cell ss:StyleID="Cell2">
|
||||
<Data ss:Type="String">
|
||||
<xsl:value-of select="region" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:Index="2" ss:MergeAcross="2" ss:StyleID="Cell2">
|
||||
<Data ss:Type="String">
|
||||
<xsl:value-of select="city" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell2">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="house_count" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell2">
|
||||
<Data ss:Type="String" />
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell2">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="square" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell2">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="people_count" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell2">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="volume_heat" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell2">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="sum_heat" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell2">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="volume_hwater" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell2">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="sum_hwater" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell2">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="volume_cwater" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell2">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="sum_cwater" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell2">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="volume_sewers" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell2">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="sum_sewers" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell2">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="saldo_out" />
|
||||
</Data>
|
||||
</Cell>
|
||||
</Row>
|
||||
</xsl:when>
|
||||
<xsl:when test="style_id = 3">
|
||||
<!-- <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Строка с котельной >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -->
|
||||
<Row>
|
||||
<Cell ss:StyleID="Cell3">
|
||||
<Data ss:Type="String">
|
||||
<xsl:value-of select="region" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell3">
|
||||
<Data ss:Type="String">
|
||||
<xsl:value-of select="city" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:Index="3" ss:MergeAcross="1" ss:StyleID="Cell3">
|
||||
<Data ss:Type="String">
|
||||
<xsl:value-of select="boiler" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell3">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="house_count" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell3">
|
||||
<Data ss:Type="String" />
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell3">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="square" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell3">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="people_count" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell3">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="volume_heat" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell3">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="sum_heat" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell3">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="volume_hwater" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell3">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="sum_hwater" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell3">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="volume_cwater" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell3">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="sum_cwater" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell3">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="volume_sewers" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell3">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="sum_sewers" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell3">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="saldo_out" />
|
||||
</Data>
|
||||
</Cell>
|
||||
</Row>
|
||||
</xsl:when>
|
||||
<xsl:when test="style_id = 4">
|
||||
<!-- <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Строка с объектами >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -->
|
||||
<Row>
|
||||
<Cell ss:StyleID="CellReg">
|
||||
<Data ss:Type="String">
|
||||
<xsl:value-of select="region" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:Index="2" ss:StyleID="CellCity">
|
||||
<Data ss:Type="String">
|
||||
<xsl:value-of select="city" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:Index="3" ss:StyleID="Cell3">
|
||||
<Data ss:Type="String">
|
||||
<xsl:value-of select="boiler" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:MergeAcross="1" ss:Index="4" ss:StyleID="Cell4">
|
||||
<Data ss:Type="String">
|
||||
<xsl:value-of select="address" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell4">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="floors" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell4">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="square" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell4">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="people_count" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell4">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="volume_heat" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell4">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="sum_heat" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell4">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="volume_hwater" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell4">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="sum_hwater" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell4">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="volume_cwater" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell4">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="sum_cwater" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell4">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="volume_sewers" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell4">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="sum_sewers" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell4">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="saldo_out" />
|
||||
</Data>
|
||||
</Cell>
|
||||
</Row>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
<xsl:template match="Jur">
|
||||
<xsl:choose>
|
||||
<xsl:when test="style_id = 1">
|
||||
<!-- <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Строка с улусом >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -->
|
||||
<Row>
|
||||
<Cell ss:MergeAcross="3" ss:StyleID="Cell1">
|
||||
<Data ss:Type="String">
|
||||
<xsl:value-of select="reg" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell1">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="count" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell1">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="building_volume" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell1">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="heat_volume" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell1">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="heat_summa" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell1">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="gcal_ost" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell1">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="gcal_ost_summa" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell1">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="hw_vol" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell1">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="hw_summa" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell1">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="vol_xvs" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell1">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="sum_xvs" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell1">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="vol_kan" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell1">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="sum_kan" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell1">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="all_summa" />
|
||||
</Data>
|
||||
</Cell>
|
||||
</Row>
|
||||
</xsl:when>
|
||||
<xsl:when test="style_id = 2">
|
||||
<!-- <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Строка с населенным пунктом >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -->
|
||||
<Row>
|
||||
<Cell ss:StyleID="Cell2">
|
||||
<Data ss:Type="String">
|
||||
<xsl:value-of select="reg" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:Index="2" ss:MergeAcross="2" ss:StyleID="Cell2">
|
||||
<Data ss:Type="String">
|
||||
<xsl:value-of select="city" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell2">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="count" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell2">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="building_volume" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell2">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="heat_volume" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell2">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="heat_summa" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell2">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="gcal_ost" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell2">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="gcal_ost_summa" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell2">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="hw_vol" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell2">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="hw_summa" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell2">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="vol_xvs" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell2">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="sum_xvs" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell2">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="vol_kan" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell2">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="sum_kan" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell2">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="all_summa" />
|
||||
</Data>
|
||||
</Cell>
|
||||
</Row>
|
||||
</xsl:when>
|
||||
<xsl:when test="style_id = 3">
|
||||
<!-- <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Строка с котельной >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -->
|
||||
<Row>
|
||||
<Cell ss:StyleID="Cell3">
|
||||
<Data ss:Type="String">
|
||||
<xsl:value-of select="reg" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell3">
|
||||
<Data ss:Type="String">
|
||||
<xsl:value-of select="city" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:Index="3" ss:MergeAcross="1" ss:StyleID="Cell3">
|
||||
<Data ss:Type="String">
|
||||
<xsl:value-of select="boiler" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell3">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="count" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell3">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="building_volume" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell3">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="heat_volume" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell3">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="heat_summa" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell3">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="gcal_ost" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell3">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="gcal_ost_summa" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell3">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="hw_vol" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell3">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="hw_summa" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell3">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="vol_xvs" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell3">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="sum_xvs" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell3">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="vol_kan" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell3">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="sum_kan" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell3">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="all_summa" />
|
||||
</Data>
|
||||
</Cell>
|
||||
</Row>
|
||||
</xsl:when>
|
||||
<xsl:when test="style_id = 4">
|
||||
<!-- <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Строка с объектами >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -->
|
||||
<Row>
|
||||
<Cell ss:StyleID="CellReg">
|
||||
<Data ss:Type="String">
|
||||
<xsl:value-of select="reg" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:Index="2" ss:StyleID="CellCity">
|
||||
<Data ss:Type="String">
|
||||
<xsl:value-of select="city" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:Index="3" ss:StyleID="Cell3">
|
||||
<Data ss:Type="String">
|
||||
<xsl:value-of select="boiler" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:MergeAcross="1" ss:Index="4" ss:StyleID="Cell4">
|
||||
<Data ss:Type="String">
|
||||
<xsl:value-of select="name" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell4">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="building_volume" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell4">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="heat_volume" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell4">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="heat_summa" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell4">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="gcal_ost" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell4">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="gcal_ost_summa" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell4">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="hw_vol" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell4">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="hw_summa" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell4">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="vol_xvs" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell4">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="sum_xvs" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell4">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="vol_kan" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell4">
|
||||
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="sum_kan" />
|
||||
</Data>
|
||||
</Cell>
|
||||
<Cell ss:StyleID="Cell4">
|
||||
<Data ss:Type="Number">
|
||||
<xsl:value-of select="all_summa" />
|
||||
</Data>
|
||||
</Cell>
|
||||
</Row>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>`
|
||||
|
||||
const PrintReport = () => {
|
||||
const handleGenerateExcel = () => {
|
||||
// Define the example XML data
|
||||
const xmlData = `
|
||||
<root>
|
||||
<Kvp>
|
||||
<style_id>1</style_id>
|
||||
<region>Region 1</region>
|
||||
<city>City 1</city>
|
||||
<house_count>10</house_count>
|
||||
<square>1000</square>
|
||||
<people_count>500</people_count>
|
||||
<volume_heat>200</volume_heat>
|
||||
<sum_heat>1000</sum_heat>
|
||||
<volume_hwater>300</volume_hwater>
|
||||
<sum_hwater>1500</sum_hwater>
|
||||
<volume_cwater>400</volume_cwater>
|
||||
<sum_cwater>2000</sum_cwater>
|
||||
<volume_sewers>500</volume_sewers>
|
||||
<sum_sewers>2500</sum_sewers>
|
||||
<saldo_out>300</saldo_out>
|
||||
</Kvp>
|
||||
</root>
|
||||
`;
|
||||
|
||||
// Parse the XSL template and XML data
|
||||
const parser = new DOMParser();
|
||||
const xslDoc = parser.parseFromString(xslTemplate, "application/xml");
|
||||
const xmlDoc = parser.parseFromString(xmlData, "application/xml");
|
||||
|
||||
// Apply the transformation
|
||||
const xsltProcessor = new XSLTProcessor();
|
||||
xsltProcessor.importStylesheet(xslDoc);
|
||||
const resultDocument = xsltProcessor.transformToDocument(xmlDoc);
|
||||
|
||||
// Serialize the result to a string
|
||||
const serializer = new XMLSerializer();
|
||||
const resultXml = serializer.serializeToString(resultDocument);
|
||||
|
||||
// Add missing Excel-specific headers if needed
|
||||
const correctedXml = `<?xml version="1.0" encoding="utf-8"?>\n` + resultXml
|
||||
|
||||
// Convert to Blob and trigger download
|
||||
const blob = new Blob([correctedXml], { type: "application/vnd.ms-excel" });
|
||||
const url = URL.createObjectURL(blob);
|
||||
const link = document.createElement("a");
|
||||
link.href = url;
|
||||
link.download = "template.xls";
|
||||
link.click();
|
||||
|
||||
// Clean up
|
||||
URL.revokeObjectURL(url);
|
||||
}
|
||||
|
||||
return (
|
||||
<Flex p='sm'>
|
||||
<Button onClick={handleGenerateExcel}>Сохранить в Excel</Button>
|
||||
</Flex>
|
||||
)
|
||||
}
|
||||
|
||||
export default PrintReport
|
@ -93,11 +93,11 @@ export default function Reports() {
|
||||
</Table.Thead>
|
||||
<Table.Tbody>
|
||||
{[...new Set(Object.keys(report).flatMap(key => Object.keys(report[key])))].map(id => {
|
||||
const row: any = { id: Number(id) };
|
||||
const row: Record<string, unknown> = { id: Number(id) };
|
||||
Object.keys(report).forEach(key => {
|
||||
row[key] = report[key][id];
|
||||
});
|
||||
return (<Table.Tr key={row.id}>
|
||||
return (<Table.Tr key={row.id as number}>
|
||||
{[
|
||||
{ field: 'id', headerName: '№', width: 70 },
|
||||
...Object.keys(report).map(key => ({
|
||||
@ -125,7 +125,7 @@ export default function Reports() {
|
||||
)
|
||||
}
|
||||
return (
|
||||
<Table.Td key={`${row.id}-${column.headerName}`}>{row[column.field]}</Table.Td>
|
||||
<Table.Td key={`${row.id}-${column.headerName}`}>{row[column.field] as string}</Table.Td>
|
||||
)
|
||||
})}
|
||||
</Table.Tr>)
|
||||
|
@ -1,63 +1,42 @@
|
||||
import { useRoles } from '../hooks/swrHooks'
|
||||
import { CreateField } from '../interfaces/create'
|
||||
import RoleService from '../services/RoleService'
|
||||
import FormFields from '../components/FormFields'
|
||||
import { Button, Loader, Modal, ScrollAreaAutosize, Table } from '@mantine/core'
|
||||
import { useDisclosure } from '@mantine/hooks'
|
||||
import { IRole } from '../interfaces/role'
|
||||
import { Loader, Stack } from '@mantine/core'
|
||||
import CustomTable from '../components/CustomTable'
|
||||
|
||||
export default function Roles() {
|
||||
const { roles, isError, isLoading } = useRoles()
|
||||
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
|
||||
const createFields: CreateField[] = [
|
||||
{ key: 'name', headerName: 'Название', type: 'string', required: true, defaultValue: '' },
|
||||
{ key: 'description', headerName: 'Описание', type: 'string', required: false, defaultValue: '' },
|
||||
]
|
||||
|
||||
const columns = [
|
||||
{ field: 'id', headerName: 'ID', type: "number" },
|
||||
{ field: 'name', headerName: 'Название', flex: 1, editable: true },
|
||||
{ field: 'description', headerName: 'Описание', flex: 1, editable: true },
|
||||
];
|
||||
|
||||
if (isError) return <div>Произошла ошибка при получении данных.</div>
|
||||
if (isLoading) return <Loader />
|
||||
|
||||
return (
|
||||
<ScrollAreaAutosize w={'100%'} h={'100%'} p='sm'>
|
||||
<Button onClick={open}>
|
||||
Добавить роль
|
||||
</Button>
|
||||
|
||||
<Modal opened={opened} onClose={close} title="Создание роли" centered>
|
||||
<FormFields
|
||||
fields={createFields}
|
||||
submitHandler={RoleService.createRole}
|
||||
/>
|
||||
</Modal>
|
||||
|
||||
<Table highlightOnHover>
|
||||
<Table.Thead>
|
||||
<Table.Tr>
|
||||
{columns.map(column => (
|
||||
<Table.Th key={column.field}>{column.headerName}</Table.Th>
|
||||
))}
|
||||
</Table.Tr>
|
||||
</Table.Thead>
|
||||
<Table.Tbody>
|
||||
{roles.map((role: IRole) => (
|
||||
<Table.Tr
|
||||
key={role.id}
|
||||
>
|
||||
{columns.map(column => (
|
||||
<Table.Td key={column.field}>{role[column.field as keyof IRole]}</Table.Td>
|
||||
))}
|
||||
</Table.Tr>
|
||||
))}
|
||||
</Table.Tbody>
|
||||
</Table>
|
||||
</ScrollAreaAutosize>
|
||||
<Stack w={'100%'} h={'100%'} p='sm'>
|
||||
<CustomTable
|
||||
createFields={createFields}
|
||||
submitHandler={RoleService.createRole}
|
||||
data={roles} columns={[
|
||||
{
|
||||
accessorKey: 'id',
|
||||
header: 'id',
|
||||
cell: (info) => info.getValue(),
|
||||
},
|
||||
{
|
||||
accessorKey: 'name',
|
||||
header: 'Название',
|
||||
cell: (info) => info.getValue(),
|
||||
},
|
||||
{
|
||||
accessorKey: 'description',
|
||||
header: 'Описание',
|
||||
cell: (info) => info.getValue(),
|
||||
},
|
||||
]} />
|
||||
</Stack>
|
||||
)
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
import { Flex } from '@mantine/core';
|
||||
import CustomTable from '../components/CustomTable';
|
||||
|
||||
function TableTest() {
|
||||
|
||||
return (
|
||||
<Flex direction='column' align='flex-start' gap='sm' p='sm'>
|
||||
<CustomTable />
|
||||
</Flex>
|
||||
)
|
||||
}
|
||||
|
||||
export default TableTest
|
@ -3,10 +3,8 @@ import { IRole } from "../interfaces/role"
|
||||
import { useEffect, useState } from "react"
|
||||
import { CreateField } from "../interfaces/create"
|
||||
import UserService from "../services/UserService"
|
||||
import FormFields from "../components/FormFields"
|
||||
import { Badge, Button, Flex, Loader, Modal, Pagination, ScrollAreaAutosize, Select, Table } from "@mantine/core"
|
||||
import { useDisclosure } from "@mantine/hooks"
|
||||
import { IUser } from "../interfaces/user"
|
||||
import { Flex, Loader, Stack } from "@mantine/core"
|
||||
import CustomTable from "../components/CustomTable"
|
||||
|
||||
export default function Users() {
|
||||
const { users, isError, isLoading } = useUsers()
|
||||
@ -21,8 +19,6 @@ export default function Users() {
|
||||
}
|
||||
}, [roles])
|
||||
|
||||
const [opened, { open, close }] = useDisclosure(false);
|
||||
|
||||
const createFields: CreateField[] = [
|
||||
{ key: 'email', headerName: 'E-mail', type: 'string', required: true, defaultValue: '' },
|
||||
{ key: 'login', headerName: 'Логин', type: 'string', required: true, defaultValue: '' },
|
||||
@ -32,24 +28,6 @@ export default function Users() {
|
||||
{ key: 'password', headerName: 'Пароль', type: 'string', required: true, defaultValue: '' },
|
||||
]
|
||||
|
||||
const columns = [
|
||||
{ field: 'id', headerName: 'ID', type: "number", flex: 1 },
|
||||
{ field: 'email', headerName: 'Email', flex: 1, editable: true },
|
||||
{ field: 'login', headerName: 'Логин', flex: 1, editable: true },
|
||||
{ field: 'phone', headerName: 'Телефон', flex: 1, editable: true },
|
||||
{ field: 'name', headerName: 'Имя', flex: 1, editable: true },
|
||||
{ field: 'surname', headerName: 'Фамилия', flex: 1, editable: true },
|
||||
{ field: 'is_active', headerName: 'Статус', type: "boolean", flex: 1, editable: true },
|
||||
{
|
||||
field: 'role_id',
|
||||
headerName: 'Роль',
|
||||
valueOptions: roles ? roles.map((role: IRole) => ({ label: role.name, value: role.id })) : [],
|
||||
type: 'singleSelect',
|
||||
flex: 1,
|
||||
editable: true
|
||||
},
|
||||
];
|
||||
|
||||
if (isError) return (
|
||||
<div>
|
||||
Произошла ошибка при получении данных.
|
||||
@ -65,97 +43,50 @@ export default function Users() {
|
||||
}
|
||||
|
||||
return (
|
||||
<ScrollAreaAutosize w={'100%'} h={'100%'} p='sm'>
|
||||
<Button onClick={open}>
|
||||
Добавить пользователя
|
||||
</Button>
|
||||
|
||||
<Modal opened={opened} onClose={close} title="Регистрация пользователя" centered>
|
||||
<FormFields
|
||||
fields={createFields}
|
||||
submitHandler={UserService.createUser}
|
||||
/>
|
||||
</Modal>
|
||||
|
||||
<Stack w={'100%'} h={'100%'} p='xs'>
|
||||
{Array.isArray(roleOptions) &&
|
||||
<Table highlightOnHover>
|
||||
<Table.Thead>
|
||||
<Table.Tr>
|
||||
{columns.map(column => (
|
||||
<Table.Th key={column.field}>{column.headerName}</Table.Th>
|
||||
))}
|
||||
</Table.Tr>
|
||||
</Table.Thead>
|
||||
<Table.Tbody>
|
||||
{users.map((user: IUser) => (
|
||||
<Table.Tr
|
||||
key={user.id}
|
||||
//bg={selectedRows.includes(element.position) ? 'var(--mantine-color-blue-light)' : undefined}
|
||||
>
|
||||
{columns.map(column => {
|
||||
if (column.field === 'is_active') {
|
||||
return (
|
||||
user.is_active ? (
|
||||
<Table.Td key={column.field}>
|
||||
<Badge fullWidth variant="light">
|
||||
Активен
|
||||
</Badge>
|
||||
</Table.Td>
|
||||
) : (
|
||||
<Table.Td key={column.field}>
|
||||
<Badge color="gray" fullWidth variant="light">
|
||||
Отключен
|
||||
</Badge>
|
||||
</Table.Td>
|
||||
)
|
||||
)
|
||||
}
|
||||
else if (column.field === 'role_id') {
|
||||
return (
|
||||
<Table.Td key={column.field}>
|
||||
<Select
|
||||
data={roleOptions}
|
||||
defaultValue={user.role_id.toString()}
|
||||
variant="unstyled"
|
||||
allowDeselect={false}
|
||||
/>
|
||||
</Table.Td>
|
||||
)
|
||||
}
|
||||
else return (
|
||||
<Table.Td key={column.field}>{user[column.field as keyof IUser]}</Table.Td>
|
||||
)
|
||||
})}
|
||||
</Table.Tr>
|
||||
))}
|
||||
</Table.Tbody>
|
||||
</Table>
|
||||
<CustomTable
|
||||
createFields={createFields}
|
||||
submitHandler={UserService.createUser}
|
||||
data={users}
|
||||
columns={[
|
||||
{
|
||||
accessorKey: 'email',
|
||||
header: 'E-mail',
|
||||
cell: (info) => info.getValue(),
|
||||
},
|
||||
{
|
||||
accessorKey: 'login',
|
||||
header: 'Логин',
|
||||
cell: (info) => info.getValue(),
|
||||
},
|
||||
{
|
||||
accessorKey: 'phone',
|
||||
header: 'Телефон',
|
||||
cell: (info) => info.getValue(),
|
||||
},
|
||||
{
|
||||
accessorKey: 'name',
|
||||
header: 'Имя',
|
||||
cell: (info) => info.getValue(),
|
||||
},
|
||||
{
|
||||
accessorKey: 'surname',
|
||||
header: 'Фамилия',
|
||||
cell: (info) => info.getValue(),
|
||||
},
|
||||
{
|
||||
accessorKey: 'is_active',
|
||||
header: 'Активен',
|
||||
cell: (info) => info.getValue(),
|
||||
},
|
||||
{
|
||||
accessorKey: 'role_id',
|
||||
header: 'Роль',
|
||||
cell: (info) => info.getValue(),
|
||||
}
|
||||
]} />
|
||||
}
|
||||
|
||||
<Pagination total={10} />
|
||||
|
||||
{/* <DataGrid
|
||||
density="compact"
|
||||
autoHeight
|
||||
style={{ width: "100%" }}
|
||||
rows={users}
|
||||
columns={columns}
|
||||
initialState={{
|
||||
pagination: {
|
||||
paginationModel: { page: 0, pageSize: 10 },
|
||||
},
|
||||
}}
|
||||
pageSizeOptions={[10, 20, 50, 100]}
|
||||
checkboxSelection
|
||||
disableRowSelectionOnClick
|
||||
|
||||
processRowUpdate={(updatedRow) => {
|
||||
return updatedRow
|
||||
}}
|
||||
|
||||
onProcessRowUpdateError={() => {
|
||||
}}
|
||||
/> */}
|
||||
</ScrollAreaAutosize>
|
||||
</Stack>
|
||||
)
|
||||
}
|
Reference in New Issue
Block a user