Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
浙江兰德纵横网络技术股份有限公司
o2oa
提交
f4e37266
o2oa
项目概览
浙江兰德纵横网络技术股份有限公司
/
o2oa
通知
339
Star
10
Fork
6
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f4e37266
编写于
5月 19, 2021
作者:
NoSubject
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加OOXML对象,用于版式文件转换为word
上级
8e95b824
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
150 addition
and
27 deletion
+150
-27
o2web/source/x_component_process_Xform/widget/OOXML.js
o2web/source/x_component_process_Xform/widget/OOXML.js
+108
-0
o2web/source/x_desktop/js/initialScriptText.js
o2web/source/x_desktop/js/initialScriptText.js
+42
-27
未找到文件。
o2web/source/x_component_process_Xform/widget/OOXML.js
浏览文件 @
f4e37266
...
...
@@ -176,10 +176,118 @@ o2.xApplication.process.Xform.widget.OOXML.WordprocessingML = o2.OOXML.WML = new
this
.
insertChildren
(
oo_body
,
[
oo_p
]);
}
},
getTableTblW
:
function
(
table
){
var
type
=
"
auto
"
;
var
w
=
table
.
get
(
"
width
"
).
toFloat
();
if
(
w
)
w
=
this
.
pxToPt
(
w
);
if
(
!
w
)
w
=
table
.
getStyle
(
"
width
"
).
toFloat
();
if
(
!
w
){
w
=
0
;
}
else
{
type
=
"
dxa
"
;
w
=
w
*
20
;
}
return
{
"
w
"
:
w
,
"
type
"
:
type
};
},
getTableBorder
:
function
(
table
,
where
){
var
attr
=
{
"
space
"
:
"
0
"
,
"
val
"
:
"
single
"
,
"
color
"
:
"
auto
"
,
"
sz
"
:
"
0
"
}
var
sz
=
table
.
get
(
"
border
"
).
toFloat
();
if
(
sz
)
sz
=
this
.
pxToPt
(
b
);
if
(
!
sz
)
sz
=
table
.
getStyle
(
"
border-
"
+
where
+
"
-width
"
).
toFloat
();
if
(
!
sz
)
sz
=
0
;
attr
.
sz
=
sz
*
20
;
var
color
=
this
.
getColorHex
(
table
.
getStyle
(
"
border-
"
+
where
+
"
-color
"
));
if
(
!
color
)
color
=
"
auto
"
;
attr
.
color
=
color
;
var
style
=
table
.
getStyle
(
"
border-
"
+
where
+
"
-style
"
);
switch
(
style
){
case
"
dashed
"
:
case
"
dotted
"
:
case
"
double
"
:
attr
.
val
=
"
double
"
;
break
;
default
:
attr
.
val
=
"
single
"
;
}
var
space
=
table
.
get
(
"
cellspacing
"
).
toFloat
();
if
(
space
)
attr
.
space
=
this
.
pxToPt
(
space
)
*
20
;
return
attr
;
},
getTableTblGrid
:
function
(
table
){
var
grids
=
[];
var
trs
=
table
.
getElements
(
"
tr
"
);
for
(
var
i
=
0
;
i
<
trs
.
length
;
i
++
){
var
idx
=
0
;
tds
=
trs
[
i
].
cells
;
tds
.
each
(
function
(
td
){
var
colspan
=
td
.
get
(
"
colspan
"
);
if
(
!
colspan
)
{
while
(
grids
.
length
<=
idx
)
grids
.
push
(
0
);
var
pt
=
this
.
pxToPt
(
td
.
clientWidth
);
if
(
pt
>
grids
[
idx
])
grids
[
idx
]
=
pt
;
}
else
{
idx
=
idx
+
(
colspan
.
toInt
()
-
1
);
while
(
grids
.
length
<=
idx
)
grids
.
push
(
0
);
}
idx
++
;
});
}
return
grids
;
},
processTable
:
function
(
table
,
oo_body
){
var
oo_doc
=
oo_body
.
ownerDocument
;
var
oo_tbl
=
this
.
createEl
(
oo_doc
,
"
tbl
"
);
var
oo_tblPr
=
this
.
createEl
(
oo_doc
,
"
tblPr
"
);
//表格宽度属性
var
oo_tblW
=
this
.
createEl
(
oo_doc
,
"
tblW
"
);
var
tblW
=
this
.
getTableTblW
(
table
);
this
.
setAttrs
(
oo_tblW
,
tblW
,
false
);
oo_tblPr
.
appendChild
(
oo_tblW
);
//表格边框属性
var
oo_tblBorders
=
this
.
createEl
(
oo_doc
,
"
tblBorders
"
);
var
oo_top
=
this
.
createEl
(
oo_doc
,
"
top
"
);
this
.
setAttrs
(
oo_top
,
this
.
getTableBorder
(
table
,
"
top
"
),
false
);
var
oo_left
=
this
.
createEl
(
oo_doc
,
"
left
"
);
this
.
setAttrs
(
oo_left
,
this
.
getTableBorder
(
table
,
"
left
"
),
false
);
var
oo_bottom
=
this
.
createEl
(
oo_doc
,
"
bottom
"
);
this
.
setAttrs
(
oo_bottom
,
this
.
getTableBorder
(
table
,
"
bottom
"
),
false
);
var
oo_right
=
this
.
createEl
(
oo_doc
,
"
right
"
);
this
.
setAttrs
(
oo_right
,
this
.
getTableBorder
(
table
,
"
right
"
),
false
);
this
.
insertSiblings
(
oo_tblBorders
,
[
oo_top
,
oo_left
,
oo_bottom
,
oo_right
],
"
beforeend
"
)
oo_tblPr
.
appendChild
(
oo_tblBorders
);
var
mar
=
table
.
get
(
"
cellpadding
"
).
toFloat
();
if
(
mar
){
mar
=
this
.
pxToPt
(
b
)
*
20
;
var
oo_tblCellMar
=
this
.
createEl
(
oo_doc
,
"
tblCellMar
"
);
var
oo_mar
=
this
.
createEl
(
oo_doc
,
"
left
"
);
this
.
setAttrs
(
oo_mar
,
{
"
type
"
:
"
dxa
"
,
"
w
"
:
mar
});
oo_tblCellMar
.
appendChild
(
oo_mar
);
oo_mar
=
this
.
createEl
(
oo_doc
,
"
right
"
);
this
.
setAttrs
(
oo_mar
,
{
"
type
"
:
"
dxa
"
,
"
w
"
:
mar
});
oo_tblCellMar
.
appendChild
(
oo_mar
);
oo_mar
=
this
.
createEl
(
oo_doc
,
"
top
"
);
this
.
setAttrs
(
oo_mar
,
{
"
type
"
:
"
dxa
"
,
"
w
"
:
mar
});
oo_tblCellMar
.
appendChild
(
oo_mar
);
oo_mar
=
this
.
createEl
(
oo_doc
,
"
bottom
"
);
this
.
setAttrs
(
oo_mar
,
{
"
type
"
:
"
dxa
"
,
"
w
"
:
mar
});
oo_tblCellMar
.
appendChild
(
oo_mar
);
oo_tblPr
.
appendChild
(
oo_tblCellMar
);
}
// <w:tblGrid>
// <w:gridCol w:w="4597"/>
// <w:gridCol w:w="4237"/>
// </w:tblGrid>
},
pxToPt
:
function
(
px
){
...
...
o2web/source/x_desktop/js/initialScriptText.js
浏览文件 @
f4e37266
...
...
@@ -873,15 +873,22 @@ bind.headers = {
};
bind
.
parameters
=
{
"
add
"
:
function
(
value
){
try
{
if
(
parameters
)
parameters
.
add
(
value
);
}
catch
(
e
){}
},
"
put
"
:
function
(
name
,
value
){
if
((
typeof
name
)
===
"
object
"
){
var
_keys
=
Object
.
keys
(
name
);
for
(
var
i
=
0
;
i
<
_keys
.
length
;
i
++
){
if
(
parameters
)
parameters
.
put
(
_keys
[
i
],
name
[
_keys
[
i
]]);
try
{
if
((
typeof
name
)
===
"
object
"
){
var
_keys
=
Object
.
keys
(
name
);
for
(
var
i
=
0
;
i
<
_keys
.
length
;
i
++
){
if
(
parameters
)
parameters
.
put
(
_keys
[
i
],
name
[
_keys
[
i
]]);
}
}
else
{
if
(
parameters
)
parameters
.
put
(
name
,
value
);
}
}
else
{
if
(
parameters
)
parameters
.
put
(
name
,
value
);
}
}
catch
(
e
){}
},
"
remove
"
:
function
(
name
){
try
{
...
...
@@ -891,41 +898,49 @@ bind.parameters = {
};
//bind.parameters = this.parameters || null;
bind
.
response
=
(
function
(){
var
_self
=
this
;
if
(
this
.
jaxrsResponse
){
if
(
this
.
jaxrsResponse
.
get
()){
if
(
JSON
.
validate
(
this
.
jaxrsResponse
.
get
())){
var
value
=
this
.
jaxrsResponse
.
get
();
if
(
JSON
.
validate
(
value
)){
return
{
"
status
"
:
this
.
jaxrsResponse
.
status
,
"
value
"
:
JSON
.
decode
(
this
.
jaxrsResponse
.
get
())
"
value
"
:
JSON
.
decode
(
value
),
"
get
"
:
function
(){
JSON
.
decode
(
value
)
}
};
}
else
{
return
{
"
status
"
:
this
.
jaxrsResponse
.
status
,
"
value
"
:
this
.
jaxrsResponse
.
value
"
value
"
:
value
,
"
get
"
:
function
(){
return
value
;
}
};
}
}
else
{
return
{
"
status
"
:
this
.
jaxrsResponse
.
status
};
return
{
"
status
"
:
this
.
jaxrsResponse
.
status
,
"
value
"
:
this
.
jaxrsResponse
.
value
,
"
get
"
:
function
(){
return
_self
.
jaxrsResponse
.
value
;
}
};
}
}
else
{
var
_self
=
this
;
return
{
"
get
"
:
function
(){
if
(
_self
.
jaxrsResponse
.
get
()){
if
(
JSON
.
validate
(
_self
.
jaxrsResponse
.
get
())){
return
{
"
status
"
:
_self
.
jaxrsResponse
.
status
,
"
value
"
:
JSON
.
decode
(
_self
.
jaxrsResponse
.
get
())
};
}
else
{
return
{
"
status
"
:
_self
.
jaxrsResponse
.
status
,
"
value
"
:
_self
.
jaxrsResponse
.
value
};
}
}
else
{
return
{
"
status
"
:
_self
.
jaxrsResponse
.
status
};
}
return
_self
.
jaxwsResponse
||
null
;
// if (_self.jaxwsResponse && _self.jaxwsResponse.get()){
// if (JSON.validate(_self.jaxwsResponse.get())){
// return {
// "status": _self.jaxwsResponse.status,
// "value": JSON.decode(_self.jaxwsResponse.get())
// };
// }else{
// return {
// "status": _self.jaxwsResponse.status,
// "value": _self.jaxwsResponse.value
// };
// }
// }else{
// return {"status": _self.jaxwsResponse.status};
// }
}
}
}
...
...
liyi_hz2008
@liyi_hz2008
mentioned in commit
57e61ca2
·
6月 04, 2021
mentioned in commit
57e61ca2
mentioned in commit 57e61ca2e6e1d603d312afee4501b480012e63bc
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录