Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
浙江兰德纵横网络技术股份有限公司
o2oa
提交
db4ee4dd
o2oa
项目概览
浙江兰德纵横网络技术股份有限公司
/
o2oa
通知
339
Star
10
Fork
6
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
db4ee4dd
编写于
9月 10, 2021
作者:
NoSubject
提交者:
NoSubject
9月 11, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
elementUI组件支持数据模板和区段
(cherry picked from commit
850ceb9a
)
上级
165558c3
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
100 addition
and
73 deletion
+100
-73
o2web/source/x_component_process_Xform/$ElModule.js
o2web/source/x_component_process_Xform/$ElModule.js
+2
-2
o2web/source/x_component_process_Xform/$Module.js
o2web/source/x_component_process_Xform/$Module.js
+54
-54
o2web/source/x_component_process_Xform/Elcommon.js
o2web/source/x_component_process_Xform/Elcommon.js
+44
-17
未找到文件。
o2web/source/x_component_process_Xform/$ElModule.js
浏览文件 @
db4ee4dd
...
...
@@ -56,7 +56,7 @@ o2.xApplication.process.Xform.$ElModule = MWF.APP$ElModule = new Class(
if
(
arr
.
length
>
1
&&
arr
[
1
]){
var
modelId
=
this
.
json
.
id
.
substring
(
0
,
this
.
json
.
id
.
lastIndexOf
(
"
..
"
));
modelId
=
(
modelId
)
?
modelId
+
"
..
"
+
arr
[
1
]
:
arr
[
1
];
this
.
json
[
arr
[
1
]]
=
this
.
getBusinessDataById
(
null
,
modelId
)
;
this
.
json
[
arr
[
1
]]
=
this
.
_getBusinessData
(
modelId
)
||
""
;
this
.
vModels
.
push
(
arr
[
1
]);
}
}
...
...
@@ -121,7 +121,7 @@ o2.xApplication.process.Xform.$ElModule = MWF.APP$ElModule = new Class(
app
.
watch
[
m
]
=
function
(
val
,
oldVal
){
var
modelId
=
this
.
json
.
id
.
substring
(
0
,
this
.
json
.
id
.
lastIndexOf
(
"
..
"
));
modelId
=
(
modelId
)
?
modelId
+
"
..
"
+
m
:
m
;
this
.
setBusinessDataById
(
val
,
modelId
);
this
.
_setBusinessData
(
val
,
modelId
);
}.
bind
(
this
);
}.
bind
(
this
));
}
...
...
o2web/source/x_component_process_Xform/$Module.js
浏览文件 @
db4ee4dd
...
...
@@ -209,16 +209,16 @@ MWF.xApplication.process.Xform.$Module = MWF.APP$Module = new Class(
}.
bind
(
this
));
}
},
_getBusinessData
:
function
(){
_getBusinessData
:
function
(
id
){
var
v
;
if
(
this
.
json
.
section
==
"
yes
"
){
v
=
this
.
_getBusinessSectionData
();
v
=
this
.
_getBusinessSectionData
(
id
);
}
else
{
if
(
this
.
json
.
type
===
"
Opinion
"
){
v
=
this
.
_getBusinessSectionDataByPerson
();
v
=
this
.
_getBusinessSectionDataByPerson
(
id
);
}
else
{
// return this.form.businessData.data[this.json.id] || "";
var
value
=
this
.
getBusinessDataById
();
var
value
=
this
.
getBusinessDataById
(
null
,
id
);
return
(
o2
.
typeOf
(
value
)
!==
"
null
"
)
?
value
:
""
;
//return this.getBusinessDataById() || "";
}
...
...
@@ -226,63 +226,63 @@ MWF.xApplication.process.Xform.$Module = MWF.APP$Module = new Class(
//if (o2.typeOf(v)==="string") v = o2.dtxt(v);
return
v
;
},
_getBusinessSectionData
:
function
(){
_getBusinessSectionData
:
function
(
id
){
switch
(
this
.
json
.
sectionBy
){
case
"
person
"
:
return
this
.
_getBusinessSectionDataByPerson
();
return
this
.
_getBusinessSectionDataByPerson
(
id
);
case
"
unit
"
:
return
this
.
_getBusinessSectionDataByUnit
();
return
this
.
_getBusinessSectionDataByUnit
(
id
);
case
"
activity
"
:
return
this
.
_getBusinessSectionDataByActivity
();
return
this
.
_getBusinessSectionDataByActivity
(
id
);
case
"
splitValue
"
:
return
this
.
_getBusinessSectionDataBySplitValue
();
return
this
.
_getBusinessSectionDataBySplitValue
(
id
);
case
"
script
"
:
return
this
.
_getBusinessSectionDataByScript
(((
this
.
json
.
sectionByScript
)
?
this
.
json
.
sectionByScript
.
code
:
""
));
return
this
.
_getBusinessSectionDataByScript
(((
this
.
json
.
sectionByScript
)
?
this
.
json
.
sectionByScript
.
code
:
""
)
,
id
);
default
:
// return this.form.businessData.data[this.json.id] || "";
return
this
.
getBusinessDataById
()
||
""
;
return
this
.
getBusinessDataById
(
null
,
id
)
||
""
;
}
},
_getBusinessSectionDataByPerson
:
function
(){
this
.
form
.
sectionListObj
[
this
.
json
.
id
]
=
layout
.
desktop
.
session
.
user
.
id
;
_getBusinessSectionDataByPerson
:
function
(
id
){
this
.
form
.
sectionListObj
[
id
||
this
.
json
.
id
]
=
layout
.
desktop
.
session
.
user
.
id
;
// var dataObj = this.form.businessData.data[this.json.id];
var
dataObj
=
this
.
getBusinessDataById
();
var
dataObj
=
this
.
getBusinessDataById
(
null
,
id
);
return
(
dataObj
)
?
(
dataObj
[
layout
.
desktop
.
session
.
user
.
id
]
||
""
)
:
""
;
},
_getBusinessSectionDataByUnit
:
function
(){
this
.
form
.
sectionListObj
[
this
.
json
.
id
]
=
""
;
_getBusinessSectionDataByUnit
:
function
(
id
){
this
.
form
.
sectionListObj
[
id
||
this
.
json
.
id
]
=
""
;
// var dataObj = this.form.businessData.data[this.json.id];
var
dataObj
=
this
.
getBusinessDataById
();
var
dataObj
=
this
.
getBusinessDataById
(
null
,
id
);
if
(
!
dataObj
)
return
""
;
var
key
=
(
this
.
form
.
businessData
.
task
)
?
this
.
form
.
businessData
.
task
.
unit
:
""
;
if
(
key
)
this
.
form
.
sectionListObj
[
this
.
json
.
id
]
=
key
;
if
(
key
)
this
.
form
.
sectionListObj
[
id
||
this
.
json
.
id
]
=
key
;
return
(
key
)
?
(
dataObj
[
key
]
||
""
)
:
""
;
},
_getBusinessSectionDataByActivity
:
function
(){
this
.
form
.
sectionListObj
[
this
.
json
.
id
]
=
""
;
_getBusinessSectionDataByActivity
:
function
(
id
){
this
.
form
.
sectionListObj
[
id
||
this
.
json
.
id
]
=
""
;
// var dataObj = this.form.businessData.data[this.json.id];
var
dataObj
=
this
.
getBusinessDataById
();
var
dataObj
=
this
.
getBusinessDataById
(
null
,
id
);
if
(
!
dataObj
)
return
""
;
var
key
=
(
this
.
form
.
businessData
.
work
)
?
this
.
form
.
businessData
.
work
.
activity
:
""
;
if
(
key
)
this
.
form
.
sectionListObj
[
this
.
json
.
id
]
=
key
;
if
(
key
)
this
.
form
.
sectionListObj
[
id
||
this
.
json
.
id
]
=
key
;
return
(
key
)
?
(
dataObj
[
key
]
||
""
)
:
""
;
},
_getBusinessSectionDataBySplitValue
:
function
(){
this
.
form
.
sectionListObj
[
this
.
json
.
id
]
=
""
;
_getBusinessSectionDataBySplitValue
:
function
(
id
){
this
.
form
.
sectionListObj
[
id
||
this
.
json
.
id
]
=
""
;
// var dataObj = this.form.businessData.data[this.json.id];
var
dataObj
=
this
.
getBusinessDataById
();
var
dataObj
=
this
.
getBusinessDataById
(
null
,
id
);
if
(
!
dataObj
)
return
""
;
var
key
=
(
this
.
form
.
businessData
.
work
)
?
this
.
form
.
businessData
.
work
.
splitValue
:
""
;
if
(
key
)
this
.
form
.
sectionListObj
[
this
.
json
.
id
]
=
key
;
if
(
key
)
this
.
form
.
sectionListObj
[
id
||
this
.
json
.
id
]
=
key
;
return
(
key
)
?
(
dataObj
[
key
]
||
""
)
:
""
;
},
_getBusinessSectionDataByScript
:
function
(
code
){
this
.
form
.
sectionListObj
[
this
.
json
.
id
]
=
""
;
_getBusinessSectionDataByScript
:
function
(
code
,
id
){
this
.
form
.
sectionListObj
[
id
||
this
.
json
.
id
]
=
""
;
// var dataObj = this.form.businessData.data[this.json.id];
var
dataObj
=
this
.
getBusinessDataById
();
var
dataObj
=
this
.
getBusinessDataById
(
null
,
id
);
if
(
!
dataObj
)
return
""
;
var
key
=
this
.
form
.
Macro
.
exec
(
code
,
this
);
if
(
key
)
this
.
form
.
sectionListObj
[
this
.
json
.
id
]
=
key
;
if
(
key
)
this
.
form
.
sectionListObj
[
id
||
this
.
json
.
id
]
=
key
;
return
(
key
)
?
(
dataObj
[
key
]
||
""
)
:
""
;
},
_setEnvironmentData
:
function
(
v
){
...
...
@@ -384,67 +384,67 @@ MWF.xApplication.process.Xform.$Module = MWF.APP$Module = new Class(
return
evdata
;
},
_setBusinessData
:
function
(
v
){
_setBusinessData
:
function
(
v
,
id
){
//if (o2.typeOf(v)==="string") v = o2.txt(v);
if
(
this
.
json
.
section
==
"
yes
"
){
this
.
_setBusinessSectionData
(
v
);
this
.
_setBusinessSectionData
(
v
,
id
);
}
else
{
if
(
this
.
json
.
type
===
"
Opinion
"
){
this
.
_setBusinessSectionDataByPerson
(
v
);
this
.
_setBusinessSectionDataByPerson
(
v
,
id
);
}
else
{
this
.
setBusinessDataById
(
v
);
this
.
setBusinessDataById
(
v
,
id
);
if
(
this
.
json
.
isTitle
)
this
.
form
.
businessData
.
$work
.
title
=
v
;
}
}
},
_setBusinessSectionData
:
function
(
v
){
_setBusinessSectionData
:
function
(
v
,
id
){
switch
(
this
.
json
.
sectionBy
){
case
"
person
"
:
this
.
_setBusinessSectionDataByPerson
(
v
);
this
.
_setBusinessSectionDataByPerson
(
v
,
id
);
break
;
case
"
unit
"
:
this
.
_setBusinessSectionDataByUnit
(
v
);
this
.
_setBusinessSectionDataByUnit
(
v
,
id
);
break
;
case
"
activity
"
:
this
.
_setBusinessSectionDataByActivity
(
v
);
this
.
_setBusinessSectionDataByActivity
(
v
,
id
);
break
;
case
"
splitValue
"
:
this
.
_setBusinessSectionDataBySplitValue
(
v
);
this
.
_setBusinessSectionDataBySplitValue
(
v
,
id
);
break
;
case
"
script
"
:
this
.
_setBusinessSectionDataByScript
(
this
.
json
.
sectionByScript
.
code
,
v
);
this
.
_setBusinessSectionDataByScript
(
this
.
json
.
sectionByScript
.
code
,
v
,
id
);
break
;
default
:
this
.
setBusinessDataById
(
v
);
this
.
setBusinessDataById
(
v
,
id
);
}
},
_setBusinessSectionDataByPerson
:
function
(
v
){
_setBusinessSectionDataByPerson
:
function
(
v
,
id
){
var
key
=
layout
.
desktop
.
session
.
user
.
id
;
this
.
_setBusinessSectionDataByKey
(
key
,
v
);
this
.
_setBusinessSectionDataByKey
(
key
,
v
,
id
);
},
_setBusinessSectionDataByUnit
:
function
(
v
){
_setBusinessSectionDataByUnit
:
function
(
v
,
id
){
var
key
=
(
this
.
form
.
businessData
.
task
)
?
this
.
form
.
businessData
.
task
.
unit
:
""
;
this
.
_setBusinessSectionDataByKey
(
key
,
v
);
this
.
_setBusinessSectionDataByKey
(
key
,
v
,
id
);
},
_setBusinessSectionDataByActivity
:
function
(
v
){
_setBusinessSectionDataByActivity
:
function
(
v
,
id
){
var
key
=
(
this
.
form
.
businessData
.
work
)
?
this
.
form
.
businessData
.
work
.
activity
:
""
;
this
.
_setBusinessSectionDataByKey
(
key
,
v
);
this
.
_setBusinessSectionDataByKey
(
key
,
v
,
id
);
},
_setBusinessSectionDataBySplitValue
:
function
(
v
){
_setBusinessSectionDataBySplitValue
:
function
(
v
,
id
){
var
key
=
(
this
.
form
.
businessData
.
work
)
?
this
.
form
.
businessData
.
work
.
splitValue
:
""
;
this
.
_setBusinessSectionDataByKey
(
key
,
v
);
this
.
_setBusinessSectionDataByKey
(
key
,
v
,
id
);
},
_setBusinessSectionDataByScript
:
function
(
code
,
v
){
_setBusinessSectionDataByScript
:
function
(
code
,
v
,
id
){
var
key
=
this
.
form
.
Macro
.
exec
(
code
,
this
);
this
.
_setBusinessSectionDataByKey
(
key
,
v
);
this
.
_setBusinessSectionDataByKey
(
key
,
v
,
id
);
},
_setBusinessSectionDataByKey
:
function
(
key
,
v
){
_setBusinessSectionDataByKey
:
function
(
key
,
v
,
id
){
if
(
key
){
var
dataObj
=
this
.
getBusinessDataById
();
var
dataObj
=
this
.
getBusinessDataById
(
null
,
id
);
var
evdata
;
if
(
!
dataObj
){
dataObj
=
{};
evdata
=
this
.
setBusinessDataById
(
dataObj
);
evdata
=
this
.
setBusinessDataById
(
dataObj
,
id
);
}
dataObj
[
key
]
=
v
;
if
(
evdata
)
evdata
.
check
(
key
,
v
);
...
...
o2web/source/x_component_process_Xform/Elcommon.js
浏览文件 @
db4ee4dd
...
...
@@ -44,8 +44,10 @@ o2.xApplication.process.Xform.Elcommon = o2.APPElcommon = new Class(
},
_loadUserInterface
:
function
(){
debugger
;
this
.
field
=
true
;
this
.
node
.
set
(
"
html
"
,
this
.
_createElementHtml
());
this
.
_checkVueHtml
();
//this._checkVueHtml();
this
.
_checkVmodel
();
this
.
node
.
set
({
"
id
"
:
this
.
json
.
id
,
...
...
@@ -95,10 +97,10 @@ o2.xApplication.process.Xform.Elcommon = o2.APPElcommon = new Class(
switch
(
ty
){
case
"
object
"
:
Object
.
keys
(
app
.
data
).
each
(
function
(
k
){
if
(
!
this
.
json
.
hasOwnProperty
(
k
))
this
.
json
[
k
]
=
app
.
data
[
k
];
this
.
json
[
k
]
=
app
.
data
[
k
];
//this.form.Macro.environment.data.add(k, app.data[k]);
}.
bind
(
this
));
app
.
data
=
this
.
this
.
json
;
app
.
data
=
this
.
json
;
// app.data = this.json;
// app.data = Object.merge(this.json, this.form.Macro.environment.data);
break
;
...
...
@@ -111,7 +113,7 @@ o2.xApplication.process.Xform.Elcommon = o2.APPElcommon = new Class(
//_self.form.Macro.environment.data.add(_self.json.id, d);
Object
.
keys
(
d
).
each
(
function
(
k
){
if
(
!
_self
.
json
.
hasOwnProperty
(
k
))
_self
.
json
[
k
]
=
d
[
k
];
_self
.
json
[
k
]
=
d
[
k
];
//_self.form.Macro.environment.data.add(k, d[k]);
});
//var data = Object.merge(_slef.json);
...
...
@@ -165,24 +167,49 @@ o2.xApplication.process.Xform.Elcommon = o2.APPElcommon = new Class(
// return html;
// },
_checkVmodel
:
function
(
text
){
if
(
text
){
// if (text){
// this.vModels = [];
// var reg = /(?:v-model)(?:.lazy|.number|.trim)?(?:\s*=\s*)(?:["'])?([^"']*)/g;
// var arr;
// while ((arr = reg.exec(text)) !== null) {
// if (arr.length>1 && arr[1]){
// var modelId = this.json.id.substring(0, this.json.id.lastIndexOf(".."));
// modelId = (modelId) ? modelId+".."+arr[1] : arr[1];
// this.json[arr[1]] = this._getBusinessData(modelId);
// this.vModels.push(arr[1]);
// }
// }
// }
var
nodes
=
this
.
node
.
querySelectorAll
(
"
*[v-model]
"
);
this
.
vModels
=
[];
var
reg
=
/
(?:
v-model
)(?:
.lazy|.number|.trim
)?(?:\s
*=
\s
*
)(?:[
"'
])?([^
"'
]
*
)
/g
;
var
arr
;
while
((
arr
=
reg
.
exec
(
text
))
!==
null
)
{
if
(
arr
.
length
>
1
&&
arr
[
1
]){
var
arrs
=
[
"
el-checkbox-group
"
];
nodes
.
forEach
(
function
(
node
){
var
model
=
node
.
get
(
"
v-model
"
);
var
tag
=
node
.
tagName
.
toString
().
toLowerCase
();
if
(
model
){
var
modelId
=
this
.
json
.
id
.
substring
(
0
,
this
.
json
.
id
.
lastIndexOf
(
"
..
"
));
modelId
=
(
modelId
)
?
modelId
+
"
..
"
+
arr
[
1
]
:
arr
[
1
]
;
this
.
json
[
arr
[
1
]]
=
this
.
getBusinessDataById
(
null
,
modelId
);
this
.
vModels
.
push
(
arr
[
1
]);
}
modelId
=
(
modelId
)
?
modelId
+
"
..
"
+
model
:
model
;
this
.
json
[
model
]
=
this
.
_getBusinessData
(
modelId
);
if
(
!
this
.
json
[
model
]){
this
.
json
[
model
]
=
(
arrs
.
indexOf
(
tag
)
===-
1
)
?
""
:
[]
}
this
.
vModels
.
push
(
model
);
}
}.
bind
(
this
));
},
_createElementHtml
:
function
(){
var
html
=
this
.
json
.
vueTemplate
||
""
;
if
(
html
)
this
.
_checkVmodel
(
html
);
//
if (html) this._checkVmodel(html);
// return this._filterHtml(html);
return
html
;
},
resetData
:
function
(){
if
(
this
.
vModels
&&
this
.
vModels
.
length
){
this
.
vModels
.
forEach
(
function
(
m
){
var
modelId
=
this
.
json
.
id
.
substring
(
0
,
this
.
json
.
id
.
lastIndexOf
(
"
..
"
));
modelId
=
(
modelId
)
?
modelId
+
"
..
"
+
m
:
m
;
this
.
json
[
m
]
=
this
.
_getBusinessData
(
modelId
);
}.
bind
(
this
));
}
},
});
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录