提交 4987c061 编写于 作者: NoSubject's avatar NoSubject

Merge branch 'feature/mobile_work_base' into 'wrdp'

预加载脚本支持

See merge request o2oa/o2oa!1931
......@@ -110,7 +110,7 @@ MWF.xApplication.Selector.Script = new Class({
MWF.xApplication.Selector.Script.Item = new Class({
Extends: MWF.xApplication.Selector.Person.Item,
_getShowName: function(){
return this.data.name;
return this.data.name+"("+this.data.alias+")";
},
_setIcon: function(){
this.iconNode.setStyle("background-image", "url("+"../x_component_Selector/$Selector/default/icon/attr.png)");
......@@ -154,7 +154,7 @@ MWF.xApplication.Selector.Script.Item = new Class({
MWF.xApplication.Selector.Script.ItemSelected = new Class({
Extends: MWF.xApplication.Selector.Person.ItemSelected,
_getShowName: function(){
return this.data.name;
return this.data.name+"("+this.data.alias+")";
},
_setIcon: function(){
this.iconNode.setStyle("background-image", "url("+"../x_component_Selector/$Selector/default/icon/attr.png)");
......
......@@ -80,6 +80,7 @@
<td class="editTableTitle">脚本:</td>
<td class="editTableValue">
<div class="MWFScriptSelect" data-count=0 name="includeScripts"></div>
<div class="MWFScriptSelectAction"><div style="color: #0b58a2; cursor: pointer; float: left">复制</div><div style="color: #0b58a2; cursor: pointer; float: left; margin-left:10px">粘贴</div></div>
</td>
</tr>
</table>
......
......@@ -1317,7 +1317,7 @@ debugger;
}.bind(this));
scriptNodes.each(function(node){
new MWF.xApplication.process.ProcessDesigner.widget.PersonSelector(node, this.form.designer, {
var ps = new MWF.xApplication.process.ProcessDesigner.widget.PersonSelector(node, this.form.designer, {
"type": "Script",
"count": node.dataset["count"] || 1,
"names": (!node.dataset["count"] || node.dataset["count"].toInt()==1) ? [this.data[node.get("name")]] : this.data[node.get("name")],
......@@ -1325,6 +1325,74 @@ debugger;
this.saveScriptSelectItem(node, ids);
}.bind(this)
});
node.store("selector", ps);
var actionNode = node.getNext();
if (actionNode.hasClass("MWFScriptSelectAction")){
var _self = this;
var copyNode = actionNode.getFirst();
var pasteNode = actionNode.getLast();
copyNode.store("slectNode", node);
pasteNode.store("slectNode", node);
copyNode.addEvent("click", function(e){
var selectNode = this.retrieve("slectNode");
if (selectNode){
var name = node.get("name");
var data = _self.data[name];
if (data){
var str = JSON.encode(data);
o2.DL.open({
"isTitle": false,
"width": 400,
"height": 500,
"html": "<textarea style='width: 99%; height: 98%'>"+str+"</textarea>",
"buttonList": [{
"type": "ok",
"text": "ok",
"action": function(){this.close();}
}]
})
}
}
});
pasteNode.addEvent("click", function(e){
var selectNode = this.retrieve("slectNode");
if (selectNode){
o2.DL.open({
"isTitle": false,
"width": 400,
"height": 500,
"html": "<textarea style='width: 99%; height: 98%'></textarea>",
"buttonList": [{
"type": "ok",
"text": "ok",
"action": function(){
var dataStr = this.content.getElement("textarea").get("value");
try{
var data = JSON.decode(dataStr);
var s = selectNode.retrieve("selector");
s.setData(data);
_self.saveScriptSelectItem(selectNode, s.identitys);
}catch(e){
throw e;
}
this.close();
}
},{
"type": "cancel",
"text": "cancel",
"action": function(){this.close();}
}]
})
}
});
}
}.bind(this));
var _self = this;
......
......@@ -259,5 +259,6 @@ MWF.xApplication.process.FormDesigner.LP = {
"subformScript": "子表单脚本",
"selectedScript": "视图选择脚本",
"action.tools": "操作按钮"
}
};
\ No newline at end of file
},
"copyed": "已复制"
};
......@@ -7,11 +7,11 @@
<link rel="stylesheet" href="css/mBoxTooltip.css" charset="UTF-8" />
<script src="../o2_core/o2.min.js"></script>
<script src="../o2_lib/Decimal.js"></script>
<script src="js/base_work.min.js"></script>
<script src="js/o2m.api.js"></script>
<script src="js/base.min.js"></script>
<script src="js/work.min.js"></script>
<script>layout.mobile = true;</script>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
<meta content="yes" name="apple-mobile-web-app-capable" />
<meta content="black" name="apple-mobile-web-app-status-bar-style" />
......
......@@ -8,9 +8,8 @@
<link rel="stylesheet" href="css/mBoxTooltip.css" charset="UTF-8" />
<script src="../o2_core/o2.min.js"></script>
<script src="../o2_lib/Decimal.js"></script>
<script src="js/base_work.min.js"></script>
<script src="js/o2m.api.js"></script>
<script src="js/base.min.js"></script>
<script src="js/work.min.js"></script>
<script>layout.mobile = true;</script>
......@@ -39,4 +38,4 @@
<script type="text/javascript" src="../o2_lib/wechat/jweixin-1.6.0.js"></script>
</body>
</html>
\ No newline at end of file
</html>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册