Compare commits

..

No commits in common. "6d50f9594a285ced713fba9c55231f85072eedfa" and "6f00c9c540249d012d11f3c0840b51f6f10a9189" have entirely different histories.

53 changed files with 844 additions and 2961 deletions

91
package-lock.json generated
View File

@ -38,7 +38,6 @@
"gsap": "^3.11.5",
"http-proxy-middleware": "^2.0.6",
"js-md5": "^0.8.3",
"konva": "^8.3.14",
"lodash": "^4.17.21",
"moment": "^2.29.4",
"ol": "^7.4.0",
@ -49,7 +48,6 @@
"react-audio-player": "^0.17.0",
"react-cookies": "^0.1.1",
"react-dom": "^18.2.0",
"react-konva": "^18.2.3",
"react-pdf": "^7.3.3",
"react-redux": "^8.0.2",
"react-rnd": "^10.4.11",
@ -6595,14 +6593,6 @@
"@types/react": "*"
}
},
"node_modules/@types/react-reconciler": {
"version": "0.28.8",
"resolved": "https://registry.npmmirror.com/@types/react-reconciler/-/react-reconciler-0.28.8.tgz",
"integrity": "sha512-SN9c4kxXZonFhbX4hJrZy37yw9e7EIxcpHCxQv5JUS18wDE5ovkQKlqQEkufdJCCMfuI9BnjUJvhYeJ9x5Ra7g==",
"dependencies": {
"@types/react": "*"
}
},
"node_modules/@types/resolve": {
"version": "1.17.1",
"resolved": "https://registry.npmmirror.com/@types/resolve/-/resolve-1.17.1.tgz",
@ -13014,17 +13004,6 @@
"node": ">=8"
}
},
"node_modules/its-fine": {
"version": "1.2.5",
"resolved": "https://registry.npmmirror.com/its-fine/-/its-fine-1.2.5.tgz",
"integrity": "sha512-fXtDA0X0t0eBYAGLVM5YsgJGsJ5jEmqZEPrGbzdf5awjv0xE7nqv3TVnvtUF060Tkes15DbDAKW/I48vsb6SyA==",
"dependencies": {
"@types/react-reconciler": "^0.28.0"
},
"peerDependencies": {
"react": ">=18.0"
}
},
"node_modules/jake": {
"version": "10.8.5",
"resolved": "https://registry.npmmirror.com/jake/-/jake-10.8.5.tgz",
@ -15086,25 +15065,6 @@
"node": ">= 8"
}
},
"node_modules/konva": {
"version": "8.4.3",
"resolved": "https://registry.npmmirror.com/konva/-/konva-8.4.3.tgz",
"integrity": "sha512-ARqdgAbdNIougRlOKvkQwHlGhXPRBV4KvhCP+qoPpGoVQwwiJe4Hkdu4HHdRPb9rGUp04jDTAxBzEwBsE272pg==",
"funding": [
{
"type": "patreon",
"url": "https://www.patreon.com/lavrton"
},
{
"type": "opencollective",
"url": "https://opencollective.com/konva"
},
{
"type": "github",
"url": "https://github.com/sponsors/lavrton"
}
]
},
"node_modules/l7-tiny-sdf": {
"version": "0.0.4",
"resolved": "https://registry.npmjs.org/l7-tiny-sdf/-/l7-tiny-sdf-0.0.4.tgz",
@ -18833,51 +18793,6 @@
"resolved": "https://registry.npmmirror.com/react-is/-/react-is-16.13.1.tgz",
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="
},
"node_modules/react-konva": {
"version": "18.2.10",
"resolved": "https://registry.npmmirror.com/react-konva/-/react-konva-18.2.10.tgz",
"integrity": "sha512-ohcX1BJINL43m4ynjZ24MxFI1syjBdrXhqVxYVDw2rKgr3yuS0x/6m1Y2Z4sl4T/gKhfreBx8KHisd0XC6OT1g==",
"funding": [
{
"type": "patreon",
"url": "https://www.patreon.com/lavrton"
},
{
"type": "opencollective",
"url": "https://opencollective.com/konva"
},
{
"type": "github",
"url": "https://github.com/sponsors/lavrton"
}
],
"dependencies": {
"@types/react-reconciler": "^0.28.2",
"its-fine": "^1.1.1",
"react-reconciler": "~0.29.0",
"scheduler": "^0.23.0"
},
"peerDependencies": {
"konva": "^8.0.1 || ^7.2.5 || ^9.0.0",
"react": ">=18.0.0",
"react-dom": ">=18.0.0"
}
},
"node_modules/react-konva/node_modules/react-reconciler": {
"version": "0.29.2",
"resolved": "https://registry.npmmirror.com/react-reconciler/-/react-reconciler-0.29.2.tgz",
"integrity": "sha512-zZQqIiYgDCTP/f1N/mAR10nJGrPD2ZR+jDSEsKWJHYC7Cm2wodlwbR3upZRdC3cjIjSlTLNVyO7Iu0Yy7t2AYg==",
"dependencies": {
"loose-envify": "^1.1.0",
"scheduler": "^0.23.2"
},
"engines": {
"node": ">=0.10.0"
},
"peerDependencies": {
"react": "^18.3.1"
}
},
"node_modules/react-lifecycles-compat": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz",
@ -19688,9 +19603,9 @@
}
},
"node_modules/scheduler": {
"version": "0.23.2",
"resolved": "https://registry.npmmirror.com/scheduler/-/scheduler-0.23.2.tgz",
"integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==",
"version": "0.23.0",
"resolved": "https://registry.npmmirror.com/scheduler/-/scheduler-0.23.0.tgz",
"integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==",
"dependencies": {
"loose-envify": "^1.1.0"
}

View File

@ -50,10 +50,7 @@
"react-router-dom": "^6.3.0",
"react-scripts": "5.0.1",
"redux": "^4.2.0",
"typescript": "^4.7.4",
"konva": "^8.3.14",
"react-konva": "^18.2.3"
"typescript": "^4.7.4"
},
"scripts": {
"start": "craco start",

View File

@ -53,7 +53,7 @@ class BasicCrudModal extends React.Component {
}
onEdit = (path,values) => {
createCrudService(path).edit(values).then((result) => {
createCrudService(path).edit1(values).then((result) => {
if (result?.code === 200) {
message.success('修改成功');
this.setState({ open: false });

View File

@ -208,10 +208,4 @@ code {
}
.flex-end{
justify-content: flex-end;
}
.ellipsis1 {
overflow:hidden;/*内容超出后隐藏*/
text-overflow:ellipsis;/*超出内容显示为省略号*/
white-space:nowrap;/*文本不进行换行*/
}

View File

@ -350,9 +350,6 @@ export async function loadMenu(): Promise<MenuItem[]> {
{ id: id(), title: '防治宣传', path: '/mgr/sg/byfz/byxc' },
]
},
{
id: id(), title: '闸门监控', path: '/mgr/sg/zmjk',
},
{
id: id(), title: '维修养护', path: '/mgr/sg/wxyh',
},

View File

@ -62,14 +62,6 @@ const apiurl = {
role: service_xyt + '/system/menu/list'
},
//闸门监控
zmjk: {
getList : service_xyt + '/attGateB/list',
getInformation: service_xyt + '/attGateB/data',
getDamData: service_xyt + '/gatePore/listByStcd',
getVideo: service_xyt + '/gateValveCctvRel/list'
},
// 基本情况
home: {
yq: service_fxdd + '/real/rain/list',//'/stStbprpB/rainfallStationDetails/rainfallList',//雨情
@ -1090,49 +1082,8 @@ const apiurl = {
// 全周期
gcdsj:{
qzqda:{
list:service_fxdd + '/projectEvents/doc/page',
export: service_fxdd + '/projectEvents/export'
list:service_fxdd + '/projectEvents/doc/page'
}
},
szzf:{
ajdj:{
list:service_fxdd + '/szCase/page',
add:service_fxdd + '/szCase/insert',
edit:service_fxdd + '/szCase/update',
del:service_fxdd + '/szCase/del/',
upload:service_fxdd + '/szCase/file/upload/singleSimple',
download:service_fxdd + '/szCase/file/download/',
detail:service_fxdd + '/szCase/get/'
},
ajtj:{
// 统计类型 0:案件来源,1:案件类型,2:执行类型
info:service_fxdd + '/szCase/statistics/',
//趋势
qs:service_fxdd + '/szCase/statisticsNum/'
},
clyj:{
tree:service_fxdd + '/szTreatmentBasis/get/tree',
edit:service_fxdd + '/szTreatmentBasis/update',
add:service_fxdd + '/szTreatmentBasis/insert',
del:service_fxdd + '/szTreatmentBasis/del/',
detail:service_fxdd + '/szTreatmentBasis/get/'
}
},
flfg:{
edit:service_fxdd + '/SzRuleByLaw/update',
add:service_fxdd + '/SzRuleByLaw/insert',
del:service_fxdd + '/SzRuleByLaw/del/',
upload:service_fxdd + '/SzRuleByLaw/file/upload/singleSimple',
download:service_fxdd + '/SzRuleByLaw/file/download/',
list:service_fxdd + '/SzRuleByLaw/page'
},
zdgl:{
edit:service_fxdd + '/SzRegulatoryFramework/update',
add:service_fxdd + '/SzRegulatoryFramework/insert',
del:service_fxdd + '/SzRegulatoryFramework/del/',
upload:service_fxdd + '/SzRegulatoryFramework/file/upload/singleSimple',
download:service_fxdd + '/SzRegulatoryFramework/file/download/',
list:service_fxdd + '/SzRegulatoryFramework/page'
}
}

View File

@ -435,20 +435,6 @@ export function httpPostFile(url, data = {}) {
// return sendFile(url, options);
// }
export function httppostAddfile(url, data = {},key,fileKey) {
const form = new FormData();
let json=new Blob([JSON.stringify(data)],{ type: "application/json" })
// form.append(key, json);
if(data.file){
form.append("file", data.file.originFileObj??data.file);
}
const options = {
method: 'POST',
body: form,
};
return send(url, options);
}
async function sendFile(url, options) {
try {
const res = await request(url, options,'blob');

View File

@ -10,20 +10,6 @@ export function changeObjectStringToMoment(obj: { [key: string]: any }, fields:
return ret;
}
export function apertureMeter(val?: any): number | undefined {
if (typeof val !== 'number') {
return undefined
}
return val / 1000;
}
export function renAperture(val?: any) {
if (typeof val !== 'number') {
return '-'
}
return (val / 1000).toFixed(3);
}
export async function base64FromFile(file: File): Promise<string | undefined> {
return new Promise((resolve) => {

View File

@ -48,7 +48,6 @@ import Xjxpz from "./rcgl/xcxj/xjxpz"
import Fzxc from "./rcgl/byfz/fzxc"
import Bypc from "./rcgl/byfz/bypc"
import Zmjk from "./rcgl/zmjk"
import Wxyh from "./rcgl/wxyh"
import Szzb from "./rcgl/szzb"
import Stlljc from "./rcgl/stlljc"
@ -197,7 +196,6 @@ const AppRouters: React.FC = () => {
{ path: 'sg/xcxj/xjxpz', element: <Xjxpz/> },
{ path: 'sg/byfz/byxc', element: <Fzxc /> },
{ path: 'sg/byfz/bypc', element: <Bypc /> },
{ path: 'sg/zmjk', element: <Zmjk /> },
{ path: 'sg/wxyh', element: <Wxyh /> },
{ path: 'sg/aqgl/aqjcgl', element: <Aqjcgl /> },
{ path: 'sg/aqgl/fxgkqd', element: <Fxgkqd /> },

View File

@ -1,38 +0,0 @@
import React from 'react'
import { Shape } from 'react-konva';
const ColorPolygon: React.FC<{
pts: ({ x?: number, y?: number } | [number, number])[]
fill: string;
desc?: string;
opacity?: number;
}> = ({ pts, fill, opacity }) => {
return (
<Shape
fill={fill}
opacity={opacity}
sceneFunc={(context:any, shape:any) => {
context.beginPath();
pts.forEach((p, i) => {
let x:any, y:any;
if (Array.isArray(p)) {
x = p[0];
y = p[1];
} else {
x = p.x;
y = p.y;
}
if (i === 0) {
context.moveTo(x, y);
} else {
context.lineTo(x, y);
}
})
context.closePath();
context.fillStrokeShape(shape)
}}
/>
)
}
export default ColorPolygon

View File

@ -1,46 +0,0 @@
import React from 'react';
import { Layer, Rect } from 'react-konva';
import ColorPolygon from './ColorPolygon';
import { CanvasH, CanvasW, FarBuildingTop, Horizontal, RoofTop, SideRoomSize } from './consts';
import { ControlPts } from './coordinates';
import { RoomWindows } from './Window';
const Sider: React.FC<{
pts: ControlPts;
side: 'left' | 'right';
}> = ({ side, pts }) => {
return (
<Layer
x={side === 'left' ? 0 : CanvasW}
scaleX={side === 'left' ? 1 : -1}
width={CanvasW * 0.5}
>
<ColorPolygon desc='水' fill="#458eab" pts={[[0, Horizontal], [0, CanvasH], [CanvasW * 0.5, CanvasH], [CanvasW * 0.5, Horizontal]]} />
<ColorPolygon desc='远处的墙' fill="#8fa7a7" pts={[[0, FarBuildingTop], pts.C2, pts.C1, [pts.C1.x, FarBuildingTop]]} />
<Rect x={pts.RoomLT.x} y={pts.RoomLT.y} width={SideRoomSize} height={SideRoomSize} fill="#738785" />
<RoomWindows rect={[pts.RoomLT.x, pts.RoomLT.y + 8, pts.RoomRB.x - 16, pts.RoomRB.y]} />
<ColorPolygon desc='房屋侧面' fill="#4a5c5e" pts={[pts.RoomRT, pts.RoomRB, pts.RoomRBFar, pts.RoomRTFar]} />
<Rect x={pts.RoomLT.x - 2} y={pts.RoomLT.y} width={SideRoomSize + 4} height={8} fill="#f2ebcd" />
<ColorPolygon desc='房屋侧面-白条' fill="#f2ebcd" pts={[
[pts.RoomRT.x + 2, pts.RoomRT.y],
[pts.RoomRB.x + 2, pts.RoomRT.y + 8],
[pts.RoomRTFar.x! + 2, pts.RoomRTFar.y! + 8],
[pts.RoomRTFar.x! + 2, pts.RoomRTFar.y!]
]} />
<ColorPolygon desc='房屋底面' fill="#4a5c5e" pts={[pts.RoomLB, pts.RoomLBFar, pts.RoomRBFar, pts.RoomRB]} />
<Rect x={pts.RoomRB.x - 16} y={pts.RoomRB.y - 8 - SideRoomSize} width={16} height={SideRoomSize} fill="#6e3a34" />
<ColorPolygon desc='侧面' fill="#4a5c5e" pts={[pts.L2, pts.B2, pts.B1, pts.L1]} />
<ColorPolygon desc='上盖' fill="#728381" pts={[pts.C2, pts.L2, pts.L1, pts.C1]} />
<ColorPolygon desc='墙' fill="#738b8b" pts={[[pts.C1.x, RoofTop], pts.C1, pts.L1, pts.A1]} />
<ColorPolygon desc='内壁' fill="#334648" pts={[pts.A1, pts.B1, pts.B3, pts.A2]} />
</Layer>
)
}
export default React.memo(Sider)

View File

@ -1,105 +0,0 @@
import React, { useMemo } from 'react';
import { Layer, Rect } from 'react-konva';
import ColorPolygon from './ColorPolygon';
import { Window1, WindowSep } from './Window';
import { TopRoomHeight } from './consts';
import { ControlPts, mirror } from './coordinates';
const Topper1: React.FC<{
pts: ControlPts;
type: number;
}> = ({ pts, type }) => {
const windows = useMemo<{
w: number[][];
h: number[][];
}>(() => {
const x1 = pts.TopRectLB.x;
const y0 = pts.TopRectLB.y - TopRoomHeight
const y1 = pts.TopRectLB.y - TopRoomHeight * 0.75;
const x2 = pts.TopRectRB.x;
const y2 = pts.TopRectLB.y - TopRoomHeight * 0.25;
if (type === 1) {
const u = (x2 - x1) / 10;
return {
w: [
[x1 + u, y1, x1 + 3 * u, y2],
[x1 + 4 * u, y1, x1 + 6 * u, y2],
[x1 + 7 * u, y1, x1 + 9 * u, y2],
],
h: []
}
} else if (type === 2) {
const u = (x2 - x1 - 8) / 14;
return {
w: [
[x1 + u, y1, x1 + 3 * u, y2],
[x1 + 4 * u, y1, x1 + 6 * u, y2],
[x1 + 8 * u + 8, y1, x1 + 10 * u + 8, y2],
[x1 + 11 * u + 8, y1, x1 + 13 * u + 8, y2],
],
h: [
[x1 + 7 * u, y0, x1 + 7 * u + 8, pts.TopRectLB.y],
],
}
} else if (type === 3) {
const xc = (x2 - x1) * 0.5;
const u = (xc - 8) / 8;
return {
w: [
[x1 + u, y1, x1 + 3 * u, y2],
[x1 + 5 * u + 8, y1, x1 + 7 * u + 8, y2],
[x1 + u + xc, y1, x1 + 3 * u + xc, y2],
[x1 + 5 * u + 8 + xc, y1, x1 + 7 * u + 8 + xc, y2],
],
h: [
[x1 + 4 * u, y0, x1 + 4 * u + 8, pts.TopRectLB.y],
[x1 + 4 * u + xc, y0, x1 + 4 * u + 8 + xc, pts.TopRectLB.y],
]
}
} else if (type > 3) {
const xc1 = (x2 - x1) / 3;
const xc2 = xc1 * 2;
const u = (xc1 - 8) / 8;
return {
w: [
[x1 + u, y1, x1 + 3 * u, y2],
[x1 + 5 * u + 8, y1, x1 + 7 * u + 8, y2],
[x1 + u + xc1, y1, x1 + 3 * u + xc1, y2],
[x1 + 5 * u + 8 + xc1, y1, x1 + 7 * u + 8 + xc1, y2],
[x1 + u + xc2, y1, x1 + 3 * u + xc2, y2],
[x1 + 5 * u + 8 + xc2, y1, x1 + 7 * u + 8 + xc2, y2],
],
h: [
[x1 + 4 * u, y0, x1 + 4 * u + 8, pts.TopRectLB.y],
[x1 + 4 * u + xc1, y0, x1 + 4 * u + 8 + xc1, pts.TopRectLB.y],
[x1 + 4 * u + xc2, y0, x1 + 4 * u + 8 + xc2, pts.TopRectLB.y],
]
}
}
return {
w: [], h: []
}
}, [])
return (
<Layer>
<Rect fill='#738b8b' x={pts.TopRectLB.x} y={pts.TopRectLB.y - TopRoomHeight} width={pts.TopRectRB.x - pts.TopRectLB.x} height={TopRoomHeight} />
<ColorPolygon fill='#4a5c5e' pts={[pts.TopRectLB, pts.RoomRBFar, mirror(pts.RoomRBFar), pts.TopRectRB]} />
{
pts.SepsLTLBRBRT.map((s, index) => (
<ColorPolygon key={'a' + index} fill='#334648' pts={s} />
))
}
{
windows.w.map((o, index) => <Window1 rect={o} key={'w' + index} />)
}
{
windows.h.map((o, index) => <WindowSep rect={o} key={'h' + index} />)
}
</Layer>
)
}
export default React.memo(Topper1);

View File

@ -1,29 +0,0 @@
import React from 'react';
import { Layer, Rect } from 'react-konva';
import ColorPolygon from './ColorPolygon';
import { CanvasH, CanvasW, ViewCenter, WaterTop } from './consts';
import { ControlPts, interpolate, intersection, mirror } from './coordinates';
const Topper2: React.FC<{
pts: ControlPts;
waterRatio: number;
}> = ({ pts, waterRatio }) => {
const waterP1 = interpolate(pts.B1, { x: pts.L1.x, y: WaterTop }, waterRatio);
const waterP2 = intersection(waterP1, ViewCenter, { x: 0, y: undefined });
return (
<Layer>
{
pts.SepsFront.map((s, index) => (
<Rect key={index} fill='#738b8b' x={s.x} y={s.y} width={s.w} height={s.h} />
))
}
<ColorPolygon fill='#539cb9' pts={[waterP1, waterP2, mirror(waterP2), mirror(waterP1)]} opacity={0.8} />
<ColorPolygon fill='#2d99ba' pts={[waterP2, mirror(waterP2), [CanvasW, CanvasH], [0, CanvasH]]} opacity={0.8} />
</Layer>
)
}
export default React.memo(Topper2);

View File

@ -1,104 +0,0 @@
import React from 'react'
import { Line, Rect } from 'react-konva';
import ColorPolygon from './ColorPolygon';
const S1 = 4;
export const Window1: React.FC<{
rect: number[];
}> = ({ rect }) => {
const [x1, y1, x2, y2] = rect;
const w1 = (x2 - x1 - S1) / 2;
const w2 = (x2 - x1 - S1 * 2) / 3;
return (
<>
<Rect fill='#b1c3cf' x={x1} y={y1} width={w1} height={16} />
<Rect fill='#b1c3cf' x={x1 + w1 + S1} y={y1} width={w1} height={16} />
<Rect fill='#b1c3cf' x={x1} y={y1 + 16 + S1} width={w2} height={y2 - y1 - 16 - S1} />
<Rect fill='#b1c3cf' x={x1 + w2 + S1} y={y1 + 16 + S1} width={w2} height={y2 - y1 - 16 - S1} />
<Rect fill='#b1c3cf' x={x1 + (w2 + S1) * 2} y={y1 + 16 + S1} width={w2} height={y2 - y1 - 16 - S1} />
</>
)
}
export const WindowSep: React.FC<{
rect: number[];
}> = ({ rect }) => {
const [x1, y1, x2, y2] = rect;
return (
<Rect fill='#b1c3cf' x={x1} y={y1 - 8} width={x2 - x1} height={y2 - y1 + 8} />
)
}
export const RoomWindows: React.FC<{
rect: number[];
}> = ({ rect }) => {
const [x1, y1, x2, y2] = rect;
const u = (x2 - x1) / 10;
const v = (y2 - y1) / 6;
const c1 = x1 - 10 + 1;
const c2 = x1 - 10 + 7 * u;
const dc = (c2 - c1) / 10;
return (
<>
<Rect fill='#c1d3d5' x={x1 + u} y={y1 + v} width={u} height={v} />
<Line stroke='#fff' points={[x1 + u, y1 + v, x1 + 2 * u, y1 + v]} />
<Rect fill='#c1d3d5' x={x1 + u * 2 + 2} y={y1 + v} width={u} height={v} />
<Line stroke='#fff' points={[x1 + u * 2 + 2, y1 + v, x1 + 3 * u + 2, y1 + v]} />
<Rect fill='#c1d3d5' x={x1 + u * 5} y={y1 + v} width={u} height={v} />
<Line stroke='#fff' points={[x1 + u * 5, y1 + v, x1 + 6 * u, y1 + v]} />
<Rect fill='#c1d3d5' x={x1 + u * 6 + 2} y={y1 + v} width={u} height={v} />
<Line stroke='#fff' points={[x1 + u * 6 + 2, y1 + v, x1 + 7 * u + 2, y1 + v]} />
<Rect fill='#c1d3d5' x={x1 + u} y={y1 + v * 4} width={u} height={v} />
<Line stroke='#fff' points={[x1 + u, y1 + v * 4, x1 + 2 * u, y1 + v * 4]} />
<Rect fill='#c1d3d5' x={x1 + u * 2 + 2} y={y1 + v * 4} width={u} height={v} />
<Line stroke='#fff' points={[x1 + u * 2 + 2, y1 + v * 4, x1 + 3 * u + 2, y1 + v * 4]} />
<Rect fill='#c1d3d5' x={x1 + u * 5} y={y1 + v * 4} width={u} height={v} />
<Line stroke='#fff' points={[x1 + u * 5, y1 + v * 4, x1 + 6 * u, y1 + v * 4]} />
<Rect fill='#c1d3d5' x={x1 + u * 6 + 2} y={y1 + v * 4} width={u} height={v} />
<Line stroke='#fff' points={[x1 + u * 6 + 2, y1 + v * 4, x1 + 7 * u + 2, y1 + v * 4]} />
<Rect fill='#8fa7a7' x={x1 - 10} y={y1 + 3 * v} width={7 * u} height={v * 0.6} />
<ColorPolygon
fill='#4a5c5e'
pts={[
[x1 - 10, y1 + 3.6 * v],
[x1 - 10 + 4, y1 + 3.6 * v + 2],
[x1 - 10 + 7 * u + 3, y1 + 3.6 * v + 2],
[x1 - 10 + 7 * u + 3, y1 + 3 * v + 2],
[x1 - 10 + 7 * u, y1 + 3 * v],
[x1 - 10 + 7 * u, y1 + 3.6 * v + 2],
[x1 - 10 + 7 * u, y1 + 3.6 * v],
]}
/>
<Line stroke='#8fa7a7' lineJoin='round' points={[
x1, y1 + 2.5 * v + 2,
x1 - 10 + 4, y1 + 2.5 * v + 2,
x1 - 10, y1 + 2.5 * v, x1 - 10 + 7 * u, y1 + 2.5 * v,
x1 - 10 + 7 * u + 3, y1 + 2.5 * v + 2,
]} />
<Line stroke='#8fa7a7' points={[x1 - 10 + 4, y1 + 2.5 * v + 2, x1 - 10 + 4, y1 + 3 * v]} />
{
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map(i => (
<Line key={i} stroke='#8fa7a7' points={[c1 + dc * i, y1 + 2.5 * v, c1 + dc * i, y1 + 3 * v]} />
))
}
</>
)
}

View File

@ -1,119 +0,0 @@
import React from 'react'
import { Circle, Layer, Line, Rect } from 'react-konva';
import ColorPolygon from './ColorPolygon';
import { ViewCenter, WaterTop } from './consts';
import { ControlPts, interpolate, intersection } from './coordinates';
import ZmDec from './ZmDec';
import { useLinearAnim } from './useLinearAnim';
const ZmColumn: React.FC<{
kdMax: number;
gtophgt?: number;
idx: number;
pts: ControlPts;
waterRatio: number;
selected: boolean;
}> = ({ kdMax, gtophgt, idx, pts, waterRatio, selected }) => {
const renKd = gtophgt; //useLinearAnim(gtophgt);
const a = pts.ZmArea[idx];
if (!a || typeof renKd !== 'number') {
return null;
}
const hh1 = (a.lb1.y - a.lt1.y) * 0.5;
const hh2 = (a.lb2.y - a.lt2.y) * 0.5;
const ratio = renKd / kdMax;
const e1 = hh1 * ratio * 0.8;
const e2 = hh2 * ratio * 0.8;
const lineLineLeft = { x: (a.lt1.x + a.lt2.x) * 0.5, y: (a.lt1.y + a.lt2.y) * 0.5 };
const lineLineRight = { x: (a.rt1.x + a.rt2.x) * 0.5, y: (a.rt1.y + a.rt2.y) * 0.5 };
const line1 = interpolate(lineLineLeft, lineLineRight, 0.25);
const line2 = interpolate(lineLineLeft, lineLineRight, 0.75);
const ty1 = a.lt1.y + hh1 - e1;
const ty2 = a.lt2.y + hh2 - e2;
const joiny = (ty1 + ty2) * 0.5;
const waterP1 = interpolate(a.lb0, { x: a.lb0.x, y: WaterTop }, waterRatio);
const waterP1R = { x: a.rb0.x, y: waterP1.y };
const waterP2 = intersection(ViewCenter, waterP1, { x: a.lb1.x, y: undefined });
const waterP2R = { x: a.rb1.x, y: waterP2.y };
const waterP3 = intersection(ViewCenter, waterP1, { x: a.lb3.x, y: undefined });
waterP3.y -= 26;
const waterP3R = { x: a.rb3.x, y: waterP3.y };
if (waterP3.x < waterP2.x) {
waterP3.x = waterP2.x;
}
if (waterP3R.x > waterP2R.x) {
waterP3R.x = waterP2R.x
}
//
const b1 = { x: a.lb0.x, y: a.lb0.y - 32 };
const b6 = { x: a.rb0.x, y: a.rb0.y - 32 };
const b2 = interpolate(b1, b6, 0.4);
const b5 = interpolate(b1, b6, 0.6);
const b3 = { x: b2.x, y: b2.y + 12 };
const b4 = { x: b5.x, y: b5.y + 12 };
const b1_1 = intersection(b1, ViewCenter, { x: a.lb1.x, y: undefined });
const b1_6 = intersection(b6, ViewCenter, { x: a.rb1.x, y: undefined });
const b1_2 = intersection(b2, ViewCenter, { x: undefined, y: b1_1.y });
const b1_5 = intersection(b5, ViewCenter, { x: undefined, y: b1_6.y });
const b1_3 = intersection(b3, ViewCenter, { x: b1_2.x, y: undefined });
const b1_4 = intersection(b4, ViewCenter, { x: b1_5.x, y: undefined });
return (
<>
{
waterP3 && waterP3R ? (
<ColorPolygon fill='#539cb9' pts={[waterP2, waterP2R, waterP3R, waterP3]} opacity={0.8} />
) : null
}
<ColorPolygon
desc="闸门上测"
fill='#afb5b5'
pts={[
[a.lt1.x, ty1],
[a.rt1.x, ty1],
[a.rt2.x, ty2],
[a.lt2.x, ty2],
]}
/>
<Line stroke='#222' strokeWidth={8} lineCap="round" points={[line1.x, line1.y, line1.x, joiny]} />
<Line stroke='#222' strokeWidth={8} lineCap="round" points={[line2.x, line2.y, line2.x, joiny]} />
<Circle fill='#afb5b5' x={line1.x} y={joiny} radius={10} />
<Circle fill='#afb5b5' x={line2.x} y={joiny} radius={10} />
<Line stroke='#222' strokeWidth={12} points={[line1.x, joiny - 8, line1.x, joiny - 10]} />
<Line stroke='#222' strokeWidth={12} points={[line2.x, joiny - 8, line2.x, joiny - 10]} />
<Rect
desc='闸门正面'
fill={selected ? '#95927a' : '#5f6969'}
stroke={selected ? 'orange' : "#222"}
strokeWidth={1} x={a.lt1.x} y={ty1} width={a.rt1.x - a.lt1.x} height={hh1} />
<ZmDec tl={{ x: a.lt1.x, y: ty1 }} rb={{ x: a.rt1.x, y: ty1 + hh1 }} />
<ColorPolygon desc="出水口" fill='#8d9d9b' pts={[b1_1, b1_2, b2, b1]} />
<ColorPolygon desc="出水口" fill='#8d9d9b' pts={[b1_5, b1_6, b6, b5]} />
<ColorPolygon desc="出水口" fill='#8d9d9b' pts={[b1_2, b1_3, b3, b2]} />
<ColorPolygon desc="出水口" fill='#8d9d9b' pts={[b1_3, b1_4, b4, b3]} />
<ColorPolygon desc="出水口" fill='#8d9d9b' pts={[b1_4, b1_5, b5, b4]} />
<ColorPolygon desc="出水口" fill='#728381' pts={[b1, b2, b3, b4, b5, b6, a.rb0, a.lb0]} />
{
waterP1.y < b1.y ? (
<ColorPolygon fill='#539cb9' pts={[waterP1, waterP1R, waterP2R, waterP2]} opacity={0.8} />
) : null
}
</>
)
}
export default React.memo(ZmColumn)

View File

@ -1,35 +0,0 @@
import React, { useMemo } from 'react'
import { Layer } from 'react-konva';
import { ControlPts } from './coordinates';
import ZmColumn from './ZmColumn';
// import { StationItem, GateRuntime } from '../../../models/_/defs';
import { apertureMeter } from '../../../utils/utils';
const ZmColumns: React.FC<{
zmobj: any;
runtime: any;
pts: ControlPts;
selectedId?: string;
waterRatio: number;
}> = ({ zmobj, runtime, pts, waterRatio }) => {
const eqpnoList = useMemo(() => new Array(runtime.length).fill(0).map((o, index) => index), [runtime]);
return (
<Layer>
{
eqpnoList.map((o, index) => (
<ZmColumn
key={o}
gtophgt={apertureMeter(runtime[o]?.realAperture)}
kdMax={2}
pts={pts}
idx={index}
waterRatio={waterRatio}
selected={false}
/>)
)
}
</Layer>
)
}
export default ZmColumns

View File

@ -1,60 +0,0 @@
import React from 'react'
import { Line, Rect } from 'react-konva';
import { Horizontal, ViewCenter } from './consts';
import { XY } from './coordinates'
const INTERVALS = [0, 1, 2];
const ZmDec: React.FC<{
tl: XY;
rb: XY;
}> = ({ tl, rb }) => {
const ux = (rb.x - tl.x) / 12;
const uy = (rb.y - tl.y) / 12;
const ox = tl.x + 3 * ux;
const oy = tl.y + 3 * uy;
return (
<>
{
INTERVALS.map(y => (
<React.Fragment key={y}>
{
INTERVALS.map(x => {
const cx = ox + x * 3 * ux;
const cy = oy + y * 3 * uy;
const l = cx - ux;
const r = cx + ux;
const t = cy - uy;
const b = cy + uy;
return (
<React.Fragment key={x}>
<Rect fill="323737" x={l} y={t} width={2 * ux} height={2 * uy} />
{
cx < ViewCenter.x ? (
<Line points={[l, t, l, b]} stroke="#afb5b5" strokeWidth={1} />
) : (
<Line points={[r, t, r, b]} stroke="#afb5b5" strokeWidth={1} />
)
}
{
cy < Horizontal ? (
<Line points={[l, t, r, t]} stroke="#afb5b5" strokeWidth={1} />
) : (
<Line points={[l, b, r, b]} stroke="#afb5b5" strokeWidth={1} />
)
}
</React.Fragment>
)
})
}
</React.Fragment>
))
}
</>
)
}
export default ZmDec

View File

@ -1,16 +0,0 @@
export const CanvasW = 1080;
export const CanvasH = 640;
export const Horizontal = CanvasH * 1.4 / 3;
export const ViewCenter = { x: CanvasW * 0.5, y: Horizontal };
export const GroundBase = CanvasH * 1.8 / 3;
export const BottomBase = CanvasH * 2.5 / 3;
export const RoofTop = CanvasH * 0.8 / 3;
export const RoofTopFar = RoofTop + 32;
export const FarBuildingTop = RoofTop - 16;
export const SideRoomSize = CanvasH * 0.7 / 3;
export const TopRoomHeight = SideRoomSize - 24;
export const PillarRatio = 0.2;
export const WaterTop = GroundBase;

View File

@ -1,180 +0,0 @@
import { BottomBase, CanvasW, GroundBase, PillarRatio, RoofTop, RoofTopFar, SideRoomSize, ViewCenter } from "./consts";
export type XY = {
x: number;
y: number;
}
export type XYWH = {
x: number;
y: number;
w: number;
h: number;
}
export function intersection(pt1: XY, pt2: XY, result: { x?: number, y?: number }): XY {
const invalid: XY = { x: result.x || 0, y: result.y || 0 };
if (typeof result.x === typeof result.y) {
return invalid;
}
const x1 = pt1.x, y1 = pt1.y, x2 = pt2.x, y2 = pt2.y;
if (typeof result.x === 'number') {
const x3 = result.x;
if (x2 === x1) {
return invalid;
}
result.y = (y2 - y1) * (x3 - x1) / (x2 - x1) + y1;
} else {
const y3 = result.y!;
if (y2 === y1) {
return invalid;
}
result.x = (x2 - x1) * (y3 - y1) / (y2 - y1) + x1;
}
return result as any;
}
export function interpolate(pt1: XY, pt2: XY, ratio: number): XY {
return {
x: pt1.x + (pt2.x - pt1.x) * ratio,
y: pt1.y + (pt2.y - pt1.y) * ratio,
}
}
export function mirror(pt: XY): XY {
return {
x: CanvasW - pt.x,
y: pt.y,
}
}
export type ControlPts = {
C1: XY;
L1: XY;
B1: XY;
C2: XY;
L2: XY;
B2: XY;
A1: XY;
A2: XY;
B3: XY;
RoomLT: XY;
RoomRT: XY;
RoomRB: XY;
RoomLB: XY;
RoomRTFar: XY;
RoomRBFar: XY;
RoomLBFar: XY;
TopRectLB: XY;
TopRectRB: XY;
SepsLTLBRBRT: XY[][];
SepsFront: XYWH[];
ZmArea: {
lt0: XY; lt1: XY; lt2: XY; lt3: XY;
lb0: XY; lb1: XY; lb2: XY; lb3: XY;
rt0: XY; rt1: XY; rt2: XY; rt3: XY;
rb0: XY; rb1: XY; rb2: XY; rb3: XY;
}[];
}
export function contextCoordinates(unitWidth: number, hole: number): ControlPts {
const C1 = { x: unitWidth * 0.6, y: GroundBase };
const L1 = { x: unitWidth, y: GroundBase };
const B1 = { x: unitWidth, y: BottomBase }
const C2 = intersection(ViewCenter, C1, { x: 0, y: undefined });
const L2 = intersection(ViewCenter, L1, { x: 0, y: undefined });
const B2 = intersection(ViewCenter, B1, { x: 0, y: undefined });
const A1 = { x: L1.x, y: RoofTop };
const A2 = intersection(ViewCenter, A1, { x: undefined, y: RoofTopFar });
const B3 = intersection(ViewCenter, B2, { x: A2.x, y: undefined })
const RoomLT = { x: (C1.x + L1.x) * 0.5 - SideRoomSize * 0.5, y: RoofTop - SideRoomSize }
const RoomRT = { x: (C1.x + L1.x) * 0.5 + SideRoomSize * 0.5, y: RoofTop - SideRoomSize }
const RoomRB = { x: (C1.x + L1.x) * 0.5 + SideRoomSize * 0.5, y: RoofTop }
const RoomLB = { x: (C1.x + L1.x) * 0.5 - SideRoomSize * 0.5, y: RoofTop }
const RoomRBFar = intersection(ViewCenter, RoomRB, { x: undefined, y: RoofTopFar });
const RoomRTFar = intersection(ViewCenter, RoomRT, { x: RoomRBFar.x, y: undefined });
const RoomLBFar = { x: RoomRBFar.x! - SideRoomSize, y: RoomRBFar.y };
const TopRectLB = interpolate(RoomRB, RoomRBFar, 0.05);
const TopRectRB = mirror(TopRectLB);
const TopHoleLT = intersection(A1, ViewCenter, { x: undefined, y: TopRectLB.y });
const TopHoleRT = mirror(TopHoleLT);
const HolesWidth = TopHoleRT.x - TopHoleLT.x;
const PillarWidth = (HolesWidth / hole) * PillarRatio;
const HoleWidth = (HolesWidth - PillarWidth * (hole - 1)) / hole;
const SepsLTLBRBRT: XY[][] = [];
const SepsFront: XYWH[] = [];
const ZmArea = [];
for (let i = 0; i < hole; i++) {
const TopBase = TopHoleLT.y;
// 隔断
if (i > 0) {
const frontRight = TopHoleLT.x + (PillarWidth + HoleWidth) * i;
const frontLeft = frontRight - PillarWidth;
SepsFront.push({ x: frontLeft, y: TopBase, w: PillarWidth, h: BottomBase - TopBase });
if (i < hole / 2) {
// 右侧面
const p1 = { x: frontRight, y: TopBase };
const p2 = { x: frontRight, y: BottomBase };
const p4 = intersection(p1, ViewCenter, { x: undefined, y: RoofTopFar });
const p3 = intersection(p2, ViewCenter, { x: p4.x, y: undefined });
SepsLTLBRBRT.push([p1, p2, p3, p4]);
} else if (i > hole / 2) {
// 左侧面
const p1 = { x: frontLeft, y: TopBase };
const p2 = { x: frontLeft, y: BottomBase };
const p4 = intersection(p1, ViewCenter, { x: undefined, y: RoofTopFar });
const p3 = intersection(p2, ViewCenter, { x: p4.x, y: undefined });
SepsLTLBRBRT.push([p1, p2, p3, p4]);
}
}
// 闸门面
{
const ZmTopBaseFront = TopBase + 6;
const ZmTopBaseBack = ZmTopBaseFront + 10;
const lt0 = { x: TopHoleLT.x + (PillarWidth + HoleWidth) * i, y: TopBase };
const lb0 = { x: lt0.x, y: BottomBase };
const rb0 = { x: lt0.x + HoleWidth, y: BottomBase };
const lt1 = intersection(ViewCenter, lt0, { x: undefined, y: ZmTopBaseFront });
const lt2 = intersection(ViewCenter, lt0, { x: undefined, y: ZmTopBaseBack });
const lt3 = intersection(ViewCenter, lt0, { x: undefined, y: RoofTopFar });
const lb1 = intersection(ViewCenter, lb0, { x: lt1.x, y: undefined });
const lb2 = intersection(ViewCenter, lb0, { x: lt2.x, y: undefined });
const lb3 = intersection(ViewCenter, lb0, { x: lt3.x, y: undefined });
const rb1 = intersection(ViewCenter, rb0, { x: undefined, y: lb1.y });
const rb2 = intersection(ViewCenter, rb0, { x: undefined, y: lb2.y });
const rb3 = intersection(ViewCenter, rb0, { x: undefined, y: lb3.y });
const rt0 = { x: rb0.x, y: lt0.y };
const rt1 = { x: rb1.x, y: lt1.y };
const rt2 = { x: rb2.x, y: lt2.y };
const rt3 = { x: rb3.x, y: lt3.y };
ZmArea.push({ lt0, lb0, rb0, rt0, lt1, rt1, lb1, rb1, lt2, lb2, rt2, rb2, lt3, lb3, rt3, rb3 });
}
}
return {
C1, L1, B1, C2, L2, B2, A1, A2, B3,
RoomLT, RoomRT, RoomRB, RoomLB, RoomRTFar, RoomRBFar, RoomLBFar,
TopRectLB, TopRectRB,
SepsLTLBRBRT, SepsFront, ZmArea,
}
}

View File

@ -1,350 +0,0 @@
import React, { useEffect, useMemo, useState } from 'react'
import { Stage } from 'react-konva';
import Sider from './Sider';
import Topper1 from './Topper1';
import Topper2 from './Topper2';
import ZmColumns from './ZmColumns';
import { contextCoordinates } from './coordinates';
import { renAperture } from '../../../utils/utils';
import HFivePlayer from '../../../components/video1Plary'
import './index.less';
import { httpget, httpget2, httppost2 } from '../../../utils/request';
import apiurl from '../../../service/apiurl';
const CanvasW = 1080
const CanvasH = 640
const waterRatio = 0
const zmobj ={
"hpCode": "HP0074208040002120",
"stcd": "4265630075",
"ctrlType": "PLC",
"ctrlProtocol": "PLC",
"uprzStcd": null,
"dwrzStcd": null,
"flowStcd": null,
"gaType": "waga",
"ctrlPass": null,
"maxHgt": 1.9,
"minHgt": 0,
"name": "五岭包节制闸",
"ghtX": null,
"ghtY": null,
"irrCode": "D00000020",
"irrName": "三干渠",
"engCode": "ENG100076",
"engName": "三干渠管理处",
"orgCode": "A07",
"gaorNum": 3,
"wagaType": "节制闸",
"plcType": null,
"bim": 0,
"vip": 0,
"miu": null,
"lgtd": 112.242945,
"lttd": 30.848166,
"runtime": [
null,
{
"stcd": "4265630075",
"gateNumber": 1,
"realAperture": 376,
"setAperture": 0,
"sensorLever": null,
"altitudeLever": null,
"remoteSignal": 0,
"powerSignal": 0,
"openingSignal": 0,
"closeingSignal": 0,
"errorSignal": 0,
"openedSignal": 0,
"closedSignal": 0,
"tm": "2024-09-25 20:03:26",
"_online": true
},
{
"stcd": "4265630075",
"gateNumber": 2,
"realAperture": 388,
"setAperture": 0,
"sensorLever": null,
"altitudeLever": null,
"remoteSignal": 0,
"powerSignal": 0,
"openingSignal": 0,
"closeingSignal": 0,
"errorSignal": 0,
"openedSignal": 0,
"closedSignal": 0,
"tm": "2024-09-25 20:03:26",
"_online": true
},
{
"stcd": "4265630075",
"gateNumber": 3,
"realAperture": 394,
"setAperture": 0,
"sensorLever": null,
"altitudeLever": null,
"remoteSignal": 0,
"powerSignal": null,
"openingSignal": 0,
"closeingSignal": 0,
"errorSignal": 0,
"openedSignal": 0,
"closedSignal": 0,
"tm": "2024-09-25 20:03:26",
"_online": true
}
],
"real": {
"stcd": "4265630075",
"stationName": "五岭包节制闸",
"z1": null,
"zz1": null,
"z1tm": null,
"z2": null,
"zz2": null,
"z2tm": null,
"hq": null,
"hqtm": null,
"demtl": null
},
"cctvs": [],
"_idx": 88,
"_fav": false,
"_sort": 10086
}
const runtime = [
null,
{
"stcd": "4265630075",
"gateNumber": 1,
"realAperture": 976,
"setAperture": 0,
"sensorLever": null,
"altitudeLever": null,
"remoteSignal": 0,
"powerSignal": 0,
"openingSignal": 0,
"closeingSignal": 0,
"errorSignal": 0,
"openedSignal": 0,
"closedSignal": 0,
"tm": "2024-09-25 20:03:31"
},
{
"stcd": "4265630075",
"gateNumber": 2,
"realAperture": 388,
"setAperture": 0,
"sensorLever": null,
"altitudeLever": null,
"remoteSignal": 0,
"powerSignal": 0,
"openingSignal": 0,
"closeingSignal": 0,
"errorSignal": 0,
"openedSignal": 0,
"closedSignal": 0,
"tm": "2024-09-25 20:03:31"
},
{
"stcd": "4265630075",
"gateNumber": 3,
"realAperture": 394,
"setAperture": 0,
"sensorLever": null,
"altitudeLever": null,
"remoteSignal": 0,
"powerSignal": null,
"openingSignal": 0,
"closeingSignal": 0,
"errorSignal": 0,
"openedSignal": 0,
"closedSignal": 0,
"tm": "2024-09-25 20:03:31"
}
]
const myType = {
// 闸前水位站 2闸后水位站 3流量站
'1':'闸前水位/水深(m)',
'2':'闸后水位/水深(m)',
'3':'流量 (m³/s)',
}
const Page = () => {
const [itemIndex,setItemIndex] = useState(null)
const [data,setData] = useState({})
const [list, setList ] = useState([])
const [damList, setDamList ] = useState([])
const [videoList, setVideoList ] = useState([])
const [videoArr, setvideoArr] = useState({})
const hole = 3;//zmobj.gaorNum;
const xunit = CanvasW / (2 + hole);
const pts = contextCoordinates(xunit, hole);
const eqpnoList = useMemo(() => damList ? new Array(damList.length).fill(0).map((o, index) => index) : [], [damList]);
useEffect(()=>{
getList()
},[])
const getList = async()=>{
const {code, data} = await httppost2(apiurl.zmjk.getList)
if(code!==200){
return
}
const obj = data[0]||{}
getInformation(obj.gateCode)
getDamData(obj.stcd)
getVideo(obj.gateCode)
setData(obj)
}
const getInformation = async(gateCode)=>{
const {code, data} = await httpget2(apiurl.zmjk.getInformation,{gateCode})
if(code!==200){
return
}
setList(data)
}
const getDamData = async(stcd)=>{
const {code, data} = await httpget2(apiurl.zmjk.getDamData,{stcd})
if(code!==200){
return
}
const list = []
data.map((item)=>{
list.push({
...item
// ,realAperture:item.realAperture*1000
})
})
setDamList(list)
}
const getVideo = async(valveCode)=>{
const {code, data} = await httppost2(apiurl.zmjk.getVideo,{valveCode})
if(code!==200){
return
}
setVideoList(data)
}
const getVideoSrc = async (current) => {
const res = await httpget2(`${apiurl.gsxl.zfzl.videosrc}${'32023a7f27d8448fa10511f24e96acff'}`)
if (res.code == 200 && res.data?.length !== 0) {
setvideoArr({src:res.data})
}else{
setvideoArr({})
}
}
return (
<>
<div className='content-root clearFloat xybm sg_zmjk' style={{paddingRight:"0",paddingBottom:"0"}}>
<div className='lf CrudAdcdTreeTableBox' style={{width:"100%",overflowY:"auto"}}>
{/* <Card className='nonebox'>
</Card> */}
<div className="ant-card-body" style={{ padding: "20px 0 0 0" }}>
<dvi className="sg_zmjk_left">
<Stage width={1080} height={640}>
<Sider pts={pts} side="left" />
<Sider pts={pts} side="right" />
<Topper1 pts={pts} type={hole} />
<ZmColumns runtime={damList} zmobj={zmobj} pts={pts} waterRatio={waterRatio} />
<Topper2 pts={pts} waterRatio={waterRatio} />
</Stage>
<div style={{ position: 'absolute', left: 0, top: 20, width: '100%', height: 100, display: 'flex', alignContent: 'center' }}>
<div key="sider1" style={{ flexGrow: 1, width: 100 }}></div>
{
eqpnoList.map(o => (
<div key={o}
onClick={() => {}}
className='o' style={{ flexGrow: 1, width: 100, display: 'flex', justifyContent: 'center', cursor: 'pointer' }}>
<div style={{ width: 80, height: 40, backgroundColor: '#43c4e7', borderRadius: 12, color: '#fff', display: 'flex', justifyContent: 'center', alignItems: 'center', fontSize: 28 }}>#{o+1}</div>
</div>
))
}
<div key="sider2" style={{ flexGrow: 1, width: 100 }}></div>
</div>
<div style={{ position: 'absolute', left: 0, bottom: 20, width: '100%', height: 100, display: 'flex', alignContent: 'center' }}>
<div key="sider1" style={{ flexGrow: 1, width: 100 }}></div>
{
eqpnoList.map(o => (
<div key={o} className='o' style={{ flexGrow: 1, width: 100, display: 'flex', justifyContent: 'center' }}>
<div
onClick={() => {}}
style={{ width: 80, height: 32, border: '1px solid #444', backgroundColor: '#fff', borderRadius: 4, color: '#888', display: 'flex', justifyContent: 'center', alignItems: 'center', fontSize: 18, cursor: 'pointer' }}
>
{renAperture(damList[o]?.realAperture)}
</div>
</div>
))
}
<div key="sider2" style={{ flexGrow: 1, width: 100 }}></div>
</div>
</dvi>
<dvi className="sg_zmjk_right">
<div className='sg_zmjk_right_video'>
<div className='sg_zmjk_right_video_title'>视频监控</div>
<div className='sg_zmjk_right_video_content'>
<div className='sg_zmjk_right_video_content_left'>
{
videoList.map((item,index)=>(
<div className={index===itemIndex?'sg_zmjk_right_video_content_left_item itemChecked':'sg_zmjk_right_video_content_left_item'} onClick={()=>{setItemIndex(index);getVideoSrc(item.indexCode)}}>
{item.name}
</div>
))
}
</div>
<div className='sg_zmjk_right_video_content_right'>
{
videoArr?.src &&
<div
className="content-video"
style={{ width: '100%', height: '100%',cursor: "pointer" }}
onClick={() => {
// if (controlerParams.type == 1) {
// setVideoOpen(true)
// setIsShow(!isShow)
// }
}}
>
<HFivePlayer size={1} wsUrl={videoArr} playerID={'111'} />
{/* <div style={{textAlign:"right"}}>注:单击视频显示/隐藏云台</div> */}
</div>
}
</div>
</div>
</div>
<div className='sg_zmjk_right_information'>
<div className='sg_zmjk_right_information_title'>监测数据</div>
<div style={{height:'144px',overflowY:'auto',padding:'20px'}}>
{
list?.map((item)=>{
return (
<div className='sg_zmjk_right_information_content'>
<div>{myType[item.type]}</div>
<div>112.079 / 1.279</div>
<div>07-10 12:09:00</div>
</div>
)
})
}
</div>
</div>
<div className='sg_zmjk_right_more'>查看更多信息</div>
</dvi>
</div>
</div>
</div>
</>
);
}
export default Page;

View File

@ -1,92 +0,0 @@
.sg_zmjk{
.ant-card-body{
display: flex;
height: 100%;
.sg_zmjk_left{
top: 30px;
position: relative;
width: 1080px;
height: 640px;
transform: scale(0.9,1);
}
.sg_zmjk_right{
flex: 1;
// width: 40%;
height: 100%;
display: flex;
flex-direction: column;
.sg_zmjk_right_video{
height: 400px;
margin: 30px 20px 30px -30px;
border-radius: 5px;
border: 1px solid #bbb;
display: flex;
flex-direction: column;
.sg_zmjk_right_video_title{
height: 35px;
line-height: 35px;
padding-left: 10px;
border-bottom: 1px solid #bbb;
}
.sg_zmjk_right_video_content{
flex: 1;
display: flex;
width: 100%;
// height: 100%;
.sg_zmjk_right_video_content_left{
overflow-y: auto;
overflow-x: hidden;
padding: 10px;
width: 130px;
height: 363px;
border-right: 1px solid #bbb;
cursor: pointer;
.sg_zmjk_right_video_content_left_item{
width: 110px;
// height: 30px;
margin-bottom: 5px;
// line-height: 30px;
text-align: center;
border: 1px solid #bbb;
}
.itemChecked{
background-color: #1890FF;
color: #ffffff;
}
}
.sg_zmjk_right_video_content_right{
flex: 1;
height: 100%;
padding: 10px;
}
}
}
.sg_zmjk_right_information{
height: 180px;
margin: -10px 20px 30px -30px;
border-radius: 5px;
border: 1px solid #bbb;
.sg_zmjk_right_information_title{
height: 35px;
line-height: 35px;
padding-left: 10px;
border-bottom: 1px solid #bbb;
}
.sg_zmjk_right_information_content{
display: flex;
padding: 2px 10px;
div{
width: 33%;
margin-bottom: 10px;
}
}
}
.sg_zmjk_right_more{
margin: -10px 20px 30px -30px;
cursor: pointer;
}
}
}
}

View File

@ -1,54 +0,0 @@
import { useEffect, useReducer, useRef, useState } from "react";
const DURATION = 900;
const CNT = 5;
const INTERVAL = DURATION / CNT;
export function useLinearAnim(val: number | undefined) {
const ren = useRef(val);
const [_, refresh] = useReducer(s => s + 1, 0);
const alive = useRef<boolean>(true);
useEffect(() => {
return () => {
alive.current = false;
}
}, [])
useEffect(() => {
if (typeof val !== 'number') {
return;
}
if (ren.current == undefined) {
ren.current = val;
}
const len = val - ren.current;
let handle: any = null;
if (len) {
const dv = len / CNT;
let cnt = CNT;
handle = setInterval(() => {
if (cnt > 0 && alive.current) {
cnt--;
ren.current! -= dv;
refresh();
}
}, INTERVAL)
}
return () => {
if (handle) {
clearInterval(handle);
}
}
}, [val]);
return ren.current ?? val;
}

View File

@ -5,6 +5,7 @@ import apiurl from '../../../../../service/apiurl';
const ModalForm = ({ mode, record,onEdit,onSave,onCrudSuccess }) => {
const [form] = Form.useForm();
const onFinish = async (values) => {
values.resCode = "42120250085"
values.id = record?.id
if (mode === 'edit') {
const params = {
@ -15,11 +16,7 @@ const ModalForm = ({ mode, record,onEdit,onSave,onCrudSuccess }) => {
onEdit(apiurl.dataResourcesCenter.projectAndWater.kr.update,params)
}
if (mode === 'save') {
const params = {
...values,
resCode:record.resCode
}
onSave(apiurl.dataResourcesCenter.projectAndWater.kr.save,params)
onSave(apiurl.dataResourcesCenter.projectAndWater.kr.save,values)
}
}

View File

@ -7,7 +7,7 @@ import apiurl from '../../../../../service/apiurl';
import { httppost2 } from '../../../../../utils/request';
import { CrudOpRender_text } from '../../../../../components/crud/CrudOpRender';
import BasicCrudModal from '../../../../../components/crud/BasicCrudModal2';
export default function Zrtx({dataInfo}) {
export default function Zrtx() {
const refModal = useRef();
const columns = [
{
@ -36,9 +36,8 @@ export default function Zrtx({dataInfo}) {
}
const command = (type) => (params) => {
debugger;
if (type === 'save') {
refModal.current.showSave(dataInfo);
refModal.current.showSave({});
} else if (type === 'edit') {
refModal.current.showEdit(params)
} else if (type === 'view') {
@ -47,15 +46,13 @@ export default function Zrtx({dataInfo}) {
refModal.current.onDeletePost(apiurl.dataResourcesCenter.projectAndWater.kr.delete,params);
}
}
useEffect(() => {
getData();
}, [])
return (
<div>
<h1><Button type='primary' onClick={() => {refModal.current.showSave(dataInfo)}}>新增</Button></h1>
<h1><Button type='primary' onClick={() => {refModal.current.showSave({})}}>新增</Button></h1>
<div style={{display:"flex",columnGap:10,width:"100%"}}>
<div style={{width:500}}>
<Table

View File

@ -1,29 +1,11 @@
import React, { useEffect, useState } from 'react'
import React, { useState } from 'react'
import ProjectBasciInfo from './projectBasicInfo'
import TzParams from './tzParams'
import KrLine from './KrLine'
import MonthLl from './monthLl'
import apiurl from '../../../../service/apiurl';
import { httpget2, httppost2 } from '../../../../utils/request';
import "./index.less"
export default function ShuikuBasicInfo() {
const [tabVal, setTabVal] = useState('1')
const [data,setData] =useState('')
const getDataIfo = async () => {
try {
const res = await httppost2(apiurl.dataResourcesCenter.projectAndWater.shuikuBasicinfo.detail)
// debugger;
if (res.code == 200) {
setData(res.data[0])
}
} catch (error) {
console.log(error);
}
}
useEffect(()=>{
getDataIfo()
},[])
return (
<div className='shuiku-content-root'>
<div className='fxdd_hsybjs_toolbar'>
@ -50,8 +32,8 @@ export default function ShuikuBasicInfo() {
>
{tabVal === "1" ? <ProjectBasciInfo /> : null}
{tabVal === "2" ? <TzParams /> : null}
{tabVal === "3" ? <KrLine dataInfo={data}/> : null}
{tabVal === "5" ? <MonthLl dataInfo={data}/> : null}
{tabVal === "3" ? <KrLine /> : null}
{tabVal === "5" ? <MonthLl /> : null}
</div>
</div>

View File

@ -165,7 +165,7 @@ export default function ProjectBasciInfo() {
name="resCode"
rules={[{ required: true }]}
>
<Input allowClear style={{width:'300px'}} disabled/>
<Input allowClear style={{width:'300px'}} disabled={skdisabled}/>
</Form.Item>
</Col>
<Col span={8}>
@ -182,7 +182,7 @@ export default function ProjectBasciInfo() {
<Form.Item
label="注册登记时间"
name="regTime"
getValueFromEvent={(e, dateString) => moment(dateString).format('YYYY-MM-DD HH:mm:ss')}
getValueFromEvent={(e, dateString) => dateString}
getValueProps={value => ({
value: value ? moment(value) : undefined
})}
@ -284,7 +284,7 @@ export default function ProjectBasciInfo() {
<Form.Item
label="开工日期"
name="startDate"
getValueFromEvent={(e, dateString) => moment(dateString).format('YYYY-MM-DD HH:mm:ss')}
getValueFromEvent={(e, dateString) => dateString}
getValueProps={value => ({
value: value ? moment(value) : undefined
})}
@ -296,7 +296,7 @@ export default function ProjectBasciInfo() {
<Form.Item
label="竣工日期"
name="compDate"
getValueFromEvent={(e, dateString) => moment(dateString).format('YYYY-MM-DD HH:mm:ss')}
getValueFromEvent={(e, dateString) => dateString}
getValueProps={value => ({
value: value ? moment(value) : undefined
})}

View File

@ -1,29 +1,26 @@
import { Image } from "antd"
import zd from '../../../../assets/img/u7.png'
import title from '../../../../assets/img/titleRight.png'
import styles from './index.module.less'
import './index.less'
const Page = () => {
return (
<div style={{ display: 'flex',height:'100%' }}>
<div style={{ backgroundColor: '#ffffff',width:390,height:'100%',marginRight:10,padding:10 }}>
<div className={styles.title}>
<div className="title">
<Image src={title} />保护对象
</div>
<div className={styles.content}>
<div className="content">
水库防洪标准按50年一遇设计1000年一遇校核设计洪水位111.51校核洪水位 112.75 ,水库担负着红安县城七里坪杏花城关等城镇以及京九铁路汉麻连络线省道S234国道G230,京九铁路汉麻联络线等交通设施安全的防洪重任防洪保护人口32万
保护耕地 15 万亩
</div>
</div>
<div style={{ backgroundColor: '#ffffff',flex:1,padding:10}}>
<div className={styles.title}>
<div className="title">
<Image src={title} />转移路线示意图
</div>
<div style={{display:'flex',justifyContent:'center'}}>
<Image src={zd} width='80%' preview={false} />
</div>
</div>
</div>
)

View File

@ -9,8 +9,6 @@ import usePageTable from '../../../../components/crud/usePageTable2';
import { createCrudService } from '../../../../components/crud/_';
import {CrudOpRender_text} from '../../../../components/crud/CrudOpRender';
import './index.less'
import { httppost5 } from '../../../../utils/request';
import { exportFile } from '../../../../utils/tools';
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
const Page = () => {
@ -21,8 +19,6 @@ const Page = () => {
const refModal = useRef();
const [searchVal, setSearchVal] = useState(false)
const [isFetch, setIsFetch] = useState(false)
const [iframeSrc, setIframeSrc] = useState('')
const [pdfViewOPen, setPdfViewOPen] = useState(false)
const command = (type) => (params) => {
if (type === 'save') {
@ -50,22 +46,11 @@ const Page = () => {
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.gcdsj.qzqda.list).find_noCode);
/**
* @description pdf文件预览
* @param {String} params 文件预览url
*/
const viewPdf = (params) => {
setIframeSrc(params)
setPdfViewOPen(true)
}
const onExport = () => {
let params = {
...searchVal,
}
httppost5(apiurl.gcdsj.qzqda.export, params).then(res => {
exportFile(`全周期档案.xlsx`,res.data)
})
const viewPdf = (params) => {
// setIframeSrc(params)
// setPdfViewOPen(true)
}
useEffect(()=>{
const params = {
@ -84,7 +69,7 @@ const onExport = () => {
<Card className='nonebox'>
<ToolBar
setSearchVal={setSearchVal}
onExport={onExport}
onSave={command('save')}
role={role}
/>
</Card>
@ -160,26 +145,7 @@ const onExport = () => {
</div>
</div>
</div>
<Modal
open={pdfViewOPen}
width={1000}
title=""
footer={null}
style={{marginTop:"-5%"}}
onCancel={() => {
setPdfViewOPen(false)
}}
>
<iframe
style={{
height: '80vh',
width: '100%',
border: 0,
marginTop: 20,
}}
src={`${process.env.PUBLIC_URL}/static/pdf/web/viewer.html?file=${encodeURIComponent(`/gunshiApp/xyt/projectEvents/file/download/${iframeSrc}`)}`}
/>
</Modal>
</>
);
}

View File

@ -3,7 +3,7 @@ import { Form, Input, Button, DatePicker } from 'antd';
import moment from 'moment';
const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onExport, storeData, role }) => {
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
const addBtn = role?.rule?.find(item => item.menuName == "新增");
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
const [form] = Form.useForm();
@ -36,15 +36,15 @@ const ToolBar = ({ setSearchVal, onExport, storeData, role }) => {
format="YYYY-MM-DD HH:mm:ss"
/>
</Form.Item>
<Form.Item>
{searchBtn ? <Form.Item>
<Button type="primary" htmlType="submit">查询</Button>
</Form.Item>
</Form.Item> : null}
<Form.Item>
<Button onClick={() => form.resetFields()}>重置</Button>
</Form.Item>
<Form.Item>
<Button type="primary" onClick={onExport}>导出</Button>
<Button type="primary" onClick={onSave}>导出</Button>
</Form.Item>
</Form>
</div>

View File

@ -13,13 +13,13 @@ const { RangePicker } = DatePicker
const { Dragger } = Upload;
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
const opntios = [
{ label: '宪法', value: '宪法' },
{ label: '法律', value: '法律' },
{ label: '行政法规', value: '行政法规' },
{ label: '督察法规', value: '督察法规' },
{ label: '司法解释', value: '司法解释' },
{ label: '地方性法规', value: '地方性法规' },
const opntios=[
{label:'宪法',value:'宪法'},
{label:'法律',value:'法律'},
{label:'行政法规',value:'行政法规'},
{label:'督察法规',value:'督察法规'},
{label:'司法解释',value:'司法解释'},
{label:'地方性法规',value:'地方性法规'},
]
const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
@ -37,7 +37,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
*/
const download = (params) => {
let downloadLink = document.createElement("a");
downloadLink.href = `http://local.gunshiiot.com:18083/gunshiApp/xyt/SzRuleByLaw/file/download/${params}`;
downloadLink.href = `http://local.gunshiiot.com:18083/gunshiApp/xyt/projectEvents/file/download/${params}`;
downloadLink.download = `${params.fileName}`;
downloadLink.style.display = "none";
// 将链接添加到页面中
@ -78,15 +78,16 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
const onfinish = (values) => {
values.files = fileList.map(item => item.response?.data);
// values.eventsDate = values.eventsDate ? moment(values.eventsDate).format("YYYY-MM-DD 00:00:00") : ''
values.eventsDate = values.eventsDate ? moment(values.eventsDate).format("YYYY-MM-DD 00:00:00") : ''
let oldFiles = fileList.map(item => ({ fileId: item.response?.data?.fileId }))
if (mode === 'edit') {
onEdit(apiurl.flfg.edit, {...record,...values})
values.files = oldFiles;
values.id = record.id;
onEdit(apiurl.rcgl.gcdsj.edit, values)
}
if (mode === 'save') {
onSave(apiurl.flfg.add, values)
values.files = oldFiles
onSave(apiurl.rcgl.gcdsj.save, values)
}
}
@ -101,16 +102,16 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
}
useEffect(() => {
if (mode != 'save') {
// const imgFile = record?.files?.map(o => ({
// name: o.name,
// response: {
// data: {
// filePath: o.filePath,
// fileId: o.fileId
// }
// },
// }))
setFileList(record?.files)
const imgFile = record?.files?.map(o => ({
name: o.fileName,
response: {
data: {
filePath: o.filePath,
fileId: o.fileId
}
},
}))
setFileList(imgFile)
}
}, [record, mode])
@ -137,66 +138,51 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
<Col span={12}>
<Form.Item
label="制定机关"
name="fillUnit"
name="name"
rules={[{ required: true }]}
>
<Input disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item label="法律性质" name="type" rules={[{ required: true }]}>
<Select allowClear style={{ width: '150px' }} options={[
{ label: '宪法', value: 0 },
{ label: '法律', value: 1 },
{ label: '行政法规', value: 2 },
{ label: '督察法规', value: 3 },
{ label: '司法解释', value: 4 },
{ label: '地方性法规', value: 5 },
]} disabled={mode === 'view'} />
</Form.Item>
</Col>
{/* <Col span={12}>
<Form.Item label="法律性质" name="timeliness">
<Form.Item label="制定机关" name="name">
<Select allowClear style={{ width: '150px' }} options={opntios} />
</Form.Item>
</Col> */}
</Col>
<Col span={12}>
<Form.Item label="失效性" name="name">
<Select allowClear style={{ width: '150px' }} options={opntios} />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="时效性"
name="timeliness"
label="公布日期"
name="eventsDate"
getValueFromEvent={(e, dateString) => dateString}
getValueProps={(value) => ({ value: value ? moment(value) : undefined })}
rules={[
{
required: true,
},
]}
>
<Select allowClear style={{ width: '150px' }} options={[
{ label: '尚未生效', value: 0 },
{ label: '有效', value: 1 },
{ label: '已修改', value: 2 },
{ label: '已废止', value: 3 },
]} />
<DatePicker disabled={mode === 'view'} format={'YYYY-MM-DD'} style={{ width: '100%' }} allowClear />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="施行日期"
name="announcementDate"
name="eventsDate"
getValueFromEvent={(e, dateString) => dateString}
getValueProps={(value) => ({ value: value ? moment(value) : undefined })}
rules={[
{
required: true,
},
]}
>
<DatePicker disabled={mode === 'view'} format={'YYYY-MM-DD HH:mm:ss'} style={{ width: '100%' }} allowClear />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="公布日期"
name="implementationDate"
getValueFromEvent={(e, dateString) => dateString}
getValueProps={(value) => ({ value: value ? moment(value) : undefined })}
>
<DatePicker disabled={mode === 'view'} format={'YYYY-MM-DD HH:mm:ss'} style={{ width: '100%' }} allowClear />
<DatePicker disabled={mode === 'view'} format={'YYYY-MM-DD'} style={{ width: '100%' }} allowClear />
</Form.Item>
</Col>
</Row>
@ -205,20 +191,15 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
<Col span={24}>
<Form.Item
label="附件"
name="files"
name="fieldId"
labelCol={{ span: 3 }}
wrapperCol={{ span: 19 }}
// rules={[
// {
// required: true,
// },
// ]}
>
{mode !== "view" &&
<Dragger
name='file'
// multiple
action="/gunshiApp/tsg/SzRuleByLaw/file/upload/singleSimple"
action="/gunshiApp/xyt/projectEvents/file/upload/singleSimple"
onChange={fileChange}
onDrop={(info) => { console.log(info.dataTransfer.files); }}
fileList={fileList}
@ -238,9 +219,9 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
<Col span={12}>
<div className="file-item" style={{ width: "75%" }}>
<div className='file-description'>
{file?.fileName?.indexOf('.docx') > -1 ?
{file.name.indexOf('.docx') > -1 ?
<div
onClick={() => { download(file.fileId) }}
onClick={() => { download(file.response?.data?.fileId) }}
style={{ cursor: 'pointer' }}
>
<FileWordOutlined
@ -248,35 +229,35 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
/>
</div>
:
file?.fileName?.indexOf('.pdf') > -1 ?
file.name.indexOf('.pdf') > -1 ?
<div
onClick={() => { viewPdf(file.fileId) }}
onClick={() => { viewPdf(file.response?.data?.fileId) }}
style={{ cursor: 'pointer' }}
>
<FilePdfOutlined style={{ fontSize: 40 }} />
</div>
:
file?.fileName?.indexOf('.zip') > -1 ?
file.name.indexOf('.zip') > -1 ?
<div
onClick={() => { download(file.fileId) }}
onClick={() => { download(file.response?.data?.fileId) }}
style={{ cursor: 'pointer' }}
>
<FileZipOutlined style={{ fontSize: 40 }} />
</div>
:
file?.fileName?.indexOf('.xlsx') > -1 ?
file.name.indexOf('.xlsx') > -1 ?
<div
onClick={() => { download(file.fileId) }}
onClick={() => { download(file.response?.data?.fileId) }}
style={{ cursor: 'pointer' }}
>
<FileExcelOutlined style={{ fontSize: 40 }} />
</div>
:
<Image width={60} src={url + file.filePath} alt='' />
<Image width={60} src={url + file.response?.data?.filePath} alt='' />
}
<span>{file?.fileName}</span>
<span>{file.name}</span>
</div>
<div className={mode == "view" ? 'delete-icon disable-icon' : 'delete-icon'} onClick={() => deleteFile(file.fileId)}>
<div className={mode == "view" ? 'delete-icon disable-icon' : 'delete-icon'} onClick={() => deleteFile(file.response?.data?.fileId)}>
<DeleteOutlined />
</div>
</div>
@ -292,7 +273,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
mode === 'view' ? null : (
<>
<Form.Item {...btnItemLayout}>
<Button type="primary" htmlType="submit" loading={loading}>
<Button type="primary" htmlType="submit">
{mode === 'save' ? '提交' : '修改'}
</Button>
</Form.Item>
@ -317,7 +298,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
border: 0,
marginTop: 20,
}}
src={`${process.env.PUBLIC_URL}/static/pdf/web/viewer.html?file=${encodeURIComponent(`/gunshiApp/tsg/projectEvents/file/download/${iframeSrc}`)}`}
src={`${process.env.PUBLIC_URL}/static/pdf/web/viewer.html?file=${encodeURIComponent(`/gunshiApp/xyt/projectEvents/file/download/${iframeSrc}`)}`}
/>
</Modal>
</>

View File

@ -9,11 +9,8 @@ import apiurl from '../../../service/apiurl';
import usePageTable from '../../../components/crud/usePageTable2';
import { createCrudService } from '../../../components/crud/_';
import { CrudOpRender_text } from '../../../components/crud/CrudOpRender';
import { render } from 'react-dom';
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
const typeOb={0:'宪法',1:'法律',2:'行政法规',3:'督察法规',4:'司法解释',5:'地方性法规'}
const timelinessOb = {0:'尚未生效',1:'有效',2:'已修改',3:'已废止'}
const Page = () => {
const role = useSelector(state => state.auth.role);
const editBtn = role?.rule?.find(item => item.menuName == "编辑");
@ -28,28 +25,26 @@ const Page = () => {
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align: "center" },
{ title: '标题', key: 'name', dataIndex: 'name', width: 250, ellipsis: true },
{
title: '制定机关', key: 'fillUnit', dataIndex: 'fillUnit', width: 140,
title: '制定机关', key: 'eventsDate', dataIndex: 'eventsDate', width: 140,
},
{
title: '法律性质', key: 'type', dataIndex: 'type', width: 140,
render: (value) => <span>{typeOb[value]}</span>,
title: '法律性质', key: 'eventsType', dataIndex: 'eventsType', width: 140,
render: (value) => <span>{value == 1 ? "综合大事记" : value == 2 ? "专题大事记" : ''}</span>,
},
{
title: '时效性', key: 'timeliness', dataIndex: 'timeliness', width: 300,render:(v)=><>
{timelinessOb[v]}
</>
title: '时效性', key: 'eventsDesc', dataIndex: 'eventsDesc', width: 300
},
{
title: '公布日期', key: 'announcementDate', dataIndex: 'announcementDate', width: 300
title: '公布日期', key: 'eventsDesc', dataIndex: 'eventsDesc', width: 300
},
{
title: '施行日期', key: 'implementationDate', dataIndex: 'implementationDate', width: 300
title: '施行日期', key: 'eventsDesc', dataIndex: 'eventsDesc', width: 300
},
{
title: '上传时间', key: 'eventsDesc', dataIndex: 'eventsDesc', width: 300
},
{
title: '附件', key: 'files', dataIndex: 'files', width: 300,render:(v,r)=><a onClick={()=>viewPdf(v[0].fileId)}>{v[0]?.fileName}</a>
title: '附件', key: 'fileName', dataIndex: 'fileName', width: 300,render:(v,r)=><a onClick={()=>viewPdf(r.fileId)}>{v}</a>
},
{
title: '操作', key: 'operation', width: 240, fixed: 'right', align: 'center',
@ -57,7 +52,7 @@ const Page = () => {
<CrudOpRender_text
edit={true}
del={true}
// view={true}
view={true}
command={(cmd) => () => command(cmd)(row)} />)
},
];
@ -73,12 +68,12 @@ const Page = () => {
} else if (type === 'view') {
refModal.current.showView(params);
} else if (type === 'del') {
refModal.current.onDeleteGet(apiurl.flfg.del + `/${params.id}`);
refModal.current.onDeleteGet(apiurl.rcgl.gcdsj.delete + `/${params.id}`);
}
}
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.flfg.list).find_noCode);
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.rcgl.gcdsj.page).find_noCode);
/**
* @description 处理成功的回调

View File

@ -18,22 +18,16 @@ const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
}
}
delete values.tm
setSearchVal({...values});
setSearchVal({...values, dataSo});
}
const opntios=[
{label:'宪法',value:0},
{label:'法律',value:1},
{label:'行政法规',value:2},
{label:'督察法规',value:3},
{label:'司法解释',value:4},
{label:'地方性法规',value:5},
]
const opntios1=[
{label:'尚未生效',value:0},
{label:'有效',value:1},
{label:'已修改',value:2},
{label:'已废止',value:3},
{label:'宪法',value:'宪法'},
{label:'法律',value:'法律'},
{label:'行政法规',value:'行政法规'},
{label:'督察法规',value:'督察法规'},
{label:'司法解释',value:'司法解释'},
{label:'地方性法规',value:'地方性法规'},
]
const styles={
fontFamily: '微软雅黑 Bold", "微软雅黑 Regular", 微软雅黑, sans-serif',
@ -49,10 +43,10 @@ const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
<Form.Item label="标题" name="name">
<Input allowClear style={{width:'150px'}}/>
</Form.Item>
<Form.Item label="制定机关" name="fillUnit">
<Form.Item label="制定机关" name="name">
<Input allowClear style={{width:'150px'}}/>
</Form.Item>
<Form.Item label="法律性质" name="type">
<Form.Item label="制定机关" name="name">
<Select allowClear style={{width:'150px'}} options={opntios}/>
</Form.Item>
<Form.Item>
@ -75,13 +69,13 @@ const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
</Form.Item>
</div>
{showGj&&<div style={{display:'flex'}}>
<Form.Item label="时效性" name="timeliness">
<Select allowClear style={{width:'150px'}} options={opntios1}/>
<Form.Item label="时效性" name="name">
<Select allowClear style={{width:'150px'}} options={opntios}/>
</Form.Item>
<Form.Item label="公布日期" name="announcementDate">
<Form.Item label="公布日期" name="name">
<RangePicker allowClear />
</Form.Item>
<Form.Item label="施行日期" name="implementationDate">
<Form.Item label="施行日期" name="name">
<RangePicker allowClear />
</Form.Item>
<Form.Item label="上传时间" name="name">

View File

@ -1,150 +1,64 @@
import { Space, Table, Radio, DatePicker, Form, Select, Button, message, Upload, Input, Row, Col, Switch, Image } from 'antd';
import { InboxOutlined, LinkOutlined, DeleteOutlined, LoadingOutlined, VerticalAlignBottomOutlined } from '@ant-design/icons'
import { InboxOutlined, LinkOutlined, DeleteOutlined, LoadingOutlined,VerticalAlignBottomOutlined } from '@ant-design/icons'
import { useForm } from 'antd/lib/form/Form';
import { useEffect, useState } from 'react';
import { httpgetExport, httppostAddfile } from '../../../../utils/request';
import { exportFile } from '../../../../utils/tools';
import { useState } from 'react';
const { Dragger } = Upload;
const list = [
{
type: '立案',
key: 'files3'
type:'立案'
},
{
type: '调查取证',
key: 'files4'
type:'调查取证'
},
{
type: '审查处理',
key: 'files5'
type:'审查处理'
},
{
type: '送达执行',
key: 'files6'
type:'送达执行'
},
{
type: '结案',
key: 'files7'
type:'结案'
}
]
const baseUrl = "http://223.75.53.141:9102/test.by-lyf.tmp"
const Page = ({ uploadUrl, downloadUrl, type, getFormInfo, formJsonData }) => {
const Page = () => {
const [form] = Form.useForm();
const [fileList, setFileList] = useState([])
const [fileListHj, setFileHj] = useState({'files3': [],'files4': [],'files5': [],'files6': [],'files7': []})
const [url, setUrl] = useState('')
const [isModal, setIsModal] = useState(false)
const getInfo = () => {
form.validateFields().then((values) => {
getFormInfo({ ...values, ...fileListHj })
form.resetFields()
setFileList([])
}).catch((errorInfo) => {
console.log(errorInfo, 'error');
})
//
}
const cancel = () => {
getFormInfo(false)
form.resetFields()
setFileList([])
}
const deleteFile = (e,key) => {
fileListHj[key] = fileListHj[key].filter(item => item.fileId !== e)
setFileHj({ ...fileListHj })
}
const props = (keys) => {
return {
name: 'file',
multiple: true,
fileList: fileList,
showUploadList: false,
beforeUpload: (file, fileList) => {
// if (fileType == "pic" &&
// (file.type != "image/jpeg" || file.type != "image/png" || file.type != "image/jpg")) {
// message.error('仅支持上传jpg/png/jpeg格式的图片');
// return false;
// } else {
// return true;
// }
},
customRequest(e) {
httppostAddfile(uploadUrl, e).then(res => {
if(fileListHj[keys]){
fileListHj[keys].push(res.data)
}else{
fileListHj[keys]=[]
fileListHj[keys].push(res.data)
}
setFileHj({ ...fileListHj })
})
}
const [fileList ,setFileList] =useState()
const props = {
name: 'file',
multiple: true,
fileList: fileList,
showUploadList: false,
beforeUpload: (file, fileList) => {
// if (fileType == "pic" &&
// (file.type != "image/jpeg" || file.type != "image/png" || file.type != "image/jpg")) {
// message.error('仅支持上传jpg/png/jpeg格式的图片');
// return false;
// } else {
// return true;
// }
},
onChange(e) {
// httpPostFile(apiUrl.service.uploadFile.uploadUrl + "?group=" + typeUpload, e).then(res => {
// setFileList([...fileList, res.data])
// })
}
};
function checkMediaType(url) {
// 创建URL对象
var link = url;
// 获取路径的最后一个点之后的内容作为文件扩展名
var extension = link?.split('.').pop().toLowerCase();
// 声明支持的图片和视频文件扩展名
var imageExtensions = ['jpg', 'jpeg', 'gif', 'png'];
var file = ['pdf', 'word', 'xslx', 'xsl', 'txt', "pptx"];
//
// 判断文件扩展名是否在图片扩展名数组中
if (imageExtensions.includes(extension)) {
return 'image';
}
// 判断文件扩展名是否在视频扩展名数组中
if (file.includes(extension)) {
return extension;
}
// 扩展名不在图片或视频数组中返回null表示无法确定媒体类型
return null;
}
const preView = (item) => {
if (checkMediaType(item.name) == 'pdf') {
// window.open(baseUrl + item.previewUrl)
setUrl(item.previewUrl)
setIsModal(true)
}
const onFinish = () =>{
}
/**
* @description 文件下载
* @param {String} params 文件fileId
*/
const download = (id, name) => {
httpgetExport(downloadUrl+id).then(res => {
exportFile(name,res.data)
})
}
const onFinish = () => {
}
useEffect(() => {
setFileHj(formJsonData)
}, [])
return (
<Form form={form} onFinish={onFinish} >
<Form form={form} onFinish={onFinish} >
<Row>
<Col span={2}>
<div style={{ display: 'flex', alignItems: 'center' }}>
<div style={{ width: 3, height: 12, background: '#259def', marginRight: 5 }}></div>
案卷存档</div>
<Col span={2}>
<div style={{display:'flex',alignItems:'center'}}>
<div style={{width:3,height:12,background:'#259def',marginRight:5}}></div>
案卷存档</div>
</Col>
<Col span={10}>
<Form.Item
label='保管人员'
name='custodian'
name='name'
>
<Input />
</Form.Item>
@ -152,57 +66,33 @@ const Page = ({ uploadUrl, downloadUrl, type, getFormInfo, formJsonData }) => {
<Col span={10}>
<Form.Item
label='保管地点'
name='storageLocation'
name='adress'
>
<Input />
</Form.Item>
</Col>
</Row>
{list.map(item1 => (
{list.map(item=>(
<Row>
<Col span={2}>
<div style={{ display: 'flex', alignItems: 'center' }}>
<div style={{ width: 3, height: 12, background: '#259def', marginRight: 5 }}></div>
{item1.type}</div>
</Col>
<Col span={22}>
<Form.Item
label='附件'
name='files'
>
<Dragger {...props(item1.key)}>
<p className="ant-upload-drag-icon">
<InboxOutlined />
</p>
<p className="ant-upload-text">点击或将文件拖拽到这里上传 支持扩展名jpegpng</p>
</Dragger>
<div>
{fileListHj?.[item1.key]?.map((item) => {
return <div className='flex align-center' style={{ minHeight: "50px", fontSize: 14, columnGap: 10, cursor: checkMediaType(item.fileName) == 'image' || checkMediaType(item.fileName) == 'pdf' ? 'pointer' : "not-allowed" }}>
<div style={{ width: 40, height: 40, display: "flex", alignItems: 'center' }}>
{checkMediaType(item.fileName) == 'image' && <Image
height={40}
src={baseUrl + item.filePath}
/>}
{
checkMediaType(item.fileName) !== 'image' &&
<span >{checkMediaType(item.fileName)?.toUpperCase()}</span>
}
</div>
<span onClick={() => preView(item)}>{item.fileName}</span>
{type !== 'view' && <DeleteOutlined onClick={() => deleteFile(item.fileId,item1.key)} />}
<VerticalAlignBottomOutlined onClick={() => download(item.fileId, item.fileName)} />
</div>
})}
</div>
</Form.Item>
</Col>
</Row>))}
<div className="flex flex-end" style={{ marginTop: 10, justifyContent: "flex-end" }}>
<Button type="" style={{ marginRight: 10 }} onClick={cancel}>取消</Button>
<Button type="primary" onClick={getInfo}>确定</Button>
</div>
<Col span={2}>
<div style={{display:'flex',alignItems:'center'}}>
<div style={{width:3,height:12,background:'#259def',marginRight:5}}></div>
{item.type}</div>
</Col>
<Col span={22}>
<Form.Item
label='附件'
name='name'
>
<Dragger {...props}>
<p className="ant-upload-drag-icon">
<InboxOutlined />
</p>
<p className="ant-upload-text">点击或将文件拖拽到这里上传 支持扩展名jpegpng</p>
</Dragger>
</Form.Item>
</Col>
</Row>))}
</Form >
)

View File

@ -1,111 +1,81 @@
const basicData = [
{
label: '填报人',
key: 'createName',
key: 'name',
type: 'input',
span: 12,
disabled: true
},
{
label: '填报时间',
key: 'createTime',
key: 'name',
type: 'input',
span: 12,
// required: true
disabled: true
},
{
label: '案件编号',
key: 'caseId',
key: 'name',
type: 'input',
span: 12
},
{
label: '案件名称',
key: 'caseName',
key: 'name',
type: 'input',
span: 12,
required: true
},
{
label: '案件类型',
key: 'caseType',
key: 'name',
type: 'Select',
options: [
{ value: 0, label: '违建' },
{ value: 1, label: '毁林垦荒' },
{ value: 2, label: '筑坝拦汊' },
{ value: 3, label: '填占库容' },
{ value: 4, label: '违法取水' },
{ value: 5, label: '其他' }
],
span: 12,
required: true
},
{
label: '发现时间',
key: 'caseDate',
type: 'DatePicker',
span: 12,
required: true
span: 12
},
{
label: '案发地点',
key: 'caseAddress',
key: 'name',
type: 'input',
span: 12,
required: true
span: 12
},
{
label: '案件来源',
key: 'caseSource',
type: 'Select',
key: 'name',
type: 'Radio',
span: 12,
required: true,
options: [
{ label: '巡查上报', value: 0 },
{ label: '自主发现', value: 1 },
{ label: '公共举报', value: 2 },
{ label: '电话举报', value: 3 },
{ label: '其他', value: 4 },
{ label: '自然人', value: 'Apple' },
{ label: '法人或其他组织', value: 'Pear' },
{ label: '待定', value: 'Orange' },
]
},
{
label: '违法时间',
key: 'IllegalDate',
type: 'DatePicker',
span: 12
key: 'name',
type: 'input',
span: 24
},
{
label: '当事人类型',
key: 'partyType',
type: 'Radio',
required: true,
options: [
{ label: '自然人', value: 0 },
{ label: '法人或其他组织', value: 1 },
{ label: '待定', value: 2 },
],
label: '案件来源',
key: 'name',
type: 'input',
span: 24
},
{
label: '姓名',
key: 'partyName',
key: 'name',
type: 'input',
span: 12
},
{
label: '身份证号',
key: 'idNumber',
key: 'name',
type: 'input',
span: 12
},
{
label: '住址',
key: 'partyAddr',
key: 'name',
type: 'input',
span: 12
},
@ -117,13 +87,13 @@ const basicData = [
},
{
label: '简要案情',
key: 'intro',
key: 'name',
type: 'TextArea',
span: 24
},
{
label: '附件',
key: 'files1',
key: 'name',
type: 'upload',
span: 24
},
@ -132,106 +102,97 @@ const basicData = [
const clqkData = [
{
label: '处理程序',
key: 'processor',
key: 'name',
type: 'Select',
options: [
{ label: '简易程序', value: 0 },
{ label: '一般程序', value: 1 },
],
span: 12,
disabled: true
},
{
label: '处理依据',
key: 'treatmentBasis',
type: 'input',
key: 'name',
type: 'Select',
span: 12,
disabled: true
},
{
label: '处理措施',
key: 'treatmentMeasure',
key: 'name',
type: 'Select',
span: 12
},
{
label: '移送处理情况',
key: 'transfer',
key: 'name',
type: 'Radio',
span: 24,
options: [
{ label: '移送单位', value: '1' },
{ label: '不移送', value: '0' },
{ label: '移送单位', value: 'Apple' },
{ label: '不移送', value: 'Pear' },
],
required: true
},
{
label: '案件执行情况',
key: 'caseImplementation',
key: 'name',
type: 'Radio',
options: [
{ label: '当事人自动履行', value: 0 },
{ label: '行政强制执行', value: 1 },
{ label: '当事人自动履行', value: 'Apple' },
{ label: '行政强制执行', value: 'Pear' },
],
span: 24
},
{
label: '自动履行情况',
key: 'performance',
key: 'name',
type: 'TextArea',
span: 24
},
{
label: '伤亡人数(人)',
key: 'casualties',
key: 'name',
type: 'input',
span: 12
},
{
label: '直接损失金额(万元)',
key: 'directLossAmount',
key: 'name',
type: 'input',
span: 12
},
{
label: '结案情况',
key: 'closeStatus',
key: 'name',
type: 'Select',
options: [
{ label: '正常结案', value: 0 },
{ label: '其他方式结案', value: 1 },
{ label: '未结案', value: 2 },
],
span: 12
},
{
label: '结案时间',
key: 'closeDate',
key: 'name',
type: 'input',
span: 12
},
{
label: '文件编号及名称',
key: 'docNumName',
key: 'name',
type: 'input',
span: 24
},
{
label: '督办单位类型',
key: 'unitType',
key: 'name',
type: 'Select',
options: [
{ label: '上级督办', value: 0 },
{ label: '本级河长督办', value: 1 },
],
span: 12
},
{
label: '督办单位名称',
key: 'unitName',
key: 'name',
type: 'input',
span: 24
},
{
label: '附件',
key: 'files2',
key: 'name',
type: 'upload',
span: 24
},
@ -239,37 +200,39 @@ const clqkData = [
const xzfy = [
{
label: '行政复议情况',
key: 'administrativeReconsideration',
label: '处理程序',
key: 'name',
type: 'Select',
span: 12,
options: [
options:[
{
label: '维护', value: 0
label:'维护'
},
{ label: '变更', value: 1 },
{ label: '撤销', value: 2 },
{ label: '和解', value: 3 },
{ label: '调解', value: 4 },
{label:'变更'},
{label:'撤销'},
{label:'和解'},
{label:'调解'},
],
disabled: true
},
{
label: '行政应诉情况',
key: 'administrativeResponse',
label: '处理依据',
key: 'name',
type: 'Select',
span: 12,
disabled: true,
options: [
options:[
{
label: '驳回原告诉讼', value: 0
label:'驳回原告诉讼'
},
{ label: '变更', value: 2 },
{ label: '撤销', value: 1 },
{ label: '确认违法', value: 3 },
{ label: '确认无效', value: 4 },
{ label: '其他', value: 5 },
{label:'变更'},
{label:'撤销'},
{label:'确认违法'},
{label:'确认无效'},
{label:'其他'},
],
},
]

View File

@ -1,12 +1,9 @@
import React, { useEffect, useState } from 'react';
import { message, Tabs } from 'antd';
import React, { useState } from 'react';
import { Tabs } from 'antd';
import BascForm from '../form/index'
import { basicData, clqkData, xzfy } from './config'
import { basicData,clqkData,xzfy} from './config'
import Bajz from './bajz'
import Lsyx from './lsyx'
import { httpget, httppost } from '../../../../utils/request';
import apiurl from '../../../../service/apiurl';
import dayjs from 'dayjs'
const items = [
{
key: '1',
@ -31,71 +28,21 @@ const items = [
];
const Page = ({ mode, onCrudSuccess,record }) => {
const [formData,setFormData] =useState({})
// debugger;
const [key, setKeys] = useState('1')
const Page = () => {
const [key , setKeys] = useState('1')
const onChange = (key) => {
console.log(key);
setKeys(key)
};
const getFormInfo = (e) => {
let params = {
...formData,
...e,
caseDate: dayjs(e.caseDate).format("YYYY-MM-DD HH:mm:ss"),
IllegalDate: e.IllegalDate ? dayjs(e.IllegalDate).format("YYYY-MM-DD HH:mm:ss") : e.IllegalDate,
}
if (mode == 'save') {
addBasic(params)
} else if (mode == 'edit') {
editBasic(params)
}
}
const addBasic = (params) => {
httppost(apiurl.szzf.ajdj.add, params).then(res => {
if (res.code == 200) {
message.success('新增成功')
onCrudSuccess()
} else {
message.error(res.description)
}
})
}
const editBasic = (params) => {
httppost(apiurl.szzf.ajdj.edit, params).then(res => {
if (res.code == 200) {
message.success('编辑成功')
onCrudSuccess()
} else {
message.error(res.description)
}
})
}
useEffect(()=>{
httpget(apiurl.szzf.ajdj.detail + record.id).then(res=>{
let obj = {
createName: localStorage.getItem('userName'),
createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
createBy:localStorage.getItem('userId')
}
if(res.data.caseDate){
obj.caseDate=dayjs(res.data.caseDate)
}
setFormData({...res.data,...obj})
})
},[])
return (
<>
<Tabs defaultActiveKey="1" items={items} onChange={onChange} />
<>
{key == 1 && <BascForm formJson={basicData} formJsonData={formData} fileKey='files1'type={mode} getFormInfo={getFormInfo} uploadUrl={apiurl.szzf.ajdj.upload} downloadUrl={apiurl.szzf.ajdj.download}></BascForm>}
{key == 2 && <BascForm formJson={clqkData} fileKey='files2' formJsonData={formData} type={mode} getFormInfo={getFormInfo} uploadUrl={apiurl.szzf.ajdj.upload} downloadUrl={apiurl.szzf.ajdj.download}></BascForm>}
{key == 3 && <BascForm formJson={xzfy} formJsonData={formData} type={mode} getFormInfo={getFormInfo} uploadUrl={apiurl.szzf.ajdj.upload} downloadUrl={apiurl.szzf.ajdj.download}></BascForm>}
{key == 4 && <Bajz formJson={xzfy} formJsonData={formData} type={mode} getFormInfo={getFormInfo} uploadUrl={apiurl.szzf.ajdj.upload} downloadUrl={apiurl.szzf.ajdj.download}></Bajz>}
{key == 5 && <Lsyx formJson={xzfy} formJsonData={formData} type={mode} getFormInfo={getFormInfo} uploadUrl={apiurl.szzf.ajdj.upload} downloadUrl={apiurl.szzf.ajdj.download}></Lsyx>}
{key==1&& <BascForm formJson={basicData}></BascForm>}
{key==2&& <BascForm formJson={clqkData}></BascForm>}
{key==3&& <BascForm formJson={xzfy}></BascForm>}
{key==4&& <Bajz ></Bajz>}
{key==5&& <Lsyx ></Lsyx>}
</>
</>
)

View File

@ -9,15 +9,8 @@ import apiurl from '../../../../service/apiurl';
import usePageTable from '../../../../components/crud/usePageTable2';
import { createCrudService } from '../../../../components/crud/_';
import { CrudOpRender_text } from '../../../../components/crud/CrudOpRender';
import dayjs from 'dayjs'
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
const caseTypeOb = {
0: '违建', 1: '毁林垦荒', 2: '筑坝拦汊', 3: '填占库容', 4: '违法取水', 5: '其他'
}
const caseSourceOb = {
0: '巡查上报', 1: '自主发现', 2: '公共举报', 3: '电话举报', 4: '其他'
}
const Page = () => {
const role = useSelector(state => state.auth.role);
const editBtn = role?.rule?.find(item => item.menuName == "编辑");
@ -30,25 +23,28 @@ const Page = () => {
const [isFetch, setIsFetch] = useState(false)
const columns = [
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align: "center" },
{ title: '填报时间', key: 'createTime', dataIndex: 'createTime', width: 250, ellipsis: true },
{ title: '标题', key: 'name', dataIndex: 'name', width: 250, ellipsis: true },
{
title: '案件名称', key: 'caseName', dataIndex: 'caseName', width: 140,
title: '制定机关', key: 'eventsDate', dataIndex: 'eventsDate', width: 140,
},
{
title: '案件编号', key: 'caseId', dataIndex: 'caseId', width: 140,
title: '法律性质', key: 'eventsType', dataIndex: 'eventsType', width: 140,
render: (value) => <span>{value == 1 ? "综合大事记" : value == 2 ? "专题大事记" : ''}</span>,
},
{
title: '发现时间', key: 'caseDate', dataIndex: 'caseDate', width: 300,
title: '时效性', key: 'eventsDesc', dataIndex: 'eventsDesc', width: 300
},
{
title: '案件类型', key: 'caseType', dataIndex: 'caseType', width: 300,
render: (value) => <span>{caseTypeOb[value]}</span>,
title: '公布日期', key: 'eventsDesc', dataIndex: 'eventsDesc', width: 300
},
{
title: '案件来源', key: 'caseSource', dataIndex: 'caseSource', width: 300,
render: (value) => <span>{caseSourceOb[value]}</span>,
title: '施行日期', key: 'eventsDesc', dataIndex: 'eventsDesc', width: 300
},
{
title: '上传时间', key: 'eventsDesc', dataIndex: 'eventsDesc', width: 300
},
{
title: '附件', key: 'fileName', dataIndex: 'fileName', width: 300,render:(v,r)=><a onClick={()=>viewPdf(r.fileId)}>{v}</a>
},
{
title: '操作', key: 'operation', width: 240, fixed: 'right', align: 'center',
@ -66,26 +62,18 @@ const Page = () => {
const command = (type) => (params) => {
if (type === 'save') {
refModal.current.showSave();
} else if (type === 'edit') {
let obj={}
if(params.caseDate){
obj.caseDate= dayjs(params.caseDate)
}
if(params.IllegalDate){
obj.IllegalDate= dayjs(params.IllegalDate)
}
refModal.current.showEdit({ ...params,...obj });
refModal.current.showEdit({ ...params });
} else if (type === 'view') {
refModal.current.showView(params);
} else if (type === 'del') {
refModal.current.onDeleteGet(apiurl.szzf.ajdj.del + `/${params.id}`);
refModal.current.onDeleteGet(apiurl.rcgl.gcdsj.delete + `/${params.id}`);
}
}
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.szzf.ajdj.list).find_noCode);
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.rcgl.gcdsj.page).find_noCode);
/**
* @description 处理成功的回调
@ -98,7 +86,7 @@ const Page = () => {
const viewPdf = (params) => {
setIframeSrc(params)
setPdfViewOPen(true)
}
}
useEffect(() => {
const params = {
search: {
@ -121,7 +109,7 @@ const Page = () => {
/>
</Card>
<div className="ant-card-body" style={{ padding: "20px 0 0 0" }}>
<Table columns={columns} rowKey="inx" {...tableProps} scroll={{ x: width, y: "calc( 100vh - 400px )" }} />
<Table columns={columns} rowKey="inx" {...tableProps} scroll={{ x: width, y: "calc( 100vh - 400px )" }} dataSource={[{name:1}]}/>
</div>
</div>

View File

@ -1,174 +1,66 @@
import { Space, Table, Radio, DatePicker, Form, Select, Button, message, Upload, Input, Row, Col, Switch, Image } from 'antd';
import { InboxOutlined, LinkOutlined, DeleteOutlined, LoadingOutlined, VerticalAlignBottomOutlined } from '@ant-design/icons'
import { InboxOutlined, LinkOutlined, DeleteOutlined, LoadingOutlined,VerticalAlignBottomOutlined } from '@ant-design/icons'
import { useForm } from 'antd/lib/form/Form';
import { useEffect, useState } from 'react';
import { httpgetExport, httppostAddfile } from '../../../../utils/request';
import { exportFile } from '../../../../utils/tools';
import { useState } from 'react';
const { Dragger } = Upload;
const list = [
{
type:'整改前',
key:'files8'
type:'整改前'
},
{
type:'整改后',
key:'files9'
},
type:'整改后'
}
]
const baseUrl = "http://223.75.53.141:9102/test.by-lyf.tmp"
const Page = ({ uploadUrl, downloadUrl, type, getFormInfo, formJsonData }) => {
const Page = () => {
const [form] = Form.useForm();
const [fileList, setFileList] = useState([])
const [fileListHj, setFileHj] = useState({'files3': [],'files4': [],'files5': [],'files6': [],'files7': []})
const [url, setUrl] = useState('')
const [isModal, setIsModal] = useState(false)
const getInfo = () => {
form.validateFields().then((values) => {
getFormInfo({ ...values, ...fileListHj })
form.resetFields()
setFileList([])
}).catch((errorInfo) => {
console.log(errorInfo, 'error');
})
//
}
const cancel = () => {
getFormInfo(false)
form.resetFields()
setFileList([])
}
const deleteFile = (e,key) => {
fileListHj[key] = fileListHj[key].filter(item => item.fileId !== e)
setFileHj({ ...fileListHj })
}
const props = (keys) => {
return {
name: 'file',
multiple: true,
fileList: fileList,
showUploadList: false,
beforeUpload: (file, fileList) => {
// if (fileType == "pic" &&
// (file.type != "image/jpeg" || file.type != "image/png" || file.type != "image/jpg")) {
// message.error('仅支持上传jpg/png/jpeg格式的图片');
// return false;
// } else {
// return true;
// }
},
customRequest(e) {
httppostAddfile(uploadUrl, e).then(res => {
if(fileListHj[keys]){
fileListHj[keys].push(res.data)
}else{
fileListHj[keys]=[]
fileListHj[keys].push(res.data)
}
setFileHj({ ...fileListHj })
})
}
const [fileList ,setFileList] =useState()
const props = {
name: 'file',
multiple: true,
fileList: fileList,
showUploadList: false,
beforeUpload: (file, fileList) => {
// if (fileType == "pic" &&
// (file.type != "image/jpeg" || file.type != "image/png" || file.type != "image/jpg")) {
// message.error('仅支持上传jpg/png/jpeg格式的图片');
// return false;
// } else {
// return true;
// }
},
onChange(e) {
// httpPostFile(apiUrl.service.uploadFile.uploadUrl + "?group=" + typeUpload, e).then(res => {
// setFileList([...fileList, res.data])
// })
}
};
function checkMediaType(url) {
// 创建URL对象
var link = url;
// 获取路径的最后一个点之后的内容作为文件扩展名
var extension = link?.split('.').pop().toLowerCase();
// 声明支持的图片和视频文件扩展名
var imageExtensions = ['jpg', 'jpeg', 'gif', 'png'];
var file = ['pdf', 'word', 'xslx', 'xsl', 'txt', "pptx"];
//
// 判断文件扩展名是否在图片扩展名数组中
if (imageExtensions.includes(extension)) {
return 'image';
}
// 判断文件扩展名是否在视频扩展名数组中
if (file.includes(extension)) {
return extension;
}
// 扩展名不在图片或视频数组中返回null表示无法确定媒体类型
return null;
}
const preView = (item) => {
if (checkMediaType(item.name) == 'pdf') {
// window.open(baseUrl + item.previewUrl)
setUrl(item.previewUrl)
setIsModal(true)
}
const onFinish = () =>{
}
/**
* @description 文件下载
* @param {String} params 文件fileId
*/
const download = (id, name) => {
httpgetExport(downloadUrl+id).then(res => {
exportFile(name,res.data)
})
}
const onFinish = () => {
}
useEffect(() => {
setFileHj(formJsonData)
}, [])
return (
<Form form={form} onFinish={onFinish} >
{list.map(item1 => (
<Form form={form} onFinish={onFinish} >
{list.map(item=>(
<Row>
<Col span={2}>
<div style={{ display: 'flex', alignItems: 'center' }}>
<div style={{ width: 3, height: 12, background: '#259def', marginRight: 5 }}></div>
{item1.type}</div>
</Col>
<Col span={22}>
<Form.Item
label='附件'
name='files'
>
<Dragger {...props(item1.key)}>
<p className="ant-upload-drag-icon">
<InboxOutlined />
</p>
<p className="ant-upload-text">点击或将文件拖拽到这里上传 支持扩展名jpegpng</p>
</Dragger>
<div>
{fileListHj?.[item1.key]?.map((item) => {
return <div className='flex align-center' style={{ minHeight: "50px", fontSize: 14, columnGap: 10, cursor: checkMediaType(item.fileName) == 'image' || checkMediaType(item.fileName) == 'pdf' ? 'pointer' : "not-allowed" }}>
<div style={{ width: 40, height: 40, display: "flex", alignItems: 'center' }}>
{checkMediaType(item.fileName) == 'image' && <Image
height={40}
src={baseUrl + item.filePath}
/>}
{
checkMediaType(item.fileName) !== 'image' &&
<span >{checkMediaType(item.fileName)?.toUpperCase()}</span>
}
</div>
<span onClick={() => preView(item)}>{item.fileName}</span>
{type !== 'view' && <DeleteOutlined onClick={() => deleteFile(item.fileId,item1.key)} />}
<VerticalAlignBottomOutlined onClick={() => download(item.fileId, item.fileName)} />
</div>
})}
</div>
</Form.Item>
</Col>
</Row>))}
<div className="flex flex-end" style={{ marginTop: 10, justifyContent: "flex-end" }}>
<Button type="" style={{ marginRight: 10 }} onClick={cancel}>取消</Button>
<Button type="primary" onClick={getInfo}>确定</Button>
</div>
<Col span={2}>
<div style={{display:'flex',alignItems:'center'}}>
<div style={{width:3,height:12,background:'#259def',marginRight:5}}></div>
{item.type}</div>
</Col>
<Col span={22}>
<Form.Item
label='附件'
name='name'
>
<Dragger {...props}>
<p className="ant-upload-drag-icon">
<InboxOutlined />
</p>
<p className="ant-upload-text">点击或将文件拖拽到这里上传 支持扩展名jpegpng</p>
</Dragger>
</Form.Item>
</Col>
</Row>))}
</Form >
)

View File

@ -1,14 +1,14 @@
import React, { useEffect, useState } from 'react';
import React, { useEffect,useState } from 'react';
import { Form, Input, Button, DatePicker, Select } from 'antd';
import { DownOutlined, UpOutlined } from '@ant-design/icons'
import moment from 'moment';
const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
const addBtn = role?.rule?.find(item => item.menuName == "新增");
const searchBtn = role?.rule?.find(item => item.menuName == "查询");
const [form] = Form.useForm();
const [showGj, setShowGj] = useState(false)
const [showGj , setShowGj] =useState(false)
const onFinish = (values) => {
let dataSo;
if (values.tm) {
@ -18,27 +18,18 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
}
}
delete values.tm
setSearchVal({ ...values, dataSo });
setSearchVal({...values, dataSo});
}
const opntios = [
{ label: '宪法', value: '宪法' },
{ label: '法律', value: '法律' },
{ label: '行政法规', value: '行政法规' },
{ label: '督察法规', value: '督察法规' },
{ label: '司法解释', value: '司法解释' },
{ label: '地方性法规', value: '地方性法规' },
const opntios=[
{label:'宪法',value:'宪法'},
{label:'法律',value:'法律'},
{label:'行政法规',value:'行政法规'},
{label:'督察法规',value:'督察法规'},
{label:'司法解释',value:'司法解释'},
{label:'地方性法规',value:'地方性法规'},
]
const caseTypeOption = [
{ label: '违建', value: 0 },
{ label: '毁林垦荒', value: 1 },
{ label: '筑坝拦汊', value: 2 },
{ label: '填占库容', value: 3 },
{ label: '违法取水', value: 4 },
{ label: '其他', value: 5 },
]
const styles = {
const styles={
fontFamily: '微软雅黑 Bold", "微软雅黑 Regular", 微软雅黑, sans-serif',
fontWeight: '700',
fontStyle: 'normal',
@ -46,35 +37,34 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
}
return (
<>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div style={{display:'flex',justifyContent:'space-between'}}>
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}>
<div style={{ display: 'flex' }}>
<Form.Item label="案件类型" name="caseType">
<Select allowClear style={{ width: '150px' }} options={caseTypeOption} />
</Form.Item>
<Form.Item label="时间" name="createTime">
<RangePicker allowClear />
</Form.Item>
<Form.Item label="案件名称" name="caseName">
<Input allowClear style={{ width: '150px' }} />
</Form.Item>
<Form.Item label="案件编号" name="caseId">
<Input allowClear style={{ width: '150px' }} />
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit">查询</Button>
</Form.Item>
<Form.Item>
<Button onClick={() => form.resetFields()}>重置</Button>
</Form.Item>
{
(onSave) ?
<Form.Item>
<Button onClick={onSave}>新增</Button>
</Form.Item>
: null
}
{/* <Form.Item>
<div style={{display:'flex'}}>
<Form.Item label="标题" name="name">
<Input allowClear style={{width:'150px'}}/>
</Form.Item>
<Form.Item label="制定机关" name="name">
<Input allowClear style={{width:'150px'}}/>
</Form.Item>
<Form.Item label="制定机关" name="name">
<Select allowClear style={{width:'150px'}} options={opntios}/>
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit">查询</Button>
</Form.Item>
<Form.Item>
<Button onClick={() => form.resetFields()}>重置</Button>
</Form.Item>
{
(onSave) ?
<Form.Item>
<Button onClick={onSave}>新增</Button>
</Form.Item>
:null
}
<Form.Item>
<div style={styles} onClick={()=>setShowGj(!showGj)}>高级搜索 {!showGj&&<DownOutlined />} {showGj&&<UpOutlined />}</div>
</Form.Item>
</div>
@ -90,8 +80,8 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
</Form.Item>
<Form.Item label="上传时间" name="name">
<RangePicker allowClear />
</Form.Item>*/}
</div>
</Form.Item>
</div>}
</Form>
</div>
</>

View File

@ -2,17 +2,12 @@ import dayjs from 'dayjs';
import { Space, Table, Tag, DatePicker, Form, Select, Button, Card } from 'antd';
import ReactECharts from 'echarts-for-react';
import { useEffect, useState, useMemo } from 'react';
import { httppost } from '../../../../utils/request';
import apiurl from '../../../../service/apiurl';
let obj= { 0:'当事人自动履行',1: '行政强制执行'}
const Page = ({ title = '标题' }) => {
const [echart2, setEchart2] = useState(Object())
const [inspectordata, setInspectorData] = useState([{}])
const [plandata, setPlanData] = useState(Object())
const [problemdata, setProblemData] = useState(Object())
const [sumTotal, setSum] = useState(0)
const getPlanOption = useMemo((name, data) => {
// let total = 0
// for (let i = 0; i < data.length; i++) {
@ -21,18 +16,18 @@ const Page = ({ title = '标题' }) => {
return {
title: {},
tooltip: {},
legend: {
data: Object.values(obj)
},
// legend: {
// data: name
// },
graphic: {
type: 'text',
top: 'center',
left: 'center',
style: {
text: `总计\n${sumTotal}`,
text: `总计\n${0}`,
fontSize: 20,
fontWeight: 'bold',
textAlign: 'center'
// textAlign: 'center'
}
},
series: {
@ -59,41 +54,28 @@ const Page = ({ title = '标题' }) => {
const onOk = (event, index) => {
if (event !== null) {
let params = {
stm: dayjs(new Date(event[0])).format('YYYY-MM-DD HH:mm:ss'),
etm: dayjs(new Date(event[1])).format('YYYY-MM-DD HH:mm:ss'),
stm: dayjs(new Date(event[0])).format('YYYY-MM-DD'),
etm: dayjs(new Date(event[1])).format('YYYY-MM-DD'),
}
// getStm(params, index)
getInfo(params)
}
}
const getInfo=(params)=>{
let obj1=[]
let sum=0
httppost(apiurl.szzf.ajtj.info+2,params).then(res=>{
res.data.map(item=>{
obj1.push({value:item.count,name:obj[item.type]})
sum=sum+item.count
})
// debugger;
setPlanData(obj1)
setSum(sum)
})
}
useEffect(() => {
let params = {
stm: dayjs().startOf("year").format('YYYY-MM-DD HH:mm:ss'),
etm: dayjs().format('YYYY-MM-DD HH:mm:ss'),
}
getInfo(params)
},[])
let data = [
{ value: 1048, name: 'Search Engine' },
{ value: 735, name: 'Direct' },
{ value: 580, name: 'Email' },
{ value: 484, name: 'Union Ads' },
{ value: 300, name: 'Video Ads' }
]
setPlanData(data)
})
return (
<>
<div className='top' style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between' }}>
<div style={{ fontSize: 20, fontWeight: 'bold', display: 'flex', alignItems: 'center' }}>
<div style={{ width: 5, height: 25, backgroundColor: '#259def', marginRight: 10 }}></div>
执行情况
{title}
</div>
<DatePicker.RangePicker
style={{ width: 220, }}

View File

@ -1,31 +1,13 @@
import dayjs from 'dayjs';
import { Space, Table, Tag, DatePicker, Form, Select, Button, Card } from 'antd';
import ReactECharts from 'echarts-for-react';
import { useEffect, useState, useMemo } from 'react';
import { httpget, httppost } from '../../../../utils/request';
import apiurl from '../../../../service/apiurl';
import dayjs from 'dayjs';
import advancedFormat from 'dayjs/plugin/advancedFormat'
import customParseFormat from 'dayjs/plugin/customParseFormat'
import localeData from 'dayjs/plugin/localeData'
import weekday from 'dayjs/plugin/weekday'
import weekOfYear from 'dayjs/plugin/weekOfYear'
import weekYear from 'dayjs/plugin/weekYear'
dayjs.extend(customParseFormat)
dayjs.extend(advancedFormat)
dayjs.extend(weekday)
dayjs.extend(localeData)
dayjs.extend(weekOfYear)
dayjs.extend(weekYear)
let obj={0:'巡查上报',1:'自主发现',2:'公共举报',3:'电话举报',4:'其他'}
const Page = ({ title = '标题' }) => {
const [echart2, setEchart2] = useState(Object())
const [inspectordata, setInspectorData] = useState([{}])
const [plandata, setPlanData] = useState(Object())
const [problemdata, setProblemData] = useState(Object())
const [sumTotal, setSum] = useState(0)
const getPlanOption = useMemo((name, data) => {
// let total = 0
// for (let i = 0; i < data.length; i++) {
@ -34,18 +16,18 @@ const Page = ({ title = '标题' }) => {
return {
title: {},
tooltip: {},
legend: {
data:Object.values(obj)
},
// legend: {
// data: name
// },
graphic: {
type: 'text',
top: 'center',
left: 'center',
style: {
text: `总计\n${sumTotal}`,
text: `总计\n${0}`,
fontSize: 20,
fontWeight: 'bold',
textAlign: 'center'
// textAlign: 'center'
}
},
series: {
@ -72,41 +54,28 @@ const Page = ({ title = '标题' }) => {
const onOk = (event, index) => {
if (event !== null) {
let params = {
stm: dayjs(new Date(event[0])).format('YYYY-MM-DD HH:mm:ss'),
etm: dayjs(new Date(event[1])).format('YYYY-MM-DD HH:mm:ss'),
stm: dayjs(new Date(event[0])).format('YYYY-MM-DD'),
etm: dayjs(new Date(event[1])).format('YYYY-MM-DD'),
}
// getStm(params, index)
getInfo(params)
}
}
const getInfo=(params)=>{
let obj1=[]
let sum=0
httppost(apiurl.szzf.ajtj.info+0,params).then(res=>{
res.data.map(item=>{
obj1.push({value:item.count,name:obj[item.type]})
sum=sum+item.count
})
// debugger;
setPlanData(obj1)
setSum(sum)
})
}
useEffect(() => {
let params = {
stm: dayjs().startOf("year").format('YYYY-MM-DD HH:mm:ss'),
etm: dayjs().format('YYYY-MM-DD HH:mm:ss'),
}
getInfo(params)
},[])
let data = [
{ value: 1048, name: 'Search Engine' },
{ value: 735, name: 'Direct' },
{ value: 580, name: 'Email' },
{ value: 484, name: 'Union Ads' },
{ value: 300, name: 'Video Ads' }
]
setPlanData(data)
})
return (
<>
<div className='top' style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between' }}>
<div style={{ fontSize: 20, fontWeight: 'bold', display: 'flex', alignItems: 'center' }}>
<div style={{ width: 5, height: 25, backgroundColor: '#259def', marginRight: 10 }}></div>
案件来源
{title}
</div>
<DatePicker.RangePicker
style={{ width: 220, }}

View File

@ -2,65 +2,48 @@ import dayjs from 'dayjs';
import { Space, Table, Tag, DatePicker, Form, Select, Button, Card } from 'antd';
import ReactECharts from 'echarts-for-react';
import { useEffect, useState, useMemo } from 'react';
import { httppost } from '../../../../utils/request';
import apiurl from '../../../../service/apiurl';
let obj =
{
0: '违建',
1: '毁林垦荒',
2: '筑坝拦汊',
3: '填占库容',
4: '违法取水',
5: '其他'
}
const Page = ({ title = '标题' }) => {
const [echart2, setEchart2] = useState(Object())
const [inspectordata, setInspectorData] = useState([{}])
const [plandata, setPlanData] = useState(Object())
const [problemdata, setProblemData] = useState(Object())
const [sumTotal, setSum] = useState(0)
const getPlanOption = useMemo((name, data) => {
// let total = 0
// for (let i = 0; i < data.length; i++) {
// total = total + Number(data[i].value)
// }
return {
legend: {
data: Object.values(obj)
},
angleAxis: {
type: 'category',
data: Object.values(obj)
data: ['应用服务中心', '技术管理', '综合管理', '进度管理', '质量管理', '安全管理', '其它']
},
// radar: [
// {
// indicator: [
// { text: '' },
// { text: '' },
// { text: '' },
// { text: '' },
// { text: '' },
// { text: '' },
// { text: '' },
// ],
// radius: '80%',
// splitNumber: 12,
// shape: 'circle',
// splitArea: {
// areaStyle: {
// color: '#fff',
// }
// },
// axisLine: {
// lineStyle: {
// color: '#d4d4d4'
// }
// },
// },
// ],
radar: [
{
indicator: [
{ text: '' },
{ text: '' },
{ text: '' },
{ text: '' },
{ text: '' },
{ text: '' },
{ text: '' },
],
radius: '80%',
splitNumber: 12,
shape: 'circle',
splitArea: {
areaStyle: {
color: '#fff',
}
},
axisLine: {
lineStyle: {
color: '#d4d4d4'
}
},
},
],
radiusAxis: {
min: 0,
max: 20,
@ -95,7 +78,15 @@ const Page = ({ title = '标题' }) => {
borderRadius: 8
},
},
data: plandata
data: [
{ value: 40, name: '应用服务中心' },
{ value: 32, name: '技术管理' },
{ value: 30, name: '综合管理' },
{ value: 30, name: '进度管理' },
{ value: 28, name: '质量管理' },
{ value: 28, name: '安全管理' },
{ value: 18, name: '其它' },
]
}
]
}
@ -105,41 +96,28 @@ const Page = ({ title = '标题' }) => {
const onOk = (event, index) => {
if (event !== null) {
let params = {
stm: dayjs(new Date(event[0])).format('YYYY-MM-DD HH:mm:ss'),
etm: dayjs(new Date(event[1])).format('YYYY-MM-DD HH:mm:ss'),
stm: dayjs(new Date(event[0])).format('YYYY-MM-DD'),
etm: dayjs(new Date(event[1])).format('YYYY-MM-DD'),
}
// getStm(params, index)
getInfo(params)
}
}
const getInfo = (params) => {
let obj1 = []
let sum = 0
httppost(apiurl.szzf.ajtj.info + 1, params).then(res => {
res.data.map(item => {
obj1.push({ value: item.count, name: obj[item.type] })
sum = sum + item.count
})
// debugger;
setPlanData(obj1)
setSum(sum)
})
}
useEffect(() => {
let params = {
stm: dayjs().startOf("year").format('YYYY-MM-DD HH:mm:ss'),
etm: dayjs().format('YYYY-MM-DD HH:mm:ss'),
}
getInfo(params)
}, [])
let data = [
{ value: 1048, name: 'Search Engine' },
{ value: 735, name: 'Direct' },
{ value: 580, name: 'Email' },
{ value: 484, name: 'Union Ads' },
{ value: 300, name: 'Video Ads' }
]
setPlanData(data)
})
return (
<>
<div className='top' style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between' }}>
<div style={{ fontSize: 20, fontWeight: 'bold', display: 'flex', alignItems: 'center' }}>
<div style={{ width: 5, height: 25, backgroundColor: '#259def', marginRight: 10 }}></div>
案件类型
{title}
</div>
<DatePicker.RangePicker
style={{ width: 220, }}

View File

@ -3,8 +3,6 @@ import { Space, Table, Tag, DatePicker, Form, Select, Button, Card } from 'antd'
import ReactECharts from 'echarts-for-react';
import { useEffect, useState, useMemo } from 'react';
import { encode } from 'punycode';
import { httpget } from '../../../../utils/request';
import apiurl from '../../../../service/apiurl';
const Page = ({ title = '标题' }) => {
const [echart2, setEchart2] = useState(Object())
@ -16,12 +14,12 @@ const Page = ({ title = '标题' }) => {
tooltip: {
trigger: 'axis',
position: ['20%', '50%'],
formatter:function(value){
console.log(value);
return `<div>${value[0].value.month+"月份"}</div><div>数量:${value[0].value.count}</div>`;
}
},
},
legend: {
data: ['运行调度指令'],
},
dataset: [
{ source: plandata },
]
@ -29,30 +27,22 @@ const Page = ({ title = '标题' }) => {
xAxis:
{
type: 'category',
axisLabel: {
show: true,
textStyle: {
color: '#595C61'
},
formatter:function(value){
return value+'月';
}
}
}
,
yAxis: [
{
name: 'mm',
type: 'value'
}
],
series: [
{
name:'数量',
name: '2量',
type: 'line',
datasetIndex: 0,
encode: {
x: 'month',
y: 'count'
x: 'name',
y: 'value'
},
itemStyle: {
color: 'skyblue'
@ -65,33 +55,34 @@ const Page = ({ title = '标题' }) => {
const onOk = (event, index) => {
if (event !== null) {
let params = dayjs(event).format('YYYY')
getInfo(params)
let params = {
stm: dayjs(new Date(event[0])).format('YYYY-MM-DD'),
etm: dayjs(new Date(event[1])).format('YYYY-MM-DD'),
}
}
}
const getInfo = (params) => {
httpget(apiurl.szzf.ajtj.qs+ params).then(res => {
setPlanData(res.data)
})
}
useEffect(() => {
let params = dayjs().format('YYYY')
getInfo(params)
}, [])
let data = [
{ value: 1048, name: 'Search Engine' },
{ value: 735, name: 'Direct' },
{ value: 580, name: 'Email' },
{ value: 484, name: 'Union Ads' },
{ value: 300, name: 'Video Ads' }
]
setPlanData(data)
})
return (
<>
<div className='top' style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between' }}>
<div style={{ fontSize: 20, fontWeight: 'bold', display: 'flex', alignItems: 'center' }}>
<div style={{ width: 5, height: 25, backgroundColor: '#259def', marginRight: 10 }}></div>
案件趋势
{title}
</div>
<DatePicker
<DatePicker.RangePicker
style={{ width: 220, }}
onChange={(e, index) => onOk(e, 2)}
defaultValue={dayjs()}
picker='year'
></DatePicker>
defaultValue={[dayjs().startOf("year"), dayjs()]}
></DatePicker.RangePicker>
</div>
<ReactECharts
ref={(e) => setEchart2(e)}

View File

@ -3,17 +3,14 @@ import { Button } from 'antd'
import ModalForm from './form';
import BasicCrudModal from '../../../../components/crud/BasicCrudModal';
import React, { Fragment, useRef, useMemo, useEffect, useState } from 'react';
import { httpget } from '../../../../utils/request';
import apiurl from '../../../../service/apiurl';
const Page = ({ treeSelect }) => {
const Page = ({ data }) => {
const refModal = useRef();
const [data,setData] = useState({})
/**
* @description 处理成功的回调
*/
const successCallback = () => {
getInfo()
// refresh()
// setIsFetch(!isFetch)
}
const dataPahe = {
@ -21,37 +18,27 @@ const Page = ({ treeSelect }) => {
zhunag: '1'
}
const edit = () => {
refModal.current.showEdit({...data});
refModal.current.showEdit({});
}
const getInfo=()=>{
httpget(apiurl.szzf.clyj.detail+treeSelect?.key).then(res=>{
setData({...res.data,name:treeSelect.name})
})
}
useEffect(()=>{
if(treeSelect){
getInfo()
}
},[treeSelect])
return (
<>
<div className={styles.list} style={{ padding: '0 10px', marginBottom: 5 }}>{treeSelect?.name}<Button type="primary" onClick={edit}>编辑</Button></div>
<div className={styles.list} style={{ padding: '0 10px', marginBottom: 5 }}>{dataPahe.title}<Button type="primary" onClick={edit}>编辑</Button></div>
<div className={styles.listborder} style={{ padding: '0 10px', }}>状态</div>
<div className={styles.listborder} style={{ padding: '0 10px', marginBottom: 5 }}>{data?.status?'启用':'禁用'}</div>
<div className={styles.listborder} style={{ padding: '0 10px', }}>{dataPahe.title}</div>
<div className={styles.listborder} style={{ padding: '0 10px', marginBottom: 5 }}>{dataPahe.title}</div>
<div className={styles.contentBor} style={{ padding: '0 10px', marginBottom: 5, height: '35%' }}>
<div className={styles.listborder} style={{ padding: '0 10px', height: '30%' }}>法律依据</div>
{data?.legalName ?? '无内容请添加'}
<div className={styles.listborder} style={{ padding: '0 10px', height: '30%' }}>{dataPahe.title}</div>
{dataPahe.title ?? '无内容请添加'}
</div>
<div style={{ display: 'flex', height: '33%' }}>
<div className={styles.contentBor} style={{ flex: 1, marginRight: 5 }}>
<div className={styles.listborder} style={{ height: '30%', padding: '0 10px', }}>违法行为描述</div>
<div style={{ padding: '0 10px' }}>{data?.violationDesc ?? '无内容请添加'}</div>
<div className={styles.listborder} style={{ height: '30%', padding: '0 10px', }}>{dataPahe.title}</div>
<div style={{ padding: '0 10px' }}>{dataPahe.title ?? '无内容请添加'}</div>
</div>
<div className={styles.contentBor} style={{ flex: 1 }}>
<div className={styles.listborder} style={{ height: '30%', padding: '0 10px', }}>处罚措施</div>
<div style={{ padding: '0 10px' }}>{data?.penalties ?? '无内容请添加'}</div>
<div className={styles.listborder} style={{ height: '30%', padding: '0 10px', }}>{dataPahe.title}</div>
<div style={{ padding: '0 10px' }}>{dataPahe.title ?? '无内容请添加'}</div>
</div>
</div>

View File

@ -5,7 +5,6 @@
align-items: center;
justify-content: space-between;
background-color: #fff;
font-size: 16px;
}
.listborder{
@ -16,13 +15,9 @@
justify-content: space-between;
background-color: #fff;
border-bottom: 1px solid #f0f0f0;
font-size: 16px;
}
.contentBor{
background-color: #fff;
border-bottom: 1px solid #f0f0f0;
font-size: 16px;
}

View File

@ -10,10 +10,10 @@ import moment from 'moment';
const { TextArea } = Input;
const options=[
{label:'禁用',value:0},
{label:'启用',value:1}
{label:'禁用'},
{label:'启用'}
]
const ModalForm = ({ mode, record, onEdit, onSave, onCrudSuccess }) => {
const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
const [form] = Form.useForm();
const [fileList, setFileList] = useState([]) //上传文件列表
@ -24,11 +24,30 @@ const ModalForm = ({ mode, record, onEdit, onSave, onCrudSuccess }) => {
const onfinish = (values) => {
onEdit(apiurl.szzf.clyj.edit, {...record,...values})
values.eventsDate = values.eventsDate ? moment(values.eventsDate).format("YYYY-MM-DD 00:00:00") : ''
let oldFiles = fileList.map(item => ({ fileId: item.response?.data?.fileId }))
if (mode === 'edit') {
values.files = oldFiles;
values.id = record.id;
onEdit(apiurl.rcgl.gcdsj.edit, values)
}
if (mode === 'save') {
values.files = oldFiles
onSave(apiurl.rcgl.gcdsj.save, values)
}
}
useEffect(() => {
if(record){
form.setFieldsValue(record)
if (mode != 'save') {
const imgFile = record?.files?.map(o => ({
name: o.fileName,
response: {
data: {
filePath: o.filePath,
fileId: o.fileId
}
},
}))
setFileList(imgFile)
}
}, [record, mode])
@ -55,7 +74,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onCrudSuccess }) => {
<Col span={24}>
<Form.Item
label="状态"
name="status"
name="name"
rules={[{ required: true }]}
>
<Radio.Group options={options}/>
@ -64,7 +83,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onCrudSuccess }) => {
<Col span={24}>
<Form.Item
label="法律名称"
name="legalName"
name="name"
rules={[{ required: true }]}
>
<Input style={{ width: '100%' }} allowClear />
@ -73,7 +92,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onCrudSuccess }) => {
<Col span={24}>
<Form.Item
label="法条内容"
name="legalContent"
name="name"
>
<Input style={{ width: '100%' }} allowClear />
</Form.Item>
@ -82,7 +101,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onCrudSuccess }) => {
<Col span={24}>
<Form.Item
label="违法行为描述"
name="violationDesc"
name="name"
>
<TextArea rows={4} />
</Form.Item>
@ -90,7 +109,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onCrudSuccess }) => {
<Col span={24}>
<Form.Item
label="处罚措施"
name="penalties"
name="name"
>
<TextArea rows={4} />
</Form.Item>

View File

@ -2,22 +2,17 @@ import { Card } from 'antd'
import TreeSelectZdy from './treeSelectZdy'
import ContentPage from './content'
import { useEffect, useState } from 'react'
const Page = () => {
const [treeSelect ,setTreeSelect] =useState({})
useEffect(()=>{
console.log(treeSelect,'1111');
},[treeSelect])
return (
<div style={{display:'flex',height: '100%'}}>
<div style={{ width: 320, backgroundColor: '#fff', padding: 10 }}>
<TreeSelectZdy setTreeSelect={setTreeSelect}/>
<TreeSelectZdy />
</div>
<div style={{ flex:1 ,marginLeft:10}}>
<ContentPage treeSelect={treeSelect[0]}/>
<ContentPage />
</div>
</div>

View File

@ -1,64 +1,57 @@
import React, { useState, useMemo, useEffect, useRef } from 'react';
import { Tree, Input, Tooltip } from 'antd';
import { httpget } from '../../../../utils/request';
import apiurl from '../../../../service/apiurl';
import React, { useState, useMemo } from 'react';
import { Tree, Input } from 'antd';
const { Search } = Input;
// const data = [
// {
// key: 'parent 1',
// title: '违反水利工程建设与管理类行为',
// children: [
// {
// value: 'parent 1-0',
// title: '侵占、毁坏水法规定相关设施',
// children: [
// {
// key: 'leaf1',
// title: '侵占、毁坏水工程及堤防、护岸...',
// },
// {
// key: 'leaf2',
// title: '毁坏防汛、水文监测、水文地质...',
// },
// {
// key: 'leaf3',
// title: '在水工程保护范围内,从事影响..',
// }
// ],
// },
// {
// key: 'parent 1-1',
// title: '破坏大坝管理设施、妨碍大坝',
// children: [
// {
// key: 'leaf4',
// title: '毁坏大坝及其管理设施',
// },
// {
// key: 'leaf5',
// title: '危害大坝安全或破坏大坝正常运行',
// },
// {
// key: 'leaf6',
// title: '在岸区或坝体从事生产活动',
// },
// ],
// },
// ],
// },
// ];
const data = [
{
key: 'parent 1',
title: '违反水利工程建设与管理类行为',
children: [
{
value: 'parent 1-0',
title: '侵占、毁坏水法规定相关设施',
children: [
{
key: 'leaf1',
title: '侵占、毁坏水工程及堤防、护岸...',
},
{
key: 'leaf2',
title: '毁坏防汛、水文监测、水文地质...',
},
{
key: 'leaf3',
title: '在水工程保护范围内,从事影响..',
}
],
},
{
key: 'parent 1-1',
title: '破坏大坝管理设施、妨碍大坝',
children: [
{
key: 'leaf4',
title: '毁坏大坝及其管理设施',
},
{
key: 'leaf5',
title: '危害大坝安全或破坏大坝正常运行',
},
{
key: 'leaf6',
title: '在岸区或坝体从事生产活动',
},
],
},
],
},
];
let dataList = [];
const Page = ({ setTreeSelect }) => {
const Page = () => {
const [expandedKeys, setExpandedKeys] = useState([]);
const [searchValue, setSearchValue] = useState();
const [searchValue, setSearchValue] = useState('');
const [autoExpandParent, setAutoExpandParent] = useState(true);
const [selectNode, setSelect] = useState(true);
const [data, setData] = useState([]);
const treeRef = useRef();
const onExpand = (newExpandedKeys) => {
@ -67,7 +60,15 @@ const Page = ({ setTreeSelect }) => {
};
const onSearch = (value) => {
debugger;
// const newExpandedKeys = dataList
// .map((item) => {
// if (item.title.indexOf(value) > -1) {
// return getParentKey(item.key, data);
// }
// return null;
// })
// .filter((item, i, self) => !!(item && self.indexOf(item) === i));
// setExpandedKeys(newExpandedKeys);
setSearchValue(value);
setAutoExpandParent(true);
@ -75,94 +76,48 @@ const Page = ({ setTreeSelect }) => {
const treeData = useMemo(() => {
const loop = (data) =>
data.map((item) => {
const strTitle = item.legalName;
const strTitle = item.title;
const index = strTitle?.indexOf(searchValue);
const beforeStr = strTitle.substring(0, index);
const afterStr = strTitle.slice(index + searchValue?.length);
const afterStr = strTitle.slice(index + searchValue.length);
const title =
index > -1 ? (
<span key={item.id}>
<span key={item.key}>
{beforeStr}
<span className="site-tree-search-value" style={{ color: 'red' }}>{searchValue}</span>
{afterStr}
</span>
) : (
<span key={item.id}>{strTitle}</span>
<span key={item.key}>{strTitle}</span>
);
if (item.children) {
return { title: title, key: item.id, children: loop(item.children), name: strTitle };
return { title, key: item.key, children: loop(item.children) };
}
if (index > -1) {
console.log(index, strTitle, searchValue);
dataList.push(item.id)
dataList.push(item.key)
setExpandedKeys(dataList);
if (dataList.length < 2) {
treeRef.current.scrollTo({ key: dataList[0].id });
}
}
return {
title: title,
key: item.id,
name: strTitle
title,
key: item.key,
};
});
return loop(data);
}, [searchValue, data]);
useEffect(() => {
httpget(apiurl.szzf.clyj.tree).then(res => {
setData(res.data)
setTreeSelect(
[{
key: res.data[0].id,
name: res.data[0].legalName,
}]
)
setSelect([res.data[0].id])
})
}, [])
}, [searchValue]);
return (
<>
<div style={{ margin: '10px 0' }}><Search onSearch={onSearch} /></div>
<Tree
onExpand={onExpand}
ref={treeRef}
expandedKeys={expandedKeys}
treeData={treeData}
autoExpandParent={autoExpandParent}
selectedKeys={selectNode}
titleRender={(data) => {
return (
<div style={{ color: data.children ? '#c8c8c8' : '', cursor: data.children ? 'not-allowed' : '' }} >
<Tooltip title={data.name}>
<div className='ellipsis1' style={{ width: 200 }}>
{data.title}
</div>
</Tooltip>
</div>)
}}
onSelect={(e, node) => {
if (node.selectedNodes[0].children) {
return;
}
setSelect(e)
setTreeSelect(
node.selectedNodes
)
}}
height={800}
/>
</>
);
};
export default Page;
export default Page;

View File

@ -1,38 +1,34 @@
import React, { useEffect, useState, useRef } from 'react';
import { TreeSelect, Table, Tag, DatePicker, Form, Select, Button, message, Upload, Input, Row, Col, Switch, Image,Radio } from 'antd';
import { Space, Table, Radio, DatePicker, Form, Select, Button, message, Upload, Input, Row, Col, Switch, Image } from 'antd';
import './ddForm.less'
import dayjs from 'dayjs'
import { InboxOutlined, LinkOutlined, DeleteOutlined, LoadingOutlined, VerticalAlignBottomOutlined } from '@ant-design/icons'
import apiurl from '../../../../service/apiurl';
import { httpgetExport, httppostAddfile } from '../../../../utils/request';
import { exportFile } from '../../../../utils/tools';
// import apiUrl from '../../service/apiurl'
import { InboxOutlined, LinkOutlined, DeleteOutlined, LoadingOutlined,VerticalAlignBottomOutlined } from '@ant-design/icons'
import { httpPostFile } from '../../../../utils/request';
import apiUrl from '../../../../service/apiurl'
import PdfView from './pdfView'
const { RangePicker } = DatePicker;
const { TextArea } = Input;
const baseUrl = "http://local.gunshiiot.com:18083/gunshiApp/xintankou"
const baseUrl = "http://223.75.53.141:9102/test.by-lyf.tmp"
const FormZdy = ({ fileKey,typeName = "ddForm", formJson, getFormInfo, type, formJsonData, typeUpload = 'dispatch', isModalOpen, fileType, footer = true, uploadUrl,TableZdyProps,downloadUrl,
onSave }) => {
const FormZdy = ({ typeName = "ddForm", formJson, getFormInfo, type, formJsonData, typeUpload = 'dispatch', isModalOpen,fileType,footer=true }) => {
const [fileList, setFileList] = useState([])
const [fileListUp, setFileLisUp] = useState([])
const [url, setUrl] = useState('')
const [isModal, setIsModal] = useState(false)
//
// debugger;
const [form] = Form.useForm();
// function onDocumentLoadSuccess({ numPages }) {
// setRenderNumPages(numPages);
// }
// function onDocumentLoadSuccess({ numPages }) {
// setRenderNumPages(numPages);
// }
const onFinish = (e) => {
}
const getInfo = () => {
form.validateFields().then((values) => {
getFormInfo({ ...values, [fileKey]: fileList, fileIds: fileList.map(item => item.fileId) })
getFormInfo({ ...values, files: fileList, fileIds: fileList.map(item => item.id) })
form.resetFields()
setFileList([])
}).catch((errorInfo) => {
@ -51,8 +47,7 @@ const FormZdy = ({ fileKey,typeName = "ddForm", formJson, getFormInfo, type, for
// window.open('http://local.gunshiiot.com:18083/xintankou/api/file/preview/104')
// }
const deleteFile = (e) => {
debugger;
let arr = fileList.filter(item => item.fileId !== e)
let arr = fileList.filter(item => item.id !== e)
setFileList(arr)
}
const props = {
@ -60,7 +55,7 @@ const FormZdy = ({ fileKey,typeName = "ddForm", formJson, getFormInfo, type, for
multiple: true,
fileList: fileList,
showUploadList: false,
beforeUpload: (file, fileList) => {
beforeUpload: (file, fileList) => {
if (fileType == "pic" &&
(file.type != "image/jpeg" || file.type != "image/png" || file.type != "image/jpg")) {
message.error('仅支持上传jpg/png/jpeg格式的图片');
@ -69,10 +64,9 @@ const FormZdy = ({ fileKey,typeName = "ddForm", formJson, getFormInfo, type, for
return true;
}
},
customRequest(e) {
onChange(e) {
setFileLisUp([...fileListUp, e.file])
debugger
httppostAddfile(uploadUrl, e).then(res => {
httpPostFile(apiUrl.service.uploadFile.uploadUrl + "?group=" + typeUpload, e).then(res => {
setFileList([...fileList, res.data])
})
}
@ -82,12 +76,12 @@ const FormZdy = ({ fileKey,typeName = "ddForm", formJson, getFormInfo, type, for
// 创建URL对象
var link = url;
// 获取路径的最后一个点之后的内容作为文件扩展名
var extension = link?.split('.').pop().toLowerCase();
var extension = link.split('.').pop().toLowerCase();
// 声明支持的图片和视频文件扩展名
var imageExtensions = ['jpg', 'jpeg', 'gif', 'png'];
var file = ['pdf', 'word', 'xslx', 'xsl', 'txt', "pptx"];
//
var file = ['pdf', 'word', 'xslx', 'xsl', 'txt',"pptx"];
// 判断文件扩展名是否在图片扩展名数组中
if (imageExtensions.includes(extension)) {
return 'image';
@ -104,209 +98,122 @@ const FormZdy = ({ fileKey,typeName = "ddForm", formJson, getFormInfo, type, for
const preView = (item) => {
if (checkMediaType(item.name) == 'pdf') {
// window.open(baseUrl + item.previewUrl)
setUrl(item.previewUrl)
setUrl(`${`http://local.gunshiiot.com:18083/xintankou`}/static/pdf/web/viewer.html?file=${encodeURIComponent(`http://local.gunshiiot.com:18083/gunshiApp/xintankou/${item.previewUrl}`)}`)
setIsModal(true)
}
}
/**
* @description 文件下载
* @param {String} params 文件fileId
*/
const download = async(id, name) => {
var extension = name?.split('.').pop().toLowerCase();
httpgetExport(downloadUrl+id).then(res => {
exportFile(name,res.data)
})
}
/**
* @description 文件下载
* @param {String} params 文件fileId
*/
const download = (id,name) => {
let downloadLink = document.createElement("a");
downloadLink.href = `http://local.gunshiiot.com:18083/gunshiApp/xintankou/api/file/download/${id}`;
downloadLink.download = `${name}`;
downloadLink.style.display = "none";
// 将链接添加到页面中
document.body.appendChild(downloadLink);
// 模拟点击事件,开始下载
downloadLink.click();
}
useEffect(() => {
// form.resetFields()
form.resetFields()
let formType = type
if (type = 'edit') {
formType = 2
if(type='edit'){
formType=2
}
if (type == 'view') {
formType = 1
if(type == 'view'){
formType =1
}
if (type == 'save') {
formType = 0
if(type=='save'){
formType =0
}
if (formType == 1 || formType == 2 || formType == 3) {
form.setFieldsValue(formJsonData)
if (formJsonData?.[fileKey]) {
setFileList(formJsonData[fileKey])
if (formJsonData?.files) {
setFileList(formJsonData.files)
}
console.log(formJsonData, formJson);
//
}
return () => {
setFileList([])
}
}, [type, formJsonData, isModalOpen])
return (
<div style={{ backgroundColor: '#fff', marginTop: 10 }}>
<div style={{ backgroundColor: '#fff' }}>
<Form form={form} name="searchTabel" onFinish={onFinish} className={typeName}>
<Row>
{formJson?.map(item => {
{formJson.map(item => {
return (
<Col span={item.span} >
{item.type == "input" &&
<Form.Item
label={item.label}
name={item.key}
rules={[{ required: item.required, message: '请输入' + item.label }]}
>
<Input disabled={type == 'view' || item.disabled} placeholder={item.placeholder} />
</Form.Item>}
{item.type == "title" &&
<Form.Item
label={item.label}
name={item.key}
rules={[{ required: item.required, message: '请输入' + item.label }]}
>
<div className='title'>
<div className='titleRight'></div>
{item.content}
</div>
</Form.Item>}
{item.type == "Select" && <Form.Item
<Form.Item
label={item.label}
name={item.key}
rules={[{ required: item.required, message: '请输入' + item.label }]}
className={item.type == 'empty'?'empty':'noempty'}
>
<Select disabled={type == 'view'} options={item.options} fieldNames={item.fieldNames} />
</Form.Item>}
{item.type == "Radio" && <Form.Item
label={item.label}
name={item.key}
rules={[{ required: item.required, message: '请输入' + item.label }]}
>
<Radio.Group disabled={type == 'view'} options={item.options}/>
</Form.Item>}
{/* {item.type == "Select" && <Select disabled={type == 1} options={item.options} />} */}
{item.type == "Switch" && <Form.Item
label={item.label}
name={item.key}
rules={[{ required: item.required, message: '请输入' + item.label }]}
>
<Switch defaultChecked onChange={onChange} disabled={type == 'view'} />
</Form.Item>}
{/* {item.type == "Switch" && <Switch defaultChecked onChange={onChange} disabled={type == 1} />} */}
{item.type == "DatePicker" && <Form.Item
label={item.label}
name={item.key}
rules={[{ required: item.required, message: '请输入' + item.label }]}
>
{/* {formJsonData[item.key]} */}
<DatePicker disabled={type == 'view'} style={{ width: "100%" }} picker={item.picker}/>
</Form.Item>}
{/* {item.type == "DatePicker" && <DatePicker disabled={type == 1} style={{ width: "100%" }} />} */}
{item.type == "TextArea" && <Form.Item
label={item.label}
name={item.key}
rules={[{ required: item.required, message: '请输入' + item.label }]}
>
<TextArea rows={4} disabled={type == 'view'} />
</Form.Item>}
{/* {item.type == "TextArea" && <TextArea rows={4} disabled={type == 1} />} */}
{item.type == "RangePicker" && <Form.Item
label={item.label}
name={item.key}
rules={[{ required: item.required, message: '请输入' + item.label }]}
>
<RangePicker disabled={type == 'view'} />
</Form.Item>}
{item.type == "TreeSelect" && <Form.Item
label={item.label}
name={item.key}
rules={[{ required: item.required, message: '请输入' + item.label }]}
>
<TreeSelect
showSearch
style={{ width: '100%' }}
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
placeholder="Please select"
allowClear
fieldNames={item.fieldNames}
treeData={item.treeData}
treeCheckable={item.multiple}
/>
</Form.Item>}
{/* {item.type == "RangePicker" &&
<RangePicker disabled={type == 'view'} />} */}
{item.type == "upload" && <Form.Item
label={item.label}
name={item.key}
rules={[{ required: item.required, message: '请输入' + item.label }]}
>
<>
{type !== 'view' && <Dragger {...props}>
<p className="ant-upload-drag-icon">
<InboxOutlined />
</p>
{fileType == "pic" ? <p className="ant-upload-text">点击或将文件拖拽到这里上传 支持扩展名jpegpng</p> : <p className="ant-upload-text"></p>}
</Dragger>}
<div className='flex' >
{fileList?.map((item) => {
return <div className='flex align-center file-item' style={{ marginRight:'3%',width:'30%',minHeight: "50px", fontSize: 14, columnGap: 10, cursor: checkMediaType(item.fileName) == 'image' || checkMediaType(item.fileName) == 'pdf' ? 'pointer' : "not-allowed" }}>
<div style={{ width: 40, height: 40, display: "flex", alignItems: 'center' }}>
{checkMediaType(item.fileName) == 'image' && <Image
{item.type == "input" && <Input disabled={type == 1 || item.disabled} placeholder={item.placeholder} />}
{item.type == "Select" && <Select disabled={type == 1} options={item.options} />}
{item.type == "empty" && <Input disabled={item.type == "empty" ? true : false} />}
{item.type == "Switch" && <Switch defaultChecked onChange={onChange} disabled={type == 1} />}
{item.type == "DatePicker" && <DatePicker disabled={type == 1} style={{width:"100%"}} />}
{item.type == "TextArea" && <TextArea rows={4} disabled={type == 1} />}
{item.type == "Radio" &&<Radio.Group options={item.options} />}
{item.type == "RangePicker" &&
<RangePicker disabled={type=='view'} />}
{item.type == "upload" &&
<>
{type !== 1 && <Dragger {...props}>
<p className="ant-upload-drag-icon">
<InboxOutlined />
</p>
{fileType == "pic" ? <p className="ant-upload-text">点击或将文件拖拽到这里上传 支持扩展名jpegpng</p>: <p className="ant-upload-text"></p>}
</Dragger>}
<div>
{fileList?.map((item) => {
return <div className='flex align-center' style={{ minHeight: "50px", fontSize: 14,columnGap:10, cursor: checkMediaType(item.name) == 'image' || checkMediaType(item.name) == 'pdf'?'pointer':"not-allowed" }}>
<div style={{width:40,height:40,display:"flex",alignItems:'center'}}>
{checkMediaType(item.name) == 'image' && <Image
height={40}
src={baseUrl + item.filePath}
src={baseUrl + item.previewUrl}
/>}
{
checkMediaType(item.fileName) !== 'image' &&
<span >{checkMediaType(item.fileName)?.toUpperCase()}</span>
checkMediaType(item.name) !== 'image' &&
<span >{checkMediaType(item.name)?.toUpperCase()}</span>
}
</div>
<span onClick={() => preView(item)}>{item.name}</span>
{type==2&&<DeleteOutlined onClick={() => deleteFile(item.id)} />}
<VerticalAlignBottomOutlined onClick={() => download(item.id,item.name)} />
</div>
<span onClick={() => preView(item)}>{item.fileName}</span>
{type !== 'view' && <DeleteOutlined onClick={() => deleteFile(item.fileId)} />}
<VerticalAlignBottomOutlined onClick={() => download(item.fileId, item.fileName)} />
</div>
})}
</div>
</>
</Form.Item>}
})}
</div>
</>}
</Form.Item>
</Col>
)
})}
</Row>
</Form >
{TableZdyProps}
{
type !== 'view' && <div className="flex flex-end" style={{ marginTop: 10, justifyContent: "flex-end" }}>
<Button type="" style={{ marginRight: 10 }} onClick={cancel}>取消</Button>
<Button type="primary" onClick={getInfo}>确定</Button>
</div>
}
<PdfView url={`${process.env.PUBLIC_URL}/static/pdf/web/viewer.html?file=${encodeURIComponent(`/gunshiApp/xyt/rescue/goods/file/download/${url}`)}`} isModal={isModal} setModalN={(e)=>setIsModal(e)}/>
{type !== 1 &&<div className="flex flex-end" style={{ marginTop: 10 }}>
<Button type="" style={{ marginRight: 10 }} onClick={cancel}>取消</Button>
<Button type="primary" onClick={getInfo}>确定</Button>
</div>}
<PdfView url={url} isModal={isModal} setModalN={(e)=>setIsModal(e)}/>
</div >
</div>
);
}

View File

@ -14,13 +14,12 @@ const { Dragger } = Upload;
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
const opntios=[
{value:0,label:'党支部工作制度'},
{value:1,label:'行政工作制度'},
{value:2,label:'部门工作制度'},
{value:3,label:'安全管理制度'},
{value:4,label:'工程管理制度'},
{value:5,label:'技术规程'},
{value:6,label:'岗位责任制'}
{label:'宪法',value:'宪法'},
{label:'法律',value:'法律'},
{label:'行政法规',value:'行政法规'},
{label:'督察法规',value:'督察法规'},
{label:'司法解释',value:'司法解释'},
{label:'地方性法规',value:'地方性法规'},
]
const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
@ -38,7 +37,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
*/
const download = (params) => {
let downloadLink = document.createElement("a");
downloadLink.href = `http://local.gunshiiot.com:18083/gunshiApp/tsg/projectEvents/file/download/${params}`;
downloadLink.href = `http://local.gunshiiot.com:18083/gunshiApp/xyt/projectEvents/file/download/${params}`;
downloadLink.download = `${params.fileName}`;
downloadLink.style.display = "none";
// 将链接添加到页面中
@ -79,16 +78,16 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
const onfinish = (values) => {
let oldFiles = fileList.map(item => (item.response?.data))
debugger
values.eventsDate = values.eventsDate ? moment(values.eventsDate).format("YYYY-MM-DD 00:00:00") : ''
let oldFiles = fileList.map(item => ({ fileId: item.response?.data?.fileId }))
if (mode === 'edit') {
values.files = oldFiles;
values.id = record.id;
onEdit(apiurl.zdgl.edit, {...record,...values})
onEdit(apiurl.rcgl.gcdsj.edit, values)
}
if (mode === 'save') {
values.files = oldFiles
onSave(apiurl.zdgl.add, values)
onSave(apiurl.rcgl.gcdsj.save, values)
}
}
@ -137,24 +136,30 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
</Form.Item>
</Col>
<Col span={12}>
<Form.Item label="制度类型" name="type" rules={[{ required: true }]}>
<Form.Item label="制度类型" name="name">
<Select allowClear style={{ width: '150px' }} options={opntios} />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="公布日期"
name="releaseDate"
name="eventsDate"
getValueFromEvent={(e, dateString) => dateString}
getValueProps={(value) => ({ value: value ? moment(value) : undefined })}
rules={[
{
required: true,
},
]}
>
<DatePicker disabled={mode === 'view'} format={'YYYY-MM-DD HH:mm:ss'} style={{ width: '100%' }} allowClear />
<DatePicker disabled={mode === 'view'} format={'YYYY-MM-DD'} style={{ width: '100%' }} allowClear />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="发布单位"
name="fillUnit"
name="name"
rules={[{ required: true }]}
>
<Input disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
</Form.Item>
@ -165,7 +170,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
<Col span={24}>
<Form.Item
label="附件"
name="files"
name="fieldId"
labelCol={{ span: 3 }}
wrapperCol={{ span: 19 }}
>
@ -173,7 +178,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
<Dragger
name='file'
// multiple
action="/gunshiApp/tsg/SzRegulatoryFramework/file/upload/singleSimple"
action="/gunshiApp/xyt/projectEvents/file/upload/singleSimple"
onChange={fileChange}
onDrop={(info) => { console.log(info.dataTransfer.files); }}
fileList={fileList}
@ -247,7 +252,7 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
mode === 'view' ? null : (
<>
<Form.Item {...btnItemLayout}>
<Button type="primary" htmlType="submit" loading={loading}>
<Button type="primary" htmlType="submit">
{mode === 'save' ? '提交' : '修改'}
</Button>
</Form.Item>

View File

@ -11,7 +11,6 @@ import { createCrudService } from '../../../components/crud/_';
import { CrudOpRender_text } from '../../../components/crud/CrudOpRender';
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
const obj={0:"党支部工作制度",1:"行政工作制度",2:"部门工作制度",3:"安全管理制度",4:"工程管理制度",5:"技术规程",6:"岗位责任制"}
const Page = () => {
const role = useSelector(state => state.auth.role);
const editBtn = role?.rule?.find(item => item.menuName == "编辑");
@ -26,19 +25,19 @@ const Page = () => {
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align: "center" },
{ title: '标题', key: 'name', dataIndex: 'name', width: 250, ellipsis: true },
{
title: '制度类型', key: 'type', dataIndex: 'type', width: 140,render:(v)=><>{obj[v]}</>
title: '制度类型', key: 'eventsDate', dataIndex: 'eventsDate', width: 140,
},
{
title: '发布日期', key: 'releaseDate', dataIndex: 'releaseDate', width: 300
title: '发布日期', key: 'eventsDesc', dataIndex: 'eventsDesc', width: 300
},
{
title: '发布单位', key: 'fillUnit', dataIndex: 'fillUnit', width: 300
title: '发布单位', key: 'eventsDesc', dataIndex: 'eventsDesc', width: 300
},
{
title: '上传时间', key: 'uploadDate', dataIndex: 'uploadDate', width: 300
title: '上传时间', key: 'eventsDesc', dataIndex: 'eventsDesc', width: 300
},
{
title: '附件', key: 'files', dataIndex: 'files', width: 300,render:(v,r)=><a onClick={()=>viewPdf(v[0].fileId)}>{v[0]?.fileName}</a>
title: '附件', key: 'fileName', dataIndex: 'fileName', width: 300,render:(v,r)=><a onClick={()=>viewPdf(r.fileId)}>{v}</a>
},
{
title: '操作', key: 'operation', width: 240, fixed: 'right', align: 'center',
@ -46,7 +45,7 @@ const Page = () => {
<CrudOpRender_text
edit={true}
del={true}
// view={true}
view={true}
command={(cmd) => () => command(cmd)(row)} />)
},
];
@ -62,12 +61,12 @@ const Page = () => {
} else if (type === 'view') {
refModal.current.showView(params);
} else if (type === 'del') {
refModal.current.onDeleteGet(apiurl.zdgl.del + `/${params.id}`);
refModal.current.onDeleteGet(apiurl.rcgl.gcdsj.delete + `/${params.id}`);
}
}
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.zdgl.list).find_noCode);
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.rcgl.gcdsj.page).find_noCode);
/**
* @description 处理成功的回调
@ -134,7 +133,7 @@ const Page = () => {
border: 0,
marginTop: 20,
}}
src={`${process.env.PUBLIC_URL}/static/pdf/web/viewer.html?file=${encodeURIComponent(`/gunshiApp/tsg/projectEvents/file/download/${iframeSrc}`)}`}
src={`${process.env.PUBLIC_URL}/static/pdf/web/viewer.html?file=${encodeURIComponent(`/gunshiApp/xyt/projectEvents/file/download/${iframeSrc}`)}`}
/>
</Modal>
</>

View File

@ -22,13 +22,12 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
}
const opntios = [
{value:0,label:'党支部工作制度'},
{value:1,label:'行政工作制度'},
{value:2,label:'部门工作制度'},
{value:3,label:'安全管理制度'},
{value:4,label:'工程管理制度'},
{value:5,label:'技术规程'},
{value:6,label:'岗位责任制'}
{ label: '宪法', value: '宪法' },
{ label: '法律', value: '法律' },
{ label: '行政法规', value: '行政法规' },
{ label: '督察法规', value: '督察法规' },
{ label: '司法解释', value: '司法解释' },
{ label: '地方性法规', value: '地方性法规' },
]
const styles = {
fontFamily: '微软雅黑 Bold", "微软雅黑 Regular", 微软雅黑, sans-serif',
@ -43,13 +42,13 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
<Form.Item label="标题" name="name">
<Input allowClear style={{ width: '150px' }} />
</Form.Item>
<Form.Item label="制度类型" name="type">
<Form.Item label="制度类型" name="name">
<Select allowClear style={{ width: '150px' }} options={opntios} />
</Form.Item>
<Form.Item label="发布日期" name="releaseDate">
<Form.Item label="发布日期" name="name">
<RangePicker allowClear />
</Form.Item>
<Form.Item label="发布单位" name="fillUnit">
<Form.Item label="发布单位" name="name">
<Input allowClear style={{ width: '150px' }} />
</Form.Item>
<Form.Item>

View File

@ -1,210 +1,137 @@
const getBackground = () => {
return {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0, color: '#ffffff' // 0% 处的颜色
}, {
offset: 0.5, color: 'blue' // 100% 处的颜色
}, {
offset: 1, color: '#ffffff' // 100% 处的颜色
}],
global: false // 缺省为 false
}
}
const data = {
name: '销售部',
children: [{
name: '销售一部',
children: [{
name: '任务名称1',
itemStyle: { color: "#ff9800" },
},
{
name: '任务名称2',
itemStyle: { color: "#4d8dd9" },
},
{
name: '任务名称3',
itemStyle: { color: "#22b07b" },
},
{
name: '任务名称4'
},
{
name: '任务名称5'
},
{
name: '任务名称6'
},
{
name: '任务名称7'
},
{
name: '任务名称8'
}
]
},
{
name: '销售二部',
},
{
name: '销售三部',
children: [{
name: '任务3-1'
},
{
name: '任务3-2'
}
]
},
{
name: '销售四部',
children: [{
name: '任务4-1'
},
{
name: '任务4-2'
}
]
}
]
}
export default function jgOption() {
return {
tooltip: {
trigger: 'item',
triggerOn: 'mousemove'
},
series: [{
type: 'tree',
id: 0,
name: 'tree1',
data: [data],
top: '10%',
left: '10%',
bottom: '20%',
right: '10%',
avoidLabelOverlap: true,//防止标签重叠
roam: true, //移动+缩放 'scale' 或 'zoom':只能够缩放。 'move' 或 'pan':只能够平移。
scaleLimit:{ //缩放比例
min:0.7,//最小的缩放值
max:4,//最大的缩放值
},
layout: 'orthogonal',//树图布局orthogonal水平垂直方向radial径向布局 是指以根节点为圆心,每一层节点为环,一层层向外
orient: 'TB', //树形方向 TB为上下结构 LR为左右结构
// nodePadding: 100,//结点间距 (发现没用)
//layerPadding: 30,//连接线长度 (发现没用)
symbol: 'circle', //图形形状 rect方形 roundRect圆角 emptyCircle圆形 circle实心圆
symbolSize: 14, //状态大小
edgeShape: 'polyline', //线条类型 curve曲线
initialTreeDepth: 1, //初始展开的层级
expandAndCollapse: true,//子树折叠和展开的交互,默认打开
lineStyle: {//结构线条样式
width: 0.7,
color: '#1E9FFF',
type: 'broken'
},
label: {
// 每个节点对应的文本标签样式
show: true, // 是否显示标签
distance: 8, // 文本距离图形元素的距离
position: ['50%', '50%'], // 标签位置
verticalAlign: 'middle', // 文字垂直对齐方式默认自动topmiddlebottom
align: 'center', // 文字水平对齐方式默认自动leftrightcenter
fontSize: 16, // 字体大小
color: '#333', // 字体颜色
// color: 'red', // 字体颜色
backgroundColor: '#F8F9FA', // 文字块的背景颜色
borderColor: '#CED4DA', // 文字块边框颜色
borderWidth: 1, // 文字块边框宽度
borderType: 'solid', // 文字块边框描边类型 solid dashed dotted
borderRadius: 2, // 文字块的圆角
padding: [6, 6], // 文字块内边距
shadowColor: 'rgba(0,121,221,0.3)', // 文字块的背景阴影颜色
shadowBlur: 6, // 文字块的背景阴影长度
formatter: (params) => {
let newName = ''
let len = params.data.name.length
let strLen = params.data.relationType === 0 ? 100 : 1 //一行显示几个字
let rowNum = Math.ceil(len / strLen)
if (len > strLen) {
for (let p = 0; p < rowNum; p++) {
let tempStr = ''
let start = p * strLen
let end = start + strLen
if (p == rowNum - 1) {
tempStr = params.data.name.substring(start, len)
} else {
tempStr = params.data.name.substring(start, end) + '\n'
}
newName += tempStr
}
} else {
newName = params.data.name
}
let n = newName
if (n.length > 16) {
n = n.slice(0, 16) + '...'
}
let str = `{name|${n}}`
let isMain = params.data.relationType === 0
str = isMain ? `{name|${n}} {current|本企业} {main|总部}` : str
return str
tooltip: {
trigger: "item",
triggerOn: "mousemove",
color: "#fff",
backgroundColor: "skyblue",
borderColor: "skyblue",
},
rich: {
name: {
fontSize: 14
animationDurationUpdate: 1500,
animationEasingUpdate: "quinticInOut",
series: [
{
type: "tree",
symbolSize: 75,
symbol: "roundRect",
edgeShape: "polyline",
edgeForkPosition: "50%",
edgeSymbol: ["circle", "arrow"],
edgeSymbolSize: [4, 10],
edgeLabel: {
normal: {
textStyle: {
fontSize: 18,
},
},
},
initialTreeDepth: 2,
orient: "vertical",
itemStyle: {
color: "#FFC125",
borderColor: "#FFC125",
},
roam: true, // 可移动,可缩放
expandAndCollapse: true,
animationDuration: 550,
animationDurationUpdate: 750,
//线条的颜色
lineStyle: {
normal: {
opacity: 0.9,
color: "#93beff",
// type: "dashed",
width: 2,
},
},
label: {
show: true,
position: "inside",
textStyle: {
fontSize: 15,
color: "#fff",
},
},
leaves: {
label: {
position: "inside",
color: "#fff",
},
itemStyle: {
color: "#dfdfdf",
borderColor: "#dfdfdf",
},
},
data: [
{
name: "根节点",
url: "",
// 根节点样式设置
itemStyle: {
color: "#18a849",
borderColor: "#18a849",
},
children: [
{
name: "子节点1",
children: [
{
name: "叶子节点1",
itemStyle: {
color: "#5470C6",
borderColor: "#5470C6",
},
},
{
name: "叶子节点2",
itemStyle: {
color: "#5470C6",
borderColor: "#5470C6",
},
},
{
name: "叶子节点3",
itemStyle: {
color: "#5470C6",
borderColor: "#5470C6",
},
},
],
},
{
name: "子节点2",
children: [
{
name: "叶子节点4",
itemStyle: {
color: "#5470C6",
borderColor: "#5470C6",
},
},
{
name: "叶子节点5",
itemStyle: {
color: "#5470C6",
borderColor: "#5470C6",
},
},
{
name: "叶子节点6",
itemStyle: {
color: "#5470C6",
borderColor: "#5470C6",
},
},
],
},
],
},
],
},
current: {
fontSize: 12,
padding: 0,
color: '#07CA42',
fontWeight: 600,
backgroundColor: '#E5F7EA',
borderRadius: 2
},
main: {
color: '#0780ED',
fontSize: 12,
padding: 0,
fontWeight: 600,
backgroundColor: '#E6F2FD',
borderRadius: 2
}
}
},
leaves: { //叶子节点文本样式
label: {
//backgroundColor: '#81c5f7',
backgroundColor: '#fff',
color:'#333',
position: 'bottom',
rotate: 0,//标签旋转。
verticalAlign: 'middle',
align: 'center',
//文本框内文字超过6个字折行
/* formatter: function(val) {
let strs = val.name.split(''); //字符串数组
let str = ''
for(let i = 0, s; s = strs[i++];) { //遍历字符串数组
str += s;
if(!(i % 6)) str += '\n'; //按需要求余,目前是一个字换一行
}
return str
}, */
//或者
overflow:'break',//break为文字折行 truncate为文字超出部分省略号显示
lineOverflow:'truncate',//文字超出高度后 直接截取
}
},
expandAndCollapse: true, //默认展开树形结构
animationDuration: 550,
animationDurationUpdate: 750
}]
};
}
],
};
}