Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ems3.3
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
ems3.3
Commits
f6f15a3b
Commit
f6f15a3b
authored
Jan 10, 2023
by
TZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去除 log
parent
d094b7af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
76 deletions
+75
-76
mtable.jsx
src/components/AutoTable/mtable.jsx
+75
-76
No files found.
src/components/AutoTable/mtable.jsx
View file @
f6f15a3b
...
...
@@ -43,7 +43,6 @@ const Mtable = (props) => {
dataSource
,
}
=
props
;
console
.
log
(
'this is path:'
,
path
);
const
actionRefs
=
actionRef
??
useRef
(),
formRefs
=
formRef
??
useRef
(),
ifspagination
=
pagination
==
'false'
||
pagination
===
false
,
...
...
@@ -92,10 +91,10 @@ const Mtable = (props) => {
let
itemwidth
=
valueColumns
[
it
.
key
]?.
width
?
valueColumns
[
it
.
key
].
width
:
it
.
width
?
it
.
width
:
resizeable
?
160
:
'auto'
;
?
it
.
width
:
resizeable
?
160
:
'auto'
;
let
options
=
{};
if
([
'select'
,
'treeSelect'
,
'radio'
,
'checkbox'
,
'cascader'
].
includes
(
it
?.
valueType
))
{
if
(
Array
.
isArray
(
it
.
options
))
{
...
...
@@ -279,79 +278,79 @@ const Mtable = (props) => {
//缩放表格
const
handleResize
=
(
index
)
=>
(
e
,
{
size
})
=>
{
e
.
stopImmediatePropagation
();
setcolumnes
((
s
)
=>
{
const
nextColumns
=
[...
s
];
nextColumns
[
index
]
=
{
...
nextColumns
[
index
],
width
:
size
.
width
,
};
return
nextColumns
;
});
};
(
e
,
{
size
})
=>
{
e
.
stopImmediatePropagation
();
setcolumnes
((
s
)
=>
{
const
nextColumns
=
[...
s
];
nextColumns
[
index
]
=
{
...
nextColumns
[
index
],
width
:
size
.
width
,
};
return
nextColumns
;
});
};
//更新表格缩放
const
handleResizeStop
=
(
index
)
=>
(
e
,
{
size
})
=>
{
e
.
stopImmediatePropagation
();
let
submitdata
=
{
...
valueColumns
}
??
{},
curkey
=
Object
.
keys
(
submitdata
)[
index
];
submitdata
[
curkey
].
width
=
parseInt
(
size
.
width
);
setvalueColumns
(
submitdata
);
doFetch
({
url
:
'/ngic-base-business/paFieldScene/save'
,
params
:
{
sceneMark
:
activeTabKey
?
path
+
activeTabKey
:
path
,
controList
:
Object
.
keys
(
submitdata
).
map
((
it
,
i
)
=>
{
return
{
fieldKey
:
it
,
fieldWidth
:
i
==
index
?
parseInt
(
size
.
width
)
:
submitdata
[
it
].
width
,
fieldOrder
:
submitdata
[
it
].
order
,
fieldFixed
:
submitdata
[
it
].
fixed
,
fieldShow
:
submitdata
[
it
].
show
,
};
}),
},
});
};
(
e
,
{
size
})
=>
{
e
.
stopImmediatePropagation
();
let
submitdata
=
{
...
valueColumns
}
??
{},
curkey
=
Object
.
keys
(
submitdata
)[
index
];
submitdata
[
curkey
].
width
=
parseInt
(
size
.
width
);
setvalueColumns
(
submitdata
);
doFetch
({
url
:
'/ngic-base-business/paFieldScene/save'
,
params
:
{
sceneMark
:
activeTabKey
?
path
+
activeTabKey
:
path
,
controList
:
Object
.
keys
(
submitdata
).
map
((
it
,
i
)
=>
{
return
{
fieldKey
:
it
,
fieldWidth
:
i
==
index
?
parseInt
(
size
.
width
)
:
submitdata
[
it
].
width
,
fieldOrder
:
submitdata
[
it
].
order
,
fieldFixed
:
submitdata
[
it
].
fixed
,
fieldShow
:
submitdata
[
it
].
show
,
};
}),
},
});
};
const
components
=
resizeable
?
{
components
:
{
header
:
{
cell
:
Resizecell
,
components
:
{
header
:
{
cell
:
Resizecell
,
},
},
},
columnsState
:
{
value
:
valueColumns
,
onChange
:
(
val
,
state
)
=>
{
setvalueColumns
((
s
)
=>
{
let
submitdata
=
{
...
s
,
...
val
,
};
doFetch
({
url
:
'/ngic-base-business/paFieldScene/save'
,
params
:
{
sceneMark
:
activeTabKey
?
path
+
activeTabKey
:
path
,
controList
:
Object
.
keys
(
submitdata
).
map
((
it
)
=>
{
return
{
fieldKey
:
it
,
fieldWidth
:
submitdata
[
it
].
width
,
fieldOrder
:
submitdata
[
it
].
order
,
fieldFixed
:
submitdata
[
it
].
fixed
,
fieldShow
:
submitdata
[
it
].
show
,
};
}),
},
columnsState
:
{
value
:
valueColumns
,
onChange
:
(
val
,
state
)
=>
{
setvalueColumns
((
s
)
=>
{
let
submitdata
=
{
...
s
,
...
val
,
};
doFetch
({
url
:
'/ngic-base-business/paFieldScene/save'
,
params
:
{
sceneMark
:
activeTabKey
?
path
+
activeTabKey
:
path
,
controList
:
Object
.
keys
(
submitdata
).
map
((
it
)
=>
{
return
{
fieldKey
:
it
,
fieldWidth
:
submitdata
[
it
].
width
,
fieldOrder
:
submitdata
[
it
].
order
,
fieldFixed
:
submitdata
[
it
].
fixed
,
fieldShow
:
submitdata
[
it
].
show
,
};
}),
},
});
return
submitdata
;
});
return
submitdata
;
});
},
},
},
}
}
:
{};
const
datas
=
dataSource
?
{
dataSource
,
toolBarRender
:
false
}
:
{
request
};
...
...
@@ -400,19 +399,19 @@ const Mtable = (props) => {
scroll=
{
x
?
{
x
:
x
,
}
x
:
x
,
}
:
{}
}
pagination=
{
pagination
?
{
showTotal
:
(
total
,
range
)
=>
<
span
>
共
{
total
}
条
</
span
>,
showQuickJumper
:
true
,
showSizeChanger
:
true
,
pageSizeOptions
:
[
5
,
10
,
15
,
30
,
50
,
100
,
200
],
defaultPageSize
:
pageSize
||
15
,
}
showTotal
:
(
total
,
range
)
=>
<
span
>
共
{
total
}
条
</
span
>,
showQuickJumper
:
true
,
showSizeChanger
:
true
,
pageSizeOptions
:
[
5
,
10
,
15
,
30
,
50
,
100
,
200
],
defaultPageSize
:
pageSize
||
15
,
}
:
false
}
search=
{
{
...
...
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