Commit 9270de0d authored by 皮倩雯's avatar 皮倩雯

fix: '修改全局radio是否为Switch'

parent 2fe5eb41
Pipeline #63203 passed with stages
......@@ -219,10 +219,8 @@ const AddModal = props => {
const onSubmit = () => {
// 不切换树
if (valueData.length == 0) {
console.log(pramData);
formAdd.validateFields().then(validate1 => {
if (validate1) {
console.log(1123123);
form.validateFields().then(validate => {
if (validate) {
setLoading(true);
......
......@@ -101,6 +101,7 @@ const IotConfig = () => {
GetDataBaseConfig().then(res => {
if (res.code === 0) {
GetDbProduct({ ...res.data }).then(ress => {
console.log(res.data);
console.log(ress.data.Project);
if (ress.data.Project.length > 0) {
console.log(ress.data.Project[ress.data.Project.length - 1].projectName);
......@@ -345,10 +346,12 @@ const IotConfig = () => {
const OperateNginx = checked => {
if (checked) {
setSwitchStatus(true);
setLoading(true);
DepositServiceEnable({
host: currentDataBase.ip,
dataBaseName: currentDataBase.dbName,
}).then(res => {
setLoading(false);
getStatus(currentDataBase.ip, currentDataBase.dbName);
if (res.success) {
// setCurrentConfig(checked);
......@@ -358,10 +361,12 @@ const IotConfig = () => {
}
});
} else {
setLoading(true);
DepositServiceDisable({
host: currentDataBase.ip,
dataBaseName: currentDataBase.dbName,
}).then(res => {
setLoading(false);
if (res.success) {
setDbStatus('已禁用');
setBuStatus('启动');
......
......@@ -20,6 +20,7 @@ import {
Select,
AutoComplete,
Cascader,
Switch,
} from 'antd';
import {
AddIntegratedLogin,
......@@ -64,7 +65,7 @@ const AddModal = props => {
if (visible) {
getMap();
if (type === 'edit') {
setRadio(pickItem.target);
setRadio(pickItem.target != 0);
setRadio1(pickItem.isMaster);
console.log(pickItem);
form.setFieldsValue({
......@@ -76,14 +77,11 @@ const AddModal = props => {
systemName: pickItem.SystemName,
iconUrl: pickItem.iconUrl,
subtitle: pickItem.Subtitle,
target: pickItem.target,
target: pickItem.target != 0,
isMaster: pickItem.isMaster,
images: pickItem.images,
siteDescription: pickItem.siteDescription,
});
setRadio1(pickItem.isMaster);
console.log(pickItem);
console.log(pickItem.images);
if (pickItem.images && pickItem.images.length > 0) {
let arr = [];
pickItem.images.map((i, j) => {
......@@ -279,7 +277,7 @@ const AddModal = props => {
iconUrl: obj.iconUrl,
accountType: 'Panda',
isHide: false,
target: obj.target,
target: radio ? 1 : 0,
isMaster: obj.isMaster,
images: dataList,
mapSetting: obj.mapSetting,
......@@ -317,7 +315,7 @@ const AddModal = props => {
accountParam: bb,
iconUrl: obj.iconUrl,
accountType: 'Panda',
target: obj.target,
target: radio ? 1 : 0,
isMaster: obj.isMaster,
images: dataList,
clients: pickItem.clients,
......@@ -367,11 +365,11 @@ const AddModal = props => {
};
const onChange = e => {
setRadio(e.target.value);
setRadio(e);
};
const onChange1 = e => {
setRadio1(e.target.value);
setRadio1(e);
};
const beforeUpload = file => {
......@@ -643,10 +641,11 @@ const AddModal = props => {
</Col>
</Row>
<Item label="新标签" name="target">
<Radio.Group onChange={onChange} value={radio}>
<Switch checkedChildren="是" unCheckedChildren="否" checked={radio} onChange={onChange} />
{/* <Radio.Group onChange={onChange} value={radio}>
<Radio value={0}>否</Radio>
<Radio value={1}>是</Radio>
</Radio.Group>
</Radio.Group> */}
</Item>
<Row>
<Col span={10}>
......@@ -741,10 +740,16 @@ const AddModal = props => {
<Input disabled />
</Item>
<Item label="特殊站点" name="isMaster">
<Radio.Group onChange={onChange1} value={radio1}>
<Switch
checkedChildren="是"
unCheckedChildren="否"
onChange={onChange1}
checked={radio1}
/>
{/* <Radio.Group onChange={onChange1} value={radio1}>
<Radio value={false}>否</Radio>
<Radio value={true}>是</Radio>
</Radio.Group>
</Radio.Group> */}
</Item>
<Item label="详情图片" name="images" style={{ height: '112px' }}>
<Upload
......
/* eslint-disable no-unused-expressions */
import React, { useState, useEffect } from 'react';
import { Form, Input, notification, Select, Radio, Tooltip } from 'antd';
import { Form, Input, notification, Select, Radio, Tooltip, Switch } from 'antd';
import SiteModal from '@/components/Modal/SiteModa';
import { addRole, GetRoleGroup, getWebConfigTypes } from '@/services/RoleManage/api';
import { InfoCircleOutlined } from '@ant-design/icons';
......@@ -11,9 +11,12 @@ const AddModal = props => {
const [formLayout, setFormLayout] = useState('horizontal');
const [groupList, setGroupList] = useState([]);
const [loading, setLoading] = useState(false);
const { confirmModal, itemObj, siteList } = props;
const { confirmModal, itemObj, siteList, visible } = props;
const [typeList, setTypeList] = useState([]); // 应用类别
const [value, setValue] = useState(2);
const [value, setValue] = useState(false);
useEffect(() => {
setValue(false);
}, [visible]);
useEffect(() => {
itemObj.groupflag &&
form.setFieldsValue({
......@@ -66,19 +69,15 @@ const AddModal = props => {
.then(res => {
console.log(form.getFieldsValue());
setLoading(true);
console.log(res.BuiltInRole);
if (!res.BuiltInRole || res.BuiltInRole == 2) {
res.BuiltInRole = false;
} else if (res.BuiltInRole == 1) {
res.BuiltInRole = true;
}
console.log(res.BuiltInRole);
console.log(value);
addRole({
roleName: res.roleName,
description: res.description,
group: res.group,
subSystemValue: res.subSystemValue || '',
BuiltInRole: res.BuiltInRole,
BuiltInRole: value,
})
.then(res => {
setLoading(false);
......@@ -170,8 +169,7 @@ const AddModal = props => {
};
const onChangeRadio = e => {
console.log(e.target.value);
setValue(e.target.value);
setValue(e);
};
const onFinish = value => {};
return (
......@@ -247,10 +245,16 @@ const AddModal = props => {
}
name="BuiltInRole"
>
<Radio.Group onChange={onChangeRadio} value={value} defaultValue={value}>
<Switch
checkedChildren="是"
unCheckedChildren="否"
checked={value}
onChange={onChangeRadio}
/>
{/* <Radio.Group onChange={onChangeRadio} value={value} defaultValue={value}>
<Radio value={2}>否</Radio>
<Radio value={1}>是</Radio>
</Radio.Group>
</Radio.Group> */}
</Item>
<Item label="角色分组" name="group">
<Select
......
import React, { useState, useEffect } from 'react';
import { Form, Input, notification, Select, Radio, Tooltip } from 'antd';
import { Form, Input, notification, Select, Radio, Tooltip, Switch } from 'antd';
import SiteModal from '@/components/Modal/SiteModa';
import { editRole, GetRoleGroup } from '@/services/RoleManage/api';
import { InfoCircleOutlined } from '@ant-design/icons';
......@@ -22,12 +22,9 @@ const AddModal = props => {
description: itemObj.description,
group: itemObj.group,
subSystemValue: itemObj.subSystemValue,
BuiltInRole: itemObj.BuiltInRole,
});
if (itemObj.BuiltInRole === true) {
setValue(1);
} else {
setValue(2);
}
setValue(itemObj.BuiltInRole);
}, [itemObj]);
const onSubmit = () => {
form
......@@ -36,18 +33,12 @@ const AddModal = props => {
console.log(res, 'res');
setLoading(true);
console.log(value);
if (value == 2) {
res.BuiltInRole = false;
} else {
res.BuiltInRole = true;
}
console.log(res.BuiltInRole);
editRole({
roleID: itemObj.roleID,
roleName: res.roleName,
description: res.description,
remark: res.group,
BuiltInRole: res.BuiltInRole,
BuiltInRole: value,
// subSystemValue: itemObj.subSystemValue || itemObj.visibleValue || '',
})
.then(res => {
......@@ -60,7 +51,7 @@ const AddModal = props => {
description: '编辑成功',
});
console.log(value);
if (value == 1) {
if (value) {
confirmModal(true);
} else {
confirmModal(false);
......@@ -120,8 +111,7 @@ const AddModal = props => {
};
const onChangeRadio = e => {
console.log(e.target.value);
setValue(e.target.value);
setValue(e);
};
const onFinish = value => {};
return (
......@@ -165,10 +155,16 @@ const AddModal = props => {
name="BuiltInRole"
>
{console.log(value, 'nalie')}
<Radio.Group onChange={onChangeRadio} value={value}>
<Switch
checkedChildren="是"
unCheckedChildren="否"
checked={value}
onChange={onChangeRadio}
/>
{/* <Radio.Group onChange={onChangeRadio} value={value}>
<Radio value={2}>否</Radio>
<Radio value={1}>是</Radio>
</Radio.Group>
</Radio.Group> */}
</Item>
<Item label="角色分组" name="group">
<Select
......
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