|
|
@@ -1,13 +1,130 @@
|
|
|
MWF.xDesktop.requireApp("process.Xform", "$Input", null, false);
|
|
|
MWF.xDesktop.requireApp("Selector", "package", null, false);
|
|
|
MWF.require("MWF.widget.O2Identity", null, false);
|
|
|
-MWF.xApplication.process.Xform.Org = MWF.APPOrg = new Class({
|
|
|
+/** @class process.Org 人员组织组件。
|
|
|
+ * @example
|
|
|
+ * //可以在脚本中获取该组件
|
|
|
+ * //方法1:
|
|
|
+ * var field = this.form.get("fieldId"); //获取组件对象
|
|
|
+ * //方法2
|
|
|
+ * var field = this.target; //在组件本身的脚本中获取,比如事件脚本、默认值脚本、校验脚本等等
|
|
|
+ *
|
|
|
+ * var data = field.getData(); //获取值
|
|
|
+ * field.setData("字符串值"); //设置值
|
|
|
+ * field.hide(); //隐藏字段
|
|
|
+ * var id = field.json.id; //获取字段标识
|
|
|
+ * var flag = field.isEmpty(); //字段是否为空
|
|
|
+ * field.resetData(); //重置字段的值为默认值或置空
|
|
|
+ * @extends MWF.xApplication.process.Xform.$Input
|
|
|
+ * @category FormComponents
|
|
|
+ * @hideconstructor
|
|
|
+ */
|
|
|
+MWF.xApplication.process.Xform.Org = MWF.APPOrg = new Class(
|
|
|
+ /** @lends MWF.xApplication.process.Xform.Org# */
|
|
|
+ {
|
|
|
Implements: [Events],
|
|
|
Extends: MWF.APP$Input,
|
|
|
options: {
|
|
|
+ /**
|
|
|
+ * 组件加载前触发。
|
|
|
+ * @event MWF.xApplication.process.Xform.Org#queryLoad
|
|
|
+ * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
|
|
|
+ */
|
|
|
+ /**
|
|
|
+ * 组件加载时触发.
|
|
|
+ * @event MWF.xApplication.process.Xform.Org#load
|
|
|
+ * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
|
|
|
+ */
|
|
|
+ /**
|
|
|
+ * 组件加载后触发.
|
|
|
+ * @event MWF.xApplication.process.Xform.Org#postLoad
|
|
|
+ * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
|
|
|
+ */
|
|
|
+ /**
|
|
|
+ * 当组件值改变时触发。
|
|
|
+ * @event MWF.xApplication.process.Xform.Org#change
|
|
|
+ * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
|
|
|
+ */
|
|
|
+ /**
|
|
|
+ * 当组件不允许输入(使用人员选择框)时,完成选择人员,并且给组件赋值后执行。
|
|
|
+ * @event MWF.xApplication.process.Xform.Org#select
|
|
|
+ * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
|
|
|
+ */
|
|
|
"moduleEvents": ["load", "queryLoad", "postLoad", "change", "select"],
|
|
|
- "selectorEvents" : ["queryLoadSelector","postLoadSelector","postLoadContent","queryLoadCategory","postLoadCategory",
|
|
|
- "selectCategory", "unselectCategory","queryLoadItem","postLoadItem","selectItem", "unselectItem","change"],
|
|
|
+ /**
|
|
|
+ * 人员选择框事件:加载前执行。this.target指向人员选择框。
|
|
|
+ * @event MWF.xApplication.process.Xform.Org#queryLoadSelector
|
|
|
+ * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
|
|
|
+ */
|
|
|
+ /**
|
|
|
+ * 人员选择框事件:加载后执行,由于选择项为异步加载,此时选择项并未加载完成。this.target指向人员选择框。
|
|
|
+ * @event MWF.xApplication.process.Xform.Org#postLoadSelector
|
|
|
+ * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
|
|
|
+ */
|
|
|
+ /**
|
|
|
+ * 人员选择框事件:加载选择框容器节点前执行。this.target指向人员选择框。
|
|
|
+ * @event MWF.xApplication.process.Xform.Org#queryLoadCategory
|
|
|
+ * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
|
|
|
+ */
|
|
|
+ /**
|
|
|
+ * 人员选择框事件:加载选择框容器节点后执行。this.target指向人员选择框。
|
|
|
+ * @event MWF.xApplication.process.Xform.Org#postLoadContent
|
|
|
+ * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
|
|
|
+ */
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 人员选择框事件:加载分类前执行。this.target指向分类,this.target.selector指向人员选择框。
|
|
|
+ * @event MWF.xApplication.process.Xform.Org#queryLoadCategory
|
|
|
+ * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
|
|
|
+ */
|
|
|
+ /**
|
|
|
+ * 人员选择框事件:加载分类后执行。this.target指向分类,this.target.selector指向人员选择框。
|
|
|
+ * @event MWF.xApplication.process.Xform.Org#postLoadCategory
|
|
|
+ * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
|
|
|
+ */
|
|
|
+ /**
|
|
|
+ * 人员选择框事件:选择分类后执行。this.target指向分类,this.target.selector指向人员选择框。
|
|
|
+ * @event MWF.xApplication.process.Xform.Org#selectCategory
|
|
|
+ * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
|
|
|
+ */
|
|
|
+ /**
|
|
|
+ * 人员选择框事件:取消选择分类后执行。this.target指向分类,this.target.selector指向人员选择框。
|
|
|
+ * @event MWF.xApplication.process.Xform.Org#unselectCategory
|
|
|
+ * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
|
|
|
+ */
|
|
|
+ /**
|
|
|
+ * 人员选择框事件:展开分类后执行。this.target指向分类,this.target.selector指向人员选择框。
|
|
|
+ * @event MWF.xApplication.process.Xform.Org#expand
|
|
|
+ * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
|
|
|
+ */
|
|
|
+ /**
|
|
|
+ * 人员选择框事件:折叠分类后执行。this.target指向分类,this.target.selector指向人员选择框。
|
|
|
+ * @event MWF.xApplication.process.Xform.Org#collapse
|
|
|
+ * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
|
|
|
+ */
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 人员选择框事件:加载选择项前执行。this.target指向选择项,this.target.selector指向人员选择框。
|
|
|
+ * @event MWF.xApplication.process.Xform.Org#queryLoadItem
|
|
|
+ * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
|
|
|
+ */
|
|
|
+ /**
|
|
|
+ * 人员选择框事件:加载选择项后执行。this.target指向选择项,this.target.selector指向人员选择框。
|
|
|
+ * @event MWF.xApplication.process.Xform.Org#postLoadItem
|
|
|
+ * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
|
|
|
+ */
|
|
|
+ /**
|
|
|
+ * 人员选择框事件:选择选择项后执行。this.target指向选择项,this.target.selector指向人员选择框。
|
|
|
+ * @event MWF.xApplication.process.Xform.Org#selectItem
|
|
|
+ * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
|
|
|
+ */
|
|
|
+ /**
|
|
|
+ * 人员选择框事件:取消选择选择项后执行。this.target指向选择项,this.target.selector指向人员选择框。
|
|
|
+ * @event MWF.xApplication.process.Xform.Org#unselectItem
|
|
|
+ * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
|
|
|
+ */
|
|
|
+ "selectorEvents" : ["queryLoadSelector","postLoadSelector","queryLoadContent","postLoadContent","queryLoadCategory","postLoadCategory",
|
|
|
+ "selectCategory", "unselectCategory","queryLoadItem","postLoadItem","selectItem", "unselectItem","change","expand","collapse"],
|
|
|
"readonly": true
|
|
|
},
|
|
|
|
|
|
@@ -468,6 +585,11 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg = new Class({
|
|
|
if (!v || !v.length) if (this.descriptionNode) this.descriptionNode.setStyle("display", "block");
|
|
|
},
|
|
|
|
|
|
+ /**
|
|
|
+ * @summary 弹出选择界面.
|
|
|
+ * @example
|
|
|
+ * this.form.get('org').clickSelect();
|
|
|
+ */
|
|
|
clickSelect: function( ev ){
|
|
|
if (this.readonly)return;
|
|
|
if( layout.mobile ){
|
|
|
@@ -477,6 +599,14 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg = new Class({
|
|
|
if( this.selector && this.selector.loading ) {
|
|
|
}else if( this.selector && this.selector.selector && this.selector.selector.active ){
|
|
|
}else{
|
|
|
+ /**
|
|
|
+ * @summary 人员选择框package的对象
|
|
|
+ * @member {o2.O2Selector}
|
|
|
+ * @example
|
|
|
+ * //可以在脚本中获取该组件
|
|
|
+ * var selector = this.form.get("fieldId").selector.selector; //获取人员选择框对象
|
|
|
+ * var options = selector.options; //获取人员选择框的选项
|
|
|
+ */
|
|
|
this.selector = new MWF.O2Selector(this.form.app.content, options);
|
|
|
}
|
|
|
}
|