Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_42566577
o2oa
提交
3e808494
o2oa
项目概览
weixin_42566577
/
o2oa
与 Fork 源项目一致
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
0
Fork
0
代码
文件
提交
分支
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,发现更多精彩内容 >>
提交
3e808494
编写于
11月 19, 2021
作者:
U
unknown
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复移动端自定义表单重复绑定事件的问题
上级
b3bfc542
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
613 addition
and
5 deletion
+613
-5
o2web/source/x_component_process_FormDesigner/Module/Form/template/form_custom_submit_mobile.json
...igner/Module/Form/template/form_custom_submit_mobile.json
+5
-5
o2web/source/x_component_process_FormDesigner/Module/Form/template/test.json
...onent_process_FormDesigner/Module/Form/template/test.json
+608
-0
未找到文件。
o2web/source/x_component_process_FormDesigner/Module/Form/template/form_custom_submit_mobile.json
浏览文件 @
3e808494
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
o2web/source/x_component_process_FormDesigner/Module/Form/template/test.json
0 → 100644
浏览文件 @
3e808494
{
"json"
:
{
"id"
:
"3af5d031-b50b-465b-bc8c-cc13e3327549"
,
"name"
:
"自定义提交表单Mobile端模板"
,
"type"
:
"Form"
,
"mode"
:
"Mobile"
,
"application"
:
"1b77e104-b0d3-45f0-944d-79b825d2a27e"
,
"applicationName"
:
"003测试"
,
"styles"
:
{
"background-color"
:
"#f0f0f0"
},
"cssLinks"
:
[],
"scriptSrc"
:
[],
"moduleList"
:
{
"submitNode"
:
{
"id"
:
"submitNode"
,
"type"
:
"Div"
,
"defaultValue"
:
{
"code"
:
""
,
"html"
:
""
},
"isSaved"
:
true
,
"pid"
:
"Mobile1ba2edfb-8d28-4058-9d76-4f9d53f5e613submitNode"
,
"moduleName"
:
"div"
,
"recoveryStyles"
:
{
"height"
:
"100%"
,
"min-height"
:
"280px"
,
"background-color"
:
"#eeeeee"
},
"preprocessing"
:
"y"
},
"submitInnerNode"
:
{
"id"
:
"submitInnerNode"
,
"type"
:
"Div"
,
"defaultValue"
:
{
"code"
:
""
,
"html"
:
""
},
"isSaved"
:
true
,
"pid"
:
"1ba2edfb-8d28-4058-9d76-4f9d53f5e613submitInnerNode"
,
"moduleName"
:
"div"
,
"preprocessing"
:
"y"
},
"submitContentWrapNode"
:
{
"id"
:
"submitContentWrapNode"
,
"type"
:
"Div"
,
"defaultValue"
:
{
"code"
:
""
,
"html"
:
""
},
"isSaved"
:
true
,
"pid"
:
"1ba2edfb-8d28-4058-9d76-4f9d53f5e613div"
,
"moduleName"
:
"div"
,
"preprocessing"
:
"y"
},
"submitContentNode"
:
{
"id"
:
"submitContentNode"
,
"type"
:
"Div"
,
"defaultValue"
:
{
"code"
:
""
,
"html"
:
""
},
"isSaved"
:
true
,
"pid"
:
"1ba2edfb-8d28-4058-9d76-4f9d53f5e613div"
,
"moduleName"
:
"div"
,
"preprocessing"
:
"y"
},
"submitContentInnerNode"
:
{
"id"
:
"submitContentInnerNode"
,
"type"
:
"Div"
,
"defaultValue"
:
{
"code"
:
""
,
"html"
:
""
},
"isSaved"
:
true
,
"pid"
:
"1ba2edfb-8d28-4058-9d76-4f9d53f5e613submitContentInnerNode"
,
"moduleName"
:
"div"
,
"preprocessing"
:
"y"
},
"routeGroupArea"
:
{
"id"
:
"routeGroupArea"
,
"type"
:
"Div"
,
"defaultValue"
:
{
"code"
:
""
,
"html"
:
""
},
"isSaved"
:
true
,
"pid"
:
"1ba2edfb-8d28-4058-9d76-4f9d53f5e613routeGroupArea"
,
"moduleName"
:
"div"
,
"recoveryStyles"
:
{
"overflow"
:
"hidden"
,
"min-height"
:
"40px"
,
"background-color"
:
"#ffffff"
,
"padding"
:
"0xp 20px"
},
"preprocessing"
:
"y"
},
"routeSelectorArea"
:
{
"id"
:
"routeSelectorArea"
,
"type"
:
"Div"
,
"defaultValue"
:
{
"code"
:
""
,
"html"
:
""
},
"isSaved"
:
true
,
"pid"
:
"1ba2edfb-8d28-4058-9d76-4f9d53f5e613routeSelectorArea"
,
"moduleName"
:
"div"
,
"recoveryStyles"
:
{
"overflow"
:
"hidden"
,
"min-height"
:
"40px"
,
"background-color"
:
"#ffffff"
,
"padding"
:
"0xp 20px"
},
"preprocessing"
:
"y"
},
"inputOpinionNode"
:
{
"id"
:
"inputOpinionNode"
,
"type"
:
"Div"
,
"defaultValue"
:
{
"code"
:
""
,
"html"
:
""
},
"isSaved"
:
true
,
"pid"
:
"1ba2edfb-8d28-4058-9d76-4f9d53f5e613inputOpinionNode"
,
"moduleName"
:
"div"
,
"recoveryStyles"
:
{
"height"
:
"129px"
,
"border-right"
:
"0px solid #6681a5"
,
"overflow"
:
"hidden"
,
"border-left"
:
"0px solid #6681a5"
,
"background-color"
:
"#EEE"
},
"preprocessing"
:
"y"
},
"inputTextarea"
:
{
"id"
:
"inputTextarea"
,
"type"
:
"Textarea"
,
"defaultValue"
:
{
"code"
:
""
,
"html"
:
""
},
"compute"
:
"create"
,
"section"
:
"no"
,
"sectionBy"
:
"person"
,
"properties"
:
{
"placeholder"
:
"请在此处填写流程意见"
},
"isSaved"
:
true
,
"pid"
:
"1ba2edfb-8d28-4058-9d76-4f9d53f5e613inputTextarea"
,
"isReadonly"
:
false
,
"moduleName"
:
"textarea"
,
"recoveryStyles"
:
{
"border"
:
"0px solid #ccc"
,
"color"
:
"#666"
},
"recoveryInputStyles"
:
{
"height"
:
"120px"
,
"background-color"
:
"#fff"
,
"border"
:
"1px solid #eeeeee"
,
"margin-right"
:
"1px"
,
"width"
:
"100%"
,
"font-size"
:
"100%"
,
"resize"
:
"none"
,
"border-image"
:
"none"
,
"padding"
:
"3px"
,
"overflow-x"
:
"hidden"
,
"overflow-y"
:
"auto"
,
"color"
:
"#666"
,
"border-bottom"
:
"1px solid #ccc"
},
"preprocessing"
:
"y"
},
"mediaActionArea"
:
{
"id"
:
"mediaActionArea"
,
"type"
:
"Div"
,
"defaultValue"
:
{
"code"
:
""
,
"html"
:
""
},
"isSaved"
:
true
,
"pid"
:
"1ba2edfb-8d28-4058-9d76-4f9d53f5e613mediaActionArea"
,
"moduleName"
:
"div"
,
"recoveryStyles"
:
{
"position"
:
"relative"
,
"height"
:
"25px"
,
"line-height"
:
"25px"
,
"top"
:
"-32px"
,
"margin-right"
:
"5px"
},
"preprocessing"
:
"y"
},
"handwritingAction"
:
{
"id"
:
"handwritingAction"
,
"type"
:
"Div"
,
"defaultValue"
:
{
"code"
:
""
,
"html"
:
""
},
"properties"
:
{
"text"
:
"手写"
},
"isSaved"
:
true
,
"pid"
:
"db627f2f-ec8d-4c02-ba90-2e083ebd9dafhandwritingAction"
,
"moduleName"
:
"div"
,
"recoveryStyles"
:
{
"float"
:
"right"
,
"border"
:
"1px solid #6681a5"
,
"border-radius"
:
"3px"
,
"cursor"
:
"pointer"
,
"padding-left"
:
"24px"
,
"padding-right"
:
"5px"
,
"margin-left"
:
"5px"
,
"background"
:
"url(/x_component_process_Work/$Processor/default/write.png) no-repeat 5px center"
,
"width"
:
"28px"
,
"height"
:
"25px"
},
"preprocessing"
:
"y"
},
"selectIdeaNode"
:
{
"id"
:
"selectIdeaNode"
,
"type"
:
"Div"
,
"defaultValue"
:
{
"code"
:
""
,
"html"
:
""
},
"isSaved"
:
true
,
"pid"
:
"1ba2edfb-8d28-4058-9d76-4f9d53f5e613selectIdeaNode"
,
"moduleName"
:
"div"
,
"recoveryStyles"
:
{
"background-color"
:
"#eee"
,
"max-height"
:
"200px"
,
"clear"
:
"both"
,
"overflow"
:
"hidden"
},
"preprocessing"
:
"y"
},
"selectIdeaAreaNode"
:
{
"id"
:
"selectIdeaAreaNode"
,
"type"
:
"Div"
,
"defaultValue"
:
{
"code"
:
""
,
"html"
:
""
},
"isSaved"
:
true
,
"pid"
:
"1ba2edfb-8d28-4058-9d76-4f9d53f5e613selectIdeaAreaNode"
,
"moduleName"
:
"div"
,
"recoveryStyles"
:
{
"overflow"
:
"auto"
,
"max-height"
:
"200px"
},
"preprocessing"
:
"y"
},
"orgsArea"
:
{
"id"
:
"orgsArea"
,
"type"
:
"Div"
,
"defaultValue"
:
{
"code"
:
""
,
"html"
:
""
},
"isSaved"
:
true
,
"pid"
:
"1ba2edfb-8d28-4058-9d76-4f9d53f5e613orgsArea"
,
"moduleName"
:
"div"
,
"preprocessing"
:
"y"
},
"submitButtonNode"
:
{
"id"
:
"submitButtonNode"
,
"type"
:
"Div"
,
"defaultValue"
:
{
"code"
:
""
,
"html"
:
""
},
"isSaved"
:
true
,
"pid"
:
"1ba2edfb-8d28-4058-9d76-4f9d53f5e613submitButtonNode"
,
"moduleName"
:
"div"
,
"recoveryStyles"
:
{
"height"
:
"50px"
,
"overflow"
:
"hidden"
,
"clear"
:
"both"
,
"margin-top"
:
"10px"
},
"preprocessing"
:
"y"
},
"routeGroupTitle"
:
{
"id"
:
"routeGroupTitle"
,
"type"
:
"Label"
,
"valueType"
:
"text"
,
"text"
:
"选择决策组"
,
"isSaved"
:
true
,
"pid"
:
"1ba2edfb-8d28-4058-9d76-4f9d53f5e613routeGroupTitle"
,
"moduleName"
:
"label"
,
"recoveryStyles"
:
{
"overflow"
:
"hidden"
,
"height"
:
"30px"
,
"line-height"
:
"30px"
,
"font-size"
:
"14px"
,
"font-weight"
:
"bold"
,
"background-color"
:
"#eeeeee"
,
"color"
:
"#333333"
,
"padding-left"
:
"20px"
},
"preprocessing"
:
"y"
},
"routeSelectorTitle"
:
{
"id"
:
"routeSelectorTitle"
,
"type"
:
"Label"
,
"valueType"
:
"text"
,
"text"
:
"选择决策"
,
"isSaved"
:
true
,
"pid"
:
"1ba2edfb-8d28-4058-9d76-4f9d53f5e613routeSelectorTitle"
,
"moduleName"
:
"label"
,
"recoveryStyles"
:
{
"overflow"
:
"hidden"
,
"height"
:
"30px"
,
"line-height"
:
"30px"
,
"font-size"
:
"14px"
,
"font-weight"
:
"bold"
,
"background-color"
:
"#eeeeee"
,
"color"
:
"#333333"
,
"padding-left"
:
"20px"
},
"preprocessing"
:
"y"
},
"routeOpinionTile"
:
{
"id"
:
"routeOpinionTile"
,
"type"
:
"Label"
,
"valueType"
:
"text"
,
"text"
:
"填写意见"
,
"isSaved"
:
true
,
"pid"
:
"1ba2edfb-8d28-4058-9d76-4f9d53f5e613routeOpinionTile"
,
"moduleName"
:
"label"
,
"recoveryStyles"
:
{
"overflow"
:
"hidden"
,
"height"
:
"30px"
,
"line-height"
:
"30px"
,
"font-size"
:
"14px"
,
"font-weight"
:
"bold"
,
"background-color"
:
"#eeeeee"
,
"color"
:
"#333333"
,
"padding-left"
:
"20px"
},
"preprocessing"
:
"y"
},
"orgsTile"
:
{
"id"
:
"orgsTile"
,
"type"
:
"Label"
,
"valueType"
:
"text"
,
"text"
:
"选择人员"
,
"isSaved"
:
true
,
"pid"
:
"1ba2edfb-8d28-4058-9d76-4f9d53f5e613orgsTile"
,
"moduleName"
:
"label"
,
"recoveryStyles"
:
{
"overflow"
:
"hidden"
,
"height"
:
"30px"
,
"line-height"
:
"30px"
,
"font-size"
:
"14px"
,
"font-weight"
:
"bold"
,
"background-color"
:
"#eeeeee"
,
"color"
:
"#333333"
,
"padding-left"
:
"20px"
},
"preprocessing"
:
"y"
},
"okButton"
:
{
"id"
:
"okButton"
,
"type"
:
"Div"
,
"defaultValue"
:
{
"code"
:
""
,
"html"
:
""
},
"isSaved"
:
true
,
"pid"
:
"1ba2edfb-8d28-4058-9d76-4f9d53f5e613div"
,
"moduleName"
:
"div"
,
"recoveryStyles"
:
{
"width"
:
"45%"
,
"height"
:
"3em"
,
"float"
:
"left"
,
"margin-left"
:
"0.5em"
,
"color"
:
"#ffffff"
,
"background"
:
"#3296FA"
,
"border-radius"
:
"5px"
,
"border"
:
"1px solid #3296FA"
},
"preprocessing"
:
"y"
},
"cancelButton"
:
{
"id"
:
"cancelButton"
,
"type"
:
"Div"
,
"defaultValue"
:
{
"code"
:
""
,
"html"
:
""
},
"isSaved"
:
true
,
"pid"
:
"1ba2edfb-8d28-4058-9d76-4f9d53f5e613div"
,
"moduleName"
:
"div"
,
"recoveryStyles"
:
{
"width"
:
"45%"
,
"height"
:
"3em"
,
"float"
:
"right"
,
"margin-right"
:
"0.5em"
,
"background"
:
"#ffffff"
,
"border-radius"
:
"5px"
,
"border"
:
"1px solid #dfdfdf"
},
"preprocessing"
:
"y"
},
"okIconNode"
:
{
"id"
:
"okIconNode"
,
"type"
:
"Div"
,
"defaultValue"
:
{
"code"
:
""
,
"html"
:
""
},
"isSaved"
:
true
,
"pid"
:
"1ba2edfb-8d28-4058-9d76-4f9d53f5e613div"
,
"moduleName"
:
"div"
,
"recoveryStyles"
:
{
"height"
:
"3em"
,
"width"
:
"3em"
,
"float"
:
"left"
,
"background"
:
"url(/x_component_process_Work/$Processor/default/ok-18.png) no-repeat center center"
},
"preprocessing"
:
"y"
},
"okTextNode"
:
{
"id"
:
"okTextNode"
,
"type"
:
"Label"
,
"valueType"
:
"text"
,
"text"
:
"确定"
,
"isSaved"
:
true
,
"pid"
:
"1ba2edfb-8d28-4058-9d76-4f9d53f5e613label"
,
"moduleName"
:
"label"
,
"recoveryStyles"
:
{
"font-size"
:
"1em"
,
"margin-left"
:
"3em"
,
"margin-right"
:
"3em"
,
"line-height"
:
"3em"
,
"text-align"
:
"center"
},
"preprocessing"
:
"y"
},
"cancelIconNode"
:
{
"id"
:
"cancelIconNode"
,
"type"
:
"Div"
,
"defaultValue"
:
{
"code"
:
""
,
"html"
:
""
},
"isSaved"
:
true
,
"pid"
:
"1ba2edfb-8d28-4058-9d76-4f9d53f5e613div"
,
"moduleName"
:
"div"
,
"recoveryStyles"
:
{
"height"
:
"3em"
,
"width"
:
"3em"
,
"float"
:
"left"
,
"background"
:
"url(/x_component_process_Work/$Processor/default/cancel-18.png) no-repeat center center"
},
"preprocessing"
:
"y"
},
"label"
:
{
"id"
:
"label"
,
"type"
:
"Label"
,
"valueType"
:
"text"
,
"text"
:
"取消"
,
"isSaved"
:
true
,
"pid"
:
"1ba2edfb-8d28-4058-9d76-4f9d53f5e613label"
,
"moduleName"
:
"label"
,
"recoveryStyles"
:
{
"font-size"
:
"1em"
,
"color"
:
"#191F25"
,
"margin-left"
:
"3em"
,
"margin-right"
:
"3em"
,
"line-height"
:
"3em"
,
"text-align"
:
"center"
},
"preprocessing"
:
"y"
},
"div_loadSubmitForm"
:
{
"id"
:
"div_loadSubmitForm"
,
"type"
:
"Div"
,
"defaultValue"
:
{
"code"
:
""
,
"html"
:
""
},
"events"
:
{
"queryLoad"
:
{
"code"
:
"MWF.xDesktop.requireApp(
\"
process.Xform
\"
,
\"
Org
\"
, null, false);
\r\n\r\n
this.define(
\"
loadProcessorMobile
\"
, function(){
\r\n
if( !this.processor ){
\r\n
this.processor = new O2ProcessorMobile(this);
\r\n
}
\r\n
this.processor.load();
\r\n
});
\r\n\r\n
this.define(
\"
popupProcessorMobile
\"
, function(){
\r\n
if( !this.processor ){
\r\n
this.processor = new O2ProcessorMobile(this);
\r\n
}
\r\n
this.processor.load();
\r\n
});
\r\n\r\n
window.O2ProcessorMobile = new Class({
\r\n
Implements: [Events],
\r\n
initialize: function (macro) {
\r\n\r\n
debugger;
\r\n\r\n
this.macro = macro;
\r\n
this.app = macro.form.app;
\r\n
this.form = this.app.appForm;
\r\n
this.task = this.form.businessData.task;
\r\n
this.appContentNode = $(document.body); //this.app.content;
\r\n\r\n
this.initConstant();
\r\n
this.getCss();
\r\n
this.getAllNode();
\r\n\r\n
// this.loadCss();
\r\n\r\n
},
\r\n
initConstant: function () {
\r\n
this.DefaultDecisionOpinionName =
\"
其它
\"
; //默认的决策组,如果当前节点有决策组,但是某些决策没有落在决策组中,那么使用默认决策组
\r\n
},
\r\n
load: function () {
\r\n
if ( this.status ===
\"
show
\"
|| this.status ===
\"
loading
\"
){
\r\n
\r\n
}else if (this.status ===
\"
closed
\"
) {
\r\n
this.node.show();
\r\n
// this.positionSeted = false; //重新设置位置
\r\n
// this.setSize( this.getCurrentRouteOrgList().length );
\r\n
this.status =
\"
show
\"
;
\r\n
} else {
\r\n
this.status =
\"
loading
\"
;
\r\n
this.container = new Element(
\"
div
\"
).inject(this.appContentNode);
\r\n
this.node.setStyles({
\r\n
\"
width
\"
:
\"
100%
\"
,
\r\n
\"
position
\"
:
\"
absolute
\"
,
\r\n
\"
z-index
\"
:
\"
101
\"\r\n
})
\r\n
this.loadContent();
\r\n
this.setEvents();
\r\n
this.node.inject(this.container);
\r\n
this.status =
\"
show
\"
;
\r\n
}
\r\n
},
\r\n
loadContent: function () {
\r\n
this.getRouteGroupList();
\r\n\r\n
var orgLength = this.getMaxOrgLength();
\r\n
if (orgLength === 0) { //流程选人数量为0
\r\n
if (this.orgsTile) {
\r\n
this.orgsTile.destroy();
\r\n
this.orgsTile = null;
\r\n
}
\r\n
if (this.orgsArea) {
\r\n
this.orgsArea.destroy();
\r\n
this.orgsArea = null;
\r\n
}
\r\n
}
\r\n\r\n
this.setOpinion(); //意见
\r\n\r\n
if (this.hasDecisionOpinion) { //有决策组
\r\n
this.setRouteGroupList();
\r\n
} else { //没有决策组
\r\n
if (this.routeGroupTitle) {
\r\n
this.routeGroupTitle.destroy();
\r\n
this.routeGroupTitle = null;
\r\n
}
\r\n
if (this.routeGroupArea) {
\r\n
this.routeGroupArea.destroy();
\r\n
this.routeGroupArea = null;
\r\n
}
\r\n
// this.routeSelectorArea.setStyles( this.css.routeSelectorArea );
\r\n
// if( this.inputOpinionNodeTd && this.selectIdeaNodeTd ){
\r\n
// this.inputOpinionNodeTd.set(
\"
width
\"
, orgLength < 2 ?
\"
60%
\"
:
\"
50%
\"
);
\r\n
// }
\r\n
this.setRouteList();
\r\n
}
\r\n
},
\r\n\r\n
getAllNode: function () {
\r\n
this.node = this.getNode(
\"
submitNode
\"
);
\r\n\r\n
this.buttonNode = this.getNode(
\"
submitButtonNode
\"
);
\r\n\r\n
this.contentWrapNode = this.getNode(
\"
submitContentWrapNode
\"
);
\r\n
this.contentNode = this.getNode(
\"
submitContentNode
\"
);
\r\n
this.contentInnerNode = this.getNode(
\"
submitContentInnerNode
\"
);
\r\n\r\n
this.routeGroupTitle = this.getNode(
\"
routeGroupTitle
\"
);
\r\n
this.routeGroupArea = this.getNode(
\"
routeGroupArea
\"
);
\r\n\r\n
this.routeSelectorTitle = this.getNode(
\"
routeSelectorTitle
\"
);
\r\n
this.routeSelectorArea = this.getNode(
\"
routeSelectorArea
\"
);
\r\n\r\n
this.selectIdeaAreaNode = this.getNode(
\"
selectIdeaAreaNode
\"
);
\r\n\r\n
this.inputOpinionNode = this.getNode(
\"
inputOpinionNode
\"
);
\r\n
this.inputTextarea = this.getNode(
\"
inputTextarea
\"
);
\r\n\r\n
this.handwritingAction = this.getNode(
\"
handwritingAction
\"
);
\r\n\r\n
this.orgsTile = this.getNode(
\"
orgsTile
\"
);
\r\n
this.orgsArea = this.getNode(
\"
orgsArea
\"
);
\r\n\r\n
this.buttonsArea = this.getNode(
\"
submitButtonNode
\"
);
\r\n
this.okButton = this.getNode(
\"
okButton
\"
);
\r\n
this.cancelButton = this.getNode(
\"
cancelButton
\"
);
\r\n
},
\r\n
setEvents: function () {
\r\n
if (this.cancelButton) {
\r\n
this.cancelButton.addEvent(
\"
click
\"
, function () {
\r\n
this.close();
\r\n
this.fireEvent(
\"
cancel
\"
);
\r\n
}.bind(this));
\r\n
}
\r\n
if (this.okButton) {
\r\n
this.okButton.addEvent(
\"
click
\"
, function (ev) {
\r\n
this.submit(ev)
\r\n
}.bind(this));
\r\n
}
\r\n
},
\r\n
getNode: function (name) {
\r\n
if (this.macro.form.get(name)) {
\r\n
return this.macro.form.get(name).node;
\r\n
}
\r\n
if (this.form.allForName[name]) {
\r\n
return this.form.allForName[name].node;
\r\n
}
\r\n
},
\r\n
setData: function (name, value) {
\r\n
var item = this.macro.form.get(name);
\r\n
return item ? item.setData(value) : null;
\r\n
},
\r\n
getData: function (name) {
\r\n
var item = this.macro.form.get(name);
\r\n
return item ? item.getData() : null;
\r\n
},
\r\n
getRouteConfigList: function () { //获取当前待办的所有路由设置
\r\n
if (!this.routeConfigList) {
\r\n
o2.Actions.get(
\"
x_processplatform_assemble_surface
\"
).listRoute({
\"
valueList
\"
: this.task.routeList}, function (json) {
\r\n
json.data.each(function (d) {
\r\n
d.selectConfigList = JSON.parse(d.selectConfig ||
\"
[]
\"
);
\r\n
}.bind(this));
\r\n
this.routeConfigList = json.data;
\r\n
}.bind(this), null, false);
\r\n
}
\r\n
return this.routeConfigList;
\r\n
},
\r\n
getRouteConfig: function (routeId) { //根据某个ID获取路由设置
\r\n
var routeList = this.getRouteConfigList();
\r\n
for (var i = 0; i < routeList.length; i++) {
\r\n
if (routeList[i].id === routeId) {
\r\n
return routeList[i];
\r\n
}
\r\n
}
\r\n
},
\r\n
getMaxOrgLength: function () { //获取当前待办下可能的最多选人组件个数
\r\n
var routeList = this.getRouteConfigList();
\r\n
var length = 0;
\r\n
routeList.each(function (route) {
\r\n
if (route.hiddenScriptText) { //如果隐藏路由,返回
\r\n
if (this.form.Macro.exec(route.hiddenScriptText, this).toString() ===
\"
true
\"
) return;
\r\n
}
\r\n
length = Math.max(length, route.selectConfigList.length);
\r\n
}.bind(this));
\r\n
return length;
\r\n
},
\r\n
getOrgConfig: function (routeId) { //获取人员选择配置
\r\n
var routeList = this.getRouteConfigList();
\r\n
for (var i = 0; i < routeList.length; i++) {
\r\n
if (routeList[i].id === routeId) {
\r\n
return routeList[i].selectConfigList;
\r\n
}
\r\n
}
\r\n
},
\r\n
getCurrentRouteSelectorList: function () { //获取当前路由的人员选择器对象
\r\n
var selectorList = [];
\r\n
var currentRoute = this.selectedRoute ? this.selectedRoute.retrieve(
\"
route
\"
) :
\"\"
;
\r\n
var orgList = this.orgItemsObject[currentRoute];
\r\n
if (!orgList) return [];
\r\n
orgList.each(function (org) {
\r\n
if (org.selector && org.selector.selector) {
\r\n
selectorList.push(org.selector.selector);
\r\n
}
\r\n
}.bind(this))
\r\n
return selectorList;
\r\n
},
\r\n
getCurrentRouteOrgList: function () { //获取当前路由的org对象
\r\n
var currentRoute = this.selectedRoute ? this.selectedRoute.retrieve(
\"
route
\"
) :
\"\"
;
\r\n
var orgList = this.orgItemsObject[currentRoute];
\r\n
return orgList || [];
\r\n
},
\r\n
getSelectorSelectedData: function (filedName) { //获取人员选择器选择的值
\r\n
var data = [];
\r\n
var orgList = this.getCurrentRouteOrgList();
\r\n
for (var i = 0; i < orgList.length; i++) {
\r\n
var org = orgList[i];
\r\n
if (org.json.name === filedName) {
\r\n
var selector = org.selector.selector;
\r\n
selector.selectedItems.each(function (item) {
\r\n
data.push(item.data)
\r\n
})
\r\n
}
\r\n
}
\r\n
return data;
\r\n
},
\r\n
getMarginY: function (node) {
\r\n
return (node.getStyle(
\"
margin-top
\"
).toInt() || 0) +
\r\n
(node.getStyle(
\"
margin-bottom
\"
).toInt() || 0);
\r\n
// (node.getStyle(
\"
padding-top
\"
).toInt() || 0 ) +
\r\n
// (node.getStyle(
\"
padding-bottom
\"
).toInt() || 0 )+
\r\n
// (node.getStyle(
\"
border-top-width
\"
).toInt() || 0 ) +
\r\n
// (node.getStyle(
\"
border-bottom-width
\"
).toInt() || 0 );
\r\n
},
\r\n
setSize: function (currentOrgLength) {
\r\n
var lines = ((currentOrgLength + 1) / 2).toInt();
\r\n\r\n
if (lines > 0) {
\r\n
this.showOrgsArea();
\r\n
} else {
\r\n
this.hideOrgsArea();
\r\n
}
\r\n\r\n
if (this.buttonsArea) {
\r\n
var bodySize = this.appContentNode.getSize();
\r\n
var nodeHeight = bodySize.y - this.getMarginY(this.node);
\r\n
this.node.setStyles({
\r\n
\"
overflow-y
\"
:
\"
hidden
\"
,
\r\n
\"
height
\"
: nodeHeight
\r\n
});
\r\n
var buttonsAreaSize = this.buttonsArea.getSize();
\r\n
this.contentNode.setStyles({
\r\n
\"
height
\"
: nodeHeight - buttonsAreaSize.y - this.getMarginY(this.buttonsArea) - this.getMarginY(this.contentNode),
\r\n
\"
overflow-y
\"
:
\"
auto
\"\r\n
})
\r\n
}
\r\n\r\n
this.fireEvent(
\"
resize
\"
);
\r\n
},
\r\n
showOrgsArea: function () {
\r\n
if (this.orgsTile) this.orgsTile.show();
\r\n
if (this.orgsArea) this.orgsArea.show();
\r\n
},
\r\n
hideOrgsArea: function () {
\r\n
if (this.orgsTile) this.orgsTile.hide();
\r\n
if (this.orgsArea) this.orgsArea.hide();
\r\n
},
\r\n\r\n
/*决策和决策组相关 开始*/
\r\n
getRouteGroupList: function () { //获取决策组并格式化成对象
\r\n
if (this.routeGroupObject) return this.routeGroupObject;
\r\n
this.routeGroupObject = {};
\r\n
this.routeGroupNameList = [];
\r\n
this.hasDecisionOpinion = false;
\r\n
var routeList = this.getRouteConfigList();
\r\n
routeList.each(function (route, i) {
\r\n\r\n
if (route.hiddenScriptText && this.form && this.form.Macro) { //如果隐藏路由,返回
\r\n
if (this.form.Macro.exec(route.hiddenScriptText, this).toString() ===
\"
true
\"
) return;
\r\n
}
\r\n\r\n
if (route.displayNameScriptText && this.form && this.form.Macro) { //如果有显示名称公式
\r\n
route.displayName = this.form.Macro.exec(route.displayNameScriptText, this);
\r\n
} else {
\r\n
route.displayName = route.name;
\r\n
}
\r\n\r\n
if (route.decisionOpinion) { //决策组名称
\r\n
this.hasDecisionOpinion = true;
\r\n
var decisionOpinionList = route.decisionOpinion.split(
\"
#
\"
);
\r\n
decisionOpinionList.each(function (decisionOption) {
\r\n
this.routeGroupNameList.combine([decisionOption]);
\r\n
var d = this.splitByStartNumber(decisionOption);
\r\n
if (!this.routeGroupObject[d.name]) this.routeGroupObject[d.name] = [];
\r\n
this.routeGroupObject[d.name].push(route);
\r\n
}.bind(this))
\r\n
} else {
\r\n
var defaultName = this.DefaultDecisionOpinionName;
\r\n
this.routeGroupNameList.combine([defaultName]);
\r\n
if (!this.routeGroupObject[defaultName]) this.routeGroupObject[defaultName] = [];
\r\n
this.routeGroupObject[defaultName].push(route);
\r\n
}
\r\n
}.bind(this));
\r\n
return this.routeGroupObject;
\r\n
},
\r\n
splitByStartNumber: function (str) {
\r\n
var obj = {
\r\n
name:
\"\"
,
\r\n
order:
\"\"\r\n
};
\r\n
for (var i = 0; i < str.length; i++) {
\r\n
if (parseInt(str.substr(i, 1)).toString() !==
\"
NaN
\"
) {
\r\n
obj.order = obj.order + str.substr(i, 1);
\r\n
} else {
\r\n
obj.name = str.substr(i, str.length);
\r\n
break;
\r\n
}
\r\n
}
\r\n
return obj;
\r\n
},
\r\n
setRouteGroupList: function () { //排序并创建决策组DOM对象
\r\n
var _self = this;
\r\n\r\n
//根据决策组的排序号进行排序
\r\n
var keys = this.routeGroupNameList;
\r\n
keys.sort(function (a, b) {
\r\n
var aIdx = parseInt(this.splitByStartNumber(a).order ||
\"
9999999
\"
);
\r\n
var bIdx = parseInt(this.splitByStartNumber(b).order ||
\"
9999999
\"
);
\r\n
return aIdx - bIdx;
\r\n
}.bind(this));
\r\n\r\n
var list = [];
\r\n
keys.each(function (k) {
\r\n
list.push(this.splitByStartNumber(k).name)
\r\n
}.bind(this));
\r\n\r\n
debugger;
\r\n\r\n
list.each(function (routeGroupName) {
\r\n
var routeList = this.routeGroupObject[routeGroupName];
\r\n
var routeGroupNode = new Element(
\"
div
\"
, {
\r\n
\"
styles
\"
: this.css.routeGroupNode,
\r\n
\"
text
\"
: routeGroupName
\r\n
}).inject(this.routeGroupArea);
\r\n
routeGroupNode.store(
\"
routeList
\"
, routeList);
\r\n
routeGroupNode.store(
\"
routeGroupName
\"
, routeGroupName);
\r\n\r\n
routeGroupNode.addEvents({
\r\n
\"
mouseover
\"
: function (e) {
\r\n
_self.overRouteGroup(this);
\r\n
},
\r\n
\"
mouseout
\"
: function (e) {
\r\n
_self.outRouteGroup(this);
\r\n
},
\r\n
\"
click
\"
: function (e) {
\r\n
_self.selectRouteGroup(this);
\r\n
}
\r\n
});
\r\n\r\n
if (keys.length === 1) { //如果决策组只有1个,则默认选中
\r\n
this.selectRouteGroup(routeGroupNode);
\r\n
} else {
\r\n
this.setSize(0);
\r\n
}
\r\n
}.bind(this))
\r\n
},
\r\n
overRouteGroup: function (node) {
\r\n
if (this.selectedRouteGroup) {
\r\n
if (this.selectedRouteGroup.get(
\"
text
\"
) != node.get(
\"
text
\"
)) {
\r\n
node.setStyles(this.css.routeGroupNode_over);
\r\n
}
\r\n
} else {
\r\n
node.setStyles(this.css.routeGroupNode_over);
\r\n
}
\r\n
},
\r\n
outRouteGroup: function (node) {
\r\n
if (this.selectedRouteGroup) {
\r\n
if (this.selectedRouteGroup.get(
\"
text
\"
) != node.get(
\"
text
\"
)) {
\r\n
node.setStyles(this.css.routeGroupNode);
\r\n
}
\r\n
} else {
\r\n
node.setStyles(this.css.routeGroupNode);
\r\n
}
\r\n
},
\r\n
selectRouteGroup: function (node) { //选中决策组执行...
\r\n
if (this.selectedRouteGroup) {
\r\n
if (this.selectedRouteGroup.get(
\"
text
\"
) != node.get(
\"
text
\"
)) {
\r\n
this.selectedRouteGroup.setStyles(this.css.routeGroupNode);
\r\n
//this.selectedRouteGroup.removeClass(
\"
mainColor_bg
\"
);
\r\n\r\n
this.selectedRouteGroup = node;
\r\n
this.selectedRouteGroup.setStyles(this.css.routeGroupNode_selected);
\r\n
//this.selectedRouteGroup.addClass(
\"
mainColor_bg
\"
);
\r\n\r\n
var routeList = this.selectedRouteGroup.retrieve(
\"
routeList
\"
);
\r\n
this.setRouteList(routeList);
\r\n\r\n
} else {
\r\n\r\n
}
\r\n
} else {
\r\n
this.selectedRouteGroup = node;
\r\n
node.setStyles(this.css.routeGroupNode_selected);
\r\n\r\n
var routeList = this.selectedRouteGroup.retrieve(
\"
routeList
\"
);
\r\n
this.setRouteList(routeList);
\r\n
}
\r\n
this.routeGroupArea.setStyle(
\"
background-color
\"
,
\"
#FFF
\"
);
\r\n
},
\r\n
setRouteList: function (routeList) { //创建决策对象
\r\n
var _self = this;
\r\n
this.routeSelectorArea.empty();
\r\n
this.selectedRoute = null;
\r\n\r\n
if (!routeList) routeList = this.getRouteConfigList();
\r\n
routeList.each(function (route, i) {
\r\n
if (route.hiddenScriptText && this.form && this.form.Macro) { //如果隐藏路由,返回
\r\n
if (this.form.Macro.exec(route.hiddenScriptText, this).toString() ===
\"
true
\"
) return;
\r\n
}
\r\n
var routeName = route.name;
\r\n
if (route.displayNameScriptText && this.form && this.form.Macro) { //如果有显示名称公式
\r\n
routeName = this.form.Macro.exec(route.displayNameScriptText, this);
\r\n
}
\r\n
var routeNode = new Element(
\"
div
\"
, {
\r\n
\"
styles
\"
: this.css.routeNode,
\r\n
\"
text
\"
: routeName
\r\n
}).inject(this.routeSelectorArea);
\r\n
routeNode.store(
\"
route
\"
, route.id);
\r\n
routeNode.store(
\"
routeName
\"
, route.name);
\r\n\r\n
routeNode.addEvents({
\r\n
\"
mouseover
\"
: function (e) {
\r\n
_self.overRoute(this);
\r\n
},
\r\n
\"
mouseout
\"
: function (e) {
\r\n
_self.outRoute(this);
\r\n
},
\r\n
\"
click
\"
: function (e) {
\r\n
_self.selectRoute(this);
\r\n
}
\r\n
});
\r\n\r\n
if (routeList.length == 1 || route.sole) { //sole表示优先路由
\r\n
this.selectRoute(routeNode);
\r\n
} else {
\r\n
this.setSize(0);
\r\n
}
\r\n\r\n
}.bind(this));
\r\n
},
\r\n
overRoute: function (node) {
\r\n
if (this.selectedRoute) {
\r\n
if (this.selectedRoute.get(
\"
text
\"
) != node.get(
\"
text
\"
)) {
\r\n
node.setStyles(this.css.routeNode_over);
\r\n
node.addClass(
\"
lightColor_bg
\"
);
\r\n
}
\r\n
} else {
\r\n
node.setStyles(this.css.routeNode_over);
\r\n
node.addClass(
\"
lightColor_bg
\"
);
\r\n
}
\r\n
},
\r\n
outRoute: function (node) {
\r\n
if (this.selectedRoute) {
\r\n
if (this.selectedRoute.get(
\"
text
\"
) != node.get(
\"
text
\"
)) {
\r\n
node.setStyles(this.css.routeNode);
\r\n
node.removeClass(
\"
lightColor_bg
\"
);
\r\n
}
\r\n
} else {
\r\n
node.setStyles(this.css.routeNode);
\r\n
node.removeClass(
\"
lightColor_bg
\"
);
\r\n
}
\r\n
},
\r\n
selectRoute: function (node) {
\r\n
if (this.selectedRoute) {
\r\n
if (this.selectedRoute.get(
\"
text
\"
) != node.get(
\"
text
\"
)) {
\r\n
this.selectedRoute.setStyles(this.css.routeNode);
\r\n
this.selectedRoute.removeClass(
\"
mainColor_bg
\"
);
\r\n\r\n
this.selectedRoute = node;
\r\n
node.setStyles(this.css.routeNode_selected);
\r\n
node.addClass(
\"
mainColor_bg
\"
);
\r\n
node.removeClass(
\"
lightColor_bg
\"
);
\r\n\r\n
} else {
\r\n
this.selectedRoute.setStyles(this.css.routeNode);
\r\n
this.selectedRoute.addClass(
\"
lightColor_bg
\"
);
\r\n
this.selectedRoute.removeClass(
\"
mainColor_bg
\"
);
\r\n\r\n
this.selectedRoute = null;
\r\n
}
\r\n
} else {
\r\n
this.selectedRoute = node;
\r\n
node.setStyles(this.css.routeNode_selected);
\r\n
node.addClass(
\"
mainColor_bg
\"
);
\r\n
node.removeClass(
\"
lightColor_bg
\"
);
\r\n
}
\r\n
this.routeSelectorArea.setStyle(
\"
background-color
\"
,
\"
#FFF
\"
);
\r\n\r\n
this.loadOrgs(this.selectedRoute ? this.selectedRoute.retrieve(
\"
route
\"
) :
\"\"
);
\r\n\r\n
if (this.form.data.json.events && this.form.data.json.events.afterSelectRoute) {
\r\n
this.form.Macro.exec(this.form.data.json.events.afterSelectRoute.code, node);
\r\n
}
\r\n\r\n
},
\r\n
/*决策和决策组相关 结束*/
\r\n\r\n
setOpinion: function () {
\r\n
if (!this.inputTextarea) return;
\r\n
if (this.handwritingAction) this.handwritingAction.addEvent(
\"
click
\"
, function () {
\r\n
window.setTimeout( function(){
\r\n
this.handwriting();
\r\n
}.bind(this), 100 )
\r\n
}.bind(this));
\r\n\r\n
if (this.selectIdeaAreaNode) {
\r\n
MWF.require(
\"
MWF.widget.UUID
\"
, function () {
\r\n
MWF.UD.getDataJson(
\"
idea
\"
, function (json) {
\r\n
if (json) {
\r\n
if (json.ideas) {
\r\n
this.setIdeaList(json.ideas);
\r\n
}
\r\n
} else {
\r\n
MWF.UD.getPublicData(
\"
idea
\"
, function (pjson) {
\r\n
if (pjson) {
\r\n
if (pjson.ideas) {
\r\n
this.setIdeaList(pjson.ideas);
\r\n
}
\r\n
}
\r\n
}.bind(this));
\r\n
}
\r\n
}.bind(this));
\r\n
}.bind(this));
\r\n
}
\r\n\r\n
},
\r\n\r\n
audioRecord: function () {
\r\n
if (!this.audioRecordNode) this.createAudioRecord();
\r\n
this.audioRecordNode.show();
\r\n
this.audioRecordNode.position({
\r\n
\"
relativeTo
\"
: this.options.mediaNode || this.node,
\r\n
\"
position
\"
:
\"
center
\"
,
\r\n
\"
edge
\"
:
\"
center
\"\r\n
});
\r\n\r\n
MWF.require(
\"
MWF.widget.AudioRecorder
\"
, function () {
\r\n
this.audioRecorder = new MWF.widget.AudioRecorder(this.audioRecordNode, {
\r\n
\"
onSave
\"
: function (blobFile) {
\r\n
this.soundFile = blobFile;
\r\n
this.audioRecordNode.hide();
\r\n
}.bind(this),
\r\n
\"
onCancel
\"
: function () {
\r\n
this.soundFile = null;
\r\n
this.audioRecordNode.hide();
\r\n
}.bind(this)
\r\n
}, null);
\r\n
}.bind(this));
\r\n
},
\r\n
createAudioRecord: function () {
\r\n
this.audioRecordNode = new Element(
\"
div
\"
, {
\"
styles
\"
: this.css.handwritingNode}).inject(this.node,
\"
after
\"
);
\r\n
var size = (this.options.mediaNode || this.node).getSize();
\r\n
var zidx = this.node.getStyle(
\"
z-index
\"
);
\r\n
this.audioRecordNode.setStyles({
\r\n
\"
height
\"
:
\"\"
+ size.y +
\"
px
\"
,
\r\n
\"
width
\"
:
\"\"
+ size.x +
\"
px
\"
,
\r\n
\"
z-index
\"
: zidx + 1
\r\n
});
\r\n
},
\r\n\r\n
handwriting: function () {
\r\n
if (!this.handwritingNode) this.createHandwriting();
\r\n
if(this.handwritingNodeMask)this.handwritingNodeMask.show();
\r\n
this.handwritingNode.show();
\r\n
this.handwritingNode.setStyles({
\r\n
\"
top
\"
:
\"
0px
\"
,
\r\n
\"
left
\"
:
\"
0px
\"\r\n
});
\r\n
},
\r\n
createHandwriting: function () {
\r\n
this.handwritingNodeMask = new Element(
\"
div.handwritingMask
\"
, {
\"
styles
\"
: this.css.handwritingMask}).inject(this.node);
\r\n\r\n
this.handwritingNode = new Element(
\"
div.handwritingNode
\"
, {
\"
styles
\"
: this.css.handwritingNode}).inject(this.node,
\"
after
\"
);
\r\n
//var size = (this.options.mediaNode || this.node).getSize();
\r\n
//var y = size.y;
\r\n
//var x = size.x;
\r\n
//兼容以前的默认高宽
\r\n\r\n
debugger;
\r\n\r\n
var bodySize = $(document.body).getSize();
\r\n
var x = bodySize.x;
\r\n
var y = bodySize.y;
\r\n\r\n
var zidx = this.node.getStyle(
\"
z-index
\"
);
\r\n
this.handwritingNode.setStyles({
\r\n
\"
height
\"
:
\"\"
+ y +
\"
px
\"
,
\r\n
\"
width
\"
:
\"\"
+ x +
\"
px
\"
,
\r\n
\"
z-index
\"
: zidx + 1
\r\n
});
\r\n
this.handwritingNode.addEvent('touchmove' , function(e){
\r\n
e.preventDefault();
\r\n
});
\r\n
this.handwritingNode.setStyles({
\r\n
\"
top
\"
:
\"
0px
\"
,
\r\n
\"
left
\"
:
\"
0px
\"\r\n
});
\r\n
this.handwritingAreaNode = new Element(
\"
div
\"
, {
\"
styles
\"
: this.css.handwritingAreaNode}).inject(this.handwritingNode);
\r\n
// this.handwritingActionNode = new Element(
\"
div
\"
, {
\r\n
//
\"
styles
\"
: this.css.handwritingActionNode,
\r\n
//
\"
text
\"
: MWF.xApplication.process.Work.LP.saveWrite
\r\n
// }).inject(this.handwritingNode);
\r\n
// var h = this.handwritingActionNode.getSize().y + this.handwritingActionNode.getStyle(
\"
margin-top
\"
).toInt() + this.handwritingActionNode.getStyle(
\"
margin-bottom
\"
).toInt();
\r\n
// h = y - h;
\r\n
// this.handwritingAreaNode.setStyle(
\"
height
\"
,
\"\"
+ h +
\"
px
\"
);
\r\n
this.handwritingAreaNode.setStyle(
\"
height
\"
,
\"\"
+ y +
\"
px
\"
);
\r\n\r\n
MWF.require(
\"
MWF.widget.Tablet
\"
, function () {
\r\n
var handWritingOptions = {
\r\n
\"
style
\"
:
\"
default
\"
,
\r\n
\"
contentWidth
\"
: 0,
\r\n
\"
contentHeight
\"
: 0,
\r\n
\"
onSave
\"
: function (base64code, base64Image, imageFile) {
\r\n
this.handwritingFile = imageFile;
\r\n
this.handwritingNode.hide();
\r\n
this.handwritingNodeMask.hide();
\r\n
// this.page.get(
\"
div_image
\"
).node.set(
\"
src
\"
,base64Image);
\r\n\r\n
}.bind(this),
\r\n
\"
onCancel
\"
: function () {
\r\n
this.handwritingFile = null;
\r\n
this.handwritingNode.hide();
\r\n
this.handwritingNodeMask.hide();
\r\n
}.bind(this)
\r\n
};
\r\n
handWritingOptions.tools = [
\r\n
\"
undo
\"
,
\r\n
\"
redo
\"
,
\"
|
\"
,
\r\n
\"
reset
\"
,
\"
|
\"
,
\r\n
\"
size
\"
,
\r\n
\"
cancel
\"\r\n
]
\r\n
this.tablet = new MWF.widget.Tablet(this.handwritingAreaNode, handWritingOptions, null);
\r\n
this.tablet.load();
\r\n
}.bind(this));
\r\n\r\n
// this.handwritingActionNode.addEvent(
\"
click
\"
, function () {
\r\n
// //this.handwritingNode.hide();
\r\n
// if (this.tablet) this.tablet.save();
\r\n
// }.bind(this));
\r\n
},
\r\n\r\n
setIdeaList: function (ideas) {
\r\n
var _self = this;
\r\n
ideas.each(function (idea) {
\r\n
new Element(
\"
div
\"
, {
\r\n
\"
styles
\"
: this.css.selectIdeaItemNode,
\r\n
\"
text
\"
: idea,
\r\n
\"
events
\"
: {
\r\n
\"
click
\"
: function () {
\r\n
if (!_self.getData(
\"
inputTextarea
\"
)) {
\r\n
_self.setData(
\"
inputTextarea
\"
, this.get(
\"
text
\"
));
\r\n
} else {
\r\n
_self.setData(
\"
inputTextarea
\"
, _self.getData(
\"
inputTextarea
\"
) +
\"
,
\"
+ this.get(
\"
text
\"
));
\r\n
}
\r\n
},
\r\n
\"
dblclick
\"
: function () {
\r\n
if (!_self.getData(
\"
inputTextarea
\"
)) {
\r\n
_self.setData(
\"
inputTextarea
\"
, this.get(
\"
text
\"
));
\r\n
} else {
\r\n
_self.setData(
\"
inputTextarea
\"
, _self.getData(
\"
inputTextarea
\"
) +
\"
,
\"
+ this.get(
\"
text
\"
));
\r\n
}
\r\n
},
\r\n
\"
mouseover
\"
: function () {
\r\n
this.setStyles(_self.css.selectIdeaItemNode_over);
\r\n
},
\r\n
\"
mouseout
\"
: function () {
\r\n
this.setStyles(_self.css.selectIdeaItemNode);
\r\n
}
\r\n
}
\r\n
}).inject(this.selectIdeaAreaNode);
\r\n
}.bind(this));
\r\n
},
\r\n
submit: function (ev) {
\r\n
if (this.hasDecisionOpinion && !this.selectedRouteGroup) {
\r\n
this.routeGroupArea.setStyle(
\"
background-color
\"
,
\"
#ffe9e9
\"
);
\r\n
MWF.xDesktop.notice(
\r\n
\"
error
\"
,
\r\n
{
\"
x
\"
:
\"
center
\"
,
\"
y
\"
:
\"
top
\"
},
\r\n
\"
请先选择决策组
\"
,
\r\n
this.routeGroupArea,
\r\n
null, //{
\"
x
\"
: 0,
\"
y
\"
: 30}
\r\n
{
\"
closeOnBoxClick
\"
: true,
\"
closeOnBodyClick
\"
: true,
\"
fixed
\"
: true,
\"
delayClose
\"
: 6000}
\r\n
);
\r\n
return false;
\r\n
}
\r\n\r\n
if (!this.selectedRoute) {
\r\n
this.routeSelectorArea.setStyle(
\"
background-color
\"
,
\"
#ffe9e9
\"
);
\r\n
new mBox.Notice({
\r\n
type:
\"
error
\"
,
\r\n
position: {
\"
x
\"
:
\"
center
\"
,
\"
y
\"
:
\"
top
\"
},
\r\n
move: false,
\r\n
target: this.routeSelectorArea,
\r\n
delayClose: 6000,
\r\n
content:
\"
请先选择决策
\"\r\n
});
\r\n
return false;
\r\n
}
\r\n
var routeName = this.selectedRoute.retrieve(
\"
routeName
\"
) || this.selectedRoute.get(
\"
text
\"
);
\r\n
var opinion = this.getData(
\"
inputTextarea
\"
);
\r\n
if (opinion === MWF.xApplication.process.Work.LP.inputText) opinion =
\"\"
;
\r\n
var medias = [];
\r\n
if (this.handwritingFile) medias.push(this.handwritingFile);
\r\n
if (this.soundFile) medias.push(this.soundFile);
\r\n
if (this.videoFile) medias.push(this.videoFile);
\r\n\r\n
var currentRouteId = this.selectedRoute.retrieve(
\"
route
\"
);
\r\n
var routeConfig = this.getRouteConfig(currentRouteId);
\r\n
if (!opinion && medias.length === 0) {
\r\n
if (routeConfig.opinionRequired == true) {
\r\n
this.inputTextarea.setStyle(
\"
background-color
\"
,
\"
#ffe9e9
\"
);
\r\n
new mBox.Notice({
\r\n
type:
\"
error
\"
,
\r\n
position: {
\"
x
\"
:
\"
center
\"
,
\"
y
\"
:
\"
top
\"
},
\r\n
move: false,
\r\n
target: this.inputTextarea,
\r\n
delayClose: 6000,
\r\n
content:
\"
请填写意见
\"\r\n
});
\r\n
return false;
\r\n
}
\r\n
}
\r\n\r\n
if (routeConfig.validationScriptText) {
\r\n
var validation = this.form.Macro.exec(routeConfig.validationScriptText, this);
\r\n
if (!validation || validation.toString() !==
\"
true
\"
) {
\r\n
if (typeOf(validation) ===
\"
string
\"
) {
\r\n
new mBox.Notice({
\r\n
type:
\"
error
\"
,
\r\n
position: {
\"
x
\"
:
\"
center
\"
,
\"
y
\"
:
\"
top
\"
},
\r\n
move: false,
\r\n
target: this.node,
\r\n
delayClose: 6000,
\r\n
content: validation
\r\n
});
\r\n
return false;
\r\n
} else {
\r\n
//
\"
路由校验失败
\"\r\n
new mBox.Notice({
\r\n
type:
\"
error
\"
,
\r\n
position: {
\"
x
\"
:
\"
center
\"
,
\"
y
\"
:
\"
top
\"
},
\r\n
move: false,
\r\n
target: this.node,
\r\n
delayClose: 6000,
\r\n
content:
\"
路由校验失败
\"\r\n
});
\r\n
return false;
\r\n
}
\r\n
}
\r\n
}
\r\n\r\n
//var array = [routeName, opinion, medias];
\r\n
//this.node.mask({
\r\n
//
\"
inject
\"
: {
\"
where
\"
:
\"
bottom
\"
,
\"
target
\"
: this.node},
\r\n
//
\"
destroyOnHide
\"
: true,
\r\n
//
\"
style
\"
: {
\r\n
//
\"
background-color
\"
:
\"
#999
\"
,
\r\n
//
\"
opacity
\"
: 0.3,
\r\n
//
\"
z-index
\"
:600
\r\n
// }
\r\n
//});
\r\n
//this.fireEvent(
\"
submit
\"
, array );
\r\n\r\n
var appendTaskOrgItem;
\r\n
if (routeConfig.type ===
\"
appendTask
\"
&& routeConfig.appendTaskIdentityType ===
\"
select
\"
) {
\r\n
if (!this.orgItems || this.orgItems.length === 0) {
\r\n
new mBox.Notice({
\r\n
type:
\"
error
\"
,
\r\n
position: {
\"
x
\"
:
\"
center
\"
,
\"
y
\"
:
\"
top
\"
},
\r\n
move: false,
\r\n
target: this.orgsArea,
\r\n
delayClose: 6000,
\r\n
content:
\"
没有配置转交人,请联系管理员
\"
//
\"
没有配置转交人,请联系管理员
\"\r\n
});
\r\n
return false;
\r\n
} else {
\r\n
appendTaskOrgItem = this.orgItems[0]
\r\n
}
\r\n
}
\r\n\r\n
if (!this.saveOrgs()) return false;
\r\n\r\n
//this.saveOrgsWithCheckEmpower( function(){
\r\n
var appandTaskIdentityList;
\r\n
if (appendTaskOrgItem) {
\r\n
appandTaskIdentityList = appendTaskOrgItem.getData();
\r\n
if (!appandTaskIdentityList || appandTaskIdentityList.length === 0) {
\r\n
new mBox.Notice({
\r\n
type:
\"
error
\"
,
\r\n
position: {
\"
x
\"
:
\"
center
\"
,
\"
y
\"
:
\"
top
\"
},
\r\n
move: false,
\r\n
target: this.orgsArea,
\r\n
delayClose: 6000,
\r\n
content:
\"
请选择转交人
\"\r\n
});
\r\n
return;
\r\n
}
\r\n
}
\r\n\r\n
if (routeConfig.validationScriptText) {
\r\n
var validation = this.form.Macro.exec(routeConfig.validationScriptText, this);
\r\n
if (!validation || validation.toString() !==
\"
true
\"
) {
\r\n
if (typeOf(validation) ===
\"
string
\"
) {
\r\n
MWF.xDesktop.notice(
\r\n
\"
error
\"
,
\r\n
{
\"
x
\"
:
\"
center
\"
,
\"
y
\"
:
\"
center
\"
},
\r\n
validation,
\r\n
this.node,
\r\n
{
\"
x
\"
: 0,
\"
y
\"
: 30},
\r\n
{
\"
closeOnBoxClick
\"
: true,
\"
closeOnBodyClick
\"
: true,
\"
fixed
\"
: true,
\"
delayClose
\"
: 6000}
\r\n
);
\r\n
return false;
\r\n
} else {
\r\n
//
\"
路由校验失败
\"\r\n
MWF.xDesktop.notice(
\r\n
\"
error
\"
,
\r\n
{
\"
x
\"
:
\"
center
\"
,
\"
y
\"
:
\"
center
\"
},
\r\n
\"
路由校验失败
\"
,
\r\n
this.node,
\r\n
{
\"
x
\"
: 0,
\"
y
\"
: 30},
\r\n
{
\"
closeOnBoxClick
\"
: true,
\"
closeOnBodyClick
\"
: true,
\"
fixed
\"
: true,
\"
delayClose
\"
: 6000}
\r\n
);
\r\n
return false;
\r\n
}
\r\n
}
\r\n
}
\r\n\r\n
this.node.mask({
\r\n
\"
inject
\"
: {
\"
where
\"
:
\"
bottom
\"
,
\"
target
\"
: this.node},
\r\n
\"
destroyOnHide
\"
: true,
\r\n
\"
style
\"
: {
\r\n
\"
background-color
\"
:
\"
#999
\"
,
\r\n
\"
opacity
\"
: 0.3,
\r\n
\"
z-index
\"
: 600
\r\n
}
\r\n
});
\r\n\r\n
// var array = [ routeName, opinion, medias, appandTaskIdentityList, this.orgItems, function(){
\r\n
// if(appendTaskOrgItem)appendTaskOrgItem.setData([]);
\r\n
// }];
\r\n\r\n
var op = this.form.getOpinion();
\r\n
var mds = op.medias;
\r\n\r\n
if (!medias || !medias.length) {
\r\n
medias = mds;
\r\n
} else {
\r\n
medias = medias.concat(mds)
\r\n
}
\r\n\r\n
this.form.submitWork(routeName, opinion, medias, function () {
\r\n
this.close();
\r\n
}.bind(this), this, null, appandTaskIdentityList, this.orgItems, function () {
\r\n
if (appendTaskOrgItem) appendTaskOrgItem.setData([]);
\r\n
this.setData(
\"
inputTextarea
\"
,
\"\"
);
\r\n
}.bind(this));
\r\n\r\n
// this.fireEvent(
\"
submit
\"
, array );
\r\n
},
\r\n\r\n
close: function () {
\r\n
this.node.setStyle(
\"
display
\"
,
\"
none
\"
);
\r\n
this.status =
\"
closed
\"
;
\r\n
},
\r\n
destroy: function () {
\r\n
// this.node.empty();
\r\n
// delete this.task;
\r\n
// delete this.node;
\r\n
// delete this.routeSelectorTile;
\r\n
// delete this.routeSelectorArea;
\r\n
// delete this.routeOpinionTile;
\r\n
// delete this.routeOpinionArea;
\r\n
// delete this.buttonsArea;
\r\n
// delete this.inputOpinionNode;
\r\n
// delete this.inputTextarea;
\r\n
// delete this.cancelButton;
\r\n
// delete this.okButton;
\r\n
},
\r\n
loadOrgs: function (route) {
\r\n
if (!this.form || !route) {
\r\n
this.hideOrgsArea();
\r\n
return;
\r\n
} else {
\r\n
this.showOrgsArea();
\r\n
}
\r\n
if (!this.orgTableObject) this.orgTableObject = {};
\r\n
if (!this.orgItemsObject) this.orgItemsObject = {};
\r\n
var isLoaded = false;
\r\n
for (var key in this.orgTableObject) {
\r\n
if (route === key) {
\r\n
this.orgTableObject[key].show();
\r\n
this.orgItems = this.orgItemsObject[key] || [];
\r\n
var data = this.getOrgConfig(route);
\r\n
isLoaded = true;
\r\n
} else {
\r\n
this.orgTableObject[key].hide();
\r\n
}
\r\n
}
\r\n
if (isLoaded) return;
\r\n\r\n
this.orgItems = [];
\r\n
this.orgItemsObject[route] = this.orgItems;
\r\n\r\n
var data = this.getOrgConfig(route);
\r\n
var routeConfig = this.getRouteConfig(route);
\r\n
var ignoreFirstOrgOldData = false; //(routeConfig.type ===
\"
appendTask
\"
&& routeConfig.appendTaskIdentityType ===
\"
select
\"
);
\r\n
this.setSize(data.length);
\r\n
if (data.length) {
\r\n
this.showOrgsArea();
\r\n\r\n
var routeOrgTable = new Element(
\"
div
\"
, {
\r\n
\"
styles
\"
: this.css.routeOrgTable
\r\n
}).inject(this.orgsArea);
\r\n
this.orgTableObject[route] = routeOrgTable;
\r\n\r\n
data.each(function (config, i) {
\r\n
var sNode = new Element(
\"
div
\"
, {
\r\n
\"
styles
\"
: this.css.routeOrgTr
\r\n
}).inject(routeOrgTable);
\r\n
this.loadOrg(sNode, config, ignoreFirstOrgOldData && i == 0)
\r\n
}.bind(this))
\r\n
} else {
\r\n
this.hideOrgsArea();
\r\n
}
\r\n\r\n
},
\r\n
loadOrg: function (container, json, position, ignoreOldData) {
\r\n
var titleNode = new Element(
\"
div.selectorTitle
\"
, {
\r\n
\"
styles
\"
: this.css.selectorTitle
\r\n
}).inject(container);
\r\n
var titleTextNode = new Element(
\"
div.selectorTitleText
\"
, {
\r\n
\"
text
\"
: json.title,
\r\n
\"
styles
\"
: this.css.selectorTitleText
\r\n
}).inject(titleNode);
\r\n\r\n
var contentNode = new Element(
\"
div.selectorContent
\"
, {
\r\n
\"
styles
\"
: this.css.selectorContent
\r\n
}).inject(container);
\r\n\r\n
var errorNode = new Element(
\"
div.selectorErrorNode
\"
, {
\r\n
\"
styles
\"
: this.css.selectorErrorNode
\r\n
}).inject(container);
\r\n\r\n
var org = new O2ProcessorMobile.Org(contentNode, this.form, json, this, {
\r\n
onSelect: function (items, data) {
\r\n
if (!data || !data.length) {
\r\n
contentNode.setStyles(this.css.selectorContent_noItem);
\r\n
} else {
\r\n
contentNode.setStyles(this.css.selectorContent);
\r\n
}
\r\n
}.bind(this)
\r\n
});
\r\n
org.ignoreOldData = ignoreOldData;
\r\n
org.errContainer = errorNode;
\r\n
org.summitDlalog = this;
\r\n
this.orgItems.push(org);
\r\n\r\n
titleNode.addEvent(
\"
click
\"
, function () {
\r\n
this.load();
\r\n
}.bind(org));
\r\n
contentNode.addEvent(
\"
click
\"
, function () {
\r\n
this.load();
\r\n
}.bind(org));
\r\n\r\n
var defaultValue = org.getValue();
\r\n
org.loadOrgWidget(defaultValue, contentNode);
\r\n
if (!defaultValue || defaultValue.length == 0) {
\r\n
{
\r\n
contentNode.setStyles(this.css.selectorContent_noItem);
\r\n
}
\r\n
}
\r\n\r\n
},
\r\n
validationOrgs: function () {
\r\n
if (!this.orgItems || !this.orgItems.length) return true;
\r\n
var flag = true;
\r\n
this.orgItems.each(function (item) {
\r\n
if (!item.validation()) flag = false;
\r\n
}.bind(this));
\r\n
return flag;
\r\n
},
\r\n
isOrgsHasEmpower: function () {
\r\n
if (!this.orgItems || !this.orgItems.length) return true;
\r\n
var flag = false;
\r\n
this.needCheckEmpowerOrg = [];
\r\n
this.orgItems.each(function (item) {
\r\n
if (item.hasEmpowerIdentity()) {
\r\n
this.needCheckEmpowerOrg.push(item);
\r\n
flag = true;
\r\n
}
\r\n
}.bind(this));
\r\n
return flag;
\r\n
},
\r\n
saveOrgs: function (keepSilent) {
\r\n
if (!this.orgItems || !this.orgItems.length) return true;
\r\n
var flag = true;
\r\n
this.orgItems.each(function (item) {
\r\n
if (!item.save(!keepSilent)) flag = false;
\r\n
}.bind(this));
\r\n
return flag;
\r\n
},
\r\n
saveOrgsWithCheckEmpower: function (callback) {
\r\n
debugger;
\r\n
if (!this.orgItems || !this.orgItems.length) {
\r\n
if (callback) callback();
\r\n
return true;
\r\n
}
\r\n
if (!this.validationOrgs()) return false;
\r\n
if (!this.isOrgsHasEmpower()) {
\r\n
if (callback) callback();
\r\n
return true;
\r\n
}
\r\n
//this.checkEmpowerMode = true;
\r\n
this.showEmpowerDlg(callback);
\r\n
},
\r\n
showEmpowerDlg: function (callback) {
\r\n\r\n
//this.needCheckEmpowerOrg.each( function(org){
\r\n
// org.saveCheckedEmpowerData();
\r\n
//}.bind(this));
\r\n\r\n
var empowerNode = new Element(
\"
div.empowerNode
\"
, {
\"
styles
\"
: this.css.empowerNode});
\r\n
var empowerTitleNode = new Element(
\"
div
\"
, {
\r\n
text:
\"
下列人员对工作进行了授权,选择后文件将发送给被授权人,取消选择后文件将发送给授权者本人
\"
,
\r\n
styles: this.css.empowerTitleNode
\r\n
}).inject(empowerNode);
\r\n\r\n
var orgs = this.needCheckEmpowerOrg;
\r\n
var len = orgs.length;
\r\n
var lines = ((len + 1) / 2).toInt();
\r\n\r\n
var empowerTable = new Element(
\"
table
\"
, {
\r\n
\"
cellspacing
\"
: 0,
\"
cellpadding
\"
: 0,
\"
border
\"
: 0,
\"
width
\"
:
\"
100%
\"
,
\r\n
\"
styles
\"
: this.css.empowerTable
\r\n
}).inject(empowerNode);
\r\n\r\n
for (var n = 0; n < lines; n++) {
\r\n
var tr = new Element(
\"
tr
\"
).inject(empowerTable);
\r\n
new Element(
\"
td
\"
, {
\"
width
\"
:
\"
50%
\"
,
\"
styles
\"
: this.css.empowerOddTd}).inject(tr);
\r\n
new Element(
\"
td
\"
, {
\"
width
\"
:
\"
50%
\"
,
\"
styles
\"
: this.css.empowerEvenTd}).inject(tr);
\r\n
}
\r\n\r\n
var trs = empowerTable.getElements(
\"
tr
\"
);
\r\n
orgs.each(function (org, i) {
\r\n
var sNode;
\r\n
var width;
\r\n
if (i + 1 == len && (len % 2 === 1)) {
\r\n
sNode = trs[trs.length - 1].getFirst(
\"
td
\"
);
\r\n
sNode.set(
\"
colspan
\"
, 2);
\r\n
trs[trs.length - 1].getLast(
\"
td
\"
).destroy();
\r\n
width =
\"
50%
\"
;
\r\n
} else {
\r\n
var row = ((i + 2) / 2).toInt();
\r\n
var tr = trs[row - 1];
\r\n
sNode = (i % 2 === 0) ? tr.getFirst(
\"
td
\"
) : tr.getLast(
\"
td
\"
);
\r\n
}
\r\n\r\n
var titleNode = new Element(
\"
div.empowerAreaTitle
\"
, {
\r\n
\"
styles
\"
: this.css.empowerAreaTitle
\r\n
}).inject(sNode);
\r\n\r\n
var titleTextNode = new Element(
\"
div.empowerAreaTitleText
\"
, {
\r\n
\"
text
\"
: org.json.title,
\r\n
\"
styles
\"
: this.css.empowerAreaTitleText
\r\n
}).inject(titleNode);
\r\n\r\n
var selectAllNode = new Element(
\"
div
\"
, {
\r\n
styles: {
\r\n
float:
\"
right
\"\r\n
}
\r\n
}).inject(titleNode);
\r\n\r\n
var contentNode = new Element(
\"
div.empowerAreaContent
\"
, {
\r\n
\"
styles
\"
: this.css.empowerAreaContent
\r\n
}).inject(sNode);
\r\n\r\n
org.loadCheckEmpower(null, contentNode, selectAllNode);
\r\n\r\n
}.bind(this));
\r\n\r\n
empowerNode.setStyle(
\"
height
\"
, lines * this.options.orgHeight + 20);
\r\n
//var dlgHeight = Math.min( Math.floor( this.form.app.content.getSize().y * 0.9) , lines*this.options.orgHeight + 151 );
\r\n\r\n
//var width = this.node.retrieve(
\"
width
\"
);
\r\n
//empowerNode.setStyle(
\"
width
\"
, width );
\r\n
var width =
\"
880
\"
;
\r\n
//if( len > 1 ){
\r\n
// width =
\"
840
\"\r\n
//}else{
\r\n
// width =
\"
420
\"\r\n
//}
\r\n
empowerNode.setStyle(
\"
width
\"
, width +
\"
px
\"
);
\r\n\r\n
this.node.getParent().mask({
\r\n
\"
style
\"
: this.css.mask
\r\n
});
\r\n
this.empowerDlg = o2.DL.open({
\r\n
\"
title
\"
:
\"
授权人员替换选择
\"
,
\r\n
\"
style
\"
: this.form.json.dialogStyle ||
\"
user
\"
,
\r\n
\"
isResize
\"
: false,
\r\n
\"
content
\"
: empowerNode,
\r\n
//
\"
container
\"
: this.node,
\r\n
\"
width
\"
: width, //600,
\r\n
\"
height
\"
:
\"
auto
\"
, //dlgHeight,
\r\n
\"
mark
\"
: false,
\r\n
\"
buttonList
\"
: [
\r\n
{
\r\n
\"
type
\"
:
\"
ok
\"
,
\r\n
\"
text
\"
:
\"
确定
\"
,
\r\n
\"
action
\"
: function (d, e) {
\r\n
//if (this.empowerDlg) this.empowerDlg.okButton.click();
\r\n\r\n
orgs.each(function (org, i) {
\r\n
org.saveCheckedEmpowerData(function () {
\r\n
if (i === orgs.length - 1) {
\r\n
if (callback) callback();
\r\n
this.node.getParent().unmask();
\r\n
this.empowerDlg.close();
\r\n
}
\r\n
}.bind(this))
\r\n
}.bind(this))
\r\n
}.bind(this)
\r\n
},
\r\n
{
\r\n
\"
type
\"
:
\"
cancel
\"
,
\r\n
\"
text
\"
:
\"
取消
\"
,
\r\n
\"
action
\"
: function () {
\r\n
this.node.getParent().unmask();
\r\n
this.empowerDlg.close();
\r\n
}.bind(this)
\r\n
}
\r\n
]
\r\n
});
\r\n
},
\r\n
getCss: function () {
\r\n
this.css = {
\r\n\r\n
\"
routeGroupNode
\"
: {
\r\n
\"
float
\"
:
\"
left
\"
,
\r\n
\"
margin-left
\"
:
\"
20px
\"
,
\r\n
\"
padding-left
\"
:
\"
28px
\"
,
\r\n
\"
color
\"
:
\"
#000
\"
,
\r\n
\"
background-color
\"
:
\"
#E3E3E3
\"
,
\r\n
\"
min-height
\"
:
\"
24px
\"
,
\r\n
\"
line-height
\"
:
\"
24px
\"
,
\r\n
\"
margin-top
\"
:
\"
8px
\"
,
\r\n
\"
cursor
\"
:
\"
pointer
\"
,
\r\n
\"
background
\"
:
\"
url(/x_component_process_Work/$Processor/process/route.png) no-repeat 5px center
\"\r\n
},
\r\n
\"
routeGroupNode_over
\"
: {
\r\n
\"
background-color
\"
:
\"
#E3E3E3
\"
,
\r\n
\"
background
\"
:
\"
url(/x_component_process_Work/$Processor/process/route.png) no-repeat 5px center
\"\r\n
},
\r\n
\"
routeGroupNode_selected
\"
: {
\r\n
\"
background-color
\"
:
\"
#E3E3E3
\"
,
\r\n
\"
background
\"
:
\"
url(/x_component_process_Work/$Processor/process/routegroup_selected.png) no-repeat 5px center
\"\r\n
},
\r\n\r\n
\"
routeNode
\"
: {
\r\n
\"
float
\"
:
\"
left
\"
,
\r\n
\"
margin-left
\"
:
\"
20px
\"
,
\r\n
\"
border-radius
\"
:
\"
5px
\"
,
\r\n
\"
height
\"
:
\"
24px
\"
,
\r\n
\"
line-height
\"
:
\"
24px
\"
,
\r\n
\"
margin-top
\"
:
\"
8px
\"
,
\r\n
\"
padding-left
\"
:
\"
26px
\"
,
\r\n
\"
padding-right
\"
:
\"
8px
\"
,
\r\n
\"
color
\"
:
\"
#000
\"
,
\r\n
\"
background
\"
:
\"
url(/x_component_process_Work/$Processor/process/nocheck.png) no-repeat 5px center
\"
,
\r\n
\"
background-color
\"
:
\"
#f0f0f0
\"\r\n
},
\r\n
\"
routeNode_over
\"
: {
\r\n
\"
color
\"
:
\"
#000
\"
,
\r\n
\"
background
\"
:
\"
url(/x_component_process_Work/$Processor/process/nocheck.png) no-repeat 5px center
\"
,
\r\n
\"
background-color
\"
:
\"
#e6ecf8
\"\r\n
},
\r\n
\"
routeNode_selected
\"
: {
\r\n
\"
color
\"
:
\"
#fff
\"
,
\r\n
\"
background
\"
:
\"
url(/x_component_process_Work/$Processor/process/checked.png) no-repeat 5px center
\"
,
\r\n
\"
background-color
\"
:
\"
#3296FA
\"\r\n
},
\r\n\r\n
\"
selectIdeaItemNode
\"
: {
\r\n
\"
line-height
\"
:
\"
18px
\"
,
\r\n
\"
font-size
\"
:
\"
14px
\"
,
\r\n
\"
cursor
\"
:
\"
pointer
\"
,
\r\n
\"
background-color
\"
:
\"
#FFF
\"
,
\r\n
\"
padding
\"
:
\"
4px 4px 4px 4px
\"
,
\r\n
\"
overflow
\"
:
\"
hidden
\"\r\n
},
\r\n
\"
selectIdeaItemNode_over
\"
: {
\r\n
\"
background-color
\"
:
\"
#e6ecf8
\"\r\n
},
\r\n\r\n
\"
handwritingNode
\"
: {
\r\n
\"
position
\"
:
\"
absolute
\"
,
\r\n
\"
background
\"
:
\"
#ffffff
\"\r\n
},
\r\n
\"
handwritingActionNode
\"
: {
\r\n
\"
width
\"
:
\"
70%
\"
,
\r\n
\"
min-width
\"
:
\"
100px
\"
,
\r\n
\"
height
\"
:
\"
3em
\"
,
\r\n
\"
line-height
\"
:
\"
3em
\"
,
\r\n
\"
margin
\"
:
\"
5px auto
\"
,
\r\n
\"
border-radius
\"
:
\"
5px
\"
,
\r\n
\"
border
\"
:
\"
1px solid #3296FA
\"
,
\r\n
\"
background-color
\"
:
\"
#3296FA
\"
,
\r\n
\"
text-align
\"
:
\"
center
\"
,
\r\n
\"
color
\"
:
\"
#ffffff
\"
,
\r\n
\"
font-size
\"
:
\"
16px
\"\r\n
},
\r\n\r\n
\"
inputOpinionAudioRecordAction
\"
: {
\r\n
\"
display
\"
:
\"
none
\"
,
\r\n
\"
float
\"
:
\"
right
\"
,
\r\n
\"
border
\"
:
\"
1px solid #6681a5
\"
,
\r\n
\"
border-radius
\"
:
\"
3px
\"
,
\r\n
\"
cursor
\"
:
\"
pointer
\"
,
\r\n
\"
padding-left
\"
:
\"
24px
\"
,
\r\n
\"
padding-right
\"
:
\"
5px
\"
,
\r\n
\"
margin-left
\"
:
\"
5px
\"
,
\r\n
\"
background
\"
:
\"
url(
\"
+
\"
/x_component_process_Work/$Processor/default/audioRecord.png) no-repeat 5px center
\"\r\n
},
\r\n\r\n
\"
routeOrgTable
\"
: {},
\r\n
\"
routeOrgTr
\"
: {
\r\n
\"
margin-bottom
\"
:
\"
10px
\"\r\n
},
\r\n
\"
routeOrgOddTd
\"
: {
\r\n
\"
width
\"
:
\"
50%
\"\r\n
},
\r\n
\"
routeOrgEvenTd
\"
: {
\r\n
\"
width
\"
:
\"
50%
\"
,
\r\n
\"
border-left
\"
:
\"
5px solid #ffffff
\"\r\n
},
\r\n\r\n
\"
selectorTitle
\"
: {
\r\n
\"
padding
\"
:
\"
0px 4px
\"
,
\r\n
\"
height
\"
:
\"
30px
\"
,
\r\n
\"
line-height
\"
:
\"
30px
\"
,
\r\n
\"
font-size
\"
:
\"
14px
\"
,
\r\n
//
\"
font-weight
\"
:
\"
bold
\"
,
\r\n
\"
color
\"
:
\"
#000
\"
,
\r\n
\"
cursor
\"
:
\"
pointer
\"
,
\r\n
\"
background
\"
:
\"
url(/x_component_process_Work/$Processor/mobile/arrow_right2.png) no-repeat right 10px center
\"
,
\r\n
\"
background-color
\"
:
\"
#fff
\"\r\n
},
\r\n
\"
selectorTitle_over
\"
: {
\r\n
\"
background-color
\"
:
\"
#e6ecf8
\"\r\n
},
\r\n
\"
selectorTitleText
\"
: {
\r\n
//
\"
float
\"
:
\"
left
\"\r\n
},
\r\n
\"
selectorErrorNode
\"
: {
\r\n
//
\"
float
\"
:
\"
right
\"
,
\r\n
\"
background-color
\"
:
\"
#fff
\"
,
\r\n
\"
margin-right
\"
:
\"
5px
\"
,
\r\n
\"
font-weight
\"
:
\"
normal
\"\r\n
},
\r\n
\"
selectorContent
\"
: {
\r\n
\"
overflow
\"
:
\"
hidden
\"
,
\r\n
\"
background-color
\"
:
\"
#fff
\"
,
\r\n
\"
padding
\"
:
\"
0px 5px 5px 5px
\"\r\n
},
\r\n
\"
selectorContent_noItem
\"
: {
\r\n
\"
padding
\"
:
\"
0px
\"\r\n
}
\r\n
}
\r\n\r\n
}
\r\n
});
\r\n\r\n\r\n
O2ProcessorMobile.Org = new Class({
\r\n
Implements: [Options, Events],
\r\n
options: {
\r\n
height : 240,
\r\n
moduleEvents : [
\"
queryLoadSelector
\"
,
\"
postLoadSelector
\"
,
\"
postLoadContent
\"
,
\"
queryLoadCategory
\"
,
\"
postLoadCategory
\"
,
\r\n
\"
selectCategory
\"
,
\"
unselectCategory
\"
,
\"
queryLoadItem
\"
,
\"
postLoadItem
\"
,
\"
selectItem
\"
,
\"
unselectItem
\"
,
\"
change
\"
]
\r\n
},
\r\n
initialize: function (container, form, json, processor, options) {
\r\n
this.form = form;
\r\n
this.json = json;
\r\n
this.processor = processor;
\r\n
this.container = $(container);
\r\n
this.orgAction = MWF.Actions.get(
\"
x_organization_assemble_control
\"
);
\r\n
this.setOptions(options);
\r\n
},
\r\n
load : function(){
\r\n
setTimeout( function(){ //如果有输入法界面,这个时候页面的计算不对,所以等100毫秒
\r\n
var options = this.getOptions();
\r\n
if(options){
\r\n
//this.selector = new MWF.O2Selector(this.container, options);
\r\n
this.selector = new MWF.O2Selector($(document.body), options);
\r\n
}
\r\n
}.bind(this), 100 )
\r\n
},
\r\n
_getOrgOptions: function(){
\r\n
this.selectTypeList = typeOf( this.json.selectType ) ==
\"
array
\"
? this.json.selectType : [this.json.selectType];
\r\n
if( this.selectTypeList.contains(
\"
identity
\"
) ) {
\r\n
this.identityOptions = new O2ProcessorMobile.IdentityOptions(this.form, this.json);
\r\n
}
\r\n
if( this.selectTypeList.contains(
\"
unit
\"
) ) {
\r\n
this.unitOptions = new O2ProcessorMobile.UnitOptions(this.form, this.json);
\r\n
}
\r\n
//if( this.selectTypeList.contains(
\"
group
\"
) ){
\r\n
// this.groupOptions = new MWF.APPOrg.GroupOptions( this.form, this.json );
\r\n
//}
\r\n
},
\r\n
getOptions: function(){
\r\n
var _self = this;
\r\n
this._getOrgOptions();
\r\n
if( this.selectTypeList.length === 0 )return false;
\r\n
var exclude = [];
\r\n
if( this.json.exclude ){
\r\n
var v = this.form.Macro.exec(this.json.exclude.code, this);
\r\n
exclude = typeOf(v)===
\"
array
\"
? v : [v];
\r\n
}
\r\n\r\n
var identityOpt;
\r\n
if( this.identityOptions ){
\r\n
identityOpt = this.identityOptions.getOptions();
\r\n
if (this.json.identityRange!==
\"
all
\"
){
\r\n
if ( !identityOpt.noUnit && (!identityOpt.units || !identityOpt.units.length) ){
\r\n
this.form.notice(
\"
无法确定身份的选择范围
\"
,
\"
error
\"
, this.node);
\r\n
return false;
\r\n
}
\r\n
}
\r\n
if ( !identityOpt.noUnit && this.json.dutyRange && this.json.dutyRange!==
\"
all
\"
){
\r\n
if (!identityOpt.dutys || !identityOpt.dutys.length){
\r\n
this.form.notice(
\"
无法确定职务的选择范围
\"
,
\"
error
\"
, this.node);
\r\n
return false;
\r\n
}
\r\n
}
\r\n
if( this.ignoreOldData ){
\r\n
identityOpt.values = this._computeValue() || [];
\r\n
}else{
\r\n
identityOpt.values = this.getValue();
\r\n
}
\r\n
identityOpt.exclude = exclude;
\r\n
}
\r\n\r\n
var unitOpt;
\r\n
if( this.unitOptions ){
\r\n
unitOpt = this.unitOptions.getOptions();
\r\n
if (this.json.unitRange!==
\"
all
\"
){
\r\n
if ( !unitOpt.units || !unitOpt.units.length){
\r\n
this.form.notice(
\"
无法确定组织的选择范围
\"
,
\"
error
\"
, this.node);
\r\n
return false;
\r\n
}
\r\n
}
\r\n
if( this.ignoreOldData ){
\r\n
unitOpt.values = this._computeValue() || [];
\r\n
}else{
\r\n
unitOpt.values = this.getValue();
\r\n
}
\r\n
unitOpt.exclude = exclude;
\r\n
}
\r\n\r\n
//var groupOpt;
\r\n
//if( this.groupOptions ){
\r\n
// groupOpt = this.groupOptions.getOptions();
\r\n
// groupOpt.values = (this.json.isInput) ? [] : values;
\r\n
// groupOpt.exclude = exclude;
\r\n
//}
\r\n\r\n
var defaultOpt = {
\r\n
\"
style
\"
:
\"
default
\"
,
\r\n
\"
zIndex
\"
: 3000
\r\n
};
\r\n\r\n
if( this.json.events && typeOf(this.json.events) ===
\"
object
\"
){
\r\n
Object.each(this.json.events, function(e, key){
\r\n
if (e.code){
\r\n
if (this.options.moduleEvents.indexOf(key)!==-1){
\r\n
//this.addEvent(key, function(event){
\r\n
// return this.form.Macro.fire(e.code, this, event);
\r\n
//}.bind(this));
\r\n
if( key ===
\"
postLoadSelector
\"
) {
\r\n
this.addEvent(
\"
loadSelector
\"
, function (selector) {
\r\n
return this.form.Macro.fire(e.code, selector);
\r\n
}.bind(this))
\r\n
}else if( key ===
\"
queryLoadSelector
\"
){
\r\n
defaultOpt[
\"
onQueryLoad
\"
] = function(target){
\r\n
return this.form.Macro.fire(e.code, target);
\r\n
}.bind(this)
\r\n
}else{
\r\n
defaultOpt[
\"
on
\"
+key.capitalize()] = function(target){
\r\n
return this.form.Macro.fire(e.code, target);
\r\n
}.bind(this)
\r\n
}
\r\n
}
\r\n
}
\r\n
}.bind(this));
\r\n
}
\r\n\r\n
if( this.form.json.selectorStyle ){
\r\n
defaultOpt = Object.merge( Object.clone(this.form.json.selectorStyle), defaultOpt );
\r\n
if( this.form.json.selectorStyle.style )defaultOpt.style = this.form.json.selectorStyle.style;
\r\n
}
\r\n\r\n
var mobileEvents = {
\r\n
\"
onComplete
\"
: function(items){
\r\n
this.selectOnComplete(items);
\r\n
}.bind(this),
\r\n
\"
onCancel
\"
: this.selectOnCancel.bind(this),
\r\n
\"
onClose
\"
: this.selectOnClose.bind(this)
\r\n
};
\r\n\r\n
if( this.selectTypeList.length === 1 ){
\r\n
return Object.merge(
\r\n
defaultOpt,
\r\n
{
\r\n
\"
type
\"
: this.selectTypeList[0],
\r\n
\"
onLoad
\"
: function(){
\r\n
//this 为 selector
\r\n
_self.selectOnLoad(this, this.selector )
\r\n
}
\r\n
//
\"
onComplete
\"
: function(items){
\r\n
// this.selectOnComplete(items);
\r\n
//}.bind(this),
\r\n
//
\"
onCancel
\"
: this.selectOnCancel.bind(this),
\r\n
//
\"
onClose
\"
: this.selectOnClose.bind(this)
\r\n
},
\r\n
mobileEvents,
\r\n
identityOpt || unitOpt
\r\n
)
\r\n
}else if( this.selectTypeList.length > 1 ){
\r\n
var options = {
\r\n
\"
type
\"
:
\"\"
,
\r\n
\"
types
\"
: this.selectTypeList,
\r\n
\"
onLoad
\"
: function(){
\r\n
//this 为 selector
\r\n
_self.selectOnLoad(this)
\r\n
}
\r\n
//
\"
onComplete
\"
: function(items){
\r\n
// this.selectOnComplete(items);
\r\n
//}.bind(this),
\r\n
//
\"
onCancel
\"
: this.selectOnCancel.bind(this),
\r\n
//
\"
onClose
\"
: this.selectOnClose.bind(this)
\r\n
};
\r\n
if( identityOpt ){
\r\n
options.identityOptions = Object.merge(
\r\n
defaultOpt,
\r\n
mobileEvents,
\r\n
identityOpt
\r\n
);
\r\n
}
\r\n
if( unitOpt ){
\r\n
options.unitOptions = Object.merge(
\r\n
defaultOpt,
\r\n
mobileEvents,
\r\n
unitOpt
\r\n
);
\r\n
}
\r\n
//if( groupOpt )options.groupOptions = groupOpt;
\r\n
return options;
\r\n
}
\r\n
},
\r\n
selectOnComplete: function(items){ //移动端才执行
\r\n
var array = [];
\r\n
items.each(function(item){
\r\n
array.push(item.data);
\r\n
}.bind(this));
\r\n
this.checkEmpower( array, function( data ){
\r\n
var values = [];
\r\n
data.each(function(d){
\r\n
values.push(MWF.org.parseOrgData(d, true));
\r\n
}.bind(this));
\r\n\r\n
this.setData(values);
\r\n\r\n
//this.validationMode();
\r\n
//this.validation();
\r\n\r\n
this.container.empty();
\r\n
this.loadOrgWidget(values, this.container);
\r\n\r\n
this.selector = null;
\r\n\r\n
this.fireEvent(
\"
select
\"
, [items, values]);
\r\n
}.bind(this))
\r\n
},
\r\n
selectOnCancel: function(){ //移动端才执行
\r\n
//this.validation();
\r\n
},
\r\n
selectOnLoad: function( selector ){
\r\n
//if (this.descriptionNode) this.descriptionNode.setStyle(
\"
display
\"
,
\"
none
\"
);
\r\n
this.fireEvent(
\"
loadSelector
\"
, [selector])
\r\n
},
\r\n
selectOnClose: function(){
\r\n
var v = this._getBusinessData();
\r\n
//if (!v || !v.length) if (this.descriptionNode) this.descriptionNode.setStyle(
\"
display
\"
,
\"
block
\"
);
\r\n
},
\r\n
loadOrgWidget: function(value, node){
\r\n
var height = node.getStyle(
\"
height
\"
).toInt();
\r\n
if (node.getStyle(
\"
overflow
\"
)===
\"
visible
\"
&& !height) node.setStyle(
\"
overflow
\"
,
\"
hidden
\"
);
\r\n
if (value && value.length){
\r\n
value.each(function(data){
\r\n
var flag = data.distinguishedName.substr(data.distinguishedName.length-1, 1);
\r\n
var copyData = Object.clone(data);
\r\n
if( this.json.displayTextScript && this.json.displayTextScript.code ){
\r\n
this.currentData = copyData;
\r\n
var displayName = this.form.Macro.exec(this.json.displayTextScript.code, this);
\r\n
if( displayName ){
\r\n
copyData.displayName = displayName;
\r\n
}
\r\n
this.currentData = null;
\r\n
}
\r\n\r\n
var widget;
\r\n
switch (flag.toLowerCase()){
\r\n
case
\"
i
\"
:
\r\n
widget = new MWF.widget.O2Identity(copyData, node, {
\"
style
\"
:
\"
xform
\"
,
\"
lazy
\"
:true});
\r\n
break;
\r\n
case
\"
p
\"
:
\r\n
widget = new MWF.widget.O2Person(copyData, node, {
\"
style
\"
:
\"
xform
\"
,
\"
lazy
\"
:true});
\r\n
break;
\r\n
case
\"
u
\"
:
\r\n
widget = new MWF.widget.O2Unit(copyData, node, {
\"
style
\"
:
\"
xform
\"
,
\"
lazy
\"
:true});
\r\n
break;
\r\n
case
\"
g
\"
:
\r\n
widget = new MWF.widget.O2Group(copyData, node, {
\"
style
\"
:
\"
xform
\"
,
\"
lazy
\"
:true});
\r\n
break;
\r\n
default:
\r\n
widget = new MWF.widget.O2Other(copyData, node, {
\"
style
\"
:
\"
xform
\"
,
\"
lazy
\"
:true});
\r\n
}
\r\n
widget.field = this;
\r\n
}.bind(this));
\r\n
}
\r\n
},
\r\n\r\n
hasEmpowerIdentity : function(){
\r\n
var data = this.getData();
\r\n
if(!this.empowerChecker )this.empowerChecker = new O2ProcessorMobile.EmpowerChecker(this.form, this.json, this.processor);
\r\n
return this.empowerChecker.hasEmpowerIdentity( data );
\r\n
},
\r\n
checkEmpower : function( data, callback, container, selectAllNode ){
\r\n
if( typeOf(data)===
\"
array
\"
&& this.identityOptions && this.json.isCheckEmpower && this.json.identityResultType ===
\"
identity
\"
) {
\r\n
if(!this.empowerChecker )this.empowerChecker = new O2ProcessorMobile.EmpowerChecker(this.form, this.json, this.processor);
\r\n
this.empowerChecker.selectAllNode = selectAllNode;
\r\n
this.empowerChecker.load(data, callback, container);
\r\n
}else{
\r\n
if( callback )callback( data );
\r\n
}
\r\n
},
\r\n\r\n
loadCheckEmpower : function( callback, container, selectAllNode ){
\r\n
this.checkEmpower( this.getData(), callback, container, selectAllNode)
\r\n
},
\r\n
saveCheckedEmpowerData:function( callback ){
\r\n
var data = this.getData();
\r\n
//this.empowerChecker.replaceEmpowerIdentity(data, function( newData ){
\r\n
this.empowerChecker.setIgnoreEmpowerFlag(data, function( newData ){
\r\n
var values = [];
\r\n
newData.each(function(d){
\r\n
values.push(MWF.org.parseOrgData(d, true));
\r\n
}.bind(this));
\r\n
this.setData( values );
\r\n
if( callback )callback(values)
\r\n
}.bind(this))
\r\n
},
\r\n\r\n
save: function( isValid ){
\r\n
if( isValid ){
\r\n
if( this.validation() ){
\r\n
return true;
\r\n
}else{
\r\n
return false;
\r\n
}
\r\n
}else{
\r\n
this.setData( this.getData() );
\r\n
return true;
\r\n
}
\r\n
},
\r\n\r\n
resetSelectorData : function(){
\r\n
if( this.selector && this.selector.selector ){
\r\n
this.selector.selector.emptySelectedItems();
\r\n
this.selector.selector.options.values = this.getValue();
\r\n
this.selector.selector.setSelectedItem();
\r\n
}
\r\n
},
\r\n
resetData: function(){
\r\n
var v = this.getValue();
\r\n
//this.setData((v) ? v.join(
\"
,
\"
) :
\"\"
);
\r\n
this.setData(v);
\r\n
},
\r\n
getData: function(){
\r\n
if( this.selector && !layout.mobile ){
\r\n
return this.getSelectedData();
\r\n
}else{
\r\n
return this.getValue();
\r\n
}
\r\n
},
\r\n
getSelectedData : function(){
\r\n
return this.getValue();
\r\n
},
\r\n
getValue: function(){
\r\n
var value = this._getBusinessData();
\r\n
if (!value) value = this._computeValue();
\r\n
return value ||
\"\"
;
\r\n
},
\r\n
_computeValue: function(){
\r\n
var values = [];
\r\n
if (this.json.identityValue) {
\r\n
this.json.identityValue.each(function(v){ if (v) values.push(v)});
\r\n
}
\r\n
if (this.json.unitValue) {
\r\n
this.json.unitValue.each(function(v){ if (v) values.push(v)});
\r\n
}
\r\n
if (this.json.dutyValue) {
\r\n
var dutys = JSON.decode(this.json.dutyValue);
\r\n
var par;
\r\n
if (dutys.length){
\r\n
dutys.each(function(duty){
\r\n
if (duty.code) par = this.form.Macro.exec(duty.code, this);
\r\n
var code =
\"
return this.org.getDuty(
\\\"\"
+duty.name+
\"\\\"
,
\\\"\"
+par+
\"\\\"
)
\"
;
\r\n\r\n
var d = this.form.Macro.exec(code, this);
\r\n
if (typeOf(d)!==
\"
array
\"
) d = (d) ? [d.toString()] : [];
\r\n
d.each(function(dd){if (dd) values.push(dd);});
\r\n\r\n
}.bind(this));
\r\n
}
\r\n
}
\r\n
if (this.json.defaultValue && this.json.defaultValue.code){
\r\n
var fd = this.form.Macro.exec(this.json.defaultValue.code, this);
\r\n
if (typeOf(fd)!==
\"
array
\"
) fd = (fd) ? [fd] : [];
\r\n
fd.each(function(fdd){
\r\n
if (fdd){
\r\n
if (typeOf(fdd)===
\"
string
\"
){
\r\n
var data;
\r\n
this.getOrgAction()[this.getValueMethod(fdd)](function(json){ data = json.data }.bind(this), null, fdd, false);
\r\n
values.push(data);
\r\n
}else{
\r\n
values.push(fdd);
\r\n
}
\r\n
}
\r\n
}.bind(this));
\r\n
}
\r\n
if (this.json.count>0){
\r\n
return values.slice(0, this.json.count);
\r\n
}
\r\n
return values;
\r\n
//return (this.json.defaultValue.code) ? this.form.Macro.exec(this.json.defaultValue.code, this): (value ||
\"\"
);
\r\n
},
\r\n
getOrgAction: function(){
\r\n
if (!this.orgAction) this.orgAction = MWF.Actions.get(
\"
x_organization_assemble_control
\"
);
\r\n
//if (!this.orgAction) this.orgAction = new MWF.xApplication.Selector.Actions.RestActions();
\r\n
return this.orgAction;
\r\n
},
\r\n
setData: function(value){
\r\n\r\n
if (!value) return false;
\r\n
var oldValues = this.getValue();
\r\n
var values = [];
\r\n\r\n
var type = typeOf(value);
\r\n
if (type===
\"
array
\"
){
\r\n
value.each(function(v){
\r\n
var vtype = typeOf(v);
\r\n
var data = null;
\r\n
if (vtype===
\"
string
\"
){
\r\n
this.getOrgAction()[this.getValueMethod(v)](function(json){ data = MWF.org.parseOrgData(json.data, true); }.bind(this), error, v, false);
\r\n
}
\r\n
if (vtype===
\"
object
\"
) {
\r\n
data = MWF.org.parseOrgData(v, true);
\r\n
if(data.woPerson)delete data.woPerson;
\r\n
}
\r\n
if (data)values.push(data);
\r\n
}.bind(this));
\r\n
}
\r\n
if (type===
\"
string
\"
){
\r\n
var vData;
\r\n
this.getOrgAction()[this.getValueMethod(value)](function(json){ vData = MWF.org.parseOrgData(json.data, true); }.bind(this), error, value, false);
\r\n
if (vData)values.push(vData);
\r\n
}
\r\n
if (type===
\"
object
\"
){
\r\n
var vData = MWF.org.parseOrgData(value, true);
\r\n
if(vData.woPerson)delete vData.woPerson;
\r\n
values.push( vData );
\r\n
}
\r\n\r\n
var change = false;
\r\n
if (oldValues.length && values.length){
\r\n
if (oldValues.length === values.length){
\r\n
for (var i=0; i<oldValues.length; i++){
\r\n
if ((oldValues[i].distinguishedName!==values[i].distinguishedName) || (oldValues[i].name!==values[i].name) || (oldValues[i].unique!==values[i].unique)){
\r\n
change = true;
\r\n
break;
\r\n
}
\r\n
}
\r\n
}else{
\r\n
change = true;
\r\n
}
\r\n
}else if (values.length || oldValues.length) {
\r\n
change = true;
\r\n
}
\r\n
this._setBusinessData(values);
\r\n
if (change) this.fireEvent(
\"
change
\"
);
\r\n
},
\r\n\r\n
getValueMethod: function(value){
\r\n
if (value){
\r\n
var flag = value.substr(value.length-1, 1);
\r\n
switch (flag.toLowerCase()){
\r\n
case
\"
i
\"
:
\r\n
return
\"
getIdentity
\"
;
\r\n
case
\"
p
\"
:
\r\n
return
\"
getPerson
\"
;
\r\n
case
\"
u
\"
:
\r\n
return
\"
getUnit
\"
;
\r\n
case
\"
g
\"
:
\r\n
return
\"
getGroup
\"
;
\r\n
default:
\r\n
return (this.json.selectType===
\"
unit
\"
) ?
\"
getUnit
\"
:
\"
getIdentity
\"
;
\r\n
}
\r\n
}
\r\n
return (this.json.selectType===
\"
unit
\"
) ?
\"
getUnit
\"
:
\"
getIdentity
\"
;
\r\n
},
\r\n\r\n
_getBusinessData: function(){
\r\n
if (this.json.section==
\"
yes
\"
){
\r\n
return this._getBusinessSectionData();
\r\n
}else {
\r\n
if (this.json.type===
\"
Opinion
\"
){
\r\n
return this._getBusinessSectionDataByPerson();
\r\n
}else{
\r\n
return this.form.businessData.data[this.json.name] ||
\"\"
;
\r\n
}
\r\n
}
\r\n
},
\r\n
_getBusinessSectionData: function(){
\r\n
switch (this.json.sectionBy){
\r\n
case
\"
person
\"
:
\r\n
return this._getBusinessSectionDataByPerson();
\r\n
case
\"
unit
\"
:
\r\n
return this._getBusinessSectionDataByUnit();
\r\n
case
\"
activity
\"
:
\r\n
return this._getBusinessSectionDataByActivity();
\r\n
case
\"
splitValue
\"
:
\r\n
return this._getBusinessSectionDataBySplitValue();
\r\n
case
\"
script
\"
:
\r\n
return this._getBusinessSectionDataByScript(this.json.sectionByScript.code);
\r\n
default:
\r\n
return this.form.businessData.data[this.json.name] ||
\"\"
;
\r\n
}
\r\n
},
\r\n
_getBusinessSectionDataByPerson: function(){
\r\n
this.form.sectionListObj[this.json.name] = layout.desktop.session.user.id;
\r\n
var dataObj = this.form.businessData.data[this.json.name];
\r\n
return (dataObj) ? (dataObj[layout.desktop.session.user.id] ||
\"\"
) :
\"\"
;
\r\n
},
\r\n
_getBusinessSectionDataByUnit: function(){
\r\n
this.form.sectionListObj[this.json.name] =
\"\"
;
\r\n
var key = (this.form.businessData.task) ? this.form.businessData.task.unit :
\"\"
;
\r\n
if (key) this.form.sectionListObj[this.json.name] = key;
\r\n
var dataObj = this.form.businessData.data[this.json.name];
\r\n
if (!dataObj) return
\"\"
;
\r\n
return (key) ? (dataObj[key] ||
\"\"
) :
\"\"
;
\r\n
},
\r\n
_getBusinessSectionDataByActivity: function(){
\r\n
this.form.sectionListObj[this.json.name] =
\"\"
;
\r\n
var key = (this.form.businessData.work) ? this.form.businessData.work.activity :
\"\"
;
\r\n
if (key) this.form.sectionListObj[this.json.name] = key;
\r\n
var dataObj = this.form.businessData.data[this.json.name];
\r\n
if (!dataObj) return
\"\"
;
\r\n
return (key) ? (dataObj[key] ||
\"\"
) :
\"\"
;
\r\n
},
\r\n
_getBusinessSectionDataBySplitValue: function(){
\r\n
this.form.sectionListObj[this.json.name] =
\"\"
;
\r\n
var key = (this.form.businessData.work) ? this.form.businessData.work.splitValue :
\"\"
;
\r\n
if (key) this.form.sectionListObj[this.json.name] = key;
\r\n
var dataObj = this.form.businessData.data[this.json.name];
\r\n
if (!dataObj) return
\"\"
;
\r\n
return (key) ? (dataObj[key] ||
\"\"
) :
\"\"
;
\r\n
},
\r\n
_getBusinessSectionDataByScript: function(code){
\r\n
this.form.sectionListObj[this.json.name] =
\"\"
;
\r\n
var dataObj = this.form.businessData.data[this.json.name];
\r\n
if (!dataObj) return
\"\"
;
\r\n
var key = this.form.Macro.exec(code, this);
\r\n
if (key) this.form.sectionListObj[this.json.name] = key;
\r\n
return (key) ? (dataObj[key] ||
\"\"
) :
\"\"
;
\r\n
},
\r\n\r\n
loadPathData: function(path){
\r\n
var data = null;
\r\n
this.form.workAction.getJobDataByPath(this.form.businessData.work.job, path, function(json){
\r\n
data = json.data || null;
\r\n
}, null, false);
\r\n
return data;
\r\n
},
\r\n\r\n
_setBusinessData: function(v){
\r\n
if (this.json.section==
\"
yes
\"
){
\r\n
// var d = this.loadPathData(this.json.name);
\r\n
// if (d) this.form.businessData.data[this.json.name] = d;
\r\n
this._setBusinessSectionData(v);
\r\n
}else {
\r\n
if (this.json.type===
\"
Opinion
\"
){
\r\n
// var d = this.loadPathData(this.json.name);
\r\n
// if (d) this.form.businessData.data[this.json.name] = d;
\r\n
this._setBusinessSectionDataByPerson(v);
\r\n
}else{
\r\n
if (this.form.businessData.data[this.json.name]){
\r\n
this.form.businessData.data[this.json.name] = v;
\r\n
}else{
\r\n
this.form.businessData.data[this.json.name] = v;
\r\n
this.form.Macro.environment.setData(this.form.businessData.data);
\r\n
}
\r\n
if (this.json.isTitle) this.form.businessData.work.title = v;
\r\n
}
\r\n
}
\r\n
},
\r\n
_setBusinessSectionData: function(v){
\r\n
switch (this.json.sectionBy){
\r\n
case
\"
person
\"
:
\r\n
this._setBusinessSectionDataByPerson(v);
\r\n
break;
\r\n
case
\"
unit
\"
:
\r\n
this._setBusinessSectionDataByUnit(v);
\r\n
break;
\r\n
case
\"
activity
\"
:
\r\n
this._setBusinessSectionDataByActivity(v);
\r\n
break;
\r\n
case
\"
splitValue
\"
:
\r\n
this._setBusinessSectionDataBySplitValue(v);
\r\n
break;
\r\n
case
\"
script
\"
:
\r\n
this._setBusinessSectionDataByScript(this.json.sectionByScript.code, v);
\r\n
break;
\r\n
default:
\r\n
if (this.form.businessData.data[this.json.name]){
\r\n
this.form.businessData.data[this.json.name] = v;
\r\n
}else{
\r\n
this.form.businessData.data[this.json.name] = v;
\r\n
this.form.Macro.environment.setData(this.form.businessData.data);
\r\n
}
\r\n
}
\r\n
},
\r\n
_setBusinessSectionDataByPerson: function(v){
\r\n
var resetData = false;
\r\n
var key = layout.desktop.session.user.id;
\r\n
this.form.sectionListObj[this.json.name] = key;
\r\n\r\n
var dataObj = this.form.businessData.data[this.json.name];
\r\n
if (!dataObj){
\r\n
dataObj = {};
\r\n
this.form.businessData.data[this.json.name] = dataObj;
\r\n
resetData = true;
\r\n
}
\r\n
if (!dataObj[key]) resetData = true;
\r\n
dataObj[key] = v;
\r\n\r\n
if (resetData) this.form.Macro.environment.setData(this.form.businessData.data);
\r\n
},
\r\n
_setBusinessSectionDataByUnit: function(v){
\r\n
var resetData = false;
\r\n
var key = (this.form.businessData.task) ? this.form.businessData.task.unit :
\"\"
;
\r\n\r\n
if (key){
\r\n
this.form.sectionListObj[this.json.name] = key;
\r\n
var dataObj = this.form.businessData.data[this.json.name];
\r\n
if (!dataObj){
\r\n
dataObj = {};
\r\n
this.form.businessData.data[this.json.name] = dataObj;
\r\n
resetData = true;
\r\n
}
\r\n
if (!dataObj[key]) resetData = true;
\r\n
dataObj[key] = v;
\r\n
}
\r\n\r\n
if (resetData) this.form.Macro.environment.setData(this.form.businessData.data);
\r\n
},
\r\n
_setBusinessSectionDataByActivity: function(v){
\r\n
var resetData = false;
\r\n
var key = (this.form.businessData.work) ? this.form.businessData.work.activity :
\"\"
;
\r\n\r\n
if (key){
\r\n
this.form.sectionListObj[this.json.name] = key;
\r\n
var dataObj = this.form.businessData.data[this.json.name];
\r\n
if (!dataObj){
\r\n
dataObj = {};
\r\n
this.form.businessData.data[this.json.name] = dataObj;
\r\n
resetData = true;
\r\n
}
\r\n
if (!dataObj[key]) resetData = true;
\r\n
dataObj[key] = v;
\r\n
}
\r\n\r\n
if (resetData) this.form.Macro.environment.setData(this.form.businessData.data);
\r\n
},
\r\n
_setBusinessSectionDataBySplitValue: function(v){
\r\n
var resetData = false;
\r\n
var key = (this.form.businessData.work) ? this.form.businessData.work.splitValue :
\"\"
;
\r\n\r\n
if (key){
\r\n
this.form.sectionListObj[this.json.name] = key;
\r\n
var dataObj = this.form.businessData.data[this.json.name];
\r\n
if (!dataObj){
\r\n
dataObj = {};
\r\n
this.form.businessData.data[this.json.name] = dataObj;
\r\n
resetData = true;
\r\n
}
\r\n
if (!dataObj[key]) resetData = true;
\r\n
dataObj[key] = v;
\r\n
}
\r\n\r\n
if (resetData) this.form.Macro.environment.setData(this.form.businessData.data);
\r\n
},
\r\n
_setBusinessSectionDataByScript: function(code, v){
\r\n
var resetData = false;
\r\n
var key = this.form.Macro.exec(code, this);
\r\n\r\n
if (key){
\r\n
this.form.sectionListObj[this.json.name] = key;
\r\n
var dataObj = this.form.businessData.data[this.json.name];
\r\n
if (!dataObj){
\r\n
dataObj = {};
\r\n
this.form.businessData.data[this.json.name] = dataObj;
\r\n
resetData = true;
\r\n
}
\r\n
if (!dataObj[key]) resetData = true;
\r\n
dataObj[key] = v;
\r\n
}
\r\n\r\n
if (resetData) this.form.Macro.environment.setData(this.form.businessData.data);
\r\n
},
\r\n\r\n
createErrorNode: function(text){
\r\n
var node;
\r\n
if( this.processor.css.errorContentNode ){
\r\n
node = new Element(
\"
div
\"
,{
\r\n
\"
styles
\"
: this.processor.css.errorContentNode,
\r\n
\"
text
\"
: text
\r\n
});
\r\n
if( this.processor.css.errorCloseNode ){
\r\n
var closeNode = new Element(
\"
div
\"
,{
\r\n
\"
styles
\"
: this.processor.css.errorCloseNode ,
\r\n
\"
events
\"
: {
\r\n
\"
click
\"
: function(){
\r\n
this.destroy();
\r\n
}.bind(node)
\r\n
}
\r\n
}).inject(node);
\r\n
}
\r\n
}else {
\r\n
node = new Element(
\"
div
\"
);
\r\n
var iconNode = new Element(
\"
div
\"
, {
\r\n
\"
styles
\"
: {
\r\n
\"
width
\"
:
\"
20px
\"
,
\r\n
\"
height
\"
:
\"
20px
\"
,
\r\n
\"
float
\"
:
\"
left
\"
,
\r\n
\"
background
\"
:
\"
url(
\"
+
\"
/x_component_process_Xform/$Form/default/icon/error.png) center center no-repeat
\"\r\n
}
\r\n
}).inject(node);
\r\n
var textNode = new Element(
\"
div
\"
, {
\r\n
\"
styles
\"
: {
\r\n
\"
height
\"
:
\"
20px
\"
,
\r\n
\"
line-height
\"
:
\"
20px
\"
,
\r\n
\"
margin-left
\"
:
\"
20px
\"
,
\r\n
\"
color
\"
:
\"
red
\"
,
\r\n
\"
word-break
\"
:
\"
keep-all
\"\r\n
},
\r\n
\"
text
\"
: text
\r\n
}).inject(node);
\r\n
}
\r\n
return node;
\r\n
},
\r\n
notValidationMode: function(text){
\r\n
if (!this.isNotValidationMode){
\r\n
//this.isNotValidationMode = true;
\r\n
//this.node.store(
\"
borderStyle
\"
, this.node.getStyles(
\"
border-left
\"
,
\"
border-right
\"
,
\"
border-top
\"
,
\"
border-bottom
\"
));
\r\n
//this.node.setStyle(
\"
border-color
\"
,
\"
red
\"
);
\r\n\r\n
this.errNode = this.createErrorNode(text);
\r\n
if( this.errContainer ){
\r\n
this.errContainer.empty();
\r\n
this.errNode.inject(this.errContainer);
\r\n
}else{
\r\n
this.errNode.inject(this.container,
\"
after
\"
);
\r\n
}
\r\n
//this.showNotValidationMode(this.node);
\r\n
//if (!this.node.isIntoView()) this.node.scrollIntoView();
\r\n
}
\r\n
},
\r\n
validation: function(){
\r\n
var data = this.getData();
\r\n
this.setData( data );
\r\n
var flag=true;
\r\n
if( this.json.validationCount && typeOf( this.json.validationCount.toInt() ) ===
\"
number
\"
){
\r\n
if( data.length < this.json.validationCount.toInt() ){
\r\n
//if( this.json.validationCount.toInt() === 1 ){
\r\n
// flag =
\"
请选择
\"\r\n
//}else{
\r\n
// flag =
\"
请至少选择
\"
+this.json.validationCount+
\"
项
\"\r\n
//}
\r\n
flag =
\"
请至少选择
\"
+this.json.validationCount+
\"
项
\"\r\n
}
\r\n
}
\r\n\r\n
if( flag === true ){
\r\n
if ( this.json.validation && this.json.validation.code){
\r\n
flag = this.form.Macro.exec(this.json.validation.code, this);
\r\n
if (!flag) flag =
\"
数据校验未通过
\"
;
\r\n
}
\r\n
}
\r\n\r\n
if (flag.toString()!=
\"
true
\"
){
\r\n
this.notValidationMode(flag);
\r\n
return false;
\r\n
}else if(this.errNode){
\r\n
this.errNode.destroy()
\r\n
}
\r\n
return true;
\r\n
}
\r\n
});
\r\n\r\n
O2ProcessorMobile.EmpowerChecker = new Class({
\r\n
Extends : MWF.APPOrg.EmpowerChecker,
\r\n
initialize: function (form, json, processor) {
\r\n
this.form = form;
\r\n
this.json = json;
\r\n
this.processor = processor;
\r\n
this.css = this.processor.css;
\r\n
this.checkedAllItems = true;
\r\n
},
\r\n
hasEmpowerIdentity: function( data ){
\r\n
var flag = false;
\r\n
if( typeOf(data)===
\"
array
\"
&& this.json.isCheckEmpower && this.json.identityResultType ===
\"
identity
\"
) {
\r\n
var array = [];
\r\n
data.each(function (d) {
\r\n
if (d.distinguishedName) {
\r\n
var flag = d.distinguishedName.substr(d.distinguishedName.length - 1, 1).toLowerCase();
\r\n
if (flag ===
\"
i
\"
)array.push(d.distinguishedName)
\r\n
}
\r\n
}.bind(this));
\r\n
if (array.length > 0) {
\r\n
o2.Actions.get(
\"
x_organization_assemble_express
\"
).listEmpowerWithIdentity({
\r\n
\"
application
\"
: (this.form.businessData.work || this.form.businessData.workCompleted).application,
\r\n
\"
process
\"
: (this.form.businessData.work || this.form.businessData.workCompleted).process,
\r\n
\"
work
\"
: (this.form.businessData.work || this.form.businessData.workCompleted).id,
\r\n
\"
identityList
\"
: array
\r\n
}, function (json) {
\r\n
var arr = [];
\r\n
json.data.each(function (d) {
\r\n
if (d.fromIdentity !== d.toIdentity)
\r\n
arr.push(d);
\r\n
});
\r\n
if (arr.length > 0) {
\r\n
flag = true;
\r\n
}
\r\n
}.bind(this), null, false)
\r\n
}
\r\n
}
\r\n
return flag;
\r\n
},
\r\n
getSelectedData : function( callback ){
\r\n
var json = {};
\r\n
this.empowerSelectNodes.each(function(node){
\r\n
if( node.retrieve(
\"
isSelected
\"
) ){
\r\n
var d = node.retrieve(
\"
data
\"
);
\r\n
json[ d.fromIdentity ] = d;
\r\n
}
\r\n
}.bind(this));
\r\n
if( callback )callback( json );
\r\n
}
\r\n
});
\r\n\r\n
O2ProcessorMobile.UnitOptions = new Class({
\r\n
Extends : MWF.APPOrg.UnitOptions
\r\n
});
\r\n\r\n
O2ProcessorMobile.IdentityOptions = new Class({
\r\n
Extends : MWF.APPOrg.IdentityOptions
\r\n
});"
,
"html"
:
"MWF.xDesktop.requireApp(
\"
process.Xform
\"
,
\"
Org
\"
, null, false);
\r\n\r\n
this.define(
\"
loadProcessorMobile
\"
, function(){
\r\n
if( !this.processor ){
\r\n
this.processor = new O2ProcessorMobile(this);
\r\n
}
\r\n
this.processor.load();
\r\n
});
\r\n\r\n
this.define(
\"
popupProcessorMobile
\"
, function(){
\r\n
if( !this.processor ){
\r\n
this.processor = new O2ProcessorMobile(this);
\r\n
}
\r\n
this.processor.load();
\r\n
});
\r\n\r\n
window.O2ProcessorMobile = new Class({
\r\n
Implements: [Events],
\r\n
initialize: function (macro) {
\r\n\r\n
debugger;
\r\n\r\n
this.macro = macro;
\r\n
this.app = macro.form.app;
\r\n
this.form = this.app.appForm;
\r\n
this.task = this.form.businessData.task;
\r\n
this.appContentNode = $(document.body); //this.app.content;
\r\n\r\n
this.initConstant();
\r\n
this.getCss();
\r\n
this.getAllNode();
\r\n\r\n
// this.loadCss();
\r\n\r\n
},
\r\n
initConstant: function () {
\r\n
this.DefaultDecisionOpinionName =
\"
其它
\"
; //默认的决策组,如果当前节点有决策组,但是某些决策没有落在决策组中,那么使用默认决策组
\r\n
},
\r\n
load: function () {
\r\n
if ( this.status ===
\"
show
\"
|| this.status ===
\"
loading
\"
){
\r\n
\r\n
}else if (this.status ===
\"
closed
\"
) {
\r\n
this.node.show();
\r\n
// this.positionSeted = false; //重新设置位置
\r\n
// this.setSize( this.getCurrentRouteOrgList().length );
\r\n
this.status =
\"
show
\"
;
\r\n
} else {
\r\n
this.status =
\"
loading
\"
;
\r\n
this.container = new Element(
\"
div
\"
).inject(this.appContentNode);
\r\n
this.node.setStyles({
\r\n
\"
width
\"
:
\"
100%
\"
,
\r\n
\"
position
\"
:
\"
absolute
\"
,
\r\n
\"
z-index
\"
:
\"
101
\"\r\n
})
\r\n
this.loadContent();
\r\n
this.setEvents();
\r\n
this.node.inject(this.container);
\r\n
this.status =
\"
show
\"
;
\r\n
}
\r\n
},
\r\n
loadContent: function () {
\r\n
this.getRouteGroupList();
\r\n\r\n
var orgLength = this.getMaxOrgLength();
\r\n
if (orgLength === 0) { //流程选人数量为0
\r\n
if (this.orgsTile) {
\r\n
this.orgsTile.destroy();
\r\n
this.orgsTile = null;
\r\n
}
\r\n
if (this.orgsArea) {
\r\n
this.orgsArea.destroy();
\r\n
this.orgsArea = null;
\r\n
}
\r\n
}
\r\n\r\n
this.setOpinion(); //意见
\r\n\r\n
if (this.hasDecisionOpinion) { //有决策组
\r\n
this.setRouteGroupList();
\r\n
} else { //没有决策组
\r\n
if (this.routeGroupTitle) {
\r\n
this.routeGroupTitle.destroy();
\r\n
this.routeGroupTitle = null;
\r\n
}
\r\n
if (this.routeGroupArea) {
\r\n
this.routeGroupArea.destroy();
\r\n
this.routeGroupArea = null;
\r\n
}
\r\n
// this.routeSelectorArea.setStyles( this.css.routeSelectorArea );
\r\n
// if( this.inputOpinionNodeTd && this.selectIdeaNodeTd ){
\r\n
// this.inputOpinionNodeTd.set(
\"
width
\"
, orgLength < 2 ?
\"
60%
\"
:
\"
50%
\"
);
\r\n
// }
\r\n
this.setRouteList();
\r\n
}
\r\n
},
\r\n\r\n
getAllNode: function () {
\r\n
this.node = this.getNode(
\"
submitNode
\"
);
\r\n\r\n
this.buttonNode = this.getNode(
\"
submitButtonNode
\"
);
\r\n\r\n
this.contentWrapNode = this.getNode(
\"
submitContentWrapNode
\"
);
\r\n
this.contentNode = this.getNode(
\"
submitContentNode
\"
);
\r\n
this.contentInnerNode = this.getNode(
\"
submitContentInnerNode
\"
);
\r\n\r\n
this.routeGroupTitle = this.getNode(
\"
routeGroupTitle
\"
);
\r\n
this.routeGroupArea = this.getNode(
\"
routeGroupArea
\"
);
\r\n\r\n
this.routeSelectorTitle = this.getNode(
\"
routeSelectorTitle
\"
);
\r\n
this.routeSelectorArea = this.getNode(
\"
routeSelectorArea
\"
);
\r\n\r\n
this.selectIdeaAreaNode = this.getNode(
\"
selectIdeaAreaNode
\"
);
\r\n\r\n
this.inputOpinionNode = this.getNode(
\"
inputOpinionNode
\"
);
\r\n
this.inputTextarea = this.getNode(
\"
inputTextarea
\"
);
\r\n\r\n
this.handwritingAction = this.getNode(
\"
handwritingAction
\"
);
\r\n\r\n
this.orgsTile = this.getNode(
\"
orgsTile
\"
);
\r\n
this.orgsArea = this.getNode(
\"
orgsArea
\"
);
\r\n\r\n
this.buttonsArea = this.getNode(
\"
submitButtonNode
\"
);
\r\n
this.okButton = this.getNode(
\"
okButton
\"
);
\r\n
this.cancelButton = this.getNode(
\"
cancelButton
\"
);
\r\n
},
\r\n
setEvents: function () {
\r\n
if (this.cancelButton) {
\r\n
this.cancelButton.addEvent(
\"
click
\"
, function () {
\r\n
this.close();
\r\n
this.fireEvent(
\"
cancel
\"
);
\r\n
}.bind(this));
\r\n
}
\r\n
if (this.okButton) {
\r\n
this.okButton.addEvent(
\"
click
\"
, function (ev) {
\r\n
this.submit(ev)
\r\n
}.bind(this));
\r\n
}
\r\n
},
\r\n
getNode: function (name) {
\r\n
if (this.macro.form.get(name)) {
\r\n
return this.macro.form.get(name).node;
\r\n
}
\r\n
if (this.form.allForName[name]) {
\r\n
return this.form.allForName[name].node;
\r\n
}
\r\n
},
\r\n
setData: function (name, value) {
\r\n
var item = this.macro.form.get(name);
\r\n
return item ? item.setData(value) : null;
\r\n
},
\r\n
getData: function (name) {
\r\n
var item = this.macro.form.get(name);
\r\n
return item ? item.getData() : null;
\r\n
},
\r\n
getRouteConfigList: function () { //获取当前待办的所有路由设置
\r\n
if (!this.routeConfigList) {
\r\n
o2.Actions.get(
\"
x_processplatform_assemble_surface
\"
).listRoute({
\"
valueList
\"
: this.task.routeList}, function (json) {
\r\n
json.data.each(function (d) {
\r\n
d.selectConfigList = JSON.parse(d.selectConfig ||
\"
[]
\"
);
\r\n
}.bind(this));
\r\n
this.routeConfigList = json.data;
\r\n
}.bind(this), null, false);
\r\n
}
\r\n
return this.routeConfigList;
\r\n
},
\r\n
getRouteConfig: function (routeId) { //根据某个ID获取路由设置
\r\n
var routeList = this.getRouteConfigList();
\r\n
for (var i = 0; i < routeList.length; i++) {
\r\n
if (routeList[i].id === routeId) {
\r\n
return routeList[i];
\r\n
}
\r\n
}
\r\n
},
\r\n
getMaxOrgLength: function () { //获取当前待办下可能的最多选人组件个数
\r\n
var routeList = this.getRouteConfigList();
\r\n
var length = 0;
\r\n
routeList.each(function (route) {
\r\n
if (route.hiddenScriptText) { //如果隐藏路由,返回
\r\n
if (this.form.Macro.exec(route.hiddenScriptText, this).toString() ===
\"
true
\"
) return;
\r\n
}
\r\n
length = Math.max(length, route.selectConfigList.length);
\r\n
}.bind(this));
\r\n
return length;
\r\n
},
\r\n
getOrgConfig: function (routeId) { //获取人员选择配置
\r\n
var routeList = this.getRouteConfigList();
\r\n
for (var i = 0; i < routeList.length; i++) {
\r\n
if (routeList[i].id === routeId) {
\r\n
return routeList[i].selectConfigList;
\r\n
}
\r\n
}
\r\n
},
\r\n
getCurrentRouteSelectorList: function () { //获取当前路由的人员选择器对象
\r\n
var selectorList = [];
\r\n
var currentRoute = this.selectedRoute ? this.selectedRoute.retrieve(
\"
route
\"
) :
\"\"
;
\r\n
var orgList = this.orgItemsObject[currentRoute];
\r\n
if (!orgList) return [];
\r\n
orgList.each(function (org) {
\r\n
if (org.selector && org.selector.selector) {
\r\n
selectorList.push(org.selector.selector);
\r\n
}
\r\n
}.bind(this))
\r\n
return selectorList;
\r\n
},
\r\n
getCurrentRouteOrgList: function () { //获取当前路由的org对象
\r\n
var currentRoute = this.selectedRoute ? this.selectedRoute.retrieve(
\"
route
\"
) :
\"\"
;
\r\n
var orgList = this.orgItemsObject[currentRoute];
\r\n
return orgList || [];
\r\n
},
\r\n
getSelectorSelectedData: function (filedName) { //获取人员选择器选择的值
\r\n
var data = [];
\r\n
var orgList = this.getCurrentRouteOrgList();
\r\n
for (var i = 0; i < orgList.length; i++) {
\r\n
var org = orgList[i];
\r\n
if (org.json.name === filedName) {
\r\n
var selector = org.selector.selector;
\r\n
selector.selectedItems.each(function (item) {
\r\n
data.push(item.data)
\r\n
})
\r\n
}
\r\n
}
\r\n
return data;
\r\n
},
\r\n
getMarginY: function (node) {
\r\n
return (node.getStyle(
\"
margin-top
\"
).toInt() || 0) +
\r\n
(node.getStyle(
\"
margin-bottom
\"
).toInt() || 0);
\r\n
// (node.getStyle(
\"
padding-top
\"
).toInt() || 0 ) +
\r\n
// (node.getStyle(
\"
padding-bottom
\"
).toInt() || 0 )+
\r\n
// (node.getStyle(
\"
border-top-width
\"
).toInt() || 0 ) +
\r\n
// (node.getStyle(
\"
border-bottom-width
\"
).toInt() || 0 );
\r\n
},
\r\n
setSize: function (currentOrgLength) {
\r\n
var lines = ((currentOrgLength + 1) / 2).toInt();
\r\n\r\n
if (lines > 0) {
\r\n
this.showOrgsArea();
\r\n
} else {
\r\n
this.hideOrgsArea();
\r\n
}
\r\n\r\n
if (this.buttonsArea) {
\r\n
var bodySize = this.appContentNode.getSize();
\r\n
var nodeHeight = bodySize.y - this.getMarginY(this.node);
\r\n
this.node.setStyles({
\r\n
\"
overflow-y
\"
:
\"
hidden
\"
,
\r\n
\"
height
\"
: nodeHeight
\r\n
});
\r\n
var buttonsAreaSize = this.buttonsArea.getSize();
\r\n
this.contentNode.setStyles({
\r\n
\"
height
\"
: nodeHeight - buttonsAreaSize.y - this.getMarginY(this.buttonsArea) - this.getMarginY(this.contentNode),
\r\n
\"
overflow-y
\"
:
\"
auto
\"\r\n
})
\r\n
}
\r\n\r\n
this.fireEvent(
\"
resize
\"
);
\r\n
},
\r\n
showOrgsArea: function () {
\r\n
if (this.orgsTile) this.orgsTile.show();
\r\n
if (this.orgsArea) this.orgsArea.show();
\r\n
},
\r\n
hideOrgsArea: function () {
\r\n
if (this.orgsTile) this.orgsTile.hide();
\r\n
if (this.orgsArea) this.orgsArea.hide();
\r\n
},
\r\n\r\n
/*决策和决策组相关 开始*/
\r\n
getRouteGroupList: function () { //获取决策组并格式化成对象
\r\n
if (this.routeGroupObject) return this.routeGroupObject;
\r\n
this.routeGroupObject = {};
\r\n
this.routeGroupNameList = [];
\r\n
this.hasDecisionOpinion = false;
\r\n
var routeList = this.getRouteConfigList();
\r\n
routeList.each(function (route, i) {
\r\n\r\n
if (route.hiddenScriptText && this.form && this.form.Macro) { //如果隐藏路由,返回
\r\n
if (this.form.Macro.exec(route.hiddenScriptText, this).toString() ===
\"
true
\"
) return;
\r\n
}
\r\n\r\n
if (route.displayNameScriptText && this.form && this.form.Macro) { //如果有显示名称公式
\r\n
route.displayName = this.form.Macro.exec(route.displayNameScriptText, this);
\r\n
} else {
\r\n
route.displayName = route.name;
\r\n
}
\r\n\r\n
if (route.decisionOpinion) { //决策组名称
\r\n
this.hasDecisionOpinion = true;
\r\n
var decisionOpinionList = route.decisionOpinion.split(
\"
#
\"
);
\r\n
decisionOpinionList.each(function (decisionOption) {
\r\n
this.routeGroupNameList.combine([decisionOption]);
\r\n
var d = this.splitByStartNumber(decisionOption);
\r\n
if (!this.routeGroupObject[d.name]) this.routeGroupObject[d.name] = [];
\r\n
this.routeGroupObject[d.name].push(route);
\r\n
}.bind(this))
\r\n
} else {
\r\n
var defaultName = this.DefaultDecisionOpinionName;
\r\n
this.routeGroupNameList.combine([defaultName]);
\r\n
if (!this.routeGroupObject[defaultName]) this.routeGroupObject[defaultName] = [];
\r\n
this.routeGroupObject[defaultName].push(route);
\r\n
}
\r\n
}.bind(this));
\r\n
return this.routeGroupObject;
\r\n
},
\r\n
splitByStartNumber: function (str) {
\r\n
var obj = {
\r\n
name:
\"\"
,
\r\n
order:
\"\"\r\n
};
\r\n
for (var i = 0; i < str.length; i++) {
\r\n
if (parseInt(str.substr(i, 1)).toString() !==
\"
NaN
\"
) {
\r\n
obj.order = obj.order + str.substr(i, 1);
\r\n
} else {
\r\n
obj.name = str.substr(i, str.length);
\r\n
break;
\r\n
}
\r\n
}
\r\n
return obj;
\r\n
},
\r\n
setRouteGroupList: function () { //排序并创建决策组DOM对象
\r\n
var _self = this;
\r\n\r\n
//根据决策组的排序号进行排序
\r\n
var keys = this.routeGroupNameList;
\r\n
keys.sort(function (a, b) {
\r\n
var aIdx = parseInt(this.splitByStartNumber(a).order ||
\"
9999999
\"
);
\r\n
var bIdx = parseInt(this.splitByStartNumber(b).order ||
\"
9999999
\"
);
\r\n
return aIdx - bIdx;
\r\n
}.bind(this));
\r\n\r\n
var list = [];
\r\n
keys.each(function (k) {
\r\n
list.push(this.splitByStartNumber(k).name)
\r\n
}.bind(this));
\r\n\r\n
debugger;
\r\n\r\n
list.each(function (routeGroupName) {
\r\n
var routeList = this.routeGroupObject[routeGroupName];
\r\n
var routeGroupNode = new Element(
\"
div
\"
, {
\r\n
\"
styles
\"
: this.css.routeGroupNode,
\r\n
\"
text
\"
: routeGroupName
\r\n
}).inject(this.routeGroupArea);
\r\n
routeGroupNode.store(
\"
routeList
\"
, routeList);
\r\n
routeGroupNode.store(
\"
routeGroupName
\"
, routeGroupName);
\r\n\r\n
routeGroupNode.addEvents({
\r\n
\"
mouseover
\"
: function (e) {
\r\n
_self.overRouteGroup(this);
\r\n
},
\r\n
\"
mouseout
\"
: function (e) {
\r\n
_self.outRouteGroup(this);
\r\n
},
\r\n
\"
click
\"
: function (e) {
\r\n
_self.selectRouteGroup(this);
\r\n
}
\r\n
});
\r\n\r\n
if (keys.length === 1) { //如果决策组只有1个,则默认选中
\r\n
this.selectRouteGroup(routeGroupNode);
\r\n
} else {
\r\n
this.setSize(0);
\r\n
}
\r\n
}.bind(this))
\r\n
},
\r\n
overRouteGroup: function (node) {
\r\n
if (this.selectedRouteGroup) {
\r\n
if (this.selectedRouteGroup.get(
\"
text
\"
) != node.get(
\"
text
\"
)) {
\r\n
node.setStyles(this.css.routeGroupNode_over);
\r\n
}
\r\n
} else {
\r\n
node.setStyles(this.css.routeGroupNode_over);
\r\n
}
\r\n
},
\r\n
outRouteGroup: function (node) {
\r\n
if (this.selectedRouteGroup) {
\r\n
if (this.selectedRouteGroup.get(
\"
text
\"
) != node.get(
\"
text
\"
)) {
\r\n
node.setStyles(this.css.routeGroupNode);
\r\n
}
\r\n
} else {
\r\n
node.setStyles(this.css.routeGroupNode);
\r\n
}
\r\n
},
\r\n
selectRouteGroup: function (node) { //选中决策组执行...
\r\n
if (this.selectedRouteGroup) {
\r\n
if (this.selectedRouteGroup.get(
\"
text
\"
) != node.get(
\"
text
\"
)) {
\r\n
this.selectedRouteGroup.setStyles(this.css.routeGroupNode);
\r\n
//this.selectedRouteGroup.removeClass(
\"
mainColor_bg
\"
);
\r\n\r\n
this.selectedRouteGroup = node;
\r\n
this.selectedRouteGroup.setStyles(this.css.routeGroupNode_selected);
\r\n
//this.selectedRouteGroup.addClass(
\"
mainColor_bg
\"
);
\r\n\r\n
var routeList = this.selectedRouteGroup.retrieve(
\"
routeList
\"
);
\r\n
this.setRouteList(routeList);
\r\n\r\n
} else {
\r\n\r\n
}
\r\n
} else {
\r\n
this.selectedRouteGroup = node;
\r\n
node.setStyles(this.css.routeGroupNode_selected);
\r\n\r\n
var routeList = this.selectedRouteGroup.retrieve(
\"
routeList
\"
);
\r\n
this.setRouteList(routeList);
\r\n
}
\r\n
this.routeGroupArea.setStyle(
\"
background-color
\"
,
\"
#FFF
\"
);
\r\n
},
\r\n
setRouteList: function (routeList) { //创建决策对象
\r\n
var _self = this;
\r\n
this.routeSelectorArea.empty();
\r\n
this.selectedRoute = null;
\r\n\r\n
if (!routeList) routeList = this.getRouteConfigList();
\r\n
routeList.each(function (route, i) {
\r\n
if (route.hiddenScriptText && this.form && this.form.Macro) { //如果隐藏路由,返回
\r\n
if (this.form.Macro.exec(route.hiddenScriptText, this).toString() ===
\"
true
\"
) return;
\r\n
}
\r\n
var routeName = route.name;
\r\n
if (route.displayNameScriptText && this.form && this.form.Macro) { //如果有显示名称公式
\r\n
routeName = this.form.Macro.exec(route.displayNameScriptText, this);
\r\n
}
\r\n
var routeNode = new Element(
\"
div
\"
, {
\r\n
\"
styles
\"
: this.css.routeNode,
\r\n
\"
text
\"
: routeName
\r\n
}).inject(this.routeSelectorArea);
\r\n
routeNode.store(
\"
route
\"
, route.id);
\r\n
routeNode.store(
\"
routeName
\"
, route.name);
\r\n\r\n
routeNode.addEvents({
\r\n
\"
mouseover
\"
: function (e) {
\r\n
_self.overRoute(this);
\r\n
},
\r\n
\"
mouseout
\"
: function (e) {
\r\n
_self.outRoute(this);
\r\n
},
\r\n
\"
click
\"
: function (e) {
\r\n
_self.selectRoute(this);
\r\n
}
\r\n
});
\r\n\r\n
if (routeList.length == 1 || route.sole) { //sole表示优先路由
\r\n
this.selectRoute(routeNode);
\r\n
} else {
\r\n
this.setSize(0);
\r\n
}
\r\n\r\n
}.bind(this));
\r\n
},
\r\n
overRoute: function (node) {
\r\n
if (this.selectedRoute) {
\r\n
if (this.selectedRoute.get(
\"
text
\"
) != node.get(
\"
text
\"
)) {
\r\n
node.setStyles(this.css.routeNode_over);
\r\n
node.addClass(
\"
lightColor_bg
\"
);
\r\n
}
\r\n
} else {
\r\n
node.setStyles(this.css.routeNode_over);
\r\n
node.addClass(
\"
lightColor_bg
\"
);
\r\n
}
\r\n
},
\r\n
outRoute: function (node) {
\r\n
if (this.selectedRoute) {
\r\n
if (this.selectedRoute.get(
\"
text
\"
) != node.get(
\"
text
\"
)) {
\r\n
node.setStyles(this.css.routeNode);
\r\n
node.removeClass(
\"
lightColor_bg
\"
);
\r\n
}
\r\n
} else {
\r\n
node.setStyles(this.css.routeNode);
\r\n
node.removeClass(
\"
lightColor_bg
\"
);
\r\n
}
\r\n
},
\r\n
selectRoute: function (node) {
\r\n
if (this.selectedRoute) {
\r\n
if (this.selectedRoute.get(
\"
text
\"
) != node.get(
\"
text
\"
)) {
\r\n
this.selectedRoute.setStyles(this.css.routeNode);
\r\n
this.selectedRoute.removeClass(
\"
mainColor_bg
\"
);
\r\n\r\n
this.selectedRoute = node;
\r\n
node.setStyles(this.css.routeNode_selected);
\r\n
node.addClass(
\"
mainColor_bg
\"
);
\r\n
node.removeClass(
\"
lightColor_bg
\"
);
\r\n\r\n
} else {
\r\n
this.selectedRoute.setStyles(this.css.routeNode);
\r\n
this.selectedRoute.addClass(
\"
lightColor_bg
\"
);
\r\n
this.selectedRoute.removeClass(
\"
mainColor_bg
\"
);
\r\n\r\n
this.selectedRoute = null;
\r\n
}
\r\n
} else {
\r\n
this.selectedRoute = node;
\r\n
node.setStyles(this.css.routeNode_selected);
\r\n
node.addClass(
\"
mainColor_bg
\"
);
\r\n
node.removeClass(
\"
lightColor_bg
\"
);
\r\n
}
\r\n
this.routeSelectorArea.setStyle(
\"
background-color
\"
,
\"
#FFF
\"
);
\r\n\r\n
this.loadOrgs(this.selectedRoute ? this.selectedRoute.retrieve(
\"
route
\"
) :
\"\"
);
\r\n\r\n
if (this.form.data.json.events && this.form.data.json.events.afterSelectRoute) {
\r\n
this.form.Macro.exec(this.form.data.json.events.afterSelectRoute.code, node);
\r\n
}
\r\n\r\n
},
\r\n
/*决策和决策组相关 结束*/
\r\n\r\n
setOpinion: function () {
\r\n
if (!this.inputTextarea) return;
\r\n
if (this.handwritingAction) this.handwritingAction.addEvent(
\"
click
\"
, function () {
\r\n
window.setTimeout( function(){
\r\n
this.handwriting();
\r\n
}.bind(this), 100 )
\r\n
}.bind(this));
\r\n\r\n
if (this.selectIdeaAreaNode) {
\r\n
MWF.require(
\"
MWF.widget.UUID
\"
, function () {
\r\n
MWF.UD.getDataJson(
\"
idea
\"
, function (json) {
\r\n
if (json) {
\r\n
if (json.ideas) {
\r\n
this.setIdeaList(json.ideas);
\r\n
}
\r\n
} else {
\r\n
MWF.UD.getPublicData(
\"
idea
\"
, function (pjson) {
\r\n
if (pjson) {
\r\n
if (pjson.ideas) {
\r\n
this.setIdeaList(pjson.ideas);
\r\n
}
\r\n
}
\r\n
}.bind(this));
\r\n
}
\r\n
}.bind(this));
\r\n
}.bind(this));
\r\n
}
\r\n\r\n
},
\r\n\r\n
audioRecord: function () {
\r\n
if (!this.audioRecordNode) this.createAudioRecord();
\r\n
this.audioRecordNode.show();
\r\n
this.audioRecordNode.position({
\r\n
\"
relativeTo
\"
: this.options.mediaNode || this.node,
\r\n
\"
position
\"
:
\"
center
\"
,
\r\n
\"
edge
\"
:
\"
center
\"\r\n
});
\r\n\r\n
MWF.require(
\"
MWF.widget.AudioRecorder
\"
, function () {
\r\n
this.audioRecorder = new MWF.widget.AudioRecorder(this.audioRecordNode, {
\r\n
\"
onSave
\"
: function (blobFile) {
\r\n
this.soundFile = blobFile;
\r\n
this.audioRecordNode.hide();
\r\n
}.bind(this),
\r\n
\"
onCancel
\"
: function () {
\r\n
this.soundFile = null;
\r\n
this.audioRecordNode.hide();
\r\n
}.bind(this)
\r\n
}, null);
\r\n
}.bind(this));
\r\n
},
\r\n
createAudioRecord: function () {
\r\n
this.audioRecordNode = new Element(
\"
div
\"
, {
\"
styles
\"
: this.css.handwritingNode}).inject(this.node,
\"
after
\"
);
\r\n
var size = (this.options.mediaNode || this.node).getSize();
\r\n
var zidx = this.node.getStyle(
\"
z-index
\"
);
\r\n
this.audioRecordNode.setStyles({
\r\n
\"
height
\"
:
\"\"
+ size.y +
\"
px
\"
,
\r\n
\"
width
\"
:
\"\"
+ size.x +
\"
px
\"
,
\r\n
\"
z-index
\"
: zidx + 1
\r\n
});
\r\n
},
\r\n\r\n
handwriting: function () {
\r\n
if (!this.handwritingNode) this.createHandwriting();
\r\n
if(this.handwritingNodeMask)this.handwritingNodeMask.show();
\r\n
this.handwritingNode.show();
\r\n
this.handwritingNode.setStyles({
\r\n
\"
top
\"
:
\"
0px
\"
,
\r\n
\"
left
\"
:
\"
0px
\"\r\n
});
\r\n
},
\r\n
createHandwriting: function () {
\r\n
this.handwritingNodeMask = new Element(
\"
div.handwritingMask
\"
, {
\"
styles
\"
: this.css.handwritingMask}).inject(this.node);
\r\n\r\n
this.handwritingNode = new Element(
\"
div.handwritingNode
\"
, {
\"
styles
\"
: this.css.handwritingNode}).inject(this.node,
\"
after
\"
);
\r\n
//var size = (this.options.mediaNode || this.node).getSize();
\r\n
//var y = size.y;
\r\n
//var x = size.x;
\r\n
//兼容以前的默认高宽
\r\n\r\n
debugger;
\r\n\r\n
var bodySize = $(document.body).getSize();
\r\n
var x = bodySize.x;
\r\n
var y = bodySize.y;
\r\n\r\n
var zidx = this.node.getStyle(
\"
z-index
\"
);
\r\n
this.handwritingNode.setStyles({
\r\n
\"
height
\"
:
\"\"
+ y +
\"
px
\"
,
\r\n
\"
width
\"
:
\"\"
+ x +
\"
px
\"
,
\r\n
\"
z-index
\"
: zidx + 1
\r\n
});
\r\n
this.handwritingNode.addEvent('touchmove' , function(e){
\r\n
e.preventDefault();
\r\n
});
\r\n
this.handwritingNode.setStyles({
\r\n
\"
top
\"
:
\"
0px
\"
,
\r\n
\"
left
\"
:
\"
0px
\"\r\n
});
\r\n
this.handwritingAreaNode = new Element(
\"
div
\"
, {
\"
styles
\"
: this.css.handwritingAreaNode}).inject(this.handwritingNode);
\r\n
// this.handwritingActionNode = new Element(
\"
div
\"
, {
\r\n
//
\"
styles
\"
: this.css.handwritingActionNode,
\r\n
//
\"
text
\"
: MWF.xApplication.process.Work.LP.saveWrite
\r\n
// }).inject(this.handwritingNode);
\r\n
// var h = this.handwritingActionNode.getSize().y + this.handwritingActionNode.getStyle(
\"
margin-top
\"
).toInt() + this.handwritingActionNode.getStyle(
\"
margin-bottom
\"
).toInt();
\r\n
// h = y - h;
\r\n
// this.handwritingAreaNode.setStyle(
\"
height
\"
,
\"\"
+ h +
\"
px
\"
);
\r\n
this.handwritingAreaNode.setStyle(
\"
height
\"
,
\"\"
+ y +
\"
px
\"
);
\r\n\r\n
MWF.require(
\"
MWF.widget.Tablet
\"
, function () {
\r\n
var handWritingOptions = {
\r\n
\"
style
\"
:
\"
default
\"
,
\r\n
\"
contentWidth
\"
: 0,
\r\n
\"
contentHeight
\"
: 0,
\r\n
\"
onSave
\"
: function (base64code, base64Image, imageFile) {
\r\n
this.handwritingFile = imageFile;
\r\n
this.handwritingNode.hide();
\r\n
this.handwritingNodeMask.hide();
\r\n
// this.page.get(
\"
div_image
\"
).node.set(
\"
src
\"
,base64Image);
\r\n\r\n
}.bind(this),
\r\n
\"
onCancel
\"
: function () {
\r\n
this.handwritingFile = null;
\r\n
this.handwritingNode.hide();
\r\n
this.handwritingNodeMask.hide();
\r\n
}.bind(this)
\r\n
};
\r\n
handWritingOptions.tools = [
\r\n
\"
undo
\"
,
\r\n
\"
redo
\"
,
\"
|
\"
,
\r\n
\"
reset
\"
,
\"
|
\"
,
\r\n
\"
size
\"
,
\r\n
\"
cancel
\"\r\n
]
\r\n
this.tablet = new MWF.widget.Tablet(this.handwritingAreaNode, handWritingOptions, null);
\r\n
this.tablet.load();
\r\n
}.bind(this));
\r\n\r\n
// this.handwritingActionNode.addEvent(
\"
click
\"
, function () {
\r\n
// //this.handwritingNode.hide();
\r\n
// if (this.tablet) this.tablet.save();
\r\n
// }.bind(this));
\r\n
},
\r\n\r\n
setIdeaList: function (ideas) {
\r\n
var _self = this;
\r\n
ideas.each(function (idea) {
\r\n
new Element(
\"
div
\"
, {
\r\n
\"
styles
\"
: this.css.selectIdeaItemNode,
\r\n
\"
text
\"
: idea,
\r\n
\"
events
\"
: {
\r\n
\"
click
\"
: function () {
\r\n
if (!_self.getData(
\"
inputTextarea
\"
)) {
\r\n
_self.setData(
\"
inputTextarea
\"
, this.get(
\"
text
\"
));
\r\n
} else {
\r\n
_self.setData(
\"
inputTextarea
\"
, _self.getData(
\"
inputTextarea
\"
) +
\"
,
\"
+ this.get(
\"
text
\"
));
\r\n
}
\r\n
},
\r\n
\"
dblclick
\"
: function () {
\r\n
if (!_self.getData(
\"
inputTextarea
\"
)) {
\r\n
_self.setData(
\"
inputTextarea
\"
, this.get(
\"
text
\"
));
\r\n
} else {
\r\n
_self.setData(
\"
inputTextarea
\"
, _self.getData(
\"
inputTextarea
\"
) +
\"
,
\"
+ this.get(
\"
text
\"
));
\r\n
}
\r\n
},
\r\n
\"
mouseover
\"
: function () {
\r\n
this.setStyles(_self.css.selectIdeaItemNode_over);
\r\n
},
\r\n
\"
mouseout
\"
: function () {
\r\n
this.setStyles(_self.css.selectIdeaItemNode);
\r\n
}
\r\n
}
\r\n
}).inject(this.selectIdeaAreaNode);
\r\n
}.bind(this));
\r\n
},
\r\n
submit: function (ev) {
\r\n
if (this.hasDecisionOpinion && !this.selectedRouteGroup) {
\r\n
this.routeGroupArea.setStyle(
\"
background-color
\"
,
\"
#ffe9e9
\"
);
\r\n
MWF.xDesktop.notice(
\r\n
\"
error
\"
,
\r\n
{
\"
x
\"
:
\"
center
\"
,
\"
y
\"
:
\"
top
\"
},
\r\n
\"
请先选择决策组
\"
,
\r\n
this.routeGroupArea,
\r\n
null, //{
\"
x
\"
: 0,
\"
y
\"
: 30}
\r\n
{
\"
closeOnBoxClick
\"
: true,
\"
closeOnBodyClick
\"
: true,
\"
fixed
\"
: true,
\"
delayClose
\"
: 6000}
\r\n
);
\r\n
return false;
\r\n
}
\r\n\r\n
if (!this.selectedRoute) {
\r\n
this.routeSelectorArea.setStyle(
\"
background-color
\"
,
\"
#ffe9e9
\"
);
\r\n
new mBox.Notice({
\r\n
type:
\"
error
\"
,
\r\n
position: {
\"
x
\"
:
\"
center
\"
,
\"
y
\"
:
\"
top
\"
},
\r\n
move: false,
\r\n
target: this.routeSelectorArea,
\r\n
delayClose: 6000,
\r\n
content:
\"
请先选择决策
\"\r\n
});
\r\n
return false;
\r\n
}
\r\n
var routeName = this.selectedRoute.retrieve(
\"
routeName
\"
) || this.selectedRoute.get(
\"
text
\"
);
\r\n
var opinion = this.getData(
\"
inputTextarea
\"
);
\r\n
if (opinion === MWF.xApplication.process.Work.LP.inputText) opinion =
\"\"
;
\r\n
var medias = [];
\r\n
if (this.handwritingFile) medias.push(this.handwritingFile);
\r\n
if (this.soundFile) medias.push(this.soundFile);
\r\n
if (this.videoFile) medias.push(this.videoFile);
\r\n\r\n
var currentRouteId = this.selectedRoute.retrieve(
\"
route
\"
);
\r\n
var routeConfig = this.getRouteConfig(currentRouteId);
\r\n
if (!opinion && medias.length === 0) {
\r\n
if (routeConfig.opinionRequired == true) {
\r\n
this.inputTextarea.setStyle(
\"
background-color
\"
,
\"
#ffe9e9
\"
);
\r\n
new mBox.Notice({
\r\n
type:
\"
error
\"
,
\r\n
position: {
\"
x
\"
:
\"
center
\"
,
\"
y
\"
:
\"
top
\"
},
\r\n
move: false,
\r\n
target: this.inputTextarea,
\r\n
delayClose: 6000,
\r\n
content:
\"
请填写意见
\"\r\n
});
\r\n
return false;
\r\n
}
\r\n
}
\r\n\r\n
if (routeConfig.validationScriptText) {
\r\n
var validation = this.form.Macro.exec(routeConfig.validationScriptText, this);
\r\n
if (!validation || validation.toString() !==
\"
true
\"
) {
\r\n
if (typeOf(validation) ===
\"
string
\"
) {
\r\n
new mBox.Notice({
\r\n
type:
\"
error
\"
,
\r\n
position: {
\"
x
\"
:
\"
center
\"
,
\"
y
\"
:
\"
top
\"
},
\r\n
move: false,
\r\n
target: this.node,
\r\n
delayClose: 6000,
\r\n
content: validation
\r\n
});
\r\n
return false;
\r\n
} else {
\r\n
//
\"
路由校验失败
\"\r\n
new mBox.Notice({
\r\n
type:
\"
error
\"
,
\r\n
position: {
\"
x
\"
:
\"
center
\"
,
\"
y
\"
:
\"
top
\"
},
\r\n
move: false,
\r\n
target: this.node,
\r\n
delayClose: 6000,
\r\n
content:
\"
路由校验失败
\"\r\n
});
\r\n
return false;
\r\n
}
\r\n
}
\r\n
}
\r\n\r\n
//var array = [routeName, opinion, medias];
\r\n
//this.node.mask({
\r\n
//
\"
inject
\"
: {
\"
where
\"
:
\"
bottom
\"
,
\"
target
\"
: this.node},
\r\n
//
\"
destroyOnHide
\"
: true,
\r\n
//
\"
style
\"
: {
\r\n
//
\"
background-color
\"
:
\"
#999
\"
,
\r\n
//
\"
opacity
\"
: 0.3,
\r\n
//
\"
z-index
\"
:600
\r\n
// }
\r\n
//});
\r\n
//this.fireEvent(
\"
submit
\"
, array );
\r\n\r\n
var appendTaskOrgItem;
\r\n
if (routeConfig.type ===
\"
appendTask
\"
&& routeConfig.appendTaskIdentityType ===
\"
select
\"
) {
\r\n
if (!this.orgItems || this.orgItems.length === 0) {
\r\n
new mBox.Notice({
\r\n
type:
\"
error
\"
,
\r\n
position: {
\"
x
\"
:
\"
center
\"
,
\"
y
\"
:
\"
top
\"
},
\r\n
move: false,
\r\n
target: this.orgsArea,
\r\n
delayClose: 6000,
\r\n
content:
\"
没有配置转交人,请联系管理员
\"
//
\"
没有配置转交人,请联系管理员
\"\r\n
});
\r\n
return false;
\r\n
} else {
\r\n
appendTaskOrgItem = this.orgItems[0]
\r\n
}
\r\n
}
\r\n\r\n
if (!this.saveOrgs()) return false;
\r\n\r\n
//this.saveOrgsWithCheckEmpower( function(){
\r\n
var appandTaskIdentityList;
\r\n
if (appendTaskOrgItem) {
\r\n
appandTaskIdentityList = appendTaskOrgItem.getData();
\r\n
if (!appandTaskIdentityList || appandTaskIdentityList.length === 0) {
\r\n
new mBox.Notice({
\r\n
type:
\"
error
\"
,
\r\n
position: {
\"
x
\"
:
\"
center
\"
,
\"
y
\"
:
\"
top
\"
},
\r\n
move: false,
\r\n
target: this.orgsArea,
\r\n
delayClose: 6000,
\r\n
content:
\"
请选择转交人
\"\r\n
});
\r\n
return;
\r\n
}
\r\n
}
\r\n\r\n
if (routeConfig.validationScriptText) {
\r\n
var validation = this.form.Macro.exec(routeConfig.validationScriptText, this);
\r\n
if (!validation || validation.toString() !==
\"
true
\"
) {
\r\n
if (typeOf(validation) ===
\"
string
\"
) {
\r\n
MWF.xDesktop.notice(
\r\n
\"
error
\"
,
\r\n
{
\"
x
\"
:
\"
center
\"
,
\"
y
\"
:
\"
center
\"
},
\r\n
validation,
\r\n
this.node,
\r\n
{
\"
x
\"
: 0,
\"
y
\"
: 30},
\r\n
{
\"
closeOnBoxClick
\"
: true,
\"
closeOnBodyClick
\"
: true,
\"
fixed
\"
: true,
\"
delayClose
\"
: 6000}
\r\n
);
\r\n
return false;
\r\n
} else {
\r\n
//
\"
路由校验失败
\"\r\n
MWF.xDesktop.notice(
\r\n
\"
error
\"
,
\r\n
{
\"
x
\"
:
\"
center
\"
,
\"
y
\"
:
\"
center
\"
},
\r\n
\"
路由校验失败
\"
,
\r\n
this.node,
\r\n
{
\"
x
\"
: 0,
\"
y
\"
: 30},
\r\n
{
\"
closeOnBoxClick
\"
: true,
\"
closeOnBodyClick
\"
: true,
\"
fixed
\"
: true,
\"
delayClose
\"
: 6000}
\r\n
);
\r\n
return false;
\r\n
}
\r\n
}
\r\n
}
\r\n\r\n
this.node.mask({
\r\n
\"
inject
\"
: {
\"
where
\"
:
\"
bottom
\"
,
\"
target
\"
: this.node},
\r\n
\"
destroyOnHide
\"
: true,
\r\n
\"
style
\"
: {
\r\n
\"
background-color
\"
:
\"
#999
\"
,
\r\n
\"
opacity
\"
: 0.3,
\r\n
\"
z-index
\"
: 600
\r\n
}
\r\n
});
\r\n\r\n
// var array = [ routeName, opinion, medias, appandTaskIdentityList, this.orgItems, function(){
\r\n
// if(appendTaskOrgItem)appendTaskOrgItem.setData([]);
\r\n
// }];
\r\n\r\n
var op = this.form.getOpinion();
\r\n
var mds = op.medias;
\r\n\r\n
if (!medias || !medias.length) {
\r\n
medias = mds;
\r\n
} else {
\r\n
medias = medias.concat(mds)
\r\n
}
\r\n\r\n
this.form.submitWork(routeName, opinion, medias, function () {
\r\n
this.close();
\r\n
}.bind(this), this, null, appandTaskIdentityList, this.orgItems, function () {
\r\n
if (appendTaskOrgItem) appendTaskOrgItem.setData([]);
\r\n
this.setData(
\"
inputTextarea
\"
,
\"\"
);
\r\n
}.bind(this));
\r\n\r\n
// this.fireEvent(
\"
submit
\"
, array );
\r\n
},
\r\n\r\n
close: function () {
\r\n
this.node.setStyle(
\"
display
\"
,
\"
none
\"
);
\r\n
this.status =
\"
closed
\"
;
\r\n
},
\r\n
destroy: function () {
\r\n
// this.node.empty();
\r\n
// delete this.task;
\r\n
// delete this.node;
\r\n
// delete this.routeSelectorTile;
\r\n
// delete this.routeSelectorArea;
\r\n
// delete this.routeOpinionTile;
\r\n
// delete this.routeOpinionArea;
\r\n
// delete this.buttonsArea;
\r\n
// delete this.inputOpinionNode;
\r\n
// delete this.inputTextarea;
\r\n
// delete this.cancelButton;
\r\n
// delete this.okButton;
\r\n
},
\r\n
loadOrgs: function (route) {
\r\n
if (!this.form || !route) {
\r\n
this.hideOrgsArea();
\r\n
return;
\r\n
} else {
\r\n
this.showOrgsArea();
\r\n
}
\r\n
if (!this.orgTableObject) this.orgTableObject = {};
\r\n
if (!this.orgItemsObject) this.orgItemsObject = {};
\r\n
var isLoaded = false;
\r\n
for (var key in this.orgTableObject) {
\r\n
if (route === key) {
\r\n
this.orgTableObject[key].show();
\r\n
this.orgItems = this.orgItemsObject[key] || [];
\r\n
var data = this.getOrgConfig(route);
\r\n
isLoaded = true;
\r\n
} else {
\r\n
this.orgTableObject[key].hide();
\r\n
}
\r\n
}
\r\n
if (isLoaded) return;
\r\n\r\n
this.orgItems = [];
\r\n
this.orgItemsObject[route] = this.orgItems;
\r\n\r\n
var data = this.getOrgConfig(route);
\r\n
var routeConfig = this.getRouteConfig(route);
\r\n
var ignoreFirstOrgOldData = false; //(routeConfig.type ===
\"
appendTask
\"
&& routeConfig.appendTaskIdentityType ===
\"
select
\"
);
\r\n
this.setSize(data.length);
\r\n
if (data.length) {
\r\n
this.showOrgsArea();
\r\n\r\n
var routeOrgTable = new Element(
\"
div
\"
, {
\r\n
\"
styles
\"
: this.css.routeOrgTable
\r\n
}).inject(this.orgsArea);
\r\n
this.orgTableObject[route] = routeOrgTable;
\r\n\r\n
data.each(function (config, i) {
\r\n
var sNode = new Element(
\"
div
\"
, {
\r\n
\"
styles
\"
: this.css.routeOrgTr
\r\n
}).inject(routeOrgTable);
\r\n
this.loadOrg(sNode, config, ignoreFirstOrgOldData && i == 0)
\r\n
}.bind(this))
\r\n
} else {
\r\n
this.hideOrgsArea();
\r\n
}
\r\n\r\n
},
\r\n
loadOrg: function (container, json, position, ignoreOldData) {
\r\n
var titleNode = new Element(
\"
div.selectorTitle
\"
, {
\r\n
\"
styles
\"
: this.css.selectorTitle
\r\n
}).inject(container);
\r\n
var titleTextNode = new Element(
\"
div.selectorTitleText
\"
, {
\r\n
\"
text
\"
: json.title,
\r\n
\"
styles
\"
: this.css.selectorTitleText
\r\n
}).inject(titleNode);
\r\n\r\n
var contentNode = new Element(
\"
div.selectorContent
\"
, {
\r\n
\"
styles
\"
: this.css.selectorContent
\r\n
}).inject(container);
\r\n\r\n
var errorNode = new Element(
\"
div.selectorErrorNode
\"
, {
\r\n
\"
styles
\"
: this.css.selectorErrorNode
\r\n
}).inject(container);
\r\n\r\n
var org = new O2ProcessorMobile.Org(contentNode, this.form, json, this, {
\r\n
onSelect: function (items, data) {
\r\n
if (!data || !data.length) {
\r\n
contentNode.setStyles(this.css.selectorContent_noItem);
\r\n
} else {
\r\n
contentNode.setStyles(this.css.selectorContent);
\r\n
}
\r\n
}.bind(this)
\r\n
});
\r\n
org.ignoreOldData = ignoreOldData;
\r\n
org.errContainer = errorNode;
\r\n
org.summitDlalog = this;
\r\n
this.orgItems.push(org);
\r\n\r\n
titleNode.addEvent(
\"
click
\"
, function () {
\r\n
this.load();
\r\n
}.bind(org));
\r\n
contentNode.addEvent(
\"
click
\"
, function () {
\r\n
this.load();
\r\n
}.bind(org));
\r\n\r\n
var defaultValue = org.getValue();
\r\n
org.loadOrgWidget(defaultValue, contentNode);
\r\n
if (!defaultValue || defaultValue.length == 0) {
\r\n
{
\r\n
contentNode.setStyles(this.css.selectorContent_noItem);
\r\n
}
\r\n
}
\r\n\r\n
},
\r\n
validationOrgs: function () {
\r\n
if (!this.orgItems || !this.orgItems.length) return true;
\r\n
var flag = true;
\r\n
this.orgItems.each(function (item) {
\r\n
if (!item.validation()) flag = false;
\r\n
}.bind(this));
\r\n
return flag;
\r\n
},
\r\n
isOrgsHasEmpower: function () {
\r\n
if (!this.orgItems || !this.orgItems.length) return true;
\r\n
var flag = false;
\r\n
this.needCheckEmpowerOrg = [];
\r\n
this.orgItems.each(function (item) {
\r\n
if (item.hasEmpowerIdentity()) {
\r\n
this.needCheckEmpowerOrg.push(item);
\r\n
flag = true;
\r\n
}
\r\n
}.bind(this));
\r\n
return flag;
\r\n
},
\r\n
saveOrgs: function (keepSilent) {
\r\n
if (!this.orgItems || !this.orgItems.length) return true;
\r\n
var flag = true;
\r\n
this.orgItems.each(function (item) {
\r\n
if (!item.save(!keepSilent)) flag = false;
\r\n
}.bind(this));
\r\n
return flag;
\r\n
},
\r\n
saveOrgsWithCheckEmpower: function (callback) {
\r\n
debugger;
\r\n
if (!this.orgItems || !this.orgItems.length) {
\r\n
if (callback) callback();
\r\n
return true;
\r\n
}
\r\n
if (!this.validationOrgs()) return false;
\r\n
if (!this.isOrgsHasEmpower()) {
\r\n
if (callback) callback();
\r\n
return true;
\r\n
}
\r\n
//this.checkEmpowerMode = true;
\r\n
this.showEmpowerDlg(callback);
\r\n
},
\r\n
showEmpowerDlg: function (callback) {
\r\n\r\n
//this.needCheckEmpowerOrg.each( function(org){
\r\n
// org.saveCheckedEmpowerData();
\r\n
//}.bind(this));
\r\n\r\n
var empowerNode = new Element(
\"
div.empowerNode
\"
, {
\"
styles
\"
: this.css.empowerNode});
\r\n
var empowerTitleNode = new Element(
\"
div
\"
, {
\r\n
text:
\"
下列人员对工作进行了授权,选择后文件将发送给被授权人,取消选择后文件将发送给授权者本人
\"
,
\r\n
styles: this.css.empowerTitleNode
\r\n
}).inject(empowerNode);
\r\n\r\n
var orgs = this.needCheckEmpowerOrg;
\r\n
var len = orgs.length;
\r\n
var lines = ((len + 1) / 2).toInt();
\r\n\r\n
var empowerTable = new Element(
\"
table
\"
, {
\r\n
\"
cellspacing
\"
: 0,
\"
cellpadding
\"
: 0,
\"
border
\"
: 0,
\"
width
\"
:
\"
100%
\"
,
\r\n
\"
styles
\"
: this.css.empowerTable
\r\n
}).inject(empowerNode);
\r\n\r\n
for (var n = 0; n < lines; n++) {
\r\n
var tr = new Element(
\"
tr
\"
).inject(empowerTable);
\r\n
new Element(
\"
td
\"
, {
\"
width
\"
:
\"
50%
\"
,
\"
styles
\"
: this.css.empowerOddTd}).inject(tr);
\r\n
new Element(
\"
td
\"
, {
\"
width
\"
:
\"
50%
\"
,
\"
styles
\"
: this.css.empowerEvenTd}).inject(tr);
\r\n
}
\r\n\r\n
var trs = empowerTable.getElements(
\"
tr
\"
);
\r\n
orgs.each(function (org, i) {
\r\n
var sNode;
\r\n
var width;
\r\n
if (i + 1 == len && (len % 2 === 1)) {
\r\n
sNode = trs[trs.length - 1].getFirst(
\"
td
\"
);
\r\n
sNode.set(
\"
colspan
\"
, 2);
\r\n
trs[trs.length - 1].getLast(
\"
td
\"
).destroy();
\r\n
width =
\"
50%
\"
;
\r\n
} else {
\r\n
var row = ((i + 2) / 2).toInt();
\r\n
var tr = trs[row - 1];
\r\n
sNode = (i % 2 === 0) ? tr.getFirst(
\"
td
\"
) : tr.getLast(
\"
td
\"
);
\r\n
}
\r\n\r\n
var titleNode = new Element(
\"
div.empowerAreaTitle
\"
, {
\r\n
\"
styles
\"
: this.css.empowerAreaTitle
\r\n
}).inject(sNode);
\r\n\r\n
var titleTextNode = new Element(
\"
div.empowerAreaTitleText
\"
, {
\r\n
\"
text
\"
: org.json.title,
\r\n
\"
styles
\"
: this.css.empowerAreaTitleText
\r\n
}).inject(titleNode);
\r\n\r\n
var selectAllNode = new Element(
\"
div
\"
, {
\r\n
styles: {
\r\n
float:
\"
right
\"\r\n
}
\r\n
}).inject(titleNode);
\r\n\r\n
var contentNode = new Element(
\"
div.empowerAreaContent
\"
, {
\r\n
\"
styles
\"
: this.css.empowerAreaContent
\r\n
}).inject(sNode);
\r\n\r\n
org.loadCheckEmpower(null, contentNode, selectAllNode);
\r\n\r\n
}.bind(this));
\r\n\r\n
empowerNode.setStyle(
\"
height
\"
, lines * this.options.orgHeight + 20);
\r\n
//var dlgHeight = Math.min( Math.floor( this.form.app.content.getSize().y * 0.9) , lines*this.options.orgHeight + 151 );
\r\n\r\n
//var width = this.node.retrieve(
\"
width
\"
);
\r\n
//empowerNode.setStyle(
\"
width
\"
, width );
\r\n
var width =
\"
880
\"
;
\r\n
//if( len > 1 ){
\r\n
// width =
\"
840
\"\r\n
//}else{
\r\n
// width =
\"
420
\"\r\n
//}
\r\n
empowerNode.setStyle(
\"
width
\"
, width +
\"
px
\"
);
\r\n\r\n
this.node.getParent().mask({
\r\n
\"
style
\"
: this.css.mask
\r\n
});
\r\n
this.empowerDlg = o2.DL.open({
\r\n
\"
title
\"
:
\"
授权人员替换选择
\"
,
\r\n
\"
style
\"
: this.form.json.dialogStyle ||
\"
user
\"
,
\r\n
\"
isResize
\"
: false,
\r\n
\"
content
\"
: empowerNode,
\r\n
//
\"
container
\"
: this.node,
\r\n
\"
width
\"
: width, //600,
\r\n
\"
height
\"
:
\"
auto
\"
, //dlgHeight,
\r\n
\"
mark
\"
: false,
\r\n
\"
buttonList
\"
: [
\r\n
{
\r\n
\"
type
\"
:
\"
ok
\"
,
\r\n
\"
text
\"
:
\"
确定
\"
,
\r\n
\"
action
\"
: function (d, e) {
\r\n
//if (this.empowerDlg) this.empowerDlg.okButton.click();
\r\n\r\n
orgs.each(function (org, i) {
\r\n
org.saveCheckedEmpowerData(function () {
\r\n
if (i === orgs.length - 1) {
\r\n
if (callback) callback();
\r\n
this.node.getParent().unmask();
\r\n
this.empowerDlg.close();
\r\n
}
\r\n
}.bind(this))
\r\n
}.bind(this))
\r\n
}.bind(this)
\r\n
},
\r\n
{
\r\n
\"
type
\"
:
\"
cancel
\"
,
\r\n
\"
text
\"
:
\"
取消
\"
,
\r\n
\"
action
\"
: function () {
\r\n
this.node.getParent().unmask();
\r\n
this.empowerDlg.close();
\r\n
}.bind(this)
\r\n
}
\r\n
]
\r\n
});
\r\n
},
\r\n
getCss: function () {
\r\n
this.css = {
\r\n\r\n
\"
routeGroupNode
\"
: {
\r\n
\"
float
\"
:
\"
left
\"
,
\r\n
\"
margin-left
\"
:
\"
20px
\"
,
\r\n
\"
padding-left
\"
:
\"
28px
\"
,
\r\n
\"
color
\"
:
\"
#000
\"
,
\r\n
\"
background-color
\"
:
\"
#E3E3E3
\"
,
\r\n
\"
min-height
\"
:
\"
24px
\"
,
\r\n
\"
line-height
\"
:
\"
24px
\"
,
\r\n
\"
margin-top
\"
:
\"
8px
\"
,
\r\n
\"
cursor
\"
:
\"
pointer
\"
,
\r\n
\"
background
\"
:
\"
url(/x_component_process_Work/$Processor/process/route.png) no-repeat 5px center
\"\r\n
},
\r\n
\"
routeGroupNode_over
\"
: {
\r\n
\"
background-color
\"
:
\"
#E3E3E3
\"
,
\r\n
\"
background
\"
:
\"
url(/x_component_process_Work/$Processor/process/route.png) no-repeat 5px center
\"\r\n
},
\r\n
\"
routeGroupNode_selected
\"
: {
\r\n
\"
background-color
\"
:
\"
#E3E3E3
\"
,
\r\n
\"
background
\"
:
\"
url(/x_component_process_Work/$Processor/process/routegroup_selected.png) no-repeat 5px center
\"\r\n
},
\r\n\r\n
\"
routeNode
\"
: {
\r\n
\"
float
\"
:
\"
left
\"
,
\r\n
\"
margin-left
\"
:
\"
20px
\"
,
\r\n
\"
border-radius
\"
:
\"
5px
\"
,
\r\n
\"
height
\"
:
\"
24px
\"
,
\r\n
\"
line-height
\"
:
\"
24px
\"
,
\r\n
\"
margin-top
\"
:
\"
8px
\"
,
\r\n
\"
padding-left
\"
:
\"
26px
\"
,
\r\n
\"
padding-right
\"
:
\"
8px
\"
,
\r\n
\"
color
\"
:
\"
#000
\"
,
\r\n
\"
background
\"
:
\"
url(/x_component_process_Work/$Processor/process/nocheck.png) no-repeat 5px center
\"
,
\r\n
\"
background-color
\"
:
\"
#f0f0f0
\"\r\n
},
\r\n
\"
routeNode_over
\"
: {
\r\n
\"
color
\"
:
\"
#000
\"
,
\r\n
\"
background
\"
:
\"
url(/x_component_process_Work/$Processor/process/nocheck.png) no-repeat 5px center
\"
,
\r\n
\"
background-color
\"
:
\"
#e6ecf8
\"\r\n
},
\r\n
\"
routeNode_selected
\"
: {
\r\n
\"
color
\"
:
\"
#fff
\"
,
\r\n
\"
background
\"
:
\"
url(/x_component_process_Work/$Processor/process/checked.png) no-repeat 5px center
\"
,
\r\n
\"
background-color
\"
:
\"
#3296FA
\"\r\n
},
\r\n\r\n
\"
selectIdeaItemNode
\"
: {
\r\n
\"
line-height
\"
:
\"
18px
\"
,
\r\n
\"
font-size
\"
:
\"
14px
\"
,
\r\n
\"
cursor
\"
:
\"
pointer
\"
,
\r\n
\"
background-color
\"
:
\"
#FFF
\"
,
\r\n
\"
padding
\"
:
\"
4px 4px 4px 4px
\"
,
\r\n
\"
overflow
\"
:
\"
hidden
\"\r\n
},
\r\n
\"
selectIdeaItemNode_over
\"
: {
\r\n
\"
background-color
\"
:
\"
#e6ecf8
\"\r\n
},
\r\n\r\n
\"
handwritingNode
\"
: {
\r\n
\"
position
\"
:
\"
absolute
\"
,
\r\n
\"
background
\"
:
\"
#ffffff
\"\r\n
},
\r\n
\"
handwritingActionNode
\"
: {
\r\n
\"
width
\"
:
\"
70%
\"
,
\r\n
\"
min-width
\"
:
\"
100px
\"
,
\r\n
\"
height
\"
:
\"
3em
\"
,
\r\n
\"
line-height
\"
:
\"
3em
\"
,
\r\n
\"
margin
\"
:
\"
5px auto
\"
,
\r\n
\"
border-radius
\"
:
\"
5px
\"
,
\r\n
\"
border
\"
:
\"
1px solid #3296FA
\"
,
\r\n
\"
background-color
\"
:
\"
#3296FA
\"
,
\r\n
\"
text-align
\"
:
\"
center
\"
,
\r\n
\"
color
\"
:
\"
#ffffff
\"
,
\r\n
\"
font-size
\"
:
\"
16px
\"\r\n
},
\r\n\r\n
\"
inputOpinionAudioRecordAction
\"
: {
\r\n
\"
display
\"
:
\"
none
\"
,
\r\n
\"
float
\"
:
\"
right
\"
,
\r\n
\"
border
\"
:
\"
1px solid #6681a5
\"
,
\r\n
\"
border-radius
\"
:
\"
3px
\"
,
\r\n
\"
cursor
\"
:
\"
pointer
\"
,
\r\n
\"
padding-left
\"
:
\"
24px
\"
,
\r\n
\"
padding-right
\"
:
\"
5px
\"
,
\r\n
\"
margin-left
\"
:
\"
5px
\"
,
\r\n
\"
background
\"
:
\"
url(
\"
+
\"
/x_component_process_Work/$Processor/default/audioRecord.png) no-repeat 5px center
\"\r\n
},
\r\n\r\n
\"
routeOrgTable
\"
: {},
\r\n
\"
routeOrgTr
\"
: {
\r\n
\"
margin-bottom
\"
:
\"
10px
\"\r\n
},
\r\n
\"
routeOrgOddTd
\"
: {
\r\n
\"
width
\"
:
\"
50%
\"\r\n
},
\r\n
\"
routeOrgEvenTd
\"
: {
\r\n
\"
width
\"
:
\"
50%
\"
,
\r\n
\"
border-left
\"
:
\"
5px solid #ffffff
\"\r\n
},
\r\n\r\n
\"
selectorTitle
\"
: {
\r\n
\"
padding
\"
:
\"
0px 4px
\"
,
\r\n
\"
height
\"
:
\"
30px
\"
,
\r\n
\"
line-height
\"
:
\"
30px
\"
,
\r\n
\"
font-size
\"
:
\"
14px
\"
,
\r\n
//
\"
font-weight
\"
:
\"
bold
\"
,
\r\n
\"
color
\"
:
\"
#000
\"
,
\r\n
\"
cursor
\"
:
\"
pointer
\"
,
\r\n
\"
background
\"
:
\"
url(/x_component_process_Work/$Processor/mobile/arrow_right2.png) no-repeat right 10px center
\"
,
\r\n
\"
background-color
\"
:
\"
#fff
\"\r\n
},
\r\n
\"
selectorTitle_over
\"
: {
\r\n
\"
background-color
\"
:
\"
#e6ecf8
\"\r\n
},
\r\n
\"
selectorTitleText
\"
: {
\r\n
//
\"
float
\"
:
\"
left
\"\r\n
},
\r\n
\"
selectorErrorNode
\"
: {
\r\n
//
\"
float
\"
:
\"
right
\"
,
\r\n
\"
background-color
\"
:
\"
#fff
\"
,
\r\n
\"
margin-right
\"
:
\"
5px
\"
,
\r\n
\"
font-weight
\"
:
\"
normal
\"\r\n
},
\r\n
\"
selectorContent
\"
: {
\r\n
\"
overflow
\"
:
\"
hidden
\"
,
\r\n
\"
background-color
\"
:
\"
#fff
\"
,
\r\n
\"
padding
\"
:
\"
0px 5px 5px 5px
\"\r\n
},
\r\n
\"
selectorContent_noItem
\"
: {
\r\n
\"
padding
\"
:
\"
0px
\"\r\n
}
\r\n
}
\r\n\r\n
}
\r\n
});
\r\n\r\n\r\n
O2ProcessorMobile.Org = new Class({
\r\n
Implements: [Options, Events],
\r\n
options: {
\r\n
height : 240,
\r\n
moduleEvents : [
\"
queryLoadSelector
\"
,
\"
postLoadSelector
\"
,
\"
postLoadContent
\"
,
\"
queryLoadCategory
\"
,
\"
postLoadCategory
\"
,
\r\n
\"
selectCategory
\"
,
\"
unselectCategory
\"
,
\"
queryLoadItem
\"
,
\"
postLoadItem
\"
,
\"
selectItem
\"
,
\"
unselectItem
\"
,
\"
change
\"
]
\r\n
},
\r\n
initialize: function (container, form, json, processor, options) {
\r\n
this.form = form;
\r\n
this.json = json;
\r\n
this.processor = processor;
\r\n
this.container = $(container);
\r\n
this.orgAction = MWF.Actions.get(
\"
x_organization_assemble_control
\"
);
\r\n
this.setOptions(options);
\r\n
},
\r\n
load : function(){
\r\n
setTimeout( function(){ //如果有输入法界面,这个时候页面的计算不对,所以等100毫秒
\r\n
var options = this.getOptions();
\r\n
if(options){
\r\n
//this.selector = new MWF.O2Selector(this.container, options);
\r\n
this.selector = new MWF.O2Selector($(document.body), options);
\r\n
}
\r\n
}.bind(this), 100 )
\r\n
},
\r\n
_getOrgOptions: function(){
\r\n
this.selectTypeList = typeOf( this.json.selectType ) ==
\"
array
\"
? this.json.selectType : [this.json.selectType];
\r\n
if( this.selectTypeList.contains(
\"
identity
\"
) ) {
\r\n
this.identityOptions = new O2ProcessorMobile.IdentityOptions(this.form, this.json);
\r\n
}
\r\n
if( this.selectTypeList.contains(
\"
unit
\"
) ) {
\r\n
this.unitOptions = new O2ProcessorMobile.UnitOptions(this.form, this.json);
\r\n
}
\r\n
//if( this.selectTypeList.contains(
\"
group
\"
) ){
\r\n
// this.groupOptions = new MWF.APPOrg.GroupOptions( this.form, this.json );
\r\n
//}
\r\n
},
\r\n
getOptions: function(){
\r\n
var _self = this;
\r\n
this._getOrgOptions();
\r\n
if( this.selectTypeList.length === 0 )return false;
\r\n
var exclude = [];
\r\n
if( this.json.exclude ){
\r\n
var v = this.form.Macro.exec(this.json.exclude.code, this);
\r\n
exclude = typeOf(v)===
\"
array
\"
? v : [v];
\r\n
}
\r\n\r\n
var identityOpt;
\r\n
if( this.identityOptions ){
\r\n
identityOpt = this.identityOptions.getOptions();
\r\n
if (this.json.identityRange!==
\"
all
\"
){
\r\n
if ( !identityOpt.noUnit && (!identityOpt.units || !identityOpt.units.length) ){
\r\n
this.form.notice(
\"
无法确定身份的选择范围
\"
,
\"
error
\"
, this.node);
\r\n
return false;
\r\n
}
\r\n
}
\r\n
if ( !identityOpt.noUnit && this.json.dutyRange && this.json.dutyRange!==
\"
all
\"
){
\r\n
if (!identityOpt.dutys || !identityOpt.dutys.length){
\r\n
this.form.notice(
\"
无法确定职务的选择范围
\"
,
\"
error
\"
, this.node);
\r\n
return false;
\r\n
}
\r\n
}
\r\n
if( this.ignoreOldData ){
\r\n
identityOpt.values = this._computeValue() || [];
\r\n
}else{
\r\n
identityOpt.values = this.getValue();
\r\n
}
\r\n
identityOpt.exclude = exclude;
\r\n
}
\r\n\r\n
var unitOpt;
\r\n
if( this.unitOptions ){
\r\n
unitOpt = this.unitOptions.getOptions();
\r\n
if (this.json.unitRange!==
\"
all
\"
){
\r\n
if ( !unitOpt.units || !unitOpt.units.length){
\r\n
this.form.notice(
\"
无法确定组织的选择范围
\"
,
\"
error
\"
, this.node);
\r\n
return false;
\r\n
}
\r\n
}
\r\n
if( this.ignoreOldData ){
\r\n
unitOpt.values = this._computeValue() || [];
\r\n
}else{
\r\n
unitOpt.values = this.getValue();
\r\n
}
\r\n
unitOpt.exclude = exclude;
\r\n
}
\r\n\r\n
//var groupOpt;
\r\n
//if( this.groupOptions ){
\r\n
// groupOpt = this.groupOptions.getOptions();
\r\n
// groupOpt.values = (this.json.isInput) ? [] : values;
\r\n
// groupOpt.exclude = exclude;
\r\n
//}
\r\n\r\n
var defaultOpt = {
\r\n
\"
style
\"
:
\"
default
\"
,
\r\n
\"
zIndex
\"
: 3000
\r\n
};
\r\n\r\n
if( this.json.events && typeOf(this.json.events) ===
\"
object
\"
){
\r\n
Object.each(this.json.events, function(e, key){
\r\n
if (e.code){
\r\n
if (this.options.moduleEvents.indexOf(key)!==-1){
\r\n
//this.addEvent(key, function(event){
\r\n
// return this.form.Macro.fire(e.code, this, event);
\r\n
//}.bind(this));
\r\n
if( key ===
\"
postLoadSelector
\"
) {
\r\n
this.addEvent(
\"
loadSelector
\"
, function (selector) {
\r\n
return this.form.Macro.fire(e.code, selector);
\r\n
}.bind(this))
\r\n
}else if( key ===
\"
queryLoadSelector
\"
){
\r\n
defaultOpt[
\"
onQueryLoad
\"
] = function(target){
\r\n
return this.form.Macro.fire(e.code, target);
\r\n
}.bind(this)
\r\n
}else{
\r\n
defaultOpt[
\"
on
\"
+key.capitalize()] = function(target){
\r\n
return this.form.Macro.fire(e.code, target);
\r\n
}.bind(this)
\r\n
}
\r\n
}
\r\n
}
\r\n
}.bind(this));
\r\n
}
\r\n\r\n
if( this.form.json.selectorStyle ){
\r\n
defaultOpt = Object.merge( Object.clone(this.form.json.selectorStyle), defaultOpt );
\r\n
if( this.form.json.selectorStyle.style )defaultOpt.style = this.form.json.selectorStyle.style;
\r\n
}
\r\n\r\n
var mobileEvents = {
\r\n
\"
onComplete
\"
: function(items){
\r\n
this.selectOnComplete(items);
\r\n
}.bind(this),
\r\n
\"
onCancel
\"
: this.selectOnCancel.bind(this),
\r\n
\"
onClose
\"
: this.selectOnClose.bind(this)
\r\n
};
\r\n\r\n
if( this.selectTypeList.length === 1 ){
\r\n
return Object.merge(
\r\n
defaultOpt,
\r\n
{
\r\n
\"
type
\"
: this.selectTypeList[0],
\r\n
\"
onLoad
\"
: function(){
\r\n
//this 为 selector
\r\n
_self.selectOnLoad(this, this.selector )
\r\n
}
\r\n
//
\"
onComplete
\"
: function(items){
\r\n
// this.selectOnComplete(items);
\r\n
//}.bind(this),
\r\n
//
\"
onCancel
\"
: this.selectOnCancel.bind(this),
\r\n
//
\"
onClose
\"
: this.selectOnClose.bind(this)
\r\n
},
\r\n
mobileEvents,
\r\n
identityOpt || unitOpt
\r\n
)
\r\n
}else if( this.selectTypeList.length > 1 ){
\r\n
var options = {
\r\n
\"
type
\"
:
\"\"
,
\r\n
\"
types
\"
: this.selectTypeList,
\r\n
\"
onLoad
\"
: function(){
\r\n
//this 为 selector
\r\n
_self.selectOnLoad(this)
\r\n
}
\r\n
//
\"
onComplete
\"
: function(items){
\r\n
// this.selectOnComplete(items);
\r\n
//}.bind(this),
\r\n
//
\"
onCancel
\"
: this.selectOnCancel.bind(this),
\r\n
//
\"
onClose
\"
: this.selectOnClose.bind(this)
\r\n
};
\r\n
if( identityOpt ){
\r\n
options.identityOptions = Object.merge(
\r\n
defaultOpt,
\r\n
mobileEvents,
\r\n
identityOpt
\r\n
);
\r\n
}
\r\n
if( unitOpt ){
\r\n
options.unitOptions = Object.merge(
\r\n
defaultOpt,
\r\n
mobileEvents,
\r\n
unitOpt
\r\n
);
\r\n
}
\r\n
//if( groupOpt )options.groupOptions = groupOpt;
\r\n
return options;
\r\n
}
\r\n
},
\r\n
selectOnComplete: function(items){ //移动端才执行
\r\n
var array = [];
\r\n
items.each(function(item){
\r\n
array.push(item.data);
\r\n
}.bind(this));
\r\n
this.checkEmpower( array, function( data ){
\r\n
var values = [];
\r\n
data.each(function(d){
\r\n
values.push(MWF.org.parseOrgData(d, true));
\r\n
}.bind(this));
\r\n\r\n
this.setData(values);
\r\n\r\n
//this.validationMode();
\r\n
//this.validation();
\r\n\r\n
this.container.empty();
\r\n
this.loadOrgWidget(values, this.container);
\r\n\r\n
this.selector = null;
\r\n\r\n
this.fireEvent(
\"
select
\"
, [items, values]);
\r\n
}.bind(this))
\r\n
},
\r\n
selectOnCancel: function(){ //移动端才执行
\r\n
//this.validation();
\r\n
},
\r\n
selectOnLoad: function( selector ){
\r\n
//if (this.descriptionNode) this.descriptionNode.setStyle(
\"
display
\"
,
\"
none
\"
);
\r\n
this.fireEvent(
\"
loadSelector
\"
, [selector])
\r\n
},
\r\n
selectOnClose: function(){
\r\n
var v = this._getBusinessData();
\r\n
//if (!v || !v.length) if (this.descriptionNode) this.descriptionNode.setStyle(
\"
display
\"
,
\"
block
\"
);
\r\n
},
\r\n
loadOrgWidget: function(value, node){
\r\n
var height = node.getStyle(
\"
height
\"
).toInt();
\r\n
if (node.getStyle(
\"
overflow
\"
)===
\"
visible
\"
&& !height) node.setStyle(
\"
overflow
\"
,
\"
hidden
\"
);
\r\n
if (value && value.length){
\r\n
value.each(function(data){
\r\n
var flag = data.distinguishedName.substr(data.distinguishedName.length-1, 1);
\r\n
var copyData = Object.clone(data);
\r\n
if( this.json.displayTextScript && this.json.displayTextScript.code ){
\r\n
this.currentData = copyData;
\r\n
var displayName = this.form.Macro.exec(this.json.displayTextScript.code, this);
\r\n
if( displayName ){
\r\n
copyData.displayName = displayName;
\r\n
}
\r\n
this.currentData = null;
\r\n
}
\r\n\r\n
var widget;
\r\n
switch (flag.toLowerCase()){
\r\n
case
\"
i
\"
:
\r\n
widget = new MWF.widget.O2Identity(copyData, node, {
\"
style
\"
:
\"
xform
\"
,
\"
lazy
\"
:true});
\r\n
break;
\r\n
case
\"
p
\"
:
\r\n
widget = new MWF.widget.O2Person(copyData, node, {
\"
style
\"
:
\"
xform
\"
,
\"
lazy
\"
:true});
\r\n
break;
\r\n
case
\"
u
\"
:
\r\n
widget = new MWF.widget.O2Unit(copyData, node, {
\"
style
\"
:
\"
xform
\"
,
\"
lazy
\"
:true});
\r\n
break;
\r\n
case
\"
g
\"
:
\r\n
widget = new MWF.widget.O2Group(copyData, node, {
\"
style
\"
:
\"
xform
\"
,
\"
lazy
\"
:true});
\r\n
break;
\r\n
default:
\r\n
widget = new MWF.widget.O2Other(copyData, node, {
\"
style
\"
:
\"
xform
\"
,
\"
lazy
\"
:true});
\r\n
}
\r\n
widget.field = this;
\r\n
}.bind(this));
\r\n
}
\r\n
},
\r\n\r\n
hasEmpowerIdentity : function(){
\r\n
var data = this.getData();
\r\n
if(!this.empowerChecker )this.empowerChecker = new O2ProcessorMobile.EmpowerChecker(this.form, this.json, this.processor);
\r\n
return this.empowerChecker.hasEmpowerIdentity( data );
\r\n
},
\r\n
checkEmpower : function( data, callback, container, selectAllNode ){
\r\n
if( typeOf(data)===
\"
array
\"
&& this.identityOptions && this.json.isCheckEmpower && this.json.identityResultType ===
\"
identity
\"
) {
\r\n
if(!this.empowerChecker )this.empowerChecker = new O2ProcessorMobile.EmpowerChecker(this.form, this.json, this.processor);
\r\n
this.empowerChecker.selectAllNode = selectAllNode;
\r\n
this.empowerChecker.load(data, callback, container);
\r\n
}else{
\r\n
if( callback )callback( data );
\r\n
}
\r\n
},
\r\n\r\n
loadCheckEmpower : function( callback, container, selectAllNode ){
\r\n
this.checkEmpower( this.getData(), callback, container, selectAllNode)
\r\n
},
\r\n
saveCheckedEmpowerData:function( callback ){
\r\n
var data = this.getData();
\r\n
//this.empowerChecker.replaceEmpowerIdentity(data, function( newData ){
\r\n
this.empowerChecker.setIgnoreEmpowerFlag(data, function( newData ){
\r\n
var values = [];
\r\n
newData.each(function(d){
\r\n
values.push(MWF.org.parseOrgData(d, true));
\r\n
}.bind(this));
\r\n
this.setData( values );
\r\n
if( callback )callback(values)
\r\n
}.bind(this))
\r\n
},
\r\n\r\n
save: function( isValid ){
\r\n
if( isValid ){
\r\n
if( this.validation() ){
\r\n
return true;
\r\n
}else{
\r\n
return false;
\r\n
}
\r\n
}else{
\r\n
this.setData( this.getData() );
\r\n
return true;
\r\n
}
\r\n
},
\r\n\r\n
resetSelectorData : function(){
\r\n
if( this.selector && this.selector.selector ){
\r\n
this.selector.selector.emptySelectedItems();
\r\n
this.selector.selector.options.values = this.getValue();
\r\n
this.selector.selector.setSelectedItem();
\r\n
}
\r\n
},
\r\n
resetData: function(){
\r\n
var v = this.getValue();
\r\n
//this.setData((v) ? v.join(
\"
,
\"
) :
\"\"
);
\r\n
this.setData(v);
\r\n
},
\r\n
getData: function(){
\r\n
if( this.selector && !layout.mobile ){
\r\n
return this.getSelectedData();
\r\n
}else{
\r\n
return this.getValue();
\r\n
}
\r\n
},
\r\n
getSelectedData : function(){
\r\n
return this.getValue();
\r\n
},
\r\n
getValue: function(){
\r\n
var value = this._getBusinessData();
\r\n
if (!value) value = this._computeValue();
\r\n
return value ||
\"\"
;
\r\n
},
\r\n
_computeValue: function(){
\r\n
var values = [];
\r\n
if (this.json.identityValue) {
\r\n
this.json.identityValue.each(function(v){ if (v) values.push(v)});
\r\n
}
\r\n
if (this.json.unitValue) {
\r\n
this.json.unitValue.each(function(v){ if (v) values.push(v)});
\r\n
}
\r\n
if (this.json.dutyValue) {
\r\n
var dutys = JSON.decode(this.json.dutyValue);
\r\n
var par;
\r\n
if (dutys.length){
\r\n
dutys.each(function(duty){
\r\n
if (duty.code) par = this.form.Macro.exec(duty.code, this);
\r\n
var code =
\"
return this.org.getDuty(
\\\"\"
+duty.name+
\"\\\"
,
\\\"\"
+par+
\"\\\"
)
\"
;
\r\n\r\n
var d = this.form.Macro.exec(code, this);
\r\n
if (typeOf(d)!==
\"
array
\"
) d = (d) ? [d.toString()] : [];
\r\n
d.each(function(dd){if (dd) values.push(dd);});
\r\n\r\n
}.bind(this));
\r\n
}
\r\n
}
\r\n
if (this.json.defaultValue && this.json.defaultValue.code){
\r\n
var fd = this.form.Macro.exec(this.json.defaultValue.code, this);
\r\n
if (typeOf(fd)!==
\"
array
\"
) fd = (fd) ? [fd] : [];
\r\n
fd.each(function(fdd){
\r\n
if (fdd){
\r\n
if (typeOf(fdd)===
\"
string
\"
){
\r\n
var data;
\r\n
this.getOrgAction()[this.getValueMethod(fdd)](function(json){ data = json.data }.bind(this), null, fdd, false);
\r\n
values.push(data);
\r\n
}else{
\r\n
values.push(fdd);
\r\n
}
\r\n
}
\r\n
}.bind(this));
\r\n
}
\r\n
if (this.json.count>0){
\r\n
return values.slice(0, this.json.count);
\r\n
}
\r\n
return values;
\r\n
//return (this.json.defaultValue.code) ? this.form.Macro.exec(this.json.defaultValue.code, this): (value ||
\"\"
);
\r\n
},
\r\n
getOrgAction: function(){
\r\n
if (!this.orgAction) this.orgAction = MWF.Actions.get(
\"
x_organization_assemble_control
\"
);
\r\n
//if (!this.orgAction) this.orgAction = new MWF.xApplication.Selector.Actions.RestActions();
\r\n
return this.orgAction;
\r\n
},
\r\n
setData: function(value){
\r\n\r\n
if (!value) return false;
\r\n
var oldValues = this.getValue();
\r\n
var values = [];
\r\n\r\n
var type = typeOf(value);
\r\n
if (type===
\"
array
\"
){
\r\n
value.each(function(v){
\r\n
var vtype = typeOf(v);
\r\n
var data = null;
\r\n
if (vtype===
\"
string
\"
){
\r\n
this.getOrgAction()[this.getValueMethod(v)](function(json){ data = MWF.org.parseOrgData(json.data, true); }.bind(this), error, v, false);
\r\n
}
\r\n
if (vtype===
\"
object
\"
) {
\r\n
data = MWF.org.parseOrgData(v, true);
\r\n
if(data.woPerson)delete data.woPerson;
\r\n
}
\r\n
if (data)values.push(data);
\r\n
}.bind(this));
\r\n
}
\r\n
if (type===
\"
string
\"
){
\r\n
var vData;
\r\n
this.getOrgAction()[this.getValueMethod(value)](function(json){ vData = MWF.org.parseOrgData(json.data, true); }.bind(this), error, value, false);
\r\n
if (vData)values.push(vData);
\r\n
}
\r\n
if (type===
\"
object
\"
){
\r\n
var vData = MWF.org.parseOrgData(value, true);
\r\n
if(vData.woPerson)delete vData.woPerson;
\r\n
values.push( vData );
\r\n
}
\r\n\r\n
var change = false;
\r\n
if (oldValues.length && values.length){
\r\n
if (oldValues.length === values.length){
\r\n
for (var i=0; i<oldValues.length; i++){
\r\n
if ((oldValues[i].distinguishedName!==values[i].distinguishedName) || (oldValues[i].name!==values[i].name) || (oldValues[i].unique!==values[i].unique)){
\r\n
change = true;
\r\n
break;
\r\n
}
\r\n
}
\r\n
}else{
\r\n
change = true;
\r\n
}
\r\n
}else if (values.length || oldValues.length) {
\r\n
change = true;
\r\n
}
\r\n
this._setBusinessData(values);
\r\n
if (change) this.fireEvent(
\"
change
\"
);
\r\n
},
\r\n\r\n
getValueMethod: function(value){
\r\n
if (value){
\r\n
var flag = value.substr(value.length-1, 1);
\r\n
switch (flag.toLowerCase()){
\r\n
case
\"
i
\"
:
\r\n
return
\"
getIdentity
\"
;
\r\n
case
\"
p
\"
:
\r\n
return
\"
getPerson
\"
;
\r\n
case
\"
u
\"
:
\r\n
return
\"
getUnit
\"
;
\r\n
case
\"
g
\"
:
\r\n
return
\"
getGroup
\"
;
\r\n
default:
\r\n
return (this.json.selectType===
\"
unit
\"
) ?
\"
getUnit
\"
:
\"
getIdentity
\"
;
\r\n
}
\r\n
}
\r\n
return (this.json.selectType===
\"
unit
\"
) ?
\"
getUnit
\"
:
\"
getIdentity
\"
;
\r\n
},
\r\n\r\n
_getBusinessData: function(){
\r\n
if (this.json.section==
\"
yes
\"
){
\r\n
return this._getBusinessSectionData();
\r\n
}else {
\r\n
if (this.json.type===
\"
Opinion
\"
){
\r\n
return this._getBusinessSectionDataByPerson();
\r\n
}else{
\r\n
return this.form.businessData.data[this.json.name] ||
\"\"
;
\r\n
}
\r\n
}
\r\n
},
\r\n
_getBusinessSectionData: function(){
\r\n
switch (this.json.sectionBy){
\r\n
case
\"
person
\"
:
\r\n
return this._getBusinessSectionDataByPerson();
\r\n
case
\"
unit
\"
:
\r\n
return this._getBusinessSectionDataByUnit();
\r\n
case
\"
activity
\"
:
\r\n
return this._getBusinessSectionDataByActivity();
\r\n
case
\"
splitValue
\"
:
\r\n
return this._getBusinessSectionDataBySplitValue();
\r\n
case
\"
script
\"
:
\r\n
return this._getBusinessSectionDataByScript(this.json.sectionByScript.code);
\r\n
default:
\r\n
return this.form.businessData.data[this.json.name] ||
\"\"
;
\r\n
}
\r\n
},
\r\n
_getBusinessSectionDataByPerson: function(){
\r\n
this.form.sectionListObj[this.json.name] = layout.desktop.session.user.id;
\r\n
var dataObj = this.form.businessData.data[this.json.name];
\r\n
return (dataObj) ? (dataObj[layout.desktop.session.user.id] ||
\"\"
) :
\"\"
;
\r\n
},
\r\n
_getBusinessSectionDataByUnit: function(){
\r\n
this.form.sectionListObj[this.json.name] =
\"\"
;
\r\n
var key = (this.form.businessData.task) ? this.form.businessData.task.unit :
\"\"
;
\r\n
if (key) this.form.sectionListObj[this.json.name] = key;
\r\n
var dataObj = this.form.businessData.data[this.json.name];
\r\n
if (!dataObj) return
\"\"
;
\r\n
return (key) ? (dataObj[key] ||
\"\"
) :
\"\"
;
\r\n
},
\r\n
_getBusinessSectionDataByActivity: function(){
\r\n
this.form.sectionListObj[this.json.name] =
\"\"
;
\r\n
var key = (this.form.businessData.work) ? this.form.businessData.work.activity :
\"\"
;
\r\n
if (key) this.form.sectionListObj[this.json.name] = key;
\r\n
var dataObj = this.form.businessData.data[this.json.name];
\r\n
if (!dataObj) return
\"\"
;
\r\n
return (key) ? (dataObj[key] ||
\"\"
) :
\"\"
;
\r\n
},
\r\n
_getBusinessSectionDataBySplitValue: function(){
\r\n
this.form.sectionListObj[this.json.name] =
\"\"
;
\r\n
var key = (this.form.businessData.work) ? this.form.businessData.work.splitValue :
\"\"
;
\r\n
if (key) this.form.sectionListObj[this.json.name] = key;
\r\n
var dataObj = this.form.businessData.data[this.json.name];
\r\n
if (!dataObj) return
\"\"
;
\r\n
return (key) ? (dataObj[key] ||
\"\"
) :
\"\"
;
\r\n
},
\r\n
_getBusinessSectionDataByScript: function(code){
\r\n
this.form.sectionListObj[this.json.name] =
\"\"
;
\r\n
var dataObj = this.form.businessData.data[this.json.name];
\r\n
if (!dataObj) return
\"\"
;
\r\n
var key = this.form.Macro.exec(code, this);
\r\n
if (key) this.form.sectionListObj[this.json.name] = key;
\r\n
return (key) ? (dataObj[key] ||
\"\"
) :
\"\"
;
\r\n
},
\r\n\r\n
loadPathData: function(path){
\r\n
var data = null;
\r\n
this.form.workAction.getJobDataByPath(this.form.businessData.work.job, path, function(json){
\r\n
data = json.data || null;
\r\n
}, null, false);
\r\n
return data;
\r\n
},
\r\n\r\n
_setBusinessData: function(v){
\r\n
if (this.json.section==
\"
yes
\"
){
\r\n
// var d = this.loadPathData(this.json.name);
\r\n
// if (d) this.form.businessData.data[this.json.name] = d;
\r\n
this._setBusinessSectionData(v);
\r\n
}else {
\r\n
if (this.json.type===
\"
Opinion
\"
){
\r\n
// var d = this.loadPathData(this.json.name);
\r\n
// if (d) this.form.businessData.data[this.json.name] = d;
\r\n
this._setBusinessSectionDataByPerson(v);
\r\n
}else{
\r\n
if (this.form.businessData.data[this.json.name]){
\r\n
this.form.businessData.data[this.json.name] = v;
\r\n
}else{
\r\n
this.form.businessData.data[this.json.name] = v;
\r\n
this.form.Macro.environment.setData(this.form.businessData.data);
\r\n
}
\r\n
if (this.json.isTitle) this.form.businessData.work.title = v;
\r\n
}
\r\n
}
\r\n
},
\r\n
_setBusinessSectionData: function(v){
\r\n
switch (this.json.sectionBy){
\r\n
case
\"
person
\"
:
\r\n
this._setBusinessSectionDataByPerson(v);
\r\n
break;
\r\n
case
\"
unit
\"
:
\r\n
this._setBusinessSectionDataByUnit(v);
\r\n
break;
\r\n
case
\"
activity
\"
:
\r\n
this._setBusinessSectionDataByActivity(v);
\r\n
break;
\r\n
case
\"
splitValue
\"
:
\r\n
this._setBusinessSectionDataBySplitValue(v);
\r\n
break;
\r\n
case
\"
script
\"
:
\r\n
this._setBusinessSectionDataByScript(this.json.sectionByScript.code, v);
\r\n
break;
\r\n
default:
\r\n
if (this.form.businessData.data[this.json.name]){
\r\n
this.form.businessData.data[this.json.name] = v;
\r\n
}else{
\r\n
this.form.businessData.data[this.json.name] = v;
\r\n
this.form.Macro.environment.setData(this.form.businessData.data);
\r\n
}
\r\n
}
\r\n
},
\r\n
_setBusinessSectionDataByPerson: function(v){
\r\n
var resetData = false;
\r\n
var key = layout.desktop.session.user.id;
\r\n
this.form.sectionListObj[this.json.name] = key;
\r\n\r\n
var dataObj = this.form.businessData.data[this.json.name];
\r\n
if (!dataObj){
\r\n
dataObj = {};
\r\n
this.form.businessData.data[this.json.name] = dataObj;
\r\n
resetData = true;
\r\n
}
\r\n
if (!dataObj[key]) resetData = true;
\r\n
dataObj[key] = v;
\r\n\r\n
if (resetData) this.form.Macro.environment.setData(this.form.businessData.data);
\r\n
},
\r\n
_setBusinessSectionDataByUnit: function(v){
\r\n
var resetData = false;
\r\n
var key = (this.form.businessData.task) ? this.form.businessData.task.unit :
\"\"
;
\r\n\r\n
if (key){
\r\n
this.form.sectionListObj[this.json.name] = key;
\r\n
var dataObj = this.form.businessData.data[this.json.name];
\r\n
if (!dataObj){
\r\n
dataObj = {};
\r\n
this.form.businessData.data[this.json.name] = dataObj;
\r\n
resetData = true;
\r\n
}
\r\n
if (!dataObj[key]) resetData = true;
\r\n
dataObj[key] = v;
\r\n
}
\r\n\r\n
if (resetData) this.form.Macro.environment.setData(this.form.businessData.data);
\r\n
},
\r\n
_setBusinessSectionDataByActivity: function(v){
\r\n
var resetData = false;
\r\n
var key = (this.form.businessData.work) ? this.form.businessData.work.activity :
\"\"
;
\r\n\r\n
if (key){
\r\n
this.form.sectionListObj[this.json.name] = key;
\r\n
var dataObj = this.form.businessData.data[this.json.name];
\r\n
if (!dataObj){
\r\n
dataObj = {};
\r\n
this.form.businessData.data[this.json.name] = dataObj;
\r\n
resetData = true;
\r\n
}
\r\n
if (!dataObj[key]) resetData = true;
\r\n
dataObj[key] = v;
\r\n
}
\r\n\r\n
if (resetData) this.form.Macro.environment.setData(this.form.businessData.data);
\r\n
},
\r\n
_setBusinessSectionDataBySplitValue: function(v){
\r\n
var resetData = false;
\r\n
var key = (this.form.businessData.work) ? this.form.businessData.work.splitValue :
\"\"
;
\r\n\r\n
if (key){
\r\n
this.form.sectionListObj[this.json.name] = key;
\r\n
var dataObj = this.form.businessData.data[this.json.name];
\r\n
if (!dataObj){
\r\n
dataObj = {};
\r\n
this.form.businessData.data[this.json.name] = dataObj;
\r\n
resetData = true;
\r\n
}
\r\n
if (!dataObj[key]) resetData = true;
\r\n
dataObj[key] = v;
\r\n
}
\r\n\r\n
if (resetData) this.form.Macro.environment.setData(this.form.businessData.data);
\r\n
},
\r\n
_setBusinessSectionDataByScript: function(code, v){
\r\n
var resetData = false;
\r\n
var key = this.form.Macro.exec(code, this);
\r\n\r\n
if (key){
\r\n
this.form.sectionListObj[this.json.name] = key;
\r\n
var dataObj = this.form.businessData.data[this.json.name];
\r\n
if (!dataObj){
\r\n
dataObj = {};
\r\n
this.form.businessData.data[this.json.name] = dataObj;
\r\n
resetData = true;
\r\n
}
\r\n
if (!dataObj[key]) resetData = true;
\r\n
dataObj[key] = v;
\r\n
}
\r\n\r\n
if (resetData) this.form.Macro.environment.setData(this.form.businessData.data);
\r\n
},
\r\n\r\n
createErrorNode: function(text){
\r\n
var node;
\r\n
if( this.processor.css.errorContentNode ){
\r\n
node = new Element(
\"
div
\"
,{
\r\n
\"
styles
\"
: this.processor.css.errorContentNode,
\r\n
\"
text
\"
: text
\r\n
});
\r\n
if( this.processor.css.errorCloseNode ){
\r\n
var closeNode = new Element(
\"
div
\"
,{
\r\n
\"
styles
\"
: this.processor.css.errorCloseNode ,
\r\n
\"
events
\"
: {
\r\n
\"
click
\"
: function(){
\r\n
this.destroy();
\r\n
}.bind(node)
\r\n
}
\r\n
}).inject(node);
\r\n
}
\r\n
}else {
\r\n
node = new Element(
\"
div
\"
);
\r\n
var iconNode = new Element(
\"
div
\"
, {
\r\n
\"
styles
\"
: {
\r\n
\"
width
\"
:
\"
20px
\"
,
\r\n
\"
height
\"
:
\"
20px
\"
,
\r\n
\"
float
\"
:
\"
left
\"
,
\r\n
\"
background
\"
:
\"
url(
\"
+
\"
/x_component_process_Xform/$Form/default/icon/error.png) center center no-repeat
\"\r\n
}
\r\n
}).inject(node);
\r\n
var textNode = new Element(
\"
div
\"
, {
\r\n
\"
styles
\"
: {
\r\n
\"
height
\"
:
\"
20px
\"
,
\r\n
\"
line-height
\"
:
\"
20px
\"
,
\r\n
\"
margin-left
\"
:
\"
20px
\"
,
\r\n
\"
color
\"
:
\"
red
\"
,
\r\n
\"
word-break
\"
:
\"
keep-all
\"\r\n
},
\r\n
\"
text
\"
: text
\r\n
}).inject(node);
\r\n
}
\r\n
return node;
\r\n
},
\r\n
notValidationMode: function(text){
\r\n
if (!this.isNotValidationMode){
\r\n
//this.isNotValidationMode = true;
\r\n
//this.node.store(
\"
borderStyle
\"
, this.node.getStyles(
\"
border-left
\"
,
\"
border-right
\"
,
\"
border-top
\"
,
\"
border-bottom
\"
));
\r\n
//this.node.setStyle(
\"
border-color
\"
,
\"
red
\"
);
\r\n\r\n
this.errNode = this.createErrorNode(text);
\r\n
if( this.errContainer ){
\r\n
this.errContainer.empty();
\r\n
this.errNode.inject(this.errContainer);
\r\n
}else{
\r\n
this.errNode.inject(this.container,
\"
after
\"
);
\r\n
}
\r\n
//this.showNotValidationMode(this.node);
\r\n
//if (!this.node.isIntoView()) this.node.scrollIntoView();
\r\n
}
\r\n
},
\r\n
validation: function(){
\r\n
var data = this.getData();
\r\n
this.setData( data );
\r\n
var flag=true;
\r\n
if( this.json.validationCount && typeOf( this.json.validationCount.toInt() ) ===
\"
number
\"
){
\r\n
if( data.length < this.json.validationCount.toInt() ){
\r\n
//if( this.json.validationCount.toInt() === 1 ){
\r\n
// flag =
\"
请选择
\"\r\n
//}else{
\r\n
// flag =
\"
请至少选择
\"
+this.json.validationCount+
\"
项
\"\r\n
//}
\r\n
flag =
\"
请至少选择
\"
+this.json.validationCount+
\"
项
\"\r\n
}
\r\n
}
\r\n\r\n
if( flag === true ){
\r\n
if ( this.json.validation && this.json.validation.code){
\r\n
flag = this.form.Macro.exec(this.json.validation.code, this);
\r\n
if (!flag) flag =
\"
数据校验未通过
\"
;
\r\n
}
\r\n
}
\r\n\r\n
if (flag.toString()!=
\"
true
\"
){
\r\n
this.notValidationMode(flag);
\r\n
return false;
\r\n
}else if(this.errNode){
\r\n
this.errNode.destroy()
\r\n
}
\r\n
return true;
\r\n
}
\r\n
});
\r\n\r\n
O2ProcessorMobile.EmpowerChecker = new Class({
\r\n
Extends : MWF.APPOrg.EmpowerChecker,
\r\n
initialize: function (form, json, processor) {
\r\n
this.form = form;
\r\n
this.json = json;
\r\n
this.processor = processor;
\r\n
this.css = this.processor.css;
\r\n
this.checkedAllItems = true;
\r\n
},
\r\n
hasEmpowerIdentity: function( data ){
\r\n
var flag = false;
\r\n
if( typeOf(data)===
\"
array
\"
&& this.json.isCheckEmpower && this.json.identityResultType ===
\"
identity
\"
) {
\r\n
var array = [];
\r\n
data.each(function (d) {
\r\n
if (d.distinguishedName) {
\r\n
var flag = d.distinguishedName.substr(d.distinguishedName.length - 1, 1).toLowerCase();
\r\n
if (flag ===
\"
i
\"
)array.push(d.distinguishedName)
\r\n
}
\r\n
}.bind(this));
\r\n
if (array.length > 0) {
\r\n
o2.Actions.get(
\"
x_organization_assemble_express
\"
).listEmpowerWithIdentity({
\r\n
\"
application
\"
: (this.form.businessData.work || this.form.businessData.workCompleted).application,
\r\n
\"
process
\"
: (this.form.businessData.work || this.form.businessData.workCompleted).process,
\r\n
\"
work
\"
: (this.form.businessData.work || this.form.businessData.workCompleted).id,
\r\n
\"
identityList
\"
: array
\r\n
}, function (json) {
\r\n
var arr = [];
\r\n
json.data.each(function (d) {
\r\n
if (d.fromIdentity !== d.toIdentity)
\r\n
arr.push(d);
\r\n
});
\r\n
if (arr.length > 0) {
\r\n
flag = true;
\r\n
}
\r\n
}.bind(this), null, false)
\r\n
}
\r\n
}
\r\n
return flag;
\r\n
},
\r\n
getSelectedData : function( callback ){
\r\n
var json = {};
\r\n
this.empowerSelectNodes.each(function(node){
\r\n
if( node.retrieve(
\"
isSelected
\"
) ){
\r\n
var d = node.retrieve(
\"
data
\"
);
\r\n
json[ d.fromIdentity ] = d;
\r\n
}
\r\n
}.bind(this));
\r\n
if( callback )callback( json );
\r\n
}
\r\n
});
\r\n\r\n
O2ProcessorMobile.UnitOptions = new Class({
\r\n
Extends : MWF.APPOrg.UnitOptions
\r\n
});
\r\n\r\n
O2ProcessorMobile.IdentityOptions = new Class({
\r\n
Extends : MWF.APPOrg.IdentityOptions
\r\n
});"
},
"load"
:
{
"code"
:
"this.loadProcessorMobile()"
,
"html"
:
"this.loadProcessorMobile()"
}
},
"properties"
:
{
"text"
:
"这里的queryLoad加载源码,load事件执行初始化"
},
"isSaved"
:
true
,
"pid"
:
"Mobile3af5d031-b50b-465b-bc8c-cc13e3327549div_loadSubmitForm"
,
"moduleName"
:
"div"
,
"recoveryStyles"
:
{
"display"
:
"none"
},
"preprocessing"
:
"y"
}
},
"formStyleType"
:
"defaultMobile"
,
"pid"
:
"Mobile3af5d031-b50b-465b-bc8c-cc13e33275493af5d031-b50b-465b-bc8c-cc13e3327549"
,
"submitFormType"
:
"select"
,
"isPrompt"
:
true
,
"promptPosition"
:
"center"
,
"defaultTools"
:
[
{
"type"
:
"MWFToolBarButton"
,
"img"
:
"save.png"
,
"title"
:
"{{$.lp.saveTitle}}"
,
"action"
:
"saveWork"
,
"text"
:
"{{$.lp.save}}"
,
"id"
:
"action_saveData"
,
"control"
:
"allowSave"
,
"condition"
:
""
,
"read"
:
false
},
{
"type"
:
"MWFToolBarButton"
,
"img"
:
"submit.png"
,
"title"
:
"{{$.lp.flowTitle}}"
,
"action"
:
"processWork"
,
"text"
:
"{{$.lp.flow}}"
,
"id"
:
"action_processWork"
,
"control"
:
"allowProcessing"
,
"condition"
:
""
,
"read"
:
false
},
{
"type"
:
"MWFToolBarButton"
,
"img"
:
"retract.png"
,
"title"
:
"{{$.lp.retractTitle}}"
,
"action"
:
"retractWork"
,
"text"
:
"{{$.lp.retract}}"
,
"id"
:
"action_retract"
,
"control"
:
"allowRetract"
,
"condition"
:
""
,
"read"
:
true
},
{
"type"
:
"MWFToolBarButton"
,
"img"
:
"read.png"
,
"title"
:
"{{$.lp.setReaded}}"
,
"action"
:
"readedWork"
,
"text"
:
"{{$.lp.readed}}"
,
"id"
:
"action_readed"
,
"control"
:
"allowReadProcessing"
,
"condition"
:
""
,
"read"
:
true
},
{
"type"
:
"MWFToolBarButton"
,
"img"
:
"rollback.png"
,
"title"
:
"{{$.lp.rollbackTitle}}"
,
"action"
:
"rollback"
,
"text"
:
"{{$.lp.rollback}}"
,
"id"
:
"action_rollback"
,
"control"
:
"allowRollback"
,
"condition"
:
""
,
"read"
:
true
},
{
"type"
:
"MWFToolBarButton"
,
"img"
:
"del.png"
,
"title"
:
"{{$.lp.deleteTitle}}"
,
"action"
:
"deleteWork"
,
"text"
:
"{{$.lp.delete}}"
,
"id"
:
"action_delete"
,
"control"
:
"allowDelete"
,
"condition"
:
""
,
"read"
:
false
},
{
"type"
:
"MWFToolBarButton"
,
"img"
:
"press.png"
,
"title"
:
"{{$.lp.pressTitle}}"
,
"action"
:
"pressWork"
,
"text"
:
"{{$.lp.press}}"
,
"id"
:
"action_press"
,
"control"
:
"allowPress"
,
"condition"
:
""
,
"read"
:
true
}
],
"tools"
:
[],
"styleConfig"
:
{
"name"
:
"手机样式"
,
"file"
:
"styles_defaultMobile.json"
,
"mode"
:
[
"pc"
,
"mobile"
]
},
"languageType"
:
"none"
,
"afterProcessAction"
:
"close"
,
"subformList"
:
[],
"$version"
:
"5.2"
,
"submitScript"
:
{
"code"
:
"layout.mobile ? this.popupProcessorMobile() : this.popupProcessor();"
}
},
"html"
:
"<div class=
\"
css css3af5d031b50b465bbc8ccc13e3327549
\"
id=
\"
3af5d031-b50b-465b-bc8c-cc13e3327549_undefined
\"
mwftype=
\"
form
\"
style=
\"\"
><div id=
\"
submitNode
\"
mwftype=
\"
div
\"
style=
\"
height: 100%; min-height: 280px; background-color: rgb(238, 238, 238);
\"
><div id=
\"
submitInnerNode
\"
mwftype=
\"
div
\"
style=
\"\"
><div id=
\"
submitContentWrapNode
\"
mwftype=
\"
div
\"
style=
\"\"
><div id=
\"
submitContentNode
\"
mwftype=
\"
div
\"
style=
\"\"
><div id=
\"
submitContentInnerNode
\"
mwftype=
\"
div
\"
style=
\"\"
><div id=
\"
routeGroupTitle
\"
mwftype=
\"
label
\"
style=
\"
overflow: hidden; height: 30px; line-height: 30px; font-size: 14px; font-weight: bold; background-color: rgb(238, 238, 238); color: rgb(51, 51, 51); padding-left: 20px;
\"
>选择决策组</div><div id=
\"
routeGroupArea
\"
mwftype=
\"
div
\"
style=
\"
overflow: hidden; min-height: 40px; background-color: rgb(255, 255, 255);
\"
></div><div id=
\"
routeSelectorTitle
\"
mwftype=
\"
label
\"
style=
\"
overflow: hidden; height: 30px; line-height: 30px; font-size: 14px; font-weight: bold; background-color: rgb(238, 238, 238); color: rgb(51, 51, 51); padding-left: 20px;
\"
>选择决策</div><div id=
\"
routeSelectorArea
\"
mwftype=
\"
div
\"
style=
\"
overflow: hidden; min-height: 40px; background-color: rgb(255, 255, 255);
\"
></div><div id=
\"
routeOpinionTile
\"
mwftype=
\"
label
\"
style=
\"
overflow: hidden; height: 30px; line-height: 30px; font-size: 14px; font-weight: bold; background-color: rgb(238, 238, 238); color: rgb(51, 51, 51); padding-left: 20px;
\"
>填写意见</div><div id=
\"
inputOpinionNode
\"
mwftype=
\"
div
\"
style=
\"
height: 129px; border-right: 0px solid rgb(102, 129, 165); overflow: hidden; border-left: 0px solid rgb(102, 129, 165); background-color: rgb(238, 238, 238);
\"
><div id=
\"
inputTextarea
\"
mwftype=
\"
textarea
\"
placeholder=
\"
请在此处填写流程意见
\"
style=
\"
position: relative; padding-right: 2px; border: 0px solid rgb(204, 204, 204); color: rgb(102, 102, 102);
\"
><textarea style=
\"
background: rgb(255, 255, 255); width: 100%; border-width: 1px; border-style: solid; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-image: none 100% / 1 / 0 stretch; height: 120px; margin-right: 1px; font-size: 100%; resize: none; padding: 3px; overflow: hidden auto; color: rgb(102, 102, 102);
\"
></textarea></div><div id=
\"
mediaActionArea
\"
mwftype=
\"
div
\"
style=
\"
position: relative; height: 25px; line-height: 25px; top: -32px; margin-right: 5px;
\"
><div id=
\"
handwritingAction
\"
mwftype=
\"
div
\"
style=
\"
float: right; border: 1px solid rgb(102, 129, 165); border-radius: 3px; cursor: pointer; padding-left: 24px; padding-right: 5px; margin-left: 5px; background: url("/x_component_process_Work/$Processor/default/write.png") 5px center no-repeat; width: 28px; height: 25px;
\"
>手写</div></div></div><div id=
\"
selectIdeaNode
\"
mwftype=
\"
div
\"
style=
\"
background-color: rgb(238, 238, 238); max-height: 200px; clear: both; overflow: hidden;
\"
><div id=
\"
selectIdeaAreaNode
\"
mwftype=
\"
div
\"
style=
\"
overflow: auto; max-height: 200px;
\"
></div></div><div id=
\"
orgsTile
\"
mwftype=
\"
label
\"
style=
\"
overflow: hidden; height: 30px; line-height: 30px; font-size: 14px; font-weight: bold; background-color: rgb(238, 238, 238); color: rgb(51, 51, 51); padding-left: 20px;
\"
>选择人员</div><div id=
\"
orgsArea
\"
mwftype=
\"
div
\"
style=
\"\"
></div></div></div></div><div id=
\"
submitButtonNode
\"
mwftype=
\"
div
\"
style=
\"
height: 50px; overflow: hidden; clear: both; margin-top: 10px;
\"
><div id=
\"
okButton
\"
mwftype=
\"
div
\"
style=
\"
width: 45%; height: 3em; float: left; margin-left: 0.5em; color: rgb(255, 255, 255); background: rgb(50, 150, 250); border-radius: 5px; border: 1px solid rgb(50, 150, 250);
\"
><div id=
\"
okIconNode
\"
mwftype=
\"
div
\"
style=
\"
height: 3em; width: 3em; float: left; background: url("/x_component_process_Work/$Processor/default/ok-18.png") center center no-repeat;
\"
></div><div id=
\"
okTextNode
\"
mwftype=
\"
label
\"
style=
\"
font-size: 1em; margin-left: 3em; margin-right: 3em; line-height: 3em; text-align: center;
\"
>确定</div></div><div id=
\"
cancelButton
\"
mwftype=
\"
div
\"
style=
\"
width: 45%; height: 3em; float: right; margin-right: 0.5em; background: rgb(255, 255, 255); border-radius: 5px; border: 1px solid rgb(223, 223, 223);
\"
><div id=
\"
cancelIconNode
\"
mwftype=
\"
div
\"
style=
\"
height: 3em; width: 3em; float: left; background: url("/x_component_process_Work/$Processor/default/cancel-18.png") center center no-repeat;
\"
></div><div id=
\"
label
\"
mwftype=
\"
label
\"
style=
\"
font-size: 1em; color: rgb(25, 31, 37); margin-left: 3em; margin-right: 3em; line-height: 3em; text-align: center;
\"
>取消</div></div></div></div></div><div id=
\"
div_loadSubmitForm
\"
mwftype=
\"
div
\"
style=
\"
display: none;
\"
>这里的queryLoad加载源码,load事件执行初始化</div></div>"
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录