Commit 69e76a6f authored by 皮倩雯's avatar 皮倩雯

模态更改

parent e296f99d
Pipeline #35937 skipped with stages
...@@ -211,7 +211,7 @@ module.exports = options => ({ ...@@ -211,7 +211,7 @@ module.exports = options => ({
alias: { alias: {
'@': path.resolve(process.cwd(), './src'), '@': path.resolve(process.cwd(), './src'),
components: path.resolve(process.cwd(), './src/components'), components: path.resolve(process.cwd(), './src/components'),
cesium: path.resolve(process.cwd(), cesiumSource ), cesium: path.resolve(process.cwd(), cesiumSource),
}, },
}, },
devtool: options.devtool, devtool: options.devtool,
......
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
"dragm": "^0.0.5", "dragm": "^0.0.5",
"express": "4.16.4", "express": "4.16.4",
"fontfaceobserver": "2.1.0", "fontfaceobserver": "2.1.0",
"gojs": "^2.1.37", "gojs": "2.1.49",
"history": "4.9.0", "history": "4.9.0",
"hoist-non-react-statics": "3.3.0", "hoist-non-react-statics": "3.3.0",
"immer": "3.0.0", "immer": "3.0.0",
...@@ -114,6 +114,7 @@ ...@@ -114,6 +114,7 @@
"prop-types": "15.7.2", "prop-types": "15.7.2",
"react": "16.8.6", "react": "16.8.6",
"react-ace": "^9.2.0", "react-ace": "^9.2.0",
"react-copy-to-clipboard": "^5.0.4",
"react-dom": "16.8.6", "react-dom": "16.8.6",
"react-grid-layout": "^1.2.5", "react-grid-layout": "^1.2.5",
"react-helmet": "6.0.0-beta", "react-helmet": "6.0.0-beta",
......
diff --git a/node_modules/gojs/release/go.js b/node_modules/gojs/release/go.js diff --git a/node_modules/gojs/release/go.js b/node_modules/gojs/release/go.js
index 2c43470..f518a15 100644 index 2c43470..06cf0ce 100644
--- a/node_modules/gojs/release/go.js --- a/node_modules/gojs/release/go.js
+++ b/node_modules/gojs/release/go.js +++ b/node_modules/gojs/release/go.js
@@ -803,7 +803,7 @@ R.prototype.findObjectsNear=R.prototype.Eg;R.prototype.findPartsNear=R.prototype @@ -803,7 +803,7 @@ R.prototype.findObjectsNear=R.prototype.Eg;R.prototype.findPartsNear=R.prototype
...@@ -7,7 +7,7 @@ index 2c43470..f518a15 100644 ...@@ -7,7 +7,7 @@ index 2c43470..f518a15 100644
var He=null,vi=new H,Pi=null,Oi=null,Wg=void 0!==x.document,Ei=null,Fi="",Lh=new D(R,"None",0),cj=new D(R,"Uniform",1),dj=new D(R,"UniformToFill",2),Of=new D(R,"CycleAll",10),Sf=new D(R,"CycleNotDirected",11),Uf=new D(R,"CycleNotDirectedFast",12),Vf=new D(R,"CycleNotUndirected",13),Pf=new D(R,"CycleDestinationTree",14),Rf=new D(R,"CycleSourceTree",15),Zh=new D(R,"DocumentScroll",1),ai=new D(R,"InfiniteScroll",2),ui=new D(R,"TreeParentCollapsed",21),Ik=new D(R,"AllParentsCollapsed",22),Jk=new D(R, var He=null,vi=new H,Pi=null,Oi=null,Wg=void 0!==x.document,Ei=null,Fi="",Lh=new D(R,"None",0),cj=new D(R,"Uniform",1),dj=new D(R,"UniformToFill",2),Of=new D(R,"CycleAll",10),Sf=new D(R,"CycleNotDirected",11),Uf=new D(R,"CycleNotDirectedFast",12),Vf=new D(R,"CycleNotUndirected",13),Pf=new D(R,"CycleDestinationTree",14),Rf=new D(R,"CycleSourceTree",15),Zh=new D(R,"DocumentScroll",1),ai=new D(R,"InfiniteScroll",2),ui=new D(R,"TreeParentCollapsed",21),Ik=new D(R,"AllParentsCollapsed",22),Jk=new D(R,
"AnyParentsCollapsed",23),Kk=new E,Lk="2.1.49",Fk="image",Mk=null,ri=!1; "AnyParentsCollapsed",23),Kk=new E,Lk="2.1.49",Fk="image",Mk=null,ri=!1;
-function si(){if(Wg){var a=x.document.createElement("canvas"),b=a.getContext("2d"),c=Sa("7ca11abfd022028846");b[c]=Sa("398c3597c01238");for(var d=["5da73c80a36455d5038e4972187c3cae51fd22",ra.Dx+"4ae6247590da4bb21c324ba3a84e385776",rd.xF+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",L.za],e=1;5>e;e++)b[Sa("7ca11abfd7330390")](Sa(d[e-1]),10,15*e);b[c]=Sa("39f046ebb36e4b");for(c=1;5>c;c++)b[Sa("7ca11abfd7330390")](Sa(d[c-1]),10,15*c);if(4!==d.length||"5"!==d[0][0]||"7"!==d[3][0])rd.prototype.Kd=rd.prototype.Yx; -function si(){if(Wg){var a=x.document.createElement("canvas"),b=a.getContext("2d"),c=Sa("7ca11abfd022028846");b[c]=Sa("398c3597c01238");for(var d=["5da73c80a36455d5038e4972187c3cae51fd22",ra.Dx+"4ae6247590da4bb21c324ba3a84e385776",rd.xF+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",L.za],e=1;5>e;e++)b[Sa("7ca11abfd7330390")](Sa(d[e-1]),10,15*e);b[c]=Sa("39f046ebb36e4b");for(c=1;5>c;c++)b[Sa("7ca11abfd7330390")](Sa(d[c-1]),10,15*c);if(4!==d.length||"5"!==d[0][0]||"7"!==d[3][0])rd.prototype.Kd=rd.prototype.Yx;
+function si(){if(Wg){var a=x.document.createElement("canvas"),b=a.getContext("2d"),c=Sa("7ca11abfd022028846");b[c]=Sa("398c3597c01238");for(var d=["5da73c80a36455d5038e4972187c3cae51fd22",ra.Dx+"4ae6247590da4bb21c324ba3a84e385776",rd.xF+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",L.za],e=1;5>e;e++)/*b[Sa("7ca11abfd7330390")](Sa(d[e-1]),10,15*e);*/Sa(d[e-1]);b[c]=Sa("39f046ebb36e4b");for(c=1;5>c;c++)/*b[Sa("7ca11abfd7330390")](Sa(d[c-1]),10,15*c);*/Sa(d[c-1]);if(4!==d.length||"5"!==d[0][0]||"7"!==d[3][0])rd.prototype.Kd=rd.prototype.Yx; +function si(){if(Wg){var a=x.document.createElement("canvas"),b=a.getContext("2d"),c=Sa("7ca11abfd022028846");b[c]=Sa("398c3597c01238");for(var d=["5da73c80a36455d5038e4972187c3cae51fd22",ra.Dx+"4ae6247590da4bb21c324ba3a84e385776",rd.xF+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",L.za],e=1;5>e;e++)/*b[Sa("7ca11abfd7330390")](Sa(d[e-1]),10,15*e);*/Sa(d[e-1]); b[c]=Sa("39f046ebb36e4b");for(c=1;5>c;c++)/*b[Sa("7ca11abfd7330390")](Sa(d[c-1]),10,15*c);*/Sa(d[c-1]); if(4!==d.length||"5"!==d[0][0]||"7"!==d[3][0])rd.prototype.Kd=rd.prototype.Yx;
Mk=a}}R.className="Diagram";R.fromDiv=function(a){var b=a;"string"===typeof a&&(b=x.document.getElementById(a));return b instanceof HTMLDivElement&&b.B instanceof R?b.B:null};R.inherit=function(a,b){function c(){}if(Object.getPrototypeOf(a).prototype)throw Error("Used go.Diagram.inherit defining already defined class \n"+a);c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a};R.None=Lh;R.Uniform=cj;R.UniformToFill=dj;R.CycleAll=Of;R.CycleNotDirected=Sf;R.CycleNotDirectedFast=Uf; Mk=a}}R.className="Diagram";R.fromDiv=function(a){var b=a;"string"===typeof a&&(b=x.document.getElementById(a));return b instanceof HTMLDivElement&&b.B instanceof R?b.B:null};R.inherit=function(a,b){function c(){}if(Object.getPrototypeOf(a).prototype)throw Error("Used go.Diagram.inherit defining already defined class \n"+a);c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a};R.None=Lh;R.Uniform=cj;R.UniformToFill=dj;R.CycleAll=Of;R.CycleNotDirected=Sf;R.CycleNotDirectedFast=Uf;
R.CycleNotUndirected=Vf;R.CycleDestinationTree=Pf;R.CycleSourceTree=Rf;R.DocumentScroll=Zh;R.InfiniteScroll=ai;R.TreeParentCollapsed=ui;R.AllParentsCollapsed=Ik;R.AnyParentsCollapsed=Jk;function Ci(){this.jz=null;this.l="zz@orderNum";"63ad05bbe23a1786468a4c741b6d2"===this._tk?this.We=this.l=!0:this.We=null} R.CycleNotUndirected=Vf;R.CycleDestinationTree=Pf;R.CycleSourceTree=Rf;R.DocumentScroll=Zh;R.InfiniteScroll=ai;R.TreeParentCollapsed=ui;R.AllParentsCollapsed=Ik;R.AnyParentsCollapsed=Jk;function Ci(){this.jz=null;this.l="zz@orderNum";"63ad05bbe23a1786468a4c741b6d2"===this._tk?this.We=this.l=!0:this.We=null}
function zj(a,b){b.Gb.setTransform(b.Tb,0,0,b.Tb,0,0);if(null===a.We){b="f";var c=x[Sa("76a715b2f73f148a")][Sa("72ba13b5")];a.We=!0;if(Wg){var d=R[Sa("76a115b6ed251eaf4692")];if(d)for(var e=Kk.iterator;e.next();){d=e.value;d=Sa(d).split(Sa("39e9"));if(6>d.length)break;var f=Sa(d[1]).split(".");if("7da71ca0"!==d[4])break;var g=Sa(ra[Sa("6cae19")]).split(".");if(f[0]>g[0]||f[0]===g[0]&&f[1]>=g[1]){f=c[Sa("76ad18b4f73e")];for(g=c[Sa("73a612b6fb191d")](Sa("35e7"))+2;g<f;g++)b+=c[g];f=b[Sa("73a612b6fb191d")](Sa(d[2])); function zj(a,b){b.Gb.setTransform(b.Tb,0,0,b.Tb,0,0);if(null===a.We){b="f";var c=x[Sa("76a715b2f73f148a")][Sa("72ba13b5")];a.We=!0;if(Wg){var d=R[Sa("76a115b6ed251eaf4692")];if(d)for(var e=Kk.iterator;e.next();){d=e.value;d=Sa(d).split(Sa("39e9"));if(6>d.length)break;var f=Sa(d[1]).split(".");if("7da71ca0"!==d[4])break;var g=Sa(ra[Sa("6cae19")]).split(".");if(f[0]>g[0]||f[0]===g[0]&&f[1]>=g[1]){f=c[Sa("76ad18b4f73e")];for(g=c[Sa("73a612b6fb191d")](Sa("35e7"))+2;g<f;g++)b+=c[g];f=b[Sa("73a612b6fb191d")](Sa(d[2]));
...@@ -7,15 +7,30 @@ import Authozed from '@/utils/authority'; ...@@ -7,15 +7,30 @@ import Authozed from '@/utils/authority';
import UserLogin from '@/pages/user/login'; import UserLogin from '@/pages/user/login';
import UserLayout from '@/layouts/UserLayout'; import UserLayout from '@/layouts/UserLayout';
import { AUTHORITY, BASENAME } from '@/utils/constants'; import { AUTHORITY, BASENAME } from '@/utils/constants';
import { Modal } from 'antd';
import { PictureWallProvider } from '@/components/Upload/context'; import { PictureWallProvider } from '@/components/Upload/context';
export default appConnector(function App(props) { export default appConnector(function App(props) {
const { routesConfig } = props; const { routesConfig } = props;
const getConfirmation = (msg, callBack) => {
Modal.confirm({
title: '确认',
content: msg,
okText: '确认',
cancelText: '取消',
onOk() {
callBack(true);
},
onCancel() {
callBack(false);
},
});
};
return ( return (
<> <>
<Helmet titleTemplate="%s - 运维平台" defaultTitle="运维平台"> <Helmet titleTemplate="%s - 运维平台" defaultTitle="运维平台">
<meta name="description" content="运维平台" /> <meta name="description" content="运维平台" />
</Helmet> </Helmet>
<Router basename={BASENAME}> <Router basename={BASENAME} getUserConfirmation={getConfirmation}>
<Authozed <Authozed
noMatch={ noMatch={
<UserLayout> <UserLayout>
......
...@@ -13,8 +13,18 @@ import { ...@@ -13,8 +13,18 @@ import {
message, message,
} from 'antd'; } from 'antd';
import { get, CITY_SERVICE, PUBLISH_SERVICE } from '@/services'; import { get, CITY_SERVICE, PUBLISH_SERVICE } from '@/services';
import { GetKeyValue, EditKeyValue, DeleteKeyValue, AddKeyValue } from '@/services/dataCenter/api' import {
import { EditTwoTone, DeleteOutlined, PlusSquareOutlined, SyncOutlined } from '@ant-design/icons'; GetKeyValue,
EditKeyValue,
DeleteKeyValue,
AddKeyValue,
} from '@/services/dataCenter/api';
import {
EditTwoTone,
DeleteOutlined,
PlusSquareOutlined,
SyncOutlined,
} from '@ant-design/icons';
import styles from './AppDic.less'; import styles from './AppDic.less';
const AppDic = () => { const AppDic = () => {
...@@ -127,10 +137,9 @@ const AppDic = () => { ...@@ -127,10 +137,9 @@ const AppDic = () => {
// setLoading(false); // setLoading(false);
// message.error(err); // message.error(err);
// }); // });
GetKeyValue({}).then( GetKeyValue({}).then(resnew => {
resnew => {
if (resnew.code == 0) { if (resnew.code == 0) {
let res = resnew.data let res = resnew.data;
if (res.length > 0) { if (res.length > 0) {
res.map(item => { res.map(item => {
item.key = item.id; item.key = item.id;
...@@ -145,8 +154,7 @@ const AppDic = () => { ...@@ -145,8 +154,7 @@ const AppDic = () => {
}); });
} }
setLoading(false); setLoading(false);
} });
)
}; };
// 提交-添加 // 提交-添加
const submitAdd = () => { const submitAdd = () => {
...@@ -185,8 +193,7 @@ const AppDic = () => { ...@@ -185,8 +193,7 @@ const AppDic = () => {
key, key,
value, value,
desc: description, desc: description,
}).then( }).then(res => {
res => {
if (res.code == 0) { if (res.code == 0) {
setAddVisible(false); setAddVisible(false);
getData(); getData();
...@@ -199,10 +206,7 @@ const AppDic = () => { ...@@ -199,10 +206,7 @@ const AppDic = () => {
description: res.msg, description: res.msg,
}); });
} }
} });
)
} else { } else {
notification.error({ notification.error({
message: '提交失败', message: '提交失败',
...@@ -212,8 +216,7 @@ const AppDic = () => { ...@@ -212,8 +216,7 @@ const AppDic = () => {
}; };
// 提交-重置 // 提交-重置
const submitReset = () => { const submitReset = () => {
get(`${PUBLISH_SERVICE}/DataManger/ResetKeyValue`, { get(`${PUBLISH_SERVICE}/DataManger/ResetKeyValue`, {})
})
.then(res => { .then(res => {
if (res.code === 0) { if (res.code === 0) {
getData(); getData();
...@@ -230,7 +233,6 @@ const AppDic = () => { ...@@ -230,7 +233,6 @@ const AppDic = () => {
.catch(err => { .catch(err => {
message.error(err); message.error(err);
}); });
}; };
// 提交-编辑 // 提交-编辑
const submitEdit = () => { const submitEdit = () => {
...@@ -271,8 +273,7 @@ const AppDic = () => { ...@@ -271,8 +273,7 @@ const AppDic = () => {
key, key,
value, value,
desc: description, desc: description,
}).then( }).then(res => {
res => {
if (res.code == 0) { if (res.code == 0) {
setEditVisible(false); setEditVisible(false);
getData(); getData();
...@@ -285,8 +286,7 @@ const AppDic = () => { ...@@ -285,8 +286,7 @@ const AppDic = () => {
description: res.msg, description: res.msg,
}); });
} }
} });
)
} else { } else {
notification.error({ notification.error({
message: '提交失败', message: '提交失败',
...@@ -320,8 +320,7 @@ const AppDic = () => { ...@@ -320,8 +320,7 @@ const AppDic = () => {
DeleteKeyValue({ DeleteKeyValue({
key: select.Key, key: select.Key,
}).then( }).then(res => {
res => {
if (res.code === 0) { if (res.code === 0) {
getData(select.parentID); getData(select.parentID);
notification.success({ notification.success({
...@@ -333,8 +332,7 @@ const AppDic = () => { ...@@ -333,8 +332,7 @@ const AppDic = () => {
description: res.msg, description: res.msg,
}); });
} }
} });
)
}; };
const pagination = { const pagination = {
...@@ -343,7 +341,7 @@ const AppDic = () => { ...@@ -343,7 +341,7 @@ const AppDic = () => {
defaultPageSize: 20, defaultPageSize: 20,
showQuickJumper: true, showQuickJumper: true,
showSizeChanger: true, showSizeChanger: true,
} };
return ( return (
<div className={styles.AppDic}> <div className={styles.AppDic}>
<Spin spinning={loading} tip="loading..."> <Spin spinning={loading} tip="loading...">
...@@ -352,11 +350,11 @@ const AppDic = () => { ...@@ -352,11 +350,11 @@ const AppDic = () => {
marginBottom: '10px', marginBottom: '10px',
fontSize: '16px', fontSize: '16px',
height: 'calc(100vh-200px)', height: 'calc(100vh-200px)',
display:'flex', display: 'flex',
alignItems:'center' alignItems: 'center',
}} }}
> >
<span >数据字典</span> <span>数据字典</span>
<Tooltip title="添加"> <Tooltip title="添加">
<PlusSquareOutlined <PlusSquareOutlined
onClick={() => { onClick={() => {
...@@ -367,7 +365,7 @@ const AppDic = () => { ...@@ -367,7 +365,7 @@ const AppDic = () => {
color: '#1890FF', color: '#1890FF',
fontSize: '20px', fontSize: '20px',
marginRight: '22px', marginRight: '22px',
marginLeft: '90%' marginLeft: '90%',
}} }}
/> />
</Tooltip> </Tooltip>
...@@ -385,7 +383,7 @@ const AppDic = () => { ...@@ -385,7 +383,7 @@ const AppDic = () => {
fontSize: '20px', fontSize: '20px',
verticalAlign: 'text-bottom', verticalAlign: 'text-bottom',
marginRight: '30px', marginRight: '30px',
float: 'right' float: 'right',
}} }}
/> />
</Tooltip> </Tooltip>
......
...@@ -28,7 +28,6 @@ const dictionary1 = () => { ...@@ -28,7 +28,6 @@ const dictionary1 = () => {
</Tabs> </Tabs>
</Card> </Card>
</PageContainer> </PageContainer>
); );
}; };
......
...@@ -9,6 +9,7 @@ import { ...@@ -9,6 +9,7 @@ import {
notification, notification,
Spin, Spin,
} from 'antd'; } from 'antd';
import copy from 'copy-to-clipboard';
import PageContainer from '@/components/BasePageContainer'; import PageContainer from '@/components/BasePageContainer';
import styles from './ManagementDataBase.less'; import styles from './ManagementDataBase.less';
import { import {
...@@ -177,6 +178,22 @@ const ManagementDataBase = () => { ...@@ -177,6 +178,22 @@ const ManagementDataBase = () => {
// setContent(text); // setContent(text);
setContent(arr); setContent(arr);
}; };
// 复制SQL
const copySql = text => {
if (copy(text)) {
notification.success({
message: '提示',
duration: 3,
description: '复制成功',
});
} else {
notification.error({
message: '提示',
duration: 3,
description: '复制失败',
});
}
};
const autoCheckColumns = [ const autoCheckColumns = [
{ {
title: '表名称', title: '表名称',
...@@ -212,6 +229,16 @@ const ManagementDataBase = () => { ...@@ -212,6 +229,16 @@ const ManagementDataBase = () => {
key: 'Message', key: 'Message',
ellipsis: true, ellipsis: true,
}, },
{
title: 'SQL语句',
dataIndex: 'DiffSql',
key: 'DiffSql',
render: text => (
<Button size="small" type="primary" onClick={() => copySql(text)}>
复制SQL
</Button>
),
},
]; ];
const logColumns = [ const logColumns = [
{ {
......
...@@ -27,7 +27,7 @@ const LoginLog = () => { ...@@ -27,7 +27,7 @@ const LoginLog = () => {
const [endTime, setEndTime] = useState( const [endTime, setEndTime] = useState(
moment(new Date(), 'YYYY-MM-DD HH:mm:ss'), // 默认值当前时间 moment(new Date(), 'YYYY-MM-DD HH:mm:ss'), // 默认值当前时间
); );
const [filteredValue,setFilteredValue] =useState([]) const [filteredValue, setFilteredValue] = useState([]);
const columns = [ const columns = [
// { // {
...@@ -47,7 +47,7 @@ const LoginLog = () => { ...@@ -47,7 +47,7 @@ const LoginLog = () => {
key: 'LoginName', key: 'LoginName',
filters: LoginNameFilters, filters: LoginNameFilters,
onFilter: (value, record) => record.LoginName === value, onFilter: (value, record) => record.LoginName === value,
filteredValue filteredValue,
}, },
{ {
title: '用户名', title: '用户名',
...@@ -55,7 +55,7 @@ const LoginLog = () => { ...@@ -55,7 +55,7 @@ const LoginLog = () => {
key: 'ShowName', key: 'ShowName',
filters: ShowNameFilters, filters: ShowNameFilters,
onFilter: (value, record) => record.ShowName === value, onFilter: (value, record) => record.ShowName === value,
filteredValue filteredValue,
}, },
{ {
title: '系统类型', title: '系统类型',
...@@ -63,7 +63,7 @@ const LoginLog = () => { ...@@ -63,7 +63,7 @@ const LoginLog = () => {
key: 'SystemType', key: 'SystemType',
filters: SystemTypeFilters, filters: SystemTypeFilters,
onFilter: (value, record) => record.SystemType === value, onFilter: (value, record) => record.SystemType === value,
filteredValue filteredValue,
}, },
// { // {
// title: '终端', // title: '终端',
...@@ -133,14 +133,14 @@ const LoginLog = () => { ...@@ -133,14 +133,14 @@ const LoginLog = () => {
), ),
); );
}; };
const handleReset = () =>{ const handleReset = () => {
setStartTime(moment().startOf('week')) setStartTime(moment().startOf('week'));
setFilteredValue([]) setFilteredValue([]);
} };
const onChangeInput =(filters) =>{ const onChangeInput = filters => {
console.log('filters',filters); console.log('filters', filters);
setFilteredValue(filters.LoginName,filters.ShowName,filters.SystemType) setFilteredValue(filters.LoginName, filters.ShowName, filters.SystemType);
} };
return ( return (
<> <>
<div className={styles.loginLog}> <div className={styles.loginLog}>
...@@ -171,7 +171,15 @@ const LoginLog = () => { ...@@ -171,7 +171,15 @@ const LoginLog = () => {
<Button onClick={() => setTime(24 * 7)}>1</Button> <Button onClick={() => setTime(24 * 7)}>1</Button>
<Button onClick={() => setTime(14 * 24)}>2</Button> <Button onClick={() => setTime(14 * 24)}>2</Button>
<Button onClick={() => setTime(30 * 24)}>1</Button> <Button onClick={() => setTime(30 * 24)}>1</Button>
<Button icon={<SyncOutlined className={styles.icon}/>} onClick={handleReset} style={{ marginLeft: '25px', verticalAlign:'middle', marginTop:'-3px' }}> <Button
icon={<SyncOutlined className={styles.icon} />}
onClick={handleReset}
style={{
marginLeft: '25px',
verticalAlign: 'middle',
marginTop: '-3px',
}}
>
重置 重置
</Button> </Button>
</Col> </Col>
......
...@@ -13,7 +13,7 @@ import { ...@@ -13,7 +13,7 @@ import {
} from 'antd'; } from 'antd';
import { SwapRightOutlined, SyncOutlined } from '@ant-design/icons'; import { SwapRightOutlined, SyncOutlined } from '@ant-design/icons';
import moment from 'moment'; import moment from 'moment';
import { get,PUBLISH_SERVICE } from '@/services/index'; import { get, PUBLISH_SERVICE } from '@/services/index';
import styles from './index.less'; import styles from './index.less';
const OmsLog = () => { const OmsLog = () => {
...@@ -23,7 +23,7 @@ const OmsLog = () => { ...@@ -23,7 +23,7 @@ const OmsLog = () => {
const [functionName, setFunctionName] = useState(''); // 接口名称筛选 const [functionName, setFunctionName] = useState(''); // 接口名称筛选
const [label, setLabel] = useState(''); // 标签筛选 const [label, setLabel] = useState(''); // 标签筛选
const [startTime, setStartTime] = useState(moment().startOf('week')); // 默认值当天0点 const [startTime, setStartTime] = useState(moment().startOf('week')); // 默认值当天0点
const [filteredValue,setFilteredValue] =useState([]) const [filteredValue, setFilteredValue] = useState([]);
const [endTime, setEndTime] = useState( const [endTime, setEndTime] = useState(
moment(new Date(), 'YYYY-MM-DD HH:mm:ss'), // 默认值当前时间 moment(new Date(), 'YYYY-MM-DD HH:mm:ss'), // 默认值当前时间
); );
...@@ -105,10 +105,10 @@ const OmsLog = () => { ...@@ -105,10 +105,10 @@ const OmsLog = () => {
function: functionName, function: functionName,
label, label,
PageIndex: 1, PageIndex: 1,
PageSize: 1000 PageSize: 1000,
}) })
.then(res => { .then(res => {
if (res.code===0) { if (res.code === 0) {
// setData(res.root.filter(item => item.label!=="ServiceInput"&&item.label!=="ServiceReturn")); // setData(res.root.filter(item => item.label!=="ServiceInput"&&item.label!=="ServiceReturn"));
if (!res.data) { if (!res.data) {
setData([]); setData([]);
...@@ -120,13 +120,12 @@ const OmsLog = () => { ...@@ -120,13 +120,12 @@ const OmsLog = () => {
return item; return item;
}), }),
); );
console.log(result) console.log(result);
// 过滤优先级 // 过滤优先级
let arr1 = result.map(item => item.Level); let arr1 = result.map(item => item.Level);
arr1 = arr1.filter((value, index) => arr1.indexOf(value) === index); arr1 = arr1.filter((value, index) => arr1.indexOf(value) === index);
setLevelFilters(arr1.map(item => ({ text: item, value: item }))); setLevelFilters(arr1.map(item => ({ text: item, value: item })));
} }
} else { } else {
notification.error({ notification.error({
message: '数据获取失败', message: '数据获取失败',
...@@ -157,17 +156,17 @@ const OmsLog = () => { ...@@ -157,17 +156,17 @@ const OmsLog = () => {
), ),
); );
}; };
const handleReset =() =>{ const handleReset = () => {
setStartTime(moment().startOf('week')) setStartTime(moment().startOf('week'));
setEndTime(moment(new Date(), 'YYYY-MM-DD HH:mm:ss')) setEndTime(moment(new Date(), 'YYYY-MM-DD HH:mm:ss'));
setFunctionName('') setFunctionName('');
setFilteredValue([]) setFilteredValue([]);
setLabel('') setLabel('');
} };
const onChangeInput =(filters)=>{ const onChangeInput = filters => {
console.log('filters',filters); console.log('filters', filters);
setFilteredValue(filters.Level) setFilteredValue(filters.Level);
} };
return ( return (
<> <>
<div className={styles.omsLog}> <div className={styles.omsLog}>
...@@ -218,12 +217,20 @@ const OmsLog = () => { ...@@ -218,12 +217,20 @@ const OmsLog = () => {
/> />
<Button <Button
type="primary" type="primary"
style={{ marginLeft: '10px'}} style={{ marginLeft: '10px' }}
onClick={getData} onClick={getData}
> >
查询 查询
</Button> </Button>
<Button icon={<SyncOutlined className={styles.icon}/>} onClick={handleReset} style={{ marginLeft: '25px', verticalAlign:'middle', marginTop:'-3px' }}> <Button
icon={<SyncOutlined className={styles.icon} />}
onClick={handleReset}
style={{
marginLeft: '25px',
verticalAlign: 'middle',
marginTop: '-3px',
}}
>
重置 重置
</Button> </Button>
</Col> </Col>
......
...@@ -251,7 +251,7 @@ const ServiceLog = () => { ...@@ -251,7 +251,7 @@ const ServiceLog = () => {
setStartTime(moment().startOf('week')); setStartTime(moment().startOf('week'));
setEndTime(moment(new Date(), 'YYYY-MM-DD HH:mm:ss')); setEndTime(moment(new Date(), 'YYYY-MM-DD HH:mm:ss'));
setSearchWord(''); setSearchWord('');
} };
return ( return (
<> <>
<div className={styles.serviceLog}> <div className={styles.serviceLog}>
...@@ -282,7 +282,12 @@ const ServiceLog = () => { ...@@ -282,7 +282,12 @@ const ServiceLog = () => {
<Button onClick={() => setTime(24 * 60, '3')}>1</Button> <Button onClick={() => setTime(24 * 60, '3')}>1</Button>
<Button onClick={() => setTime(24 * 7 * 60, '4')}>1</Button> <Button onClick={() => setTime(24 * 7 * 60, '4')}>1</Button>
<span style={{ marginLeft: '20px' }}>返回状态:</span> <span style={{ marginLeft: '20px' }}>返回状态:</span>
<Select defaultValue='全部' value={logType} onChange={changeStatus} className={styles.sel}> <Select
defaultValue="全部"
value={logType}
onChange={changeStatus}
className={styles.sel}
>
<Option value="9999">全部</Option> <Option value="9999">全部</Option>
<Option value="0">正常</Option> <Option value="0">正常</Option>
<Option value="-1">异常</Option> <Option value="-1">异常</Option>
...@@ -298,7 +303,15 @@ const ServiceLog = () => { ...@@ -298,7 +303,15 @@ const ServiceLog = () => {
enterButton enterButton
value={searchWord} value={searchWord}
/> />
<Button icon={<SyncOutlined className={styles.icon}/>} onClick={handleReset} style={{ marginLeft: '25px', verticalAlign:'middle', marginTop:'-3px' }}> <Button
icon={<SyncOutlined className={styles.icon} />}
onClick={handleReset}
style={{
marginLeft: '25px',
verticalAlign: 'middle',
marginTop: '-3px',
}}
>
重置 重置
</Button> </Button>
</Col> </Col>
...@@ -306,7 +319,9 @@ const ServiceLog = () => { ...@@ -306,7 +319,9 @@ const ServiceLog = () => {
<Spin spinning={loading} tip="loading"> <Spin spinning={loading} tip="loading">
<Row style={{ background: 'white' }}> <Row style={{ background: 'white' }}>
<Col span={8} style={{ paddingTop: '8px', paddingLeft: '5px' }}> <Col span={8} style={{ paddingTop: '8px', paddingLeft: '5px' }}>
<span style={{ fontSize: '14px', fontWeight: '600' }}>访问量统计</span> <span style={{ fontSize: '14px', fontWeight: '600' }}>
访问量统计
</span>
<span style={{ paddingLeft: '60%' }}>间隔:</span> <span style={{ paddingLeft: '60%' }}>间隔:</span>
<Select <Select
defaultValue="每小时" defaultValue="每小时"
...@@ -322,10 +337,14 @@ const ServiceLog = () => { ...@@ -322,10 +337,14 @@ const ServiceLog = () => {
</Select> </Select>
</Col> </Col>
<Col span={7} offset={1} style={{ paddingTop: '8px' }}> <Col span={7} offset={1} style={{ paddingTop: '8px' }}>
<span style={{ fontSize: '14px', fontWeight: '600' }}>接口调用频次统计</span> <span style={{ fontSize: '14px', fontWeight: '600' }}>
接口调用频次统计
</span>
</Col> </Col>
<Col span={7} offset={1} style={{ paddingTop: '8px' }}> <Col span={7} offset={1} style={{ paddingTop: '8px' }}>
<span style={{ fontSize: '14px', fontWeight: '600' }}>接口平均耗时统计</span> <span style={{ fontSize: '14px', fontWeight: '600' }}>
接口平均耗时统计
</span>
</Col> </Col>
</Row> </Row>
<Row className={styles.chart}> <Row className={styles.chart}>
...@@ -339,10 +358,15 @@ const ServiceLog = () => { ...@@ -339,10 +358,15 @@ const ServiceLog = () => {
renderer="svg" renderer="svg"
scale={{ scale={{
Count: { alias: '计数' }, Count: { alias: '计数' },
StartTime: { alias: '访问开始时间'} StartTime: { alias: '访问开始时间' },
}} }}
> >
<Axis name="StartTime" label="" title={{ offset: 20 }} className={styles.fontColor} /> <Axis
name="StartTime"
label=""
title={{ offset: 20 }}
className={styles.fontColor}
/>
<Axis name="Count" title /> <Axis name="Count" title />
<Line shape="smooth" position="StartTime*Count" /> <Line shape="smooth" position="StartTime*Count" />
<Tooltip shared lock /> <Tooltip shared lock />
...@@ -361,7 +385,12 @@ const ServiceLog = () => { ...@@ -361,7 +385,12 @@ const ServiceLog = () => {
Path: { alias: '接口调用频次' }, Path: { alias: '接口调用频次' },
}} }}
> >
<Axis name="Path" label="" title={{ offset: 20 }} className={styles.fontColor}/> <Axis
name="Path"
label=""
title={{ offset: 20 }}
className={styles.fontColor}
/>
<Axis name="Count" title /> <Axis name="Count" title />
<Interval position="Path*Count" /> <Interval position="Path*Count" />
<Tooltip shared lock /> <Tooltip shared lock />
......
...@@ -9,7 +9,7 @@ import PicturesWall from '@/components/Upload/index'; ...@@ -9,7 +9,7 @@ import PicturesWall from '@/components/Upload/index';
const { Item } = Form; const { Item } = Form;
const { Option } = Select; const { Option } = Select;
const AddConfig = props => { const AddConfig = props => {
const { miniTitle, submitCallback, subType, addCallback } = props; const { miniTitle, submitCallback, subType, addCallback, singleList } = props;
console.log(subType, 'ubType'); console.log(subType, 'ubType');
const [config, setConfig] = useState(''); // 网站配置信息 const [config, setConfig] = useState(''); // 网站配置信息
const [loginList, setLoginList] = useState([ const [loginList, setLoginList] = useState([
...@@ -40,6 +40,19 @@ const AddConfig = props => { ...@@ -40,6 +40,19 @@ const AddConfig = props => {
const submit = value => { const submit = value => {
form.validateFields().then(valid => { form.validateFields().then(valid => {
if (valid) { if (valid) {
if (
singleList.some(
item =>
item.text === valid.title || item.id.slice(6) === valid.client,
)
) {
notification.error({
message: '提示',
duration: 3,
description: '应用名称跟类别不能重复',
});
return;
}
setLoading(true); setLoading(true);
const obj = { ...form.getFieldsValue() }; const obj = { ...form.getFieldsValue() };
let params = { ...obj, mode: 'single' }; let params = { ...obj, mode: 'single' };
......
...@@ -262,7 +262,11 @@ const MobileConfigPage = props => { ...@@ -262,7 +262,11 @@ const MobileConfigPage = props => {
}} }}
visible={addVisible} visible={addVisible}
> >
<AddConfig addCallback={addCallback} submitCallback={submitCallback} /> <AddConfig
addCallback={addCallback}
submitCallback={submitCallback}
singleList={singleList}
/>
</Drawer> </Drawer>
</PageContainer> </PageContainer>
); );
......
...@@ -293,7 +293,7 @@ const MiniMenu = props => { ...@@ -293,7 +293,7 @@ const MiniMenu = props => {
// obj.relatedRoleList = String(roleList) || ''; // obj.relatedRoleList = String(roleList) || '';
// } // }
console.log(obj); console.log(obj);
const parentID = item.menuID ? item.menuID : -1; const parentID = item.menuID ? item.menuID : '-1';
addMenu({ addMenu({
_dc: Date.now(), _dc: Date.now(),
parentID, parentID,
...@@ -431,13 +431,13 @@ const MiniMenu = props => { ...@@ -431,13 +431,13 @@ const MiniMenu = props => {
dragMenu({ dragMenu({
menuID: obj.id, menuID: obj.id,
newParentID: obj.parentId || -1, newParentID: obj.parentId.toString() || '-1',
menuList: String(arrList) || '', menuList: String(arrList) || '',
_version: 9999, _version: 9999,
_dc: Date.now(), _dc: Date.now(),
}).then(res => { }).then(res => {
console.log(res); console.log(res);
if (res.success) { if (res.code === 0) {
setFlag(flag + 1); setFlag(flag + 1);
} else { } else {
notification.error({ notification.error({
......
...@@ -5,23 +5,24 @@ ...@@ -5,23 +5,24 @@
* @LastEditTime: 2021-10-11 10:21:35 * @LastEditTime: 2021-10-11 10:21:35
* @LastEditors: leizhe * @LastEditors: leizhe
*/ */
import React, {PureComponent } from "react"; import React, { PureComponent } from 'react';
import DragM from "dragm"; import DragM from 'dragm';
export default class ModalDrag extends PureComponent { export default class ModalDrag extends PureComponent {
updateTransform = transformStr =>{ updateTransform = transformStr => {
this.modalDom.style.transform = transformStr; this.modalDom.style.transform = transformStr;
}; };
componentDidMount(){
this.modalDom = document.getElementsByClassName("ant-modal-wrap")[0] componentDidMount() {
this.modalDom = document.getElementsByClassName('ant-modal-wrap')[0];
} }
render(){
const {title} = this.props; render() {
const { title } = this.props;
return ( return (
<DragM updateTransform={this.updateTransform}> <DragM updateTransform={this.updateTransform}>
<div>{title}</div> <div>{title}</div>
</DragM> </DragM>
) );
} }
} }
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
max-height: 20rem; max-height: 20rem;
overflow-y: scroll; overflow-y: scroll;
.ant-card{ .ant-card{
width: 80%; width: 83%;
margin-left: 4rem; margin-left: 4rem;
} }
.ant-card-head-title{ .ant-card-head-title{
......
...@@ -216,7 +216,7 @@ const TableManager = (props) => { ...@@ -216,7 +216,7 @@ const TableManager = (props) => {
align: 'center' align: 'center'
}, },
{ {
title: '字段数量', title: '附加字段',
dataIndex: 'fieldCount', dataIndex: 'fieldCount',
key: 'fieldCount', key: 'fieldCount',
align: 'center', align: 'center',
...@@ -334,7 +334,7 @@ const TableManager = (props) => { ...@@ -334,7 +334,7 @@ const TableManager = (props) => {
align: 'center', align: 'center',
}, },
{ {
title: '字段数量', title: '附加字段',
dataIndex: 'fieldCount', dataIndex: 'fieldCount',
key: 'fieldCount', key: 'fieldCount',
align: 'center', align: 'center',
......
...@@ -136,8 +136,9 @@ const Flow = () => { ...@@ -136,8 +136,9 @@ const Flow = () => {
dataIndex: 'extendWebPage', dataIndex: 'extendWebPage',
align: 'center', align: 'center',
render: text => ( render: text => (
// eslint-disable-next-line react/no-danger <span style={{ color: text === '(默认)' ? 'grey' : '000000D9' }}>
<span dangerouslySetInnerHTML={{ __html: text }} /> {text}
</span>
), ),
}, },
{ {
...@@ -145,8 +146,9 @@ const Flow = () => { ...@@ -145,8 +146,9 @@ const Flow = () => {
dataIndex: 'extendMobilePage', dataIndex: 'extendMobilePage',
align: 'center', align: 'center',
render: text => ( render: text => (
// eslint-disable-next-line react/no-danger <span style={{ color: text === '(默认)' ? 'grey' : '000000D9' }}>
<span dangerouslySetInnerHTML={{ __html: text }} /> {text}
</span>
), ),
}, },
{ {
...@@ -155,8 +157,9 @@ const Flow = () => { ...@@ -155,8 +157,9 @@ const Flow = () => {
align: 'center', align: 'center',
width: 80, width: 80,
render: text => ( render: text => (
// eslint-disable-next-line react/no-danger <span style={{ color: text === '(无)' ? 'grey' : '000000D9' }}>
<span dangerouslySetInnerHTML={{ __html: text }} /> {text}
</span>
), ),
}, },
{ {
...@@ -164,8 +167,9 @@ const Flow = () => { ...@@ -164,8 +167,9 @@ const Flow = () => {
dataIndex: 'flowEndBehavior', dataIndex: 'flowEndBehavior',
align: 'center', align: 'center',
render: text => ( render: text => (
// eslint-disable-next-line react/no-danger <span style={{ color: text === '(不做处理)' ? 'grey' : '000000D9' }}>
<span dangerouslySetInnerHTML={{ __html: text }} /> {text}
</span>
), ),
}, },
{ {
...@@ -179,8 +183,7 @@ const Flow = () => { ...@@ -179,8 +183,7 @@ const Flow = () => {
dataIndex: 'errorNodes', dataIndex: 'errorNodes',
align: 'center', align: 'center',
render: text => ( render: text => (
// eslint-disable-next-line react/no-danger <span style={{ color: text === '(无)' ? 'grey' : 'red' }}>{text}</span>
<span dangerouslySetInnerHTML={{ __html: text }} />
), ),
}, },
{ {
...@@ -188,8 +191,9 @@ const Flow = () => { ...@@ -188,8 +191,9 @@ const Flow = () => {
dataIndex: 'interfaceConfig', dataIndex: 'interfaceConfig',
align: 'center', align: 'center',
render: text => ( render: text => (
// eslint-disable-next-line react/no-danger <span style={{ color: text === '(无)' ? 'grey' : '000000D9' }}>
<span dangerouslySetInnerHTML={{ __html: text }} /> {text}
</span>
), ),
}, },
{ {
......
...@@ -82,45 +82,30 @@ const Timelimit = props => { ...@@ -82,45 +82,30 @@ const Timelimit = props => {
title: '规则名称', title: '规则名称',
dataIndex: 'Name', dataIndex: 'Name',
align: 'center', align: 'center',
render: text => (
// eslint-disable-next-line react/no-danger
<span dangerouslySetInnerHTML={{ __html: text }} />
),
}, },
{ {
title: '开始节点', title: '开始节点',
dataIndex: 'StartNode', dataIndex: 'StartNode',
align: 'center', align: 'center',
render: text => (
// eslint-disable-next-line react/no-danger
<span dangerouslySetInnerHTML={{ __html: text }} />
),
}, },
{ {
title: '结束节点', title: '结束节点',
dataIndex: 'EndNode', dataIndex: 'EndNode',
align: 'center', align: 'center',
render: text => (
// eslint-disable-next-line react/no-danger
<span dangerouslySetInnerHTML={{ __html: text }} />
),
}, },
{ {
title: '默认时限', title: '默认时限',
dataIndex: 'TimeLimit', dataIndex: 'TimeLimit',
align: 'center', align: 'center',
render: text => (
// eslint-disable-next-line react/no-danger
<span dangerouslySetInnerHTML={{ __html: text }} />
),
}, },
{ {
title: '时限指派字段', title: '时限指派字段',
dataIndex: 'TimeLimitFieldHtml', dataIndex: 'TimeLimitField',
align: 'center', align: 'center',
render: text => ( render: text => (
// eslint-disable-next-line react/no-danger <span style={{ color: text === '(未配置)' ? 'grey' : '#0000009D' }}>
<span dangerouslySetInnerHTML={{ __html: text }} /> {text}
</span>
), ),
}, },
{ {
...@@ -128,8 +113,9 @@ const Timelimit = props => { ...@@ -128,8 +113,9 @@ const Timelimit = props => {
dataIndex: 'TimeoutField', dataIndex: 'TimeoutField',
align: 'center', align: 'center',
render: text => ( render: text => (
// eslint-disable-next-line react/no-danger <span style={{ color: text === '(未配置)' ? 'grey' : '#0000009D' }}>
<span dangerouslySetInnerHTML={{ __html: text }} /> {text}
</span>
), ),
}, },
{ {
......
...@@ -230,8 +230,7 @@ const AddModal = props => { ...@@ -230,8 +230,7 @@ const AddModal = props => {
<Select> <Select>
{timeLimitFlowNodes.map(item => ( {timeLimitFlowNodes.map(item => (
<Option value={item.Name} key={item.ID}> <Option value={item.Name} key={item.ID}>
{/* eslint-disable-next-line react/no-danger */} <span>{item.Name}</span>
<span dangerouslySetInnerHTML={{ __html: item.Name }} />
</Option> </Option>
))} ))}
</Select> </Select>
...@@ -244,8 +243,7 @@ const AddModal = props => { ...@@ -244,8 +243,7 @@ const AddModal = props => {
<Select> <Select>
{timeLimitFlowNodes.map(item => ( {timeLimitFlowNodes.map(item => (
<Option value={item.Name} key={item.ID}> <Option value={item.Name} key={item.ID}>
{/* eslint-disable-next-line react/no-danger */} <span>{item.Name}</span>
<span dangerouslySetInnerHTML={{ __html: item.Name }} />
</Option> </Option>
))} ))}
</Select> </Select>
......
...@@ -93,6 +93,17 @@ const FlowNode = () => { ...@@ -93,6 +93,17 @@ const FlowNode = () => {
} }
setExpandedRowKeys(data); setExpandedRowKeys(data);
}; };
// 表格内文案样式
const textStyleOne = (text, record) => {
if (record.colorType === 2) {
return 'red';
}
if (text === '(未配置)') {
return 'grey';
}
return '000000D9';
};
// 定义展开的表格 // 定义展开的表格
const createUnfoldTable = itemTable => { const createUnfoldTable = itemTable => {
const columns = [ const columns = [
...@@ -101,12 +112,15 @@ const FlowNode = () => { ...@@ -101,12 +112,15 @@ const FlowNode = () => {
dataIndex: 'name', dataIndex: 'name',
width: 149, width: 149,
align: 'left', align: 'left',
render: text => ( render: (text, record) => (
<div <div
style={{ paddingLeft: 60 }} style={{
// eslint-disable-next-line react/no-danger paddingLeft: 60,
dangerouslySetInnerHTML={{ __html: text }} color: record.colorType === 2 ? 'red' : '#000000D9',
/> }}
>
{text}
</div>
), ),
}, },
{ {
...@@ -114,19 +128,15 @@ const FlowNode = () => { ...@@ -114,19 +128,15 @@ const FlowNode = () => {
dataIndex: 'aliasName', dataIndex: 'aliasName',
align: 'center', align: 'center',
width: 80, width: 80,
render: text => ( render: text => <span>{text}</span>,
// eslint-disable-next-line react/no-danger
<span dangerouslySetInnerHTML={{ __html: text }} />
),
}, },
{ {
title: '移交方式', title: '移交方式',
dataIndex: 'extendHandover', dataIndex: 'extendHandover',
align: 'center', align: 'center',
width: 80, width: 80,
render: text => ( render: (text, record) => (
// eslint-disable-next-line react/no-danger <span style={{ color: textStyleOne(text, record) }}>{text}</span>
<span dangerouslySetInnerHTML={{ __html: text }} />
), ),
}, },
{ {
...@@ -134,9 +144,8 @@ const FlowNode = () => { ...@@ -134,9 +144,8 @@ const FlowNode = () => {
dataIndex: 'extendNodeType', dataIndex: 'extendNodeType',
align: 'center', align: 'center',
width: 80, width: 80,
render: text => ( render: (text, record) => (
// eslint-disable-next-line react/no-danger <span style={{ color: textStyleOne(text, record) }}>{text}</span>
<span dangerouslySetInnerHTML={{ __html: text }} />
), ),
}, },
{ {
...@@ -147,10 +156,9 @@ const FlowNode = () => { ...@@ -147,10 +156,9 @@ const FlowNode = () => {
ellipsis: { ellipsis: {
showTitle: true, showTitle: true,
}, },
render: text => ( render: (text, record) => (
<Tooltip placement="topLeft" title={text}> <Tooltip placement="topLeft" title={text}>
{/* eslint-disable-next-line react/no-danger */} <span style={{ color: textStyleOne(text, record) }}>{text}</span>
<span dangerouslySetInnerHTML={{ __html: text }} />
</Tooltip> </Tooltip>
), ),
}, },
...@@ -159,15 +167,21 @@ const FlowNode = () => { ...@@ -159,15 +167,21 @@ const FlowNode = () => {
dataIndex: 'extendSeeFields', dataIndex: 'extendSeeFields',
align: 'center', align: 'center',
width: 80, width: 80,
render: (text, record) => (
<span style={{ color: record.colorType === 2 ? 'red' : '#000000D9' }}>
{text}
</span>
),
}, },
{ {
title: '字段', title: '字段',
dataIndex: 'extendFields', dataIndex: 'extendFields',
align: 'center', align: 'center',
width: 80, width: 80,
render: text => ( render: (text, record) => (
// eslint-disable-next-line react/no-danger <span style={{ color: record.colorType === 2 ? 'red' : '#000000D9' }}>
<span dangerouslySetInnerHTML={{ __html: text }} /> {text}
</span>
), ),
}, },
...@@ -176,9 +190,10 @@ const FlowNode = () => { ...@@ -176,9 +190,10 @@ const FlowNode = () => {
dataIndex: 'extendEditableLater', dataIndex: 'extendEditableLater',
align: 'center', align: 'center',
width: 80, width: 80,
render: text => ( render: (text, record) => (
// eslint-disable-next-line react/no-danger <span style={{ color: record.colorType === 2 ? 'red' : '#000000D9' }}>
<span dangerouslySetInnerHTML={{ __html: text }} /> {text}
</span>
), ),
}, },
{ {
...@@ -186,9 +201,10 @@ const FlowNode = () => { ...@@ -186,9 +201,10 @@ const FlowNode = () => {
dataIndex: 'extendRollbackable', dataIndex: 'extendRollbackable',
align: 'center', align: 'center',
width: 80, width: 80,
render: text => ( render: (text, record) => (
// eslint-disable-next-line react/no-danger <span style={{ color: record.colorType === 2 ? 'red' : '#000000D9' }}>
<span dangerouslySetInnerHTML={{ __html: text }} /> {text}
</span>
), ),
}, },
{ {
...@@ -196,9 +212,10 @@ const FlowNode = () => { ...@@ -196,9 +212,10 @@ const FlowNode = () => {
dataIndex: 'extendRollbackNode', dataIndex: 'extendRollbackNode',
align: 'center', align: 'center',
width: 80, width: 80,
render: text => ( render: (text, record) => (
// eslint-disable-next-line react/no-danger <span style={{ color: record.colorType === 2 ? 'red' : '#000000D9' }}>
<span dangerouslySetInnerHTML={{ __html: text }} /> {text}
</span>
), ),
}, },
{ {
...@@ -206,9 +223,10 @@ const FlowNode = () => { ...@@ -206,9 +223,10 @@ const FlowNode = () => {
dataIndex: 'tranferable', dataIndex: 'tranferable',
align: 'center', align: 'center',
width: 80, width: 80,
render: text => ( render: (text, record) => (
// eslint-disable-next-line react/no-danger <span style={{ color: record.colorType === 2 ? 'red' : '#000000D9' }}>
<span dangerouslySetInnerHTML={{ __html: text }} /> {text}
</span>
), ),
}, },
{ {
...@@ -216,9 +234,10 @@ const FlowNode = () => { ...@@ -216,9 +234,10 @@ const FlowNode = () => {
dataIndex: 'eventInformation', dataIndex: 'eventInformation',
align: 'center', align: 'center',
width: 80, width: 80,
render: text => ( render: (text, record) => (
// eslint-disable-next-line react/no-danger <span style={{ color: record.colorType === 2 ? 'red' : '#000000D9' }}>
<span dangerouslySetInnerHTML={{ __html: text }} /> {text}
</span>
), ),
}, },
{ {
......
...@@ -28,8 +28,11 @@ ...@@ -28,8 +28,11 @@
// 编辑节点表单 // 编辑节点表单
.formData { .formData {
height: 32rem; height: calc(100vh - 162px);
overflow-y: scroll; overflow-y: scroll;
.ant-radio-wrapper {
min-width: 130px;
}
.filedListItem { .filedListItem {
display: flex; display: flex;
flex-wrap: nowrap; flex-wrap: nowrap;
......
...@@ -85,55 +85,67 @@ const AuxiliaryView = props => { ...@@ -85,55 +85,67 @@ const AuxiliaryView = props => {
title: '前端便签', title: '前端便签',
dataIndex: 'WebLabel', dataIndex: 'WebLabel',
align: 'center', align: 'center',
render: text => ( render: text => {
// eslint-disable-next-line react/no-danger if (text === '(未配置)' || text === '(无)') {
<span dangerouslySetInnerHTML={{ __html: text }} /> return <span style={{ color: 'grey' }}>{text}</span>;
), }
return <span>{text}</span>;
},
}, },
{ {
title: '前端视图', title: '前端视图',
dataIndex: 'WebPage', dataIndex: 'WebPage',
align: 'center', align: 'center',
render: text => ( render: text => {
// eslint-disable-next-line react/no-danger if (text === '(未配置)' || text === '(无)') {
<span dangerouslySetInnerHTML={{ __html: text }} /> return <span style={{ color: 'grey' }}>{text}</span>;
), }
return <span>{text}</span>;
},
}, },
{ {
title: '前端参数', title: '前端参数',
dataIndex: 'WebParam', dataIndex: 'WebParam',
align: 'center', align: 'center',
render: text => ( render: text => {
// eslint-disable-next-line react/no-danger if (text === '(未配置)' || text === '(无)') {
<span dangerouslySetInnerHTML={{ __html: text }} /> return <span style={{ color: 'grey' }}>{text}</span>;
), }
return <span>{text}</span>;
},
}, },
{ {
title: '手持标签', title: '手持标签',
dataIndex: 'MobileLabel', dataIndex: 'MobileLabel',
align: 'center', align: 'center',
render: text => ( render: text => {
// eslint-disable-next-line react/no-danger if (text === '(未配置)' || text === '(无)') {
<span dangerouslySetInnerHTML={{ __html: text }} /> return <span style={{ color: 'grey' }}>{text}</span>;
), }
return <span>{text}</span>;
},
}, },
{ {
title: '手持视图', title: '手持视图',
dataIndex: 'MobilePage', dataIndex: 'MobilePage',
align: 'center', align: 'center',
render: text => ( render: text => {
// eslint-disable-next-line react/no-danger if (text === '(未配置)' || text === '(无)') {
<span dangerouslySetInnerHTML={{ __html: text }} /> return <span style={{ color: 'grey' }}>{text}</span>;
), }
return <span>{text}</span>;
},
}, },
{ {
title: '手持参数', title: '手持参数',
dataIndex: 'MobileParam', dataIndex: 'MobileParam',
align: 'center', align: 'center',
render: text => ( render: text => {
// eslint-disable-next-line react/no-danger if (text === '(未配置)' || text === '(无)') {
<span dangerouslySetInnerHTML={{ __html: text }} /> return <span style={{ color: 'grey' }}>{text}</span>;
), }
return <span>{text}</span>;
},
}, },
{ {
title: '操作', title: '操作',
......
...@@ -10,7 +10,6 @@ import { ...@@ -10,7 +10,6 @@ import {
import { import {
Form, Form,
Modal,
Input, Input,
Radio, Radio,
Select, Select,
...@@ -18,6 +17,8 @@ import { ...@@ -18,6 +17,8 @@ import {
Checkbox, Checkbox,
Button, Button,
message, message,
Drawer,
Space,
} from 'antd'; } from 'antd';
import { PlusOutlined } from '@ant-design/icons'; import { PlusOutlined } from '@ant-design/icons';
import Fieldselection from './nodeEditComponents/Fieldselection'; import Fieldselection from './nodeEditComponents/Fieldselection';
...@@ -99,58 +100,47 @@ const NodeEdit = props => { ...@@ -99,58 +100,47 @@ const NodeEdit = props => {
loadEventFields({ eventTableName: value.TableName }).then(res => { loadEventFields({ eventTableName: value.TableName }).then(res => {
if (res.code === 0) { if (res.code === 0) {
let defaultCheckedList = value[val] ? value[val].split(',') : []; let defaultCheckedList = value[val] ? value[val].split(',') : [];
// 处理数据为树形结构 // 处理树形结构
let keylist = new Set(); let checkList = res.data.map(item => {
let list = new Map(); let plainOptions = [];
res.data.forEach(item => { item.root.forEach(ele => {
keylist.add(item.group); plainOptions = [...plainOptions, ele.fieldName];
if (keylist.has(item.group)) {
let listItem = list.get(item.group);
// 存入check得选项,是否全选,选中的选项'
if (listItem) {
list.set(item.group, {
plainOptions: [...listItem.plainOptions, item.fieldName],
defaultCheckedList: [],
}); });
} else { return {
list.set(item.group, { groupName: item.groupName,
plainOptions: [item.fieldName], plainOptions,
defaultCheckedList: [], defaultCheckedList: [],
};
}); });
}
}
});
let checkList = [...list];
defaultCheckedList.forEach(item => { defaultCheckedList.forEach(item => {
checkList.forEach(element => { checkList.forEach(element => {
// 当前得模块是否有当前字段 // 当前得模块是否有当前字段
let indeterminate = element[1].plainOptions.some( let indeterminate = element.plainOptions.some(
checkName => checkName === item, checkName => checkName === item,
); );
// 处理已选中的字段 // 处理已选中的字段
if (indeterminate) { if (indeterminate) {
element[1].defaultCheckedList.push(item); element.defaultCheckedList.push(item);
} }
if ( if (
element[1].defaultCheckedList.length > 0 && element.defaultCheckedList.length > 0 &&
element[1].defaultCheckedList.length < element.defaultCheckedList.length < element.plainOptions.length
element[1].plainOptions.length
) { ) {
element[1].indeterminate = true; element.indeterminate = true;
} else { } else {
element[1].indeterminate = false; element.indeterminate = false;
} }
// 处理是否全选字段 // 处理是否全选字段
if ( if (
element[1].defaultCheckedList.length === element.defaultCheckedList.length === element.plainOptions.length
element[1].plainOptions.length
) { ) {
element[1].checkAll = true; element.checkAll = true;
} else { } else {
element[1].checkAll = false; element.checkAll = false;
} }
}); });
}); });
console.log(checkList, 'checkList');
setFieldList(checkList); setFieldList(checkList);
setTimeout(() => { setTimeout(() => {
setShowField(true); setShowField(true);
...@@ -215,14 +205,19 @@ const NodeEdit = props => { ...@@ -215,14 +205,19 @@ const NodeEdit = props => {
} }
}; };
return ( return (
<Modal <Drawer
title="流程节点配置" title="流程节点配置"
width="500px"
onClose={handleCancel}
visible={visible} visible={visible}
onOk={onFinish} footer={
width="800px" <Space>
onCancel={handleCancel} <Button onClick={handleCancel}>取消</Button>
maskClosable={false} <Button onClick={onFinish} type="primary">
centered 确定
</Button>
</Space>
}
> >
<Form <Form
form={form} form={form}
...@@ -329,13 +324,13 @@ const NodeEdit = props => { ...@@ -329,13 +324,13 @@ const NodeEdit = props => {
/> />
</div> </div>
</Form.Item> </Form.Item>
<Form.Item label="查看字段(工程模型)"> <Form.Item label="查看字段">
<div className={styles.filedListItem}> <div className={styles.filedListItem}>
<Form.Item <Form.Item
name="SeeFields" name="SeeFields"
style={{ marginBottom: 0, width: '100%' }} style={{ marginBottom: 0, width: '100%' }}
> >
<Input placeholder="请选择查看字段" allowClear /> <Input placeholder="请选择查看字段(工程模型)" allowClear />
</Form.Item> </Form.Item>
<Button <Button
type="dashed" type="dashed"
...@@ -379,7 +374,7 @@ const NodeEdit = props => { ...@@ -379,7 +374,7 @@ const NodeEdit = props => {
fieldList={fieldList} fieldList={fieldList}
onSubumit={val => setFiled(val)} onSubumit={val => setFiled(val)}
/> />
</Modal> </Drawer>
); );
}; };
export default NodeEdit; export default NodeEdit;
...@@ -19,7 +19,7 @@ const Fieldselection = props => { ...@@ -19,7 +19,7 @@ const Fieldselection = props => {
return; return;
} }
checkList.forEach(element => { checkList.forEach(element => {
arr = [...arr, ...element[1].defaultCheckedList]; arr = [...arr, ...element.defaultCheckedList];
}); });
setSelectList(arr); setSelectList(arr);
// 初始化拖拽 // 初始化拖拽
...@@ -35,11 +35,11 @@ const Fieldselection = props => { ...@@ -35,11 +35,11 @@ const Fieldselection = props => {
const onChange = (list, index) => { const onChange = (list, index) => {
setCheckList(value => { setCheckList(value => {
const chooseList = JSON.parse(JSON.stringify(value)); const chooseList = JSON.parse(JSON.stringify(value));
chooseList[index][1].defaultCheckedList = list; chooseList[index].defaultCheckedList = list;
chooseList[index][1].indeterminate = chooseList[index].indeterminate =
!!list.length && list.length < chooseList[index][1].plainOptions.length; !!list.length && list.length < chooseList[index].plainOptions.length;
chooseList[index][1].checkAll = chooseList[index].checkAll =
list.length === chooseList[index][1].plainOptions.length; list.length === chooseList[index].plainOptions.length;
return chooseList; return chooseList;
}); });
}; };
...@@ -47,11 +47,11 @@ const Fieldselection = props => { ...@@ -47,11 +47,11 @@ const Fieldselection = props => {
const onCheckAllChange = (e, index) => { const onCheckAllChange = (e, index) => {
setCheckList(value => { setCheckList(value => {
const chooseList = JSON.parse(JSON.stringify(value)); const chooseList = JSON.parse(JSON.stringify(value));
chooseList[index][1].defaultCheckedList = e.target.checked chooseList[index].defaultCheckedList = e.target.checked
? chooseList[index][1].plainOptions ? chooseList[index].plainOptions
: []; : [];
chooseList[index][1].indeterminate = false; chooseList[index].indeterminate = false;
chooseList[index][1].checkAll = e.target.checked; chooseList[index].checkAll = e.target.checked;
return chooseList; return chooseList;
}); });
}; };
...@@ -98,19 +98,21 @@ const Fieldselection = props => { ...@@ -98,19 +98,21 @@ const Fieldselection = props => {
<div className={styles.cardBox} key={index}> <div className={styles.cardBox} key={index}>
<div className={styles.title}> <div className={styles.title}>
<Divider orientation="left" className={styles.cardDivider}> <Divider orientation="left" className={styles.cardDivider}>
<span style={{ marginRight: '10px' }}>{item[0]}</span> <span style={{ marginRight: '10px' }}>
{item.groupName}
</span>
<Checkbox <Checkbox
indeterminate={item[1].indeterminate} indeterminate={item.indeterminate}
onChange={e => onCheckAllChange(e, index)} onChange={e => onCheckAllChange(e, index)}
checked={item[1].checkAll} checked={item.checkAll}
/> />
</Divider> </Divider>
</div> </div>
<div className={styles.filedList}> <div className={styles.filedList}>
<CheckboxGroup <CheckboxGroup
key={index} key={index}
options={item[1].plainOptions} options={item.plainOptions}
value={item[1].defaultCheckedList} value={item.defaultCheckedList}
onChange={list => onChange(list, index)} onChange={list => onChange(list, index)}
/> />
</div> </div>
......
...@@ -37,6 +37,7 @@ const Workflow = () => { ...@@ -37,6 +37,7 @@ const Workflow = () => {
const [editIndex, setEditIndex] = useState(); // 编辑流程组得索引 const [editIndex, setEditIndex] = useState(); // 编辑流程组得索引
const [treeVisible, setTreeVisible] = useState(true); const [treeVisible, setTreeVisible] = useState(true);
const [chartLoading, setChartLoading] = useState(false); // 流程图的loading const [chartLoading, setChartLoading] = useState(false); // 流程图的loading
const [canSelect, setCanSelect] = useState(true); // 是否可以切换树
const [visible, setVisible] = useState({ const [visible, setVisible] = useState({
FlowModal: false, FlowModal: false,
FlowGroupModal: false, FlowGroupModal: false,
...@@ -129,8 +130,8 @@ const Workflow = () => { ...@@ -129,8 +130,8 @@ const Workflow = () => {
showModal('FlowGroupModal', true); showModal('FlowGroupModal', true);
setModalType('add'); setModalType('add');
}; };
// 点击节点树触发 // 选择节点
const onSelect = (prop, treeNode) => { const chooseNode = (prop, treeNode) => {
if (!treeNode || treeNode.node.children) { if (!treeNode || treeNode.node.children) {
setCurrentSelectId(treeId); setCurrentSelectId(treeId);
return; return;
...@@ -146,6 +147,7 @@ const Workflow = () => { ...@@ -146,6 +147,7 @@ const Workflow = () => {
if (res.code === 0) { if (res.code === 0) {
setFlowData(res.data); setFlowData(res.data);
} else { } else {
setFlowData({ Nodes: [], Lines: [] });
notification.error({ notification.error({
title: '提示', title: '提示',
duration: 3, duration: 3,
...@@ -157,6 +159,27 @@ const Workflow = () => { ...@@ -157,6 +159,27 @@ const Workflow = () => {
setCurrentSelectId(treeId); setCurrentSelectId(treeId);
} }
}; };
// 点击节点树触发
const onSelect = (prop, treeNode) => {
// 如果没有保存弹是否保存弹窗
if (!canSelect) {
confirm({
title: '流程未保存确定要切换吗?',
icon: <ExclamationCircleOutlined />,
content: '',
okText: '是',
okType: 'danger',
cancelText: '否',
onOk() {
setCanSelect(true);
chooseNode(prop, treeNode);
},
onCancel() {},
});
} else {
chooseNode(prop, treeNode);
}
};
// 处理树数据 // 处理树数据
const mapTree = (val, index) => { const mapTree = (val, index) => {
const obj = { ...val }; const obj = { ...val };
...@@ -222,6 +245,10 @@ const Workflow = () => { ...@@ -222,6 +245,10 @@ const Workflow = () => {
// 选中当前选中的节点 // 选中当前选中的节点
onSelect(); onSelect();
}; };
// 数据改变后的回调函数
const leaveCallBack = val => {
setCanSelect(!val);
};
return ( return (
<PageContainer> <PageContainer>
<div className={styles.flowContainer}> <div className={styles.flowContainer}>
...@@ -273,6 +300,7 @@ const Workflow = () => { ...@@ -273,6 +300,7 @@ const Workflow = () => {
flowData={flowData} flowData={flowData}
flowID={currentSelectId} flowID={currentSelectId}
chartLoading={chartLoading} chartLoading={chartLoading}
leaveCallBack={leaveCallBack}
/> />
) : ( ) : (
<Empty <Empty
......
...@@ -3,6 +3,7 @@ import { Button, Modal, notification, Spin } from 'antd'; ...@@ -3,6 +3,7 @@ import { Button, Modal, notification, Spin } from 'antd';
import { SaveNodeChange, GetFlowNode } from '@/services/platform/workflow'; import { SaveNodeChange, GetFlowNode } from '@/services/platform/workflow';
import { ExclamationCircleOutlined } from '@ant-design/icons'; import { ExclamationCircleOutlined } from '@ant-design/icons';
import { Prompt } from 'react-router-dom';
import * as go from 'gojs'; import * as go from 'gojs';
import styles from '../workflow.less'; import styles from '../workflow.less';
import NodeModal from './flowChartComponents/NodeModal'; import NodeModal from './flowChartComponents/NodeModal';
...@@ -10,7 +11,7 @@ import imgUrl from '@/assets/images/icons/closeBlue.png'; ...@@ -10,7 +11,7 @@ import imgUrl from '@/assets/images/icons/closeBlue.png';
const { confirm } = Modal; const { confirm } = Modal;
let diagram = null; let diagram = null;
const FlowChart = props => { const FlowChart = props => {
const { flowData, flowID, chartLoading } = props; const { flowData, flowID, chartLoading, leaveCallBack } = props;
const [visible, setVisible] = useState(false); const [visible, setVisible] = useState(false);
const [editMsg, setEditMsg] = useState({}); // 编辑节点的信息 const [editMsg, setEditMsg] = useState({}); // 编辑节点的信息
const [modalType, setModalType] = useState(''); // 存入弹窗是编辑还是新增 const [modalType, setModalType] = useState(''); // 存入弹窗是编辑还是新增
...@@ -20,10 +21,12 @@ const FlowChart = props => { ...@@ -20,10 +21,12 @@ const FlowChart = props => {
const [deleteLine, setDeleteLine] = useState(); // 删除的线id const [deleteLine, setDeleteLine] = useState(); // 删除的线id
const [deleteNode, setDeleteNode] = useState(); // 删除的节点id const [deleteNode, setDeleteNode] = useState(); // 删除的节点id
const [AddNodes, setAddNodes] = useState([]); // 新增数组 const [AddNodes, setAddNodes] = useState([]); // 新增数组
const [initFlowData, setInitFlowData] = useState({}); // 初始数据,用来比对是否有修改流程图
const [currentFlowData, setCurrentFlowData] = useState({ const [currentFlowData, setCurrentFlowData] = useState({
Nodes: [], Nodes: [],
Lines: [], Lines: [],
}); // 组件内得流程图数据 }); // 组件内得流程图数据
const [showLeaveTip, setShowLeaveTip] = useState(false); // 离开路由是否又提醒
const objGo = go.GraphObject.make; const objGo = go.GraphObject.make;
// 监听删除,给删除数组里添加删除id // 监听删除,给删除数组里添加删除id
useEffect(() => { useEffect(() => {
...@@ -36,6 +39,7 @@ const FlowChart = props => { ...@@ -36,6 +39,7 @@ const FlowChart = props => {
setDeleteNodes([...DeleteNodes, deleteNode]); setDeleteNodes([...DeleteNodes, deleteNode]);
} }
}, [deleteNode]); }, [deleteNode]);
// 初始化
useEffect(() => { useEffect(() => {
// 初始化流程图 // 初始化流程图
init(); init();
...@@ -73,6 +77,7 @@ const FlowChart = props => { ...@@ -73,6 +77,7 @@ const FlowChart = props => {
setDeleteNode(''); setDeleteNode('');
setDeleteLine(''); setDeleteLine('');
setCurrentFlowData(JSON.parse(JSON.stringify(flowData))); setCurrentFlowData(JSON.parse(JSON.stringify(flowData)));
setShowLeaveTip(false);
} }
}, [flowData]); }, [flowData]);
// 存入在树形流程中选择得流程数据 // 存入在树形流程中选择得流程数据
...@@ -81,13 +86,30 @@ const FlowChart = props => { ...@@ -81,13 +86,30 @@ const FlowChart = props => {
if (currentFlowData.Nodes.length === 0) { if (currentFlowData.Nodes.length === 0) {
nodeDataArray = []; nodeDataArray = [];
} else { } else {
nodeDataArray = currentFlowData.Nodes.map(item => { // 处理老数据,让老数据可以正常展示
nodeDataArray = currentFlowData.Nodes.map((item, index) => {
let obj; let obj;
obj = item; obj = item;
obj.key = item.NodeId; obj.key = item.NodeId;
if (obj.points === '') {
if (obj.NodeType === '1') {
obj.points = `${(index * 200).toString()}" 100"`;
} else {
obj.points = `${(index * 200).toString()}" -22"`;
}
}
return obj; return obj;
}); });
} }
// 保存初始数据
setInitFlowData(
JSON.parse(
JSON.stringify({
Nodes: nodeDataArray,
Lines: currentFlowData.Lines,
}),
),
);
diagram.model = go.Model.fromJson({ diagram.model = go.Model.fromJson({
linkFromPortIdProperty: 'fromPort', // 所需信息: linkFromPortIdProperty: 'fromPort', // 所需信息:
linkToPortIdProperty: 'toPort', // 标识数据属性名称 linkToPortIdProperty: 'toPort', // 标识数据属性名称
...@@ -112,6 +134,8 @@ const FlowChart = props => { ...@@ -112,6 +134,8 @@ const FlowChart = props => {
}; };
// 删除节点 // 删除节点
const delNode = () => { const delNode = () => {
setShowLeaveTip(true);
leaveCallBack(true);
diagram.commandHandler.deleteSelection(); diagram.commandHandler.deleteSelection();
}; };
// 流程图初始化 // 流程图初始化
...@@ -303,12 +327,30 @@ const FlowChart = props => { ...@@ -303,12 +327,30 @@ const FlowChart = props => {
nodeData.roleList = roleList; nodeData.roleList = roleList;
diagram.model.updateTargetBindings(nodeData); diagram.model.updateTargetBindings(nodeData);
} }
// 关闭时进行数据比对看数据是否改变
let diagramObj = JSON.parse(diagram.model.toJson());
let stageJson = {
Nodes: diagramObj.nodeDataArray,
Lines: diagramObj.linkDataArray,
};
if (
JSON.stringify(stageJson.Nodes) === JSON.stringify(initFlowData.Nodes)
) {
setShowLeaveTip(false);
leaveCallBack(false);
} else {
leaveCallBack(true);
setShowLeaveTip(true);
}
setVisible(false); setVisible(false);
}; };
// 获取保存后的流程数据 // 获取保存后的流程数据
const getFlowData = () => { const getFlowData = () => {
GetFlowNode({ flowID }).then(res => { GetFlowNode({ flowID }).then(res => {
if (res.code === 0) { if (res.code === 0) {
// 保存后离开不用提醒要修改数据了
setShowLeaveTip(false);
leaveCallBack(false);
setCurrentFlowData(res.data); setCurrentFlowData(res.data);
} else { } else {
notification.error({ notification.error({
...@@ -355,9 +397,15 @@ const FlowChart = props => { ...@@ -355,9 +397,15 @@ const FlowChart = props => {
}; };
return ( return (
<> <>
<Prompt
message="编辑的内容还未保存,确定要离开该页面吗?"
when={showLeaveTip}
/>
<div className={styles.buttonList}> <div className={styles.buttonList}>
<Button onClick={() => addNode()}>添加节点</Button> <Button onClick={() => addNode()}>添加节点</Button>
<Button onClick={() => saveFlow()}>保存</Button> <Button type="primary" onClick={() => saveFlow()}>
保存
</Button>
</div> </div>
<Spin spinning={chartLoading}> <Spin spinning={chartLoading}>
<div <div
......
...@@ -13,7 +13,7 @@ import { ...@@ -13,7 +13,7 @@ import {
Popconfirm, Popconfirm,
message, message,
} from 'antd'; } from 'antd';
import { DeleteOutlined } from '@ant-design/icons'; import { DeleteOutlined, EditTwoTone } from '@ant-design/icons';
import RoalChoose from './nodeModalComponents/RoalChoose'; import RoalChoose from './nodeModalComponents/RoalChoose';
const { Option } = Select; const { Option } = Select;
...@@ -21,6 +21,8 @@ const NodeModal = props => { ...@@ -21,6 +21,8 @@ const NodeModal = props => {
const { onSubumit, handleCancel, visible, modalType, editMsg } = props; const { onSubumit, handleCancel, visible, modalType, editMsg } = props;
const [form] = Form.useForm(); const [form] = Form.useForm();
const [showRoal, setShowRoal] = useState(false); // 是否显示选择角色用户弹窗 const [showRoal, setShowRoal] = useState(false); // 是否显示选择角色用户弹窗
const [isEdit, setIsEdit] = useState(); // 是编辑角色还是添加角色
const [chooseUser, setChooseUser] = useState(); // 当前编辑角色或者机构的默认承办人
const [nodeMsg, setNodeMsg] = useState({ const [nodeMsg, setNodeMsg] = useState({
NodeName: '', NodeName: '',
NodeType: '', NodeType: '',
...@@ -58,8 +60,8 @@ const NodeModal = props => { ...@@ -58,8 +60,8 @@ const NodeModal = props => {
setNodeMsg({ ...nodeMsg, roleList }); setNodeMsg({ ...nodeMsg, roleList });
}; };
// 添加用户 // 添加用户
const addUser = obj => { const addUser = (obj, treeLength) => {
if (obj.roleId === '') { if (obj.roleId === '' || obj.roleName === '' || treeLength === 0) {
notification.error({ notification.error({
message: '提示', message: '提示',
duration: 3, duration: 3,
...@@ -68,7 +70,10 @@ const NodeModal = props => { ...@@ -68,7 +70,10 @@ const NodeModal = props => {
return; return;
} }
// 如果已经有角色就提示 // 如果已经有角色就提示
if (nodeMsg.roleList.some(item => item.roleId === obj.roleId)) { if (
nodeMsg.roleList.some(item => item.roleId === obj.roleId) &&
isEdit === 'add'
) {
notification.error({ notification.error({
message: '提示', message: '提示',
duration: 3, duration: 3,
...@@ -76,9 +81,27 @@ const NodeModal = props => { ...@@ -76,9 +81,27 @@ const NodeModal = props => {
}); });
return; return;
} }
setShowRoal(false); // 编辑角色覆盖原有
let chooseIndex = nodeMsg.roleList.findIndex(
item => item.roleId === obj.roleId,
);
let newList;
if (chooseIndex === -1) {
// 添加表格 // 添加表格
setNodeMsg({ ...nodeMsg, roleList: [...nodeMsg.roleList, obj] }); setNodeMsg({ ...nodeMsg, roleList: [...nodeMsg.roleList, obj] });
} else {
newList = [...nodeMsg.roleList];
newList[chooseIndex] = obj;
// 修改表格
setNodeMsg({ ...nodeMsg, roleList: [...newList] });
}
setShowRoal(false);
};
// 编辑默认承办人
const toEdit = record => {
setIsEdit('edit');
setChooseUser(record);
setShowRoal(true);
}; };
// 定义表格 // 定义表格
const columns = [ const columns = [
...@@ -86,6 +109,14 @@ const NodeModal = props => { ...@@ -86,6 +109,14 @@ const NodeModal = props => {
title: '机构(角色)名称', title: '机构(角色)名称',
dataIndex: 'roleName', dataIndex: 'roleName',
align: 'center', align: 'center',
ellipsis: {
showTitle: false,
},
render: text => (
<Tooltip placement="topLeft" title={text}>
{text}
</Tooltip>
),
}, },
{ {
title: '默认承办人', title: '默认承办人',
...@@ -120,6 +151,12 @@ const NodeModal = props => { ...@@ -120,6 +151,12 @@ const NodeModal = props => {
/> />
</Popconfirm> </Popconfirm>
</Tooltip> </Tooltip>
<Tooltip title="修改默认承办人">
<EditTwoTone
onClick={() => toEdit(record)}
style={{ fontSize: '16px', color: '#1890FF' }}
/>
</Tooltip>
</Space> </Space>
</> </>
), ),
...@@ -196,7 +233,9 @@ const NodeModal = props => { ...@@ -196,7 +233,9 @@ const NodeModal = props => {
style={{ marginBottom: '10px' }} style={{ marginBottom: '10px' }}
onClick={() => { onClick={() => {
setShowRoal(true); setShowRoal(true);
setIsEdit('add');
}} }}
type="primary"
> >
添加 添加
</Button> </Button>
...@@ -207,11 +246,18 @@ const NodeModal = props => { ...@@ -207,11 +246,18 @@ const NodeModal = props => {
bordered bordered
size="small" size="small"
scroll={{ y: 'calc(100vh - 550px)' }} scroll={{ y: 'calc(100vh - 550px)' }}
onRow={record => ({
onDoubleClick: () => {
toEdit(record);
},
})}
pagination={false} pagination={false}
/> />
</Drawer> </Drawer>
<RoalChoose <RoalChoose
visible={showRoal} visible={showRoal}
modalType={isEdit}
chooseUser={chooseUser}
handleCancel={() => setShowRoal(false)} handleCancel={() => setShowRoal(false)}
onSubumit={addUser} onSubumit={addUser}
/> />
......
...@@ -9,15 +9,19 @@ import { ...@@ -9,15 +9,19 @@ import {
Pagination, Pagination,
Spin, Spin,
Divider, Divider,
notification,
Empty,
Tabs,
} from 'antd'; } from 'antd';
import Tree from '@/components/ExpendableTree'; import Tree from '@/components/ExpendableTree';
import { UserOutlined } from '@ant-design/icons'; import { UserOutlined } from '@ant-design/icons';
import styles from '../../../workflow.less'; import styles from '../../../workflow.less';
const CheckboxGroup = Checkbox.Group; const CheckboxGroup = Checkbox.Group;
const { TabPane } = Tabs;
const RoalChoose = props => { const RoalChoose = props => {
const { onSubumit, handleCancel, visible } = props; const { onSubumit, handleCancel, visible, modalType, chooseUser } = props;
const [form] = Form.useForm(); const [form] = Form.useForm();
const [currentSelectId, setCurrentSelectId] = useState(''); // 当前选择节点Id const [currentSelectId, setCurrentSelectId] = useState(''); // 当前选择节点Id
const [currentRoalName, setCurrentRoalName] = useState(''); // 当前选择节点名称 const [currentRoalName, setCurrentRoalName] = useState(''); // 当前选择节点名称
...@@ -28,35 +32,82 @@ const RoalChoose = props => { ...@@ -28,35 +32,82 @@ const RoalChoose = props => {
const [checkAll, setCheckAll] = useState(false); // 全选框全选样式 const [checkAll, setCheckAll] = useState(false); // 全选框全选样式
const [total, setTotal] = useState(); // 角色人员条数 const [total, setTotal] = useState(); // 角色人员条数
const [loading, setLoading] = useState(false); // 加载时的loading const [loading, setLoading] = useState(false); // 加载时的loading
const [userList, setUserList] = useState([]); // 编辑选中的用户信息
const [currentPage, setCurrentPage] = useState(1); const [currentPage, setCurrentPage] = useState(1);
const [pageSize, setPageSize] = useState(10);
const [roleType, setRoleType] = useState('2'); // 角色类型
// 初始化 // 初始化
useEffect(() => { useEffect(() => {
form.resetFields(); form.resetFields();
if (visible) { if (visible) {
setCurrentSelectId(''); setCurrentPage(1);
if (modalType === 'edit') {
console.log(chooseUser);
setRoleType(chooseUser.type.toString());
form.setFieldsValue({ roleName: chooseUser.roleName });
setUserList(chooseUser.defaultUserId);
getData('', 1, pageSize, chooseUser.roleId, chooseUser.type);
} else {
getData('', 1, pageSize, 0, 2);
setRoleType('2');
}
} else {
setUserList([]);
setTreeData([]);
setPlainOptions([]); setPlainOptions([]);
setCheckedList([]); setCheckedList([]);
setIndeterminate(false); setIndeterminate(false);
setCheckAll(false); setCheckAll(false);
setCurrentPage(1);
getData('', 0);
} else {
setTreeData([]);
} }
}, [visible]); }, [visible]);
// 获取表单回显 // 默认选中第一个
const getData = (roleName, pageIndex, pageSize) => { useEffect(() => {
if (treeData.length > 0) {
setCurrentSelectId(treeData[0].id);
setCurrentRoalName(treeData[0].name);
let options = treeData[0].userList.map(item => ({
label: item.name,
value: item.id,
}));
setPlainOptions(options);
}
}, [treeData]);
// 对默认选中的进行处理
useEffect(() => {
if (userList.length > 0 && modalType === 'edit') {
onChange(userList);
} else {
setCheckedList([]);
setIndeterminate(false);
setCheckAll(false);
}
}, [plainOptions]);
// 获取左侧树回显
const getData = (roleName, pageIndex, pageSizes, roleId, Type) => {
roleName = roleName || ''; roleName = roleName || '';
setLoading(true); setLoading(true);
GetRoleUser({ roleName, pageIndex, pageSize }).then(res => { GetRoleUser({
roleName,
pageIndex,
pageSize: pageSizes,
roleId,
Type: Number(Type),
}).then(res => {
setLoading(false); setLoading(false);
if (res.code === 0) { if (res.code === 0) {
setTreeData(res.data.data); setTreeData(res.data.data);
setTotal(res.data.count); setTotal(res.data.count);
} else {
notification.error({
message: '提示',
duration: 3,
description: res.msg,
});
} }
}); });
}; };
// 提交表单 // 查询角色
const onFinish = () => { const onFinish = () => {
form.validateFields().then(validate => { form.validateFields().then(validate => {
if (validate) { if (validate) {
...@@ -66,7 +117,7 @@ const RoalChoose = props => { ...@@ -66,7 +117,7 @@ const RoalChoose = props => {
setIndeterminate(false); setIndeterminate(false);
setCheckAll(false); setCheckAll(false);
setCurrentPage(1); setCurrentPage(1);
getData(validate.roleName, 1); getData(validate.roleName, 1, pageSize, 0, roleType);
} }
}); });
}; };
...@@ -76,6 +127,7 @@ const RoalChoose = props => { ...@@ -76,6 +127,7 @@ const RoalChoose = props => {
return { return {
title: obj.name, title: obj.name,
key: obj.id, key: obj.id,
disabled: modalType === 'edit' && obj.name !== chooseUser.roleName,
userList: obj.userList, userList: obj.userList,
}; };
}; };
...@@ -84,20 +136,17 @@ const RoalChoose = props => { ...@@ -84,20 +136,17 @@ const RoalChoose = props => {
setCurrentRoalName(e.node.title); setCurrentRoalName(e.node.title);
if (selectedKeys[0]) { if (selectedKeys[0]) {
// 选择后对复选框的用户进行重新赋值 // 选择后对复选框的用户进行重新赋值
let userList = [...e.node.userList]; let userLists = [...e.node.userList];
let options = userList.map(item => ({ let options = userLists.map(item => ({
label: item.name, label: item.name,
value: item.id, value: item.id,
})); }));
setCurrentSelectId(selectedKeys[0]); setCurrentSelectId(selectedKeys[0]);
setPlainOptions(options); setPlainOptions(options);
setCheckedList([]);
setIndeterminate(false);
setCheckAll(false);
} }
}; };
// 监听分页 // 监听分页
const paginationChange = (page, pageSize) => { const paginationChange = (page, pageSizes) => {
// 分页时清空复选框 // 分页时清空复选框
setCurrentSelectId(''); setCurrentSelectId('');
setPlainOptions([]); setPlainOptions([]);
...@@ -105,8 +154,9 @@ const RoalChoose = props => { ...@@ -105,8 +154,9 @@ const RoalChoose = props => {
setIndeterminate(false); setIndeterminate(false);
setCheckAll(false); setCheckAll(false);
setCurrentPage(page); setCurrentPage(page);
setPageSize(pageSizes);
let roleName = form.getFieldValue('roleName'); let roleName = form.getFieldValue('roleName');
getData(roleName, page, pageSize); getData(roleName, page, pageSizes, 0, roleType);
}; };
// 复选框全选监听 // 复选框全选监听
const onCheckAllChange = e => { const onCheckAllChange = e => {
...@@ -121,6 +171,19 @@ const RoalChoose = props => { ...@@ -121,6 +171,19 @@ const RoalChoose = props => {
setIndeterminate(!!list.length && list.length < plainOptions.length); setIndeterminate(!!list.length && list.length < plainOptions.length);
setCheckAll(list.length === plainOptions.length); setCheckAll(list.length === plainOptions.length);
}; };
// tab栏切换回调
const tabCallback = val => {
if (val === roleType) {
return;
}
setRoleType(val);
setPlainOptions([]);
setCheckedList([]);
setIndeterminate(false);
setCheckAll(false);
setCurrentPage(1);
getData(form.getFieldValue('roleName'), 1, pageSize, 0, val);
};
// 保存选择的角色列表 // 保存选择的角色列表
const onSave = () => { const onSave = () => {
// 默认承办人字符串拼接 // 默认承办人字符串拼接
...@@ -142,9 +205,26 @@ const RoalChoose = props => { ...@@ -142,9 +205,26 @@ const RoalChoose = props => {
roleId: currentSelectId, roleId: currentSelectId,
defaultUserId: checkedList, defaultUserId: checkedList,
defauletUserName: DeafaultUserName, defauletUserName: DeafaultUserName,
type: Number(roleType),
}; };
onSubumit(obj); onSubumit(obj, treeData.length);
}; };
// 角色列表样式
const roleDom = () =>
treeData.length > 0 ? (
<Tree
blockNode
autoExpandParent
onSelect={onSelect}
selectedKeys={[currentSelectId]}
treeData={treeData.map(item => mapTree(item))}
/>
) : (
<Empty
image={Empty.PRESENTED_IMAGE_SIMPLE}
description="未有查找到角色"
/>
);
return ( return (
<Modal <Modal
title="角色用户列表" title="角色用户列表"
...@@ -164,12 +244,17 @@ const RoalChoose = props => { ...@@ -164,12 +244,17 @@ const RoalChoose = props => {
<Form.Item name="roleName"> <Form.Item name="roleName">
<Input <Input
prefix={<UserOutlined className="site-form-item-icon" />} prefix={<UserOutlined className="site-form-item-icon" />}
placeholder="RoleName" placeholder="请输入机构或角色名称"
disabled={modalType === 'edit'}
allowClear allowClear
/> />
</Form.Item> </Form.Item>
<Form.Item> <Form.Item>
<Button type="primary" htmlType="submit"> <Button
type="primary"
htmlType="submit"
disabled={modalType === 'edit'}
>
搜索 搜索
</Button> </Button>
</Form.Item> </Form.Item>
...@@ -178,17 +263,22 @@ const RoalChoose = props => { ...@@ -178,17 +263,22 @@ const RoalChoose = props => {
{/* 角色树 */} {/* 角色树 */}
<Spin spinning={loading}> <Spin spinning={loading}>
<div className={styles.treeContent}> <div className={styles.treeContent}>
<span style={{ marginLeft: '28px', fontWeight: 700 }}> <Tabs activeKey={roleType} onChange={tabCallback}>
角色列表 <TabPane
</span> tab="角色列表"
<Divider style={{ margin: '10px 0' }} /> key="2"
<Tree disabled={modalType === 'edit' && chooseUser.type === 1}
blockNode >
autoExpandParent {roleDom()}
onSelect={onSelect} </TabPane>
selectedKeys={[currentSelectId]} <TabPane
treeData={treeData.map(item => mapTree(item))} tab="机构列表"
/> key="1"
disabled={modalType === 'edit' && chooseUser.type === 2}
>
{roleDom()}
</TabPane>
</Tabs>
</div> </div>
</Spin> </Spin>
{/* 分页 */} {/* 分页 */}
...@@ -215,11 +305,18 @@ const RoalChoose = props => { ...@@ -215,11 +305,18 @@ const RoalChoose = props => {
</Checkbox> </Checkbox>
<Divider style={{ margin: '10px 0' }} /> <Divider style={{ margin: '10px 0' }} />
<div className={styles.checkContent}> <div className={styles.checkContent}>
{plainOptions.length > 0 ? (
<CheckboxGroup <CheckboxGroup
options={plainOptions} options={plainOptions}
value={checkedList} value={checkedList}
onChange={onChange} onChange={onChange}
/> />
) : (
<Empty
image={Empty.PRESENTED_IMAGE_SIMPLE}
description="未有查找到用户"
/>
)}
</div> </div>
</div> </div>
</div> </div>
......
...@@ -109,13 +109,17 @@ ...@@ -109,13 +109,17 @@
width: 100%; width: 100%;
height: 370px; height: 370px;
margin: 10px 0 10px 0; margin: 10px 0 10px 0;
padding: 20px 20px 20px 20px; padding: 8px 20px 20px 20px;
box-sizing: border-box; box-sizing: border-box;
border: 1px solid #ccc; border: 1px solid #ccc;
.ant-tree-list-holder { .ant-tree-list-holder {
height: 285px; height: 285px;
} }
} }
.footer {
position: relative;
z-index: 999;
}
} }
.userContent { .userContent {
width: 50%; width: 50%;
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { Form, Modal, Input, Select, Radio, Checkbox, notification, Tooltip } from 'antd'; import {
Form,
Modal,
Input,
Select,
Radio,
Checkbox,
notification,
Tooltip,
Drawer,
Space,
Button,
} from 'antd';
import { import {
getField, loadTableFields, LoadEventFields, LoadEventType, UpdateFields getField,
} from '@/services/platform/bs' loadTableFields,
import styles from './index.less' LoadEventFields,
import ChangeAdd from './changeAdd' LoadEventType,
UpdateFields,
} from '@/services/platform/bs';
import styles from './index.less';
import ChangeAdd from './changeAdd';
import { PlusSquareOutlined } from '@ant-design/icons'; import { PlusSquareOutlined } from '@ant-design/icons';
import { shape } from 'prop-types'; import { shape } from 'prop-types';
const AddModal = props => { const AddModal = props => {
const { callBackSubmit = () => { }, isType, itemData, isVisible, formObj1 } = props; const {
callBackSubmit = () => {},
isType,
itemData,
isVisible,
formObj1,
onCancel,
} = props;
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [fieldName, setFieldName] = useState([]); // 弹窗 const [fieldName, setFieldName] = useState([]); // 弹窗
const [eventList, setEventList] = useState([]); // 事件 const [eventList, setEventList] = useState([]); // 事件
const [filed, setFiled] = useState({}); // 事件 const [filed, setFiled] = useState({}); // 事件
const [verification, setVerification] = useState([]); const [verification, setVerification] = useState([]);
const [Shape, setShape] = useState('文本') const [Shape, setShape] = useState('文本');
const [characteristics, setCharacteristics] = useState(['文本', '数值', '唯一值文本', '多行文本', '编码', '地址', '本人部门', '本人姓名', '本人ID', '选择器', '搜索选择器', '值选择器', '值复选器', '业务选择器', '可编辑值选择器', '平铺值选择器', '站点选择器', '人员选择器', '人员选择器新', '城市选择器', '台账选择器', '附件', '可预览附件', '图片', '可预览图片', '录音', '视频', '日期时间', '日期', '日期月份', '日期年份', '日期周', '时分秒', '设备选择', '坐标控件', '区域控件', '路径控件', '智能抄表', '二维码识别', '设备二维码', '位置坐标']) const [characteristics, setCharacteristics] = useState([
'文本',
'数值',
'唯一值文本',
'多行文本',
'编码',
'地址',
'本人部门',
'本人姓名',
'本人ID',
'选择器',
'搜索选择器',
'值选择器',
'值复选器',
'业务选择器',
'可编辑值选择器',
'平铺值选择器',
'站点选择器',
'人员选择器',
'人员选择器新',
'城市选择器',
'台账选择器',
'附件',
'可预览附件',
'图片',
'可预览图片',
'录音',
'视频',
'日期时间',
'日期',
'日期月份',
'日期年份',
'日期周',
'时分秒',
'设备选择',
'坐标控件',
'区域控件',
'路径控件',
'智能抄表',
'二维码识别',
'设备二维码',
'位置坐标',
]);
const [visible, setVisible] = useState(false); // 弹窗 const [visible, setVisible] = useState(false); // 弹窗
const [isShow, setIsShow] = useState(false); // 弹窗 const [isShow, setIsShow] = useState(false); // 弹窗
const [type, setType] = useState(''); // 弹窗类型 const [type, setType] = useState(''); // 弹窗类型
const [formObj, setFormObj] = useState({ rule: [], numerical: '' }); const [formObj, setFormObj] = useState({ rule: [], numerical: '' });
const [characterValue, setCharacterValue] = useState('') const [characterValue, setCharacterValue] = useState('');
const [pramData, setPramData] = useState({ Unit: '', ExceptionEvent: '', Group: '', RowSpan: 0, ColSpan: 0, ReadOnly: false, EditableLater: false, ExceptionValue: '', Preset: '', picture: false, must: false, coordinates: false }) const [pramData, setPramData] = useState({
const [checkedList, setCheckedList] = useState([]);//选中的复选框内容 Unit: '',
ExceptionEvent: '',
Group: '',
RowSpan: 0,
ColSpan: 0,
ReadOnly: false,
EditableLater: false,
ExceptionValue: '',
Preset: '',
picture: false,
must: false,
coordinates: false,
});
const [checkedList, setCheckedList] = useState([]); //选中的复选框内容
const { TextArea } = Input; const { TextArea } = Input;
const [form] = Form.useForm(); const [form] = Form.useForm();
const { Item } = Form; const { Item } = Form;
...@@ -33,25 +111,48 @@ const AddModal = props => { ...@@ -33,25 +111,48 @@ const AddModal = props => {
if (validate) { if (validate) {
setLoading(true); setLoading(true);
let obj = form.getFieldsValue(); let obj = form.getFieldsValue();
let data = [{ Unit: pramData.Unit || '', StoreType: "nvarchar(255)", Group: pramData.Group || '', Shape, ExceptionEvent: pramData.ExceptionEvent || '', RowSpan: pramData.RowSpan || 0, ColSpan: pramData.ColSpan || 0, ReadOnly: pramData.ReadOnly || false, EditableLater: pramData.EditableLater || false, ExceptionValue: pramData.ExceptionValue || '', Preset: pramData.Preset || '', ID: Number(itemData.ID), Name: obj.Name, Alias: obj.Alias, SyncEvent: obj.SyncEvent, ValidationRule: obj.ValidationRule, ExceptionEventFields: characterValue }] let data = [
{
Unit: pramData.Unit || '',
StoreType: 'nvarchar(255)',
Group: pramData.Group || '',
Shape,
ExceptionEvent: pramData.ExceptionEvent || '',
RowSpan: pramData.RowSpan || 0,
ColSpan: pramData.ColSpan || 0,
ReadOnly: pramData.ReadOnly || false,
EditableLater: pramData.EditableLater || false,
ExceptionValue: pramData.ExceptionValue || '',
Preset: pramData.Preset || '',
ID: Number(itemData.ID),
Name: obj.Name,
Alias: obj.Alias,
SyncEvent: obj.SyncEvent,
ValidationRule: obj.ValidationRule,
ExceptionEventFields: characterValue,
},
];
switch (Shape) { switch (Shape) {
case '编码': case '编码':
data[0].Config = `${obj.code}.${obj.prefix ? obj.prefix : ''}`; data[0].Config = `${obj.code}.${obj.prefix ? obj.prefix : ''}`;
break break;
case '坐标控件': case '坐标控件':
pramData.coordinates ? data[0].Config = '当前坐标' : data[0].Config = ''; pramData.coordinates
break ? (data[0].Config = '当前坐标')
case '图片': case '可预览图片': : (data[0].Config = '');
break;
case '图片':
case '可预览图片':
data[0].Preset = pramData.picture ? '拍照相册' : ''; data[0].Preset = pramData.picture ? '拍照相册' : '';
data[0].ValidationRule = pramData.must ? 'required' : '' data[0].ValidationRule = pramData.must ? 'required' : '';
break break;
default: default:
data[0].Config = obj.Config; data[0].Config = obj.Config;
} }
UpdateFields(data).then(res => { UpdateFields(data).then(res => {
setLoading(false); setLoading(false);
if (res.msg === "Ok" || res.msg === "") { if (res.msg === 'Ok' || res.msg === '') {
form.resetFields(); form.resetFields();
callBackSubmit(); callBackSubmit();
notification.success({ notification.success({
...@@ -59,7 +160,6 @@ const AddModal = props => { ...@@ -59,7 +160,6 @@ const AddModal = props => {
duration: 3, duration: 3,
description: '修改成功', description: '修改成功',
}); });
} else { } else {
notification.error({ notification.error({
message: '提示', message: '提示',
...@@ -67,88 +167,96 @@ const AddModal = props => { ...@@ -67,88 +167,96 @@ const AddModal = props => {
description: res.msg, description: res.msg,
}); });
} }
}) });
} }
}); });
}; };
useEffect(() => { useEffect(() => {
if (isType != '') { if (isType != '') {
let req1 = getField({ fieldID: itemData.ID }) let req1 = getField({ fieldID: itemData.ID });
let req2 = loadTableFields({ tableName: formObj1 }) let req2 = loadTableFields({ tableName: formObj1 });
let req3 = LoadEventType({}) let req3 = LoadEventType({});
Promise.all([req1, req2, req3]).then(res => { Promise.all([req1, req2, req3]).then(res => {
res[1].msg === 'Ok' && setFieldName(res[1].data.root) res[1].msg === 'Ok' && setFieldName(res[1].data.root);
res[2].msg === 'Ok' && setEventList(res[2].data.root) res[2].msg === 'Ok' && setEventList(res[2].data.root);
if (res[0].msg === 'Ok') { if (res[0].msg === 'Ok') {
form.setFieldsValue({ ...res[0].data.root }) form.setFieldsValue({ ...res[0].data.root });
if (res[0].data.root.ExceptionEventFields === '') { if (res[0].data.root.ExceptionEventFields === '') {
setCharacterValue('') setCharacterValue('');
setCheckedList([]) setCheckedList([]);
setIsShow(false) setIsShow(false);
} else { } else {
setIsShow(true) setIsShow(true);
setCharacterValue(res[0].data.root.ExceptionEventFields) setCharacterValue(res[0].data.root.ExceptionEventFields);
setCheckedList(res[0].data.root.ExceptionEventFields.split(',')) setCheckedList(res[0].data.root.ExceptionEventFields.split(','));
} }
setShape(res[0].data.root.Shape) setShape(res[0].data.root.Shape);
let coordinates = false, picture = false, must = false let coordinates = false,
picture = false,
must = false;
switch (res[0].data.root.Shape) { switch (res[0].data.root.Shape) {
case '坐标控件': case '坐标控件':
res[0].data.root.Config === "当前坐标" ? coordinates = true : coordinates = false res[0].data.root.Config === '当前坐标'
break ? (coordinates = true)
case '图片': case '可预览图片': : (coordinates = false);
res[0].data.root.Preset === "拍照相册" ? picture = true : picture = false; break;
res[0].data.root.ValidationRule === "required" ? must = true : must = false case '图片':
break case '可预览图片':
res[0].data.root.Preset === '拍照相册'
? (picture = true)
: (picture = false);
res[0].data.root.ValidationRule === 'required'
? (must = true)
: (must = false);
break;
case '编码': case '编码':
let code = res[0].data.root.Config.split(".") let code = res[0].data.root.Config.split('.');
form.setFieldsValue({ code: code[0] || '', prefix: code[1] === "undefined" ? '' : code[1] }); form.setFieldsValue({
break code: code[0] || '',
prefix: code[1] === 'undefined' ? '' : code[1],
});
break;
} }
setPramData({ ...res[0].data.root, coordinates, must, picture }) setPramData({ ...res[0].data.root, coordinates, must, picture });
let index = res[2].data.root.find(item => { return item.Name == res[0].data.root.ExceptionEvent }) let index = res[2].data.root.find(item => {
console.log('index',index); return item.Name == res[0].data.root.ExceptionEvent;
getFieldData(index.TableName) });
console.log('index', index);
getFieldData(index.TableName);
} }
}) });
} }
}, [isVisible]); }, [isVisible]);
const layout = { const layout = {
layout: 'horizontal', layout: 'horizontal',
labelCol: { labelCol: {
span: 4, span: 3,
}, },
wrapperCol: { wrapperCol: {
span: 17, span: 30,
}, },
}; };
const handleChange = (value) => { const handleChange = value => {
form.setFieldsValue({ schemename: value }); form.setFieldsValue({ schemename: value });
} };
const onOK = prop => { const onOK = prop => {
setVisible(false); setVisible(false);
if (type === 'rule') { if (type === 'rule') {
form.setFieldsValue({ ValidationRule: prop }); form.setFieldsValue({ ValidationRule: prop });
} else { } else {
setCheckedList(prop.checkedList) setCheckedList(prop.checkedList);
setCharacterValue(prop.str) setCharacterValue(prop.str);
} }
}; };
const add = (type) => { const add = type => {
let obj = form.getFieldsValue(); let obj = form.getFieldsValue();
let data = { ...formObj } let data = { ...formObj };
if (obj.ValidationRule) { if (obj.ValidationRule) {
let arr = obj.ValidationRule.split(",") let arr = obj.ValidationRule.split(',');
arr.map(item => { arr.map(item => {
switch (item) { switch (item) {
case 'required': case 'required':
...@@ -161,117 +269,114 @@ const AddModal = props => { ...@@ -161,117 +269,114 @@ const AddModal = props => {
data.rule.push(item); data.rule.push(item);
break; break;
default: default:
data.numerical = item data.numerical = item;
} }
}) });
} else { } else {
data = { rule: [], numerical: '' } data = { rule: [], numerical: '' };
} }
setType(type); setType(type);
setFormObj(data) setFormObj(data);
setVisible(true); setVisible(true);
} };
const handleEvent = (value, e) => { const handleEvent = (value, e) => {
let data = { ...pramData } let data = { ...pramData };
data.ExceptionEvent = e.name data.ExceptionEvent = e.name;
if (e.tablename) { if (e.tablename) {
getFieldData(e.tablename) getFieldData(e.tablename);
setPramData(data) setPramData(data);
} else { } else {
setIsShow(false) setIsShow(false);
setFiled({}) setFiled({});
setCharacterValue('') setCharacterValue('');
setCheckedList([]) setCheckedList([]);
}
} }
const getFieldData = (value) => { };
const getFieldData = value => {
LoadEventFields({ eventTableName: value, distinctFields: '' }).then(res => { LoadEventFields({ eventTableName: value, distinctFields: '' }).then(res => {
if (res.msg === 'Ok') { if (res.msg === 'Ok') {
setFiled(formateArrDataA(res.data.root, 'group')) setFiled(formateArrDataA(res.data.root, 'group'));
setIsShow(true) setIsShow(true);
} }
});
}) };
}
const formateArrDataA = (initialArr, name) => { const formateArrDataA = (initialArr, name) => {
// 判定传参是否符合规则 // 判定传参是否符合规则
if (!(initialArr instanceof Array)) { if (!(initialArr instanceof Array)) {
return '请传入正确格式的数组' return '请传入正确格式的数组';
} }
if (!name) { if (!name) {
return '请传入对象属性' return '请传入对象属性';
} }
//先获取一下这个数组中有多少个"name" //先获取一下这个数组中有多少个"name"
let nameArr = [] let nameArr = [];
for (let i in initialArr) { for (let i in initialArr) {
if (nameArr.indexOf(initialArr[i][`${name}`]) === -1) { if (nameArr.indexOf(initialArr[i][`${name}`]) === -1) {
nameArr.push(initialArr[i][`${name}`]) nameArr.push(initialArr[i][`${name}`]);
} }
} }
//新建一个包含多个list的结果对象 //新建一个包含多个list的结果对象
let tempObj = {} let tempObj = {};
// 根据不同的"name"生成多个数组 // 根据不同的"name"生成多个数组
for (let k in nameArr) { for (let k in nameArr) {
for (let j in initialArr) { for (let j in initialArr) {
if (initialArr[j][`${name}`] == nameArr[k]) { if (initialArr[j][`${name}`] == nameArr[k]) {
// 每次外循环时新建一个对应"name"的数组, 内循环时当前数组不变 // 每次外循环时新建一个对应"name"的数组, 内循环时当前数组不变
tempObj[nameArr[k]] = tempObj[nameArr[k]] || [] tempObj[nameArr[k]] = tempObj[nameArr[k]] || [];
tempObj[nameArr[k]].push(initialArr[j]) tempObj[nameArr[k]].push(initialArr[j]);
} }
} }
} }
for (let key in tempObj) { for (let key in tempObj) {
let arr = [] let arr = [];
tempObj[key].map(item => { tempObj[key].map(item => {
tempObj[key] = arr; tempObj[key] = arr;
arr.push(item.fieldName) arr.push(item.fieldName);
}) });
}
return tempObj
} }
const handleCharacteristics = (value) => { return tempObj;
let data = { ...pramData } };
setShape(value) const handleCharacteristics = value => {
data.must = false let data = { ...pramData };
data.coordinates = false setShape(value);
data.picture = false data.must = false;
data.Preset = '' data.coordinates = false;
setPramData(data) data.picture = false;
data.Preset = '';
setPramData(data);
form.setFieldsValue({ ValidationRule: '' }); form.setFieldsValue({ ValidationRule: '' });
if (value.indexOf("日期") != -1 || value === "时分秒") { if (value.indexOf('日期') != -1 || value === '时分秒') {
form.setFieldsValue({ Config: undefined }); form.setFieldsValue({ Config: undefined });
} }
};
} const onCharacterValue = e => {
const onCharacterValue = (e) => { setCharacterValue(e.target.value);
setCharacterValue(e.target.value) };
}
const onChangeReady = (e, str) => { const onChangeReady = (e, str) => {
let data = { ...pramData } let data = { ...pramData };
switch (str) { switch (str) {
case 'ReadOnly': case 'ReadOnly':
data.ReadOnly = e.target.checked; data.ReadOnly = e.target.checked;
break; break;
case 'EditableLater': case 'EditableLater':
data.EditableLater = e.target.checked data.EditableLater = e.target.checked;
break; break;
case 'must': case 'must':
data.must = e.target.checked data.must = e.target.checked;
break; break;
case 'picture': case 'picture':
data.picture = e.target.checked data.picture = e.target.checked;
break; break;
case 'coordinates': case 'coordinates':
data.coordinates = e.target.checked data.coordinates = e.target.checked;
break; break;
} }
setPramData(data) setPramData(data);
} };
const handleInput = (e, str) => { const handleInput = (e, str) => {
let data = { ...pramData } let data = { ...pramData };
switch (str) { switch (str) {
case 'Unit': case 'Unit':
data.Unit = e.target.value; data.Unit = e.target.value;
...@@ -286,49 +391,47 @@ const AddModal = props => { ...@@ -286,49 +391,47 @@ const AddModal = props => {
data.ExceptionValue = e.target.value; data.ExceptionValue = e.target.value;
break; break;
default: default:
break break;
}
setPramData(data)
} }
const handleSeparator = (value) => { setPramData(data);
let data = { ...pramData } };
const handleSeparator = value => {
let data = { ...pramData };
switch (value) { switch (value) {
case '6': case '6':
data.Preset = '是' data.Preset = '是';
form.setFieldsValue({ Config: '是,否' }); form.setFieldsValue({ Config: '是,否' });
break; break;
case '7': case '7':
data.Preset = '否' data.Preset = '否';
form.setFieldsValue({ Config: '是,否' }); form.setFieldsValue({ Config: '是,否' });
break; break;
case '8': case '8':
data.Preset = '否' data.Preset = '否';
form.setFieldsValue({ Config: '否,是' }); form.setFieldsValue({ Config: '否,是' });
break; break;
} }
setPramData(data) setPramData(data);
} };
return ( return (
<> <>
<Modal <Drawer
title='修改' title="修改"
bodyStyle={{ width: '100%', minHeight: '100px' }} width="600px"
width="700px" // {...props}
destroyOnClose
maskClosable={false}
centered={true}
cancelText="取消"
okText="确认"
{...props}
visible={isVisible} visible={isVisible}
onOk={() => onSubmit()} onClose={onCancel}
confirmLoading={loading} footer={
forceRender={true} <Space>
getContainer={false} <Button onClick={onCancel}>取消</Button>
<Button onClick={onSubmit} type="primary">
确定
</Button>
</Space>
}
> >
{isVisible && ( {isVisible && (
<Form form={form} {...layout} > <Form form={form} {...layout}>
<Item <Item
label="字段名" label="字段名"
name="Name" name="Name"
...@@ -336,138 +439,233 @@ const AddModal = props => { ...@@ -336,138 +439,233 @@ const AddModal = props => {
> >
<Input placeholder="请输入别名" disabled /> <Input placeholder="请输入别名" disabled />
</Item> </Item>
<Item <Item label="别名" name="Alias">
label="别名"
name="Alias"
>
<Input placeholder="请输入别名" allowClear /> <Input placeholder="请输入别名" allowClear />
</Item> </Item>
<Item <Item name="ReadOnly" label="属性">
name="ReadOnly"
label="属性"
>
<div> <div>
<Checkbox checked={pramData.ReadOnly} onChange={(e) => onChangeReady(e, 'ReadOnly')}>只读</Checkbox> <Checkbox
<Checkbox checked={pramData.EditableLater} onChange={(e) => onChangeReady(e, 'EditableLater')}>允许补正(事后修改)</Checkbox> checked={pramData.ReadOnly}
onChange={e => onChangeReady(e, 'ReadOnly')}
>
只读
</Checkbox>
<Checkbox
checked={pramData.EditableLater}
onChange={e => onChangeReady(e, 'EditableLater')}
>
允许补正(事后修改)
</Checkbox>
</div> </div>
</Item> </Item>
<Item <Item label="同步" name="SyncEvent">
label="同步"
name="SyncEvent"
>
<Radio.Group> <Radio.Group>
<Radio value={0} style={{ marginRight: '0.5rem' }}>不同步</Radio> <Radio value={0} style={{ marginRight: '0.5rem' }}>
<Radio value={1} style={{ marginRight: '0.5rem' }}>工单 → 事件</Radio> 不同步
<Radio value={2} >事件(上报时) → 工单</Radio> </Radio>
<Radio value={1} style={{ marginRight: '0.5rem' }}>
工单 → 事件
</Radio>
<Radio value={2}>事件(上报时) → 工单</Radio>
</Radio.Group> </Radio.Group>
</Item> </Item>
<Item <Item label="形态">
label="形态"
>
<div className={styles.listEvent}> <div className={styles.listEvent}>
<Select style={{ width: '42%' }} value={Shape} onChange={handleCharacteristics}> <Select
{characteristics.length ? characteristics.map((item, index) => { return <Select.Option key={index} value={item}>{item}</Select.Option>; }) : ''} style={{ width: '42%' }}
value={Shape}
onChange={handleCharacteristics}
>
{characteristics.length
? characteristics.map((item, index) => {
return (
<Select.Option key={index} value={item}>
{item}
</Select.Option>
);
})
: ''}
</Select> </Select>
<div className={styles.unit}>单位:<Input style={{ width: '5rem' }} placeholder="" allowClear value={pramData.Unit} onChange={(e) => handleInput(e, 'Unit')} /></div> <div className={styles.unit}>
<div className={styles.unit}>宽:<Input style={{ width: '4rem' }} placeholder="" allowClear value={pramData.RowSpan} onChange={(e) => handleInput(e, 'RowSpan')} /></div> 单位:
<Input
style={{ width: '5rem' }}
placeholder=""
allowClear
value={pramData.Unit}
onChange={e => handleInput(e, 'Unit')}
/>
</div>
<div className={styles.unit}>
宽:
<Input
style={{ width: '4rem' }}
placeholder=""
allowClear
value={pramData.RowSpan}
onChange={e => handleInput(e, 'RowSpan')}
/>
</div>
</div> </div>
</Item> </Item>
{(() => { {(() => {
switch (Shape) { switch (Shape) {
case '编码': case '编码':
return <> return (
<Item <>
label="前缀" <Item label="前缀" name="prefix">
name="prefix" <Input
> style={{ width: '95%' }}
<Input style={{ width: '95%' }} placeholder="" allowClear /> placeholder=""
allowClear
/>
</Item> </Item>
<Item <Item label="编码方式" name="code">
label="编码方式"
name="code"
>
<Radio.Group> <Radio.Group>
<Radio value='年份编码' style={{ marginRight: '0.5rem' }}>XJ-2019-000001(前缀-年份-六位编码)</Radio> <Radio
<Radio value='年月编码' style={{ marginRight: '0.5rem' }}>XJ-201909-000001(前缀-年份月份-六位编码)</Radio> value="年份编码"
<Radio value='一般编码' defaultChecked >XJ00000001(前缀 八位编码)</Radio> style={{ marginRight: '0.5rem' }}
>
XJ-2019-000001(前缀-年份-六位编码)
</Radio>
<Radio
value="年月编码"
style={{ marginRight: '0.5rem' }}
>
XJ-201909-000001(前缀-年份月份-六位编码)
</Radio>
<Radio value="一般编码" defaultChecked>
XJ00000001(前缀 八位编码)
</Radio>
</Radio.Group> </Radio.Group>
</Item> </Item>
</> </>
case '值选择器': case '值复选器': case '可编辑值选择器': case '平铺值选择器': );
return <> <Item case '值选择器':
label="可选值" case '值复选器':
name="Config" case '可编辑值选择器':
> case '平铺值选择器':
return (
<>
{' '}
<Item label="可选值" name="Config">
<TextArea allowClear /> <TextArea allowClear />
</Item> </Item>
<Item <Item colon={false} label=" ">
colon={false} {' '}
label=" " <div style={{ display: 'flex', alignItems: 'center' }}>
> <div style={{ display: 'flex', alignItems: 'center' }}> <span style={{ marginRight: '0.4rem' }}>
<span style={{ marginRight: '0.4rem' }}>以英文逗号为分隔符填写,或其他分隔符粘贴:</span> 以英文逗号为分隔符填写,或其他分隔符粘贴:
<Select onChange={handleSeparator} style={{ width: '30%' }}> </span>
<Select.Option value='0'>以,分隔(英文逗号)</Select.Option> <Select
<Select.Option value='1'>以/分隔(正斜杠)</Select.Option> onChange={handleSeparator}
<Select.Option value='2'>以\\分隔(反斜杠)</Select.Option> style={{ width: '30%' }}
<Select.Option value='3'>以、分隔(中文顿号)</Select.Option> >
<Select.Option value='4'>以;分隔(英文分号)</Select.Option> <Select.Option value="0">
<Select.Option value='5'>以;分隔(中文分号)</Select.Option> 以,分隔(英文逗号)
<Select.Option value='6'>(是)/否</Select.Option> </Select.Option>
<Select.Option value='7'>是/(否)</Select.Option> <Select.Option value="1">
<Select.Option value='8'>(否)/是</Select.Option> 以/分隔(正斜杠)
</Select.Option>
<Select.Option value="2">
以\\分隔(反斜杠)
</Select.Option>
<Select.Option value="3">
以、分隔(中文顿号)
</Select.Option>
<Select.Option value="4">
以;分隔(英文分号)
</Select.Option>
<Select.Option value="5">
以;分隔(中文分号)
</Select.Option>
<Select.Option value="6">(是)/否</Select.Option>
<Select.Option value="7">是/(否)</Select.Option>
<Select.Option value="8">(否)/是</Select.Option>
</Select> </Select>
</div> </div>
</Item> </Item>
</> </>
case '图片': case '可预览图片': );
return <Item case '图片':
name="ReadOnly" case '可预览图片':
label="选项" return (
> <Item name="ReadOnly" label="选项">
<div> <div>
<Checkbox checked={pramData.picture} onChange={(e) => onChangeReady(e, 'picture')}>允许从相册选取</Checkbox> <Checkbox
<Checkbox checked={pramData.must} onChange={(e) => onChangeReady(e, 'must')}>必填字段</Checkbox> checked={pramData.picture}
onChange={e => onChangeReady(e, 'picture')}
>
允许从相册选取
</Checkbox>
<Checkbox
checked={pramData.must}
onChange={e => onChangeReady(e, 'must')}
>
必填字段
</Checkbox>
</div> </div>
</Item> </Item>
case '日期时间': case '日期': case '日期月份': case '日期年份': case '日期周': case '时分秒': );
return <Item case '日期时间':
label="选项" case '日期':
name="Config" case '日期月份':
> case '日期年份':
case '日期周':
case '时分秒':
return (
<Item label="选项" name="Config">
<Radio.Group style={{ marginTop: '0.3rem' }}> <Radio.Group style={{ marginTop: '0.3rem' }}>
<Radio value='默认为空' defaultChecked style={{ width: '18rem', marginBottom: '0.5rem' }}>默认为空</Radio> <Radio
<Radio value='' >默认为当前时间</Radio> value="默认为空"
<Radio value='不可选择' style={{ width: '18rem' }}>锁定为当前时间(通过用户点击刷新)</Radio> defaultChecked
<Radio value='不超过当前时间' >不超过当前时间</Radio> style={{ width: '18rem', marginBottom: '0.5rem' }}
>
默认为空
</Radio>
<Radio value="">默认为当前时间</Radio>
<Radio value="不可选择" style={{ width: '18rem' }}>
锁定为当前时间(通过用户点击刷新)
</Radio>
<Radio value="不超过当前时间">不超过当前时间</Radio>
</Radio.Group> </Radio.Group>
</Item> </Item>
);
case '坐标控件': case '坐标控件':
return <Item return (
label="选项" <Item label="选项" name="Config">
name="Config"
>
<div> <div>
<Checkbox value='当前坐标' style={{ marginRight: '0.2rem' }} checked={pramData.coordinates} onChange={(e) => onChangeReady(e, 'coordinates')}></Checkbox>锁定为当前位置坐标 <Checkbox
value="当前坐标"
style={{ marginRight: '0.2rem' }}
checked={pramData.coordinates}
onChange={e => onChangeReady(e, 'coordinates')}
/>
锁定为当前位置坐标
</div> </div>
</Item> </Item>
);
default: default:
return <Item return (
label="配置" <Item label="配置" name="Config">
name="Config"
>
<TextArea allowClear /> <TextArea allowClear />
</Item> </Item>
);
} }
} })()}
)()} {Shape === '图片' || Shape === '可预览图片' ? (
{Shape === '图片' || Shape === '可预览图片' ? '' : ''
<Item ) : (
label="预设值" <Item label="预设值">
>
<div className={styles.listEvent}> <div className={styles.listEvent}>
<Input style={{ width: '40%', height: '1.8rem' }} value={pramData.Preset} onChange={(e) => handleInput(e, 'Preset')} placeholder="" allowClear /> <Input
style={{ width: '40%', height: '1.8rem' }}
value={pramData.Preset}
onChange={e => handleInput(e, 'Preset')}
placeholder=""
allowClear
/>
<Item <Item
style={{ marginLeft: '1rem' }} style={{ marginLeft: '1rem' }}
label="验证" label="验证"
...@@ -479,17 +677,26 @@ const AddModal = props => { ...@@ -479,17 +677,26 @@ const AddModal = props => {
<Tooltip title="选择验证规则"> <Tooltip title="选择验证规则">
<PlusSquareOutlined <PlusSquareOutlined
onClick={() => add('rule')} onClick={() => add('rule')}
style={{ fontSize: '24px', color: '#1890FF', display: 'flex', alignItems: 'center' }} style={{
fontSize: '24px',
color: '#1890FF',
display: 'flex',
alignItems: 'center',
}}
/> />
</Tooltip> </Tooltip>
</div> </div>
</Item> </Item>
} )}
<Item <Item label="异常值">
label="异常值"
>
<div className={styles.listEvent}> <div className={styles.listEvent}>
<Input style={{ width: '40%', height: '1.8rem' }} value={pramData.ExceptionValue} onChange={(e) => handleInput(e, 'ExceptionValue')} placeholder="" allowClear /> <Input
style={{ width: '40%', height: '1.8rem' }}
value={pramData.ExceptionValue}
onChange={e => handleInput(e, 'ExceptionValue')}
placeholder=""
allowClear
/>
<Item <Item
style={{ marginLeft: '1rem' }} style={{ marginLeft: '1rem' }}
label="触发事件" label="触发事件"
...@@ -497,27 +704,51 @@ const AddModal = props => { ...@@ -497,27 +704,51 @@ const AddModal = props => {
style={{ margin: '0 0 0 1rem' }} style={{ margin: '0 0 0 1rem' }}
> >
<Select style={{ width: '12rem' }} onChange={handleEvent}> <Select style={{ width: '12rem' }} onChange={handleEvent}>
{eventList.length ? eventList.map((item, index) => { return <Select.Option key={index} tablename={item.TableName} name={item.Name} value={item.ID}>{item.Name}</Select.Option>; }) : ''} {eventList.length
? eventList.map((item, index) => {
return (
<Select.Option
key={index}
tablename={item.TableName}
name={item.Name}
value={item.ID}
>
{item.Name}
</Select.Option>
);
})
: ''}
</Select> </Select>
</Item> </Item>
</div> </div>
</Item> </Item>
<Item <Item label="字段集">
label="字段集"
>
<div className={styles.listEvent}> <div className={styles.listEvent}>
<Input style={{ width: '93%' }} placeholder="" disabled={!isShow} onChange={onCharacterValue} allowClear value={characterValue} /> <Input
style={{ width: '93%' }}
placeholder=""
disabled={!isShow}
onChange={onCharacterValue}
allowClear
value={characterValue}
/>
<Tooltip title={!isShow ? '' : '字符集选择'}> <Tooltip title={!isShow ? '' : '字符集选择'}>
<PlusSquareOutlined <PlusSquareOutlined
onClick={() => !isShow ? '' : add('characteristics')} onClick={() => (!isShow ? '' : add('characteristics'))}
style={{ fontSize: '24px', color: !isShow ? 'gray' : '#1890FF', cursor: !isShow ? 'no-drop' : 'pointer', display: 'flex', alignItems: 'center', marginLeft: '0.5rem' }} style={{
fontSize: '24px',
color: !isShow ? 'gray' : '#1890FF',
cursor: !isShow ? 'no-drop' : 'pointer',
display: 'flex',
alignItems: 'center',
marginLeft: '0.5rem',
}}
/> />
</Tooltip> </Tooltip>
</div> </div>
</Item> </Item>
</Form> </Form>
)} )}
</Modal>
<ChangeAdd <ChangeAdd
visible={visible} visible={visible}
onCancel={() => setVisible(false)} onCancel={() => setVisible(false)}
...@@ -526,7 +757,9 @@ const AddModal = props => { ...@@ -526,7 +757,9 @@ const AddModal = props => {
isType={type} isType={type}
filed={filed} filed={filed}
characterValue={characterValue} characterValue={characterValue}
formObj={formObj} /> formObj={formObj}
/>
</Drawer>
</> </>
); );
}; };
......
...@@ -8,19 +8,29 @@ import { ...@@ -8,19 +8,29 @@ import {
Popconfirm, Popconfirm,
Spin, Spin,
notification, notification,
Tooltip Tooltip,
} from 'antd'; } from 'antd';
import { EditOutlined, DeleteOutlined,SortDescendingOutlined,PlusSquareOutlined,RollbackOutlined } from '@ant-design/icons'; import {
import { reloadTableFields, removeFields, loadUnattachedTables } from '@/services/platform/bs'; EditOutlined,
DeleteOutlined,
SortDescendingOutlined,
PlusSquareOutlined,
RollbackOutlined,
} from '@ant-design/icons';
import {
reloadTableFields,
removeFields,
loadUnattachedTables,
} from '@/services/platform/bs';
import FieldEditor from './fieldEditor'; import FieldEditor from './fieldEditor';
import { useHistory } from 'react-router-dom'; import { useHistory } from 'react-router-dom';
import styles from './index.less' import styles from './index.less';
import AffiliateAdd from '../bsmanager/tablemanager/components/Field/affiliateAdd' import AffiliateAdd from '../bsmanager/tablemanager/components/Field/affiliateAdd';
import LoadGroup from '../bsmanager/tablemanager/components/Field/loadGroup' import LoadGroup from '../bsmanager/tablemanager/components/Field/loadGroup';
const AddModal = props => { const AddModal = props => {
const history = useHistory(); const history = useHistory();
const [allData, setAllData] = useState([]); const [allData, setAllData] = useState([]);
const [tableList, setTableList] = useState([]) const [tableList, setTableList] = useState([]);
const [tableData, setTableData] = useState([]); const [tableData, setTableData] = useState([]);
const [treeLoading, setTreeLoading] = useState(false); const [treeLoading, setTreeLoading] = useState(false);
const [formObj, setFormObj] = useState(''); const [formObj, setFormObj] = useState('');
...@@ -28,8 +38,8 @@ const AddModal = props => { ...@@ -28,8 +38,8 @@ const AddModal = props => {
const [isVisible, setIsVisible] = useState(false); // 弹窗 const [isVisible, setIsVisible] = useState(false); // 弹窗
const [isType, setIsType] = useState(''); // 弹窗类型 const [isType, setIsType] = useState(''); // 弹窗类型
const [itemData, setItemData] = useState({}); const [itemData, setItemData] = useState({});
const [select, setSelect] = useState([]) const [select, setSelect] = useState([]);
const [selectTableName, setSelectTableName] = useState({}) const [selectTableName, setSelectTableName] = useState({});
const [pramFormObj, setPramFormObj] = useState({}); const [pramFormObj, setPramFormObj] = useState({});
const [visible, setVisible] = useState(false); // 弹窗 const [visible, setVisible] = useState(false); // 弹窗
const [type, setType] = useState(''); // 弹窗类型 const [type, setType] = useState(''); // 弹窗类型
...@@ -45,12 +55,21 @@ const AddModal = props => { ...@@ -45,12 +55,21 @@ const AddModal = props => {
const getField = () => { const getField = () => {
loadUnattachedTables().then(res => { loadUnattachedTables().then(res => {
if (res.data.root && res.data.root.length) { if (res.data.root && res.data.root.length) {
setTableList(res.data.root) setTableList(res.data.root);
} }
});
}) };
// 处理表格特殊样式
const styleConfig = record => {
if (record.Type === 1) {
return 'red';
}
if (record.Type === 2) {
return 'grey';
} }
const expandedRowRender = (item) => { return '000000D9';
};
const expandedRowRender = item => {
const columns = [ const columns = [
{ {
title: '字段名', title: '字段名',
...@@ -58,7 +77,11 @@ const AddModal = props => { ...@@ -58,7 +77,11 @@ const AddModal = props => {
key: 'name', key: 'name',
width: 190, width: 190,
align: 'left', align: 'left',
render: text => <div style={{ paddingLeft: '2rem' }}>{text}</div>, render: (text, record) => (
<div style={{ paddingLeft: '2rem', color: styleConfig(record) }}>
{text}
</div>
),
}, },
{ {
title: '别名', title: '别名',
...@@ -66,6 +89,9 @@ const AddModal = props => { ...@@ -66,6 +89,9 @@ const AddModal = props => {
key: 'alias', key: 'alias',
align: 'center', align: 'center',
width: 200, width: 200,
render: (text, record) => (
<span style={{ color: styleConfig(record) }}>{text} </span>
),
}, },
{ {
title: '字段类型', title: '字段类型',
...@@ -73,6 +99,9 @@ const AddModal = props => { ...@@ -73,6 +99,9 @@ const AddModal = props => {
key: 'storeType', key: 'storeType',
align: 'center', align: 'center',
width: 200, width: 200,
render: (text, record) => (
<span style={{ color: styleConfig(record) }}>{text} </span>
),
}, },
{ {
title: '形态', title: '形态',
...@@ -80,6 +109,9 @@ const AddModal = props => { ...@@ -80,6 +109,9 @@ const AddModal = props => {
key: 'shape', key: 'shape',
align: 'center', align: 'center',
width: 200, width: 200,
render: (text, record) => (
<span style={{ color: styleConfig(record) }}>{text} </span>
),
}, },
{ {
title: '配置', title: '配置',
...@@ -87,6 +119,9 @@ const AddModal = props => { ...@@ -87,6 +119,9 @@ const AddModal = props => {
key: 'config', key: 'config',
align: 'center', align: 'center',
width: 200, width: 200,
render: (text, record) => (
<span style={{ color: styleConfig(record) }}>{text} </span>
),
}, },
{ {
...@@ -95,6 +130,9 @@ const AddModal = props => { ...@@ -95,6 +130,9 @@ const AddModal = props => {
key: 'readOnly', key: 'readOnly',
align: 'center', align: 'center',
width: 200, width: 200,
render: (text, record) => (
<span style={{ color: styleConfig(record) }}>{text} </span>
),
}, },
{ {
title: '同步', title: '同步',
...@@ -102,6 +140,9 @@ const AddModal = props => { ...@@ -102,6 +140,9 @@ const AddModal = props => {
key: 'syncEvent', key: 'syncEvent',
align: 'center', align: 'center',
width: 200, width: 200,
render: (text, record) => (
<span style={{ color: styleConfig(record) }}>{text} </span>
),
}, },
{ {
title: '操作', title: '操作',
...@@ -111,10 +152,12 @@ const AddModal = props => { ...@@ -111,10 +152,12 @@ const AddModal = props => {
render: (text, record) => ( render: (text, record) => (
<Space> <Space>
<Tooltip title="修改"> <Tooltip title="修改">
<EditOutlined style={{ fontSize: '16px', color: '#1890FF' }} <EditOutlined
style={{ fontSize: '16px', color: '#1890FF' }}
onClick={() => { onClick={() => {
editor(record); editor(record);
}}> }}
>
编辑 编辑
</EditOutlined> </EditOutlined>
</Tooltip> </Tooltip>
...@@ -128,7 +171,11 @@ const AddModal = props => { ...@@ -128,7 +171,11 @@ const AddModal = props => {
}} }}
> >
<Tooltip title="删除"> <Tooltip title="删除">
<DeleteOutlined style={{ fontSize: '16px', color: '#e86060' }}>删除</DeleteOutlined> <DeleteOutlined
style={{ fontSize: '16px', color: '#e86060' }}
>
删除
</DeleteOutlined>
</Tooltip> </Tooltip>
</Popconfirm> </Popconfirm>
</div> </div>
...@@ -137,23 +184,35 @@ const AddModal = props => { ...@@ -137,23 +184,35 @@ const AddModal = props => {
}, },
]; ];
return <Table columns={columns} onRow={record => { return (
<Table
columns={columns}
onRow={record => {
return { return {
onDoubleClick: event => { onDoubleClick: event => {
event.stopPropagation() event.stopPropagation();
editor(record); editor(record);
}, },
onClick: event => { onClick: event => {
event.stopPropagation() event.stopPropagation();
setSelectTableName(record) setSelectTableName(record);
}, // 点击行 }, // 点击行
}
}} bordered rowClassName={setRowClassName} showHeader={false} dataSource={allData[item.type]} pagination={false} />;
}; };
const setRowClassName = (record) => }}
Object.entries(record).toString() === Object.entries(selectTableName).toString() ? styles.clickRowStyle : ''; bordered
rowClassName={setRowClassName}
showHeader={false}
dataSource={allData[item.type]}
pagination={false}
/>
);
};
const setRowClassName = record =>
Object.entries(record).toString() ===
Object.entries(selectTableName).toString()
? styles.clickRowStyle
: '';
const columns = [ const columns = [
{ {
title: '字段名', title: '字段名',
dataIndex: 'type', dataIndex: 'type',
...@@ -161,9 +220,12 @@ const AddModal = props => { ...@@ -161,9 +220,12 @@ const AddModal = props => {
align: 'left', align: 'left',
width: 150, width: 150,
render: text => { render: text => {
return (<a >{text}(共{allData[text] ? allData[text].length : ''}条)</a>) return (
} <a>
{text}(共{allData[text] ? allData[text].length : ''}条)
</a>
);
},
}, },
{ {
title: '别名', title: '别名',
...@@ -214,69 +276,67 @@ const AddModal = props => { ...@@ -214,69 +276,67 @@ const AddModal = props => {
ellipsis: true, ellipsis: true,
key: 'title', key: 'title',
align: 'center', align: 'center',
}, },
]; ];
useEffect(() => { useEffect(() => {
if (props.match.params.id) { if (props.match.params.id) {
setFormObj(props.match.params.id) setFormObj(props.match.params.id);
setTreeLoading(true); setTreeLoading(true);
reloadTableFields({ reloadTableFields({
tableName: props.match.params.id, tableName: props.match.params.id,
}).then(res => { }).then(res => {
setTreeLoading(false); setTreeLoading(false);
if (res.msg === 'Ok') { if (res.msg === 'Ok') {
let arr = formateArrDataA(res.data.root, 'group') let arr = formateArrDataA(res.data.root, 'group');
let newArr = [] let newArr = [];
Object.keys(arr).map((item, index) => { Object.keys(arr).map((item, index) => {
newArr.push({ type: item, key: index, id: index }) newArr.push({ type: item, key: index, id: index });
}) });
setAllData(arr); setAllData(arr);
setTableData(newArr); setTableData(newArr);
setSelect(newArr) setSelect(newArr);
} }
}); });
getField() getField();
} }
}, [flag]); }, [flag]);
const formateArrDataA = (initialArr, name) => { const formateArrDataA = (initialArr, name) => {
// 判定传参是否符合规则 // 判定传参是否符合规则
if (!(initialArr instanceof Array)) { if (!(initialArr instanceof Array)) {
return '请传入正确格式的数组' return '请传入正确格式的数组';
} }
if (!name) { if (!name) {
return '请传入对象属性' return '请传入对象属性';
} }
//先获取一下这个数组中有多少个"name" //先获取一下这个数组中有多少个"name"
let nameArr = [] let nameArr = [];
for (let i in initialArr) { for (let i in initialArr) {
if (nameArr.indexOf(initialArr[i][`${name}`]) === -1) { if (nameArr.indexOf(initialArr[i][`${name}`]) === -1) {
nameArr.push(initialArr[i][`${name}`]) nameArr.push(initialArr[i][`${name}`]);
} }
} }
//新建一个包含多个list的结果对象 //新建一个包含多个list的结果对象
let tempObj = {} let tempObj = {};
// 根据不同的"name"生成多个数组 // 根据不同的"name"生成多个数组
for (let k in nameArr) { for (let k in nameArr) {
for (let j in initialArr) { for (let j in initialArr) {
if (initialArr[j][`${name}`] == nameArr[k]) { if (initialArr[j][`${name}`] == nameArr[k]) {
// 每次外循环时新建一个对应"name"的数组, 内循环时当前数组不变 // 每次外循环时新建一个对应"name"的数组, 内循环时当前数组不变
tempObj[nameArr[k]] = tempObj[nameArr[k]] || [] tempObj[nameArr[k]] = tempObj[nameArr[k]] || [];
tempObj[nameArr[k]].push(initialArr[j]) tempObj[nameArr[k]].push(initialArr[j]);
} }
} }
} }
for (let keys in tempObj) { for (let keys in tempObj) {
let arr = [] let arr = [];
tempObj[keys].map((item, index) => { tempObj[keys].map((item, index) => {
tempObj[keys] = arr; tempObj[keys] = arr;
item.key = index item.key = index;
arr.push(item) arr.push(item);
}) });
}
return tempObj
} }
return tempObj;
};
// 删除表字段 // 删除表字段
const deleteChart = record => { const deleteChart = record => {
removeFields({ fieldIDs: record.ID }).then(res => { removeFields({ fieldIDs: record.ID }).then(res => {
...@@ -298,44 +358,63 @@ const AddModal = props => { ...@@ -298,44 +358,63 @@ const AddModal = props => {
}; };
// 返回上一级 // 返回上一级
const back = () => { const back = () => {
let template = props.history.location.state.template let template = props.history.location.state.template;
history.push({ pathname: '/platformCenter/bsmanger/tablemanger', state: { template } }) history.push({
} pathname: '/platformCenter/bsmanger/tablemanger',
state: { template },
});
};
const onUnfold = (expanded, record) => { const onUnfold = (expanded, record) => {
const data = [...select] const data = [...select];
let index = data.indexOf(record) let index = data.indexOf(record);
if (expanded) { if (expanded) {
data.push(record) data.push(record);
} else { } else {
data.splice(index, 1) data.splice(index, 1);
}
setSelect(data)
} }
setSelect(data);
};
//附加 //附加
const add = (record) => { const add = record => {
setPramFormObj(props.history.location.state.template); setPramFormObj(props.history.location.state.template);
setType('affiliateAdd'); setType('affiliateAdd');
setVisible(true); setVisible(true);
} };
//分组与排序 //分组与排序
const sort = (record) => { const sort = record => {
setPramFormObj(props.history.location.state.template); setPramFormObj(props.history.location.state.template);
setType('sort'); setType('sort');
setVisible(true); setVisible(true);
} };
const onSubmit = prop => { const onSubmit = prop => {
setVisible(false); setVisible(false);
setFlag(flag + 1) setFlag(flag + 1);
}; };
return ( return (
<>
<><Spin tip="loading..." spinning={treeLoading}> <Spin tip="loading..." spinning={treeLoading}>
<div className={styles.containerBox}> <div className={styles.containerBox}>
<div className={styles.config}><div className={styles.title}>{formObj}(字段配置)</div> <div className={styles.config}>
<div className={styles.title}>{formObj}(字段配置)</div>
<div className={styles.btn}> <div className={styles.btn}>
<Button type="primary" icon={<PlusSquareOutlined />} onClick={add}>附加</Button> <Button
<Button type="primary" icon={<SortDescendingOutlined /> }onClick={sort}>分组排序</Button> type="primary"
<Button type="primary" icon={<RollbackOutlined />} onClick={back}>返回</Button></div> icon={<PlusSquareOutlined />}
onClick={add}
>
附加
</Button>
<Button
type="primary"
icon={<SortDescendingOutlined />}
onClick={sort}
>
分组排序
</Button>
<Button type="primary" icon={<RollbackOutlined />} onClick={back}>
返回
</Button>
</div>
</div> </div>
<Table <Table
...@@ -343,22 +422,25 @@ const AddModal = props => { ...@@ -343,22 +422,25 @@ const AddModal = props => {
dataSource={tableData} dataSource={tableData}
expandable={{ expandedRowRender }} expandable={{ expandedRowRender }}
size="small" size="small"
rowKey='id' rowKey="id"
expandedRowKeys={select.map(item => item.key)} //展开的行 expandedRowKeys={select.map(item => item.key)} //展开的行
expandRowByClick={true} expandRowByClick={true}
defaultExpandAllRows={true} defaultExpandAllRows={true}
pagination={false} pagination={false}
scroll={{ y: 'calc(100vh - 186px)' }} scroll={{ y: 'calc(100vh - 186px)' }}
size="small" size="small"
onExpand={onUnfold} /> onExpand={onUnfold}
/>
</div> </div>
</Spin><FieldEditor </Spin>
<FieldEditor
isVisible={isVisible} isVisible={isVisible}
isType={isType} isType={isType}
itemData={itemData} itemData={itemData}
formObj1={formObj} formObj1={formObj}
onCancel={() => setIsVisible(false)} onCancel={() => setIsVisible(false)}
callBackSubmit={Submit} /> callBackSubmit={Submit}
/>
{visible && type === 'affiliateAdd' && ( {visible && type === 'affiliateAdd' && (
<AffiliateAdd <AffiliateAdd
visible={visible} visible={visible}
...@@ -378,8 +460,8 @@ const AddModal = props => { ...@@ -378,8 +460,8 @@ const AddModal = props => {
onCancel={() => setVisible(false)} onCancel={() => setVisible(false)}
callBackSubmit={onSubmit} callBackSubmit={onSubmit}
/> />
)}</> )}
</>
); );
}; };
export default AddModal; export default AddModal;
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import {
Row,
Col,
Select,
Spin,
Table,
Input,
Button,
Space,
Tooltip,
Popconfirm,
notification,
} from 'antd';
import {
SyncOutlined,
PlusOutlined,
ArrowUpOutlined,
EditTwoTone,
DeleteOutlined,
VideoCameraOutlined,
ZoomInOutlined,
CaretUpFilled,
CaretDownFilled,
} from '@ant-design/icons';
import voca from 'voca';
import styles from './index.less'; import styles from './index.less';
import { Row, Col, Select, Spin, Table, Input, Button, Space, Tooltip, Popconfirm, notification } from 'antd'; import {
import { SyncOutlined, PlusOutlined, ArrowUpOutlined, EditTwoTone, DeleteOutlined, VideoCameraOutlined, ZoomInOutlined, CaretUpFilled, CaretDownFilled } from '@ant-design/icons'; GetVideoConfigList,
import { GetVideoConfigList, deleteInsertVideoConfig } from '@/services/platform/videoManger'; deleteInsertVideoConfig,
} from '@/services/platform/videoManger';
import AddModal from './AddModal'; import AddModal from './AddModal';
import CheckModal from './CheckModal'; import CheckModal from './CheckModal';
import VideoModal from './VideoModal'; import VideoModal from './VideoModal';
import voca from 'voca';
const videoManager = () => { const videoManager = () => {
const [configurationType, setConfigurationType] = useState('1') const [configurationType, setConfigurationType] = useState('1');
const [loading, setLoading] = useState(false); // 加载 const [loading, setLoading] = useState(false); // 加载
const [searchWord, setSearchWord] = useState(''); // 关键字 const [searchWord, setSearchWord] = useState(''); // 关键字
const { Search } = Input; const { Search } = Input;
const [addVisible, setAddVisible] = useState(false) const [addVisible, setAddVisible] = useState(false);
const [checkVisible, setCheckVisible] = useState(false) const [checkVisible, setCheckVisible] = useState(false);
const [videoVisible, setVideoVisible] = useState(false) const [videoVisible, setVideoVisible] = useState(false);
const [type, setType] = useState('萤石云')//视频厂商类型 const [type, setType] = useState('萤石云'); // 视频厂商类型
const [type1, setType1] = useState('bb')//表单样式 const [type1, setType1] = useState('bb'); // 表单样式
const [kind, setKind] = useState('') const [kind, setKind] = useState('');
const [tableData, setTableData] = useState('') const [tableData, setTableData] = useState('');
const [flag, setFlag] = useState(0) const [flag, setFlag] = useState(0);
const [obj, setObj] = useState({}) const [obj, setObj] = useState({});
const [show1, setShow1] = useState('block') const [show1, setShow1] = useState('block');
const [show2, setShow2] = useState('none') const [show2, setShow2] = useState('none');
const columns = [ const columns = [
{ {
...@@ -31,53 +56,85 @@ const videoManager = () => { ...@@ -31,53 +56,85 @@ const videoManager = () => {
dataIndex: 'Name', dataIndex: 'Name',
key: 'Name', key: 'Name',
width: 200, width: 200,
align: 'center' align: 'center',
}, { },
{
title: '视频厂商', title: '视频厂商',
dataIndex: 'VideoManufacturer', dataIndex: 'VideoManufacturer',
key: 'VideoManufacturer', key: 'VideoManufacturer',
width: 150, width: 150,
align: 'center' align: 'center',
}, { },
{
title: '登录名', title: '登录名',
dataIndex: 'LoginName', dataIndex: 'LoginName',
key: 'LoginName', key: 'LoginName',
width: 350, width: 350,
align: 'center' align: 'center',
}, { },
{
title: '登录密码', title: '登录密码',
dataIndex: 'LoginPwd', dataIndex: 'LoginPwd',
key: 'LoginPwd', key: 'LoginPwd',
width: 350, width: 350,
align: 'center' align: 'center',
}, { },
{
title: '设备编码', title: '设备编码',
dataIndex: 'EquipmentCode', dataIndex: 'EquipmentCode',
key: 'EquipmentCode', key: 'EquipmentCode',
width: 150, width: 150,
align: 'center' align: 'center',
}, { },
{
title: '通道ID', title: '通道ID',
dataIndex: 'PassageId', dataIndex: 'PassageId',
key: 'PassageId', key: 'PassageId',
width: 100, width: 100,
align: 'center' align: 'center',
}, { },
{
title: '刻录机名称', title: '刻录机名称',
dataIndex: 'RecorderName', dataIndex: 'RecorderName',
key: 'RecorderName', key: 'RecorderName',
width: 100, width: 100,
align: 'center' align: 'center',
}, { },
{
// title: '录入时间', // title: '录入时间',
dataIndex: 'CreateTime', dataIndex: 'CreateTime',
key: 'CreateTime', key: 'CreateTime',
width: 150, width: 150,
align: 'center', align: 'center',
title: ( title: (
<div>录入时间<Tooltip title="点击降序"><CaretUpFilled style={{display:show1,color:'#1890ff',marginTop: '-13px', marginLeft: '60%'}} onClick={()=> shengxu()}/></Tooltip><Tooltip title="点击升序"><CaretDownFilled style={{display:show2,color:'#1890ff',marginTop: '-13px', marginLeft: '60%'}} onClick={()=> jiangxu()}/></Tooltip></div> <div>
) 录入时间
}, { <Tooltip title="点击降序">
<CaretUpFilled
style={{
display: show1,
color: '#1890ff',
marginTop: '-13px',
marginLeft: '60%',
}}
onClick={() => shengxu()}
/>
</Tooltip>
<Tooltip title="点击升序">
<CaretDownFilled
style={{
display: show2,
color: '#1890ff',
marginTop: '-13px',
marginLeft: '60%',
}}
onClick={() => jiangxu()}
/>
</Tooltip>
</div>
),
},
{
title: '操作', title: '操作',
dataIndex: '', dataIndex: '',
key: '', key: '',
...@@ -123,25 +180,25 @@ const videoManager = () => { ...@@ -123,25 +180,25 @@ const videoManager = () => {
</Tooltip> </Tooltip>
</Space> </Space>
), ),
} },
] ];
const edit = record =>{ const edit = record => {
setAddVisible(true) setAddVisible(true);
setKind('edit') setKind('edit');
setObj(record) setObj(record);
} };
const preView = record =>{ const preView = record => {
setVideoVisible(true) setVideoVisible(true);
setObj(record) setObj(record);
} };
const check = record =>{ const check = record => {
setCheckVisible(true) setCheckVisible(true);
setObj(record) setObj(record);
console.log(record) console.log(record);
} };
const delete1 = record =>{ const delete1 = record => {
deleteInsertVideoConfig({Id:record.Id}).then(res =>{ deleteInsertVideoConfig({ Id: record.Id }).then(res => {
if (res.msg === 'Ok') { if (res.msg === 'Ok') {
notification.success({ notification.success({
message: '提示', message: '提示',
...@@ -156,120 +213,120 @@ const videoManager = () => { ...@@ -156,120 +213,120 @@ const videoManager = () => {
description: res.msg, description: res.msg,
}); });
} }
}) });
} };
const shengxu =()=>{ const shengxu = () => {
setShow1('none') setShow1('none');
setShow2('block') setShow2('block');
setLoading(true) setLoading(true);
GetVideoConfigList({ GetVideoConfigList({
VideoType: type, VideoType: type,
pageIndex: 1, pageIndex: 1,
pageSize: 1000, pageSize: 1000,
IsAsc:true IsAsc: true,
}).then(res=>{ }).then(res => {
setLoading(false) setLoading(false);
if(res.msg ==='Ok'){ if (res.msg === 'Ok') {
setTableData(res.data.list) setTableData(res.data.list);
}
})
} }
const jiangxu =()=>{ });
setShow2('none') };
setShow1('block') const jiangxu = () => {
setLoading(true) setShow2('none');
setShow1('block');
setLoading(true);
GetVideoConfigList({ GetVideoConfigList({
VideoType: type, VideoType: type,
pageIndex: 1, pageIndex: 1,
pageSize: 1000, pageSize: 1000,
IsAsc:false IsAsc: false,
}).then(res=>{ }).then(res => {
setLoading(false) setLoading(false);
if(res.msg ==='Ok'){ if (res.msg === 'Ok') {
setTableData(res.data.list) setTableData(res.data.list);
}
})
} }
useEffect(()=>{ });
setLoading(true) };
getData() useEffect(() => {
},[]) setLoading(true);
getData();
}, []);
useEffect(()=>{ useEffect(() => {
setLoading(true) setLoading(true);
getData() getData();
},[type,flag]) }, [type, flag]);
const getData =() =>{ const getData = () => {
GetVideoConfigList({ GetVideoConfigList({
VideoType: type, VideoType: type,
pageIndex: 1, pageIndex: 1,
pageSize: 1000 pageSize: 1000,
}).then(res=>{ }).then(res => {
setLoading(false) setLoading(false);
if(res.msg ==='Ok'){ if (res.msg === 'Ok') {
setTableData(res.data.list) setTableData(res.data.list);
}
})
} }
});
};
const selectChange = value => { const selectChange = value => {
setConfigurationType(value) setConfigurationType(value);
switch (value) { switch (value) {
case '1': case '1':
setType('萤石云') setType('萤石云');
setType1('bb') setType1('bb');
break; break;
case '2': case '2':
setType('海康') setType('海康');
setType1('bb') setType1('bb');
break; break;
case '3': case '3':
setType('海康1.2') setType('海康1.2');
setType1('aa') setType1('aa');
break; break;
case '4': case '4':
setType('海康NVR') setType('海康NVR');
setType1('aa') setType1('aa');
break; break;
} }
} };
// 获取搜索框的值 // 获取搜索框的值
const handleSearch = e => { const handleSearch = e => {
setSearchWord(e.target.value); setSearchWord(e.target.value);
}; };
//搜索 // 搜索
const submitSearchUser = () => { const submitSearchUser = () => {
GetVideoConfigList({ GetVideoConfigList({
VideoType: type, VideoType: type,
pageIndex: 1, pageIndex: 1,
pageSize: 1000, pageSize: 1000,
QueryWhere: searchWord QueryWhere: searchWord,
}).then(res=>{ }).then(res => {
if(res.msg ==='Ok'){ if (res.msg === 'Ok') {
setTableData(res.data.list) setTableData(res.data.list);
}
})
} }
//重置 });
};
// 重置
const handleReset = () => { const handleReset = () => {
setConfigurationType('1') setConfigurationType('1');
setSearchWord('') setSearchWord('');
setType('萤石云') setType('萤石云');
setType1('bb') setType1('bb');
setFlag(flag+1) setFlag(flag + 1);
} };
//新增 // 新增
const addVideo = () => { const addVideo = () => {
setAddVisible(true) setAddVisible(true);
setKind('add') setKind('add');
} };
const onSubmit =()=>{ const onSubmit = () => {
setAddVisible(false) setAddVisible(false);
setFlag(flag+1) setFlag(flag + 1);
} };
return ( return (
<div className={styles.videoManagerContainer}> <div className={styles.videoManagerContainer}>
<Row className={styles.head}> <Row className={styles.head}>
...@@ -295,11 +352,27 @@ const videoManager = () => { ...@@ -295,11 +352,27 @@ const videoManager = () => {
enterButton enterButton
value={searchWord} value={searchWord}
/> />
<Button icon={<SyncOutlined className={styles.icon} />} onClick={handleReset} style={{ marginLeft: '30px', verticalAlign: 'middle', marginTop: '-3px' }}> <Button
重置 icon={<SyncOutlined className={styles.icon} />}
onClick={handleReset}
style={{
marginLeft: '30px',
verticalAlign: 'middle',
marginTop: '-3px',
}}
>
}} > 重置
</Button> </Button>
<Button icon={<PlusOutlined className={styles.icon} />} onClick={addVideo} style={{ marginLeft: '49%', verticalAlign: 'middle', marginTop: '-3px' }}> <Button
新增 icon={<PlusOutlined className={styles.icon} />}
onClick={addVideo}
style={{
marginLeft: '49%',
verticalAlign: 'middle',
marginTop: '-3px',
}}
>
}} > 新增
</Button> </Button>
</Col> </Col>
</Row> </Row>
...@@ -311,12 +384,13 @@ const videoManager = () => { ...@@ -311,12 +384,13 @@ const videoManager = () => {
rowKey={record => record.Id} rowKey={record => record.Id}
columns={columns} columns={columns}
dataSource={tableData} dataSource={tableData}
scroll={{y: 'calc(100vh - 210px)' }} scroll={{ y: 'calc(100vh - 210px)' }}
onRow={record => { onRow={record => ({
return { onDoubleClick: event => {
onDoubleClick: event => {event.stopPropagation(); edit(record)}, //双击 event.stopPropagation();
}; edit(record);
}} }, // 双击
})}
pagination={{ pagination={{
showTotal: (total, range) => showTotal: (total, range) =>
`第${range[0]}-${range[1]} 条/共 ${total} 条`, `第${range[0]}-${range[1]} 条/共 ${total} 条`,
...@@ -331,7 +405,7 @@ const videoManager = () => { ...@@ -331,7 +405,7 @@ const videoManager = () => {
<AddModal <AddModal
visible={addVisible} visible={addVisible}
onCancel={() => { onCancel={() => {
setAddVisible(false) setAddVisible(false);
}} }}
okText="确认" okText="确认"
cancelText="取消" cancelText="取消"
...@@ -344,7 +418,7 @@ const videoManager = () => { ...@@ -344,7 +418,7 @@ const videoManager = () => {
<CheckModal <CheckModal
visible={checkVisible} visible={checkVisible}
onCancel={() => { onCancel={() => {
setCheckVisible(false) setCheckVisible(false);
}} }}
okText="确认" okText="确认"
cancelText="取消" cancelText="取消"
...@@ -355,13 +429,12 @@ const videoManager = () => { ...@@ -355,13 +429,12 @@ const videoManager = () => {
<VideoModal <VideoModal
visible={videoVisible} visible={videoVisible}
onCancel={() => { onCancel={() => {
setVideoVisible(false) setVideoVisible(false);
}} }}
obj={obj} obj={obj}
/> />
</div> </div>
) );
}; };
export default videoManager; export default videoManager;
...@@ -107,6 +107,7 @@ const UserManage = () => { ...@@ -107,6 +107,7 @@ const UserManage = () => {
const [searchWord, setSearchWord] = useState(''); // 关键字 const [searchWord, setSearchWord] = useState(''); // 关键字
const [currentSelectOrg, setCurrentSelectOrg] = useState('-1'); // 左侧机构树-选中组织,字符串类型默认全部机构'-1',注意用户表中的OUID是数字 const [currentSelectOrg, setCurrentSelectOrg] = useState('-1'); // 左侧机构树-选中组织,字符串类型默认全部机构'-1',注意用户表中的OUID是数字
const [currentSelectOldOrg, setCurrentSelectOldOrg] = useState([]); // 更改机构时的树-原先选中组织 const [currentSelectOldOrg, setCurrentSelectOldOrg] = useState([]); // 更改机构时的树-原先选中组织
const [showSearchStyle, setShowSearchStyle] = useState(false); // 是否显示模糊查询样式
/** ***Modal弹框,是否可视**** */ /** ***Modal弹框,是否可视**** */
const [userVisible, setUserVisible] = useState(false); // 添加用户 const [userVisible, setUserVisible] = useState(false); // 添加用户
...@@ -143,7 +144,7 @@ const UserManage = () => { ...@@ -143,7 +144,7 @@ const UserManage = () => {
const [currentOrgArea, setCurrentOrgArea] = useState(''); const [currentOrgArea, setCurrentOrgArea] = useState('');
const [currentOrgDistinct, setCurrentOrgDistinct] = useState(''); const [currentOrgDistinct, setCurrentOrgDistinct] = useState('');
const [saveExtentFlag, setSaveExtentFlag] = useState(0); const [saveExtentFlag, setSaveExtentFlag] = useState(0);
const [filteredValue,setFilteredValue] =useState([]); const [filteredValue, setFilteredValue] = useState([]);
const { Search } = Input; const { Search } = Input;
const setRowClassName = record => const setRowClassName = record =>
record.userID === selectColor.userID ? styles.clickRowStyle : ''; record.userID === selectColor.userID ? styles.clickRowStyle : '';
...@@ -155,30 +156,14 @@ const UserManage = () => { ...@@ -155,30 +156,14 @@ const UserManage = () => {
key: 'loginName', key: 'loginName',
width: 150, width: 150,
// fixed: 'left', // fixed: 'left',
render: item => ( render: item => searchStyle(item),
<div
ref={r => {
if (r) {
r.innerHTML = item;
}
}}
/>
),
}, },
{ {
title: '用户姓名', title: '用户姓名',
dataIndex: 'userName', dataIndex: 'userName',
key: 'userName', key: 'userName',
width: 150, width: 150,
render: item => ( render: item => searchStyle(item),
<div
ref={r => {
if (r) {
r.innerHTML = item;
}
}}
/>
),
}, },
{ {
title: '所在机构', title: '所在机构',
...@@ -196,17 +181,9 @@ const UserManage = () => { ...@@ -196,17 +181,9 @@ const UserManage = () => {
key: 'phone', key: 'phone',
width: 150, width: 150,
ellipsis: true, ellipsis: true,
render: record => { render: text => {
if (record) { if (text) {
return ( return searchStyle(text);
<div
ref={r => {
if (r) {
r.innerHTML = record;
}
}}
/>
);
} }
return <span>未绑定</span>; return <span>未绑定</span>;
}, },
...@@ -338,10 +315,7 @@ const UserManage = () => { ...@@ -338,10 +315,7 @@ const UserManage = () => {
<div style={{ width: '130px' }}> <div style={{ width: '130px' }}>
<Form form={form}> <Form form={form}>
<Item> <Item>
<Radio.Group <Radio.Group value={selectValue} onChange={onTypeChange}>
value={selectValue}
onChange={onTypeChange}
>
<Space direction="vertical"> <Space direction="vertical">
<Radio value={0}>访客</Radio> <Radio value={0}>访客</Radio>
<Radio value={1}>普通用户</Radio> <Radio value={1}>普通用户</Radio>
...@@ -387,7 +361,19 @@ const UserManage = () => { ...@@ -387,7 +361,19 @@ const UserManage = () => {
), ),
}, },
]; ];
// 模糊查询匹配的样式
const searchStyle = val => {
let n;
if (showSearchStyle) {
n = val.replace(
new RegExp(searchWord, 'g'),
`<span style='color:red'>${searchWord}</span>`,
);
} else {
n = val;
}
return <div dangerouslySetInnerHTML={{ __html: n }} />;
};
// 获取搜索框的值 // 获取搜索框的值
const handleSearch = e => { const handleSearch = e => {
setSearchWord(e.target.value); setSearchWord(e.target.value);
...@@ -419,7 +405,7 @@ const UserManage = () => { ...@@ -419,7 +405,7 @@ const UserManage = () => {
<span className={styles.titleText}>{org.text}</span> <span className={styles.titleText}>{org.text}</span>
<span className={styles.tip}> <span className={styles.tip}>
<Tooltip title="" className={styles.fs}> <Tooltip title="" className={styles.fs}>
<Dropdown overlay={orgButtonMenu} disabled={currentOrgOperate} > <Dropdown overlay={orgButtonMenu} disabled={currentOrgOperate}>
<PlusOutlined <PlusOutlined
style={{ marginLeft: 20 }} style={{ marginLeft: 20 }}
onClick={e => e.stopPropagation()} onClick={e => e.stopPropagation()}
...@@ -472,7 +458,7 @@ const UserManage = () => { ...@@ -472,7 +458,7 @@ const UserManage = () => {
.then(newres => { .then(newres => {
if (newres.code === 0) { if (newres.code === 0) {
let res = newres.data; let res = newres.data;
console.log(res) console.log(res);
setTreeLoading(false); setTreeLoading(false);
setTreeData(res); setTreeData(res);
setTreeDataCopy(res); setTreeDataCopy(res);
...@@ -511,8 +497,8 @@ const UserManage = () => { ...@@ -511,8 +497,8 @@ const UserManage = () => {
// 点击树节点,获取当前机构下所有用户 // 点击树节点,获取当前机构下所有用户
const onSelect = (props, e) => { const onSelect = (props, e) => {
console.log(e) console.log(e);
console.log(props) console.log(props);
setTableLoading(true); setTableLoading(true);
if (e) { if (e) {
setOrgTitle(e.node.title.props.children[0].props.children); setOrgTitle(e.node.title.props.children[0].props.children);
...@@ -533,6 +519,7 @@ const UserManage = () => { ...@@ -533,6 +519,7 @@ const UserManage = () => {
groupID: props[0], groupID: props[0],
}).then(res => { }).then(res => {
if (res.code === 0) { if (res.code === 0) {
console.log(res);
setCurrentOrgArea(res.data.MapRange); setCurrentOrgArea(res.data.MapRange);
setCurrentOrgDistinct(res.data.AreeName); setCurrentOrgDistinct(res.data.AreeName);
} }
...@@ -562,6 +549,7 @@ const UserManage = () => { ...@@ -562,6 +549,7 @@ const UserManage = () => {
item.key = index; item.key = index;
return item; return item;
}); });
setShowSearchStyle(false);
setTableData(table); setTableData(table);
} else { } else {
setTableLoading(false); setTableLoading(false);
...@@ -773,12 +761,12 @@ const UserManage = () => { ...@@ -773,12 +761,12 @@ const UserManage = () => {
const onTypeChange = value => { const onTypeChange = value => {
setSelctValue(value.target.value); setSelctValue(value.target.value);
}; };
const authUser = (record) => { const authUser = record => {
setCurrentUser(record); setCurrentUser(record);
console.log(selectValue) console.log(selectValue);
AddUserAuthSetting({ AddUserAuthSetting({
userId: record.userID, userId: record.userID,
userLevel: selectValue userLevel: selectValue,
}).then(res => { }).then(res => {
if (res.code === 0) { if (res.code === 0) {
message.info('提交成功'); message.info('提交成功');
...@@ -817,12 +805,14 @@ const UserManage = () => { ...@@ -817,12 +805,14 @@ const UserManage = () => {
setOrgTitle('全部机构搜索结果'); // 设置表头 setOrgTitle('全部机构搜索结果'); // 设置表头
setCurrentSelectOrg('-1'); // 清空选中机构 setCurrentSelectOrg('-1'); // 清空选中机构
console.log(res.data); console.log(res.data);
setShowSearchStyle(true);
setTableData(res.data); setTableData(res.data);
setTableLength(res.data.length); setTableLength(res.data.length);
} else { } else {
notification.error({ notification.error({
message: '提交失败', message: '提示',
description: res.message, duration: 3,
description: res.msg,
}); });
} }
}) })
...@@ -1137,7 +1127,7 @@ const UserManage = () => { ...@@ -1137,7 +1127,7 @@ const UserManage = () => {
let res = newres.data; let res = newres.data;
setTreeLoading(false); setTreeLoading(false);
setSearchWord(''); setSearchWord('');
setFilteredValue([]) setFilteredValue([]);
// 第一次加载,默认选择第一个组织 // 第一次加载,默认选择第一个组织
onSelect([res[0].id], false); onSelect([res[0].id], false);
} else { } else {
...@@ -1154,9 +1144,9 @@ const UserManage = () => { ...@@ -1154,9 +1144,9 @@ const UserManage = () => {
message.error(err); message.error(err);
}); });
}; };
const onChangeInput = (filters) =>{ const onChangeInput = filters => {
setFilteredValue(filters.OUName); setFilteredValue(filters.OUName);
} };
// 更改机构范围 // 更改机构范围
const submitExtent = (extent, areaName) => { const submitExtent = (extent, areaName) => {
...@@ -1177,14 +1167,14 @@ const UserManage = () => { ...@@ -1177,14 +1167,14 @@ const UserManage = () => {
setEditOrgExtentVisible(false); setEditOrgExtentVisible(false);
}; };
const addChange =e=>{ const addChange = e => {
console.log(e) console.log(e);
e.domEvent.stopPropagation() e.domEvent.stopPropagation();
} };
/** ***操作按钮**** */ /** ***操作按钮**** */
// 机构操作 // 机构操作
const orgButtonMenu = ( const orgButtonMenu = (
<Menu onClick={e =>addChange(e)}> <Menu onClick={e => addChange(e)}>
<Menu.Item key="1" onClick={addUser} icon={<UserAddOutlined />}> <Menu.Item key="1" onClick={addUser} icon={<UserAddOutlined />}>
添加用户 添加用户
</Menu.Item> </Menu.Item>
...@@ -1194,7 +1184,7 @@ const UserManage = () => { ...@@ -1194,7 +1184,7 @@ const UserManage = () => {
</Menu> </Menu>
); );
const orgButtonMenu1 = ( const orgButtonMenu1 = (
<Menu onClick={e =>addChange(e)}> <Menu onClick={e => addChange(e)}>
<Menu.Item key="3" onClick={editOrg} icon={<EditOutlined />}> <Menu.Item key="3" onClick={editOrg} icon={<EditOutlined />}>
编辑当前机构 编辑当前机构
</Menu.Item> </Menu.Item>
...@@ -1231,7 +1221,7 @@ const UserManage = () => { ...@@ -1231,7 +1221,7 @@ const UserManage = () => {
{/* 左侧机构树 */} {/* 左侧机构树 */}
<Spin spinning={treeLoading} tip="loading..."> <Spin spinning={treeLoading} tip="loading...">
<Card <Card
style={{overflowY:'hidden'}} style={{ overflowY: 'hidden' }}
className={classnames({ className={classnames({
[styles.orgContainer]: true, [styles.orgContainer]: true,
[styles.orgContainerHide]: !treeVisible, [styles.orgContainerHide]: !treeVisible,
...@@ -1242,7 +1232,7 @@ const UserManage = () => { ...@@ -1242,7 +1232,7 @@ const UserManage = () => {
style={{ style={{
fontSize: '15px ', fontSize: '15px ',
fontWeight: 'bold', fontWeight: 'bold',
marginLeft: '15px' marginLeft: '15px',
}} }}
> >
机构列表 机构列表
...@@ -1254,11 +1244,13 @@ const UserManage = () => { ...@@ -1254,11 +1244,13 @@ const UserManage = () => {
color: '#1890FF', color: '#1890FF',
fontSize: '25px', fontSize: '25px',
verticalAlign: 'middle', verticalAlign: 'middle',
marginLeft: '67%' marginLeft: '67%',
}} }}
/> />
</Tooltip> </Tooltip>
<hr style={{ width: '95%', color: '#eeecec' ,marginLeft: '15px'}} /> <hr
style={{ width: '95%', color: '#eeecec', marginLeft: '15px' }}
/>
{treeData.length > 0 && ( {treeData.length > 0 && (
<Tree <Tree
showIcon="true" showIcon="true"
...@@ -1271,7 +1263,7 @@ const UserManage = () => { ...@@ -1271,7 +1263,7 @@ const UserManage = () => {
onSelect={onSelect} onSelect={onSelect}
height={ height={
treeData.length && treeData.length > 30 treeData.length && treeData.length > 30
? treeData.length * 18+50 ? treeData.length * 18 + 50
: 1000 : 1000
} }
treeData={treeData.map(t => mapTree(t))} treeData={treeData.map(t => mapTree(t))}
......
...@@ -9,20 +9,20 @@ import { CITY_SERVICE, get, PUBLISH_SERVICE, post, postForm } from '../index'; ...@@ -9,20 +9,20 @@ import { CITY_SERVICE, get, PUBLISH_SERVICE, post, postForm } from '../index';
// 巡维保计划数据获取 // 巡维保计划数据获取
export const CM_XWBPlan_DataList = query => export const CM_XWBPlan_DataList = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_XWBPlan_DataList`, query); get(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_XWBPlan_DataList`, query);
//巡维保计划关联设备台账 // 巡维保计划关联设备台账
export const CM_XWBPlan_AccountTable = query => export const CM_XWBPlan_AccountTable = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_XWBPlan_AccountTable`, query); get(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_XWBPlan_AccountTable`, query);
//计划关联反馈台账表 // 计划关联反馈台账表
export const CM_XWBPlan_feedbackTable = query => export const CM_XWBPlan_feedbackTable = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_XWBPlan_feedbackTable`, query); get(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_XWBPlan_feedbackTable`, query);
//巡维保计划数据删除 // 巡维保计划数据删除
export const CM_XWBPlan_RemovePlan = query => export const CM_XWBPlan_RemovePlan = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_XWBPlan_RemovePlan`, query); get(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_XWBPlan_RemovePlan`, query);
//巡维保计划数据编辑OR添加 // 巡维保计划数据编辑OR添加
export const CM_XWBPlan_DataEditORAdd = data => export const CM_XWBPlan_DataEditORAdd = data =>
post(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_XWBPlan_DataEditORAdd`, data); post(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_XWBPlan_DataEditORAdd`, data);
...@@ -92,19 +92,18 @@ export const getRoleListPlain = params => ...@@ -92,19 +92,18 @@ export const getRoleListPlain = params =>
export const deleteWebsite = params => export const deleteWebsite = params =>
get(`${PUBLISH_SERVICE}/WebSite/MiniApp_DeleteWebsite`, params); get(`${PUBLISH_SERVICE}/WebSite/MiniApp_DeleteWebsite`, params);
// 新增小程序 // 新增小程序
export const addWebsite = (params, options) => { export const addWebsite = (params, options) =>
// let strParams = JSON.stringify(params); // let strParams = JSON.stringify(params);
// let qsParams = qs.stringify({ config: strParams }); // let qsParams = qs.stringify({ config: strParams });
return post( post(
`${PUBLISH_SERVICE}/WebSite/MiniApp_AddWebsite?_version=9999`, `${PUBLISH_SERVICE}/WebSite/MiniApp_AddWebsite?_version=9999`,
params, params,
options, options,
); );
};
// 菜单拖拽 // 菜单拖拽
export const dragMenu = params => export const dragMenu = params =>
get(`${CITY_SERVICE}/OMS.svc/P_DragMenu`, params); post(`${PUBLISH_SERVICE}/WebSite/DragMenu `, params);
export const deleteMiniMenu = params => export const deleteMiniMenu = params =>
get(`${PUBLISH_SERVICE}/PlatformCenter/DeleteMiniMenu`, params); get(`${PUBLISH_SERVICE}/PlatformCenter/DeleteMiniMenu`, params);
......
...@@ -13,7 +13,7 @@ export const UpdateFlowGroup = param => ...@@ -13,7 +13,7 @@ export const UpdateFlowGroup = param =>
post(`${PUBLISH_SERVICE}/WorkFlow/UpdateFlowGroup`, param); post(`${PUBLISH_SERVICE}/WorkFlow/UpdateFlowGroup`, param);
// 查询全部角色对应的人员 // 查询全部角色对应的人员
export const GetRoleUser = param => export const GetRoleUser = param =>
get(`${PUBLISH_SERVICE}/WorkFlow/GetRoleUser`, param); post(`${PUBLISH_SERVICE}/WorkFlow/GetRoleUser`, param);
// 获取节点信息 // 获取节点信息
export const GetNodeInfo = param => export const GetNodeInfo = param =>
get(`${PUBLISH_SERVICE}/WorkFlow/GetNodeInfo`, param); get(`${PUBLISH_SERVICE}/WorkFlow/GetNodeInfo`, param);
......
...@@ -11,92 +11,109 @@ import { CITY_SERVICE, get, PUBLISH_SERVICE, post, postForm } from '../index'; ...@@ -11,92 +11,109 @@ import { CITY_SERVICE, get, PUBLISH_SERVICE, post, postForm } from '../index';
export const GetCM_Ledger_LoadLedgers = query => export const GetCM_Ledger_LoadLedgers = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/GetCM_Ledger_LoadLedgers`, query); get(`${PUBLISH_SERVICE}/WorkOrderCenter/GetCM_Ledger_LoadLedgers`, query);
// 加载台账表 // 加载台账表
export const GetCM_Ledger_LoadLedgerTable = query => export const GetCM_Ledger_LoadLedgerTable = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/GetCM_Ledger_LoadLedgerTable`, query); get(`${PUBLISH_SERVICE}/WorkOrderCenter/GetCM_Ledger_LoadLedgerTable`, query);
// 查看对应台账 // 查看对应台账
export const GetCMLedger_QueryLedgers = query => export const GetCMLedger_QueryLedgers = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/GetCMLedger_QueryLedgers`, query); get(`${PUBLISH_SERVICE}/WorkOrderCenter/GetCMLedger_QueryLedgers`, query);
// 编辑或新增台账 // 编辑或新增台账
export const GetCMLedger_OperateLedger = data => export const GetCMLedger_OperateLedger = data =>
post(`${PUBLISH_SERVICE}/WorkOrderCenter/GetCMLedger_OperateLedger`, data); post(`${PUBLISH_SERVICE}/WorkOrderCenter/GetCMLedger_OperateLedger`, data);
// 删除台账 // 删除台账
export const CM_Ledger_RmoveLedger = query => export const CM_Ledger_RmoveLedger = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Ledger_RmoveLedger`, query); get(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Ledger_RmoveLedger`, query);
// 加载事件 // 加载事件
export const GetCM_Event_LoadEventTable = query => export const GetCM_Event_LoadEventTable = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/GetCM_Event_LoadEventTable`, query); get(`${PUBLISH_SERVICE}/WorkOrderCenter/GetCM_Event_LoadEventTable`, query);
// 加载事件主表 // 加载事件主表
export const GetCM_Event_LoadEventTypeTable = query => export const GetCM_Event_LoadEventTypeTable = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/GetCM_Event_LoadEventTypeTable`, query); get(
`${PUBLISH_SERVICE}/WorkOrderCenter/GetCM_Event_LoadEventTypeTable`,
query,
);
//根据触发事件加载字段 // 根据触发事件加载字段
export const LoadEventFields = query => export const LoadEventFields = query =>
get(`${PUBLISH_SERVICE}/CaseManage/LoadEventFields`, query); get(`${PUBLISH_SERVICE}/CaseManage/LoadEventFields`, query);
// 加载事件权限部门角色 // 加载事件权限部门角色
export const CM_Event_LoadDepartmentAndRoles = query => export const CM_Event_LoadDepartmentAndRoles = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Event_LoadDepartmentAndRoles`, query); get(
`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Event_LoadDepartmentAndRoles`,
query,
);
// 修改事件类型 // 修改事件类型
export const CM_Event_EditEventTable = data => export const CM_Event_EditEventTable = data =>
post(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Event_EditEventTable`, data); post(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Event_EditEventTable`, data);
// 加载事件权限部门角色 // 加载事件权限部门角色
export const GetCM_Event_QueryEventType = query => export const GetCM_Event_QueryEventType = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/GetCM_Event_QueryEventType`, query); get(`${PUBLISH_SERVICE}/WorkOrderCenter/GetCM_Event_QueryEventType`, query);
// 添加事件类型表 // 添加事件类型表
export const CM_Event_AddEventTable = data => export const CM_Event_AddEventTable = data =>
post(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Event_AddEventTable`, data); post(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Event_AddEventTable`, data);
// 删除事件类型表 // 删除事件类型表
export const CM_Event_RemoveEventTable = eventTypeIDs => export const CM_Event_RemoveEventTable = eventTypeIDs =>
post(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Event_RemoveEventTable?eventTypeIDs=${eventTypeIDs}`); post(
`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Event_RemoveEventTable?eventTypeIDs=${eventTypeIDs}`,
);
// 事件类型调序 // 事件类型调序
export const CM_Event_ReOrder = eventTypeIDs => export const CM_Event_ReOrder = eventTypeIDs =>
post(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Event_ReOrder?eventTypeIDs=${eventTypeIDs}`); post(
`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Event_ReOrder?eventTypeIDs=${eventTypeIDs}`,
);
// 点击受理流程之后加载受理流程和权限,显示字段为FlowName,FlowRoles // 点击受理流程之后加载受理流程和权限,显示字段为FlowName,FlowRoles
export const GetCM_Event_LoadEvenFlows = query => export const GetCM_Event_LoadEvenFlows = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/GetCM_Event_LoadEvenFlows`, query); get(`${PUBLISH_SERVICE}/WorkOrderCenter/GetCM_Event_LoadEvenFlows`, query);
// 点击添加之后加载受理流程集 // 点击添加之后加载受理流程集
export const CM_Event_ReloadFlows = query => export const CM_Event_ReloadFlows = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Event_ReloadFlows`, query); get(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Event_ReloadFlows`, query);
// 添加受理流程 // 添加受理流程
export const CM_Event_AddEvenFlow = query => export const CM_Event_AddEvenFlow = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Event_AddEvenFlow`, query); get(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Event_AddEvenFlow`, query);
// 编辑受理流程 // 编辑受理流程
export const CM_Event_EditEvenFlow = query => export const CM_Event_EditEvenFlow = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Event_EditEvenFlow`, query); get(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Event_EditEvenFlow`, query);
// 删除受理流程 // 删除受理流程
export const CM_Event_RemoveEvenFlow = query => export const CM_Event_RemoveEvenFlow = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Event_RemoveEvenFlow`, query); get(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Event_RemoveEvenFlow`, query);
// 加载事件辅助视图配置信息 // 加载事件辅助视图配置信息
export const CM_Event_ReloadEventExtendPages = query => export const CM_Event_ReloadEventExtendPages = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Event_ReloadEventExtendPages`, query); get(
`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Event_ReloadEventExtendPages`,
query,
);
// 添加或修改事件辅助视图配置 // 添加或修改事件辅助视图配置
export const CM_Event_OperateEventExtendPage = data => export const CM_Event_OperateEventExtendPage = data =>
post(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Event_OperateEventExtendPage`, data); post(
`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Event_OperateEventExtendPage`,
data,
);
// 查询事件辅助视图配置信息 // 查询事件辅助视图配置信息
export const GetEventExtendPage = query => export const GetEventExtendPage = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/GetEventExtendPage`, query); get(`${PUBLISH_SERVICE}/WorkOrderCenter/GetEventExtendPage`, query);
// 删除事件辅助视图配置 // 删除事件辅助视图配置
export const CM_Event_RemoveEventExtendPage = query => export const CM_Event_RemoveEventExtendPage = query =>
get(`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Event_RemoveEventExtendPage`, query); get(
`${PUBLISH_SERVICE}/WorkOrderCenter/CM_Event_RemoveEventExtendPage`,
query,
);
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