Commit 3e3176b1 authored by 皮倩雯's avatar 皮倩雯

数据库初始化追加界面优化升级

parent 9a174ae4
Pipeline #59354 passed with stages
...@@ -45,6 +45,7 @@ import { ...@@ -45,6 +45,7 @@ import {
regroupTableType, regroupTableType,
} from '@/services/tablemanager/tablemanager'; } from '@/services/tablemanager/tablemanager';
import { useHistory } from 'react-router-dom'; import { useHistory } from 'react-router-dom';
import { Ellipse } from 'bizcharts/lib/g-components';
import styles from './index.less'; import styles from './index.less';
import Editor from './components/Field/editor'; import Editor from './components/Field/editor';
// import AddTablelList from './components/Field/addTable'; // import AddTablelList from './components/Field/addTable';
...@@ -53,7 +54,6 @@ import AffiliateAdd from './components/Field/affiliateAdd'; ...@@ -53,7 +54,6 @@ import AffiliateAdd from './components/Field/affiliateAdd';
import LoadGroup from './components/Field/loadGroup'; import LoadGroup from './components/Field/loadGroup';
import LoadGroupNew from './components/Field/loadGroupNew'; import LoadGroupNew from './components/Field/loadGroupNew';
import { defaultFields } from './components/defaultFields'; import { defaultFields } from './components/defaultFields';
import { Ellipse } from 'bizcharts/lib/g-components';
const { Search } = Input; const { Search } = Input;
const { Option } = Select; const { Option } = Select;
const placeholder = '请输入表名'; const placeholder = '请输入表名';
...@@ -122,9 +122,7 @@ const TableManager = props => { ...@@ -122,9 +122,7 @@ const TableManager = props => {
selectValue, selectValue,
} = props.history.location.query; } = props.history.location.query;
setSelectTableName(template); setSelectTableName(template);
const i = group.findIndex(item => { const i = group.findIndex(item => item.type == selectValue);
return item.type == selectValue;
});
setTimeout(() => { setTimeout(() => {
setSelect(selectValue); setSelect(selectValue);
setPickIndex(i); setPickIndex(i);
...@@ -260,7 +258,7 @@ const TableManager = props => { ...@@ -260,7 +258,7 @@ const TableManager = props => {
}); });
}); });
console.log(sortList, 'sortList'); console.log(sortList, 'sortList');
console.log(groupData);
setAllData(groupData); setAllData(groupData);
if (!props.history.location.query || initNum.current > 0) { if (!props.history.location.query || initNum.current > 0) {
if (newArr.length > 0 && (!select || isSearch)) { if (newArr.length > 0 && (!select || isSearch)) {
...@@ -357,7 +355,7 @@ const TableManager = props => { ...@@ -357,7 +355,7 @@ const TableManager = props => {
key: 'tableStyle', key: 'tableStyle',
align: 'center', align: 'center',
width: 80, width: 80,
render: text => <div>{text || '大'}</div>, render: text => <div>{text}</div>,
}, },
{ {
title: '附加字段', title: '附加字段',
......
...@@ -308,7 +308,6 @@ const incident = () => { ...@@ -308,7 +308,6 @@ const incident = () => {
console.log(newArr, 'newArr'); console.log(newArr, 'newArr');
setTreeData(newArr); setTreeData(newArr);
}else{ }else{
console.log(123)
notification.error({ notification.error({
message: '提示', message: '提示',
duration: 3, duration: 3,
......
...@@ -2,7 +2,13 @@ ...@@ -2,7 +2,13 @@
/* eslint-disable no-restricted-syntax */ /* eslint-disable no-restricted-syntax */
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { Button, Space, notification, Modal, Popconfirm, Empty, Spin, Tooltip } from 'antd'; import { Button, Space, notification, Modal, Popconfirm, Empty, Spin, Tooltip } from 'antd';
import { BarcodeOutlined, UserOutlined, CalendarOutlined } from '@ant-design/icons'; import {
BarcodeOutlined,
UserOutlined,
CalendarOutlined,
PlusOutlined,
CheckOutlined,
} from '@ant-design/icons';
import styles from './DatabaseInitialization.less'; import styles from './DatabaseInitialization.less';
import { GetLicenseDifference, InitEditDataBase, GetProductList } from '@/services/database/api'; import { GetLicenseDifference, InitEditDataBase, GetProductList } from '@/services/database/api';
...@@ -21,6 +27,7 @@ const AppendModal = props => { ...@@ -21,6 +27,7 @@ const AppendModal = props => {
const [project1, setProject1] = useState(''); const [project1, setProject1] = useState('');
const [name1, setName1] = useState(''); const [name1, setName1] = useState('');
const [number1, setNumber1] = useState(''); const [number1, setNumber1] = useState('');
const [allValue, setAllValue] = useState([]);
useEffect(() => { useEffect(() => {
if (visible) { if (visible) {
...@@ -63,6 +70,13 @@ const AppendModal = props => { ...@@ -63,6 +70,13 @@ const AppendModal = props => {
GetLicenseDifference(value).then(res => { GetLicenseDifference(value).then(res => {
setLoading(false); setLoading(false);
if (res.code === 0) { if (res.code === 0) {
let aab = [];
res.data.map(k => {
if (k.status == 0) {
aab.push(k.name);
}
});
setAllValue(aab);
let arr = formateArrDataA(res.data, 'productName'); let arr = formateArrDataA(res.data, 'productName');
let aa = Object.keys(arr); let aa = Object.keys(arr);
aa.map(i => { aa.map(i => {
...@@ -72,6 +86,7 @@ const AppendModal = props => { ...@@ -72,6 +86,7 @@ const AppendModal = props => {
}); });
arr[i] = list; arr[i] = list;
}); });
console.log(arr);
setData(arr); setData(arr);
if (res.data.length == 0) { if (res.data.length == 0) {
setFlag(1); setFlag(1);
...@@ -131,6 +146,17 @@ const AppendModal = props => { ...@@ -131,6 +146,17 @@ const AppendModal = props => {
callBackSubmit(); callBackSubmit();
}; };
const title = e => {
let aa = [];
data[e].map(i => {
if (allValue.indexOf(i) != -1) {
aa.push(i);
}
});
console.log(aa);
return aa.length;
};
return ( return (
<Modal <Modal
title="产品追加" title="产品追加"
...@@ -227,7 +253,12 @@ const AppendModal = props => { ...@@ -227,7 +253,12 @@ const AppendModal = props => {
<div style={{ display: 'inline-block', backgroundColor: 'aliceblue' }}> <div style={{ display: 'inline-block', backgroundColor: 'aliceblue' }}>
<div style={{ float: 'right' }}> <div style={{ float: 'right' }}>
<strong> <strong>
追加产品列表(共<span style={{ color: 'rgb(24 144 255)' }}>{allLength}</span> 追加产品列表(共
<span style={{ color: 'rgb(24 144 255)' }}>
{allValue && allValue.length > 0 ? allValue.length : 0}
</span>
<span>/</span>
<span style={{ color: 'rgb(24 144 255)' }}>{allLength}</span>
个) 个)
</strong> </strong>
</div> </div>
...@@ -258,7 +289,10 @@ const AppendModal = props => { ...@@ -258,7 +289,10 @@ const AppendModal = props => {
<> <>
<span>{i}</span> <span>{i}</span>
<span> <span>
(共<span style={{ color: 'rgb(24, 144, 255)' }}>{data[i].length}</span>个) (共
<span style={{ color: 'rgb(24, 144, 255)' }}>{title(i)}</span>
<span>/</span>
<span style={{ color: 'rgb(24, 144, 255)' }}>{data[i].length}</span>个)
</span> </span>
</> </>
</div> </div>
...@@ -271,7 +305,20 @@ const AppendModal = props => { ...@@ -271,7 +305,20 @@ const AppendModal = props => {
marginBottom: '20px', marginBottom: '20px',
}} }}
> >
{j} {allValue.indexOf(j) != -1 ? (
<span>
{' '}
<PlusOutlined
style={{ color: 'rgb(24, 144, 255)', marginRight: '5px' }}
/>
{j}
</span>
) : (
<span>
<CheckOutlined style={{ color: 'green', marginRight: '5px' }} />
{j}
</span>
)}
</span> </span>
))} ))}
</div> </div>
......
...@@ -298,7 +298,6 @@ const DatabaseInitialization = props => { ...@@ -298,7 +298,6 @@ const DatabaseInitialization = props => {
const GetDb = kk => { const GetDb = kk => {
getDataBaseConfigNew().then(resdata => { getDataBaseConfigNew().then(resdata => {
console.log(resdata.data);
GetDbProduct({ GetDbProduct({
ip: resdata.data.ip, ip: resdata.data.ip,
dbName: resdata.data.dbName, dbName: resdata.data.dbName,
...@@ -369,7 +368,6 @@ const DatabaseInitialization = props => { ...@@ -369,7 +368,6 @@ const DatabaseInitialization = props => {
setKeepValue(arr); setKeepValue(arr);
} }
let newArr = Array.from(new Set(aa)); let newArr = Array.from(new Set(aa));
console.log(newArr);
setKeepStatus(gg); setKeepStatus(gg);
setKeepProduct(newArr); setKeepProduct(newArr);
setKeepCode(newArr); setKeepCode(newArr);
...@@ -406,7 +404,6 @@ const DatabaseInitialization = props => { ...@@ -406,7 +404,6 @@ const DatabaseInitialization = props => {
}; };
const GetDbChangeFirst = kk => { const GetDbChangeFirst = kk => {
console.log(123);
let obj = form.getFieldsValue(); let obj = form.getFieldsValue();
GetDbProduct({ ...obj }).then(res => { GetDbProduct({ ...obj }).then(res => {
setCardLoading(false); setCardLoading(false);
...@@ -642,9 +639,6 @@ const DatabaseInitialization = props => { ...@@ -642,9 +639,6 @@ const DatabaseInitialization = props => {
doInitLog(); doInitLog();
NewInitAddDataBase({ ...obj, productSetting }).then(res => { NewInitAddDataBase({ ...obj, productSetting }).then(res => {
if (res.code === 0) { if (res.code === 0) {
// if (value.length > 0) {
// setKeepProduct(value);
// }
GetDbChangeAppend(); GetDbChangeAppend();
setMsg('检测到License已被使用'); setMsg('检测到License已被使用');
setfirstColor('green'); setfirstColor('green');
...@@ -699,9 +693,6 @@ const DatabaseInitialization = props => { ...@@ -699,9 +693,6 @@ const DatabaseInitialization = props => {
let obj = form.getFieldsValue(); let obj = form.getFieldsValue();
InitEditDataBase(obj).then(res => { InitEditDataBase(obj).then(res => {
if (res.code === 0) { if (res.code === 0) {
// if (value.length > 0) {
// setKeepProduct(value);
// }
GetDbChangeAppend(); GetDbChangeAppend();
setMsg('检测到License已被使用'); setMsg('检测到License已被使用');
setfirstColor('green'); setfirstColor('green');
...@@ -753,11 +744,6 @@ const DatabaseInitialization = props => { ...@@ -753,11 +744,6 @@ const DatabaseInitialization = props => {
setLastColor('gray'); setLastColor('gray');
setSimpleProduct(''); setSimpleProduct('');
setTotalProduct(''); setTotalProduct('');
// console.log(keepNumber);
// if (keepNumber == '') {
// setKeepValue([]);
// }
onCheck(); onCheck();
}; };
...@@ -772,10 +758,6 @@ const DatabaseInitialization = props => { ...@@ -772,10 +758,6 @@ const DatabaseInitialization = props => {
let arr = product[item].find(i => e.indexOf(i) == -1); let arr = product[item].find(i => e.indexOf(i) == -1);
let bb = keepProduct.indexOf(arr); let bb = keepProduct.indexOf(arr);
// 已经被初始化的产品不允许取消勾选
// if (arr && bb != -1) {
// console.log(arr);
// } else {
let aa = keepValue; let aa = keepValue;
aa[item] = e; aa[item] = e;
let a = Object.keys(aa); let a = Object.keys(aa);
...@@ -785,11 +767,8 @@ const DatabaseInitialization = props => { ...@@ -785,11 +767,8 @@ const DatabaseInitialization = props => {
list.push(j); list.push(j);
}); });
}); });
console.log(aa);
setKeepValue(aa); setKeepValue(aa);
console.log(list);
setValue(list); setValue(list);
// }
} else { } else {
let aa = keepValue; let aa = keepValue;
aa[item] = e; aa[item] = e;
...@@ -800,8 +779,6 @@ const DatabaseInitialization = props => { ...@@ -800,8 +779,6 @@ const DatabaseInitialization = props => {
list.push(j); list.push(j);
}); });
}); });
console.log(aa);
console.log(list);
setKeepValue(aa); setKeepValue(aa);
setValue(list); setValue(list);
} }
...@@ -1057,37 +1034,31 @@ const DatabaseInitialization = props => { ...@@ -1057,37 +1034,31 @@ const DatabaseInitialization = props => {
title: '授权码', title: '授权码',
dataIndex: 'license', dataIndex: 'license',
key: 'license', key: 'license',
// width: 100,
// fixed: 'left',
}, },
{ {
title: '项目名', title: '项目名',
dataIndex: 'projectName', dataIndex: 'projectName',
key: 'projectName', key: 'projectName',
// width: 100,
}, },
{ {
title: '授权人', title: '授权人',
dataIndex: 'applicantName', dataIndex: 'applicantName',
key: 'applicantName', key: 'applicantName',
// width: 150,
}, },
{ {
title: '使用时间', title: '使用时间',
dataIndex: 'createTime', dataIndex: 'createTime',
key: 'createTime', key: 'createTime',
// width: 150,
}, },
{ {
title: '部署产品', title: '部署产品',
dataIndex: 'productSolutions', dataIndex: 'productSolutions',
key: 'productSolutions', key: 'productSolutions',
render: text => { render: text => {
console.log(text);
let aa = []; let aa = [];
if (text) { if (text) {
text.map(i => { text.map(i => {
aa.push(i.productName); aa.push(i.name);
}); });
return ( return (
<Tooltip title={aa.toString()} arrowPointAtCenter placement="rightTop"> <Tooltip title={aa.toString()} arrowPointAtCenter placement="rightTop">
...@@ -1179,7 +1150,6 @@ const DatabaseInitialization = props => { ...@@ -1179,7 +1150,6 @@ const DatabaseInitialization = props => {
if (form.getFieldValue().password == '') { if (form.getFieldValue().password == '') {
return Promise.reject('用户密码必填'); return Promise.reject('用户密码必填');
} }
setbeforeColor('gray'); setbeforeColor('gray');
setfirstColor('gray'); setfirstColor('gray');
setsecordColor('gray'); setsecordColor('gray');
...@@ -1206,7 +1176,6 @@ const DatabaseInitialization = props => { ...@@ -1206,7 +1176,6 @@ const DatabaseInitialization = props => {
) { ) {
return Promise.reject('数据库名称必填'); return Promise.reject('数据库名称必填');
} }
setbeforeColor('gray'); setbeforeColor('gray');
setfirstColor('gray'); setfirstColor('gray');
setsecordColor('gray'); setsecordColor('gray');
...@@ -1223,53 +1192,10 @@ const DatabaseInitialization = props => { ...@@ -1223,53 +1192,10 @@ const DatabaseInitialization = props => {
</Form.Item> </Form.Item>
</Form> </Form>
<div style={{ float: 'right' }}> <div style={{ float: 'right' }}>
{/* <Button
style={{ marginRight: '20px', visibility: ifInline }}
onClick={wirthValue}
>
当前数据库
</Button> */}
<Button onClick={save}>环境检查</Button> <Button onClick={save}>环境检查</Button>
</div> </div>
<div style={{ marginTop: '100px', transform: 'scal(1.5)' }}> <div style={{ marginTop: '100px', transform: 'scal(1.5)' }}>
<Timeline> <Timeline>
{/* <Timeline.Item color={oldColor}>
License检测
{(() => {
switch (oldColor) {
case 'gray':
return <></>;
case 'green':
return (
<>
<CheckCircleOutlined
style={{ color: 'green', marginLeft: '10px' }}
/>
</>
);
case '#eda625':
return (
<>
<ExclamationCircleOutlined
style={{ color: '#eda625', marginLeft: '10px' }}
/>
<span style={{ color: 'rgb(24 144 255)', marginLeft: '10px' }}>
{license}
</span>
</>
);
default:
return (
<>
<CloseCircleOutlined style={{ color: 'red', marginLeft: '10px' }} />
<span style={{ color: 'rgb(24 144 255)', marginLeft: '5px' }}>
{license}
</span>
</>
);
}
})()}
</Timeline.Item> */}
<Timeline.Item color={beforeColor}> <Timeline.Item color={beforeColor}>
环境检查 环境检查
{(() => { {(() => {
...@@ -1508,7 +1434,7 @@ const DatabaseInitialization = props => { ...@@ -1508,7 +1434,7 @@ const DatabaseInitialization = props => {
}} }}
> >
<PlusOutlined <PlusOutlined
style={{ color: '#96cdf9', marginRight: '5px' }} style={{ color: 'rgb(24, 144, 255)', marginRight: '5px' }}
/> />
{i} {i}
</span> </span>
......
...@@ -55,7 +55,7 @@ const ParmarModal = props => { ...@@ -55,7 +55,7 @@ const ParmarModal = props => {
{fields.map(({ key, name, fieldKey, ...restField }) => ( {fields.map(({ key, name, fieldKey, ...restField }) => (
<Space <Space
key={key} key={key}
style={{ display: 'flex', marginBottom: 8, justifyContent: 'center' }} style={{ display: 'flex', marginBottom: '-8px', justifyContent: 'center' }}
align="baseline" align="baseline"
> >
<Form.Item <Form.Item
......
...@@ -19,6 +19,7 @@ import { ...@@ -19,6 +19,7 @@ import {
getRoleListPlain, getRoleListPlain,
dragMenu, dragMenu,
} from '@/services/mobileConfig/api'; } from '@/services/mobileConfig/api';
import { setIn } from 'immutable';
import styles from './miniMenu.less'; import styles from './miniMenu.less';
import { appConnector } from '@/containers/App/store'; import { appConnector } from '@/containers/App/store';
import Tree from '@/components/ExpendableTree'; import Tree from '@/components/ExpendableTree';
...@@ -26,7 +27,6 @@ import AddForm from './AddForm'; ...@@ -26,7 +27,6 @@ import AddForm from './AddForm';
import EditForm from './editForm'; import EditForm from './editForm';
import ImportOrExport from './ImportOrExport'; import ImportOrExport from './ImportOrExport';
import CheckList from './checkBox'; import CheckList from './checkBox';
import { setIn } from 'immutable';
const MiniMenu = props => { const MiniMenu = props => {
const { userMode, clientName, parentKey } = props; const { userMode, clientName, parentKey } = props;
...@@ -798,7 +798,15 @@ const MiniMenu = props => { ...@@ -798,7 +798,15 @@ const MiniMenu = props => {
onOk={() => delMenu()} onOk={() => delMenu()}
confirmLoading={modalLoading} confirmLoading={modalLoading}
> >
是否删除<span style={{ color: 'red' }}>{modalTitle}</span>? {nodeObj.children && nodeObj.children.length > 0 ? (
<span>
是否删除<span style={{ color: 'red' }}>{modalTitle}</span>及其子菜单?
</span>
) : (
<span>
是否删除<span style={{ color: 'red' }}>{modalTitle}</span>?
</span>
)}
</Modal> </Modal>
<div <div
className={classnames({ className={classnames({
......
...@@ -200,6 +200,7 @@ const MiniMenu = props => { ...@@ -200,6 +200,7 @@ const MiniMenu = props => {
const deleteMenuTip = (val, e) => { const deleteMenuTip = (val, e) => {
e.stopPropagation(); e.stopPropagation();
console.log(val); console.log(val);
console.log(e);
setModalTitle(val.text); setModalTitle(val.text);
setNodeObj(val); setNodeObj(val);
setDelVisible(true); setDelVisible(true);
...@@ -692,7 +693,15 @@ const MiniMenu = props => { ...@@ -692,7 +693,15 @@ const MiniMenu = props => {
onOk={() => delMenu()} onOk={() => delMenu()}
confirmLoading={modalLoading} confirmLoading={modalLoading}
> >
是否删除<span style={{ color: 'red' }}>{modalTitle}</span>? {nodeObj.children && nodeObj.children.length > 0 ? (
<span>
是否删除<span style={{ color: 'red' }}>{modalTitle}</span>及其子菜单?
</span>
) : (
<span>
是否删除<span style={{ color: 'red' }}>{modalTitle}</span>?
</span>
)}
</Modal> </Modal>
<div <div
className={classnames({ className={classnames({
......
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