Commit d2fa39b1 authored by TZW's avatar TZW

11301650

parent ec1c81c7
......@@ -20,11 +20,30 @@ function DetailPro(props) {
return {
request: async () => {
let res = await doFetch({ url: props.detailpath, params: props.params });
setcuritem(res?.data?.data ?? {});
return {
success: res?.code == '0000',
data: 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 {
success: res?.code == '0000',
data:
{
...(res?.data?.data ?? {}),
...obj,
} ?? {},
};
}
},
};
}
......
......@@ -7,7 +7,6 @@ import PropTypes from 'prop-types';
function DrawerPro(props) {
let newProps = { ...props };
delete newProps.children;
const detailprops = {
...newProps,
detailpath: props.detailpath,
......
......@@ -469,7 +469,6 @@ function LinkSelect({ item, colProps, formRef, name, curindex }) {
params={params}
request={async (parse) => {
let result = {};
console.log(curlinkparams);
for (let key in curlinkparams) {
let reversekey = !curlinkparams[key] ? key : curlinkparams[key];
result[reversekey] = parse[key];
......@@ -496,6 +495,12 @@ function LinkSelect({ item, colProps, formRef, name, curindex }) {
} else {
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 });
}
return res?.data?.dataList ?? [];
......
import { doFetch } from '@/utils/doFetch';
import { Image } from 'antd';
import { useState, useEffect } from 'react';
function getcolumns(setdrawer) {
return [
{
......@@ -19,11 +20,87 @@ function getcolumns(setdrawer) {
return (
<a
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) => ({
...s,
visible: true,
item: row,
title: '详情',
fields: fieldscolumns,
extendField: 'userCharList',
detailpath: '/auth/sysUser/detail',
params: { id: row.id },
val: 'detail',
......@@ -119,7 +196,7 @@ function getcolumns(setdrawer) {
factoryIdList: 'factoryIdList',
},
},
key: 'shopId',
key: 'shopIdList',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
......@@ -138,7 +215,7 @@ function getcolumns(setdrawer) {
options: {
path: '/auth/sysSection/getAllSectionSelectionByShopIdList',
linkParams: {
shopId: 'shopIdList',
shopIdList: '',
},
},
},
......@@ -159,7 +236,7 @@ function getcolumns(setdrawer) {
options: {
path: '/auth/sysProductionLine/getAllProductLineSelectionByShopIdList',
linkParams: {
shopId: 'shopIdList',
shopIdList: '',
},
},
},
......
......@@ -2,7 +2,7 @@
* @Author: Li Hanlin
* @Date: 2022-11-09 14:44:44
* @Last Modified by: Li Hanlin
* @Last Modified time: 2022-11-30 14:10:10
* @Last Modified time: 2022-11-30 16:42:10
*/
import * as React from 'react';
......@@ -39,7 +39,7 @@ function User(props) {
setDrawer((s) => ({
...s,
visible: true,
item: row,
// item: row,
title: '详情',
val: 'detail',
title: row.userName + '的详细信息',
......@@ -137,7 +137,6 @@ function User(props) {
const Adduser = () => {
const [value, setValue] = useState('');
const [options, setOptions] = useState([]);
const [fieldscolumns, setfieldscolumns] = useState(columns);
const selectValueType = (type, options) => {
switch (type) {
......@@ -188,12 +187,12 @@ function User(props) {
key: el.id,
});
});
console.log('11111', column);
setfieldscolumns(fieldscolumns.concat(column));
}
};
fn();
}, []);
return (
<>
<InitForm
......
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