Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
浙江兰德纵横网络技术股份有限公司
o2oa-mini-program
提交
c7295869
o2oa-mini-program
项目概览
浙江兰德纵横网络技术股份有限公司
/
o2oa-mini-program
通知
3
Star
5
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa-mini-program
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
c7295869
编写于
11月 24, 2020
作者:
F
fancy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
流程启动功能完成
上级
af5d383b
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
171 addition
and
13 deletion
+171
-13
pages/progress/start-work.js
pages/progress/start-work.js
+114
-4
pages/progress/start-work.json
pages/progress/start-work.json
+2
-1
pages/progress/start-work.wxml
pages/progress/start-work.wxml
+18
-1
pages/progress/work-web.js
pages/progress/work-web.js
+22
-4
project.config.json
project.config.json
+2
-2
utils/o2Api.js
utils/o2Api.js
+13
-1
未找到文件。
pages/progress/start-work.js
浏览文件 @
c7295869
...
...
@@ -12,7 +12,11 @@ Page({
navTitle
:
'
创建工作
'
,
currentAppId
:
''
,
applicationList
:
[],
processList
:
[]
processList
:
[],
currentProcess
:
null
,
showChooseIdentityDialog
:
false
,
identityList
:
[],
selectedIdentity
:
''
},
/**
...
...
@@ -95,9 +99,85 @@ Page({
})
},
/**
* 选择身份
*/
showChooseIdentityDialog
:
function
(
identityList
){
this
.
setData
({
showChooseIdentityDialog
:
true
,
identityList
:
identityList
})
},
/**
* 启动流程实例
* @param {*} identityDn
*/
startProcess
:
function
(
identityDn
)
{
let
body
=
{
"
identity
"
:
identityDn
}
api
.
createWork
(
this
.
data
.
currentProcess
.
id
,
body
).
then
(
result
=>
{
util
.
hideLoading
()
let
work
=
result
[
0
].
taskList
[
0
].
work
let
activityName
=
result
[
0
].
taskList
[
0
].
activityName
if
(
work
)
{
wx
.
navigateBack
({
delta
:
1
,
complete
:
function
()
{
wx
.
navigateTo
({
url
:
'
../progress/work-web?work=
'
+
work
+
'
&title=
'
+
encodeURIComponent
(
activityName
)
});
}
})
}
}).
catch
(
err
=>
{
util
.
hideLoading
()
api
.
o2Error
(
err
);
})
},
/**
* 启动草稿
* @param {*} identityDn
*/
startDraft
:
function
(
identityDn
)
{
let
body
=
{
"
identity
"
:
identityDn
}
api
.
createDraft
(
this
.
data
.
currentProcess
.
id
,
body
).
then
(
result
=>
{
console
.
log
(
result
)
console
.
log
(
result
.
work
)
util
.
hideLoading
()
if
(
result
.
work
)
{
let
draft
=
JSON
.
stringify
(
result
.
work
)
wx
.
navigateBack
({
delta
:
1
,
complete
:
function
()
{
wx
.
navigateTo
({
url
:
'
../progress/work-web?draft=
'
+
encodeURIComponent
(
draft
)
});
}
})
}
}).
catch
(
err
=>
{
util
.
hideLoading
()
api
.
o2Error
(
err
);
})
},
/**
* 启动
* @param {*} identityDn
*/
start
:
function
(
identityDn
)
{
util
.
showLoading
()
if
(
this
.
data
.
currentProcess
&&
this
.
data
.
currentProcess
.
defaultStartMode
&&
this
.
data
.
currentProcess
.
defaultStartMode
===
'
draft
'
)
{
this
.
startDraft
(
identityDn
)
}
else
{
this
.
startProcess
(
identityDn
)
}
},
bindTapApplication
:
function
(
e
)
{
let
index
=
e
.
currentTarget
.
dataset
.
index
;
let
app
=
this
.
data
.
applicationList
[
index
]
;
let
index
=
e
.
currentTarget
.
dataset
.
index
let
app
=
this
.
data
.
applicationList
[
index
]
this
.
setData
({
processList
:
app
.
processList
,
currentAppId
:
app
.
id
...
...
@@ -105,6 +185,36 @@ Page({
},
bindTapProcess
:
function
(
e
)
{
let
index
=
e
.
currentTarget
.
dataset
.
index
let
process
=
this
.
data
.
processList
[
index
]
this
.
data
.
currentProcess
=
process
util
.
showLoading
()
api
.
listAvailableIdentityWithProcess
(
process
.
id
).
then
(
list
=>
{
if
(
list
&&
list
.
length
>
0
)
{
if
(
list
.
length
>
1
)
{
this
.
showChooseIdentityDialog
(
list
)
}
else
{
this
.
start
(
list
[
0
].
distinguishedName
)
}
}
else
{
util
.
toast
(
'
没有获取到当前用户的身份,无法启动流程!
'
)
}
}).
catch
(
err
=>
{
util
.
hideLoading
()
api
.
o2Error
(
err
);
})
},
tapDialogButton
:
function
(
e
)
{
this
.
setData
({
showChooseIdentityDialog
:
false
});
if
(
e
.
detail
.
index
==
1
)
{
this
.
start
(
this
.
data
.
selectedIdentity
)
}
},
identityRadioChange
:
function
(
e
)
{
this
.
data
.
selectedIdentity
=
e
.
detail
.
value
}
})
\ No newline at end of file
pages/progress/start-work.json
浏览文件 @
c7295869
{
"usingComponents"
:
{
"o2-navi"
:
"../../components/o2-navi/o2-navi"
"o2-navi"
:
"../../components/o2-navi/o2-navi"
,
"mp-dialog"
:
"/miniprogram_npm/weui-miniprogram/dialog/dialog"
}
}
\ No newline at end of file
pages/progress/start-work.wxml
浏览文件 @
c7295869
...
...
@@ -14,4 +14,21 @@
</view>
</view>
</block>
\ No newline at end of file
</block>
<mp-dialog title="请选择启动流程的身份" show="{{showChooseIdentityDialog}}" bindbuttontap="tapDialogButton" buttons="{{[{text: '取消'}, {text: '确认'}]}}">
<view class="page-section">
<view class="weui-cells weui-cells_after-title">
<view class="weui-cell weui-cell_input">
<radio-group bindchange="identityRadioChange">
<label class="weui-cell weui-check__label" wx:for="{{identityList}}" wx:key="{{item.id}}">
<view class="weui-cell__hd">
<radio value="{{item.distinguishedName}}"/>
</view>
<view class="weui-cell__bd">{{item.name}}({{item.unitName}})</view>
</label>
</radio-group>
</view>
</view>
</view>
</mp-dialog>
\ No newline at end of file
pages/progress/work-web.js
浏览文件 @
c7295869
...
...
@@ -20,16 +20,34 @@ Page({
*/
onLoad
:
function
(
options
)
{
var
title
=
decodeURIComponent
(
options
.
title
);
if
(
!
options
.
workCompleted
&&
!
options
.
work
)
{
if
(
!
options
.
workCompleted
&&
!
options
.
work
&&
!
options
.
draft
)
{
util
.
toast
(
'
参数错误!
'
);
wx
.
navigateBack
({
delta
:
1
,
});
}
else
if
(
!
options
.
workCompleted
)
{
this
.
openWorkUrl
(
options
.
work
,
title
);
}
else
{
}
else
if
(
options
.
workCompleted
)
{
this
.
openWorkCompletedUrl
(
options
.
workCompleted
,
title
);
}
else
if
(
options
.
work
)
{
this
.
openWorkUrl
(
options
.
work
,
title
);
}
else
if
(
options
.
draft
)
{
this
.
openDraft
(
options
.
draft
,
title
);
}
},
// 打开工作表单 草稿
openDraft
:
function
(
draft
,
title
=
''
)
{
var
url
=
api
.
workDraftUrl
(
draft
);
var
who
=
wx
.
getStorageSync
(
'
who
'
);
var
token
=
''
if
(
who
&&
who
.
token
)
{
token
=
who
.
token
;
url
=
url
+
'
&x-token=
'
+
token
;
}
url
=
url
+
'
#wechat_redirect
'
;
console
.
log
(
'
草稿页面 url
'
,
url
);
this
.
setData
({
workUrl
:
url
,
navTitle
:
title
});
},
// 打开工作表单 未完成的工作
openWorkUrl
:
function
(
work
,
title
=
''
)
{
...
...
project.config.json
浏览文件 @
c7295869
...
...
@@ -28,14 +28,14 @@
"disablePlugins"
:
[],
"outputPath"
:
""
},
"bundle"
:
false
,
"useIsolateContext"
:
true
,
"useCompilerModule"
:
true
,
"userConfirmedUseCompilerModuleSwitch"
:
false
,
"userConfirmedBundleSwitch"
:
false
,
"packNpmManually"
:
false
,
"packNpmRelationList"
:
[],
"minifyWXSS"
:
true
,
"bundle"
:
false
"minifyWXSS"
:
true
},
"compileType"
:
"miniprogram"
,
"libVersion"
:
"2.12.2"
,
...
...
utils/o2Api.js
浏览文件 @
c7295869
...
...
@@ -7,6 +7,8 @@ let setDistribute = (distribute) => o2Request.setDistribute(distribute);
let
cmsWebUrl
=
(
id
)
=>
o2Request
.
getO2WebBaseUrl
()
+
'
/x_desktop/cmsdocMobile.html?id=
'
+
id
;
// 未完成的工作表单打开地址
let
workWebUrl
=
(
work
)
=>
o2Request
.
getO2WebBaseUrl
()
+
'
/x_desktop/workmobilewithaction.html?workid=
'
+
work
;
// 草稿 工作地址
let
workDraftUrl
=
(
draft
)
=>
o2Request
.
getO2WebBaseUrl
+
'
/x_desktop/workmobilewithaction.html?draft=
'
+
draft
;
//工作表单打开地址 已结束
let
workCompletedWebUrl
=
(
workcompletedid
)
=>
o2Request
.
getO2WebBaseUrl
()
+
'
/x_desktop/workmobilewithaction.html?workcompletedid=
'
+
workcompletedid
;
//论坛帖子打开地址 subjectId:帖子id page:评论页码
...
...
@@ -36,8 +38,14 @@ let cmsAttachementUrl = (attId) => o2Request.o2oaCmsServiceBaseUrl() + '/jaxrs/f
/////////////////////流程 //////////////////////////////
//流程应用
//
流程应用
let
applicationList
=
()
=>
o2Request
.
get
(
o2Request
.
o2oaProcessServiceBaseUrl
()
+
'
/jaxrs/application/list/complex
'
);
// 获取当前用户在指定流程中可启动流程的身份.
let
listAvailableIdentityWithProcess
=
(
processId
)
=>
o2Request
.
get
(
o2Request
.
o2oaProcessServiceBaseUrl
()
+
'
/jaxrs/process/list/available/identity/process/
'
+
processId
);
// 启动草稿
let
createDraft
=
(
processId
,
body
)
=>
o2Request
.
post
(
o2Request
.
o2oaProcessServiceBaseUrl
()
+
'
/jaxrs/draft/process/
'
+
processId
,
body
);
// 启动流程
let
createWork
=
(
processId
,
body
)
=>
o2Request
.
post
(
o2Request
.
o2oaProcessServiceBaseUrl
()
+
'
/jaxrs/work/process/
'
+
processId
,
body
);
// 待办列表
let
taskList
=
(
lastId
,
pageSize
)
=>
o2Request
.
get
(
o2Request
.
o2oaProcessServiceBaseUrl
()
+
'
/jaxrs/task/list/
'
+
lastId
+
'
/next/
'
+
pageSize
);
...
...
@@ -91,6 +99,7 @@ module.exports = {
setDistribute
,
cmsWebUrl
,
workWebUrl
,
workDraftUrl
,
workCompletedWebUrl
,
bbsWebUrl
,
workAttachmentUrl
,
...
...
@@ -107,6 +116,9 @@ module.exports = {
readList
,
readCompletedList
,
applicationList
,
listAvailableIdentityWithProcess
,
createDraft
,
createWork
,
me
,
myAvatarUrl
,
uploadMyAvatarUrl
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录