Commit 4b6399e8 authored by wuhao's avatar wuhao 🎯

adser

parent c03fdab0
......@@ -95,6 +95,13 @@ function upperCase(str) {
const newStr = str.slice(0, 1).toUpperCase() + str.slice(1);
return newStr;
}
// tree遍历
function treeForeach(tree, func) {
tree.forEach((data) => {
func(data);
data.children && treeForeach(data.children, func); // 遍历子树
});
}
let FormRender = memo(({ fields = [], name, curindex, formRef }) => {
return (
......@@ -222,7 +229,6 @@ function MyAutoComplete({ item, colProps, formRef }) {
},
);
useEffect(() => {
console.log(username);
runAsync()
.then((data) => {
const options = data?.map((it) => ({
......@@ -674,15 +680,21 @@ function LinkTreeSelect({ item, colProps, formRef, name, curindex }) {
} else {
let curval = formRef?.current?.getFieldValue(curkey),
ifclean;
//树结构所有value提取到数组
let allvalue = [];
treeForeach(res?.data?.dataList, (node) => {
allvalue.push(node.key);
});
//过滤存在的value
if (Array.isArray(curval)) {
ifclean = res?.data?.dataList
?.map((it) => it.value)
.filter?.((it) => {
return curval?.includes(it);
});
ifclean = allvalue?.filter?.((it) => {
return curval?.includes(it);
});
} else {
ifclean = res?.data?.dataList.filter((it) => it.value == curval)?.[0]?.value;
ifclean = allvalue?.filter?.((it) => it == curval)?.[0];
}
formRef?.current?.setFieldsValue({ [curkey]: ifclean });
}
}
......@@ -1323,7 +1335,6 @@ function UploadDragger({ item, colProps }) {
},
}}
transform={(value) => {
console.log('11', value);
const key = item.key ?? item.dataIndex;
const transvalue = value?.map((it) => {
if (it.response) {
......@@ -1384,7 +1395,6 @@ function Diyrules({ item, colProps, formRef }) {
<Col {...col}>
<ProForm.Item
convertValue={(value) => {
console.log(value);
if (value?.other) return value;
let nrList = {
other: {},
......@@ -1397,7 +1407,6 @@ function Diyrules({ item, colProps, formRef }) {
nrList.value.push(it);
}
});
console.log(nrList);
return nrList;
}}
name={curkey}
......@@ -1510,7 +1519,6 @@ function TableSelect({ item, value, onChange, params = {} }) {
}
/>
);
console.log(value);
const Todo = (
<EditTable
actionRef={actionRef}
......
......@@ -6,14 +6,14 @@ function getcolumns(setdrawer) {
title: '设备编号',
dataIndex: 'equipmentNo',
key: 'equipmentNo',
align: 'center',
width: 120,
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '设备名称',
dataIndex: 'equipmentName',
align: 'center',
width: 220,
key: 'equipmentName',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
......@@ -21,7 +21,7 @@ function getcolumns(setdrawer) {
{
title: '位置号',
width: 120,
align: 'center',
dataIndex: 'positionNo',
search: false,
hideInTable: true,
......@@ -30,7 +30,7 @@ function getcolumns(setdrawer) {
{
width: 120,
title: '设备类型',
align: 'center',
dataIndex: 'equipmentTypeName',
key: 'equipmentTypeId',
valueType: 'treeSelect',
......@@ -45,7 +45,7 @@ function getcolumns(setdrawer) {
title: '设备型号',
dataIndex: 'equipmentModelName',
width: 120,
align: 'center',
key: 'equipmentModelId',
valueType: 'select',
fieldProps: {
......@@ -57,7 +57,7 @@ function getcolumns(setdrawer) {
},
{
title: '公司名称',
align: 'center',
dataIndex: 'organizationName',
width: 120,
key: 'organizationId',
......@@ -72,7 +72,7 @@ function getcolumns(setdrawer) {
{
title: '部门名称',
width: 120,
align: 'center',
valueType: 'treeSelect',
dataIndex: 'departmentName',
fieldProps: {
......@@ -96,7 +96,7 @@ function getcolumns(setdrawer) {
placeholder: '请选择',
showSearch: true,
},
align: 'center',
valueType: 'select',
options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} },
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
......@@ -104,7 +104,7 @@ function getcolumns(setdrawer) {
{
title: '车间名称',
dataIndex: 'shopName',
align: 'center',
width: 120,
valueType: 'select',
fieldProps: {
......@@ -124,7 +124,7 @@ function getcolumns(setdrawer) {
title: '工段名称',
width: 120,
dataIndex: 'sectionName',
align: 'center',
key: 'sectionId',
fieldProps: {
placeholder: '请选择',
......@@ -148,7 +148,7 @@ function getcolumns(setdrawer) {
showSearch: true,
},
key: 'productLineId',
align: 'center',
options: {
path: '/auth/sysProductionLine/getAllProductLineSelectionByShop',
linkParams: {
......@@ -161,7 +161,7 @@ function getcolumns(setdrawer) {
width: 120,
valueType: 'select',
dataIndex: 'supplierName',
align: 'center',
hideInTable: true,
search: false,
key: 'supplierId',
......@@ -175,7 +175,7 @@ function getcolumns(setdrawer) {
valueType: 'digit',
search: false,
hideInTable: true,
align: 'center',
dataIndex: 'equipmentWorth',
key: 'equipmentWorth',
},
......@@ -183,7 +183,7 @@ function getcolumns(setdrawer) {
title: '安装投产日期',
hideInTable: true,
search: false,
align: 'center',
dataIndex: 'productDate',
key: 'productDate',
valueType: 'date',
......@@ -195,7 +195,7 @@ function getcolumns(setdrawer) {
search: false,
search: false,
key: 'picList',
align: 'center',
valueType: 'uploadImage',
fieldProps: {
limit: 1,
......@@ -219,9 +219,9 @@ function getcolumns(setdrawer) {
{
title: '二维码',
width: 120,
align: 'center',
search: false,
align: 'center',
dataIndex: 'qrCodeUrl',
key: 'qrCodeUrl',
valueType: 'uploadImage',
......@@ -237,7 +237,7 @@ function getcolumns(setdrawer) {
},
{
title: '状态名称',
align: 'center',
search: false,
hideInTable: true,
dataIndex: 'statusName',
......@@ -248,7 +248,7 @@ function getcolumns(setdrawer) {
title: '设备状态',
dataIndex: 'status',
width: 120,
align: 'center',
hideInForm: true,
fixed: 'right',
valueType: 'select',
......
......@@ -777,7 +777,7 @@ function Model(props) {
dataIndex: 'equipmentNo',
key: 'equipmentNo',
search: false,
align: 'center',
width: 120,
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
......@@ -785,14 +785,14 @@ function Model(props) {
title: '设备名称',
dataIndex: 'equipmentName',
search: false,
align: 'center',
width: 120,
key: 'equipmentName',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '公司名称',
align: 'center',
search: false,
dataIndex: 'organizationName',
width: 120,
......@@ -805,7 +805,7 @@ function Model(props) {
title: '部门名称',
width: 120,
search: false,
align: 'center',
valueType: 'treeSelect',
dataIndex: 'departmentName',
key: 'departmentId',
......@@ -822,7 +822,7 @@ function Model(props) {
search: false,
key: 'factoryId',
width: 120,
align: 'center',
valueType: 'select',
options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} },
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
......@@ -830,7 +830,7 @@ function Model(props) {
{
title: '车间名称',
dataIndex: 'shopName',
align: 'center',
search: false,
width: 120,
valueType: 'select',
......@@ -848,7 +848,7 @@ function Model(props) {
search: false,
width: 120,
dataIndex: 'sectionName',
align: 'center',
key: 'sectionId',
valueType: 'select',
options: {
......@@ -865,7 +865,7 @@ function Model(props) {
dataIndex: 'productLineName',
valueType: 'select',
key: 'productLineName',
align: 'center',
options: {
path: '/auth/sysProductionLine/getAllProductLineSelectionByShop',
linkParams: {
......@@ -887,7 +887,7 @@ function Model(props) {
dataIndex: 'equipmentNo',
search: false,
key: 'equipmentNo',
align: 'center',
width: 120,
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
......@@ -895,14 +895,14 @@ function Model(props) {
title: '设备名称',
dataIndex: 'equipmentName',
search: false,
align: 'center',
width: 120,
key: 'equipmentName',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '公司名称',
align: 'center',
dataIndex: 'organizationName',
width: 120,
key: 'organizationId',
......@@ -914,7 +914,7 @@ function Model(props) {
{
title: '部门名称',
width: 120,
align: 'center',
search: false,
valueType: 'treeSelect',
dataIndex: 'departmentName',
......@@ -932,7 +932,7 @@ function Model(props) {
dataIndex: 'factoryName',
key: 'factoryId',
width: 120,
align: 'center',
valueType: 'select',
options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} },
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
......@@ -941,7 +941,7 @@ function Model(props) {
title: '车间名称',
dataIndex: 'shopName',
search: false,
align: 'center',
width: 120,
valueType: 'select',
options: {
......@@ -957,7 +957,7 @@ function Model(props) {
title: '工段名称',
width: 120,
dataIndex: 'sectionName',
align: 'center',
key: 'sectionId',
search: false,
valueType: 'select',
......@@ -975,7 +975,7 @@ function Model(props) {
valueType: 'select',
search: false,
key: 'productLineName',
align: 'center',
options: {
path: '/auth/sysProductionLine/getAllProductLineSelectionByShop',
linkParams: {
......@@ -1180,21 +1180,21 @@ function Model(props) {
dataIndex: 'equipmentNo',
key: 'equipmentNo',
search: false,
align: 'center',
width: 120,
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '设备名称',
dataIndex: 'equipmentName',
align: 'center',
width: 120,
key: 'equipmentName',
formItemProps: { rules: [{ required: true, message: '此项为必填项' }] },
},
{
title: '公司名称',
align: 'center',
dataIndex: 'organizationName',
width: 120,
key: 'organizationId',
......@@ -1209,7 +1209,7 @@ function Model(props) {
{
title: '部门名称',
width: 120,
align: 'center',
valueType: 'treeSelect',
dataIndex: 'departmentName',
fieldProps: {
......@@ -1229,7 +1229,7 @@ function Model(props) {
dataIndex: 'factoryName',
key: 'factoryId',
width: 120,
align: 'center',
fieldProps: {
placeholder: '请选择',
showSearch: true,
......@@ -1241,7 +1241,7 @@ function Model(props) {
{
title: '车间名称',
dataIndex: 'shopName',
align: 'center',
width: 120,
fieldProps: {
placeholder: '请选择',
......@@ -1261,7 +1261,7 @@ function Model(props) {
title: '工段名称',
width: 120,
dataIndex: 'sectionName',
align: 'center',
key: 'sectionId',
fieldProps: {
placeholder: '请选择',
......@@ -1285,7 +1285,7 @@ function Model(props) {
placeholder: '请选择',
showSearch: true,
},
align: 'center',
options: {
path: '/auth/sysProductionLine/getAllProductLineSelectionByShop',
linkParams: {
......
......@@ -145,7 +145,7 @@ function getcolumns(setDrawer, ifs, formRef) {
},
{
title: '公司名称',
align: 'center',
dataIndex: 'organizationName',
width: 120,
key: 'organizationId',
......@@ -160,7 +160,7 @@ function getcolumns(setDrawer, ifs, formRef) {
{
title: '部门名称',
width: 120,
align: 'center',
valueType: 'treeSelect',
dataIndex: 'departmentName',
fieldProps: {
......@@ -176,24 +176,6 @@ function getcolumns(setDrawer, ifs, formRef) {
},
},
},
{
title: '负责工厂',
dataIndex: 'factoryNames',
align: 'center',
key: 'factoryNames',
hideInTable: true,
hideInForm: true,
formItemProps: { rules: [{ required: false, message: '此项为必填项' }] },
},
{
title: '负责车间',
dataIndex: 'shopNames',
key: 'shopNames',
align: 'center',
hideInTable: true,
hideInForm: true,
formItemProps: { rules: [{ required: false, message: '此项为必填项' }] },
},
{
title: '角色名称',
dataIndex: 'roleNames',
......@@ -205,22 +187,20 @@ function getcolumns(setDrawer, ifs, formRef) {
title: '负责工厂',
dataIndex: 'factoryNames',
key: 'factoryIdList',
search: false,
fieldProps: {
placeholder: '请选择',
showSearch: true,
mode: 'multiple',
},
width: 120,
align: 'center',
valueType: 'select',
options: { path: '/auth/sysFactory/getAllFactorySelection', params: {} },
},
{
title: '负责车间',
dataIndex: 'shopNames',
search: false,
align: 'center',
fieldProps: {
placeholder: '请选择',
showSearch: true,
......@@ -241,7 +221,7 @@ function getcolumns(setDrawer, ifs, formRef) {
title: '负责工段',
width: 120,
dataIndex: 'sectionNames',
align: 'center',
search: false,
key: 'sectionIdList',
hideInTable: true,
......@@ -272,7 +252,7 @@ function getcolumns(setDrawer, ifs, formRef) {
search: false,
hideInTable: true,
key: 'productionLineIdList',
align: 'center',
options: {
path: '/auth/sysProductionLine/getAllProductLineSelectionByShopIdList',
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