Commit ca060de7 authored by 皮倩雯's avatar 皮倩雯

集成登录新增配置

parent 44afbb3d
Pipeline #60133 canceled with stages
......@@ -797,7 +797,7 @@ const RMSComponents = props => {
title="权限选择"
bodyStyle={{ width: '100%', height: '590px', overflowY: 'scorll' }}
width="1000px"
style={{ top: '10px' }}
style={{ top: '-20px' }}
destroyOnClose
centered
cancelText="取消"
......
......@@ -411,6 +411,12 @@ const TableView = props => {
};
// 添加字段
const handleAdd = () => {
// let box = document.getElementById('box');
// let v = document.getElementsByClassName('ant-table-body')[0];
// if (v) {
// v.scrollTop = 500;
// }
scrollToAnchor();
const newData = {
keyIndex: count,
Name: '',
......@@ -422,6 +428,12 @@ const TableView = props => {
setDataSource([...dataSource, newData]);
setCount(count + 1);
};
const scrollToAnchor = () => {
// const anchorElement = document.getElementById('page-bottom');
// console.log(anchorElement);
// anchorElement.scrollIntoView(false);
};
// 批量删除字段
const deleteFilleds = () => {
if (selectedRowKeys.length === 0) {
......@@ -668,7 +680,9 @@ const TableView = props => {
columns={columns}
scroll={{ x: 'max-content', y: '540px' }}
pagination={false}
id="box"
/>
<div id="page-bottom" />
</Spin>
</div>
</Modal>
......
......@@ -1691,20 +1691,20 @@ const AddModal = props => {
}
name="EditableFields"
labelCol={{ span: 5 }}
rules={[
{
validator: (rule, value) => {
if (form.getFieldValue().EditableFields == '') {
return Promise.reject('编辑字段必选');
}
return Promise.resolve();
},
},
{
required: true,
message: '请选择编辑字段',
},
]}
// rules={[
// {
// validator: (rule, value) => {
// if (form.getFieldValue().EditableFields == '') {
// return Promise.reject('编辑字段必选');
// }
// return Promise.resolve();
// },
// },
// {
// required: true,
// message: '请选择编辑字段',
// },
// ]}
>
<div style={{ display: 'flex' }}>
<Form.Item name="EditableFields" style={{ marginBottom: 0, width: '100%' }}>
......
......@@ -3,6 +3,8 @@
/* eslint-disable prefer-template */
/* eslint-disable react/jsx-boolean-value */
import React, { useState, useEffect } from 'react';
import ReactQuill from 'react-quill';
import 'react-quill/dist/quill.snow.css';
import {
Form,
Modal,
......@@ -28,10 +30,23 @@ import { PlusOutlined, LoadingOutlined } from '@ant-design/icons';
import { get, PUBLISH_SERVICE } from '@/services';
import PreviewModal from './PreviewModal';
const { Item } = Form;
const { TextArea } = Input;
const modules = {
toolbar: [
[{ header: [1, 2, 3, 4, 5, 6, false] }],
[{ color: [] }, { background: [] }],
[{ font: [] }],
[{ align: [] }],
['bold', 'italic', 'underline', 'strike', 'blockquote'],
[{ list: 'ordered' }, { list: 'bullet' }, { indent: '-1' }, { indent: '+1' }],
],
};
const AddModal = props => {
const { callBackSubmit = () => {}, type, pickItem, visible, onCancel, keepSystemName } = props;
const [loading, setLoading] = useState(false);
const [radio, setRadio] = useState();
const [radio1, setRadio1] = useState();
const [flag, setFlag] = useState(1);
const [form] = Form.useForm();
const [imageUrl, setImageUrl] = useState();
......@@ -41,17 +56,26 @@ const AddModal = props => {
const [show, setShow] = useState(0);
const [optionslist, setOptionsList] = useState([]);
const [keepLength, setKeeplength] = useState('');
const [fileList, setFileList] = useState([]);
// const [formats, setFormats] = useState([
// 'bold',
// 'italic',
// 'underline',
// 'strike',
// 'blockquote',
// 'list',
// 'bullet',
// 'indent',
// ]);
const { Option } = Select;
useEffect(() => {
console.log(keepSystemName);
if (visible) {
getMap();
if (type === 'edit') {
console.log(pickItem);
console.log(pickItem.AccountParam[0]);
setRadio(pickItem.target);
setRadio1(pickItem.isMaster);
form.setFieldsValue({
accountParamKey: pickItem.AccountParamKey,
accountParamValue: pickItem.AccountParamValue === 1 ? '熊猫ticket' : '熊猫token',
......@@ -62,7 +86,23 @@ const AddModal = props => {
iconUrl: pickItem.iconUrl,
subtitle: pickItem.Subtitle,
target: pickItem.target,
isMaster: pickItem.isMaster,
images: pickItem.images,
siteDescription: pickItem.siteDescription,
});
if (pickItem.images.length > 0) {
let arr = [];
pickItem.images.map((i, j) => {
let aa = {};
aa.uid = j;
aa.name = 'image.png';
aa.status = 'done';
aa.url = window.location.origin + `/${i}`;
aa.submitUrl = i;
arr.push(aa);
});
setFileList(arr);
}
if (pickItem.iconUrl) {
// if (
// pickItem.iconUrl.startsWith('CityTemp') ||
......@@ -82,15 +122,19 @@ const AddModal = props => {
}
} else {
setRadio(0);
setRadio1(false);
form.setFieldsValue({
accountParamValue: '熊猫ticket',
target: 0,
isMaster: false,
mapSetting: '',
coordinate: '',
});
}
} else {
setRadio('');
setFileList([]);
setRadio1('');
setImageUrl('');
setIm('');
setKeepImgeUrl('');
......@@ -219,6 +263,18 @@ const AddModal = props => {
if (obj.coordinate) {
data = obj.coordinate.split(',');
}
console.log(fileList);
let dataList = [];
if (fileList.length > 0) {
fileList.map(i => {
if (i.submitUrl) {
dataList.push(i.submitUrl);
} else {
dataList.push(i.response.data);
}
});
console.log(dataList);
}
if (type === 'add') {
AddIntegratedLogin({
systemName: obj.systemName,
......@@ -229,8 +285,11 @@ const AddModal = props => {
iconUrl: obj.iconUrl,
accountType: 'Panda',
target: obj.target,
isMaster: obj.isMaster,
images: dataList,
mapSetting: obj.mapSetting,
coordinate: data,
siteDescription: obj.siteDescription,
})
.then(res => {
if (res.code === 0) {
......@@ -264,9 +323,12 @@ const AddModal = props => {
iconUrl: obj.iconUrl,
accountType: 'Panda',
target: obj.target,
isMaster: obj.isMaster,
images: dataList,
clients: pickItem.clients,
mapSetting: obj.mapSetting,
coordinate: data,
siteDescription: obj.siteDescription,
})
.then(res => {
if (res.code === 0) {
......@@ -309,10 +371,13 @@ const AddModal = props => {
};
const onChange = e => {
console.log(e);
setRadio(e.target.value);
};
const onChange1 = e => {
setRadio1(e.target.value);
};
const beforeUpload = file => {
const isJpgOrPng =
file.type === 'image/jpeg' ||
......@@ -329,6 +394,10 @@ const AddModal = props => {
return isJpgOrPng && isLt2M;
};
const handleChange1 = ({ fileList: newFileList }) => {
setFileList(newFileList);
};
const handleChange = info => {
setKeepImgeUrl('');
setIm('');
......@@ -364,14 +433,25 @@ const AddModal = props => {
</div>
);
const uploadButton1 = (
<div>
<PlusOutlined />
<div
style={{
marginTop: 8,
}}
>
上传
</div>
</div>
);
const pictruePreview = () => {
setPreviewModal(true);
};
const onOk = props => {
if (props) {
console.log(props.path);
console.log(process.env.PROXY);
setImageUrl(window.location.origin + `/${props.path}`);
setIm(props.path);
setKeepImgeUrl(props.path);
......@@ -380,11 +460,11 @@ const AddModal = props => {
};
const inputType = value => {
console.log(value);
if (value) {
form.setFieldsValue({ internetAddress: value });
}
};
const options = [
{
value: 'http://{IP:端口}/civbase/user/noscret/?client={client}',
......@@ -395,15 +475,25 @@ const AddModal = props => {
];
const onChangeField = (value, selectedOptions) => {
console.log(selectedOptions);
console.log(value);
let aa = selectedOptions[selectedOptions.length - 1].lastpos;
form.setFieldsValue({ coordinate: aa });
};
const onQuillChange = (content, delta, source, editor) => {
console.log(content);
console.log(delta);
console.log(source);
console.log(editor);
// content 是真实的DOM节点
// delta 记录了修改的对象,下篇文章详述
// source 值为user或api
// editor 文本框对象,可以调用函数获取content, delta值
};
return (
<Modal
title={type === 'add' ? '新增网站' : '编辑网站'}
style={{ top: '150px' }}
bodyStyle={{ width: '100%', maxHeight: '600px', overflow: 'scroll' }}
width="700px"
destroyOnClose
maskClosable={false}
......@@ -653,6 +743,36 @@ const AddModal = props => {
<Item label="经纬度" name="coordinate">
<Input disabled />
</Item>
<Item label="特殊站点" name="isMaster">
<Radio.Group onChange={onChange1} value={radio1}>
<Radio value={false}></Radio>
<Radio value={true}></Radio>
</Radio.Group>
</Item>
<Item label="详情图片" name="images" style={{ height: '112px' }}>
<Upload
name="singleFile"
action={`${window.location.origin}${PUBLISH_SERVICE}/UploadSingleFile`}
listType="picture-card"
fileList={fileList}
beforeUpload={beforeUpload}
onChange={handleChange1}
showUploadList={{ showPreviewIcon: false }}
onPreview={false}
>
{fileList.length >= 3 ? null : uploadButton1}
</Upload>
</Item>
<Item label="站点详情" name="siteDescription">
{/* <TextArea /> */}
<ReactQuill
placeholder="请输入内容"
theme="snow" // 主题
modules={modules}
onChange={onQuillChange}
// formats={formats}
/>
</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