巴林闲侠
2 years ago
9 changed files with 192 additions and 4 deletions
@ -0,0 +1,2 @@ |
|||
DELETE FROM public.resource WHERE code = 'XIUGAIJIUHA'; |
|||
DELETE FROM public.user_resource WHERE resource = 'XIUGAIJIUHA'; |
@ -0,0 +1,34 @@ |
|||
/* |
|||
Navicat Premium Data Transfer |
|||
|
|||
Source Server : 10.8.30.156 |
|||
Source Server Type : PostgreSQL |
|||
Source Server Version : 100019 |
|||
Source Host : 10.8.30.156:5432 |
|||
Source Catalog : inspection |
|||
Source Schema : public |
|||
|
|||
Target Server Type : PostgreSQL |
|||
Target Server Version : 100019 |
|||
File Encoding : 65001 |
|||
|
|||
Date: 03/03/2023 09:20:08 |
|||
*/ |
|||
|
|||
|
|||
-- ---------------------------- |
|||
-- Table structure for report_serial |
|||
-- ---------------------------- |
|||
DROP TABLE IF EXISTS "public"."report_serial"; |
|||
CREATE TABLE "public"."report_serial" ( |
|||
"project_id" int4 NOT NULL, |
|||
"serial_no" int4 |
|||
) |
|||
; |
|||
COMMENT ON COLUMN "public"."report_serial"."project_id" IS '结构物id'; |
|||
COMMENT ON COLUMN "public"."report_serial"."serial_no" IS '报告序号'; |
|||
|
|||
-- ---------------------------- |
|||
-- Primary Key structure for table report_serial |
|||
-- ---------------------------- |
|||
ALTER TABLE "public"."report_serial" ADD CONSTRAINT "report_serial_pkey" PRIMARY KEY ("project_id"); |
@ -0,0 +1,39 @@ |
|||
/* |
|||
Navicat Premium Data Transfer |
|||
|
|||
Source Server : 10.8.30.156 |
|||
Source Server Type : PostgreSQL |
|||
Source Server Version : 100019 |
|||
Source Host : 10.8.30.156:5432 |
|||
Source Catalog : inspection |
|||
Source Schema : public |
|||
|
|||
Target Server Type : PostgreSQL |
|||
Target Server Version : 100019 |
|||
File Encoding : 65001 |
|||
|
|||
Date: 03/03/2023 09:20:24 |
|||
*/ |
|||
|
|||
|
|||
-- ---------------------------- |
|||
-- Table structure for report_info |
|||
-- ---------------------------- |
|||
DROP TABLE IF EXISTS "public"."report_info"; |
|||
CREATE TABLE "public"."report_info" ( |
|||
"id" int4 NOT NULL DEFAULT nextval('report_info_id_seq'::regclass), |
|||
"project_id" int4 NOT NULL, |
|||
"excel_path" varchar(255) COLLATE "pg_catalog"."default" NOT NULL, |
|||
"inspect_tm" timestamp(0) NOT NULL, |
|||
"report_tm" timestamp(0) NOT NULL |
|||
) |
|||
; |
|||
COMMENT ON COLUMN "public"."report_info"."project_id" IS '结构物id'; |
|||
COMMENT ON COLUMN "public"."report_info"."excel_path" IS '文件路径'; |
|||
COMMENT ON COLUMN "public"."report_info"."inspect_tm" IS '巡检时间'; |
|||
COMMENT ON COLUMN "public"."report_info"."report_tm" IS '文件生成时间'; |
|||
|
|||
-- ---------------------------- |
|||
-- Primary Key structure for table report_info |
|||
-- ---------------------------- |
|||
ALTER TABLE "public"."report_info" ADD CONSTRAINT "report_info_pkey" PRIMARY KEY ("id"); |
@ -0,0 +1,15 @@ |
|||
'use strict'; |
|||
|
|||
import { basicAction } from '@peace/utils' |
|||
import { ApiTable } from '$utils' |
|||
|
|||
// export function getPatrolReport (query) {
|
|||
// return dispatch => basicAction({
|
|||
// type: 'get',
|
|||
// query,
|
|||
// dispatch: dispatch,
|
|||
// actionType: 'GET_PATROL_REPORT',
|
|||
// url: ApiTable.getPatrolReport,
|
|||
// msg: { error: '获取巡检报告失败' },
|
|||
// });
|
|||
// }
|
@ -0,0 +1,88 @@ |
|||
import React, { useState, useRef } from 'react'; |
|||
import { connect } from 'react-redux'; |
|||
import { Button } from 'antd'; |
|||
import ProTable from '@ant-design/pro-table'; |
|||
import { getCheckItems } from '../actions/checkItems'; |
|||
|
|||
function patrolReport(props) { |
|||
const { dispatch } = props; |
|||
const tableRef = useRef(); |
|||
const [dataSource, setDataSource] = useState([{}]); |
|||
|
|||
const columns = [{ |
|||
title: '结构物名称', |
|||
dataIndex: 'name', |
|||
key: 'name', |
|||
ellipsis: true, |
|||
width: 150, |
|||
}, { |
|||
title: '巡检报告名称', |
|||
dataIndex: 'groupName', |
|||
key: 'groupName', |
|||
ellipsis: true, |
|||
search: false, |
|||
width: 250, |
|||
render: (_, record) => { |
|||
return <div>{record?.checkItemsGroup?.name}</div> |
|||
} |
|||
}, { |
|||
title: '巡检日期', |
|||
dataIndex: 'date', |
|||
key: 'date', |
|||
valueType: 'dateRange', |
|||
ellipsis: true, |
|||
width: 150, |
|||
render: (_, record) => { |
|||
return <div>{record?.checkItemsGroup?.name}</div> |
|||
} |
|||
}, { |
|||
title: '操作', |
|||
dataIndex: 'action', |
|||
key: 'action', |
|||
search: false, |
|||
width: 200, |
|||
render: (_, record) => { |
|||
return <> |
|||
<Button type="link" onClick={() => { |
|||
const qnDomain = localStorage.getItem('qnDomain'); |
|||
window.open(`https://view.officeapps.live.com/op/view.aspx?src=${qnDomain}${'/project/8fe38891-59c5-4735-b3d9-d8d335fc28ee/test.docx'}`) |
|||
}}>预览</Button> |
|||
<Button type="link" onClick={() => { /* 下载 */ }}>下载</Button> |
|||
</> |
|||
}, |
|||
}]; |
|||
|
|||
return ( |
|||
<> |
|||
<ProTable |
|||
columns={columns} |
|||
actionRef={tableRef} |
|||
options={false} |
|||
dataSource={dataSource || []} |
|||
rowKey='id' |
|||
pagination={{ pageSize: 10 }} |
|||
request={async (params = {}) => { |
|||
// const res = await dispatch(getCheckItems({
|
|||
// limit: params.pageSize,
|
|||
// page: params.current - 1,
|
|||
// name: params?.name
|
|||
// }));
|
|||
// setDataSource(res?.payload.data?.rows);
|
|||
// return {
|
|||
// ...res,
|
|||
// total: res.payload.data.count ? res.payload.data.count : 0,
|
|||
// };
|
|||
}} |
|||
onReset={() => { }} |
|||
/> |
|||
</> |
|||
) |
|||
} |
|||
|
|||
function mapStateToProps(state) { |
|||
const { auth } = state |
|||
return { |
|||
user: auth.user |
|||
} |
|||
} |
|||
export default connect(mapStateToProps)(patrolReport); |
Loading…
Reference in new issue