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

数据库初始化追加

parent 5fb162e4
Pipeline #58925 passed with stages
...@@ -37,10 +37,6 @@ import ChangeAdd from './ChangeAdd'; ...@@ -37,10 +37,6 @@ import ChangeAdd from './ChangeAdd';
const { Option } = Select; const { Option } = Select;
const AddModal = props => { const AddModal = props => {
const [inputValue, setInputValue] = useState({
feedbackName: '',
doRole: '',
});
const { callBackSubmit = () => {}, visible, type, formObj, keepTableData } = props; const { callBackSubmit = () => {}, visible, type, formObj, keepTableData } = props;
const [Type1, setType1] = useState(''); const [Type1, setType1] = useState('');
...@@ -74,13 +70,11 @@ const AddModal = props => { ...@@ -74,13 +70,11 @@ const AddModal = props => {
form.setFieldsValue({ isSubmit: '否', docycle: '一周一次' }); form.setFieldsValue({ isSubmit: '否', docycle: '一周一次' });
setType1(''); setType1('');
setType2(''); setType2('');
setInputValue({ feedbackName: '', doRole: '' });
setFiled1({}); setFiled1({});
} else if (type === 'edit') { } else if (type === 'edit') {
CM_XWBPlan_DataList({ id: formObj.id }).then(res => { CM_XWBPlan_DataList({ id: formObj.id }).then(res => {
let data = res.data[0]; let data = res.data[0];
data && form.setFieldsValue({ ...data }); data && form.setFieldsValue({ ...data });
setInputValue({ ...data });
console.log(data.businessTypee); console.log(data.businessTypee);
setType1(data.businessType); setType1(data.businessType);
setType2(data.accountName); setType2(data.accountName);
...@@ -113,8 +107,6 @@ const AddModal = props => { ...@@ -113,8 +107,6 @@ const AddModal = props => {
form.validateFields().then(validate => { form.validateFields().then(validate => {
if (validate) { if (validate) {
let obj = form.getFieldsValue(); let obj = form.getFieldsValue();
// obj.feedbackName = inputValue.feedbackName;
// obj.doRole = inputValue.doRole;
if (type == 'add') { if (type == 'add') {
CM_XWBPlan_DataEditORAdd(obj).then(res => { CM_XWBPlan_DataEditORAdd(obj).then(res => {
if (res.msg == '') { if (res.msg == '') {
...@@ -167,26 +159,34 @@ const AddModal = props => { ...@@ -167,26 +159,34 @@ const AddModal = props => {
setType2(e.target.value); setType2(e.target.value);
form.setFieldsValue({ accountName: e.target.value }); form.setFieldsValue({ accountName: e.target.value });
}; };
const changeText = (e, type) => {
let inputText = { ...inputValue };
inputText[type] = e.target.value;
setInputValue(inputText);
};
const pickFiled = fileds => { const pickFiled = fileds => {
if (form.getFieldValue(fileds)) {
setTypes('add');
setCharacterValue(form.getFieldValue(fileds));
setCheckedList1(form.getFieldValue(fileds).split(','));
setPickItem(fileds);
setIsVisible(true);
} else {
setTypes('add'); setTypes('add');
setCharacterValue(inputValue[fileds]); setCharacterValue(form.getFieldValue(fileds));
setCheckedList1(inputValue[fileds].split(',')); setCheckedList1([]);
setPickItem(fileds); setPickItem(fileds);
setIsVisible(true); setIsVisible(true);
}
}; };
const pickFiled1 = fileds => { const pickFiled1 = fileds => {
if (form.getFieldValue(fileds)) {
setTypes('app'); setTypes('app');
setCharacterValue(inputValue[fileds]); setCheckedList1(form.getFieldValue(fileds).split(','));
setCheckedList1(inputValue[fileds].split(','));
console.log(inputValue[fileds]);
console.log(inputValue[fileds].split(','));
setPickItem(fileds); setPickItem(fileds);
setIsVisibleRoles(true); setIsVisibleRoles(true);
} else {
setTypes('app');
setCheckedList1([]);
setPickItem(fileds);
setIsVisibleRoles(true);
}
}; };
const getRole = () => { const getRole = () => {
CM_Event_LoadDepartmentAndRoles().then(res => { CM_Event_LoadDepartmentAndRoles().then(res => {
...@@ -258,7 +258,7 @@ const AddModal = props => { ...@@ -258,7 +258,7 @@ const AddModal = props => {
if (!name) { if (!name) {
return '请传入对象属性'; return '请传入对象属性';
} }
//先获取一下这个数组中有多少个"name" // 先获取一下这个数组中有多少个"name"
let nameArr = []; let nameArr = [];
a3.map(i => { a3.map(i => {
if (nameArr.indexOf(i.group) === -1) { if (nameArr.indexOf(i.group) === -1) {
...@@ -266,7 +266,7 @@ const AddModal = props => { ...@@ -266,7 +266,7 @@ const AddModal = props => {
} }
}); });
console.log(nameArr); console.log(nameArr);
//新建一个包含多个list的结果对象 // 新建一个包含多个list的结果对象
let tempObj = {}; let tempObj = {};
// 根据不同的"name"生成多个数组 // 根据不同的"name"生成多个数组
for (let k in nameArr) { for (let k in nameArr) {
...@@ -295,20 +295,23 @@ const AddModal = props => { ...@@ -295,20 +295,23 @@ const AddModal = props => {
setSelectValue1(value); setSelectValue1(value);
}; };
const onOK = prop => { const onOK = prop => {
console.log(prop.isType);
setIsVisibleRoles(false); setIsVisibleRoles(false);
let inputText = {};
inputText[prop.pickItem] = prop.str;
setCheckedList1(prop.stt);
form.setFieldsValue(inputText);
};
const onOK1 = prop => {
console.log(prop);
setIsVisible(false); setIsVisible(false);
console.log(props); let inputText = {};
let inputText = { ...inputValue };
inputText[prop.pickItem] = prop.str; inputText[prop.pickItem] = prop.str;
setCheckedList1(prop.checkedList); setCheckedList1(prop.stt);
setInputValue(inputText);
form.setFieldsValue(inputText); form.setFieldsValue(inputText);
}; };
// const title = <ModalDrag title="巡维保计划配置" />
const inputType = value => { const inputType = value => {
console.log(value);
if (value) { if (value) {
form.setFieldsValue({ businessType: value }); form.setFieldsValue({ businessType: value });
} }
...@@ -345,7 +348,8 @@ const AddModal = props => { ...@@ -345,7 +348,8 @@ const AddModal = props => {
let aa = form.getFieldValue().businessName; let aa = form.getFieldValue().businessName;
if (type === 'add' && keepTableData.indexOf(aa) != -1) { if (type === 'add' && keepTableData.indexOf(aa) != -1) {
return Promise.reject('业务名称已存在'); return Promise.reject('业务名称已存在');
} else if ( }
if (
type === 'edit' && type === 'edit' &&
keepTableData.indexOf(aa) != -1 && keepTableData.indexOf(aa) != -1 &&
aa != formObj.businessName aa != formObj.businessName
...@@ -556,7 +560,7 @@ const AddModal = props => { ...@@ -556,7 +560,7 @@ const AddModal = props => {
<ChangeAdd <ChangeAdd
visible={isVisible} visible={isVisible}
onCancel={() => setIsVisible(false)} onCancel={() => setIsVisible(false)}
callBackSubmit={onOK} callBackSubmit={onOK1}
newCheckedList={checkedList1} newCheckedList={checkedList1}
isType={types} isType={types}
filed={filed} filed={filed}
......
...@@ -95,7 +95,7 @@ const ChangeAdd = props => { ...@@ -95,7 +95,7 @@ const ChangeAdd = props => {
setCheckedList(checkArr); setCheckedList(checkArr);
setIndeterminate(!!checkArr.length && checkArr.length < filed.length); setIndeterminate(!!checkArr.length && checkArr.length < filed.length);
setCheckAll(checkArr.length === filed.length && filed.length != 0); setCheckAll(checkArr.length === filed.length && filed.length != 0);
let newArr = characterValue.length ? characterValue.split(',') : []; let newArr = characterValue ? characterValue.split(',') : [];
setSelectData(newArr); setSelectData(newArr);
} }
} }
......
...@@ -329,7 +329,7 @@ const maintenance = () => { ...@@ -329,7 +329,7 @@ const maintenance = () => {
marginTop: '10px', marginTop: '10px',
}} }}
> >
<span style={{ marginTop: '-3px' }}>新增</span> <span style={{ marginTop: '-2px' }}>新增</span>
</Button> </Button>
<Button <Button
icon={<OrderedListOutlined className={styles.icon} />} icon={<OrderedListOutlined className={styles.icon} />}
...@@ -340,7 +340,7 @@ const maintenance = () => { ...@@ -340,7 +340,7 @@ const maintenance = () => {
marginTop: '10px', marginTop: '10px',
}} }}
> >
<span style={{ marginTop: '-3px' }}>调序</span> <span style={{ marginTop: '-2px' }}>调序</span>
</Button> </Button>
</span> </span>
</div> </div>
......
...@@ -306,8 +306,11 @@ const AddModal = props => { ...@@ -306,8 +306,11 @@ const AddModal = props => {
}; };
const onOK = prop => { const onOK = prop => {
console.log(prop);
setIsVisibleRoles(false); setIsVisibleRoles(false);
let inputText = {}; let inputText = {};
console.log(inputText);
console.log(inputText[prop.pickItem]);
inputText[prop.pickItem] = prop.str; inputText[prop.pickItem] = prop.str;
setCheckedList1(prop.stt); setCheckedList1(prop.stt);
form.setFieldsValue(inputText); form.setFieldsValue(inputText);
......
...@@ -229,7 +229,7 @@ const patrolFeedback = () => { ...@@ -229,7 +229,7 @@ const patrolFeedback = () => {
marginTop: '10px', marginTop: '10px',
}} }}
> >
<span style={{ marginTop: '-3px' }}>新增</span> <span style={{ marginTop: '-2px' }}>新增</span>
</Button> </Button>
<Button <Button
icon={<OrderedListOutlined className={styles.icon} />} icon={<OrderedListOutlined className={styles.icon} />}
...@@ -240,7 +240,7 @@ const patrolFeedback = () => { ...@@ -240,7 +240,7 @@ const patrolFeedback = () => {
marginTop: '10px', marginTop: '10px',
}} }}
> >
<span style={{ marginTop: '-3px' }}>调序</span> <span style={{ marginTop: '-2px' }}>调序</span>
</Button> </Button>
<Button <Button
icon={<DeleteOutlined className={styles.icon} />} icon={<DeleteOutlined className={styles.icon} />}
...@@ -252,7 +252,7 @@ const patrolFeedback = () => { ...@@ -252,7 +252,7 @@ const patrolFeedback = () => {
onClick={de} onClick={de}
disabled={!hasSelected} disabled={!hasSelected}
> >
<span style={{ marginTop: '-3px' }}>批量删除</span> <span style={{ marginTop: '-2px' }}>批量删除</span>
</Button> </Button>
</span> </span>
</div> </div>
......
...@@ -626,7 +626,7 @@ const AddModal = props => { ...@@ -626,7 +626,7 @@ const AddModal = props => {
setOrder(res.data.root.Order); setOrder(res.data.root.Order);
form.setFieldsValue({ ...res.data.root }); form.setFieldsValue({ ...res.data.root });
if (res.data.root.ImageExpression) { if (res.data.root.ImageExpression) {
setImageUrl(window.location.origin + `/civweb4/${res.data.root.ImageExpression}`); setImageUrl(`${window.location.origin }/civweb4/${res.data.root.ImageExpression}`);
setIm(res.data.root.ImageExpression); setIm(res.data.root.ImageExpression);
} else { } else {
form.setFieldsValue({ form.setFieldsValue({
...@@ -1302,7 +1302,7 @@ const AddModal = props => { ...@@ -1302,7 +1302,7 @@ const AddModal = props => {
const onOk = props => { const onOk = props => {
if (props) { if (props) {
setImageUrl(window.location.origin + `/civweb4/${props}`); setImageUrl(`${window.location.origin }/civweb4/${props}`);
setIm(props); setIm(props);
setKeepImgeUrl(props); setKeepImgeUrl(props);
form.setFieldsValue({ ImageExpression: `${props}` }); form.setFieldsValue({ ImageExpression: `${props}` });
...@@ -1853,12 +1853,12 @@ const AddModal = props => { ...@@ -1853,12 +1853,12 @@ const AddModal = props => {
form.setFieldsValue({ ImageExpression: '' }); form.setFieldsValue({ ImageExpression: '' });
}} }}
style={{ style={{
position: 'relative', position: 'absolute',
fontSize: '18px', fontSize: '18px',
left: '34px', left: '44px',
top: '10px', top: '45px',
color: 'white', color: 'white',
zIndex:'2' zIndex:'999'
}} }}
/> />
</> </>
......
...@@ -272,13 +272,14 @@ ...@@ -272,13 +272,14 @@
} }
} }
.imgg { .imgg {
position: absolute; position: relative;
top: 0; top: -33px;
left: 0; left: -9px;
height: 104px; height: 104px;
width: 104px; width: 104px;
background: rgba(0, 0, 0, 0.5); background: rgba(0, 0, 0, 0.5);
border-radius: 2px; border-radius: 2px;
z-index:1;
} }
.imgg :hover { .imgg :hover {
opacity: 0.7; opacity: 0.7;
......
/* 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 styles from './DatabaseInitialization.less';
import { GetLicenseDifference, InitEditDataBase, GetProductList } from '@/services/database/api';
const AppendModal = props => {
const { callBackSubmit = () => {}, visible, onCancel, value } = props;
const [data, setData] = useState([]);
const [allLength, setAllLength] = useState('');
const [flag, setFlag] = useState();
const [loading, setLoading] = useState(false);
useEffect(() => {
if (visible) {
getProduct();
console.log(value);
} else {
setData([]);
setFlag();
setAllLength('');
}
}, [visible]);
const getProduct = () => {
setLoading(true);
GetLicenseDifference(value).then(res => {
setLoading(false);
if (res.code === 0) {
let arr = formateArrDataA(res.data, 'productName');
let aa = Object.keys(arr);
aa.map(i => {
let list = [];
arr[i].map(j => {
list.push(j.name);
});
arr[i] = list;
});
setData(arr);
if (res.data.length == 0) {
setFlag(1);
} else {
setFlag(0);
}
setAllLength(res.data.length);
} else {
notification.error({
message: '提示',
duration: 3,
description: res.msg,
});
}
});
};
const formateArrDataA = (initialArr, name) => {
// 判定传参是否符合规则
if (!(initialArr instanceof Array)) {
return '请传入正确格式的数组';
}
if (!name) {
return '请传入对象属性';
}
// 先获取一下这个数组中有多少个"name"
let nameArr = [];
for (let i in initialArr) {
if (nameArr.indexOf(initialArr[i][`${name}`]) === -1) {
nameArr.push(initialArr[i][`${name}`]);
}
}
// 新建一个包含多个list的结果对象
let tempObj = {};
// 根据不同的"name"生成多个数组
for (let k in nameArr) {
for (let j in initialArr) {
if (initialArr[j][`${name}`] == nameArr[k]) {
// 每次外循环时新建一个对应"name"的数组, 内循环时当前数组不变
tempObj[nameArr[k]] = tempObj[nameArr[k]] || [];
tempObj[nameArr[k]].push(initialArr[j]);
}
}
}
for (let keys in tempObj) {
let arr = [];
tempObj[keys].map((item, index) => {
tempObj[keys] = arr;
item.key = index;
arr.push(item);
});
}
return tempObj;
};
const Submit = () => {
callBackSubmit();
};
return (
<Modal
title="产品追加"
width="800px"
visible={visible}
onCancel={onCancel}
destroyOnClose
maskClosable={false}
bodyStyle={{
height: '500px',
overflowY: 'scroll',
}}
footer={
<Space>
<Button onClick={onCancel}>取消</Button>
<Popconfirm
placement="topLeft"
title={<span style={{ color: 'rgb(24 144 255)' }}>是否确认追加!</span>}
okText="确认"
cancelText="取消"
onConfirm={() => {
Submit();
}}
>
<Button type="primary">追加</Button>
</Popconfirm>
</Space>
}
>
<Spin spinning={loading}>
{flag == 1 ? (
<Empty
image={Empty.PRESENTED_IMAGE_SIMPLE}
description={<span>当前授权码下产品已全部初始化,无需再次追加</span>}
/>
) : (
<>
{allLength > 0 && (
<div style={{ marginBottom: '26px' }}>
<strong>
追加产品列表(共<span style={{ color: 'rgb(24 144 255)' }}>{allLength}</span>个)
</strong>
</div>
)}
{data &&
Object.keys(data).map((i, j) => (
<div
style={{
border: '2px solid #c2cdfd',
borderRadius: '5px',
marginBottom: '20px',
position: 'relative',
paddingTop: '30px',
}}
>
<div
style={{
position: 'absolute',
left: '13px',
top: '-12px',
backgroundColor: 'white',
paddingLeft: '10px',
paddingRight: '10px',
}}
>
<>
<span>{i}</span>
<span>
(共<span style={{ color: 'rgb(24, 144, 255)' }}>{data[i].length}</span>个)
</span>
</>
</div>
{data[i].map(j => (
<span
style={{
width: '150px',
marginLeft: '24px',
display: 'inline-block',
marginBottom: '20px',
}}
>
{j}
</span>
))}
</div>
))}
</>
)}
</Spin>
</Modal>
);
};
export default AppendModal;
/* eslint-disable guard-for-in */
/* eslint-disable no-restricted-syntax */
/* eslint-disable no-lonely-if */ /* eslint-disable no-lonely-if */
/* eslint-disable prefer-promise-reject-errors */ /* eslint-disable prefer-promise-reject-errors */
/* eslint-disable no-else-return */ /* eslint-disable no-else-return */
...@@ -22,25 +24,14 @@ import { ...@@ -22,25 +24,14 @@ import {
import PageContainer from '@/components/BasePageContainer'; import PageContainer from '@/components/BasePageContainer';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { import {
setTableSQLDirName,
deleteConnNew,
initDBv4new,
getInitDBLogNew, getInitDBLogNew,
getConnRecordNew,
getDataBaseConfigNew,
saveConnectionNew,
getDataBaseList,
updateConnDescNew,
deleteInitDBLogNew, deleteInitDBLogNew,
connectionTest,
GetProductList, // 获取产品列表 GetProductList, // 获取产品列表
GetDbProduct, // 获取产品方案配置 GetDbProduct, // 获取产品方案配置
InitAddDataBase, // 数据库初始化
InitEditDataBase, // 二次初始化
CheckConnection,
SetAdminMenuToRole, SetAdminMenuToRole,
CheckDatabaseIsExist, CheckDatabaseIsExist,
NewInitAddDataBase, NewInitAddDataBase,
InitEditDataBase,
} from '@/services/database/api'; } from '@/services/database/api';
import { import {
CloseCircleOutlined, CloseCircleOutlined,
...@@ -53,6 +44,7 @@ import { ...@@ -53,6 +44,7 @@ import {
} from '@ant-design/icons'; } from '@ant-design/icons';
import styles from './DatabaseInitialization.less'; import styles from './DatabaseInitialization.less';
import styles1 from '../InitDataBase/InitDataBase.less'; import styles1 from '../InitDataBase/InitDataBase.less';
import AppendModal from './AppendModal';
const CheckboxGroup = Checkbox.Group; const CheckboxGroup = Checkbox.Group;
const formLables = { const formLables = {
...@@ -76,7 +68,6 @@ const DatabaseInitialization = props => { ...@@ -76,7 +68,6 @@ const DatabaseInitialization = props => {
const [cardLoading, setCardLoading] = useState(false); // 初始化card Loading const [cardLoading, setCardLoading] = useState(false); // 初始化card Loading
const [finish, setFinish] = useState(false); const [finish, setFinish] = useState(false);
const [initLoading, setInitLoading] = useState(false); const [initLoading, setInitLoading] = useState(false);
const [dbExists, setDbExists] = useState(false); // 数据库是否存在
const [keepDb, setKeepDb] = useState([]); const [keepDb, setKeepDb] = useState([]);
const [keepProduct, setKeepProduct] = useState([]); const [keepProduct, setKeepProduct] = useState([]);
const scroll = useRef(null); const scroll = useRef(null);
...@@ -85,7 +76,6 @@ const DatabaseInitialization = props => { ...@@ -85,7 +76,6 @@ const DatabaseInitialization = props => {
const [title, setTitle] = useState([]); const [title, setTitle] = useState([]);
const [keepCode, setKeepCode] = useState([]); const [keepCode, setKeepCode] = useState([]);
const [keepData, setKeepData] = useState([]); const [keepData, setKeepData] = useState([]);
const [checkboxFlag, setCheckboxFlag] = useState(0);
const [keepValue, setKeepValue] = useState([]); const [keepValue, setKeepValue] = useState([]);
const [value, setValue] = useState([]); const [value, setValue] = useState([]);
const [product, setProduct] = useState([]); const [product, setProduct] = useState([]);
...@@ -116,6 +106,9 @@ const DatabaseInitialization = props => { ...@@ -116,6 +106,9 @@ const DatabaseInitialization = props => {
const [licen, setLicen] = useState(''); const [licen, setLicen] = useState('');
const [showDetali, setShowDetali] = useState(false); const [showDetali, setShowDetali] = useState(false);
const [keepLast, setKeepLast] = useState(''); const [keepLast, setKeepLast] = useState('');
const [appendVisible, setAppendVisible] = useState(false);
const [append, setAppend] = useState('不需要追加');
const [dataValue, setDataValue] = useState();
// 获取数据库配置信息 // 获取数据库配置信息
useEffect(() => { useEffect(() => {
...@@ -128,7 +121,6 @@ const DatabaseInitialization = props => { ...@@ -128,7 +121,6 @@ const DatabaseInitialization = props => {
GetProductList().then(res => { GetProductList().then(res => {
setCardLoading(false); setCardLoading(false);
if (res.code === 0) { if (res.code === 0) {
console.log(res.data);
GetDb(res.data); GetDb(res.data);
setKeepData(res.data); setKeepData(res.data);
let arr = formateArrDataA(res.data, 'productName'); let arr = formateArrDataA(res.data, 'productName');
...@@ -141,8 +133,6 @@ const DatabaseInitialization = props => { ...@@ -141,8 +133,6 @@ const DatabaseInitialization = props => {
arr[i] = list; arr[i] = list;
}); });
setAllLength(res.data.length); setAllLength(res.data.length);
console.log(arr);
console.log(aa);
setTitle(aa); setTitle(aa);
setData(arr); setData(arr);
} }
...@@ -295,6 +285,7 @@ const DatabaseInitialization = props => { ...@@ -295,6 +285,7 @@ const DatabaseInitialization = props => {
}; };
const GetDb = kk => { const GetDb = kk => {
console.log(121212);
GetDbProduct().then(res => { GetDbProduct().then(res => {
if (res.code === 0) { if (res.code === 0) {
if (res.data.DbInfo.ip == '127.0.0.1' || !res.data.DbInfo.ip) { if (res.data.DbInfo.ip == '127.0.0.1' || !res.data.DbInfo.ip) {
...@@ -314,9 +305,9 @@ const DatabaseInitialization = props => { ...@@ -314,9 +305,9 @@ const DatabaseInitialization = props => {
setkeepNa(''); setkeepNa('');
setkeepCo(''); setkeepCo('');
} }
if (!res.data.IsAuthorize) {
form.setFieldsValue(res.data.DbInfo); form.setFieldsValue(res.data.DbInfo);
} GetDbChangeFirst(kk);
// 有License的情况下首次进入展示数据 // 有License的情况下首次进入展示数据
// if (res.data.IsAuthorize) { // if (res.data.IsAuthorize) {
if (res.data.Product) { if (res.data.Product) {
...@@ -324,11 +315,6 @@ const DatabaseInitialization = props => { ...@@ -324,11 +315,6 @@ const DatabaseInitialization = props => {
res.data.Product.map(i => { res.data.Product.map(i => {
aa.push(i.name); aa.push(i.name);
}); });
if (res.data.IsAuthorize) {
setCheckboxFlag(1);
} else {
setCheckboxFlag(0);
}
if (aa.length > 0) { if (aa.length > 0) {
let dd = []; let dd = [];
aa.map(i => { aa.map(i => {
...@@ -352,16 +338,31 @@ const DatabaseInitialization = props => { ...@@ -352,16 +338,31 @@ const DatabaseInitialization = props => {
setKeepValue(arr); setKeepValue(arr);
} }
let newArr = Array.from(new Set(aa)); let newArr = Array.from(new Set(aa));
console.log(newArr);
setKeepProduct(newArr); setKeepProduct(newArr);
setKeepCode(newArr); setKeepCode(newArr);
setValue(newArr); setValue(newArr);
} }
setDbExists(res.data.DBExists);
setKeepDb(res.data); setKeepDb(res.data);
setIsAuthorize(res.data.IsAuthorize); setIsAuthorize(res.data.IsAuthorize);
if (res.data.IsAuthorize) { if (res.data.IsAuthorize) {
setMsg(''); setMsg('');
// if (res.data.IsAppend) {
// setMsg('当前环境需要追加产品');
// setAppend('');
// } else {
// setMsg('');
// setAppend('没有追加的产品');
// }
} else { } 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]) {
setbeforeColor('red'); setbeforeColor('red');
setResult('检测到License已被使用'); setResult('检测到License已被使用');
...@@ -371,32 +372,74 @@ const DatabaseInitialization = props => { ...@@ -371,32 +372,74 @@ const DatabaseInitialization = props => {
setResult('未检测到License'); setResult('未检测到License');
setMsg('未检测到License'); setMsg('未检测到License');
} }
}
// if (res.data.DBExists) {
// setCheckboxFlag(1);
// setMsg('当前数据库已存在不可初始化');
// notification.error({
// message: '提示',
// duration: 3,
// description: '当前数据库已存在不可初始化',
// });
// } else if (!res.data.DBExists && !res.data.Project[0]) {
// setCheckboxFlag(0);
// setMsg('');
// notification.warning({
// message: '提示',
// duration: 3,
// description: '未检测到License,自主选择产品进行数据库初始化',
// });
// } else if (!res.data.DBExists && res.data.Project[0]) {
// setCheckboxFlag(1);
// notification.success({
// message: '提示',
// duration: 3,
// description: '已检测到License,需初始化数据库',
// });
// setMsg('');
// } // }
}
} else {
notification.error({
message: '提示',
duration: 3,
description: res.msg,
});
}
});
};
const GetDbChangeFirst = kk => {
console.log(123);
let obj = form.getFieldsValue();
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);
} else {
onCheckLaster(res.data.IsAppend);
}
} else {
if (res.data.Project && res.data.Project[0]) {
setbeforeColor('red');
setResult('检测到License已被使用');
setMsg('检测到License已被使用');
} else {
setbeforeColor('red');
setResult('未检测到License');
setMsg('未检测到License');
}
}
} else { } else {
notification.error({ notification.error({
message: '提示', message: '提示',
...@@ -409,15 +452,16 @@ const DatabaseInitialization = props => { ...@@ -409,15 +452,16 @@ const DatabaseInitialization = props => {
const GetDbChange = e => { const GetDbChange = e => {
let obj = form.getFieldsValue(); let obj = form.getFieldsValue();
console.log(2222);
GetDbProduct({ ...obj }).then(res => { GetDbProduct({ ...obj }).then(res => {
setCardLoading(false); setCardLoading(false);
if (res.code === 0) { if (res.code === 0) {
if (res.data.IsAuthorize) { if (res.data.IsAuthorize) {
// setMsg(''); // setMsg('');
if (e) { if (e) {
findCheck(); findCheck(res.data.IsAppend);
} else { } else {
onCheckLaster(); onCheckLaster(res.data.IsAppend);
} }
} else { } else {
if (res.data.Project && res.data.Project[0]) { if (res.data.Project && res.data.Project[0]) {
...@@ -446,13 +490,6 @@ const DatabaseInitialization = props => { ...@@ -446,13 +490,6 @@ const DatabaseInitialization = props => {
res.data.Product.map(i => { res.data.Product.map(i => {
aa.push(i.name); aa.push(i.name);
}); });
console.log(aa);
// if (res.data.IsAuthorize || res.data.DBExists) {
// setCheckboxFlag(1);
// } else {
// setCheckboxFlag(0);
// }
// console.log(aa);
if (aa.length > 0) { if (aa.length > 0) {
let dd = []; let dd = [];
aa.map(i => { aa.map(i => {
...@@ -462,13 +499,9 @@ const DatabaseInitialization = props => { ...@@ -462,13 +499,9 @@ const DatabaseInitialization = props => {
} }
}); });
}); });
console.log(dd);
let Arr = Array.from(new Set(dd)); let Arr = Array.from(new Set(dd));
console.log(Arr);
let arr = formateArrDataA(Arr, 'productName'); let arr = formateArrDataA(Arr, 'productName');
console.log(arr);
let a = Object.keys(arr); let a = Object.keys(arr);
console.log(a);
a.map(i => { a.map(i => {
let list = []; let list = [];
arr[i].map(j => { arr[i].map(j => {
...@@ -481,18 +514,81 @@ const DatabaseInitialization = props => { ...@@ -481,18 +514,81 @@ const DatabaseInitialization = props => {
setKeepValue(arr); setKeepValue(arr);
} }
let newArr = Array.from(new Set(aa)); let newArr = Array.from(new Set(aa));
console.log(aa);
// 当前数据库已存在和上一个已存在数据库值重新赋值 // 当前数据库已存在和上一个已存在数据库值重新赋值
if (newArr.length > 0 || dbExists) { if (newArr.length > 0) {
setKeepProduct(newArr);
setKeepCode(newArr);
setValue(newArr);
} else {
setKeepProduct([]);
setKeepCode([]);
setValue([]);
}
if (res.data.Product.length == 0) {
console.log(1212);
setKeepValue([]);
}
}
setKeepDb(res.data);
setIsAuthorize(res.data.IsAuthorize);
} else {
notification.error({
message: '提示',
duration: 3,
description: res.msg,
});
}
});
};
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 = [];
res.data.Product.map(i => {
aa.push(i.name);
});
if (aa.length > 0) {
let dd = [];
aa.map(i => {
keepData.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));
// 当前数据库已存在和上一个已存在数据库值重新赋值
if (newArr.length > 0) {
setKeepProduct(newArr); setKeepProduct(newArr);
setKeepCode(newArr); setKeepCode(newArr);
setValue(newArr); setValue(newArr);
} else {
setKeepProduct([]);
setKeepCode([]);
setValue([]);
} }
if (res.data.Product.length == 0) { if (res.data.Product.length == 0) {
setKeepValue([]); setKeepValue([]);
} }
} }
setDbExists(res.data.DBExists);
setKeepDb(res.data); setKeepDb(res.data);
setIsAuthorize(res.data.IsAuthorize); setIsAuthorize(res.data.IsAuthorize);
} else { } else {
...@@ -517,45 +613,12 @@ const DatabaseInitialization = props => { ...@@ -517,45 +613,12 @@ const DatabaseInitialization = props => {
handleShowModal('initVisible', false); handleShowModal('initVisible', false);
setInitVisible(true); setInitVisible(true);
doInitLog(); doInitLog();
// if (dbExists) {
// InitEditDataBase({ ...obj, productSetting, license: j }).then(res => {
// setInitLoading(false);
// if (res.code === 0) {
// setfirstColor('green');
// setsecordColor('green');
// SetAdminMenuToRole().then(resdata => {
// if (resdata.code === 0) {
// setLastColor('green');
// }
// });
// notification.success({
// message: '提示',
// duration: 5,
// description: '数据库初始化成功',
// });
// } else {
// setfirstColor('red');
// setsecordColor('gray');
// setLastColor('gray');
// notification.error({
// message: '提示',
// duration: 5,
// description: res.msg,
// });
// }
// });
// return;
// }
NewInitAddDataBase({ ...obj, productSetting }).then(res => { NewInitAddDataBase({ ...obj, productSetting }).then(res => {
if (res.code === 0) { if (res.code === 0) {
if (value.length > 0) { if (value.length > 0) {
setKeepProduct(value); setKeepProduct(value);
} }
// setbeforeColor('red');
// setResult('检测到License已被使用');
setMsg('检测到License已被使用'); setMsg('检测到License已被使用');
setCheckboxFlag(1);
setfirstColor('green'); setfirstColor('green');
setDataResult('成功'); setDataResult('成功');
...@@ -564,13 +627,64 @@ const DatabaseInitialization = props => { ...@@ -564,13 +627,64 @@ const DatabaseInitialization = props => {
duration: 3, duration: 3,
description: '数据库初始化成功', description: '数据库初始化成功',
}); });
setDbExists(true);
if (keepNumber != '') { if (keepNumber != '') {
setkeepNumber('已使用'); setkeepNumber('已使用');
} }
// setkeepNa(''); if (res.data.productPackageCount == 0) {
// setkeepMsg(''); setProductResult('产品授权不包含已初始化的产品');
// setkeepCo(''); setsecordColor('#eda625');
} else {
setsecordColor('green');
}
setTotalProduct(res.data.productPackageSumCount);
setSimpleProduct(res.data.productPackageCount);
SetAdminMenuToRole().then(resdata => {
if (resdata.code === 0) {
setLastColor('green');
setKeepLast('');
} else {
setLastColor('red');
setKeepLast(res.data.msg);
}
});
} else {
setDataResult(res.msg);
setFinish(true);
setfirstColor('red');
setsecordColor('gray');
setLastColor('gray');
notification.error({
message: '提示',
duration: 3,
description: res.msg,
});
}
});
};
// 数据库初始化追加
const initDatabaseProAppend = () => {
// 数据库存在调用编辑接口否则调用新增接口
handleShowModal('initVisible', false);
setInitVisible(true);
doInitLog();
let obj = form.getFieldsValue();
InitEditDataBase(obj).then(res => {
if (res.code === 0) {
// if (value.length > 0) {
// setKeepProduct(value);
// }
setMsg('检测到License已被使用');
setfirstColor('green');
setDataResult('成功');
notification.success({
message: '提示',
duration: 3,
description: '数据库初始化追加成功',
});
if (keepNumber != '') {
setkeepNumber('已使用');
}
if (res.data.productPackageCount == 0) { if (res.data.productPackageCount == 0) {
setProductResult('产品授权不包含已初始化的产品'); setProductResult('产品授权不包含已初始化的产品');
setsecordColor('#eda625'); setsecordColor('#eda625');
...@@ -685,8 +799,6 @@ const DatabaseInitialization = props => { ...@@ -685,8 +799,6 @@ const DatabaseInitialization = props => {
arr[i] = list; arr[i] = list;
}); });
setAllLength(res.data.length); setAllLength(res.data.length);
console.log(arr);
console.log(aa);
setTitle(aa); setTitle(aa);
setData(arr); setData(arr);
} else { } else {
...@@ -699,44 +811,44 @@ const DatabaseInitialization = props => { ...@@ -699,44 +811,44 @@ const DatabaseInitialization = props => {
setbeforeColor('red'); setbeforeColor('red');
setResult('请输入完整数据库信息'); setResult('请输入完整数据库信息');
setMsg('请输入完整数据库信息'); setMsg('请输入完整数据库信息');
setCheckboxFlag(1);
} }
}; };
const onCheckLaster = () => { const onCheckLaster = aa => {
// 此时有授权码才能进入
let obj = form.getFieldsValue(); let obj = form.getFieldsValue();
CheckDatabaseIsExist({ ...obj }).then(res => { CheckDatabaseIsExist({ ...obj }).then(res => {
setCardLoading(false); setCardLoading(false);
if (res.code == 0) { if (res.code == 0) {
setDataValue(form.getFieldsValue());
// 数据库不存在 // 数据库不存在
if (res.data === false) { if (res.data === false) {
setbeforeColor('green'); setbeforeColor('green');
setResult('通过'); setResult('通过');
// 有授权码 setAppend('无需追加');
console.log(keepNumber);
if (keepNumber && keepNumber != '已使用') {
setCheckboxFlag(1);
// setDbExists(false);
setMsg(''); setMsg('');
} else { if (keepNumber && keepNumber != '已使用') {
setCheckboxFlag(0);
// setDbExists(false);
setMsg(''); setMsg('');
} }
// setValue([]); } else {
// setKeepProduct([]); if (aa) {
console.log(value); setbeforeColor('green');
setResult('检测到License,当前环境需要追加产品');
setMsg('检测到License,当前环境需要追加产品');
setAppend('');
setAppendVisible(true);
console.log(form.getFieldsValue());
setDataValue(form.getFieldsValue());
} else { } else {
setbeforeColor('red'); setbeforeColor('red');
setResult('当前数据库已存在'); setResult('无法追加,该数据库为非授权初始化数据库,请直接升级数据库!');
setCheckboxFlag(1); setMsg('无法追加,该数据库为非授权初始化数据库,请直接升级数据库!');
setMsg('当前数据库已存在'); setAppend('无需追加');
}
} }
} else { } else {
setbeforeColor('red'); setbeforeColor('red');
setResult(`${res.msg}`); setResult(`${res.msg}`);
setMsg(res.msg); setMsg(res.msg);
setCheckboxFlag(1);
} }
}); });
}; };
...@@ -747,7 +859,6 @@ const DatabaseInitialization = props => { ...@@ -747,7 +859,6 @@ const DatabaseInitialization = props => {
GetProductList({ ...obj }).then(res => { GetProductList({ ...obj }).then(res => {
setCardLoading(false); setCardLoading(false);
if (res.code === 0) { if (res.code === 0) {
console.log(res.data);
GetDbChange(1); GetDbChange(1);
setKeepData(res.data); setKeepData(res.data);
let arr = formateArrDataA(res.data, 'productName'); let arr = formateArrDataA(res.data, 'productName');
...@@ -760,8 +871,6 @@ const DatabaseInitialization = props => { ...@@ -760,8 +871,6 @@ const DatabaseInitialization = props => {
arr[i] = list; arr[i] = list;
}); });
setAllLength(res.data.length); setAllLength(res.data.length);
console.log(arr);
console.log(aa);
setTitle(aa); setTitle(aa);
setData(arr); setData(arr);
} }
...@@ -772,64 +881,52 @@ const DatabaseInitialization = props => { ...@@ -772,64 +881,52 @@ const DatabaseInitialization = props => {
setbeforeColor('red'); setbeforeColor('red');
setResult('请输入完整数据库信息'); setResult('请输入完整数据库信息');
setMsg('请输入完整数据库信息'); setMsg('请输入完整数据库信息');
setCheckboxFlag(1);
} }
}; };
const findCheck = () => { const findCheck = aa => {
let obj = form.getFieldsValue(); let obj = form.getFieldsValue();
CheckDatabaseIsExist({ ...obj }).then(res => { CheckDatabaseIsExist({ ...obj }).then(res => {
setCardLoading(false); setCardLoading(false);
if (res.code === 0) { if (res.code === 0) {
setDataValue(form.getFieldsValue());
if (res.data === true) { if (res.data === true) {
if (aa) {
setbeforeColor('green');
setResult('检测到License,当前环境需要追加产品');
setMsg('检测到License,当前环境需要追加产品');
setAppend('');
setAppendVisible(true);
setDataValue(form.getFieldsValue());
} else {
setbeforeColor('red'); setbeforeColor('red');
setPassword(false); setPassword(false);
setResult('当前数据库已存在 '); setResult('无法追加,该数据库为非授权初始化数据库,请直接升级数据库! ');
setMsg('当前数据库已存在'); setMsg('无法追加,该数据库为非授权初始化数据库,请直接升级数据库!');
setAppend('无需追加');
deleteInitDBLogNew(); deleteInitDBLogNew();
setCheckboxFlag(1); }
} else { } else {
setPassword(true); setPassword(true);
setbeforeColor('green'); setbeforeColor('green');
setResult('通过'); setResult('通过');
// setDbExists(false);
setMsg(''); setMsg('');
if (checkboxFlag == 0 && value.length == 0) { setAppend('无需追加');
notification.warning({
message: '提示',
duration: 3,
description: '请勾选产品',
});
} else if (checkboxFlag == 1 && keepProduct.length == 0) {
notification.warning({
message: '提示',
duration: 3,
description: '请勾选产品',
});
} else {
let arr = []; let arr = [];
if (checkboxFlag == 0) {
keepData.map(i => {
if (value.indexOf(i.name) != -1) {
arr.push(i);
}
});
} else {
keepData.map(i => { keepData.map(i => {
if (keepCode.indexOf(i.name) != -1) { if (keepCode.indexOf(i.name) != -1) {
arr.push(i); arr.push(i);
} }
}); });
}
onOK(arr); onOK(arr);
} }
}
} else { } else {
setbeforeColor('red'); setbeforeColor('red');
setResult(`${res.msg}`); setResult(`${res.msg}`);
setMsg(res.msg); setMsg(res.msg);
setCheckboxFlag(1);
} }
}); });
}; };
...@@ -871,6 +968,11 @@ const DatabaseInitialization = props => { ...@@ -871,6 +968,11 @@ const DatabaseInitialization = props => {
return aa; return aa;
}; };
const onOk = () => {
setAppendVisible(false);
initDatabaseProAppend();
GetDbChangeAppend();
};
return ( return (
<> <>
<PageContainer className={styles.InitDataBaseContainer}> <PageContainer className={styles.InitDataBaseContainer}>
...@@ -899,7 +1001,6 @@ const DatabaseInitialization = props => { ...@@ -899,7 +1001,6 @@ const DatabaseInitialization = props => {
if (!regCn.test(form.getFieldValue().ip)) { if (!regCn.test(form.getFieldValue().ip)) {
return Promise.reject('ip格式不正确'); return Promise.reject('ip格式不正确');
} }
setbeforeColor('gray'); setbeforeColor('gray');
setfirstColor('gray'); setfirstColor('gray');
setsecordColor('gray'); setsecordColor('gray');
...@@ -923,7 +1024,6 @@ const DatabaseInitialization = props => { ...@@ -923,7 +1024,6 @@ const DatabaseInitialization = props => {
if (form.getFieldValue().userName == '') { if (form.getFieldValue().userName == '') {
return Promise.reject('用户名称必填'); return Promise.reject('用户名称必填');
} }
setbeforeColor('gray'); setbeforeColor('gray');
setfirstColor('gray'); setfirstColor('gray');
setsecordColor('gray'); setsecordColor('gray');
...@@ -944,7 +1044,6 @@ const DatabaseInitialization = props => { ...@@ -944,7 +1044,6 @@ const DatabaseInitialization = props => {
rules={[ rules={[
{ {
validator: (rule, value) => { validator: (rule, value) => {
console.log(form.getFieldValue().password);
if (form.getFieldValue().password == '') { if (form.getFieldValue().password == '') {
return Promise.reject('用户密码必填'); return Promise.reject('用户密码必填');
} }
...@@ -969,7 +1068,6 @@ const DatabaseInitialization = props => { ...@@ -969,7 +1068,6 @@ const DatabaseInitialization = props => {
rules={[ rules={[
{ {
validator: (rule, value) => { validator: (rule, value) => {
console.log(form.getFieldValue().dbName);
if ( if (
form.getFieldValue().dbName == '' || form.getFieldValue().dbName == '' ||
form.getFieldValue().dbName == undefined form.getFieldValue().dbName == undefined
...@@ -1050,6 +1148,17 @@ const DatabaseInitialization = props => { ...@@ -1050,6 +1148,17 @@ const DatabaseInitialization = props => {
return ( return (
<CheckCircleOutlined style={{ color: 'green', marginLeft: '10px' }} /> <CheckCircleOutlined style={{ color: 'green', marginLeft: '10px' }} />
); );
case '检测到License,当前环境需要追加产品':
return (
<>
<CheckCircleOutlined
style={{ color: 'green', marginLeft: '10px' }}
/>
<span style={{ color: 'rgb(24 144 255)', marginLeft: '5px' }}>
{result}
</span>
</>
);
default: default:
return ( return (
<> <>
...@@ -1207,18 +1316,11 @@ const DatabaseInitialization = props => { ...@@ -1207,18 +1316,11 @@ const DatabaseInitialization = props => {
{keepCo ? <>{keepCo}</> : '-'} {keepCo ? <>{keepCo}</> : '-'}
</div> </div>
<div style={{ display: 'inline-block', backgroundColor: 'aliceblue' }}> <div style={{ display: 'inline-block', backgroundColor: 'aliceblue' }}>
{checkboxFlag == 0 ? (
<div style={{ float: 'right' }}>
(已选<span style={{ color: 'rgb(24 144 255)' }}>{value.length}</span>/
<span style={{ color: 'rgb(24 144 255)' }}>{allLength}</span>个产品)
</div>
) : (
<div style={{ float: 'right' }}> <div style={{ float: 'right' }}>
(已选 (已选
<span style={{ color: 'rgb(24 144 255)' }}>{keepProduct.length}</span>/ <span style={{ color: 'rgb(24 144 255)' }}>{keepProduct.length}</span>/
<span style={{ color: 'rgb(24 144 255)' }}>{allLength}</span>个产品) <span style={{ color: 'rgb(24 144 255)' }}>{allLength}</span>个产品)
</div> </div>
)}
</div> </div>
</div> </div>
<Spin tip="loading..." spinning={cardLoading}> <Spin tip="loading..." spinning={cardLoading}>
...@@ -1236,18 +1338,10 @@ const DatabaseInitialization = props => { ...@@ -1236,18 +1338,10 @@ const DatabaseInitialization = props => {
> >
{`${item}(${simple(item)}/${total(item)})`} {`${item}(${simple(item)}/${total(item)})`}
</Divider> </Divider>
{/* {checkboxFlag == 0 ? (
<CheckboxGroup
options={data[item]}
value={value}
onChange={e => onChange1(e, item)}
/>
) : (
<> */}
{data[item] && {data[item] &&
data[item].map((i, j) => { data[item].map((i, j) => {
if (keepProduct.indexOf(i) != -1) { if (keepProduct.indexOf(i) != -1) {
return <Checkbox checked={true}>{i}</Checkbox>; return <Checkbox checked>{i}</Checkbox>;
} else { } else {
return ( return (
<Checkbox checked={false} disabled> <Checkbox checked={false} disabled>
...@@ -1256,17 +1350,20 @@ const DatabaseInitialization = props => { ...@@ -1256,17 +1350,20 @@ const DatabaseInitialization = props => {
); );
} }
})} })}
{/* </>
)} */}
</div> </div>
))} ))}
</div> </div>
</Spin> </Spin>
<div> <div>
<Space size="large" className={styles.btnBox}> <Space size="large" className={styles.btnBox}>
{/* {append == '' ? (
<Button onClick={() => setAppendVisible(true)}>追加</Button>
) : (
<></>
)} */}
<Popconfirm <Popconfirm
placement="topLeft" placement="topLeft"
disabled={msg == '' ? false : true} disabled={msg != ''}
title={<span style={{ color: 'rgb(24 144 255)' }}>是否确认初始化!</span>} title={<span style={{ color: 'rgb(24 144 255)' }}>是否确认初始化!</span>}
okText="确认" okText="确认"
cancelText="取消" cancelText="取消"
...@@ -1275,7 +1372,7 @@ const DatabaseInitialization = props => { ...@@ -1275,7 +1372,7 @@ const DatabaseInitialization = props => {
deleteInitDBLogNew(); deleteInitDBLogNew();
}} }}
> >
<Button type="primary" disabled={msg == '' ? false : true}> <Button type="primary" disabled={msg != ''}>
初始化 初始化
</Button> </Button>
{/* <Button type="primary" disabled={isAuthorize && msg == '' ? false : true}> {/* <Button type="primary" disabled={isAuthorize && msg == '' ? false : true}>
...@@ -1380,6 +1477,14 @@ const DatabaseInitialization = props => { ...@@ -1380,6 +1477,14 @@ const DatabaseInitialization = props => {
{keepInitContent} {keepInitContent}
</div> </div>
</Modal> </Modal>
<AppendModal
visible={appendVisible}
onCancel={() => {
setAppendVisible(false);
}}
value={dataValue}
callBackSubmit={onOk}
/>
<Modal <Modal
title="初始化数据库详细日志" title="初始化数据库详细日志"
visible={initVisibledetail} visible={initVisibledetail}
......
...@@ -23,6 +23,9 @@ InitDataBaseContainer { ...@@ -23,6 +23,9 @@ InitDataBaseContainer {
padding-bottom: 0px !important; padding-bottom: 0px !important;
} }
} }
.ant-modal-footer {
padding: 10px 25px 10px 40px;
}
.cardContainer { .cardContainer {
margin-top: 10px; margin-top: 10px;
......
...@@ -228,3 +228,7 @@ export const SetAdminMenuToRole = params => ...@@ -228,3 +228,7 @@ export const SetAdminMenuToRole = params =>
export const NewInitAddDataBase = params => export const NewInitAddDataBase = params =>
post(`${PUBLISH_SERVICE}/DBManager/NewInitAddDataBase`, params); post(`${PUBLISH_SERVICE}/DBManager/NewInitAddDataBase`, params);
// 获取追加产品
export const GetLicenseDifference = params =>
post(`${PUBLISH_SERVICE}/DBManager/GetLicenseDifference`, params);
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