Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ems3.3
Project
Project
Details
Activity
Releases
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
wuhao
ems3.3
Commits
d2fa39b1
Commit
d2fa39b1
authored
Nov 30, 2022
by
TZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
11301650
parent
ec1c81c7
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
113 additions
and
14 deletions
+113
-14
index.jsx
src/components/DetailPro/index.jsx
+24
-5
index.jsx
src/components/DrawerPro/index.jsx
+0
-1
FormItems.jsx
src/components/InitForm/FormItems.jsx
+6
-1
columns.js
src/pages/setting/users/columns.js
+80
-3
index.jsx
src/pages/setting/users/index.jsx
+3
-4
No files found.
src/components/DetailPro/index.jsx
View file @
d2fa39b1
...
@@ -20,11 +20,30 @@ function DetailPro(props) {
...
@@ -20,11 +20,30 @@ function DetailPro(props) {
return
{
return
{
request
:
async
()
=>
{
request
:
async
()
=>
{
let
res
=
await
doFetch
({
url
:
props
.
detailpath
,
params
:
props
.
params
});
let
res
=
await
doFetch
({
url
:
props
.
detailpath
,
params
:
props
.
params
});
setcuritem
(
res
?.
data
?.
data
??
{});
if
(
props
?.
extendField
)
{
let
obj
=
{};
res
?.
data
?.
data
[
props
.
extendField
]?.
forEach
((
it
)
=>
{
obj
[
it
?.
fieldId
]
=
it
?.
fieldRealValue
;
});
console
.
log
(
'extendField:'
,
obj
);
setcuritem
({
...(
res
?.
data
?.
data
??
{}),
...
obj
,
});
console
.
log
(
'drawerpro:'
,
{
...(
res
?.
data
?.
data
??
{}),
...
obj
,
});
return
{
return
{
success
:
res
?.
code
==
'0000'
,
success
:
res
?.
code
==
'0000'
,
data
:
res
?.
data
?.
data
??
{},
data
:
{
...(
res
?.
data
?.
data
??
{}),
...
obj
,
}
??
{},
};
};
}
},
},
};
};
}
}
...
...
src/components/DrawerPro/index.jsx
View file @
d2fa39b1
...
@@ -7,7 +7,6 @@ import PropTypes from 'prop-types';
...
@@ -7,7 +7,6 @@ import PropTypes from 'prop-types';
function
DrawerPro
(
props
)
{
function
DrawerPro
(
props
)
{
let
newProps
=
{
...
props
};
let
newProps
=
{
...
props
};
delete
newProps
.
children
;
delete
newProps
.
children
;
const
detailprops
=
{
const
detailprops
=
{
...
newProps
,
...
newProps
,
detailpath
:
props
.
detailpath
,
detailpath
:
props
.
detailpath
,
...
...
src/components/InitForm/FormItems.jsx
View file @
d2fa39b1
...
@@ -469,7 +469,6 @@ function LinkSelect({ item, colProps, formRef, name, curindex }) {
...
@@ -469,7 +469,6 @@ function LinkSelect({ item, colProps, formRef, name, curindex }) {
params=
{
params
}
params=
{
params
}
request=
{
async
(
parse
)
=>
{
request=
{
async
(
parse
)
=>
{
let
result
=
{};
let
result
=
{};
console
.
log
(
curlinkparams
);
for
(
let
key
in
curlinkparams
)
{
for
(
let
key
in
curlinkparams
)
{
let
reversekey
=
!
curlinkparams
[
key
]
?
key
:
curlinkparams
[
key
];
let
reversekey
=
!
curlinkparams
[
key
]
?
key
:
curlinkparams
[
key
];
result
[
reversekey
]
=
parse
[
key
];
result
[
reversekey
]
=
parse
[
key
];
...
@@ -496,6 +495,12 @@ function LinkSelect({ item, colProps, formRef, name, curindex }) {
...
@@ -496,6 +495,12 @@ function LinkSelect({ item, colProps, formRef, name, curindex }) {
}
else
{
}
else
{
ifclean
=
res
?.
data
?.
dataList
.
filter
((
it
)
=>
it
.
value
==
curval
)?.[
0
]?.
value
;
ifclean
=
res
?.
data
?.
dataList
.
filter
((
it
)
=>
it
.
value
==
curval
)?.[
0
]?.
value
;
}
}
console
.
log
(
curval
,
res
?.
data
?.
dataList
?.
map
((
it
)
=>
it
.
value
),
curkey
,
);
formRef
?.
current
?.
setFieldsValue
({
[
curkey
]:
ifclean
});
formRef
?.
current
?.
setFieldsValue
({
[
curkey
]:
ifclean
});
}
}
return
res
?.
data
?.
dataList
??
[];
return
res
?.
data
?.
dataList
??
[];
...
...
src/pages/setting/users/columns.js
View file @
d2fa39b1
import
{
doFetch
}
from
'@/utils/doFetch'
;
import
{
doFetch
}
from
'@/utils/doFetch'
;
import
{
Image
}
from
'antd'
;
import
{
Image
}
from
'antd'
;
import
{
useState
,
useEffect
}
from
'react'
;
function
getcolumns
(
setdrawer
)
{
function
getcolumns
(
setdrawer
)
{
return
[
return
[
{
{
...
@@ -19,11 +20,87 @@ function getcolumns(setdrawer) {
...
@@ -19,11 +20,87 @@ function getcolumns(setdrawer) {
return
(
return
(
<
a
<
a
onClick
=
{()
=>
{
onClick
=
{()
=>
{
const
[
fieldscolumns
,
setfieldscolumns
]
=
useState
([
{
title
:
'用户名'
,
dataIndex
:
'username'
,
key
:
'username'
,
},
{
title
:
'姓名'
,
dataIndex
:
'fullName'
,
key
:
'fullName'
,
},
{
title
:
'手机号'
,
hideInTable
:
true
,
dataIndex
:
'telephone'
,
key
:
'telephone'
},
{
title
:
'邮箱'
,
dataIndex
:
'mailNo'
,
key
:
'mailNo'
,
hideInTable
:
true
,
search
:
false
,
},
]);
const
selectValueType
=
(
type
,
options
)
=>
{
switch
(
type
)
{
case
1
:
return
{
valueType
:
'input'
,
};
case
2
:
return
{
valueType
:
'select'
,
options
,
};
case
3
:
return
{
valueType
:
'radio'
,
options
,
};
case
4
:
return
{
valueType
:
'select'
,
options
,
};
default
:
break
;
}
};
useEffect
(()
=>
{
const
fn
=
async
()
=>
{
let
res
=
await
doFetch
({
url
:
'/base/paFormField/queryList'
,
params
:
{
formId
:
'1'
,
},
});
if
(
res
?.
data
?.
dataList
)
{
let
column
=
[
{
title
:
'扩展字段'
,
valueType
:
'split'
,
},
];
res
?.
data
?.
dataList
?.
forEach
((
el
)
=>
{
column
.
push
({
...
selectValueType
(
el
.
fieldChar
,
el
.
valueList
),
title
:
el
.
fieldName
,
dataIndex
:
el
.
fieldName
,
key
:
el
.
id
,
});
});
setfieldscolumns
(
fieldscolumns
.
concat
(
column
));
}
};
fn
();
},
[]);
setdrawer
((
s
)
=>
({
setdrawer
((
s
)
=>
({
...
s
,
...
s
,
visible
:
true
,
visible
:
true
,
item
:
row
,
item
:
row
,
title
:
'详情'
,
title
:
'详情'
,
fields
:
fieldscolumns
,
extendField
:
'userCharList'
,
detailpath
:
'/auth/sysUser/detail'
,
detailpath
:
'/auth/sysUser/detail'
,
params
:
{
id
:
row
.
id
},
params
:
{
id
:
row
.
id
},
val
:
'detail'
,
val
:
'detail'
,
...
@@ -119,7 +196,7 @@ function getcolumns(setdrawer) {
...
@@ -119,7 +196,7 @@ function getcolumns(setdrawer) {
factoryIdList
:
'factoryIdList'
,
factoryIdList
:
'factoryIdList'
,
},
},
},
},
key
:
'shopId'
,
key
:
'shopId
List
'
,
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
formItemProps
:
{
rules
:
[{
required
:
true
,
message
:
'此项为必填项'
}]
},
},
},
{
{
...
@@ -138,7 +215,7 @@ function getcolumns(setdrawer) {
...
@@ -138,7 +215,7 @@ function getcolumns(setdrawer) {
options
:
{
options
:
{
path
:
'/auth/sysSection/getAllSectionSelectionByShopIdList'
,
path
:
'/auth/sysSection/getAllSectionSelectionByShopIdList'
,
linkParams
:
{
linkParams
:
{
shopId
:
'shopIdList
'
,
shopId
List
:
'
'
,
},
},
},
},
},
},
...
@@ -159,7 +236,7 @@ function getcolumns(setdrawer) {
...
@@ -159,7 +236,7 @@ function getcolumns(setdrawer) {
options
:
{
options
:
{
path
:
'/auth/sysProductionLine/getAllProductLineSelectionByShopIdList'
,
path
:
'/auth/sysProductionLine/getAllProductLineSelectionByShopIdList'
,
linkParams
:
{
linkParams
:
{
shopId
:
'shopIdList
'
,
shopId
List
:
'
'
,
},
},
},
},
},
},
...
...
src/pages/setting/users/index.jsx
View file @
d2fa39b1
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Author: Li Hanlin
* @Date: 2022-11-09 14:44:44
* @Date: 2022-11-09 14:44:44
* @Last Modified by: Li Hanlin
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-30 1
4:10
:10
* @Last Modified time: 2022-11-30 1
6:42
:10
*/
*/
import
*
as
React
from
'react'
;
import
*
as
React
from
'react'
;
...
@@ -39,7 +39,7 @@ function User(props) {
...
@@ -39,7 +39,7 @@ function User(props) {
setDrawer
((
s
)
=>
({
setDrawer
((
s
)
=>
({
...
s
,
...
s
,
visible
:
true
,
visible
:
true
,
item
:
row
,
//
item: row,
title
:
'详情'
,
title
:
'详情'
,
val
:
'detail'
,
val
:
'detail'
,
title
:
row
.
userName
+
'的详细信息'
,
title
:
row
.
userName
+
'的详细信息'
,
...
@@ -137,7 +137,6 @@ function User(props) {
...
@@ -137,7 +137,6 @@ function User(props) {
const
Adduser
=
()
=>
{
const
Adduser
=
()
=>
{
const
[
value
,
setValue
]
=
useState
(
''
);
const
[
value
,
setValue
]
=
useState
(
''
);
const
[
options
,
setOptions
]
=
useState
([]);
const
[
fieldscolumns
,
setfieldscolumns
]
=
useState
(
columns
);
const
[
fieldscolumns
,
setfieldscolumns
]
=
useState
(
columns
);
const
selectValueType
=
(
type
,
options
)
=>
{
const
selectValueType
=
(
type
,
options
)
=>
{
switch
(
type
)
{
switch
(
type
)
{
...
@@ -188,12 +187,12 @@ function User(props) {
...
@@ -188,12 +187,12 @@ function User(props) {
key
:
el
.
id
,
key
:
el
.
id
,
});
});
});
});
console
.
log
(
'11111'
,
column
);
setfieldscolumns
(
fieldscolumns
.
concat
(
column
));
setfieldscolumns
(
fieldscolumns
.
concat
(
column
));
}
}
};
};
fn
();
fn
();
},
[]);
},
[]);
return
(
return
(
<>
<>
<
InitForm
<
InitForm
...
...
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