Commit 309ad5e4 authored by 皮倩雯's avatar 皮倩雯

数据库初始化追加

parent cae1fb8c
Pipeline #59232 passed with stages
......@@ -476,7 +476,7 @@ const AddModal = props => {
const [reportValue, setReportValue] = useState(); // 保存上报字段外部字段
const [displayValue, setDisplayValue] = useState(); // 保存显示字段外部字段
const [editableValue, setEditableValue] = useState(); // 保存编辑字段外部字段
const [transitValue, setTransitValue] = useState(); // 保存转单字段外部字段
const [displayColumns, setDisplayColumns] = useState(); // 保存显示列字段外部字段
const [relatedEventValue, setRelatedEventValue] = useState(); // 保存关联字段外部字段
const [groupName, setGroupName] = useState('角色');
const [chooseGroupName, setChooseGroupName] = useState(['角色', '部门', '站点']);
......@@ -563,8 +563,8 @@ const AddModal = props => {
setFlag(0);
}
if (type == 'add') {
if (obj.TransitFields == undefined) {
obj.TransitFields = '';
if (obj.DisplayColumns == undefined) {
obj.DisplayColumns = '';
}
if (obj.Roles == undefined) {
obj.Roles = '';
......@@ -669,8 +669,8 @@ const AddModal = props => {
} else {
setEditableIsShow('none');
}
setTransitValue(res.data.root.outTransitFields);
if (res.data.root.outTransitFields != 0) {
setDisplayColumns(res.data.root.outDisplayColumns);
if (res.data.root.outDisplayColumns != 0) {
setTransitIsShow('inline');
} else {
setTransitIsShow('none');
......@@ -882,11 +882,11 @@ const AddModal = props => {
setEditableIsShow('none');
}
};
// 转单字段外部字段
// 显示列字段外部字段
const ExternalTransitField = e => {
if (form.getFieldValue().TransitFields) {
if (form.getFieldValue().DisplayColumns) {
let pp = formateArrDataA(e, 'group');
let ab = form.getFieldValue().TransitFields.split(',');
let ab = form.getFieldValue().DisplayColumns.split(',');
let arr = Object.keys(pp);
let b = [];
let a = [];
......@@ -904,7 +904,7 @@ const AddModal = props => {
}
}
});
setTransitValue(a.length);
setDisplayColumns(a.length);
if (a.length != 0) {
setTransitIsShow('inline');
} else {
......@@ -1123,8 +1123,8 @@ const AddModal = props => {
setEditableIsShow('none');
}
}
if (prop.pickItem == 'TransitFields') {
setTransitValue(prop.valueArr.length);
if (prop.pickItem == 'DisplayColumns') {
setDisplayColumns(prop.valueArr.length);
if (prop.valueArr.length != 0) {
setTransitIsShow('inline');
} else {
......@@ -1706,11 +1706,11 @@ const AddModal = props => {
</div>
</Item>
</Col>
{/* <Col span={24}>
<Col span={24}>
<Item
label={
<div>
<Tooltip title={`存在${transitValue}个外部字段`}>
<Tooltip title={`存在${displayColumns}个外部字段`}>
<InfoCircleOutlined
style={{
color: 'red',
......@@ -1719,25 +1719,25 @@ const AddModal = props => {
}}
/>
</Tooltip>
<span>转单字段</span>
<span>显示列字段</span>
</div>
}
name="TransitFields"
name="DisplayColumns"
labelCol={{ span: 5 }}
>
<div style={{ display: 'flex' }}>
<Form.Item name="TransitFields" style={{ marginBottom: 0, width: '100%' }}>
<Input placeholder="请选择转单字段" allowClear />
<Form.Item name="DisplayColumns" style={{ marginBottom: 0, width: '100%' }}>
<Input placeholder="请选择显示列字段" allowClear />
</Form.Item>
<Button
type="dashed"
onClick={() => pickFiled('TransitFields')}
onClick={() => pickFiled('DisplayColumns')}
icon={<PlusOutlined style={{ marginTop: '5px' }} />}
style={{ marginLeft: '10px', width: '70px' }}
/>
</div>
</Item>
</Col> */}
</Col>
<Col span={24}>
<Item label="事件权限" name="Roles" labelCol={{ span: 5 }}>
<div style={{ display: 'flex' }}>
......
/* eslint-disable guard-for-in */
/* eslint-disable no-restricted-syntax */
import React, { useEffect, useState } from 'react';
import { Button, Space, notification, Modal, Popconfirm, Empty, Spin } from 'antd';
import { Button, Space, notification, Modal, Popconfirm, Empty, Spin, Tooltip } from 'antd';
import { BarcodeOutlined, UserOutlined, CalendarOutlined } from '@ant-design/icons';
import styles from './DatabaseInitialization.less';
import { GetLicenseDifference, InitEditDataBase, GetProductList } from '@/services/database/api';
const AppendModal = props => {
const { callBackSubmit = () => {}, visible, onCancel, value } = props;
const { callBackSubmit = () => {}, visible, onCancel, value, keepHistroy } = props;
const [data, setData] = useState([]);
const [allLength, setAllLength] = useState('');
const [flag, setFlag] = useState();
const [loading, setLoading] = useState(false);
const [code, setCode] = useState('');
const [project, setProject] = useState('');
const [name, setName] = useState('');
const [number, setNumber] = useState('');
const [much, setMuch] = useState([]);
const [code1, setCode1] = useState('');
const [project1, setProject1] = useState('');
const [name1, setName1] = useState('');
const [number1, setNumber1] = useState('');
useEffect(() => {
if (visible) {
getProduct();
console.log(value);
console.log(keepHistroy);
let aa = [];
keepHistroy.map((i, j) => {
if (i.license != '已使用' && j != keepHistroy.length - 1) {
aa.push(i);
}
});
if (aa.length > 0) {
let a = [];
let b = [];
let c = [];
aa.map(k => {
a.push(k.license);
b.push(k.projectName);
c.push(`${k.applicantName}${k.jobNumber})`);
});
setCode1(a.toString());
setProject1(b.toString());
setName1(c.toString());
}
setMuch(aa);
setCode(keepHistroy[keepHistroy.length - 1].license);
setProject(keepHistroy[keepHistroy.length - 1].projectName);
setName(keepHistroy[keepHistroy.length - 1].applicantName);
setNumber(keepHistroy[keepHistroy.length - 1].jobNumber);
} else {
setData([]);
setFlag();
......@@ -99,7 +134,7 @@ const AppendModal = props => {
return (
<Modal
title="产品追加"
width="800px"
width="1000px"
visible={visible}
onCancel={onCancel}
destroyOnClose
......@@ -134,11 +169,70 @@ const AppendModal = props => {
) : (
<>
{allLength > 0 && (
<div style={{ marginBottom: '26px' }}>
<div
style={{
height: '50px',
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center',
marginBottom: '15px',
}}
>
{much.length > 0 ? (
<Tooltip title={code1}>
<div style={{ display: 'inline-block', backgroundColor: 'aliceblue' }}>
<BarcodeOutlined style={{ color: 'rgb(227 168 96)', marginRight: '5px' }} />
授权码:
{code ? <>{code}</> : <span>--</span>}
<span>...</span>
</div>
</Tooltip>
) : (
<div style={{ display: 'inline-block', backgroundColor: 'aliceblue' }}>
<BarcodeOutlined style={{ color: 'rgb(227 168 96)', marginRight: '5px' }} />
授权码:
{code ? <>{code}</> : <span>--</span>}
</div>
)}
{much.length > 0 ? (
<Tooltip title={project1}>
<div style={{ display: 'inline-block', backgroundColor: 'aliceblue' }}>
<CalendarOutlined style={{ color: '#8466cb', marginRight: '5px' }} />
项目名:{project ? <>{project}</> : '--'}
<span>...</span>
</div>
</Tooltip>
) : (
<div style={{ display: 'inline-block', backgroundColor: 'aliceblue' }}>
<CalendarOutlined style={{ color: '#8466cb', marginRight: '5px' }} />
项目名:{project ? <>{project}</> : '--'}
</div>
)}
{much.length > 0 ? (
<Tooltip title={name1}>
<div style={{ display: 'inline-block', backgroundColor: 'aliceblue' }}>
<UserOutlined style={{ color: 'green', marginRight: '5px' }} />
授权人:{name ? <>{name}</> : '-'}
{number ? <>{number}</> : '-'}
{much.length > 0 ? <span>...</span> : <></>}
</div>
</Tooltip>
) : (
<div style={{ display: 'inline-block', backgroundColor: 'aliceblue' }}>
<UserOutlined style={{ color: 'green', marginRight: '5px' }} />
授权人:{name ? <>{name}</> : '-'}
{number ? <>{number}</> : '-'}
</div>
)}
<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)' }}>{allLength}</span>
个)
</strong>
</div>
</div>
</div>
)}
{data &&
Object.keys(data).map((i, j) => (
......
......@@ -20,6 +20,7 @@ import {
Popconfirm,
Timeline,
Tooltip,
Table,
} from 'antd';
import PageContainer from '@/components/BasePageContainer';
import { connect } from 'react-redux';
......@@ -32,6 +33,7 @@ import {
CheckDatabaseIsExist,
NewInitAddDataBase,
InitEditDataBase,
getDataBaseConfigNew,
} from '@/services/database/api';
import {
CloseCircleOutlined,
......@@ -41,6 +43,10 @@ import {
BarcodeOutlined,
UserOutlined,
CalendarOutlined,
CheckOutlined,
MinusSquareOutlined,
PlusOutlined,
EyeOutlined,
} from '@ant-design/icons';
import styles from './DatabaseInitialization.less';
import styles1 from '../InitDataBase/InitDataBase.less';
......@@ -70,6 +76,7 @@ const DatabaseInitialization = props => {
const [initLoading, setInitLoading] = useState(false);
const [keepDb, setKeepDb] = useState([]);
const [keepProduct, setKeepProduct] = useState([]);
const [keepStatus, setKeepStatus] = useState([]);
const scroll = useRef(null);
const [data, setData] = useState([]);
......@@ -100,6 +107,7 @@ const DatabaseInitialization = props => {
const [dataResult, setDataResult] = useState('');
const [productResult, setProductResult] = useState('');
const [keepInitContent, setKeepInitContent] = useState('');
const [keepInitContentDetail, setKeepInitContentDetail] = useState('');
const [keepinitVisible, setKeepInitVisible] = useState(false);
const [password, setPassword] = useState(false);
const [isAuthorize, setIsAuthorize] = useState(false);
......@@ -109,6 +117,9 @@ const DatabaseInitialization = props => {
const [appendVisible, setAppendVisible] = useState(false);
const [append, setAppend] = useState('不需要追加');
const [dataValue, setDataValue] = useState();
const [keepHistroy, setKeepHistroy] = useState([]);
const [historyVisible, setHistoryVisible] = useState(false);
const [keepInitDetailVisible, setKeepInitDetailVisible] = useState(false);
// 获取数据库配置信息
useEffect(() => {
......@@ -244,6 +255,7 @@ const DatabaseInitialization = props => {
);
console.log(arr);
setInitContentdetail(arr);
setKeepInitContentDetail(arr);
setShowDetali(true);
scroll.current.scrollTop = scroll.current.scrollHeight;
}
......@@ -270,7 +282,7 @@ const DatabaseInitialization = props => {
setInitContent('');
setInitContentdetail('');
setFinish(false);
deleteInitDBLogNew();
// deleteInitDBLogNew();
setShowDetali(false);
};
......@@ -280,13 +292,19 @@ const DatabaseInitialization = props => {
// setInitContent('');
// setInitContentdetail('');
setFinish(false);
deleteInitDBLogNew();
// deleteInitDBLogNew();
setShowDetali(false);
};
const GetDb = kk => {
console.log(121212);
GetDbProduct().then(res => {
getDataBaseConfigNew().then(resdata => {
console.log(resdata.data);
GetDbProduct({
ip: resdata.data.ip,
dbName: resdata.data.dbName,
userName: resdata.data.userName,
password: resdata.data.password,
}).then(res => {
if (res.code === 0) {
if (res.data.DbInfo.ip == '127.0.0.1' || !res.data.DbInfo.ip) {
setIfInline('hidden');
......@@ -295,24 +313,37 @@ const DatabaseInitialization = props => {
}
setKeepInline(res.data.DbInfo);
if (res.data.Project && res.data.Project.length > 0) {
setkeepNumber(res.data.Project[0].license);
setkeepMsg(res.data.Project[0].projectName);
setkeepNa(res.data.Project[0].applicantName);
setkeepCo(res.data.Project[0].jobNumber);
setKeepHistroy(res.data.Project);
setkeepNumber(res.data.Project[res.data.Project.length - 1].license);
setkeepMsg(res.data.Project[res.data.Project.length - 1].projectName);
setkeepNa(res.data.Project[res.data.Project.length - 1].applicantName);
setkeepCo(res.data.Project[res.data.Project.length - 1].jobNumber);
} else {
setKeepHistroy([]);
// setKeepProductData('');
setkeepNumber('');
setkeepMsg('');
setkeepNa('');
setkeepCo('');
}
form.setFieldsValue(res.data.DbInfo);
// form.setFieldsValue(res.data.DbInfo);
form.setFieldsValue({
ip: resdata.data.ip,
dbName: resdata.data.dbName,
userName: resdata.data.userName,
password: resdata.data.password,
});
GetDbChangeFirst(kk);
// 有License的情况下首次进入展示数据
// if (res.data.IsAuthorize) {
if (res.data.Product) {
let aa = [];
let gg = [];
res.data.Product.map(i => {
if (i.status == 1) {
gg.push(i.name);
}
aa.push(i.name);
});
if (aa.length > 0) {
......@@ -339,6 +370,7 @@ const DatabaseInitialization = props => {
}
let newArr = Array.from(new Set(aa));
console.log(newArr);
setKeepStatus(gg);
setKeepProduct(newArr);
setKeepCode(newArr);
setValue(newArr);
......@@ -347,23 +379,12 @@ const DatabaseInitialization = props => {
setIsAuthorize(res.data.IsAuthorize);
if (res.data.IsAuthorize) {
setMsg('');
// if (res.data.IsAppend) {
// setMsg('当前环境需要追加产品');
// setAppend('');
// } else {
// setMsg('');
// setAppend('没有追加的产品');
// }
} else {
// if (res.data.IsAppend) {
// setbeforeColor('green');
// setResult('检测到License,当前环境需要追加产品');
// setMsg('检测到License,当前环境需要追加产品');
// setAppend('');
// setAppendVisible(true);
// } else {
// setAppend('没有追加的产品');
if (res.data.Project && res.data.Project[0]) {
if (
res.data.Project &&
res.data.Project[0] &&
res.data.Project[res.data.Project.length - 1] == '已使用'
) {
setbeforeColor('red');
setResult('检测到License已被使用');
setMsg('检测到License已被使用');
......@@ -372,7 +393,6 @@ const DatabaseInitialization = props => {
setResult('未检测到License');
setMsg('未检测到License');
}
// }
}
} else {
notification.error({
......@@ -382,6 +402,7 @@ const DatabaseInitialization = props => {
});
}
});
});
};
const GetDbChangeFirst = kk => {
......@@ -390,47 +411,18 @@ const DatabaseInitialization = props => {
GetDbProduct({ ...obj }).then(res => {
setCardLoading(false);
if (res.code === 0) {
if (res.data.Product) {
let aa = [];
res.data.Product.map(i => {
aa.push(i.name);
});
if (aa.length > 0) {
let dd = [];
aa.map(i => {
kk.map(j => {
if (j.name === i) {
dd.push(j);
}
});
});
let Arr = Array.from(new Set(dd));
let arr = formateArrDataA(Arr, 'productName');
let a = Object.keys(arr);
a.map(i => {
let list = [];
arr[i].map(j => {
list.push(j.name);
});
arr[i] = list;
});
setProduct(arr);
setKeepValue(arr);
}
let newArr = Array.from(new Set(aa));
console.log(newArr);
setKeepProduct(newArr);
setKeepCode(newArr);
setValue(newArr);
}
if (res.data.IsAuthorize) {
if (kk) {
findCheck(res.data.IsAppend);
findCheck1(res.data.IsAppend);
} else {
onCheckLaster(res.data.IsAppend);
}
} else {
if (res.data.Project && res.data.Project[0]) {
if (
res.data.Project &&
res.data.Project[0] &&
res.data.Project[res.data.Project.length - 1] == '已使用'
) {
setbeforeColor('red');
setResult('检测到License已被使用');
setMsg('检测到License已被使用');
......@@ -440,6 +432,20 @@ const DatabaseInitialization = props => {
setMsg('未检测到License');
}
}
if (res.data.Project && res.data.Project.length > 0) {
setKeepHistroy(res.data.Project);
setkeepNumber(res.data.Project[res.data.Project.length - 1].license);
setkeepMsg(res.data.Project[res.data.Project.length - 1].projectName);
setkeepNa(res.data.Project[res.data.Project.length - 1].applicantName);
setkeepCo(res.data.Project[res.data.Project.length - 1].jobNumber);
} else {
// setKeepProductData('');
setKeepHistroy([]);
setkeepNumber('');
setkeepMsg('');
setkeepNa('');
setkeepCo('');
}
} else {
notification.error({
message: '提示',
......@@ -452,7 +458,6 @@ const DatabaseInitialization = props => {
const GetDbChange = e => {
let obj = form.getFieldsValue();
console.log(2222);
GetDbProduct({ ...obj }).then(res => {
setCardLoading(false);
if (res.code === 0) {
......@@ -464,7 +469,11 @@ const DatabaseInitialization = props => {
onCheckLaster(res.data.IsAppend);
}
} else {
if (res.data.Project && res.data.Project[0]) {
if (
res.data.Project &&
res.data.Project[0] &&
res.data.Project[res.data.Project.length - 1] == '已使用'
) {
setbeforeColor('red');
setResult('检测到License已被使用');
setMsg('检测到License已被使用');
......@@ -475,11 +484,14 @@ const DatabaseInitialization = props => {
}
}
if (res.data.Project && res.data.Project.length > 0) {
setkeepNumber(res.data.Project[0].license);
setkeepMsg(res.data.Project[0].projectName);
setkeepNa(res.data.Project[0].applicantName);
setkeepCo(res.data.Project[0].jobNumber);
setKeepHistroy(res.data.Project);
setkeepNumber(res.data.Project[res.data.Project.length - 1].license);
setkeepMsg(res.data.Project[res.data.Project.length - 1].projectName);
setkeepNa(res.data.Project[res.data.Project.length - 1].applicantName);
setkeepCo(res.data.Project[res.data.Project.length - 1].jobNumber);
} else {
// setKeepProductData('');
setKeepHistroy([]);
setkeepNumber('');
setkeepMsg('');
setkeepNa('');
......@@ -487,7 +499,11 @@ const DatabaseInitialization = props => {
}
if (res.data.Product) {
let aa = [];
let gg = [];
res.data.Product.map(i => {
if (i.status == 1) {
gg.push(i.name);
}
aa.push(i.name);
});
if (aa.length > 0) {
......@@ -517,15 +533,16 @@ const DatabaseInitialization = props => {
// 当前数据库已存在和上一个已存在数据库值重新赋值
if (newArr.length > 0) {
setKeepProduct(newArr);
setKeepStatus(gg);
setKeepCode(newArr);
setValue(newArr);
} else {
setKeepProduct([]);
setKeepStatus([]);
setKeepCode([]);
setValue([]);
}
if (res.data.Product.length == 0) {
console.log(1212);
setKeepValue([]);
}
}
......@@ -543,13 +560,16 @@ const DatabaseInitialization = props => {
const GetDbChangeAppend = () => {
let obj = form.getFieldsValue();
console.log(5555);
GetDbProduct({ ...obj }).then(res => {
setCardLoading(false);
if (res.code === 0) {
if (res.data.Product) {
let aa = [];
let gg = [];
res.data.Product.map(i => {
if (i.status == 1) {
gg.push(i.name);
}
aa.push(i.name);
});
if (aa.length > 0) {
......@@ -578,10 +598,12 @@ const DatabaseInitialization = props => {
// 当前数据库已存在和上一个已存在数据库值重新赋值
if (newArr.length > 0) {
setKeepProduct(newArr);
setKeepStatus(gg);
setKeepCode(newArr);
setValue(newArr);
} else {
setKeepProduct([]);
setKeepStatus([]);
setKeepCode([]);
setValue([]);
}
......@@ -589,6 +611,11 @@ const DatabaseInitialization = props => {
setKeepValue([]);
}
}
if (res.data.Project && res.data.Project.length > 0) {
setKeepHistroy(res.data.Project);
} else {
setKeepHistroy([]);
}
setKeepDb(res.data);
setIsAuthorize(res.data.IsAuthorize);
} else {
......@@ -615,9 +642,10 @@ const DatabaseInitialization = props => {
doInitLog();
NewInitAddDataBase({ ...obj, productSetting }).then(res => {
if (res.code === 0) {
if (value.length > 0) {
setKeepProduct(value);
}
// if (value.length > 0) {
// setKeepProduct(value);
// }
GetDbChangeAppend();
setMsg('检测到License已被使用');
setfirstColor('green');
......@@ -674,6 +702,7 @@ const DatabaseInitialization = props => {
// if (value.length > 0) {
// setKeepProduct(value);
// }
GetDbChangeAppend();
setMsg('检测到License已被使用');
setfirstColor('green');
setDataResult('成功');
......@@ -806,7 +835,7 @@ const DatabaseInitialization = props => {
}
});
deleteInitDBLogNew();
// deleteInitDBLogNew();
} else {
setbeforeColor('red');
setResult('请输入完整数据库信息');
......@@ -904,7 +933,7 @@ const DatabaseInitialization = props => {
setResult('无法追加,该数据库为非授权初始化数据库,请直接升级数据库! ');
setMsg('无法追加,该数据库为非授权初始化数据库,请直接升级数据库!');
setAppend('无需追加');
deleteInitDBLogNew();
// deleteInitDBLogNew();
}
} else {
setPassword(true);
......@@ -931,12 +960,57 @@ const DatabaseInitialization = props => {
});
};
const findCheck1 = aa => {
let obj = form.getFieldsValue();
CheckDatabaseIsExist({ ...obj }).then(res => {
setCardLoading(false);
if (res.code === 0) {
setDataValue(form.getFieldsValue());
if (res.data === true) {
if (aa) {
setbeforeColor('green');
setResult('检测到License,当前环境需要追加产品');
setMsg('检测到License,当前环境需要追加产品');
setAppend('');
setAppendVisible(true);
setDataValue(form.getFieldsValue());
} else {
setbeforeColor('red');
setPassword(false);
setResult('无法追加,该数据库为非授权初始化数据库,请直接升级数据库! ');
setMsg('无法追加,该数据库为非授权初始化数据库,请直接升级数据库!');
setAppend('无需追加');
// deleteInitDBLogNew();
}
} else {
setPassword(true);
setbeforeColor('green');
setResult('通过');
setMsg('');
setAppend('无需追加');
let arr = [];
keepData.map(i => {
if (keepCode.indexOf(i.name) != -1) {
arr.push(i);
}
});
}
} else {
setbeforeColor('red');
setResult(`${res.msg}`);
setMsg(res.msg);
}
});
};
const save = () => {
flagChange();
};
useEffect(() => {
if (!initVisible) {
if (!initVisible && !initVisibledetail) {
setShow('hidden');
}
}, [initVisible]);
......@@ -971,8 +1045,66 @@ const DatabaseInitialization = props => {
const onOk = () => {
setAppendVisible(false);
initDatabaseProAppend();
GetDbChangeAppend();
// GetDbChangeAppend();
};
const onHistory = () => {
setHistoryVisible(true);
};
const columns = [
{
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);
});
return (
<Tooltip title={aa.toString()} arrowPointAtCenter placement="rightTop">
<span>{text.length}</span>
</Tooltip>
);
}
},
},
];
useEffect(() => {
if (!initVisibledetail && !initVisible) {
deleteInitDBLogNew();
}
}, [initVisibledetail, initVisible]);
return (
<>
<PageContainer className={styles.InitDataBaseContainer}>
......@@ -1292,6 +1424,16 @@ const DatabaseInitialization = props => {
}}
>
<div style={{ display: 'inline-block', backgroundColor: 'aliceblue' }}>
{keepHistroy.length > 0 ? (
<Tooltip title="查看数据库授权记录">
<EyeOutlined
style={{ color: 'rgb(24 144 255)', marginRight: '5px' }}
onClick={onHistory}
/>
</Tooltip>
) : (
<></>
)}
<BarcodeOutlined style={{ color: 'rgb(227 168 96)', marginRight: '5px' }} />
授权码:
{keepNumber ? (
......@@ -1341,12 +1483,53 @@ const DatabaseInitialization = props => {
{data[item] &&
data[item].map((i, j) => {
if (keepProduct.indexOf(i) != -1) {
return <Checkbox checked>{i}</Checkbox>;
if (keepStatus.indexOf(i) != -1) {
return (
<span
style={{
width: '250px',
marginLeft: '24px',
display: 'inline-block',
marginBottom: '20px',
}}
>
<CheckOutlined style={{ color: 'green', marginRight: '5px' }} />
{i}
</span>
);
} else {
return (
<Checkbox checked={false} disabled>
<span
style={{
width: '250px',
marginLeft: '24px',
display: 'inline-block',
marginBottom: '20px',
}}
>
<PlusOutlined
style={{ color: '#96cdf9', marginRight: '5px' }}
/>
{i}
</Checkbox>
</span>
);
}
} else {
return (
<span
style={{
width: '250px',
marginLeft: '24px',
display: 'inline-block',
marginBottom: '20px',
color: '#c3c3c3',
}}
>
{/* <MinusSquareOutlined
style={{ color: 'gray', marginTop: '-6px', marginRight: '5px' }}
/> */}
{i}
</span>
);
}
})}
......@@ -1369,7 +1552,7 @@ const DatabaseInitialization = props => {
cancelText="取消"
onConfirm={() => {
Submit();
deleteInitDBLogNew();
// deleteInitDBLogNew();
}}
>
<Button type="primary" disabled={msg != ''}>
......@@ -1391,7 +1574,7 @@ const DatabaseInitialization = props => {
setInitVisible(false);
setInitContent('');
setInitContentdetail('');
deleteInitDBLogNew();
// deleteInitDBLogNew();
}}
width={800}
maskClosable={false}
......@@ -1427,19 +1610,26 @@ const DatabaseInitialization = props => {
overflowY: 'scroll',
marginRight: ' -24px',
}}
>
<Spin
spinning={initLoading}
tip="loading..."
style={{ width: '100%', marginTop: '40px' }}
>
<span>{initContent}</span>
<div style={{ height: '40px' }}>
<div style={{ position: 'relative' }}>
<Spin
{/* {initLoading ? <span>加载中...</span> : <></>} */}
{/* <Spin
spinning={initLoading}
tip="loading..."
style={{ width: '100%', marginTop: '40px' }}
/>
/> */}
</div>
</div>
{/* <br />
{showDetali ? <span>{initContentdetail}</span> : <></>} */}
</Spin>
</div>
</Modal>
<Modal
......@@ -1455,6 +1645,14 @@ const DatabaseInitialization = props => {
height: '500px',
}}
footer={[
<Button
onClick={() => {
setKeepInitDetailVisible(true);
setKeepInitVisible(false);
}}
>
查看详细日志
</Button>,
<Button
onClick={() => {
setKeepInitVisible(false);
......@@ -1477,6 +1675,49 @@ const DatabaseInitialization = props => {
{keepInitContent}
</div>
</Modal>
<Modal
title="详细日志信息"
visible={keepInitDetailVisible}
onCancel={() => {
setKeepInitDetailVisible(false);
}}
width={800}
maskClosable={false}
bodyStyle={{
height: '500px',
}}
footer={[
<Button
onClick={() => {
setKeepInitDetailVisible(false);
setKeepInitVisible(true);
}}
>
查看日志
</Button>,
<Button
onClick={() => {
setKeepInitDetailVisible(false);
}}
key="back"
type="primary"
>
关闭窗口
</Button>,
]}
>
<div
ref={scroll}
style={{
maxHeight: '470px',
overflowY: 'auto',
marginRight: ' -24px',
}}
>
{keepInitContentDetail}
</div>
</Modal>
<AppendModal
visible={appendVisible}
onCancel={() => {
......@@ -1484,7 +1725,40 @@ const DatabaseInitialization = props => {
}}
value={dataValue}
callBackSubmit={onOk}
keepHistroy={keepHistroy}
/>
<Modal
title="数据库授权记录"
visible={historyVisible}
onCancel={() => {
setHistoryVisible(false);
}}
width={1000}
bodyStyle={{
height: '500px',
overflowY: 'scroll',
}}
footer={[
<Button
onClick={() => {
setHistoryVisible(false);
}}
key="back"
>
关闭
</Button>,
]}
>
<Table
size="small"
rowKey={record => record.userID}
bordered
columns={columns}
dataSource={keepHistroy}
pagination={false}
scroll={{ x: 'max-content' }}
/>
</Modal>
<Modal
title="初始化数据库详细日志"
visible={initVisibledetail}
......@@ -1499,6 +1773,14 @@ const DatabaseInitialization = props => {
// overflowY: 'auto',
}}
footer={[
<Button
onClick={() => {
setInitVisible(true);
setinitVisibledetail(false);
}}
>
查看初始化日志
</Button>,
<Button
onClick={() => {
handleClickdetail();
......
......@@ -28,9 +28,9 @@ import {
import { EnvironmentOutlined } from '@ant-design/icons';
import classnames from 'classnames';
import { GetWebSiteConfig } from '@/services/gis/gis';
import { SetServiceConfig } from '@/services/webConfig/api';
import styles from './index.less';
import { SetServiceConfig, GetSpriteSheet } from '@/services/webConfig/api';
import { ContinuousLegend } from '@antv/g2/lib/dependents';
import styles from './index.less';
const { Option } = Select;
const defaultMap = {
basemaps: [
......@@ -153,6 +153,9 @@ const Map = props => {
const [color, setColor] = useState('');
useEffect(() => {
// GetSpriteSheet().then(res => {
// console.log(123);
// });
GetWebSiteConfig({ client: 'sandbox' }).then(res => {
let setttings = {};
if (res.data.length === 0) {
......
......@@ -308,3 +308,5 @@ export const DragSingleWebsite = param =>
export const UpdateSchemPipeNetwork = param =>
get(`${PANDA_GIS}/MapLayer/UpdateSchemPipeNetwork`, param);
export const GetSpriteSheet = param => get(`${PANDA_GIS}/MultiMedia/GetSpriteSheet`, param);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment