Commit 5075c95d authored by wuhao's avatar wuhao 🎯

dsade

parent facee4fe
/*
* @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 InitForm from "../InitForm";
import { Drawer } from "antd"; import { Drawer } from "antd";
import React, { useState, memo } from "react"; import React, { useState, memo } from "react";
...@@ -40,7 +50,7 @@ function DrawInitForm(props) { ...@@ -40,7 +50,7 @@ function DrawInitForm(props) {
style={{ position: "absolute", transform: "translateX(0)",maxWidth:"100%" }} style={{ position: "absolute", transform: "translateX(0)",maxWidth:"100%" }}
width={props.val == "detail" ? 1000 : props.width} width={props.val == "detail" ? 1000 : props.width}
{...props} {...props}
destroyOnClose={true} destroyOnClose={false}
> >
{props.val == "only" && props.children} {props.val == "only" && props.children}
{props.val == "only" ? null : props.val == "detail" ? <Details {...detailprops}></Details> : <InitForm {...newProps}></InitForm>} {props.val == "only" ? null : props.val == "detail" ? <Details {...detailprops}></Details> : <InitForm {...newProps}></InitForm>}
......
import React, { useEffect, useRef,useState } from "react"; import React, { useEffect, useMemo, useRef, useState } from "react";
import { EditableProTable } from "@ant-design/pro-table"; import { EditableProTable } from "@ant-design/pro-table";
import { useUpdate } from "ahooks"; import { useUpdate } from "ahooks";
...@@ -13,20 +13,29 @@ const EditTable = ({ ...@@ -13,20 +13,29 @@ const EditTable = ({
style, style,
}) => { }) => {
const editorFormRef = useRef(); const editorFormRef = useRef();
console.log(columns); //console.log(columns);
const [show, setshow] = useState(true); const [addon, setaddon] = useState(0);
useEffect(() => {
setshow(false); const newcolumns = useMemo(() => {
setTimeout(() => { return columns?.map((item) => {
setshow(true); return item?.params
}, 1200); ? {
}, []); ...item,
params: {
...item.params,
addon,
},
}
: {
...item,
};
});
}, [addon]);
return ( return (
show && (
<EditableProTable <EditableProTable
style={{ ...(style ?? {}) }} style={{ ...(style ?? {}) }}
columns={columns} columns={newcolumns}
rowKey={rowKey} rowKey={rowKey}
value={value || []} value={value || []}
onChange={onChange} onChange={onChange}
...@@ -48,6 +57,7 @@ const EditTable = ({ ...@@ -48,6 +57,7 @@ const EditTable = ({
return [defaultDoms.delete]; return [defaultDoms.delete];
}, },
onValuesChange: async (record, recordList) => { onValuesChange: async (record, recordList) => {
setaddon(s=>Math.random()*1000000);
let { urlchangeval } = linkconfig ?? {}; let { urlchangeval } = linkconfig ?? {};
let newvalue = [...recordList]; let newvalue = [...recordList];
if (urlchangeval && record) { if (urlchangeval && record) {
...@@ -114,7 +124,6 @@ const EditTable = ({ ...@@ -114,7 +124,6 @@ const EditTable = ({
}} }}
maxLength={maxLength ?? 1000} maxLength={maxLength ?? 1000}
/> />
)
); );
}; };
......
...@@ -340,6 +340,7 @@ function Instore(props) { ...@@ -340,6 +340,7 @@ function Instore(props) {
key: "labelId", key: "labelId",
valueType: "select", valueType: "select",
width: 180, width: 180,
params: {},
request: async (params) => { request: async (params) => {
let res = await doFetch({ let res = await doFetch({
url: "/ngic-workmanship/wmsMaterieLabel/selectionByStatus", url: "/ngic-workmanship/wmsMaterieLabel/selectionByStatus",
......
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