Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-system
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit b0a1f5d9
authored
May 25, 2026
by
Jaxon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat(任务中心): 业务开发 - 人员管理 - 任务中心
1 parent
eae05685
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
727 additions
and
174 deletions
src/views/residentManage/taskCenter/api/index.js
src/views/residentManage/taskCenter/constant/index.js
src/views/residentManage/taskCenter/view/detail/cover2Descriptions.js
src/views/residentManage/taskCenter/view/detail/detail.data.js
src/views/residentManage/taskCenter/view/detail/index.vue
src/views/residentManage/taskCenter/view/table/index.vue
src/views/residentManage/taskCenter/view/table/table.data.js
src/views/residentManage/taskCenter/api/index.js
View file @
b0a1f5d
...
...
@@ -14,3 +14,14 @@ export function getTaskCenterBizCategoryListApi(data = {}) {
data
.
method
=
"dj.api.taskcenter.bizcategory.list"
;
return
request
(
data
,
RequestMethods
.
POST
);
}
// 获取任务详情
export
function
getTaskCenterDetailApi
(
data
=
{})
{
data
.
method
=
"dj.api.taskcenter.task.detail"
;
return
request
(
data
,
RequestMethods
.
POST
);
}
export
function
getTaskCenterCountApi
(
data
=
{})
{
data
.
method
=
"dj.api.taskcenter.task.count"
;
return
request
(
data
,
RequestMethods
.
POST
);
}
src/views/residentManage/taskCenter/constant/index.js
View file @
b0a1f5d
...
...
@@ -24,10 +24,12 @@ export const statusOptions = [
{
value
:
"UNFINISHED"
,
label
:
"未完成"
,
className
:
"yellow-dot"
,
},
{
value
:
"FINISHED"
,
label
:
"已完成"
,
className
:
"green-dot"
,
},
];
...
...
src/views/residentManage/taskCenter/view/detail/cover2Descriptions.js
0 → 100644
View file @
b0a1f5d
import
dayjs
from
"dayjs"
;
import
customParseFormat
from
"dayjs/plugin/customParseFormat"
;
import
isSameOrAfter
from
"dayjs/plugin/isSameOrAfter"
;
import
isSameOrBefore
from
"dayjs/plugin/isSameOrBefore"
;
import
DescriptionImageList
from
"@/components/descriptions/components/imageList.vue"
;
import
{
statusOptions
}
from
"@/views/residentManage/taskCenter/constant"
;
import
"dayjs/locale/zh-cn"
;
dayjs
.
extend
(
isSameOrBefore
);
dayjs
.
extend
(
isSameOrAfter
);
dayjs
.
extend
(
customParseFormat
);
function
parseDatetime
(
value
)
{
if
(
!
value
)
return
"-"
;
const
formats
=
[
"YYYY-MM-DDTHH:mm:ss"
,
"YYYY-MM-DD HH:mm:ss"
,
"YYYY-MM-DDTHH:mm"
,
"YYYY-MM-DD"
,
];
for
(
const
format
of
formats
)
{
const
parsed
=
dayjs
(
value
,
format
,
true
);
if
(
parsed
.
isValid
())
{
return
parsed
.
format
(
"YYYY-MM-DD HH:mm:ss"
);
}
}
return
"-"
;
}
function
renderText
(
h
,
{
data
,
schemaItem
,
schema
})
{
return
h
(
"span"
,
schemaItem
.
meta
.
fieldValue
||
"-"
);
}
function
renderDatetime
(
h
,
{
data
,
schemaItem
,
schema
})
{
const
formatted
=
parseDatetime
(
schemaItem
.
meta
.
fieldValue
);
return
h
(
"span"
,
formatted
);
}
function
renderLink
(
h
,
{
data
,
schemaItem
,
schema
})
{
const
{
fieldValue
,
linkAlias
}
=
schemaItem
.
meta
;
if
(
!
fieldValue
)
return
h
(
"span"
,
"-"
);
const
linkProps
=
{
attrs
:
{
href
:
fieldValue
,
target
:
"_blank"
,
type
:
"primary"
,
},
on
:
{
click
:
(
e
)
=>
{
e
.
preventDefault
();
window
.
open
(
fieldValue
,
"_blank"
);
},
},
};
return
h
(
"el-link"
,
linkProps
,
linkAlias
||
fieldValue
);
}
function
renderImage
(
h
,
{
data
,
schemaItem
,
schema
})
{
const
{
fieldValue
}
=
schemaItem
.
meta
;
if
(
!
fieldValue
||
!
Array
.
isArray
(
fieldValue
)
||
fieldValue
.
length
===
0
)
{
return
h
(
"span"
,
"-"
);
}
return
h
(
DescriptionImageList
,
{
props
:
{
list
:
fieldValue
,
size
:
80
}
});
}
function
isImageUrl
(
url
)
{
if
(
!
url
)
return
false
;
const
imageExtensions
=
[
".jpg"
,
".jpeg"
,
".png"
,
".gif"
,
".bmp"
,
".webp"
,
".svg"
];
const
lowerUrl
=
url
.
toLowerCase
();
return
imageExtensions
.
some
(
ext
=>
lowerUrl
.
includes
(
ext
));
}
function
renderAttachment
(
h
,
{
data
,
schemaItem
,
schema
})
{
const
{
fieldValue
}
=
schemaItem
.
meta
;
if
(
!
fieldValue
||
!
Array
.
isArray
(
fieldValue
)
||
fieldValue
.
length
===
0
)
{
return
h
(
"span"
,
"-"
);
}
const
containerChildren
=
fieldValue
.
map
((
item
,
index
)
=>
{
const
fileName
=
item
.
name
||
item
.
fileName
||
item
.
url
||
`附件
${
index
+
1
}
`
;
const
fileUrl
=
item
.
value
||
item
.
url
||
""
;
const
rowChildren
=
[
h
(
"span"
,
{
attrs
:
{
class
:
"file-name"
}
},
fileName
),
];
if
(
isImageUrl
(
fileUrl
))
{
rowChildren
.
push
(
h
(
"span"
,
{
attrs
:
{
class
:
"download-link"
},
style
:
{
marginLeft
:
"8px"
,
color
:
"#409eff"
,
cursor
:
"pointer"
},
on
:
{
click
:
()
=>
handleDownload
(
fileUrl
,
fileName
)
},
},
"下载"
),
);
}
else
{
rowChildren
.
push
(
h
(
"el-link"
,
{
props
:
{
type
:
"text"
,
href
:
fileUrl
,
target
:
"_blank"
},
style
:
{
marginLeft
:
"8px"
,
lineHeight
:
1
},
},
"下载"
),
);
}
return
h
(
"div"
,
{
attrs
:
{
class
:
"attachment-item"
,
style
:
"display: flex; align-items: center; margin-bottom: 8px;"
}
},
rowChildren
);
});
return
h
(
"div"
,
{
attrs
:
{
class
:
"attachment-list"
}
},
containerChildren
);
}
async
function
handleDownload
(
url
,
fileName
)
{
console
.
log
(
"下载"
);
try
{
const
response
=
await
fetch
(
url
,
{
credentials
:
"include"
,
});
if
(
!
response
.
ok
)
{
throw
new
Error
(
`HTTP error! status:
${
response
.
status
}
`
);
}
const
blob
=
await
response
.
blob
();
const
blobUrl
=
URL
.
createObjectURL
(
blob
);
const
link
=
document
.
createElement
(
"a"
);
link
.
href
=
blobUrl
;
link
.
download
=
fileName
;
document
.
body
.
appendChild
(
link
);
link
.
click
();
document
.
body
.
removeChild
(
link
);
setTimeout
(()
=>
URL
.
revokeObjectURL
(
blobUrl
),
1000
);
}
catch
(
error
)
{
console
.
error
(
"下载失败:"
,
error
);
try
{
const
fallbackLink
=
document
.
createElement
(
"a"
);
fallbackLink
.
href
=
url
;
fallbackLink
.
download
=
fileName
;
document
.
body
.
appendChild
(
fallbackLink
);
fallbackLink
.
click
();
document
.
body
.
removeChild
(
fallbackLink
);
}
catch
(
fallbackError
)
{
console
.
error
(
"降级下载失败:"
,
fallbackError
);
}
}
}
export
default
{
TEXT
:
renderText
,
NUMBER
:
renderText
,
ENUM
:
renderText
,
DATETIME
:
renderDatetime
,
LINK
:
renderLink
,
IMAGE
:
renderImage
,
ATTACHMENT
:
renderAttachment
,
};
src/views/residentManage/taskCenter/view/detail/detail.data.js
0 → 100644
View file @
b0a1f5d
import
{
overdueFlagOptions
,
priorityOptions
,
statusOptions
}
from
"@/views/residentManage/taskCenter/constant/index.js"
;
export
async
function
getTaskCenterTaskDescriptionSchema
()
{
return
[
{
name
:
"description"
,
label
:
"任务描述"
,
col
:
24
,
labelWidth
:
"120px"
,
// slot : 整体的插槽名,优先级高于name
// itemStyle: 每一项的样式
// tooltip: boolean 是否用tooltip 展示data数据
// tooltipProps: el-tooltip 的传参
// render ?:(h,{ data,schemaItem,schema } )=>{} 自定义渲染
// isHide 是否隐藏 (data)=>boolean || boolean
},
{
name
:
"bizTypeName"
,
label
:
"任务分类"
,
col
:
24
,
labelWidth
:
"120px"
,
},
{
name
:
"status"
,
label
:
"完成状态"
,
col
:
24
,
labelWidth
:
"120px"
,
render
:
(
h
,
{
data
})
=>
{
const
item
=
statusOptions
.
find
(
item
=>
item
.
value
===
data
.
status
);
// const names = data.assignees.map(item => item.assigneeName).join(",") || "-";
return
h
(
"span"
,
{
class
:
item
?.
className
||
"yellow-dot"
},
item
?.
label
||
"-"
);
},
},
{
name
:
"priority"
,
label
:
"优先级"
,
col
:
24
,
labelWidth
:
"120px"
,
render
:
(
h
,
{
data
})
=>
{
const
item
=
priorityOptions
.
find
(
item
=>
item
.
value
===
data
.
priority
);
return
h
(
"el-tag"
,
{
props
:
{
type
:
item
?.
type
,
},
},
item
?.
label
||
"-"
,
);
},
},
{
name
:
"assignees"
,
label
:
"执行人"
,
col
:
24
,
labelWidth
:
"120px"
,
render
:
(
h
,
{
data
})
=>
{
console
.
log
(
"data"
);
const
names
=
data
.
assignees
.
map
(
item
=>
item
.
assigneeName
).
join
(
","
)
||
"-"
;
return
h
(
"span"
,
{},
names
);
},
},
{
divider
:
true
,
},
{
divider
:
true
,
},
{
name
:
"taskNo"
,
label
:
"任务编号"
,
col
:
24
,
labelWidth
:
"120px"
,
},
{
name
:
"createdBy"
,
label
:
"创建人"
,
col
:
24
,
labelWidth
:
"120px"
,
},
{
name
:
"createdDate"
,
label
:
"创建时间"
,
col
:
24
,
labelWidth
:
"120px"
,
},
{
name
:
"dueTime"
,
label
:
"截止时间"
,
col
:
24
,
labelWidth
:
"120px"
,
},
];
}
src/views/residentManage/taskCenter/view/detail/index.vue
View file @
b0a1f5d
<
template
>
<!-- 预估利润率 -->
<div
v-loading=
"pageLoading"
class=
"detail-wrapper"
>
<div
class=
"title-wrapper"
>
<span
class=
"title"
>
利润率测算
</span>
<div
class=
"container-wrapper"
>
<div
class=
"title-wrapper"
>
<VenusBackButton
/>
<span
class=
"title"
style=
"margin-left:12px;"
>
{{
detail
.
title
}}
</span>
</div>
<div
class=
"description-wrapper"
>
<Descriptions
:data=
"detail"
:schema=
"descriptionSchema"
>
</Descriptions>
</div>
</div>
<VenusDialog
v-model=
"dialog.profitRateCalFinish.show"
title=
"提示"
:height=
"100"
width=
"400px"
:show-close=
"false"
:close-on-click-modal=
"false"
:show-footer=
"false"
:confirm-loading=
"false"
>
<!-- 正在测算中, 请稍后 -->
</VenusDialog>
</div>
</
template
>
<
script
>
import
VenusDialog
from
"@/components/venusDialog/index.vue"
;
import
{
toUpper
}
from
"lodash-es"
;
import
Descriptions
from
"@/components/descriptions/index.vue"
;
import
VenusBackButton
from
"@/components/venusBackButton/index.vue"
;
import
{
getTaskCenterDetailApi
}
from
"@/views/residentManage/taskCenter/api"
;
import
cover2Descriptions
from
"./cover2Descriptions.js"
;
import
{
getTaskCenterTaskDescriptionSchema
}
from
"./detail.data.js"
;
export
default
{
name
:
""
,
name
:
"
TaskCenterDetail
"
,
components
:
{
VenusDialog
,
VenusBackButton
,
Descriptions
,
},
props
:
{
},
...
...
@@ -35,7 +37,9 @@ export default {
return
{
pageLoading
:
false
,
// 轮训用的 , null || Fn, 为Fn时, 执行即取消轮训
taskId
:
""
,
detail
:
{},
descriptionSchema
:
[],
dialog
:
{
profitRateCalFinish
:
{
show
:
false
,
...
...
@@ -48,24 +52,156 @@ export default {
},
async
mounted
()
{
},
beforeDestroy
()
{
const
{
query
}
=
this
.
$route
;
this
.
taskId
=
query
.
taskId
;
await
this
.
getData
(
query
.
taskId
);
const
schema
=
await
getTaskCenterTaskDescriptionSchema
();
schema
.
splice
(
6
,
0
,
...
this
.
detail
.
bizDisplayInfo
.
map
(
item
=>
({
name
:
item
.
fieldId
,
label
:
item
.
fieldName
,
col
:
24
,
labelWidth
:
"120px"
,
meta
:
item
,
render
:
cover2Descriptions
[
toUpper
(
item
.
fieldType
)],
})));
this
.
descriptionSchema
=
schema
;
},
methods
:
{
async
getTableData
()
{
async
getData
(
taskId
)
{
if
(
!
taskId
)
{
return
;
}
const
res
=
await
getTaskCenterDetailApi
({
taskId
});
if
(
!
res
)
{
return
;
}
try
{
res
.
bizContext
=
JSON
.
parse
(
res
.
bizContext
);
}
catch
(
e
)
{
res
.
bizContext
=
[];
}
try
{
res
.
bizDisplayInfo
=
JSON
.
parse
(
res
.
bizDisplayInfo
);
}
catch
(
e
)
{
res
.
bizDisplayInfo
=
[];
}
},
// const bizDisplayInfo = [
// {
// fieldId: "1",
// fieldName: "文本",
// fieldType: "text",
// fieldValue: "张三",
// linkAlias: null,
// },
// {
// fieldId: "2",
// fieldName: "数值",
// fieldType: "NUMBER",
// fieldValue: "15.369",
// linkAlias: null,
// },
// {
// fieldId: "3",
// fieldName: "枚举",
// fieldType: "ENUM",
// fieldValue: "男",
// linkAlias: null,
// },
// {
// fieldId: "4",
// fieldName: "日期",
// fieldType: "DATETIME",
// fieldValue: "2026-05-21 17:02:00",
// linkAlias: null,
// },
// {
// fieldId: "5",
// fieldName: "链接",
// fieldType: "LINK",
// fieldValue: "https://www.sojson.com/",
// linkAlias: "sojson",
// },
// {
// fieldId: "6",
// fieldName: "图片",
// fieldType: "IMAGE",
// fieldValue: [
// {
// name: "美图秀秀",
// value: "https://picsum.photos/200",
// },
// {
// name: "美图秀秀1",
// value: "https://picsum.photos/200",
// },
// ],
// linkAlias: "",
// },
// {
// fieldId: "7",
// fieldName: "最强附件",
// fieldType: "ATTACHMENT",
// fieldValue: [
// {
// name: "跨域 图片附件",
// value: "https://img.alicdn.com/bao/uploaded/i2/2206584264218/O1CN01bPOXSC1h1tkK7TTN9_!!2206584264218-0-C2M.jpg_460x460q90.jpg_.webp",
// },
// {
// name: "跨域 视频 附件",
// value: "https://media.w3.org/2010/05/sintel/trailer.mp4",
// },
// {
// name: "跨域 pdf 附件",
// value: "https://dnf999.neocities.org/%E6%B5%8B%E8%AF%95.pdf",
// },
// {
// name: "跨域 zip 附件",
// value: "https://files.vsports.fr/games/civ6_online.zip",
// },
getData
()
{
return
{};
},
// {
// name: "跨域 xlsx 附件",
// value: "https://glsk-oss.oss-cn-shenzhen.aliyuncs.com/quality/%E5%95%86%E5%93%81%E4%B8%8A%E6%9E%B6%E8%A1%A820260519004303.xlsx",
// },
// ],
// linkAlias: null,
// },
// ];
this
.
$set
(
this
,
"detail"
,
res
);
},
},
};
</
script
>
<
style
scoped
lang=
"scss"
>
.detail-wrapper
{
.container-wrapper
{
min-height
:
600px
;
box-shadow
:
0
6px
32px
0
rgba
(
0
,
0
,
0
,
0.12
);
margin
:
0
20px
0
;
background-color
:
white
;
padding
:
20px
;
border-radius
:
8px
;
.title-wrapper
{
color
:
#333
;
font-size
:
20px
;
font-weight
:
600
;
margin-bottom
:
20px
;
display
:
flex
;
align-items
:
center
;
}
.description-wrapper
{
::v-deep
.el-divider
{
margin
:
0
0
12px
;
background-color
:
#ebeef5
;
}
::v-deep
.form-item
{
margin-bottom
:
12px
;
}
}
}
}
</
style
>
src/views/residentManage/taskCenter/view/table/index.vue
View file @
b0a1f5d
...
...
@@ -9,9 +9,9 @@
:search-form=
"table.searchForm"
>
</d2-search>
<div
class=
"up-btns"
>
<el-button
:id=
"table.tableParams.btnId
"
size=
"small
"
type=
"primary
"
>
<el-button
size=
"small
"
type=
"primary
"
@
click=
"handleSearch()
"
>
查询
</el-button>
<el-button
size=
"small"
@
click=
"handleReset"
>
...
...
@@ -21,13 +21,47 @@
</div>
</
template
>
<div
class=
"d2-container-content"
>
<d2-table-header>
<!-- 新增商品上架 handleModify -->
<span
style=
" display: inline-block; margin-right: 10px"
>
<auth-button
category=
"Button"
:data=
"{ operate: 'create' }"
:show-btn-ids=
"['9031801']"
/>
</span>
<d2-table-header
:left-span=
"24"
>
<
template
#
left
>
<div
class=
"table-title-wrapper"
>
<div
class=
"title"
>
任务列表
</div>
<div
class=
"table-sum-wrapper"
>
<el-tag
type=
"info"
>
总任务数:
{{
table
.
headerSummary
.
totalCount
}}
</el-tag>
<el-tag
type=
"info"
>
未完成:
{{
table
.
headerSummary
.
unfinishedCount
}}
</el-tag>
<el-tag
type=
"info"
>
已完成:
{{
table
.
headerSummary
.
finishedCount
}}
</el-tag>
<el-tag
type=
"info"
>
已逾期:
{{
table
.
headerSummary
.
overdueCount
}}
</el-tag>
</div>
<div
class=
"sort-wrapper"
>
<el-dropdown
@
command=
"handleChangeSort"
>
<span
class=
"el-dropdown-link"
style=
"cursor:pointer"
>
{{
table
.
searchForm
.
orderBy
===
"createdDate desc"
?
"按创建时间"
:
"按截止时间"
}}
<i
class=
"el-icon-sort"
/>
</span>
<template
#
dropdown
>
<el-dropdown-menu>
<el-dropdown-item
command=
"createdDate desc"
:class=
"table.searchForm.orderBy === 'createdDate desc' ? 'is-active' : '' "
>
按创建时间
</el-dropdown-item>
<el-dropdown-item
command=
"dueTime asc"
:class=
"table.searchForm.orderBy === 'dueTime asc' ? 'is-active' : '' "
>
按截止时间
</el-dropdown-item>
</el-dropdown-menu>
</
template
>
</el-dropdown>
</div>
</div>
</template>
</d2-table-header>
<d2-table
ref=
"tableRef"
v-bind=
"table"
>
<
template
#
auth-button=
"{ scope }"
>
...
...
@@ -46,23 +80,44 @@
</template>
<
script
>
import
{
cloneDeep
}
from
"lodash-es"
;
import
{
get
,
isEmpty
}
from
"lodash-es"
;
import
{
nanoid
}
from
"nanoid"
;
import
{
mapActions
}
from
"vuex"
;
import
{
setAllOptions
}
from
"@/libs/select.js"
;
import
{
getTaskCenterListApi
}
from
"@/views/residentManage/taskCenter/api/index.js"
;
import
reportTrackFunMixin
from
"@/mixins/reportTrackFunMixin"
;
import
{
getTaskCenterCountApi
,
getTaskCenterListApi
}
from
"@/views/residentManage/taskCenter/api/index.js"
;
import
{
getTableColumns
,
getTableFormSchema
}
from
"@/views/residentManage/taskCenter/view/table/table.data"
;
export
default
{
name
:
"ShelfProduct"
,
components
:
{
},
mixins
:
[
reportTrackFunMixin
],
data
()
{
return
{
table
:
{
formSchema
:
[],
getListApi
:
getTaskCenterListApi
,
searchForm
:
{
},
headerSummary
:
{
finishedCount
:
0
,
overdueCount
:
0
,
totalCount
:
0
,
unfinishedCount
:
0
,
},
getListApi
:
async
(
query
)
=>
{
const
res
=
await
getTaskCenterListApi
(
query
);
const
headerSummary
=
await
getTaskCenterCountApi
(
query
);
Object
.
assign
(
this
.
table
.
headerSummary
,
headerSummary
);
return
res
;
},
searchForm
:
{
orderBy
:
"createdDate desc"
,
// 排序字段:创建时间升序:createdDate asc
// 降序:createdDate desc
// 更新时间升序:updatedDate asc
// 降序:updatedDate desc
// 截止时间升序:dueTime asc
// 降序:dueTime desc
},
// 表格参数
tableParams
:
{
btnId
:
nanoid
(),
...
...
@@ -81,7 +136,9 @@ export default {
};
},
async
mounted
()
{
this
.
trackMenu
();
await
this
.
getBaseData
();
await
this
.
getHeaderSummary
();
this
.
table
.
formSchema
=
await
getTableFormSchema
();
this
.
table
.
tableParams
.
tableColumns
=
await
getTableColumns
();
},
...
...
@@ -89,9 +146,43 @@ export default {
...
mapActions
({
close
:
"d2admin/page/close"
,
}),
checkQuery
()
{
const
{
searchForm
,
formSchema
}
=
this
.
table
;
const
hasFormValue
=
formSchema
.
some
(({
name
})
=>
{
const
value
=
get
(
searchForm
,
name
);
if
(
Array
.
isArray
(
value
))
{
return
value
.
length
>
0
;
}
if
(
typeof
value
===
"string"
)
{
return
value
.
trim
()
!==
""
;
}
return
!
isEmpty
(
value
);
});
if
(
hasFormValue
)
{
return
true
;
}
return
searchForm
.
orderBy
!==
"createdDate desc"
;
},
trackMenu
()
{
this
.
setReportTrackData
(
0
,
"task_web_menu_entry"
,
{});
},
handleSearch
(
clearQuery
=
true
,
resetPage
=
true
)
{
const
query
=
this
.
table
.
searchForm
;
if
(
this
.
checkQuery
())
{
console
.
log
(
"埋点"
);
this
.
setReportTrackData
(
0
,
"task_web_search_request"
,
query
);
}
this
.
$refs
.
tableRef
.
refreshTable
(
clearQuery
,
resetPage
);
},
async
getBaseData
()
{
setAllOptions
(
this
.
table
.
formSchema
);
},
async
getHeaderSummary
()
{
const
headerSummary
=
await
getTaskCenterCountApi
();
Object
.
assign
(
this
.
table
.
headerSummary
,
headerSummary
);
},
handleReset
()
{
this
.
table
.
searchForm
=
this
.
$options
.
data
().
table
.
searchForm
;
this
.
$refs
.
tableRef
.
refreshTable
(
false
,
true
);
...
...
@@ -129,7 +220,8 @@ export default {
// this.dialog.reject.show = true;
},
// 查看
handleDetail
({
taskId
})
{
async
handleDetail
({
taskId
,
bizTypeName
,
bizType
})
{
this
.
setReportTrackData
(
0
,
"task_web_view_detail"
,
{
taskId
,
bizTypeName
,
bizType
});
this
.
$router
.
push
({
path
:
"/resident-manage/task-center/detail"
,
query
:
{
...
...
@@ -137,6 +229,13 @@ export default {
},
});
},
handleChangeSort
(
command
)
{
if
(
this
.
table
.
searchForm
.
orderBy
===
command
)
{
return
;
}
this
.
table
.
searchForm
.
orderBy
=
command
;
this
.
handleSearch
(
false
,
true
);
},
// 新增 或 修改
handleModify
({
operate
,
record
})
{
// console.log("record", record);
...
...
@@ -162,11 +261,47 @@ export default {
</
script
>
<
style
lang=
"scss"
scoped
>
::v-deep
.is-active
{
background-color
:
#eaeef7
;
color
:
#5579bd
;
}
.d2-container-content
{
.table-title-wrapper
{
display
:
flex
;
align-items
:
center
;
margin-bottom
:
8px
;
>
.title
{
font-size
:
16px
;
font-weight
:
bold
;
color
:
rgba
(
0
,
0
,
0
,
0.88
);
flex-shrink
:
0
;
}
>
.table-sum-wrapper
{
flex-shrink
:
0
;
flex
:
1
;
margin-left
:
20px
;
.el-tag
{
margin-left
:
16px
;
&:first-child
{
margin-left
:
0
;
}
color
:
#000
;
font-size
:
13px
;
font-weight
:
bold
;
border
:
0
;
background-color
:
#f5f5f5
;
}
}
>
.sort-wrapper
{
}
}
::v-deep
.d2-table
{
.el-table__body-wrapper
{
.cell
{
padding
:
0
6px
;
.el-tag
{
width
:
auto
!important
;
}
}
}
}
...
...
src/views/residentManage/taskCenter/view/table/table.data.js
View file @
b0a1f5d
import
dayjs
from
"dayjs"
;
import
{
keyBy
}
from
"lodash-es"
;
import
{
getTaskCenterBizCategoryListApi
}
from
"@/views/residentManage/taskCenter/api/index.js"
;
import
{
overdueFlagOptions
,
priorityOptions
,
statusOptions
}
from
"@/views/residentManage/taskCenter/constant/index.js"
;
export
async
function
getTableFormSchema
()
{
const
bizTypesList
=
await
getTaskCenterBizCategoryListApi
();
return
[
const
bizTypesList
=
await
getTaskCenterBizCategoryListApi
();
return
[
{
label
:
"任务编号"
,
name
:
"condition.taskNo"
,
type
:
"input"
,
maxlength
:
20
,
},
{
label
:
"任务标题"
,
name
:
"condition.title"
,
type
:
"input"
,
maxlength
:
100
,
},
{
label
:
"任务编号"
,
name
:
"condition.taskNo"
,
type
:
"input"
,
maxlength
:
20
,
},
{
label
:
"任务标题"
,
name
:
"condition.title"
,
type
:
"input"
,
maxlength
:
100
,
},
{
label
:
"优先级"
,
name
:
"condition.priority"
,
type
:
"select"
,
isClear
:
true
,
optionList
:
priorityOptions
,
optionId
:
"value"
,
optionLabel
:
"label"
,
},
{
label
:
"优先级"
,
name
:
"condition.priorities"
,
type
:
"select"
,
isClear
:
true
,
optionList
:
priorityOptions
,
optionId
:
"value"
,
optionLabel
:
"label"
,
multiple
:
true
,
},
{
label
:
"完成状态"
,
name
:
"condition.status"
,
type
:
"select"
,
isClear
:
true
,
optionList
:
statusOptions
,
optionId
:
"value"
,
optionLabel
:
"label"
,
},
{
label
:
"任务分类"
,
name
:
"condition.bizTypes"
,
type
:
"select"
,
isClear
:
true
,
optionList
:
bizTypesList
,
optionId
:
"bizType"
,
optionLabel
:
"categoryName"
,
multiple
:
true
,
},
{
label
:
"执行人"
,
name
:
"condition.assigneeName"
,
type
:
"input"
,
maxlength
:
20
,
},
{
label
:
"创建人"
,
name
:
"condition.creatorName"
,
type
:
"input"
,
maxlength
:
20
,
},
{
label
:
"是否逾期"
,
name
:
"condition.overdueFlag"
,
type
:
"select"
,
isClear
:
true
,
optionList
:
overdueFlagOptions
,
optionId
:
"value"
,
optionLabel
:
"label"
,
},
{
label
:
"完成状态"
,
name
:
"condition.status"
,
type
:
"select"
,
isClear
:
true
,
optionList
:
statusOptions
,
optionId
:
"value"
,
optionLabel
:
"label"
,
},
{
label
:
"任务分类"
,
name
:
"condition.bizTypes"
,
type
:
"select"
,
isClear
:
true
,
optionList
:
bizTypesList
,
optionId
:
"bizType"
,
optionLabel
:
"categoryName"
,
multiple
:
true
,
},
{
label
:
"执行人"
,
name
:
"condition.assigneeName"
,
type
:
"input"
,
maxlength
:
20
,
},
{
label
:
"创建人"
,
name
:
"condition.creatorName"
,
type
:
"input"
,
maxlength
:
20
,
},
{
label
:
"是否逾期"
,
name
:
"condition.overdueFlag"
,
type
:
"select"
,
isClear
:
true
,
optionList
:
overdueFlagOptions
,
optionId
:
"value"
,
optionLabel
:
"label"
,
},
];
];
}
;
export
async
function
getTableColumns
()
{
return
[
{
label
:
"任务编号"
,
prop
:
"taskNo"
,
width
:
"180px"
,
},
{
label
:
"任务标题"
,
prop
:
"title"
,
minWidth
:
"200px"
,
align
:
"left"
,
},
{
label
:
"任务分类"
,
prop
:
"bizTypeName"
,
width
:
"180px"
,
},
{
label
:
"优先级"
,
prop
:
"priority"
,
width
:
"180px"
,
useTag
:
true
,
tagOptions
:
keyBy
(
priorityOptions
,
"value"
),
},
{
label
:
"执行人"
,
prop
:
"assignees"
,
width
:
"180px"
,
formatter
:
(
row
)
=>
{
return
row
.
assignees
.
map
(
item
=>
item
.
assigneeName
).
join
(
","
)
||
"-"
;
},
},
{
label
:
"完成状态"
,
prop
:
"status"
,
width
:
"180px"
,
formatter
:
(
row
)
=>
{
return
statusOptions
.
find
(
item
=>
item
.
value
===
row
.
status
)?.
label
||
"-"
;
},
return
[
{
label
:
"任务编号"
,
prop
:
"taskNo"
,
width
:
"180px"
,
},
{
label
:
"任务标题"
,
prop
:
"title"
,
minWidth
:
"200px"
,
align
:
"left"
,
},
{
label
:
"任务分类"
,
prop
:
"bizTypeName"
,
width
:
"180px"
,
},
{
label
:
"优先级"
,
prop
:
"priority"
,
width
:
"180px"
,
useTag
:
true
,
tagOptions
:
keyBy
(
priorityOptions
,
"value"
),
},
{
label
:
"执行人"
,
prop
:
"assignees"
,
width
:
"180px"
,
formatter
:
(
row
)
=>
{
return
row
.
assignees
.
map
(
item
=>
item
.
assigneeName
).
join
(
","
)
||
"-"
;
},
},
{
label
:
"完成状态"
,
prop
:
"status"
,
width
:
"180px"
,
formatter
:
(
row
)
=>
{
return
statusOptions
.
find
(
item
=>
item
.
value
===
row
.
status
)?.
label
||
"-"
;
},
className
:
(
cellValue
)
=>
{
return
{
UNFINISHED
:
"yellowSpot"
,
FINISHED
:
"greenSpot"
,
}[
cellValue
.
status
];
},
},
{
label
:
"完成时间"
,
prop
:
"completeTime"
,
width
:
"180px"
,
},
{
label
:
"截止时间"
,
prop
:
"dueTime"
,
width
:
"180px"
,
},
{
label
:
"创建人"
,
prop
:
"createdBy"
,
width
:
"180px"
,
},
{
label
:
"创建时间"
,
prop
:
"createdDate"
,
width
:
"180px"
,
},
];
valueClass
:
(
cellValue
)
=>
{
return
{
UNFINISHED
:
"yellow-dot"
,
FINISHED
:
"green-dot"
}[
cellValue
.
status
];
},
},
{
label
:
"完成时间"
,
prop
:
"completeTime"
,
width
:
"180px"
,
},
{
label
:
"截止时间"
,
prop
:
"dueTime"
,
width
:
"180px"
,
formatter
:
(
row
)
=>
{
return
row
.
dueTime
||
"-"
;
},
valueClass
:
({
dueTime
,
completeTime
})
=>
{
if
(
!
dueTime
)
return
""
;
if
(
!
completeTime
)
{
if
(
dayjs
(
dueTime
).
isBefore
(
dayjs
()))
{
return
"color-red"
;
}
}
if
(
completeTime
)
{
if
(
dayjs
(
dueTime
).
isBefore
(
dayjs
(
completeTime
)))
{
return
"color-red"
;
}
}
},
},
{
label
:
"创建人"
,
prop
:
"createdBy"
,
width
:
"180px"
,
},
{
label
:
"创建时间"
,
prop
:
"createdDate"
,
width
:
"180px"
,
},
];
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment