Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wms
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
wms
Commits
5075c95d
Commit
5075c95d
authored
Aug 14, 2023
by
wuhao
🎯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsade
parent
facee4fe
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1374 additions
and
248 deletions
+1374
-248
index.jsx
src/components/DrawInitForm/index.jsx
+11
-1
index.jsx
src/components/EditTable/index.jsx
+100
-91
index.jsx
src/pages/insertstore/Otherinstore/index.jsx
+1262
-156
index_c.jsx
src/pages/insertstore/Otherinstore/index_c.jsx
+1
-0
No files found.
src/components/DrawInitForm/index.jsx
View file @
5075c95d
/*
* @Author: wuhao930406 1148547900@qq.com
* @Date: 2023-08-14 15:27:40
* @LastEditors: wuhao930406 1148547900@qq.com
* @LastEditTime: 2023-08-14 15:43:08
* @FilePath: /wms/src/components/DrawInitForm/index.jsx
* @Description:
*
* Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
*/
import
InitForm
from
"../InitForm"
;
import
{
Drawer
}
from
"antd"
;
import
React
,
{
useState
,
memo
}
from
"react"
;
...
...
@@ -40,7 +50,7 @@ function DrawInitForm(props) {
style=
{
{
position
:
"absolute"
,
transform
:
"translateX(0)"
,
maxWidth
:
"100%"
}
}
width=
{
props
.
val
==
"detail"
?
1000
:
props
.
width
}
{
...
props
}
destroyOnClose=
{
tru
e
}
destroyOnClose=
{
fals
e
}
>
{
props
.
val
==
"only"
&&
props
.
children
}
{
props
.
val
==
"only"
?
null
:
props
.
val
==
"detail"
?
<
Details
{
...
detailprops
}
></
Details
>
:
<
InitForm
{
...
newProps
}
></
InitForm
>
}
...
...
src/components/EditTable/index.jsx
View file @
5075c95d
import
React
,
{
useEffect
,
use
Ref
,
useState
}
from
"react"
;
import
React
,
{
useEffect
,
use
Memo
,
useRef
,
useState
}
from
"react"
;
import
{
EditableProTable
}
from
"@ant-design/pro-table"
;
import
{
useUpdate
}
from
"ahooks"
;
...
...
@@ -13,108 +13,117 @@ const EditTable = ({
style
,
})
=>
{
const
editorFormRef
=
useRef
();
console
.
log
(
columns
);
const
[
show
,
setshow
]
=
useState
(
true
);
useEffect
(()
=>
{
setshow
(
false
);
setTimeout
(()
=>
{
setshow
(
true
);
},
1200
);
},
[]);
//console.log(columns);
const
[
addon
,
setaddon
]
=
useState
(
0
);
const
newcolumns
=
useMemo
(()
=>
{
return
columns
?.
map
((
item
)
=>
{
return
item
?.
params
?
{
...
item
,
params
:
{
...
item
.
params
,
addon
,
},
}
:
{
...
item
,
};
});
},
[
addon
]);
return
(
show
&&
(
<
EditableProTable
style=
{
{
...(
style
??
{})
}
}
columns=
{
columns
}
rowKey=
{
rowKey
}
value=
{
value
||
[]
}
onChange=
{
onChange
}
recordCreatorProps=
{
recordCreatorProps
==
"false"
?
false
:
{
newRecordType
:
"dataSource"
,
record
:
()
=>
({
[
rowKey
]:
Date
.
now
(),
}),
}
}
editableFormRef=
{
editorFormRef
}
editable=
{
{
type
:
"multiple"
,
editableKeys
:
value
?
value
.
map
((
item
)
=>
item
[
rowKey
])
:
[],
actionRender
:
(
row
,
config
,
defaultDoms
)
=>
{
return
[
defaultDoms
.
delete
];
},
onValuesChange
:
async
(
record
,
recordList
)
=>
{
let
{
urlchangeval
}
=
linkconfig
??
{};
let
newvalue
=
[...
recordList
];
if
(
urlchangeval
&&
record
)
{
//根据url 改变 数据值
let
{
params
,
database
,
effectresult
}
=
urlchangeval
??
{},
curvaluerow
=
<
EditableProTable
style=
{
{
...(
style
??
{})
}
}
columns=
{
newcolumns
}
rowKey=
{
rowKey
}
value=
{
value
||
[]
}
onChange=
{
onChange
}
recordCreatorProps=
{
recordCreatorProps
==
"false"
?
false
:
{
newRecordType
:
"dataSource"
,
record
:
()
=>
({
[
rowKey
]:
Date
.
now
(),
}),
}
}
editableFormRef=
{
editorFormRef
}
editable=
{
{
type
:
"multiple"
,
editableKeys
:
value
?
value
.
map
((
item
)
=>
item
[
rowKey
])
:
[],
actionRender
:
(
row
,
config
,
defaultDoms
)
=>
{
return
[
defaultDoms
.
delete
];
},
onValuesChange
:
async
(
record
,
recordList
)
=>
{
setaddon
(
s
=>
Math
.
random
()
*
1000000
);
let
{
urlchangeval
}
=
linkconfig
??
{};
let
newvalue
=
[...
recordList
];
if
(
urlchangeval
&&
record
)
{
//根据url 改变 数据值
let
{
params
,
database
,
effectresult
}
=
urlchangeval
??
{},
curvaluerow
=
value
&&
value
.
length
>
0
?
value
.
filter
((
it
)
=>
it
[
rowKey
]
==
record
[
rowKey
])[
0
]
:
{};
//获取除本行之外已修改的value值
newvalue
=
newvalue
.
map
((
it
,
i
)
=>
{
if
(
!
record
)
return
it
;
if
(
it
[
rowKey
]
==
record
[
rowKey
])
{
let
freshvals
=
{};
Object
.
keys
(
effectresult
).
map
((
its
)
=>
{
// freshvals[its] = value[i][its];
freshvals
[
its
]
=
it
[
its
];
});
it
=
{
...
record
,
...
freshvals
,
};
}
else
{
it
=
value
&&
value
.
length
>
0
?
value
.
filter
((
it
)
=>
it
[
rowKey
]
==
record
[
rowKey
])[
0
]
?
value
.
filter
((
it
s
)
=>
its
[
rowKey
]
==
it
[
rowKey
])[
0
]
:
{};
//获取除本行之外已修改的value值
}
return
it
;
});
//参数获取
let
parames
=
{};
let
ifs
=
true
;
Object
.
keys
(
params
).
map
((
it
)
=>
{
if
(
params
[
it
]
==
"linked"
)
{
parames
[
it
]
=
record
[
it
];
if
(
record
[
it
]
!=
curvaluerow
[
it
])
{
ifs
=
false
;
}
}
else
{
parames
[
it
]
=
params
[
it
];
}
});
if
(
ifs
)
{
//值未变化
}
else
{
let
res
=
await
database
(
parames
);
newvalue
=
newvalue
.
map
((
it
,
i
)
=>
{
if
(
!
record
)
return
it
;
if
(
it
[
rowKey
]
==
record
[
rowKey
])
{
let
freshvals
=
{};
Object
.
keys
(
effectresult
).
map
((
its
)
=>
{
// freshvals[its] = value[i][its];
freshvals
[
its
]
=
it
[
its
];
Object
.
keys
(
effectresult
).
map
((
items
)
=>
{
let
result
=
res
?.
data
?.
data
??
{};
it
[
items
]
=
result
[
effectresult
[
items
]];
});
it
=
{
...
record
,
...
freshvals
,
};
editorFormRef
.
current
?.
setRowData
?.(
i
,
it
);
}
else
{
it
=
value
&&
value
.
length
>
0
?
value
.
filter
((
its
)
=>
its
[
rowKey
]
==
it
[
rowKey
])[
0
]
:
{};
}
return
it
;
});
//参数获取
let
parames
=
{};
let
ifs
=
true
;
Object
.
keys
(
params
).
map
((
it
)
=>
{
if
(
params
[
it
]
==
"linked"
)
{
parames
[
it
]
=
record
[
it
];
if
(
record
[
it
]
!=
curvaluerow
[
it
])
{
ifs
=
false
;
}
}
else
{
parames
[
it
]
=
params
[
it
];
}
});
if
(
ifs
)
{
//值未变化
}
else
{
let
res
=
await
database
(
parames
);
newvalue
=
newvalue
.
map
((
it
,
i
)
=>
{
if
(
it
[
rowKey
]
==
record
[
rowKey
])
{
Object
.
keys
(
effectresult
).
map
((
items
)
=>
{
let
result
=
res
?.
data
?.
data
??
{};
it
[
items
]
=
result
[
effectresult
[
items
]];
});
editorFormRef
.
current
?.
setRowData
?.(
i
,
it
);
}
else
{
}
return
it
;
});
}
}
onChange
(
newvalue
);
},
}
}
maxLength=
{
maxLength
??
1000
}
/>
)
}
onChange
(
newvalue
);
}
,
}
}
maxLength=
{
maxLength
??
1000
}
/>
);
};
...
...
src/pages/insertstore/Otherinstore/index.jsx
View file @
5075c95d
This diff is collapsed.
Click to expand it.
src/pages/insertstore/Otherinstore/index_c.jsx
View file @
5075c95d
...
...
@@ -340,6 +340,7 @@ function Instore(props) {
key
:
"labelId"
,
valueType
:
"select"
,
width
:
180
,
params
:
{},
request
:
async
(
params
)
=>
{
let
res
=
await
doFetch
({
url
:
"/ngic-workmanship/wmsMaterieLabel/selectionByStatus"
,
...
...
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