Commit 066df678 authored by 田翔's avatar 田翔

fix: 代码优化

parent d7083678
Pipeline #88665 passed with stages
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
@imgSrc: '@/assets/images/bsmanager/patrolMaintenance/maintenance';
.QRCodeModal {
.ant-modal-header {
padding: 0
}
.ant-modal-content {
border-radius: 25px;
overflow: hidden;
}
.ant-modal-close-x {
width: 50px;
height: 50px;
}
.QRCodeTitle {
width: 100%;
height: 57px;
line-height: 57px;
color: white;
font-weight: bold;
background: url('@{imgSrc}/标题.png');
background-size: 100% 100%;
padding-left: 15px;
}
.QRCodeList {
width: 100%;
height: 100%;
.table {
.ant-table-thead {
.ant-table-cell {
background: linear-gradient(to bottom, #FEFEFF, #D5E9FF);
}
th {
border-bottom: 2px solid #DBE7FB;
text-align: center;
white-space: nowrap;
text-overflow: ellipsis;
}
}
.ant-pro-table-list-toolbar-container {
padding: 10px 0;
}
.ant-table-body {
tr {
td {
border-bottom: 1px solid #DBE7FB;
border-right: 1px solid #DBE7FB;
}
}
.ant-table-row {
padding: 4px;
}
tr:nth-child(even) {
background: #F3F9FF;
.panda-civ-workflow-table-cell-fix-right {
background-color: #F3F9FF;
}
}
&::-webkit-scrollbar {
width: 0;
height: 6px;
}
}
}
}
.QRCodeDesign {
width: 100%;
height: 100%;
display: flex;
.left {
flex: 1;
width: 100%;
height: 100%;
border-radius: 5px;
border: 1px solid #BCDEFF;
overflow: hidden;
.header {
width: 100%;
height: 42px;
display: flex;
align-items: center;
background: linear-gradient(to right, #EEF6FF, #FBFDFF);
padding: 0 10px 0 10px;
border-bottom: 1px solid #BCDEFF;
.h-icon {
width: 4px;
height: 15px;
border-radius: 3px;
background: #1685FF;
}
.h-text {
font-weight: bold;
margin-left: 5px;
}
.h-background {
width: 50%;
height: 100%;
background: url('@{imgSrc}/编辑字段背景.png');
background-size: 100% 100%;
}
.h-bgArrow {
width: 53px;
height: 18px;
background: url('@{imgSrc}/右键图标.png');
background-size: 100% 100%;
}
}
.content {
width: 100%;
height: calc(100% - 42px);
background: white;
.gName {
padding: 10px;
font-weight: 700;
border-bottom: 1px solid #EEEEEE;
}
.tag {
padding: 2px 10px;
border-radius: 1px;
&[type='设备名称'] {
background: rgb(205 235 221);
color: rgb(42 91 68);
}
&[type='设备编号'] {
color: rgb(224, 95, 66);
background: rgb(224 201 196);
}
}
.uploadIcon {
width: 30px;
height: 32px;
margin: 0 auto;
background: url('@{imgSrc}/上传文件.png');
background-size: 100% 100%;
}
.uploadBtn {
width: 75px;
height: 28px;
line-height: 28px;
border-radius: 3px;
border: 1px solid #E4ECF4;
text-align: center;
margin: 0 auto;
}
}
}
.right {
width: 500px;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
.box {
width: 62%;
height: 78%;
}
}
}
.QRCode {
width: 100%;
height: 100%;
background: url('@{imgSrc}/二维码背景.png');
background-size: 100% 100%;
position: relative;
.company {
color: white;
padding: 3%;
text-align: center;
font-size: 20px;
}
.title {
text-align: center;
font-size: 26px;
color: white;
font-weight: 700;
font-style: italic;
}
.QR {
position: absolute;
top: 36.1%;
left: 24.6%;
width: 51.1%;
height: 32%;
border-radius: 5%;
overflow: hidden;
.QRLogo {
z-index: 99;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 30%;
height: 30%;
.systemLogo{
width: 100%;
height: 100%;
background: url('@{imgSrc}/熊猫-蓝色.png');
background-size: 100% 100%;
}
}
}
.pandaLogo {
position: absolute;
left: 50%;
transform: translateX(-50%);
bottom: 22%;
width: 47%;
height: 5%;
background: url('@{imgSrc}/熊猫logo.png');
background-size: 100% 100%;
}
.info {
position: absolute;
left: 50%;
bottom: 6%;
transform: translateX(-50%);
width: 84%;
height: 10%;
.tag {
margin-left: 29%;
padding: 2px 10px;
border-radius: 1px;
&[type='设备名称'] {
background: rgb(205 235 221);
color: rgb(42 91 68);
}
&[type='设备编号'] {
color: rgb(224, 95, 66);
background: rgb(224 201 196);
}
}
.DeviceName {
text-align: center;
font-size: 15px;
font-weight: bold;
}
.DeviceCode {
text-align: center;
font-size: 15px;
font-weight: bold;
}
}
}
}
\ No newline at end of file
/* eslint-disable no-else-return */ /* eslint-disable no-else-return */
/* eslint-disable react-hooks/rules-of-hooks */ /* eslint-disable react-hooks/rules-of-hooks */
/* eslint-disable camelcase */ /* eslint-disable camelcase */
import React, { useState, createContext, useEffect, useMemo, useReducer } from 'react'; import React, { useState, createContext, useEffect, useMemo, useReducer, useRef } from 'react';
import { Space, Table, Popconfirm, Tooltip, Button, notification, Tag, message } from 'antd'; import { Space, Table, Popconfirm, Tooltip, Button, notification, Tag, message } from 'antd';
import { import {
CM_XWBPlan_DataList, CM_XWBPlan_DataList,
...@@ -28,6 +28,7 @@ import OptionEditModal from './OptionEditModal'; ...@@ -28,6 +28,7 @@ import OptionEditModal from './OptionEditModal';
import SortModal from './SortModal'; import SortModal from './SortModal';
import DragTable from '@/components/DragTable/DragTable'; import DragTable from '@/components/DragTable/DragTable';
import { defaultState, reducer } from './store/reducer'; // 状态管理 import { defaultState, reducer } from './store/reducer'; // 状态管理
import QRCodeDesign from './components/QRCodeDesign';
export const Context = createContext(); export const Context = createContext();
const maintenance = () => { const maintenance = () => {
...@@ -43,7 +44,8 @@ const maintenance = () => { ...@@ -43,7 +44,8 @@ const maintenance = () => {
const [tableData, setTableData] = useState([]); const [tableData, setTableData] = useState([]);
const [keepTableData, setKeepTableData] = useState([]); const [keepTableData, setKeepTableData] = useState([]);
const [activeName, setActiveName] = useState('project'); const [activeName, setActiveName] = useState('project');
const [selectColor, setSelectColor] = useState({}); // const [selectColor, setSelectColor] = useState({});
const QRCodeDesignRef = useRef(null)
const setRowClassName = nodeID => { const setRowClassName = nodeID => {
return nodeID == selectColor ? styles.clickRowStyle : ''; return nodeID == selectColor ? styles.clickRowStyle : '';
...@@ -623,20 +625,6 @@ const maintenance = () => { ...@@ -623,20 +625,6 @@ const maintenance = () => {
</Tooltip> </Tooltip>
), ),
}, },
// {
// title: '卡片字段',
// dataIndex: 'CarField',
// key: 'CarField',
// width: 100,
// align: 'center',
// render: record => {
// if (record) {
// return <Tag color="success">已配置</Tag>;
// } else {
// return <Tag color="processing">未配置</Tag>;
// }
// },
// },
{ {
title: '详情字段', title: '详情字段',
dataIndex: 'DetailsField', dataIndex: 'DetailsField',
...@@ -722,7 +710,7 @@ const maintenance = () => { ...@@ -722,7 +710,7 @@ const maintenance = () => {
}), }),
align: 'center', align: 'center',
render: record => ( render: record => (
<div>{ record?'是': '否' }</div> <div>{record ? '是' : '否'}</div>
), ),
}, },
{ {
...@@ -734,14 +722,19 @@ const maintenance = () => { ...@@ -734,14 +722,19 @@ const maintenance = () => {
render: (text, record) => ( render: (text, record) => (
<Space> <Space>
<Tooltip title="修改"> <Tooltip title="修改">
<EditTwoTone onClick={() => editOption(record)} style={{ fontSize: '16px' }} /> <Button type='link' onClick={() => editOption(record)}>修改</Button>
{/* <EditTwoTone onClick={() => editOption(record)} style={{ fontSize: '16px' }} /> */}
</Tooltip>
<Tooltip title="二维码设计">
<Button type='link' onClick={() => editQrCode(record)}>二维码设计</Button>
{/* <EditTwoTone onClick={() => editQrCode(record)} style={{ fontSize: '16px' }} /> */}
</Tooltip> </Tooltip>
</Space> </Space>
), ),
}, },
]; ];
} }
}, [activeName]); }, [activeName, tableData]);
const add = () => { const add = () => {
if (activeName === 'project') { if (activeName === 'project') {
...@@ -761,6 +754,9 @@ const maintenance = () => { ...@@ -761,6 +754,9 @@ const maintenance = () => {
setType('edit'); setType('edit');
setFormObj(record); setFormObj(record);
}; };
const editQrCode = (record) => {
QRCodeDesignRef.current.open(record)
}
const editOption = record => { const editOption = record => {
let obj = record; let obj = record;
obj.CarField = obj.CarField obj.CarField = obj.CarField
...@@ -951,7 +947,6 @@ const maintenance = () => { ...@@ -951,7 +947,6 @@ const maintenance = () => {
/> />
) : ( ) : (
<Table <Table
// rowClassName={setRowClassName}
size="small" size="small"
rowKey="ID" rowKey="ID"
bordered bordered
...@@ -1013,6 +1008,7 @@ const maintenance = () => { ...@@ -1013,6 +1008,7 @@ const maintenance = () => {
callBackSubmit={onOK} callBackSubmit={onOK}
/> />
</div> </div>
<QRCodeDesign ref={QRCodeDesignRef} />
</div> </div>
</Context.Provider> </Context.Provider>
); );
......
...@@ -26,8 +26,7 @@ export const reloadFlowNodes = param => ...@@ -26,8 +26,7 @@ export const reloadFlowNodes = param =>
// 清除节点配置 // 清除节点配置
export const removeFlowNodeExtend = param => export const removeFlowNodeExtend = param =>
get( get(
`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Event_RemoveFlowNodeExtend?flowNodeExtendID=${ `${PUBLISH_SERVICE}/WorkOrderCenter/CM_Event_RemoveFlowNodeExtend?flowNodeExtendID=${param.flowNodeExtendID
param.flowNodeExtendID
}`, }`,
); );
// 流程节点详情 // 流程节点详情
...@@ -68,8 +67,7 @@ export const operateFlowNodeExtendPage = (query, flowNodeId) => ...@@ -68,8 +67,7 @@ export const operateFlowNodeExtendPage = (query, flowNodeId) =>
// 删除流程节点辅助视图配置 // 删除流程节点辅助视图配置
export const removeFlowNodeExtendPage = query => export const removeFlowNodeExtendPage = query =>
post( post(
`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Flow_RemoveFlowNodeExtendPage?flowNodeExtendId=${ `${PUBLISH_SERVICE}/WorkOrderCenter/CM_Flow_RemoveFlowNodeExtendPage?flowNodeExtendId=${query.flowNodeExtendId
query.flowNodeExtendId
}`, }`,
query, query,
); );
...@@ -108,3 +106,9 @@ export const GetLayerFields = query => get(`${PANDA_GIS}/MetaData/GetLayerFields ...@@ -108,3 +106,9 @@ export const GetLayerFields = query => get(`${PANDA_GIS}/MetaData/GetLayerFields
// 获取字段对应的默认值 // 获取字段对应的默认值
export const GetFieldValueFromTable = query => get(`/PandaWorkFlow/WorkFlow/AccountManage/GetFieldValueFromTable`, query); export const GetFieldValueFromTable = query => get(`/PandaWorkFlow/WorkFlow/AccountManage/GetFieldValueFromTable`, query);
//获取维保二维码配置
export const GetDeviceQRCodeConfig = (param) => get(`${PUBLISH_SERVICE}/WorkOrderCenter/GetDeviceQRCodeConfig?accountName=${param.accountName}&accountTableName=${param.accountTableName}`);
//新增或修改维保二维码配置
export const EditOrAddDeviceQRCodeConfig = query => post(`${PUBLISH_SERVICE}/WorkOrderCenter/EditOrAddDeviceQRCodeConfig`, query);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment