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

fix: 增加控制人员

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