Commit d2979f5c authored by 程恺文's avatar 程恺文

修改

parent ff0827d6
Pipeline #79921 passed with stages
...@@ -35,6 +35,10 @@ import { get, PUBLISH_SERVICE } from '@/services'; ...@@ -35,6 +35,10 @@ import { get, PUBLISH_SERVICE } from '@/services';
import PreviewModal from './PreviewModal'; import PreviewModal from './PreviewModal';
import CryptoJS from 'crypto-js'; import CryptoJS from 'crypto-js';
const { Item } = Form; const { Item } = Form;
const controlBarObj={
'停靠' :'dock',
'隐藏':'hide'
}
const modules = { const modules = {
toolbar: [ toolbar: [
[{ header: [1, 2, 3, 4, 5, 6, false] }], [{ header: [1, 2, 3, 4, 5, 6, false] }],
...@@ -60,6 +64,7 @@ const AddModal = props => { ...@@ -60,6 +64,7 @@ const AddModal = props => {
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [radio, setRadio] = useState(); const [radio, setRadio] = useState();
const [radio1, setRadio1] = useState(); const [radio1, setRadio1] = useState();
const [radio2, setRadio2] = useState();
const [identity, setIdentity] = useState(0); const [identity, setIdentity] = useState(0);
const [flag, setFlag] = useState(1); const [flag, setFlag] = useState(1);
const [form] = Form.useForm(); const [form] = Form.useForm();
...@@ -92,6 +97,7 @@ const AddModal = props => { ...@@ -92,6 +97,7 @@ const AddModal = props => {
getMap(); getMap();
if (type === 'edit') { if (type === 'edit') {
setRadio(pickItem.target != 0); setRadio(pickItem.target != 0);
setRadio2(pickItem.controlBar != 'hide');
setRadio1(pickItem.isMaster); setRadio1(pickItem.isMaster);
setIdentity(pickItem.siteType); setIdentity(pickItem.siteType);
setAccount(pickItem.accountType); setAccount(pickItem.accountType);
...@@ -108,6 +114,7 @@ const AddModal = props => { ...@@ -108,6 +114,7 @@ const AddModal = props => {
subtitle: pickItem.Subtitle, subtitle: pickItem.Subtitle,
accountType: pickItem.accountType, accountType: pickItem.accountType,
target: pickItem.target != 0, target: pickItem.target != 0,
controlBar:pickItem.controlBar != 'hide',
isMaster: pickItem.isMaster, isMaster: pickItem.isMaster,
images: pickItem.images, images: pickItem.images,
siteDescription: pickItem.siteDescription, siteDescription: pickItem.siteDescription,
...@@ -166,6 +173,7 @@ const AddModal = props => { ...@@ -166,6 +173,7 @@ const AddModal = props => {
form.setFieldsValue({ form.setFieldsValue({
accountParamValue: '熊猫ticket', accountParamValue: '熊猫ticket',
target: 0, target: 0,
controlBar:true,
isMaster: false, isMaster: false,
mapSetting: '', mapSetting: '',
coordinate: '', coordinate: '',
...@@ -353,6 +361,7 @@ const AddModal = props => { ...@@ -353,6 +361,7 @@ const AddModal = props => {
// 提交 // 提交
const onSubmit = () => { const onSubmit = () => {
form.validateFields().then(validate => { form.validateFields().then(validate => {
console.log(validate,radio2,'validate');
if (validate) { if (validate) {
setLoading(true); setLoading(true);
let obj = form.getFieldsValue(); let obj = form.getFieldsValue();
...@@ -415,6 +424,7 @@ const AddModal = props => { ...@@ -415,6 +424,7 @@ const AddModal = props => {
accountType: account, accountType: account,
isHide: false, isHide: false,
target: radio ? 1 : 0, target: radio ? 1 : 0,
controlBar:radio2?'dock':'hide',
isMaster: obj.isMaster, isMaster: obj.isMaster,
images: dataList, images: dataList,
mapSetting: obj.mapSetting, mapSetting: obj.mapSetting,
...@@ -459,6 +469,7 @@ const AddModal = props => { ...@@ -459,6 +469,7 @@ const AddModal = props => {
iconUrl: obj.iconUrl, iconUrl: obj.iconUrl,
accountType: account, accountType: account,
target: radio ? 1 : 0, target: radio ? 1 : 0,
controlBar:radio2?'dock':'hide',
isMaster: obj.isMaster, isMaster: obj.isMaster,
images: dataList, images: dataList,
siteType: obj.siteType, siteType: obj.siteType,
...@@ -512,7 +523,9 @@ const AddModal = props => { ...@@ -512,7 +523,9 @@ const AddModal = props => {
const onChange1 = e => { const onChange1 = e => {
setRadio1(e); setRadio1(e);
}; };
const onChange2 = e => {
setRadio2(e);
};
const beforeUpload = file => { const beforeUpload = file => {
const isJpgOrPng = const isJpgOrPng =
file.type === 'image/jpeg' || file.type === 'image/jpeg' ||
...@@ -762,6 +775,9 @@ const AddModal = props => { ...@@ -762,6 +775,9 @@ const AddModal = props => {
<Item label="新标签" name="target"> <Item label="新标签" name="target">
<Switch checkedChildren="是" unCheckedChildren="否" checked={radio} onChange={onChange} /> <Switch checkedChildren="是" unCheckedChildren="否" checked={radio} onChange={onChange} />
</Item> </Item>
<Item label="控制台" name="controlBar">
<Switch checkedChildren="停靠" unCheckedChildren="隐藏" checked={radio2} onChange={onChange2} />
</Item>
<Row> <Row>
<Col span={10}> <Col span={10}>
<Item <Item
......
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