Commit 7acd3208 authored by 李纪文's avatar 李纪文

fix: 组态修改

parent b82d8435
......@@ -19,7 +19,9 @@ group:
api 参考 Antd DatePicker 组件 https://ant.design/components/date-picker-cn/#API
## 时间选择器 - 日期
## 代码演示
### 时间选择器 - 日期
<code src="./demos/base.tsx">
......@@ -31,7 +33,9 @@ api 参考 Antd DatePicker 组件 https://ant.design/components/date-picker-cn/#
| --- | --- | --- | --- |
| onChange | 改变选择的时间,重写 antd 方法,返回起始时间对象 | function(date, dateString){ } | -- |
## 时间选择器 - 范围
## 代码演示
### 时间选择器 - 范围
<code src="./demos/base2.tsx">
......
......@@ -39,6 +39,8 @@ api 参考 Antd Select 组件 https://ant.design/components/select-cn#api
| ---------- | ------------------------ | --------- | ------ |
| prefixIcon | 自定义的选择框前缀缀图标 | ReactNode | -- |
## 代码演示
### 下拉选择器 - 树单选
<code src="./demos/Basic5.tsx">
......
......@@ -5,7 +5,7 @@ import moment from 'moment';
import sha1 from 'sha1';
import Empty from '@wisdom-components/empty';
import LoadBox from '@wisdom-components/loadbox';
import { Input, message, Modal, Form, ConfigProvider, Button, Spin } from 'antd';
import { Input, message, Modal, Form, ConfigProvider, Button } from 'antd';
import {
ExclamationCircleOutlined,
DoubleLeftOutlined,
......@@ -49,16 +49,11 @@ let modalComponent = null; // 点击节点展示的模态框内容
let modalConfirmFn = null; // 点击节点展示的模态框的确定事件
let auModalConfirmFn = null; // 登录模态框的确定事件
let jumpModalProps = null;
// let nodeData = null; // 选中节点的数据
// const guidAggre = {};
// const bindData = [];
// const stationList = [];
// let mqttView = null;
let modalProps = {};
let modalWidth = 520;
let historyInfoParams = {};
let nodeData = null; // 选中节点的数据
// let editionArr = [];
let twoID = ``;
const waterFlow = new WaterFlowControlView();
......@@ -92,7 +87,6 @@ const StationList = [
];
const ConfigurationView = (props) => {
let twoID = `TDG${Date.now().toString(36)}`;
let myDiagram = null;
let mqttView = null;
let editionArr = [];
......@@ -101,12 +95,14 @@ const ConfigurationView = (props) => {
const stationList = [];
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
const prefixCls = getPrefixCls('ec-configuration-view');
const componentPrefix = getPrefixCls('');
const [isModalVisible, setIsModalVisible] = useState(false);
const [isAuModalVisible, setIsAuModalVisible] = useState(false); // 登录模态框
const [isHIModalVisible, setIsHIModalVisible] = useState(false); // 历史曲线模态框
const [isJumpModalVisible, setIsJumpModalVisible] = useState(false); // 画板跳转模态框
const [spinning, setSpinning] = useState(true); // 画板loading
const [isEmpty, setIsEmpty] = useState(false); // 画板无数据状态
const [description, setDescription] = useState(''); // 画板无数据描述
twoID = `TDG${Date.now().toString(36)}`;
const AdjustControlInput = useRef();
......@@ -150,11 +146,13 @@ const ConfigurationView = (props) => {
}
getDiagramJson(data[0], siteInfo);
} else {
setDescription('咦~未查询到工艺图画板信息哦~');
setIsEmpty(true);
setSpinning(false);
return message.info('咦~未查询到工艺图画板信息哦~');
return false;
}
} else {
setDescription('咦~工艺图画板信息报错啦~');
setIsEmpty(true);
setSpinning(false);
return message.error(drawInfo.msg);
......@@ -617,6 +615,12 @@ const ConfigurationView = (props) => {
};
useEffect(() => {
if (!props.name || !props.devices || !props.devices.length) {
setDescription('咦~工艺图配置信息不全哦~');
setIsEmpty(true);
setSpinning(false);
return false;
}
const url = globalConfig.mainserver ? globalConfig.mainserver : 'https://panda-water.cn/';
onlineMethod(`${url}civweb4/assets/images/bootPage/熊猫图标.png`, url);
return () => {
......@@ -2091,7 +2095,7 @@ const ConfigurationView = (props) => {
<div className={classNames(prefixCls)}>
<div id={twoID} className={classNames('configurationView')}>
<LoadBox spinning={spinning} />
{isEmpty && <Empty theme={'dark'} description={'咦~未查询到工艺图画板信息哦~'} />}
{isEmpty && <Empty theme={'dark'} description={description} />}
</div>
{/* 远程控制 */}
{isModalVisible && (
......@@ -2163,6 +2167,7 @@ const ConfigurationView = (props) => {
limit={true}
onCancel={() => setIsJumpModalVisible(false)}
wrapClassName={classNames(`${prefixCls}-jumpModal`)}
componentPrefix={componentPrefix}
style={{
height: jumpModalProps.height ? `${Number(jumpModalProps.height) + 103}px` : '100%',
left: `calc(50% - ${jumpModalProps.width ? jumpModalProps.width / 2 + 'px' : '50%'})`,
......
/* eslint-disable */
import React from 'react';
import { Modal } from 'antd';
import React, { useContext } from 'react';
import { Modal, ConfigProvider } from 'antd';
class DragModal extends React.Component {
constructor() {
......@@ -50,7 +50,7 @@ class DragModal extends React.Component {
// eslint-disable-next-line consistent-return
create = (visible) => {
if (this.init) return false;
const { title, dragable = true, autoIndex = true, style = {} } = this.props;
const { title, dragable = true, autoIndex = true, style = {}, componentPrefix } = this.props;
if (title && dragable && visible) {
this.init = true;
setTimeout(() => {
......@@ -58,7 +58,7 @@ class DragModal extends React.Component {
this.contain = document.getElementsByClassName(this.simpleClass)[0];
if (!autoIndex) {
// eslint-disable-next-line prefer-destructuring
this.contain = this.contain.getElementsByClassName('ant-modal')[0];
this.contain = this.contain.getElementsByClassName(`${componentPrefix}-modal`)[0];
this.contain.style.paddingBottom = 0;
this.contain.style.display = 'inline-block';
} else {
......@@ -71,7 +71,7 @@ class DragModal extends React.Component {
this.toTop();
}
// eslint-disable-next-line prefer-destructuring
this.header = this.contain.getElementsByClassName('ant-modal-header')[0];
this.header = this.contain.getElementsByClassName(`${componentPrefix}-modal-header`)[0];
this.header.style.cursor = 'all-scroll';
this.header.onmousedown = () => {
document.body.onselectstart = () => false;
......
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