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

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

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