You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
79 lines
2.7 KiB
79 lines
2.7 KiB
8 years ago
|
# 分别对应列表操作项[common/bill/ListMethods]和详情操作项[common/bill/DetailMenu]
|
||
|
|
||
|
>
|
||
|
[
|
||
|
//flow属性代表在详情中渲染为一个大按钮
|
||
|
//具有value属性,表示将执行该js方法
|
||
|
//组件将向上冒泡一个通知
|
||
|
//业务层需要监听该通知,然后自行触发该方法(方法需要自己实现)
|
||
|
{"name":"拍照","value":"ev_photo","flow":"","code":"IDE_APP_OPEN_PHOTO"},
|
||
|
{"name":"材料使用","value":"ev_usecircsmate","flow":"","code":"IDE_APP_OPEN_USECIRCSMATE"},
|
||
|
{"name":"回单","value":"ev_return","flow":"true","code":"IDE_APP_OPEN_RETURN"},
|
||
|
//以下为自动处理的操作
|
||
|
|
||
|
//直接向接口提交数据即可完成的操作
|
||
|
//action为submit
|
||
|
//paramter为一个逗号分隔的键名,组件自动获取到工单的相关键值,发送到指定接口
|
||
|
{
|
||
|
"paramter":"DispatchSn",
|
||
|
"name":"接单",
|
||
|
"action":"submit",
|
||
|
"flow":"true",
|
||
|
"code":"IDE_APP_OPEN_ACCEPT",
|
||
|
"url":"/mop/proxyIda/ida30/h5/app/AppPublicAction.do?method=service&ifCode=open_accept"
|
||
|
},
|
||
|
//需要显示一个交互表单的操作
|
||
|
//action为form
|
||
|
//url为获取form定义的接口名
|
||
|
{
|
||
|
"paramter":"DispatchSn",
|
||
|
"name":"挂起",
|
||
|
"action":"form",
|
||
|
"flow":"",
|
||
|
"code":"IDE_APP_OPEN_HANDUP",
|
||
|
"url":"/mop/proxyIda/ida30/h5/app/AppPublicAction.do?method=getFormDefine&formCode=open_hungUp_page"
|
||
|
}
|
||
|
]
|
||
|
|
||
|
# 表单格式
|
||
|
>
|
||
|
//title为交互窗显示的标题
|
||
|
//action为form提交地址
|
||
|
//form为通用表单格式
|
||
|
//onSuccess定义表单提交后的后续动作
|
||
|
//目前规定为4种:
|
||
|
//1.refreshList 刷新工单列表 在列表时直接刷新列表数据 在详情时返回
|
||
|
//2.refreshBill 刷新工单数据(含菜单)
|
||
|
//3.refreshMenu 刷新菜单
|
||
|
//4. "" nothing 什么都不干
|
||
|
|
||
|
//可以配置一个onSubmit属性,值为一个js方法。
|
||
|
//在这种情况下表单将派发一个execute事件给业务组件。
|
||
|
//此时业务组件需要实现此方法,获取的入参为表单值。
|
||
|
//业务方法需要返回一个promise对象
|
||
|
|
||
|
//将通过一个commonMethod事件将动作向上冒泡,业务代码捕获到后自行处理
|
||
|
{
|
||
|
"title":"解挂",
|
||
|
"action":"/mop/proxyIda/ida30/h5/app/AppPublicAction.do?method=service&ifCode=open_unhangup&DispatchSn=20170501212484",
|
||
|
"onSuccess":"refreshBill",
|
||
|
"form":[]
|
||
|
}
|
||
|
|
||
|
#业务页面处理后续动作的示例代码
|
||
|
>
|
||
|
events : {
|
||
|
commonMethod : function(method,component,callback){
|
||
|
if(method==="refreshList"){
|
||
|
this.reload()
|
||
|
return callback()
|
||
|
}
|
||
|
if(method==="refreshBill"){
|
||
|
return this.refreshBill(component).then(callback)
|
||
|
}
|
||
|
if(method==="refreshMenu"){
|
||
|
return this.refreshMethods(component).then(callback)
|
||
|
}
|
||
|
return callback()
|
||
|
}
|
||
|
}
|