Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
appbuild
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
appbuild
Commits
1493b342
Commit
1493b342
authored
May 26, 2022
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改部分生成代码逻辑
parent
d7a0d715
Pipeline
#1570
failed with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
3 deletions
+67
-3
appbuild-manage-ui/admin/src/views/system/gentable/genInfoForm.vue
...manage-ui/admin/src/views/system/gentable/genInfoForm.vue
+3
-3
appbuild-manager/src/main/java/com/mortals/xhx/common/utils/PoiTlUtils.java
...rc/main/java/com/mortals/xhx/common/utils/PoiTlUtils.java
+64
-0
No files found.
appbuild-manage-ui/admin/src/views/system/gentable/genInfoForm.vue
View file @
1493b342
...
...
@@ -108,9 +108,9 @@
</span>
<el-select
v-model=
"info.isShowControl"
>
<el-option
label=
"
php
"
value=
"2"
/>
<el-option
label=
"
是
"
value=
"1"
/>
<el-option
label=
"
否
"
value=
"0"
/>
<el-option
label=
"
RequestBody
"
value=
"2"
/>
<el-option
label=
"
RequestForm
"
value=
"1"
/>
<el-option
label=
"
RequestFormTwo
"
value=
"0"
/>
</el-select>
</el-form-item>
...
...
appbuild-manager/src/main/java/com/mortals/xhx/common/utils/PoiTlUtils.java
0 → 100644
View file @
1493b342
package
com.mortals.xhx.common.utils
;
import
com.deepoove.poi.XWPFTemplate
;
import
com.deepoove.poi.config.Configure
;
import
com.deepoove.poi.config.ConfigureBuilder
;
import
com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy
;
import
com.deepoove.poi.plugin.table.MultipleRowTableRenderPolicy
;
import
com.mortals.xhx.base.system.gentable.model.GentableColumnEntity
;
import
com.mortals.xhx.base.system.gentable.model.GentableEntity
;
import
com.mortals.xhx.base.system.gentable.model.ProjectInfoEntity
;
import
lombok.var
;
import
org.junit.jupiter.api.Test
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author: zxfei
* @date: 2022/5/16 23:11
* @description:
**/
public
class
PoiTlUtils
{
@Test
public
void
testData
()
throws
Exception
{
List
<
GentableEntity
>
tableList
=
new
ArrayList
<>();
GentableEntity
gentableEntity
=
new
GentableEntity
();
gentableEntity
.
setTableName
(
"test"
);
gentableEntity
.
setFunctionName
(
"ddddddd"
);
List
<
GentableColumnEntity
>
columns
=
new
ArrayList
<>();
GentableColumnEntity
columnEntity
=
new
GentableColumnEntity
();
columnEntity
.
initAttrValue
();
columns
.
add
(
columnEntity
);
gentableEntity
.
setColumns
(
columns
);
tableList
.
add
(
gentableEntity
);
tableList
.
add
(
gentableEntity
);
ProjectInfoEntity
projectInfo
=
new
ProjectInfoEntity
();
projectInfo
.
setPlatFormName
(
"测试平台"
);
Map
data
=
new
HashMap
();
data
.
put
(
"tableList"
,
tableList
);
data
.
put
(
"projectInfo"
,
projectInfo
);
ConfigureBuilder
builder
=
Configure
.
builder
();
builder
.
bind
(
"columns"
,
new
MultipleRowTableRenderPolicy
());
LoopRowTableRenderPolicy
hackLoopTableRenderPolicy
=
new
LoopRowTableRenderPolicy
();
// Configure config = Configure.builder().useSpringEL().bind("columns", hackLoopTableRenderPolicy).build();
Configure
config
=
Configure
.
builder
().
useSpringEL
().
bind
(
"columns"
,
new
MultipleRowTableRenderPolicy
()).
build
();
XWPFTemplate
template
=
XWPFTemplate
.
compile
(
"src/test/resources/okr/base.docx"
,
config
).
render
(
data
);
template
.
writeToFile
(
"target/base.docx"
);
}
}
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