Commit ee4ea158 authored by wuhao's avatar wuhao 🎯

asder

parent 4b6399e8
...@@ -169,7 +169,13 @@ const Mtable = (props) => { ...@@ -169,7 +169,13 @@ const Mtable = (props) => {
params: newparames, params: newparames,
request: async (params) => { request: async (params) => {
if (Object.keys(it?.options).includes('linkParams')) { if (Object.keys(it?.options).includes('linkParams')) {
let list = await doFetch({ url: it?.options?.path, params: newparames }); let resparams = {},
linkParams = it?.options?.linkParams ?? {};
for (let i in linkParams) {
let paramsKey = !linkParams[i] ? i : linkParams[i];
resparams[paramsKey] = newparames[i];
}
let list = await doFetch({ url: it?.options?.path, params: resparams });
const res = list.data.dataList; const res = list.data.dataList;
return it.valueType == 'treeSelect' ? handlEmptyChild(res) : res; return it.valueType == 'treeSelect' ? handlEmptyChild(res) : res;
} else { } else {
...@@ -356,19 +362,25 @@ const Mtable = (props) => { ...@@ -356,19 +362,25 @@ const Mtable = (props) => {
{...datas} {...datas}
size={size} size={size}
onSubmit={(params) => { onSubmit={(params) => {
////console.log(params, 'onSubmit'); let newparams = {},
let newparams = {}; curkey = Object.keys(params)[Object.keys(params).length - 1],
columns.map((it, i) => { curval = Object.values(params)[Object.keys(params).length - 1];
if ( columns
it?.options?.linkParams && ?.filter((it) => !(it.search === false || it.hideInSearch === true))
Object.keys(it?.options?.linkParams).includes(Object.keys(params)[0]) .map((it, i) => {
) { let { linkParams } = it?.options ?? {};
for (let dataindex in it?.options?.linkParams) { if (linkParams && Object.keys(linkParams).includes(curkey)) {
newparams[dataindex] = formRefs?.current?.getFieldValue?.(dataindex); for (let dataindex in linkParams) {
newparams[dataindex] = formRefs?.current?.getFieldValue?.(dataindex);
}
} }
} });
}); if (Object.keys(newparams).length > 0) {
setnewparams(newparams); setnewparams((s) => ({
...s,
...newparams,
}));
}
}} }}
onSizeChange={(size) => { onSizeChange={(size) => {
localStorage.setItem('size', size); //设置全局表格规格缓存 localStorage.setItem('size', size); //设置全局表格规格缓存
......
...@@ -160,7 +160,6 @@ function getcolumns(setDrawer, ifs, formRef) { ...@@ -160,7 +160,6 @@ function getcolumns(setDrawer, ifs, formRef) {
{ {
title: '部门名称', title: '部门名称',
width: 120, width: 120,
valueType: 'treeSelect', valueType: 'treeSelect',
dataIndex: 'departmentName', dataIndex: 'departmentName',
fieldProps: { fieldProps: {
...@@ -193,14 +192,12 @@ function getcolumns(setDrawer, ifs, formRef) { ...@@ -193,14 +192,12 @@ function getcolumns(setDrawer, ifs, formRef) {
mode: 'multiple', mode: 'multiple',
}, },
width: 120, width: 120,
valueType: 'select', valueType: 'select',
options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} }, options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} },
}, },
{ {
title: '负责车间', title: '负责车间',
dataIndex: 'shopNames', dataIndex: 'shopNames',
fieldProps: { fieldProps: {
placeholder: '请选择', placeholder: '请选择',
showSearch: true, showSearch: true,
...@@ -211,7 +208,7 @@ function getcolumns(setDrawer, ifs, formRef) { ...@@ -211,7 +208,7 @@ function getcolumns(setDrawer, ifs, formRef) {
options: { options: {
path: '/auth/sysShop/getShopSelectionByFactoryIdList', path: '/auth/sysShop/getShopSelectionByFactoryIdList',
linkParams: { linkParams: {
factoryIdList: 'factoryIdList', factoryIdList: '',
}, },
}, },
key: 'shopIdList', key: 'shopIdList',
...@@ -240,7 +237,6 @@ function getcolumns(setDrawer, ifs, formRef) { ...@@ -240,7 +237,6 @@ function getcolumns(setDrawer, ifs, formRef) {
}, },
{ {
title: '负责产线', title: '负责产线',
search: false,
width: 120, width: 120,
dataIndex: 'productionLines', dataIndex: 'productionLines',
valueType: 'select', valueType: 'select',
...@@ -252,7 +248,6 @@ function getcolumns(setDrawer, ifs, formRef) { ...@@ -252,7 +248,6 @@ function getcolumns(setDrawer, ifs, formRef) {
search: false, search: false,
hideInTable: true, hideInTable: true,
key: 'productionLineIdList', key: 'productionLineIdList',
options: { options: {
path: '/auth/sysProductionLine/getAllProductLineSelectionByShopIdList', path: '/auth/sysProductionLine/getAllProductLineSelectionByShopIdList',
linkParams: { linkParams: {
......
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