Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz-Vue-R7-Res
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7前端标准模板
iBiz-Vue-R7-Res
提交
768807af
提交
768807af
编写于
8月 18, 2020
作者:
Mosher
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更新action-timeline组件
上级
1c256f80
变更
2
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
115 行增加
和
137 行删除
+115
-137
action-timeline.less
src/components/action-timeline/action-timeline.less
+5
-5
action-timeline.vue
src/components/action-timeline/action-timeline.vue
+110
-132
未找到文件。
src/components/action-timeline/action-timeline.less
浏览文件 @
768807af
...
...
@@ -33,7 +33,7 @@
width: 7px;
height: 7px;
background-color: var(--view-button-background-color);
border: 1px solid
red
;
border: 1px solid
#515a6e
;
content: ' ';
border-radius: 50%;
}
...
...
@@ -46,7 +46,7 @@
z-index: 1;
display: block;
content: ' ';
border-left: 1px solid
red
;
border-left: 1px solid
#515a6e
;
}
}
...
...
@@ -63,7 +63,7 @@
position: absolute;
width: 150px;
left: -170px;
border: 2px solid
red
;
border: 2px solid
#515a6e
;
font-size: 18px;
padding: 16px;
...
...
@@ -83,12 +83,12 @@
top: 30px;
height: 2px;
width: 20px;
background-color:
red
;
background-color:
#515a6e
;
}
>.timeline {
padding: 16px;
border: 2px solid
red
;
border: 2px solid
#515a6e
;
}
}
}
...
...
src/components/action-timeline/action-timeline.vue
浏览文件 @
768807af
<
template
>
<div
class=
"action-timeline"
>
<template
v-for=
"(item, index) in items"
>
<div
:key=
'index'
class=
'action-timeline-group-wrapper'
>
<template
v-for=
"(usertask, usertaskIndex) in item.usertasks"
>
<div
class=
'action-timeline-group-wrapper'
>
<template
v-for=
"(usertask, usertaskIndex) in data.usertasks"
>
<div
:key=
'usertaskIndex'
class=
'action-timeline-group expand'
>
<div
class=
'date'
>
{{
usertask
.
userTaskName
}}
<div
class=
'arrow'
>
<i
@
click=
"changeExpand($event)"
class=
"el-icon-arrow-down
"
/>
<div
class=
'arrow'
@
click=
"changeExpand(usertask)"
>
<i
:class=
"usertask.isShow ? 'el-icon-arrow-down' : 'el-icon-arrow-up'
"
/>
</div>
</div>
<div
class=
'timeline'
>
...
...
@@ -26,22 +25,20 @@
<
template
v-else
>
<ul
class=
"action-timeline-wrapper"
>
<template
v-if=
"!usertask.isShow"
>
<template>
<li
class=
"action-timeline-item"
>
<div
class=
'timeline-time'
>
{{
formatDate
(
usertask
.
comments
[
0
].
time
,
'MM月DD日'
)
}}
{{
usertask
.
comments
[
0
].
authorName
}}
{{
formatDate
(
usertask
.
comments
[
0
].
time
,
'MM月DD日 HH:mm'
)
}}
{{
usertask
.
comments
[
0
].
authorName
}}
</div>
<div
class=
'timeline-content'
>
{{
usertask
.
comments
[
0
].
type
}}
{{
usertask
.
comments
[
0
].
fullMessage
}}
</div>
</li>
</
template
>
</template>
<
template
v-else
>
<template
v-for=
"(comment, commentIndex) in usertask.comments"
>
<li
:key=
"commentIndex"
class=
"action-timeline-item"
>
<div
class=
'timeline-time'
>
{{
formatDate
(
comment
.
time
,
'MM月DD日
'
)
}}
{{
comment
.
authorName
}}
{{
formatDate
(
comment
.
time
,
'MM月DD日 HH:mm
'
)
}}
{{
comment
.
authorName
}}
</div>
<div
class=
'timeline-content'
>
{{
comment
.
type
}}
{{
comment
.
fullMessage
}}
...
...
@@ -55,117 +52,98 @@
</div>
</template>
</div>
</template>
</div>
</template>
<
script
lang=
"ts"
>
import
{
Vue
,
Component
,
Prop
}
from
'vue-property-decorator'
;
import
{
ActionTimelineItem
}
from
'./action-timeline-interface'
;
import
{
Vue
,
Component
,
Prop
,
Watch
}
from
'vue-property-decorator'
;
import
moment
from
'moment'
;
@
Component
({
})
export
default
class
ActionTimeline
extends
Vue
{
@
Prop
()
public
data
!
:
any
;
/**
* 数据
*
* @memberof ActionTimeline
*/
public
data
:
any
=
{};
/**
* 初始化memo
*
* @memberof ActionTimeline
*/
public
initmemo
:
string
=
""
;
/**
* 传入数据服务
*
* @memberof ActionTimeline
*/
@
Prop
()
public
service
:
any
;
/**
* 上下文
*
* @memberof ActionTimeline
*/
@
Prop
()
public
context
:
any
;
public
items
:
any
[]
=
[{
"id"
:
"40833204-9be4-11ea-9c94-0242130d84ce"
,
"name"
:
null
,
"processDefinitionKey"
:
null
,
"processDefinitionName"
:
null
,
"businessKey"
:
"DC20200522022"
,
"startTime"
:
"2020-05-22 12:25:22"
,
"endTime"
:
null
,
"startUserId"
:
"001-004_0001"
,
"startUserName"
:
"隆俊杰"
,
"usertasks"
:
[{
"userTaskId"
:
"tid-1-1f3eda90105907e25e6f2e8c0f82b903"
,
"userTaskName"
:
"管理员审批"
,
"processDefinitionKey"
:
null
,
"processDefinitionName"
:
null
,
"identitylinks"
:
[],
"comments"
:
[{
"id"
:
"44eddf40-9be4-11ea-9c94-0242130d84ce"
,
"author"
:
"001-004_0001"
,
"authorName"
:
"隆俊杰"
,
"fullMessage"
:
""
,
"time"
:
"2020-05-22 12:25:29"
,
"type"
:
"审批不通过"
,
"taskId"
:
"40844383-9be4-11ea-9c94-0242130d84ce"
,
"processInstanceId"
:
"40833204-9be4-11ea-9c94-0242130d84ce"
,
"processInstanceBusinessKey"
:
"DC20200522022"
},
{
"id"
:
"b39cfc68-9be4-11ea-9c94-0242130d84ce"
,
"author"
:
"450000-000"
,
"authorName"
:
"ibzadmin"
,
"fullMessage"
:
""
,
"time"
:
"2020-05-22 12:28:35"
,
"type"
:
"审批不通过"
,
"taskId"
:
"a6c57ad1-9be4-11ea-9c94-0242130d84ce"
,
"processInstanceId"
:
"40833204-9be4-11ea-9c94-0242130d84ce"
,
"processInstanceBusinessKey"
:
"DC20200522022"
}]
},
{
"userTaskId"
:
"tid-2-c60d498abacb47b510e0aa9d64a55e57"
,
"userTaskName"
:
"被驳回"
,
"processDefinitionKey"
:
null
,
"processDefinitionName"
:
null
,
"identitylinks"
:
[{
"id"
:
"001-004_0001"
,
"firstname"
:
null
,
"displayname"
:
"隆俊杰"
}],
"comments"
:
[{
"id"
:
"a6c21f6e-9be4-11ea-9c94-0242130d84ce"
,
"author"
:
"001-004_0001"
,
"authorName"
:
"隆俊杰"
,
"fullMessage"
:
""
,
"time"
:
"2020-05-22 12:28:14"
,
"type"
:
"提交"
,
"taskId"
:
"44f09e63-9be4-11ea-9c94-0242130d84ce"
,
"processInstanceId"
:
"40833204-9be4-11ea-9c94-0242130d84ce"
,
"processInstanceBusinessKey"
:
"DC20200522022"
}]
}]
}];
/**
* 视图参数
*
* @memberof ActionTimeline
*/
@
Prop
()
public
viewparams
:
any
;
public
created
()
{
/**
* 初始化数据
*
* @memberof ActionTimeline
*/
public
created
(){
if
(
this
.
service
){
this
.
service
.
GetWFHistory
(
this
.
context
).
then
((
res
:
any
)
=>
{
if
(
res
&&
(
res
.
status
===
200
)){
this
.
data
=
res
.
data
;
}
})
}
this
.
handleData
();
}
/**
* 处理数据
*
* @memberof ActionTimeline
*/
public
handleData
()
{
if
(
this
.
data
)
{
this
.
items
=
this
.
data
;
if
(
this
.
data
&&
this
.
data
.
usertasks
)
{
this
.
data
.
usertasks
.
array
.
forEach
((
item
:
any
)
=>
{
item
.
isShow
=
true
;
})
}
}
/**
* 时间转换
*
* @memberof ActionTimeline
*/
public
formatDate
(
date
:
string
,
format
:
string
)
{
return
moment
(
date
).
format
(
format
);
}
public
updown
:
boolean
=
false
;
public
changeExpand
(
$event
:
any
)
{
this
.
items
.
forEach
((
item
:
any
)
=>
{
item
.
usertasks
.
forEach
((
usertask
:
any
)
=>
{
if
(
usertask
.
comments
.
length
>
0
)
{
usertask
.
isShow
=
false
;
}
})
})
}
public
expands
:
any
;
public
handleIdentData
()
{
if
(
this
.
data
)
{
this
.
items
=
this
.
data
;
this
.
items
.
forEach
((
item
:
any
)
=>
{
item
.
usertasks
.
forEach
((
usertask
:
any
)
=>
{
usertask
.
isShow
=
true
;
})
})
}
/**
* 点击事件
*
* @memberof ActionTimeline
*/
public
changeExpand
(
usertask
:
any
)
{
usertask
.
isShow
=
!
usertask
.
isShow
;
this
.
$forceUpdate
();
}
}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录