Commit fcacc12b authored by 皮倩雯's avatar 皮倩雯

fix: '追加新产品图标'

parent f2289ced
Pipeline #72310 waiting for manual action with stages
This diff was suppressed by a .gitattributes entry.
/* eslint-disable indent */
/* eslint-disable guard-for-in */
/* eslint-disable no-restricted-syntax */
import React, { useEffect, useState } from 'react';
......@@ -9,9 +10,10 @@ import {
PlusOutlined,
CheckOutlined,
} from '@ant-design/icons';
import styles from './DatabaseInitialization.less';
import CryptoJS from 'crypto-js';
import styles from './DatabaseInitialization.less';
import { GetLicenseDifference, InitEditDataBase, GetProductList } from '@/services/database/api';
import New from '../../../assets/images/icons/new.png';
const AppendModal = props => {
const { callBackSubmit = () => {}, visible, onCancel, value, keepHistroy } = props;
......@@ -29,6 +31,7 @@ const AppendModal = props => {
const [name1, setName1] = useState('');
const [number1, setNumber1] = useState('');
const [allValue, setAllValue] = useState([]);
const [keepData, setKeepData] = useState([]);
const key = CryptoJS.enc.Utf8.parse('1p2a3n4d5a6o7m8s9a10n1e2t3c4o5re'); // 十六位十六进制数作为密钥
const iv = CryptoJS.enc.Utf8.parse('1234567890000000');
......@@ -36,11 +39,9 @@ const AppendModal = props => {
useEffect(() => {
if (visible) {
getProduct();
console.log(value);
console.log(keepHistroy);
let aa = [];
keepHistroy.map((i, j) => {
if (i.license != '已使用' && j != keepHistroy.length - 1) {
if (i.license !== '已使用' && j !== keepHistroy.length - 1) {
aa.push(i);
}
});
......@@ -98,6 +99,7 @@ const AppendModal = props => {
GetLicenseDifference({ ...value, password: Encrypt(value.password) }).then(res => {
setLoading(false);
if (res.code === 0) {
setKeepData(res.data);
let aab = [];
res.data.map(k => {
if (k.status == 0) {
......@@ -114,7 +116,6 @@ const AppendModal = props => {
});
arr[i] = list;
});
console.log(arr);
setData(arr);
if (res.data.length == 0) {
setFlag(1);
......@@ -183,7 +184,6 @@ const AppendModal = props => {
aa.push(i);
}
});
console.log(aa);
return aa.length;
};
......@@ -224,7 +224,7 @@ const AppendModal = props => {
}
>
<Spin spinning={loading}>
{flag == 1 ? (
{flag === 1 ? (
<Empty
image={Empty.PRESENTED_IMAGE_SIMPLE}
description={<span>当前授权码下产品已全部初始化,无需再次追加</span>}
......@@ -342,9 +342,20 @@ const AppendModal = props => {
marginBottom: '20px',
}}
>
{allValue.indexOf(j) != -1 ? (
{allValue.indexOf(j) !== -1 ? (
<span>
{' '}
{keepData.length > 0 &&
keepData.find(item => item.name === j).version !== 2022 && (
<img
src={New}
style={{
height: '24px',
marginTop: '-12px',
marginRight: '3px',
}}
alt=""
/>
)}
<PlusOutlined
style={{ color: 'rgb(24, 144, 255)', marginRight: '5px' }}
/>
......@@ -352,6 +363,18 @@ const AppendModal = props => {
</span>
) : (
<span>
{keepData.length > 0 &&
keepData.find(item => item.name === j).version !== 2022 && (
<img
src={New}
style={{
height: '24px',
marginTop: '-12px',
marginRight: '3px',
}}
alt=""
/>
)}
<CheckOutlined style={{ color: 'green', marginRight: '5px' }} />
{j}
</span>
......
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