Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivManage
Commits
d05c0fc8
Commit
d05c0fc8
authored
Aug 19, 2021
by
邓超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 数据库连接模块保存连接下面记录不刷新修复 数据库标准化管理,数据库连接配置报错修复 web配置显示修复 台账管理保存显示修复 产品配置不能保存修复
parent
d05d6c72
Pipeline
#33184
passed with stages
in 43 minutes 36 seconds
Changes
6
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
186 additions
and
273 deletions
+186
-273
InitDataBase.jsx
src/pages/database/InitDataBase.jsx
+52
-198
ManagementDataBase.jsx
src/pages/database/ManagementDataBase.jsx
+12
-9
SQLServerTable.jsx
...ages/database/databaseConfig/sqlServer/SQLServerTable.jsx
+4
-1
standingBook.jsx
src/pages/platformCenter/standingBook/standingBook.jsx
+2
-1
RoleManage.jsx
src/pages/userCenter/roleManage/RoleManage.jsx
+103
-51
editForm.jsx
src/pages/webConfig/components/editForm.jsx
+13
-13
No files found.
src/pages/database/InitDataBase.jsx
View file @
d05c0fc8
...
@@ -18,22 +18,14 @@ import PageContainer from '@/components/BasePageContainer';
...
@@ -18,22 +18,14 @@ import PageContainer from '@/components/BasePageContainer';
import
{
connect
}
from
'react-redux'
;
import
{
connect
}
from
'react-redux'
;
import
{
import
{
setTableSQLDirName
,
setTableSQLDirName
,
deleteConn
,
deleteConnNew
,
deleteConnNew
,
initDBv4
,
initDBv4new
,
initDBv4new
,
getInitDBLog
,
getInitDBLogNew
,
getInitDBLogNew
,
getConnRecord
,
getConnRecordNew
,
getConnRecordNew
,
getDataBaseConfig
,
getDataBaseConfigNew
,
getDataBaseConfigNew
,
saveConnection
,
saveConnectionNew
,
saveConnectionNew
,
getDataBaseList
,
getDataBaseList
,
updateConnDesc
,
updateConnDescNew
,
updateConnDescNew
,
deleteInitDBLog
,
deleteInitDBLogNew
,
deleteInitDBLogNew
,
connectionTest
,
connectionTest
,
}
from
'@/services/database/api'
;
}
from
'@/services/database/api'
;
...
@@ -46,7 +38,7 @@ const formLables = {
...
@@ -46,7 +38,7 @@ const formLables = {
password
:
'数据库用户密码'
,
password
:
'数据库用户密码'
,
dbName
:
'数据库名称'
,
dbName
:
'数据库名称'
,
};
};
let
time
=
null
let
time
=
null
;
const
InitDataBase
=
props
=>
{
const
InitDataBase
=
props
=>
{
const
[
form
]
=
Form
.
useForm
();
const
[
form
]
=
Form
.
useForm
();
const
[
tableLoading
,
setTableLoading
]
=
useState
(
false
);
// 连接记录
const
[
tableLoading
,
setTableLoading
]
=
useState
(
false
);
// 连接记录
...
@@ -70,83 +62,15 @@ const InitDataBase = props => {
...
@@ -70,83 +62,15 @@ const InitDataBase = props => {
const
[
finish
,
setFinish
]
=
useState
(
false
);
const
[
finish
,
setFinish
]
=
useState
(
false
);
const
[
initLoading
,
setInitLoading
]
=
useState
(
false
);
const
[
initLoading
,
setInitLoading
]
=
useState
(
false
);
const
scroll
=
useRef
(
null
);
const
scroll
=
useRef
(
null
);
// 获取数据库链接记录
useEffect
(()
=>
{
setTableLoading
(
true
);
// getConnRecord({
// _version: 9999,
// dc: Date.now(),
// })
// .then(res => {
// setTableLoading(false);
// if (res.length > 0) {
// let arr = res.map((item, index) => {
// item.key = index;
// return item;
// });
// setData(arr);
// }
// })
// .catch(err => {
// setTableLoading(false);
// console.error(err);
// });
getConnRecordNew
().
then
(
resnew
=>
{
setTableLoading
(
false
);
if
(
resnew
.
code
==
0
)
{
let
res
=
resnew
.
data
let
arr
=
res
.
map
((
item
,
index
)
=>
{
item
.
key
=
index
;
return
item
;
});
setData
(
arr
);
}
}).
catch
(
err
=>
{
setTableLoading
(
false
);
console
.
error
(
err
);
});
return
()
=>
{
if
(
time
)
{
clearTimeout
(
time
)
time
=
null
}
}
},
[
upData
]);
// 获取数据库配置信息
// 获取数据库配置信息
useEffect
(()
=>
{
useEffect
(()
=>
{
setCardLoading
(
true
);
setCardLoading
(
true
);
// getDataBaseConfig({
// 数据库连接记录初始化
// _version: 9999,
getConnRecordData
();
// dc: Date.now(),
getDataBaseConfigNew
().
then
(
resnew
=>
{
// })
// .then(res => {
// setCardLoading(false);
// if (res.success) {
// const { inUse } = res;
// let obj = {};
// Object.keys(dbForm).forEach(k => {
// obj[k] = res[k];
// });
// form.setFieldsValue(obj);
// setDbForm(val => ({ ...val, ...obj }));
// setAllSqulDir(res.allSqlDir);
// if (res.allSqlDir.some(item => item === inUse)) {
// setDefaultSqlDir(res.tableSQLDirName);
// } else {
// // 默认切换到第一个产品方案
// handeleChangeSQLDirName(res.allSqlDir[0]);
// setDefaultSqlDir(res.allSqlDir[0]);
// }
// }
// })
// .catch(err => {
// setCardLoading(false);
// console.error(err);
// });
getDataBaseConfigNew
().
then
(
resnew
=>
{
setCardLoading
(
false
);
setCardLoading
(
false
);
let
res
=
resnew
.
data
let
res
=
resnew
.
data
;
if
(
resnew
.
code
==
0
)
{
if
(
resnew
.
code
==
0
)
{
const
{
inUse
}
=
res
;
const
{
inUse
}
=
res
;
...
@@ -165,23 +89,42 @@ const InitDataBase = props => {
...
@@ -165,23 +89,42 @@ const InitDataBase = props => {
setDefaultSqlDir
(
res
.
allSqlDir
[
0
]);
setDefaultSqlDir
(
res
.
allSqlDir
[
0
]);
}
}
}
}
}
});
)
return
()
=>
{
return
()
=>
{
if
(
time
)
{
if
(
time
)
{
clearTimeout
(
time
)
clearTimeout
(
time
);
time
=
null
time
=
null
;
}
}
}
};
},
[]);
},
[]);
// 获取数据库连接记录
const
getConnRecordData
=
()
=>
{
setTableLoading
(
true
);
getConnRecordNew
()
.
then
(
resnew
=>
{
setTableLoading
(
false
);
if
(
resnew
.
code
==
0
)
{
let
res
=
resnew
.
data
;
let
arr
=
res
.
map
((
item
,
index
)
=>
{
item
.
key
=
index
;
return
item
;
});
setData
(
arr
);
}
})
.
catch
(
err
=>
{
setTableLoading
(
false
);
console
.
error
(
err
);
});
};
// 获取日志
// 获取日志
const
doInitLog
=
()
=>
{
const
doInitLog
=
()
=>
{
setInitLoading
(
true
)
setInitLoading
(
true
)
;
getInitDBLogNew
()
getInitDBLogNew
()
.
then
(
res
=>
{
.
then
(
res
=>
{
if
(
res
.
code
==
0
)
{
if
(
res
.
code
==
0
)
{
if
(
res
.
data
.
content
)
{
if
(
res
.
data
.
content
)
{
setInitLoading
(
false
)
setInitLoading
(
false
)
;
let
arr
=
[];
let
arr
=
[];
arr
.
push
(
arr
.
push
(
res
.
data
.
content
res
.
data
.
content
...
@@ -195,12 +138,11 @@ const InitDataBase = props => {
...
@@ -195,12 +138,11 @@ const InitDataBase = props => {
time
=
setTimeout
(()
=>
{
time
=
setTimeout
(()
=>
{
doInitLog
();
doInitLog
();
},
600
);
},
600
);
}
}
else
{
else
{
setInitLoading
(
false
);
setInitLoading
(
false
)
if
(
time
)
{
if
(
time
)
{
clearTimeout
(
time
)
clearTimeout
(
time
)
;
time
=
null
time
=
null
;
}
}
}
}
}
}
...
@@ -208,30 +150,6 @@ const InitDataBase = props => {
...
@@ -208,30 +150,6 @@ const InitDataBase = props => {
.
catch
(
err
=>
{
.
catch
(
err
=>
{
setFinish
(
true
);
setFinish
(
true
);
});
});
// getInitDBLogNew().
// then(resnew => {
// if (resnew.code == 0) {
// let res = resnew.data
// if (res.content) {
// let arr = [];
// arr.push(
// res.content
// .split(/(\r\n)|(\n)/)
// .map((item, index) => <p key={index}>{item}</p>),
// );
// setInitContent(arr);
// scroll.current.scrollTop = scroll.current.scrollHeight;
// }
// if (!res.finish) {
// setTimeout(() => {
// doInitLog();
// }, 600);
// }
// }
// })
// .catch(err => {
// setFinish(true);
// });
};
};
// 数据库初始化
// 数据库初始化
const
initClick
=
()
=>
{
const
initClick
=
()
=>
{
...
@@ -240,30 +158,10 @@ const InitDataBase = props => {
...
@@ -240,30 +158,10 @@ const InitDataBase = props => {
setInitVisible
(
true
);
setInitVisible
(
true
);
let
obj
=
form
.
getFieldsValue
();
let
obj
=
form
.
getFieldsValue
();
doInitLog
();
doInitLog
();
// initDBv4({
// _version: 9999,
// _dc: Date.now(),
// ...obj,
// })
// .then(res => {
// setCardLoading(false);
// if (res.GetMe) {
// console.log(res);
// } else {
// notification.error({
// message: '提示',
// duration: 15,
// description: res.Say.Message || '初始化失败',
// });
// }
// })
// .catch(err => {
// setCardLoading(false);
// console.log(err);
// });
initDBv4new
({
initDBv4new
({
...
obj
...
obj
,
}).
then
(
res
=>
{
})
.
then
(
res
=>
{
setCardLoading
(
false
);
setCardLoading
(
false
);
if
(
res
.
code
==
0
)
{
if
(
res
.
code
==
0
)
{
console
.
log
(
res
);
console
.
log
(
res
);
...
@@ -299,11 +197,12 @@ const InitDataBase = props => {
...
@@ -299,11 +197,12 @@ const InitDataBase = props => {
dbName
:
obj
.
dbName
,
dbName
:
obj
.
dbName
,
userName
:
obj
.
userName
,
userName
:
obj
.
userName
,
password
:
obj
.
password
,
password
:
obj
.
password
,
})
.
then
(
})
resnew
=>
{
.
then
(
resnew
=>
{
setCardLoading
(
false
);
setCardLoading
(
false
);
if
(
resnew
.
code
==
0
)
{
if
(
resnew
.
code
==
0
)
{
setUpData
(
upData
+
1
);
// setUpData(upData + 1);
getConnRecordData
();
notification
.
success
({
notification
.
success
({
message
:
'提示'
,
message
:
'提示'
,
duration
:
3
,
duration
:
3
,
...
@@ -316,40 +215,11 @@ const InitDataBase = props => {
...
@@ -316,40 +215,11 @@ const InitDataBase = props => {
description
:
resnew
.
msg
,
description
:
resnew
.
msg
,
});
});
}
}
}
}
)
)
.
catch
(
err
=>
{
.
catch
(
err
=>
{
setCardLoading
(
false
);
setCardLoading
(
false
);
console
.
log
(
err
);
console
.
log
(
err
);
});
});
// saveConnection({
// _version: 9999,
// _dc: new Date().getTime(),
// ip: obj.ip,
// dbName: obj.dbName,
// userName: obj.userName,
// password: obj.password,
// })
// .then(res => {
// setCardLoading(false);
// if (res.GetMe === true) {
// setUpData(upData + 1);
// notification.success({
// message: '提示',
// duration: 3,
// description: '保存成功',
// });
// } else {
// notification.error({
// message: '提示',
// duration: 15,
// description: res.Say.Message || '保存失败',
// });
// }
// })
// .catch(err => {
// setCardLoading(false);
// console.log(err);
// });
};
};
// 测试连接
// 测试连接
const
onCheck
=
e
=>
{
const
onCheck
=
e
=>
{
...
@@ -467,7 +337,7 @@ const InitDataBase = props => {
...
@@ -467,7 +337,7 @@ const InitDataBase = props => {
// _version: 9999,
// _version: 9999,
// _dc: Date.now(),
// _dc: Date.now(),
// });
// });
deleteInitDBLogNew
()
deleteInitDBLogNew
()
;
};
};
// 弹窗确认回调
// 弹窗确认回调
const
modalOkCallback
=
()
=>
{
const
modalOkCallback
=
()
=>
{
...
@@ -499,7 +369,8 @@ const InitDataBase = props => {
...
@@ -499,7 +369,8 @@ const InitDataBase = props => {
})
})
.
then
(
res
=>
{
.
then
(
res
=>
{
setModalVisible
(
false
);
setModalVisible
(
false
);
setUpData
(
upData
+
1
);
// setUpData(upData + 1);
getConnRecordData
();
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
console
.
error
(
err
);
console
.
error
(
err
);
...
@@ -516,7 +387,8 @@ const InitDataBase = props => {
...
@@ -516,7 +387,8 @@ const InitDataBase = props => {
.
then
(
res
=>
{
.
then
(
res
=>
{
setTableLoading
(
false
);
setTableLoading
(
false
);
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
setUpData
(
upData
+
1
);
// setUpData(upData + 1);
getConnRecordData
();
notification
.
success
({
notification
.
success
({
message
:
'提示'
,
message
:
'提示'
,
duration
:
3
,
duration
:
3
,
...
@@ -534,25 +406,6 @@ const InitDataBase = props => {
...
@@ -534,25 +406,6 @@ const InitDataBase = props => {
setTableLoading
(
false
);
setTableLoading
(
false
);
console
.
error
(
err
);
console
.
error
(
err
);
});
});
// deleteConnNew({
// rowIndex: key
// }).then(res => {
// setTableLoading(false);
// if (res.code == 0) {
// setUpData(upData + 1);
// notification.success({
// message: '提示',
// duration: 3,
// description: '操作成功',
// });
// } else {
// notification.error({
// message: '提示',
// duration: 15,
// description: res.msg,
// });
// }
// })
};
};
const
columns
=
[
const
columns
=
[
{
{
...
@@ -760,7 +613,7 @@ const InitDataBase = props => {
...
@@ -760,7 +613,7 @@ const InitDataBase = props => {
// _version: 9999,
// _version: 9999,
// _dc: Date.now(),
// _dc: Date.now(),
//
});
//
});
deleteInitDBLogNew
()
deleteInitDBLogNew
()
;
}
}
}
}
width=
{
800
}
width=
{
800
}
maskClosable=
{
false
}
maskClosable=
{
false
}
...
@@ -773,6 +626,7 @@ const InitDataBase = props => {
...
@@ -773,6 +626,7 @@ const InitDataBase = props => {
onClick=
{
()
=>
{
onClick=
{
()
=>
{
handleClick
();
handleClick
();
}
}
}
}
key=
"back"
type=
"primary"
type=
"primary"
>
>
关闭窗口
关闭窗口
...
...
src/pages/database/ManagementDataBase.jsx
View file @
d05c0fc8
...
@@ -16,7 +16,7 @@ import {
...
@@ -16,7 +16,7 @@ import {
tableCheckNew
,
tableCheckNew
,
updateDateBase
,
updateDateBase
,
databaseStandardGetLog
,
databaseStandardGetLog
,
databaseStandardGetLogNew
databaseStandardGetLogNew
,
}
from
'@/services/database/api'
;
}
from
'@/services/database/api'
;
const
ManagementDataBase
=
()
=>
{
const
ManagementDataBase
=
()
=>
{
...
@@ -65,7 +65,7 @@ const ManagementDataBase = () => {
...
@@ -65,7 +65,7 @@ const ManagementDataBase = () => {
setCheckLoading
(
false
);
setCheckLoading
(
false
);
console
.
log
(
resnew
);
console
.
log
(
resnew
);
if
(
resnew
.
code
==
0
)
{
if
(
resnew
.
code
==
0
)
{
let
res
=
resnew
.
data
let
res
=
resnew
.
data
;
const
{
Autolist
,
ManualList
}
=
res
;
const
{
Autolist
,
ManualList
}
=
res
;
// 自动检测列表
// 自动检测列表
let
arr
=
Autolist
.
map
((
item
,
index
)
=>
{
let
arr
=
Autolist
.
map
((
item
,
index
)
=>
{
...
@@ -112,7 +112,7 @@ const ManagementDataBase = () => {
...
@@ -112,7 +112,7 @@ const ManagementDataBase = () => {
.
then
(
resnew
=>
{
.
then
(
resnew
=>
{
setLogLoading
(
false
);
setLogLoading
(
false
);
if
(
resnew
.
code
==
0
)
{
if
(
resnew
.
code
==
0
)
{
let
res
=
resnew
.
data
.
list
let
res
=
resnew
.
data
.
list
;
let
arr
=
[];
let
arr
=
[];
res
.
map
((
item
,
index
)
=>
{
res
.
map
((
item
,
index
)
=>
{
item
.
key
=
index
;
item
.
key
=
index
;
...
@@ -138,7 +138,7 @@ const ManagementDataBase = () => {
...
@@ -138,7 +138,7 @@ const ManagementDataBase = () => {
setCheckLoading
(
false
);
setCheckLoading
(
false
);
setCheckFlag
(
checkFlag
+
1
);
setCheckFlag
(
checkFlag
+
1
);
setUpFlag
(
upFlag
+
1
);
setUpFlag
(
upFlag
+
1
);
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
notification
.
success
({
notification
.
success
({
message
:
'通知'
,
message
:
'通知'
,
duration
:
3
,
duration
:
3
,
...
@@ -166,7 +166,7 @@ const ManagementDataBase = () => {
...
@@ -166,7 +166,7 @@ const ManagementDataBase = () => {
setModalVisible
(
true
);
setModalVisible
(
true
);
// setContent(text);
// setContent(text);
setContent
(
arr
);
setContent
(
arr
);
}
}
;
const
handleLog
=
(
text
,
val
)
=>
{
const
handleLog
=
(
text
,
val
)
=>
{
setModalTitle
(
val
);
setModalTitle
(
val
);
let
arr
=
[];
let
arr
=
[];
...
@@ -296,11 +296,11 @@ const ManagementDataBase = () => {
...
@@ -296,11 +296,11 @@ const ManagementDataBase = () => {
onClick=
{
()
=>
{
onClick=
{
()
=>
{
handleLog
(
text
,
'详细信息'
);
handleLog
(
text
,
'详细信息'
);
}
}
}
}
style=
{
{
backgroundColor
:
"red"
}
}
style=
{
{
backgroundColor
:
'red'
}
}
>
>
错误内容
错误内容
</
Button
>
</
Button
>
)
)
;
}
}
},
},
},
},
...
@@ -366,7 +366,6 @@ const ManagementDataBase = () => {
...
@@ -366,7 +366,6 @@ const ManagementDataBase = () => {
size=
"small"
size=
"small"
/>
/>
</
Card
>
</
Card
>
</
PageContainer
>
</
PageContainer
>
<
Modal
<
Modal
...
@@ -384,7 +383,11 @@ const ManagementDataBase = () => {
...
@@ -384,7 +383,11 @@ const ManagementDataBase = () => {
}
}
}
}
style=
{
{
top
:
'40px'
}
}
style=
{
{
top
:
'40px'
}
}
footer=
{
[
footer=
{
[
<
Button
type=
"primary"
onClick=
{
()
=>
setModalVisible
(
false
)
}
>
<
Button
type=
"primary"
onClick=
{
()
=>
setModalVisible
(
false
)
}
key=
"back"
>
关闭窗口
关闭窗口
</
Button
>,
</
Button
>,
]
}
]
}
...
...
src/pages/database/databaseConfig/sqlServer/SQLServerTable.jsx
View file @
d05c0fc8
...
@@ -203,6 +203,7 @@ const SQLServerTable = props => {
...
@@ -203,6 +203,7 @@ const SQLServerTable = props => {
size=
"small"
size=
"small"
type=
"primary"
type=
"primary"
onClick=
{
()
=>
handleCon
(
val
,
item
)
}
onClick=
{
()
=>
handleCon
(
val
,
item
)
}
key=
"testLink"
>
>
测试连接
测试连接
</
Button
>,
</
Button
>,
...
@@ -213,12 +214,14 @@ const SQLServerTable = props => {
...
@@ -213,12 +214,14 @@ const SQLServerTable = props => {
color
:
'#faad14'
,
color
:
'#faad14'
,
borderColor
:
'#ffe58f'
,
borderColor
:
'#ffe58f'
,
}
}
}
}
key=
"bntEdit"
size=
"small"
size=
"small"
onClick=
{
()
=>
handleEdit
(
val
,
item
)
}
onClick=
{
()
=>
handleEdit
(
val
,
item
)
}
>
>
编辑
编辑
</
Button
>,
</
Button
>,
<
Popconfirm
<
Popconfirm
key=
"btnDelete"
title=
{
`是否删除连接${item.name}`
}
title=
{
`是否删除连接${item.name}`
}
cancelText=
"取消"
cancelText=
"取消"
okText=
"确认"
okText=
"确认"
...
@@ -236,7 +239,7 @@ const SQLServerTable = props => {
...
@@ -236,7 +239,7 @@ const SQLServerTable = props => {
<>
<>
<
ProTable
<
ProTable
headerTitle=
"SQL数据库"
headerTitle=
"SQL数据库"
rowKey=
"
key
"
rowKey=
"
name
"
search=
{
false
}
search=
{
false
}
columns=
{
columns
}
columns=
{
columns
}
bordered
bordered
...
...
src/pages/platformCenter/standingBook/standingBook.jsx
View file @
d05c0fc8
...
@@ -161,7 +161,8 @@ const standingBook = props => {
...
@@ -161,7 +161,8 @@ const standingBook = props => {
newArr
.
push
(
item
)
newArr
.
push
(
item
)
})
})
setAllData
(
arr
);
setAllData
(
arr
);
setPickItem
(
newArr
[
0
])
// 第一次进入展示第一页 不是第一次进入根据当前选择的来进行展示
flag
===
0
?
setPickItem
(
newArr
[
0
])
:
setPickItem
(
pickItem
);
console
.
log
(
newArr
,
'newArr'
);
console
.
log
(
newArr
,
'newArr'
);
setTableData
(
newArr
);
setTableData
(
newArr
);
}
}
...
...
src/pages/userCenter/roleManage/RoleManage.jsx
View file @
d05c0fc8
...
@@ -25,7 +25,7 @@ import {
...
@@ -25,7 +25,7 @@ import {
FormOutlined
,
FormOutlined
,
EditOutlined
,
EditOutlined
,
DeleteOutlined
,
DeleteOutlined
,
UserAddOutlined
UserAddOutlined
,
}
from
'@ant-design/icons'
;
}
from
'@ant-design/icons'
;
import
{
import
{
setMenuToRole
,
setMenuToRole
,
...
@@ -47,7 +47,7 @@ import EditModal from './EditModal';
...
@@ -47,7 +47,7 @@ import EditModal from './EditModal';
import
EditGroup
from
'./EditGroup'
;
import
EditGroup
from
'./EditGroup'
;
import
userStyles
from
'@/pages/userCenter/userManage/UserManage.less'
;
import
userStyles
from
'@/pages/userCenter/userManage/UserManage.less'
;
import
iconStyles
from
'@/assets/font/omsfont/iconfont.css'
;
import
iconStyles
from
'@/assets/font/omsfont/iconfont.css'
;
import
UserModal
from
'./UserModal'
import
UserModal
from
'./UserModal'
;
import
{
data
}
from
'@/pages/platformCenter/messageManage/projectManage/components/Mock'
;
import
{
data
}
from
'@/pages/platformCenter/messageManage/projectManage/components/Mock'
;
const
{
Search
}
=
Input
;
const
{
Search
}
=
Input
;
...
@@ -131,7 +131,9 @@ const SiteManage = () => {
...
@@ -131,7 +131,9 @@ const SiteManage = () => {
};
};
useEffect
(()
=>
{
useEffect
(()
=>
{
console
.
log
(
'进入'
);
if
(
!
roleID
)
return
;
if
(
!
roleID
)
return
;
console
.
log
(
'选择后'
);
setLoading
(
true
);
setLoading
(
true
);
const
defaultConfig
=
{
const
defaultConfig
=
{
optionsList
:
[],
optionsList
:
[],
...
@@ -146,8 +148,8 @@ const SiteManage = () => {
...
@@ -146,8 +148,8 @@ const SiteManage = () => {
.
then
(
res
=>
{
.
then
(
res
=>
{
const
list
=
[];
const
list
=
[];
// eslint-disable-next-line no-unused-expressions
// eslint-disable-next-line no-unused-expressions
res
.
code
===
0
&&
res
.
code
===
0
&&
res
.
root
.
forEach
(
item
=>
{
res
.
data
.
root
.
forEach
(
item
=>
{
list
.
push
({
...
defaultConfig
,
...
item
});
list
.
push
({
...
defaultConfig
,
...
item
});
});
});
const
finalList
=
buildMap
(
list
);
const
finalList
=
buildMap
(
list
);
...
@@ -189,7 +191,6 @@ const SiteManage = () => {
...
@@ -189,7 +191,6 @@ const SiteManage = () => {
};
};
// 树形数据转换;
// 树形数据转换;
const
transTree
=
val
=>
{
const
transTree
=
val
=>
{
let
arr
=
val
;
let
arr
=
val
;
let
newArr
=
[];
let
newArr
=
[];
// 提取child里面的数组
// 提取child里面的数组
...
@@ -239,27 +240,44 @@ const SiteManage = () => {
...
@@ -239,27 +240,44 @@ const SiteManage = () => {
{
i
.
roleID
&&
(
{
i
.
roleID
&&
(
<>
<>
<
Tooltip
title=
"编辑角色"
className=
{
styles
.
fs
}
>
<
Tooltip
title=
"编辑角色"
className=
{
styles
.
fs
}
>
<
FormOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
}
}
onClick=
{
e
=>
editorUser
(
e
,
i
)
}
/>
<
FormOutlined
</
Tooltip
><
Tooltip
title=
"删除角色"
className=
{
styles
.
fs
}
>
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
}
}
<
DeleteOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
}
}
onClick=
{
e
=>
deletesUser
(
e
,
i
)
}
/>
onClick=
{
e
=>
editorUser
(
e
,
i
)
}
</
Tooltip
><
Tooltip
title=
"关联用户"
className=
{
styles
.
fs
}
>
/>
<
UserAddOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
}
}
onClick=
{
e
=>
relevancyUser
(
e
,
i
)
}
/>
</
Tooltip
>
</
Tooltip
></>
<
Tooltip
title=
"删除角色"
className=
{
styles
.
fs
}
>
<
DeleteOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
}
}
onClick=
{
e
=>
deletesUser
(
e
,
i
)
}
/>
</
Tooltip
>
<
Tooltip
title=
"关联用户"
className=
{
styles
.
fs
}
>
<
UserAddOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
}
}
onClick=
{
e
=>
relevancyUser
(
e
,
i
)
}
/>
</
Tooltip
>
</>
)
}
)
}
{
!
i
.
roleID
&&
(
{
!
i
.
roleID
&&
(
<
Tooltip
title=
"新增角色"
className=
{
styles
.
fs
}
>
<
Tooltip
title=
"新增角色"
className=
{
styles
.
fs
}
>
<
PlusSquareOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
}
}
onClick=
{
e
=>
addsUser
(
e
,
i
)
}
/>
<
PlusSquareOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
}
}
onClick=
{
e
=>
addsUser
(
e
,
i
)
}
/>
</
Tooltip
>
</
Tooltip
>
)
}
)
}
{
i
.
groupflag
&&
(
{
i
.
groupflag
&&
(
<
Tooltip
title=
"编辑分组"
className=
{
styles
.
fs
}
>
<
Tooltip
title=
"编辑分组"
className=
{
styles
.
fs
}
>
<
EditOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
}
}
onClick=
{
e
=>
editorGroup
(
e
,
i
)
}
/>
<
EditOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
}
}
onClick=
{
e
=>
editorGroup
(
e
,
i
)
}
/>
</
Tooltip
>
</
Tooltip
>
)
}
)
}
</
div
>
</
div
>
</
div
>
</
div
>
)
)
;
i
.
key
=
i
.
roleID
;
i
.
key
=
i
.
roleID
;
i
.
subSystemValue
=
item
.
visibleValue
;
i
.
subSystemValue
=
item
.
visibleValue
;
i
.
group
=
itemRole
.
visibleTitle
;
i
.
group
=
itemRole
.
visibleTitle
;
...
@@ -279,7 +297,6 @@ const SiteManage = () => {
...
@@ -279,7 +297,6 @@ const SiteManage = () => {
setItemObj
(
itemRole
);
setItemObj
(
itemRole
);
// setCurrentSelectId(roleID);
// setCurrentSelectId(roleID);
}
}
}
}
itemRole
.
title
=
(
itemRole
.
title
=
(
<
div
className=
{
styles
.
title
}
>
<
div
className=
{
styles
.
title
}
>
...
@@ -288,27 +305,44 @@ const SiteManage = () => {
...
@@ -288,27 +305,44 @@ const SiteManage = () => {
{
itemRole
.
roleID
&&
(
{
itemRole
.
roleID
&&
(
<>
<>
<
Tooltip
title=
"编辑角色"
className=
{
styles
.
fs
}
>
<
Tooltip
title=
"编辑角色"
className=
{
styles
.
fs
}
>
<
FormOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
}
}
onClick=
{
e
=>
editorUser
(
e
,
itemRole
)
}
/>
<
FormOutlined
</
Tooltip
><
Tooltip
title=
"删除角色"
className=
{
styles
.
fs
}
>
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
}
}
<
DeleteOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
}
}
onClick=
{
e
=>
deletesUser
(
e
,
itemRole
)
}
/>
onClick=
{
e
=>
editorUser
(
e
,
itemRole
)
}
</
Tooltip
><
Tooltip
title=
"关联用户"
className=
{
styles
.
fs
}
>
/>
<
UserAddOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
}
}
onClick=
{
e
=>
relevancyUser
(
e
,
itemRole
)
}
/>
</
Tooltip
>
</
Tooltip
></>
<
Tooltip
title=
"删除角色"
className=
{
styles
.
fs
}
>
<
DeleteOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
}
}
onClick=
{
e
=>
deletesUser
(
e
,
itemRole
)
}
/>
</
Tooltip
>
<
Tooltip
title=
"关联用户"
className=
{
styles
.
fs
}
>
<
UserAddOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
}
}
onClick=
{
e
=>
relevancyUser
(
e
,
itemRole
)
}
/>
</
Tooltip
>
</>
)
}
)
}
{
!
itemRole
.
roleID
&&
(
{
!
itemRole
.
roleID
&&
(
<
Tooltip
title=
"新增角色"
className=
{
styles
.
fs
}
>
<
Tooltip
title=
"新增角色"
className=
{
styles
.
fs
}
>
<
PlusSquareOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
}
}
onClick=
{
e
=>
addsUser
(
e
,
itemRole
)
}
/>
<
PlusSquareOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
}
}
onClick=
{
e
=>
addsUser
(
e
,
itemRole
)
}
/>
</
Tooltip
>
</
Tooltip
>
)
}
)
}
{
itemRole
.
groupflag
&&
(
{
itemRole
.
groupflag
&&
(
<
Tooltip
title=
"编辑分组"
className=
{
styles
.
fs
}
>
<
Tooltip
title=
"编辑分组"
className=
{
styles
.
fs
}
>
<
EditOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
}
}
onClick=
{
e
=>
editorGroup
(
e
,
itemRole
)
}
/>
<
EditOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
}
}
onClick=
{
e
=>
editorGroup
(
e
,
itemRole
)
}
/>
</
Tooltip
>
</
Tooltip
>
)
}
)
}
</
div
>
</
div
>
</
div
>
</
div
>
)
)
;
return
itemRole
;
return
itemRole
;
});
});
}
}
...
@@ -320,62 +354,80 @@ const SiteManage = () => {
...
@@ -320,62 +354,80 @@ const SiteManage = () => {
{
item
.
roleID
&&
(
{
item
.
roleID
&&
(
<>
<>
<
Tooltip
title=
"编辑角色"
className=
{
styles
.
fs
}
>
<
Tooltip
title=
"编辑角色"
className=
{
styles
.
fs
}
>
<
FormOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
}
}
onClick=
{
e
=>
editorUser
(
e
,
item
)
}
/>
<
FormOutlined
</
Tooltip
><
Tooltip
title=
"删除角色"
className=
{
styles
.
fs
}
>
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
}
}
<
DeleteOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
}
}
onClick=
{
e
=>
deletesUser
(
e
,
item
)
}
/>
onClick=
{
e
=>
editorUser
(
e
,
item
)
}
</
Tooltip
><
Tooltip
title=
"关联用户"
className=
{
styles
.
fs
}
>
/>
<
UserAddOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
}
}
onClick=
{
e
=>
relevancyUser
(
e
,
item
)
}
/>
</
Tooltip
>
</
Tooltip
></>
<
Tooltip
title=
"删除角色"
className=
{
styles
.
fs
}
>
<
DeleteOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
}
}
onClick=
{
e
=>
deletesUser
(
e
,
item
)
}
/>
</
Tooltip
>
<
Tooltip
title=
"关联用户"
className=
{
styles
.
fs
}
>
<
UserAddOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
}
}
onClick=
{
e
=>
relevancyUser
(
e
,
item
)
}
/>
</
Tooltip
>
</>
)
}
)
}
{
!
item
.
roleID
&&
(
{
!
item
.
roleID
&&
(
<
Tooltip
title=
"新增角色"
className=
{
styles
.
fs
}
>
<
Tooltip
title=
"新增角色"
className=
{
styles
.
fs
}
>
<
PlusSquareOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
}
}
onClick=
{
e
=>
addsUser
(
e
,
item
)
}
/>
<
PlusSquareOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
}
}
onClick=
{
e
=>
addsUser
(
e
,
item
)
}
/>
</
Tooltip
>
</
Tooltip
>
)
}
)
}
{
item
.
groupflag
&&
(
{
item
.
groupflag
&&
(
<
Tooltip
title=
"编辑分组"
className=
{
styles
.
fs
}
>
<
Tooltip
title=
"编辑分组"
className=
{
styles
.
fs
}
>
<
EditOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
}
}
onClick=
{
e
=>
editorGroup
(
e
,
item
)
}
/>
<
EditOutlined
style=
{
{
fontSize
:
'16px'
,
color
:
'#1890FF'
}
}
onClick=
{
e
=>
editorGroup
(
e
,
item
)
}
/>
</
Tooltip
>
</
Tooltip
>
)
}
)
}
</
div
>
</
div
>
</
div
>
</
div
>
)
)
;
return
item
;
return
item
;
});
});
return
arr3
;
return
arr3
;
};
};
//编辑角色
//编辑角色
const
editorUser
=
(
e
,
record
)
=>
{
const
editorUser
=
(
e
,
record
)
=>
{
e
.
stopPropagation
();
e
.
stopPropagation
();
setItemObj
(
record
);
setItemObj
(
record
);
setEditVisible
(
true
);
setEditVisible
(
true
);
}
}
;
//删除角色
//删除角色
const
deletesUser
=
(
e
,
record
)
=>
{
const
deletesUser
=
(
e
,
record
)
=>
{
e
.
stopPropagation
();
e
.
stopPropagation
();
setItemObj
(
record
);
setItemObj
(
record
);
setDelVisible
(
true
);
setDelVisible
(
true
);
}
}
;
//关联用户
//关联用户
const
relevancyUser
=
(
e
,
record
)
=>
{
const
relevancyUser
=
(
e
,
record
)
=>
{
e
.
stopPropagation
();
e
.
stopPropagation
();
setItemObj
(
record
);
setItemObj
(
record
);
setUserVisible
(
true
)
setUserVisible
(
true
)
;
}
}
;
//编辑分组
//编辑分组
const
editorGroup
=
(
e
,
record
)
=>
{
const
editorGroup
=
(
e
,
record
)
=>
{
console
.
log
(
record
,
'1212'
)
console
.
log
(
record
,
'1212'
);
e
.
stopPropagation
();
e
.
stopPropagation
();
setItemObj
(
record
);
setItemObj
(
record
);
setGroupVisible
(
true
);
setGroupVisible
(
true
);
}
}
;
//新增角色
//新增角色
const
addsUser
=
(
e
,
record
)
=>
{
const
addsUser
=
(
e
,
record
)
=>
{
e
.
stopPropagation
();
e
.
stopPropagation
();
setItemObj
(
record
);
setItemObj
(
record
);
setModalVisible
(
true
);
setModalVisible
(
true
);
}
}
;
const
handleChange
=
e
=>
{
const
handleChange
=
e
=>
{
const
{
value
}
=
e
.
target
;
const
{
value
}
=
e
.
target
;
setSearchWord
(
value
);
setSearchWord
(
value
);
...
@@ -415,7 +467,7 @@ const SiteManage = () => {
...
@@ -415,7 +467,7 @@ const SiteManage = () => {
setFlag
(
flag
+
1
);
setFlag
(
flag
+
1
);
setItemObj
(
''
);
setItemObj
(
''
);
handleTreeSelect
(
saveCurId
);
handleTreeSelect
(
saveCurId
);
}
}
;
const
valueCallback
=
valueObj
=>
{
const
valueCallback
=
valueObj
=>
{
setSubList
(
valueObj
);
setSubList
(
valueObj
);
};
};
...
@@ -437,7 +489,7 @@ const SiteManage = () => {
...
@@ -437,7 +489,7 @@ const SiteManage = () => {
)
)
.
then
(
res
=>
{
.
then
(
res
=>
{
setBtnLoading
(
false
);
setBtnLoading
(
false
);
if
(
res
.
msg
===
'Ok'
)
{
if
(
res
.
msg
===
'Ok'
)
{
setValueList
([...
results
.
flat
()]);
setValueList
([...
results
.
flat
()]);
notification
.
success
({
notification
.
success
({
message
:
'提示'
,
message
:
'提示'
,
...
@@ -457,8 +509,8 @@ const SiteManage = () => {
...
@@ -457,8 +509,8 @@ const SiteManage = () => {
});
});
};
};
const
handleUserAttach
=
()
=>
{
const
handleUserAttach
=
()
=>
{
setUserVisible
(
true
)
setUserVisible
(
true
)
;
}
}
;
return
(
return
(
<
PageContainer
>
<
PageContainer
>
<
div
<
div
...
...
src/pages/webConfig/components/editForm.jsx
View file @
d05c0fc8
...
@@ -47,13 +47,13 @@ const EditForm = props => {
...
@@ -47,13 +47,13 @@ const EditForm = props => {
<
Item
<
Item
label=
"产品包名:"
label=
"产品包名:"
name=
"PackageName"
name=
"PackageName"
rules=
{
[
//
rules={[
{
//
{
required
:
true
,
//
required: true,
pattern
:
new
RegExp
(
/^
[
a-z0-9A-Z
]
+$/
),
//
pattern: new RegExp(/^[a-z0-9A-Z]+$/),
message
:
'产品包名必须是英文或者数字'
,
//
message: '产品包名必须是英文或者数字',
},
//
},
]
}
//
]}
>
>
<
Input
placeholder=
"请输入产品包名"
allowClear
disabled
/>
<
Input
placeholder=
"请输入产品包名"
allowClear
disabled
/>
</
Item
>
</
Item
>
...
@@ -86,12 +86,12 @@ const EditForm = props => {
...
@@ -86,12 +86,12 @@ const EditForm = props => {
<
Item
<
Item
label=
"发布状态:"
label=
"发布状态:"
name=
"PublishState"
name=
"PublishState"
rules=
{
[
//
rules={[
{
//
{
required
:
true
,
//
required: true,
message
:
'请选择发布状态'
,
//
message: '请选择发布状态',
},
//
},
]
}
//
]}
>
>
<
Select
placeholder=
"请选择发布状态"
disabled
>
<
Select
placeholder=
"请选择发布状态"
disabled
>
{
environmentList
&&
{
environmentList
&&
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment