wps模型导出优化

This commit is contained in:
yujh 2024-08-30 17:47:36 +08:00
parent cd19309569
commit bc541ac7ed
7 changed files with 299 additions and 55 deletions

View File

@ -307,7 +307,7 @@ public class PalManageUtil {
dataUrl = "xe835-707070.png";
break;
case "|#D81E06"://关键点(-.png)
dataUrl = "xe63d-D81E06.png";
dataUrl = "xe63d-D81E06_1.png";
break;
}
return dataUrl;

View File

@ -245,6 +245,7 @@ public class OutputWordUtil {
// 设置模本装置方法和路径
try {
UtilFile temps = new UtilFile(tempPath);
System.out.println(">>>>>>>tempPath = " + tempPath);
configuration.setDirectoryForTemplateLoading(temps);
} catch (IOException e2) {
e2.printStackTrace();
@ -387,8 +388,6 @@ public class OutputWordUtil {
//创建 Document 类的对象并从磁盘加载 Word 文档
Document document = new Document(outFile.getPath());
// 获取第一个节的第一个表格
Section firstsection = document.getSections().get(1);
Table table1 = firstsection.getTables().get(0);
@ -776,13 +775,13 @@ public class OutputWordUtil {
//设置固定列宽
if(i==0){
row.getCells().get(0).setWidth(50);
row.getCells().get(0).setWidth(10);
}else if(i==1){
row.getCells().get(1).setWidth(150);
row.getCells().get(1).setWidth(10);
}else if(i==2){
row.getCells().get(2).setWidth(150);
}else {
row.getCells().get(3).setWidth(50);
row.getCells().get(2).setWidth(10);
}else if(i==3){
row.getCells().get(3).setWidth(10);
}
}
@ -819,13 +818,13 @@ public class OutputWordUtil {
//设置固定列宽
if(i==0){
row.getCells().get(0).setWidth(50);
row.getCells().get(0).setWidth(10);
}else if(i==1){
row.getCells().get(1).setWidth(100);
row.getCells().get(1).setWidth(10);
}else if(i==2){
row.getCells().get(2).setWidth(50);
}else {
row.getCells().get(3).setWidth(50);
row.getCells().get(2).setWidth(10);
}else if(i==3){
row.getCells().get(3).setWidth(10);
}
}

View File

@ -486,9 +486,9 @@
if (methodId == 'data.form') {
$('#bar_importPolicyFile').css('display','none')
}
debugger;
//新增 打开wps文件逻辑
if((methodId === 'control.policy' && ext3==='I/O_L4')|| methodId ==='engineering.standard' || methodId ==='process.scheme'){
if(methodId === 'control.policy' || methodId ==='engineering.standard' || methodId ==='process.scheme'){
//执行切换显示按钮
switchWpsDisplay(true);
}else{
@ -1105,15 +1105,9 @@
<div id="QualityInspection" awsui-qtip='质量检测' class="toolbar_button">
<div class="ico QualityInspection"></div>
</div>
<div id="bar_importPolicyFile" awsui-qtip='上传正文生成条款' class="toolbar_button" style="<#importShapeStyle>">
<div class="ico ico_importShape"></div>
</div>
<div id="modelFileUpload" awsui-qtip='文件附件上传' class="toolbar_button">
<div class="ico fileUpLoad" onclick="openUpFile()" ></div>
</div>
<div id="processTermination" awsui-qtip='废止' class="toolbar_button">
<div class="ico processTermination"></div>
</div>
<div id="processManifest" awsui-qtip='查看活动清单' class="toolbar_button" style="display: none">
<!--<i class="ico awsui-iconfont">&#xe682;</i>-->
<div class="ico processManifest"></div>
@ -1125,8 +1119,22 @@
<div id="switchViews" awsui-qtip='切换视图' class="toolbar_button">
<div class="ico switchViews" onclick="switchViews()"></div>
</div>
<div id="QuickPublishing" awsui-qtip='快捷发布' class="toolbar_button">
<div style="font-weight: bold;font-size: medium;block-size: auto;">一键发布</div>
<div style="float: right;">
<div id="bar_importPolicyFile" awsui-qtip='上传正文' class="toolbar_button" style="<#importShapeStyle>">
<div class="ico ico_importShape"></div>
</div>
<div id="export_file" ac="output" awsui-qtip='导出手册' class="toolbar_button">
<div style="font-weight: bold;font-size: 15px;block-size: auto;">导出手册</div>
</div>
<div style="float: left;margin-left: 2px;">
<div style="width: 2px;height: 20px;background-color: #050505;margin-top: 7px;float: left;margin-left: 2px;"></div>
</div>
<div id="QuickPublishing" awsui-qtip='快捷发布' class="toolbar_button">
<div style="font-weight: bold;font-size: 15px;block-size: auto;margin-left: 4px;">一键发布</div>
</div>
<div id="processTermination" awsui-qtip='废止' class="toolbar_button">
<div class="ico processTermination"></div>
</div>
</div>
<!-- <div id="bar_import" awsui-qtip='导入' class="toolbar_button" style="<#importStyle>">
<div class="ico ico_import"></div>
@ -3346,6 +3354,7 @@
<div id="policyfile_import_dlg" title="导入" style="display: none;">
<div style="width: 550px;height: 280px;vertical-align: top;">
<button id="pupShapeFile" onclick="return false;" type="button" class="awsui-btn awsui-btn-green" style="margin-left: 20px;margin-top:10px">新增</button>
<button id="downloadTmpFile" onclick="downLoadTmpFile();" type="button" class="awsui-btn awsui-btn-blue" style="margin-left: 20px;margin-top:10px">下载模版</button>
<div style="margin-left: 20px;padding: 5px; font-size: 12px; color: rgb(120, 120, 120);">
<span>附件格式支持:xml, doc, docx 文件大小不超过50M</span>
</div>

View File

@ -467,7 +467,7 @@
<div class="ico processTermination"></div>
</div>
<div id="switchViews" awsui-qtip='切换视图' class="toolbar_button">
<div class="ico switchViews" onclick="switchViews()"></div>
<div class="ico switchViews"></div>
</div>
<div id="bar_importShape" awsui-qtip='上传附件并创建相应节点' class="toolbar_button" style="<#importShapeStyle>">
<div class="ico ico_importShape"></div>
@ -1275,6 +1275,8 @@
<div id="previewDialog" style="width: 80%;padding: 20px 20px 20px 20px;overflow: hidden;">
<div id="previewContent" style="width: 100%;height: 100%;overflow:auto;text-align: center;"></div>
</div>
<div id="wpsPage" style="display:none;width: calc(100% - 36px);position: relative;background-color: #EEEEEE;">
</div>
<div id='hotkey_list' class='dialog'>
<div class='dialog_header'>快捷键列表</div>
@ -1512,13 +1514,12 @@
$(document).ready(function() {
debugger;
//新增 打开wps文件逻辑
if((methodId === 'control.policy' && ext3==='I/O_L4')|| methodId ==='engineering.standard' || methodId ==='process.scheme'){
if(methodId === 'control.policy'|| methodId ==='engineering.standard' || methodId ==='process.scheme'){
//执行切换显示按钮
switchWpsDisplay(true);
}else{
$("#switchViews").css('display','none');
}
switchWpsDisplay(true);
$("#processTermination").off("click").on("click", function () {
$.ajax({
type: "POST",
@ -1542,6 +1543,15 @@
});
});
$("#switchViews").off("click").on("click", function () {
debugger
if ($("#wpsPage").is(":visible")) {
switchWpsDisplay(false);
} else {
switchWpsDisplay(true);
}
});
function switchWpsDisplay(flag) {
if (flag) {//显示wps页面隐藏其余页面
debugger;

View File

@ -892,7 +892,7 @@ function openTextareaDialog(obj, title,id) {
function showTableDialog(obj,value,id){
let tableRef = JSON.parse($(obj).attr('ref'))
//先判断是否包含第三列第四列
if(tableRef.threeColumn ===""){
if(tableRef.threeColumn== undefined || tableRef.threeColumn ===""){
showTableDialog_open(obj,value,id);
}else{
showTableDialog_open_new(obj,value,id);
@ -914,17 +914,17 @@ function showTableDialog_open_new(obj,value,id) {
parent.operateList = tableList
var thead =
'<tr id="' + tableList[0].id + '" class="nodrop nodrag">'
+ '<td style="width: 80px;" class="dialogTableHead">拖拽操作</td>'
+ '<td style="width: 100px;" class="dialogTableHead">'
+ '<td style="width: 100px;" class="dialogTableHead">拖拽操作</td>'
+ '<td style="width: 140px;" class="dialogTableHead">'
+ tableList[0].firstColumn
+ '</td>'
+ '<td style="width: 270px;" class="dialogTableHead">'
+ '<td style="width: 250px;" class="dialogTableHead">'
+ tableList[0].secondColumn
+ '</td>'
+ '<td style="width: 100px;" class="dialogTableHead">'
+ '<td style="width: 250px;" class="dialogTableHead">'
+ tableList[0].threeColumn
+ '</td>'
+ '<td style="width: 270px;" class="dialogTableHead">'
+ '<td style="width: 100px;" class="dialogTableHead">'
+ tableList[0].fourColumn
+ '</td>'
+ '<td style="width: 80px;" class="dialogTableHead">操作</td>'

View File

@ -274,6 +274,7 @@ $(function () {
window.open(url,'fullscreen');*/
});
//终止按钮
$("#processTermination").off("click").on("click", function () {
$.ajax({
type: "POST",
@ -296,6 +297,12 @@ $(function () {
}
});
});
//导出手册
$("#export_file").off("click").on("click", function () {
debugger;
menuSelected($(this));
});
/**
* 流程清单列表按钮
*/
@ -695,4 +702,188 @@ function recordShapeText() {
for (var shape in shapes) {
shapeTextRecord[shape] = shapes[shape].text;
}
}
function menuSelected(item) {
var action = item.attr("ac");
// 编辑菜单
if (action == "rename") {
$(".diagram_title").trigger("click");
} else if (action == "close") {
if (parent.closeTabById) {
parent.closeTabById(chartId);
} else {
window.close();
}
} else if (action == "saveAs") {
UI.showSaveAs();
} else if (action == "preview") {//在线预览流程图片
UI.doPreview();
} else if (action == "saveImage") {//生成图片和缩略图
UI.saveImage();
} else if (action == "versionCompare") {
UI.showVersionCompare();
} else if (action == "output") {// 导出流程手册并预览
UI.doOutputProcess();
} else if (action == "export") {
$("#export_dialog").dlg();
} else if (action == "processExport") {
UI.processExport();
} else if (action == "undo") {
MessageSource.undo();
} else if (action == "redo") {
MessageSource.redo();
} else if (action == "cut") {
Designer.clipboard.cut();
} else if (action == "copy") {
Designer.clipboard.copy();
} else if (action == "paste") {
Designer.clipboard.paste();
} else if (action == "duplicate") {
Designer.clipboard.duplicate();
} else if (action == "brush") {
Designer.clipboard.brush();
} else if (action == "selectall") {
Designer.selectAll();
} else if (action == "openNewPage") {
UI.openNewPage();//新页面打开
} else if (action == "batchreplace") {
UI.batchReplace();
} else if (action == "delete") {
Designer.op.removeShape();
// 视图缩放
} else if (action == "zoom") {
var zoom = item.attr("zoom");
if (zoom == "in") {
Designer.zoomIn();
} else if (zoom == "out") {
Designer.zoomOut();
} else {
var zoomScale = parseFloat(zoom);
Designer.setZoomScale(zoomScale);
}
// 插入
} else if (action == "insert") {
var insertType = item.attr("in");
if (insertType == "text") {
Designer.op.changeState("creating_free_text");
} else if (insertType == "image") {
UI.showImageSelect(function(fileId, w, h) {
UI.insertImage(fileId, w, h);
});
} else if (insertType == "line") {
Designer.op.changeState("creating_free_linker");
}
// 页面
} else if (action == "set_page_size") {
var w = parseInt(item.attr("w"));
var h = parseInt(item.attr("h"));
Designer.setPageStyle({
width: w,
height: h
});
} else if (action == "set_page_padding") {
var p = parseInt(item.attr("p"));
Designer.setPageStyle({
padding: p
})
} else if (action == "set_page_showgrid") {
if (item.menuitem("isSelected")) {
item.menuitem("unselect");
Designer.setPageStyle({
showGrid: false
});
} else {
item.menuitem("select");
Designer.setPageStyle({
showGrid: true
});
}
} else if (action == "set_page_gridsize") {
var s = parseInt(item.attr("s"));
Designer.setPageStyle({
gridSize: s
})
}
// 排列
else if (action == "front") {
Designer.layerShapes("front");
} else if (action == "back") {
Designer.layerShapes("back");
} else if (action == "forward") {
Designer.layerShapes("forward");
} else if (action == "backward") {
Designer.layerShapes("backward");
} else if (action == "align_shape") {
var align = item.attr("al");
Designer.alignShapes(align);
} else if (action == "distribute_shape") {
var type = item.attr("dis");
Designer.distributeShapes(type);
} else if (action == "match_size") {
if (item.attr("custom")) {
Dock.showView("metric");
} else {
var type = {};
var w = item.attr("w");
var h = item.attr("h");
if (w) {
type.w = w;
}
if (h) {
type.h = h;
}
Designer.matchSize(type);
}
} else if (action == "lock") {
Designer.lockShapes();
} else if (action == "unlock") {
Designer.unlockShapes();
} else if (action == "group") {
Designer.group();
} else if (action == "ungroup") {
Designer.ungroup();
} else if (action == "hotkey") {
UI.showHotKey();
} else if (action == "feedback") {
UI.showFeedBack();
} else if (action == "getting_started") {
UI.gettingStart();
} else if (action == "modelConvert"){
var targetMethod = item.attr("methodId");
$.simpleAlert('转换后同名校验中', 'loading');
$.ajax({
type: "POST",
url: "./jd",
data: {
sid: sid,
cmd: "com.actionsoft.apps.coe.pal.check_repository_name_exist",
repositoryId: ruuid,
targetMethod: targetMethod
},
success: function (r,textStatus,jqXHR) {
$.simpleAlert("close");
if(r.result == 'ok' ) {
if (r.data.duplicateName){
$.confirm({
title: '提示',
content: '文件【'+r.data.repositoryName+'】名称已存在,是否新建副本?',
onConfirm: function () {
modelConvertFn(targetMethod,r.data.duplicateName);
},
onCancel: function () {}
});
}else {
modelConvertFn(targetMethod,r.data.duplicateName);
}
}else {
$.simpleAlert(r.data.desc, 'error');
}
},
error: function (jqXHR,textStatus,errorThrown) {
$.simpleAlert(errorThrown, 'err');
}
});
}
}

View File

@ -4314,16 +4314,22 @@ function outputReport() {
msg = '正在创建表单手册';
} else if (methodId == 'control.policy') {
msg = '正在创建制度手册';
if(ext3==='I/O_L4'){
//触发手动保存操作
saveWpsThis();
//设置等待时间
setTime = 2000;
}
//触发手动保存操作
saveWpsThis();
//设置等待时间
setTime = 2000;
} else if(methodId=="process.scheme"){
msg = '正在创建方案手册';
//触发手动保存操作
saveWpsThis();
//设置等待时间
setTime = 2000;
} else if(methodId=="engineering.standard"){
msg = '正在创建工程制度标准手册';
//触发手动保存操作
saveWpsThis();
//设置等待时间
setTime = 2000;
}
$.simpleAlert(msg, 'loading');
setTimeout(function(){
@ -4591,23 +4597,34 @@ UI.showImportPolicyFileDlg = function () {
$.simpleAlert('页面中有未保存的内容,请先保存');
return;
}
$("#policyfile_import_dlg").dialog({
width: 570,
height: 380,
buttons: [
{
text: '确定', cls: "blue", handler: function () {
importPolicyFile();
}
},
{
text: '取消', handler: function () {
$("#policyfile_import_dlg").dialog("close");
}
}
],
onClose: delPolicyFiles
});
var options = {
title : "注意",
content:"上传正文会覆盖原有正文内容,请确认后上传",
onConfirm: function(){
//先弹出一个二次确认框
$("#policyfile_import_dlg").dialog({
width: 570,
height: 380,
buttons: [
{
text: '确定', cls: "blue", handler: function () {
importPolicyFile();
}
},
{
text: '取消', handler: function () {
$("#policyfile_import_dlg").dialog("close");
}
}
],
onClose: delPolicyFiles
});
},
onCancel : function(){
$.simpleAlert("您选择了取消");
}
};
$.confirm(options);
}
var updatedPolicyFileList = "";// 已上传的附件列表名称
@ -4754,6 +4771,24 @@ function addPolicyFile() {
});
}
/**
* 下载正文附件模版
*/
function downLoadTmpFile(){
$.ajax({
type: "POST",
url: "./jd?sid="
+ CLB.sid
+ "&cmd=com.actionsoft.apps.coe.pal.publisher_downloadTpmFile",
data: {
sid: sid
},
success: function (r) {
window.open(r.data.url);
}
});
}
/************************处理前后置流程***************************/
/**