Commit 62fd2137 authored by 邓超's avatar 邓超
parents 01aafad0 3908e04c
......@@ -122,7 +122,7 @@
"js-calendar-converter": "0.0.4",
"lodash": "4.17.11",
"minimist": "1.2.0",
"panda-xform": "^4.4.5",
"panda-xform": "^4.5.0",
"prop-types": "15.7.2",
"quill": "^1.3.7",
"rc-tween-one": "^3.0.6",
......
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
......@@ -456,7 +456,7 @@ const WorkflowHomePage = () => {
<a
style={{ display: 'inline-block', marginTop: '5px', marginRight: '20px' }}
target="_blank"
href={path.join(__dirname, '/civmanage/第三方工单对接说明文档.pdf')}
href={path.join(__dirname, '/civmanage/熊猫第三方工单对接说明文档.pdf')}
rel="noopener noreferer"
>
<FilePdfOutlined style={{ fontSize: '24px' }} />
......
......@@ -71,6 +71,7 @@ const AddModal = props => {
const [pick, setPick] = useState(''); // 复选框数据填入项
const [keepIds, setKeepIds] = useState(null);
const [account, setAccount] = useState(0);
const [isFromLocal, setIsFromLocal] = useState(false);
const key = CryptoJS.enc.Utf8.parse('1p2a3n4d5a6o7m8s9a10n1e2t3c4o5re'); // 十六位十六进制数作为密钥
const iv = CryptoJS.enc.Utf8.parse('1234567890000000');
......@@ -385,10 +386,12 @@ const AddModal = props => {
message.error('请选择图标!');
return;
}
if (obj.iconUrl.includes('CityTemp') && obj.iconUrl.includes('图库')) {
obj.iconUrl = obj.iconUrl;
} else {
obj.iconUrl = 'CityTemp\\图库\\' + obj.iconUrl;
if (!isFromLocal) {
if (obj.iconUrl.includes('CityTemp') && obj.iconUrl.includes('图库')) {
obj.iconUrl = obj.iconUrl;
} else {
obj.iconUrl = 'CityTemp\\图库\\' + obj.iconUrl;
}
}
if (type === 'add') {
AddIntegratedLogin({
......@@ -540,6 +543,7 @@ const AddModal = props => {
// };
// });
if (info.file.response.code === 0) {
setIsFromLocal(false)
console.log('触发咯');
if (
info.file.response.data.includes('CityTemp') &&
......@@ -612,6 +616,7 @@ const AddModal = props => {
// setImageUrl(window.location.origin + `/${props.path}`);
// setIm(props.path);
// setKeepImgeUrl(props.path);
setIsFromLocal(true);
form.setFieldsValue({ iconUrl: `${props.path}` });
}
};
......
......@@ -21,7 +21,6 @@ const PreviewModal = props => {
useEffect(() => {
console.log(imageUrl);
console.log(keepImgeUrl);
debugger
console.log(type);
console.log(process.env, 'process.env.PROXY');
setPickItem('');
......
......@@ -14,6 +14,9 @@ import {
Tooltip,
Popconfirm,
notification,
Upload,
Modal,
message,
} from 'antd';
import {
SyncOutlined,
......@@ -25,10 +28,17 @@ import {
ZoomInOutlined,
CaretUpFilled,
CaretDownFilled,
ExportOutlined,
ImportOutlined,
DownloadOutlined,
} from '@ant-design/icons';
import voca from 'voca';
import styles from './index.less';
import { GetVideoConfigList, deleteInsertVideoConfig } from '@/services/videoManger/videoManger';
import {
GetVideoConfigList,
deleteInsertVideoConfig,
ImportVideoConfig,
} from '@/services/videoManger/videoManger';
import AddModal from './AddModal';
import CheckModal from './CheckModal';
import VideoModal from './VideoModal';
......@@ -36,6 +46,8 @@ import DHModal from './DHModal';
import HKModal from './HKModal';
import AddAllModal from './AddAllModal';
const path = require('path');
const videoManager = () => {
const [configurationType, setConfigurationType] = useState('1');
const [loading, setLoading] = useState(false); // 加载
......@@ -414,6 +426,40 @@ const videoManager = () => {
setAddVisible(false);
setFlag(flag + 1);
};
// 导入
const beforeUpload = val => {
const formData = new FormData();
formData.append('file', val);
console.log(formData, val, 'OK');
ImportVideoConfig(formData).then(response => {
if (response.code === 0) {
setFlag(flag + 1);
message.success('导入成功');
} else {
message.error(response.msg);
}
});
return false;
};
const downLoadObj = {
'1': '萤石云-视频导入模板',
'2': '海康-视频导入模板',
'3': '海康1-2-视频导入模板',
'4': '海康NVR-视频导入模板',
'5': '大华-视频导入模板',
'6': '海康ISC-视频导入模板',
};
// 下载模板
const downloadFile = () => {
let downloadLink = document.createElement('a');
downloadLink.href = path.join(__dirname, `/civmanage/${downLoadObj[configurationType]}.xlsx`);
downloadLink.download = downLoadObj[configurationType];
document.body.appendChild(downloadLink);
downloadLink.click();
document.body.removeChild(downloadLink);
};
return (
<div className={styles.videoManagerContainer}>
<Row className={styles.head}>
......@@ -463,6 +509,16 @@ const videoManager = () => {
>
新增
</Button> */}
<div style={{ float: 'right' }}>
<Upload showUploadList={false} accept=".xlsx" beforeUpload={beforeUpload}>
<Button style={{ marginLeft: '10px' }} type="primary" ghost>
<div style={{ display: 'flex', alignItems: 'center' }}>
<ImportOutlined style={{ marginRight: '5px' }} />
<div>导入</div>
</div>
</Button>
</Upload>
</div>
<Button
icon={<PlusOutlined className={styles.icon} />}
onClick={addAll}
......@@ -474,6 +530,17 @@ const videoManager = () => {
>
新增
</Button>
<Button
icon={<DownloadOutlined className={styles.icon} />}
onClick={downloadFile}
style={{
float: 'right',
verticalAlign: 'middle',
marginRight: '10px',
}}
>
下载模板
</Button>
</Col>
</Row>
......
......@@ -15,3 +15,7 @@ export const editInsertVideoConfig = data =>
// 删除配置
export const deleteInsertVideoConfig = data =>
post(`${PUBLISH_SERVICE}/VideoManager/InsertVideoConfig?type=delete`, data);
// 导入配置
export const ImportVideoConfig = data =>
post(`${PUBLISH_SERVICE}/VideoManager/ImportVideoConfig`, data);
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