Commit d87d96e5 authored by 皮倩雯's avatar 皮倩雯
parents 43481064 3ac0e9a9
Pipeline #73942 passed with stages
......@@ -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.
......@@ -231,7 +231,10 @@ class PicturesWall extends React.Component<PicturesWallType> {
if (file.status === 'done') {
const files = fileList.map(item => {
const { status, name, thumbUrl } = item;
const url = item.response && item.response.data || thumbUrl;
let url = item.response && item.response.data || thumbUrl;
if (url && (!url.includes('CityTemp') && !url.includes('图库'))) {
url = 'CityTemp\\图库\\' + url
}
return { uid: uuid(8, 16), name, status, url };
});
this.setState({ fileList: files })
......@@ -273,8 +276,6 @@ class PicturesWall extends React.Component<PicturesWallType> {
// reader.onload = () => resolve(reader.result as string);
// })
// });
if (path && path.indexOf('http') === 0) {
return path
}
......@@ -284,6 +285,10 @@ class PicturesWall extends React.Component<PicturesWallType> {
if (path && path.indexOf('assets') === 0) {
return `${window.location.origin}/civweb4/${path}`.replace(/\\/g, '/')
}
if (path && (!path.includes('CityTemp') && !path.includes('图库'))) {
path = 'CityTemp\\图库\\' + path
}
if (previewFlag) {
return path
}
......
......@@ -568,6 +568,7 @@ const BookConfigNew = props => {
// }}
// width="100vw"
confirmLoading={modalLoading}
okText="保存并查看"
>
<div className={styles.top}>
<Form form={form} {...layout}>
......
......@@ -259,7 +259,7 @@ const EditableCell = ({
},
},
{
pattern: /^(?!(\d+)$)[\u4e00-\u9fffa-zA-Z0-9_]+$/,
pattern: /^[^\d][\u4e00-\u9fffA-Za-z0-9_]+$/,
message: '不能输入特殊符号或者纯数字',
},
];
......
......@@ -17,7 +17,13 @@ import FlowModal from './workFlowComponents/FlowModal';
import FlowGroupModal from './workFlowComponents/FlowGroupModal';
import Order from './workFlowComponents/Order';
import styles from './WorkflowHomePage.less';
import { WFGetAllFlow, GetFlowNode, DeleteFlow } from '@/services/workflow/workflow';
import {
WFGetAllFlow,
GetFlowNode,
DeleteFlow,
CheckDoingFlowNodes,
CloseDoingFlowNodes,
} from '@/services/workflow/workflow';
import { DownLoadFiles } from '@/services/common/api';
import { UpdateFlowGroup } from '@/services/workflow/workflow';
const plugins = [ScrollToPlugin];
......@@ -114,7 +120,7 @@ const WorkflowHomePage = () => {
let list = res.data.map((item, index) => {
item.children.forEach(ele => {
flowNameList.push(ele.FlowName);
ele.PreviewImage = getImgUrl(ele.PreviewImage)
ele.PreviewImage = getImgUrl(ele.PreviewImage);
});
item.isOld = true;
item.bgType = (index + 1) % 5;
......@@ -248,36 +254,81 @@ const WorkflowHomePage = () => {
});
};
// 删除流程
const delFlow = (val, e) => {
const delFlow = async (val, e) => {
e.stopPropagation();
confirm({
title: '确定要删除吗?',
icon: <ExclamationCircleOutlined />,
content: '',
okText: '是',
okType: 'danger',
cancelText: '否',
onOk() {
DeleteFlow({ FlowId: val.FlowID })
.then(res => {
if (res.code === 0) {
setModalType('del');
getFlowList();
message.success('删除成功');
} else {
message.error({
content: (
<div style={{ whiteSpace: 'pre-line', textAlign: 'justify' }}>{res.msg}</div>
),
let res1 = await CheckDoingFlowNodes({ flowID: val.FlowID });
if (res1.code === 0) {
if (res1.data > 0) {
confirm({
title: '确定要删除当前流程吗?',
icon: <ExclamationCircleOutlined />,
content: <div>当前流程有{res1.data}条在办工单,确定删除会自动归档在办工单。</div>,
okText: '是',
okType: 'danger',
cancelText: '否',
onOk() {
CloseDoingFlowNodes({ flowID: val.FlowID }).then(res2 => {
if (res2.code === 0) {
DeleteFlow({ FlowId: val.FlowID })
.then(res3 => {
if (res3.code === 0) {
setModalType('del');
getFlowList();
message.success('删除成功');
} else {
message.error({
content: (
<div style={{ whiteSpace: 'pre-line', textAlign: 'justify' }}>
{res3.msg}
</div>
),
});
}
})
.catch(() => {
message.error('网络异常请稍后再试');
});
} else {
message.error(res2.msg);
}
});
},
onCancel() {},
});
} else {
confirm({
title: '确定要删除吗?',
icon: <ExclamationCircleOutlined />,
content: '',
okText: '是',
okType: 'danger',
cancelText: '否',
onOk() {
DeleteFlow({ FlowId: val.FlowID })
.then(res2 => {
if (res2.code === 0) {
setModalType('del');
getFlowList();
message.success('删除成功');
} else {
message.error({
content: (
<div style={{ whiteSpace: 'pre-line', textAlign: 'justify' }}>{res2.msg}</div>
),
});
}
})
.catch(() => {
message.error('网络异常请稍后再试');
});
}
})
.catch(() => {
message.error('网络异常请稍后再试');
});
},
onCancel() {},
});
},
onCancel() {},
});
}
} else {
message.error(res1.msg);
}
};
const getImgUrl = img => {
// return new Promise((resolve, reject) => {
......@@ -287,7 +338,7 @@ const WorkflowHomePage = () => {
// reader.onload = () => resolve(reader.result);
// });
// });a
return `/PandaOMS/OMS/FileCenter/DownLoadFiles?module=熊猫智慧水务平台\\WorkFlowImage&filePath=${img}`
return `/PandaOMS/OMS/FileCenter/DownLoadFiles?module=熊猫智慧水务平台\\WorkFlowImage&filePath=${img}`;
};
// tab栏选项渲染
const tabRender = (val, index) => (
......@@ -405,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' }} />
......
......@@ -10,6 +10,8 @@ import {
DeleteFlowNode,
DeleteFlowNodes,
SaveWorkFlowImage,
CheckDoingFlowNodes,
CloseDoingFlowNodes,
} from '@/services/workflow/workflow';
import { compress } from '@/utils/utils';
import { ExclamationCircleOutlined, TrophyOutlined } from '@ant-design/icons';
......@@ -153,14 +155,24 @@ const FlowChart = props => {
delLinks.add(item.data.LineId);
}
});
showDeleteConfirm([...delNodeIds], [...delNodes], [...delLinks]);
CheckDoingFlowNodes({ activityIds: [...delNodes] }).then(res => {
if (res.code === 0) {
if (res.data > 0) {
showCloseList([...delNodeIds], [...delNodes], [...delLinks], res.data);
} else {
showDeleteConfirm([...delNodeIds], [...delNodes], [...delLinks]);
}
} else {
message.error(res.msg);
}
});
return false;
};
// 监听线,连接线的时候加上text属性
diagram.addDiagramListener('LinkDrawn', e => {
// e.subject.data.text = '';
e.subject.data.lineDetail = JSON.stringify(e.subject.data);
console.log(e, e.subject.data, 'fasdfasdgds');
diagram.model.updateTargetBindings(e.subject.data);
// leaveCallBack(true);
});
......@@ -168,7 +180,6 @@ const FlowChart = props => {
diagram.addDiagramListener('externalobjectsdropped', e => {
afterNodes.current = new Map([]);
const list = JSON.parse(diagram.model.toJson()).nodeDataArray;
console.log(list, 'list');
let newNum;
let newKey;
......@@ -322,6 +333,27 @@ const FlowChart = props => {
return i;
};
}, [currentFlowData]);
const showCloseList = (delNodeIds, delNodes, delLinks, listMsg) => {
confirm({
title: '确定要删除所选节点吗?',
icon: <ExclamationCircleOutlined />,
content: <div>当前节点有{listMsg}条在办工单,确定删除会自动归档在办工单。</div>,
okText: '是',
okType: 'primary',
cancelText: '否',
onOk() {
CloseDoingFlowNodes({ activityIds: [...delNodes] }).then(res => {
if (res.code === 0) {
delNode(delNodeIds, delNodes, delLinks);
} else {
message.error(res.msg);
}
});
},
onCancel() {},
});
};
// 删除提醒
const showDeleteConfirm = (delNodeIds, delNodes, delLinks) => {
confirm({
......@@ -329,7 +361,7 @@ const FlowChart = props => {
icon: <ExclamationCircleOutlined />,
content: '',
okText: '是',
okType: 'danger',
okType: 'primary',
cancelText: '否',
onOk() {
delNode(delNodeIds, delNodes, delLinks);
......
......@@ -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,6 +386,13 @@ const AddModal = props => {
message.error('请选择图标!');
return;
}
if (!isFromLocal) {
if (obj.iconUrl.includes('CityTemp') && obj.iconUrl.includes('图库')) {
obj.iconUrl = obj.iconUrl;
} else {
obj.iconUrl = obj.iconUrl;
}
}
if (type === 'add') {
AddIntegratedLogin({
systemName: obj.systemName,
......@@ -535,7 +543,16 @@ const AddModal = props => {
// };
// });
if (info.file.response.code === 0) {
setImageUrl(getImg(info.file.response.data));
setIsFromLocal(false);
console.log('触发咯');
if (
info.file.response.data.includes('CityTemp') &&
info.file.response.data.includes('图库')
) {
setImageUrl(getImg(info.file.response.data));
} else {
setImageUrl(getImg(info.file.response.data));
}
setLoading(false);
} else {
message.error(info.file.response.msg);
......@@ -599,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}` });
}
};
......
......@@ -396,6 +396,25 @@ const Integrate = () => {
if (resnew.code === 0) {
setTableData(resnew.data);
setShowSearchStyle(true);
let aa = [];
if (resnew.data.length > 0) {
resnew.data.map((i, j) => {
aa.push(i.SystemName);
resnew.data[j].AccountParamKey = i.AccountParam[0].key;
resnew.data[j].AccountParamValue = i.AccountParam[0].value;
if (resnew.data[j].iconUrl && !resnew.data[j].iconUrl.includes('images')) {
resnew.data[j].showUrl = getImg(resnew.data[j].iconUrl);
} else {
resnew.data[j].showUrl = `${window.location.origin}/${resnew.data[j].iconUrl}`;
}
});
}
console.log(aa);
setKeepSystemName(aa);
console.log(resnew.data);
console.log(resnew.data, 'resnew.dataresnew.dataresnew.data');
setTableData(resnew.data);
} else {
notification.error({
message: '获取失败',
......@@ -406,6 +425,40 @@ const Integrate = () => {
});
};
// const getData = () => {
// setLoading(true);
// GetIntegratedLogin({ isHide: false }).then(resnew => {
// if (resnew.code === 0) {
// console.log(resnew.data);
// let aa = [];
// if (resnew.data.length > 0) {
// resnew.data.map((i, j) => {
// aa.push(i.SystemName);
// resnew.data[j].AccountParamKey = i.AccountParam[0].key;
// resnew.data[j].AccountParamValue = i.AccountParam[0].value;
// if (resnew.data[j].iconUrl && !resnew.data[j].iconUrl.includes('images')) {
// resnew.data[j].showUrl = getImg(resnew.data[j].iconUrl);
// } else {
// resnew.data[j].showUrl = `${window.location.origin}/${resnew.data[j].iconUrl}`;
// }
// });
// }
// console.log(aa);
// setKeepSystemName(aa);
// console.log(resnew.data);
// console.log(resnew.data, 'resnew.dataresnew.dataresnew.data');
// setTableData(resnew.data);
// } else {
// notification.error({
// message: '获取失败',
// description: resnew.msg,
// });
// }
// setLoading(false);
// });
// };
const handleReset = () => {
setSearchWord('');
setShowSearchStyle(false);
......
......@@ -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>
......
......@@ -276,7 +276,7 @@ export default props => {
let arr = validate.homePage.split('/'); // 用const声明常量
let allProList = JSON.parse(JSON.stringify(allProductList));
allProList.push({ PackageName: 'civ_base' });
const product = allProList.find(item => item.PackageName.includes(arr[0]));
const product = allProList.find(item => item.PackageName === arr[0]);
if (product) {
arr.shift();
validate.homePage = arr.join('/');
......
......@@ -36,7 +36,7 @@ const AddForm = props => {
}
let allProList = JSON.parse(JSON.stringify(allProductList));
allProList.push({ PackageName: 'civ_base' });
const product = allProList.find(item => item.PackageName.includes(arr[0]));
const product = allProList.find(item => item.PackageName === arr[0]);
if (product) {
if (arr.length > 1) {
arr.shift();
......
......@@ -158,7 +158,7 @@ const EditForm = props => {
}
let allProList = JSON.parse(JSON.stringify(allProductList));
allProList.push({ PackageName: 'civ_base' });
const product = allProList.find(item => item.PackageName.includes(arr[0]));
const product = allProList.find(item => item.PackageName === arr[0]);
console.log(product, 'product');
if (product) {
arr.shift();
......
......@@ -98,6 +98,11 @@ const AddUserModal = props => {
message: '提交失败',
description: '密码至少为6位,且包含数字和字母!',
});
} else if (passwordLevel === '弱') {
notification.error({
message: '提交失败',
description: '密码强度太弱,加强密码强度',
});
} else if (userName === '') {
notification.error({
message: '提交失败',
......@@ -257,8 +262,12 @@ const AddUserModal = props => {
label="账号密码"
rules={[
{
pattern: /^[a-zA-Z0-9_]{6,16}$/,
message: '长度6-16位,支持字母与数字,允许下划线',
pattern: /^(?=.*[a-zA-Z])(?=.*\d)[\w\S]{6,16}$/,
message: '长度6-16位,必须包含数字与字母',
},
{
pattern: /^(?!.*(?:SELECT|UPDATE|INSERT|AND|OR|'|"|;|--|\\)).*$/,
message: '当前密码存在sql注入风险,请重新输入', // 防止sql注入
},
{ required: true },
]}
......
......@@ -94,6 +94,7 @@ const EditUserModal = props => {
// });
// return;
// }
if ((newPassword && newPassword.length < 6) || (passwordConfirm && passwordConfirm < 6)) {
notification.error({
message: '提交失败',
......@@ -108,6 +109,25 @@ const EditUserModal = props => {
});
return;
}
if (newPassword && newPassword) {
if (newPasswordLevel === '弱') {
notification.error({
message: '提交失败',
description: '密码强度太弱,加强密码强度',
});
return;
}
if (
!/^(?=.*[a-zA-Z])(?=.*\d)[\w\S]{6,16}$/.test(newPassword) ||
!/^(?!.*(?:SELECT|UPDATE|INSERT|AND|OR|'|"|;|--|\\)).*$/.test(newPassword)
) {
notification.error({
message: '提交失败',
description: '密码验证未通过',
});
return;
}
}
// 所有验证通过才可以提交,phone/email为空时不验证
if (
loginName &&
......@@ -339,8 +359,12 @@ const EditUserModal = props => {
label="新密码"
rules={[
{
pattern: /^[a-zA-Z0-9_]{6,16}$/,
message: '长度6-16位,支持字母与数字,允许下划线',
pattern: /^(?=.*[a-zA-Z])(?=.*\d)[\w\S]{6,16}$/,
message: '长度6-16位,必须包含数字与字母',
},
{
pattern: /^(?!.*(?:SELECT|UPDATE|INSERT|AND|OR|'|"|;|--|\\)).*$/,
message: '当前密码存在sql注入风险,请重新输入', // 防止sql注入
},
// { required: true },
]}
......@@ -374,10 +398,13 @@ const EditUserModal = props => {
label="确认密码"
rules={[
{
pattern: /^[a-zA-Z0-9_]{6,16}$/,
message: '长度6-16位,支持字母与数字,允许下划线',
pattern: /^(?=.*[a-zA-Z])(?=.*\d)[\w\S]{6,16}$/,
message: '长度6-16位,必须包含数字与字母',
},
{
pattern: /^(?!.*(?:SELECT|UPDATE|INSERT|AND|OR|'|"|;|--|\\)).*$/,
message: '当前密码存在sql注入风险,请重新输入', // 防止sql注入
},
// { required: true },
]}
>
<Input.Password
......
......@@ -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);
......@@ -41,3 +41,9 @@ export const DeleteFlowNodes = param => post(`${PUBLISH_SERVICE}/WorkFlow/Delete
// 保存basde65
export const SaveWorkFlowImage = param =>
post(`${PUBLISH_SERVICE}/FileCenter/SaveWorkFlowImage`, param);
// 检查流程和节点的在办
export const CheckDoingFlowNodes = param =>
post(`${PUBLISH_SERVICE}/WorkFlow/CheckDoingFlowNodes`, param);
// 一键关单接口
export const CloseDoingFlowNodes = param =>
post(`${PUBLISH_SERVICE}/WorkFlow/CloseDoingFlowNodes`, param);
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