Commit 16889aab authored by 李纪文's avatar 李纪文

fix: 增加控制人员

parent a7251e01
...@@ -14,6 +14,8 @@ import { ...@@ -14,6 +14,8 @@ import {
LeftOutlined, LeftOutlined,
RightOutlined, RightOutlined,
DoubleRightOutlined, DoubleRightOutlined,
EyeOutlined,
EyeInvisibleOutlined,
} from '@ant-design/icons'; } from '@ant-design/icons';
import MqttView from '@wisdom-components/mqttview'; import MqttView from '@wisdom-components/mqttview';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
...@@ -32,6 +34,7 @@ import { ...@@ -32,6 +34,7 @@ import {
getPointAddress, getPointAddress,
getDeviceRealInfo, getDeviceRealInfo,
getVideoDetail, getVideoDetail,
getDictionaryInfo,
} from './apis'; } from './apis';
import { import {
isNumber, isNumber,
...@@ -67,6 +70,7 @@ const ConfigurationView = (props) => { ...@@ -67,6 +70,7 @@ const ConfigurationView = (props) => {
let myDiagram = null; let myDiagram = null;
let mqttView = null; let mqttView = null;
let editionArr = []; let editionArr = [];
let globalControl = false;
const guidAggre = {}; const guidAggre = {};
const bindData = []; const bindData = [];
const stationList = []; const stationList = [];
...@@ -85,6 +89,9 @@ const ConfigurationView = (props) => { ...@@ -85,6 +89,9 @@ const ConfigurationView = (props) => {
const [isVideoVisible, setIsVideoVisible] = useState(false); const [isVideoVisible, setIsVideoVisible] = useState(false);
const [videoData, setVideoData] = useState([]); const [videoData, setVideoData] = useState([]);
const [videoTitle, setVideoTitle] = useState(''); const [videoTitle, setVideoTitle] = useState('');
const [viewType, setViewType] = useState(false);
const [currentUser, setCurrentUser] = useState(false);
twoID = `TDG${Date.now().toString(36)}`; twoID = `TDG${Date.now().toString(36)}`;
const navigatorAgent = /(iPhone|iOS|Android|Windows Phone)/i.test(navigator.userAgent); const navigatorAgent = /(iPhone|iOS|Android|Windows Phone)/i.test(navigator.userAgent);
const AdjustControlInput = useRef(); const AdjustControlInput = useRef();
...@@ -146,6 +153,7 @@ const ConfigurationView = (props) => { ...@@ -146,6 +153,7 @@ const ConfigurationView = (props) => {
}); });
devicesCode.push(deviceList); devicesCode.push(deviceList);
}); });
await getPublicInfo();
getDiagramJson(data[0], siteInfo); getDiagramJson(data[0], siteInfo);
} else { } else {
setDescription('咦~未查询到工艺图画板信息哦~'); setDescription('咦~未查询到工艺图画板信息哦~');
...@@ -159,7 +167,10 @@ const ConfigurationView = (props) => { ...@@ -159,7 +167,10 @@ const ConfigurationView = (props) => {
setSpinning(false); setSpinning(false);
return message.error(drawInfo.msg); return message.error(drawInfo.msg);
} }
};
/** *********************************获取基本信息****************************** */
const getPublicInfo = async () => {
// 获取点表信息 // 获取点表信息
const pointInfo = devicesCode.length const pointInfo = devicesCode.length
? await getPointAddress({ ? await getPointAddress({
...@@ -171,6 +182,16 @@ const ConfigurationView = (props) => { ...@@ -171,6 +182,16 @@ const ConfigurationView = (props) => {
}) })
: null; : null;
editionArr = deepCopy(pointInfo && pointInfo.data ? pointInfo.data : [], []); editionArr = deepCopy(pointInfo && pointInfo.data ? pointInfo.data : [], []);
// 获取数据字典组态控制权限
const dictInfoRes = await getDictionaryInfo({
level: '组态控制权限',
});
const dictInfo = dictInfoRes?.data || [];
const dictList = dictInfo.find((item) => {
return item.fieldName === '控制人员' && item.fieldValue === '当前用户';
});
globalControl = dictList ? true : false;
}; };
/** *********************************节点展示逻辑****************************** */ /** *********************************节点展示逻辑****************************** */
...@@ -1213,11 +1234,20 @@ const ConfigurationView = (props) => { ...@@ -1213,11 +1234,20 @@ const ConfigurationView = (props) => {
}; };
/** **************************************权限控制方法****************************************** */ /** **************************************权限控制方法****************************************** */
const authoMethod = (code, tag, node, guid, value) => { const authoMethod = async (code, tag, node, guid, value) => {
const { people = '' } = node;
const userName =
people === '当前用户' || globalControl ? globalConfig?.userInfo?.loginName || '' : '';
setCurrentUser(userName);
setIsAuModalVisible(true); setIsAuModalVisible(true);
auModalConfirmFn = () => defineAutho(code, tag, node, guid, value); auModalConfirmFn = () => defineAutho(code, tag, node, guid, value);
}; };
// 查看密码
const viewTypeChange = (e) => {
setViewType(!viewType);
};
/** **************************************开关控制确定****************************************** */ /** **************************************开关控制确定****************************************** */
const defineSwitch = (code, tag, node) => { const defineSwitch = (code, tag, node) => {
const guid = createGuid(); const guid = createGuid();
...@@ -3032,11 +3062,30 @@ const ConfigurationView = (props) => { ...@@ -3032,11 +3062,30 @@ const ConfigurationView = (props) => {
wrapClassName={classNames(`${prefixCls}-baseModal`)} wrapClassName={classNames(`${prefixCls}-baseModal`)}
> >
<Form className={classNames('authorizeControlContent')} ref={AuthorFrom} name="loginForm"> <Form className={classNames('authorizeControlContent')} ref={AuthorFrom} name="loginForm">
<Form.Item className={classNames('authorizeControlItem')} name="userName" label="账户"> <Form.Item
<Input placeholder="请输入用户名" /> className={classNames('authorizeControlItem')}
name="userName"
label="账户"
initialValue={currentUser}
>
<Input.TextArea
placeholder="请输入用户名"
autoComplete={'off'}
autoSize={{ minRows: 1, maxRows: 1 }}
disabled={!!currentUser}
/>
</Form.Item> </Form.Item>
<Form.Item className={classNames('authorizeControlItem')} name="password" label="密码"> <Form.Item className={classNames('authorizeControlItem')} name="password" label="密码">
<Input.Password placeholder="请输入密码" /> <Input
className={classNames(viewType ? '' : 'hidePassWord')}
placeholder="请输入密码"
autoComplete={'off'}
addonAfter={
<div className={classNames('viewPassWord')} onClick={viewTypeChange}>
{viewType ? <EyeOutlined /> : <EyeInvisibleOutlined />}
</div>
}
/>
</Form.Item> </Form.Item>
</Form> </Form>
</Modal> </Modal>
......
...@@ -76,3 +76,12 @@ export function getStatisticsInfo(data) { ...@@ -76,3 +76,12 @@ export function getStatisticsInfo(data) {
data, data,
}); });
} }
// 获取数据字典
export function getDictionaryInfo(params) {
return request({
url: `${baseURI}/PandaCore/GCK/Common/GetDictionaryInfoAll`,
method: REQUEST_METHOD_GET,
params,
});
}
...@@ -115,12 +115,30 @@ ...@@ -115,12 +115,30 @@
.authorizeControlContent { .authorizeControlContent {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: 100%;
.authorizeControlItem { .authorizeControlItem {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 20px; margin-bottom: 20px;
.hidePassWord {
input {
text-security: disc;
-webkit-text-security: disc;
-moz-text-security: disc;
}
}
.viewPassWord {
color: #ffffff;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
.@{ant-prefix}-row { .@{ant-prefix}-row {
width: 100%; width: 100%;
} }
...@@ -229,7 +247,11 @@ ...@@ -229,7 +247,11 @@
&-historyInfoModal { &-historyInfoModal {
.@{ant-prefix}-modal-body { .@{ant-prefix}-modal-body {
height: 680px; height: 650px;
>div {
padding: 0;
}
} }
} }
......
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