Commit 06456f90 authored by jingnan's avatar jingnan 👀

首页待办代码优化

parent c9b6f5b1
<template>
<div class="home-my-task">
<div class="task-header">
<!-- <dee-form
ref="AddForm"
:form="searchForm"
:form-data="searchFormData"
form-btn-position="center"
:inline="true"
style="width: calc(100% - 80px);"
/> -->
<div class="refresh">
<i class="el-icon-refresh" style="margin-right:10px" title="刷新" @click="refresh" />
<span @click="jumpList">更多<i class="el-icon-arrow-right" title="更多" /></span>
</div>
</div>
<el-scrollbar class="task-content">
<!-- <div v-for="(item, index) in taskList" :key="index" :class="['task-item', {'active-item': clickTask && clickTask.id === item.id,'unClaimed-type':item.unClaimedFlag}]" @click="goInfo(item)">
<div class="task-item-label">
<div class="ti-label">
<div class="flex-start">
<span class="task-status" :style="{color: textColor[item.status] || '#2A75CE'}">【{{ item.status }}</span>
<span class="task-name">{{ item.name }}</span>
</div>
<div class="task-item-time">
{{ item.time }}
</div>
</div>
<div class="task-item-info">
<div class="task-left">
<span class="title">
<span v-for="(attr, i) in item.showTitle" :key="`attr_${i}`">
{{ attr.title }}
</span>
</span>
<span v-if="item.expireTimeInMillis && item.expireTimeInMillis > 0" class="due-text">超期</span>
</div>
</div>
<div v-if="item.proxyUserName" class="task-item-time">
代理人:{{ item.proxyUserName }}
</div>
</div>
</div> -->
<div v-for="(item, index) in resLists" :key="index" :class="['task-item', {'active-item': clickTask && clickTask.taskType === item.taskType }]" @click="goInfo(item)">
<div class="task-item-label">
<div class="ti-label">
......@@ -68,7 +33,7 @@ import { getTemps } from '@/api/workflow/userSettings.js'
// import { getFinishedTaskHome } from '@/api/workflow/taskCenter.js'
import { getAllApplication } from '@/api/workflow/config'
// import { getTaskCount } from '@/api/workspace.js'
import _get from 'lodash.get'
// import _get from 'lodash.get'
import { post, get } from '@/utils/http'
export default {
......@@ -143,7 +108,7 @@ export default {
}
],
clickTask: null,
type: '我的待办',
type: '',
quickAccessList: [
{
taskType: '检验任务',
......@@ -170,24 +135,10 @@ export default {
}
},
watch: {
searchForm: {
immediate: true,
deep: true,
handler(val) {
// console.log('val: ', val)
this.pagination.currentPage = 1
this.getTasks(1, this.type)
}
}
},
created() {
},
mounted: function() {
// this.getAllAppLists()
// if (Object.keys(this.dict).length === 0) {
// this.getDict(true)
// }
this.quickAccessList.forEach((item, index) => {
this.getCustomModules(index)
})
......@@ -219,46 +170,45 @@ export default {
}
})
},
showTitleParams(propForm, titleParams, title) {
if (!propForm) return [{ title }]
if (!titleParams) return [{ title }]
return titleParams.map(attr => {
let title = _get(propForm, attr.attr) || ''
if (attr.placeholder) {
title = attr.placeholder.replace(/\$\*/, title)
}
if (attr.connector) {
title += attr.connector
}
if (attr.dictTypeCode) {
let dictTitleList = this.dict[attr.dictTypeCode]
const oldStateDictName = this.stateDictName
this.stateDictName = attr.dictTypeCode
if (!dictTitleList) {
this.stateDictName = oldStateDictName
dictTitleList = this.dict[attr.dictTypeCode]
}
const _title = dictTitleList.find(dic => dic.value === title)
title = (_title && _title.label) || ''
}
return {
style: attr.style,
title: title
}
})
},
async getDict(flag) {
const list = await this.$utils.getDicListByCode(this.stateDictName)
this.$set(this.dict, this.stateDictName, list)
// flag && this.getTasks(1, this.type)
},
getStateDisplayName(item) {
if (!item.bizExtInfo || !item.bizExtInfo.bizObjectState) {
return ''
}
const code = item.bizExtInfo.bizObjectState
return this.$utils.getParamsFromLists(this.dict[this.stateDictName], 'value', code, 'label') || code
},
// showTitleParams(propForm, titleParams, title) {
// if (!propForm) return [{ title }]
// if (!titleParams) return [{ title }]
// return titleParams.map(attr => {
// let title = _get(propForm, attr.attr) || ''
// if (attr.placeholder) {
// title = attr.placeholder.replace(/\$\*/, title)
// }
// if (attr.connector) {
// title += attr.connector
// }
// if (attr.dictTypeCode) {
// let dictTitleList = this.dict[attr.dictTypeCode]
// const oldStateDictName = this.stateDictName
// this.stateDictName = attr.dictTypeCode
// if (!dictTitleList) {
// this.stateDictName = oldStateDictName
// dictTitleList = this.dict[attr.dictTypeCode]
// }
// const _title = dictTitleList.find(dic => dic.value === title)
// title = (_title && _title.label) || ''
// }
// return {
// style: attr.style,
// title: title
// }
// })
// },
// async getDict(flag) {
// const list = await this.$utils.getDicListByCode(this.stateDictName)
// this.$set(this.dict, this.stateDictName, list)
// },
// getStateDisplayName(item) {
// if (!item.bizExtInfo || !item.bizExtInfo.bizObjectState) {
// return ''
// }
// const code = item.bizExtInfo.bizObjectState
// return this.$utils.getParamsFromLists(this.dict[this.stateDictName], 'value', code, 'label') || code
// },
// 获取待办任务列表
getTasks(page, type) {
const params = {
......@@ -270,16 +220,8 @@ export default {
params.receiveTime1 = this.searchForm.receiveTimeRange[0] + ' 00:00:00'
params.receiveTime2 = this.searchForm.receiveTimeRange[1] + ' 23:59:59'
}
// const str = this.searchForm && this.searchForm.templateKey ? `processDefKey=${this.searchForm.templateKey}&` : ''
this.type = type
if (type === '我的待办') {
// getUnfinishedTask(str + this.$utils.filterParams(params)).then(res => {
// if (params.page === 1) {
// this.taskList = []
// }
// this.addData(res)
// })
if (type === '单个签审') {
get('/indexTask/task/todoStatistics').then(res => {
if (params.page === 1) {
this.taskList = []
......@@ -288,12 +230,6 @@ export default {
})
}
if (type === '已办任务') {
// getFinishedTaskHome(str + this.$utils.filterParams(params)).then(res => {
// if (params.page === 1) {
// this.taskList = []
// }
// this.addData(res.items.content, res.items.totalElements)
// })
get('/indexTask/task/finishStatistics').then(res => {
if (params.page === 1) {
this.taskList = []
......@@ -312,31 +248,10 @@ export default {
},
addData(data, totalElements) {
data.forEach((item) => {
// let showTitle = []
// if (item.bizExtInfo && item.bizExtInfo.bizAttrValues &&
// item.bizExtInfo && item.bizExtInfo.bizConfig) {
// const bizConfig = JSON.parse(item.bizExtInfo.bizConfig)
// showTitle = this.showTitleParams(item.bizExtInfo.bizAttrValues, bizConfig[0].pending, (item.bizExtInfo && item.bizExtInfo.taskTitle) || '')
// } else {
// showTitle = [{ title: (item.bizExtInfo && item.bizExtInfo.taskTitle) || (item.bizExtInfo && item.bizExtInfo.processTitle) || '' }]
// }
this.taskList.push({
...item
// id: item.id,
// processInstanceId: item.processInstanceId,
// name: item.aliasName || item.name || item.taskType,
// showTitle,
// theme: '',
// // theme: theme,
// title: item.bizExtInfo && item.bizExtInfo.taskTitle ? item.bizExtInfo.taskTitle : item.name,
// time: item.startTime,
// status: this.getStateDisplayName(item),
// proxyUserName: item.proxyUserName || '',
// expireTimeInMillis: item.expireTimeInMillis,
// unClaimedFlag: item.unClaimedFlag
})
})
// this.goInfo(this.taskList.length ? this.taskList[0] : null)
this.pagination.total = totalElements
},
showIcon(row) {
......
......@@ -117,20 +117,26 @@ export default {
// 初始化数据
},
mounted() {
this.$nextTick(() => {
this.$refs.myTask.getTasks(1, '我的待办')
})
// this.$nextTick(() => {
// this.$refs.myTask && this.$refs.myTask.getTasks(1, '我的待办')
// })
},
methods: {
tabClick() {
tabClick(val) {
this.$nextTick(() => {
this.$refs.myTask.getTasks(1, this.activeTitle)
if (val.label === '批量签审') {
this.$refs.moduleTaskList.loadData()
} else {
this.$refs.myTask.getTasks(1, val.label)
}
})
},
handClick(title) {
this.activeTitle = title
this.$nextTick(() => {
this.$refs.myTask.getTasks(1, this.activeTitle)
if (title === '已办任务') {
this.$refs.myTask.getTasks(1, this.activeTitle)
}
})
},
getTaskDetail(data) {
......
......@@ -3,6 +3,7 @@
<div class="task-header">
<div class="refresh">
<i class="el-icon-refresh" style="margin-right:10px" title="刷新" @click="loadData(true)" />
<span @click="jumpList">更多<i class="el-icon-arrow-right" title="更多" /></span>
</div>
</div>
<el-scrollbar v-dee-loading="loading" class="task-content">
......@@ -63,6 +64,12 @@ export default {
batchTaskItem: JSON.stringify(item)
}
})
},
jumpList() {
this.$router.push({
path: '/dee-task-center/workflow/task-center/task',
query: { title: '任务查询' }
})
}
}
}
......
<template>
<div class="MyPlanTaskPage">
<div class="TaskComponentView" :class="{'height_class':heightClass}">
<compnent :is="$route.query.router" :key="componentKey" :select-data="$route.query" :sub-type="subType" :def-state="state" />
</div>
</div>
</template>
<script>
export default {
components: {
WarehouseApply: () => import('./warehouseApply'), // 验收入库申请
WarehouseExamine: () => import('./warehouseExamine'), // 验收入库审核
JobResponseInExperiment: () => import('./jobResponseInExperiment'), // 理化试验入库响应
WarehouseInTest: () => import('./warehouseInTest'), // 检验入库响应
OutStorageExpireApply: () => import('./outStorageExpireApply'), // 三期出库申请
OutStorageRecallApply: () => import('./outStorageRecallApply'), // 返厂出库申请
WarehouseConfirm: () => import('./warehouseConfirm'), // 验收入库确认
OutStorageExpireConfirm: () => import('./outStorageExpireConfirm'), // 三期出库确认
OutStorageRecallConfirm: () => import('./outStorageRecallConfirm'), // 返厂出库确认
OutStorageOutApply: () => import('./outStorageOutApply'), // 供外出库申请
OutStorageOutExamine: () => import('./outStorageOutExamine'), // 供外出库审核
OutStorageOutApproval: () => import('./outStorageOutApproval'), // 供外出库批准
OutStorageOutConfirm: () => import('./outStorageOutConfirm'), // 供外出库确认
InStorageMatchBackApply: () => import('./inStorageMatchBackApply'), // 配套退库申请
InStorageMatchBackExamin: () => import('./inStorageMatchBackExamine'), // 配套退库审核
InStorageMatchBackConfirm: () => import('./inStorageMatchBackConfirm'), // 配套退库确认
InStorageUseOutBackApply: () => import('./inStorageUseOutBackApply'), // 领用/供外退库申请
InStorageUseOutBackExamine: () => import('./inStorageUseOutBackExamine'), // 领用/供外退库审核
InStorageUseOutBackConfirm: () => import('./inStorageUseOutBackConfirm') // 领用/供外退库确认
},
data() {
return {
tabPosition: '',
subType: '计划',
state: '',
loadComponents: true,
heightClass: false,
componentKey: 0
}
},
watch: {
'$route.query': {
immediate: true,
deep: true,
handler(v) {
this.componentKey += 1
}
}
},
created() {
},
mounted() {
},
methods: {
}
}
</script>
<style lang="scss">
.MyPlanTaskPage {
background-color: #fff;
// padding: 10px 0;
box-sizing: border-box;
height: 100%;
overflow: hidden;
.height_class {
height: calc(100% - 56px) !important;
}
.el-radio-button .el-radio-button__inner {
padding-left: 10px;
padding-right: 10px;
}
.TaskComponentView {
height: calc(100% - 40px);
box-sizing: border-box;
overflow: hidden;
}
.TodoListTable{
height: 100%;
box-sizing: border-box;
overflow: hidden;
}
.el-pagination{
text-align: right;
}
.TodoListView .splitter-pane:first-child {
padding-bottom: 0 !important;
}
.TodoListView .splitter-pane.splitter-paneR {
padding-top: 10px !important;
}
.splitter-pane-resizer{
&.horizontal{
opacity: 1;
background-color: transparent;
border: 0;
text-align: center;
&::after{
content: "";
display: inline-block;
width: 35px;
height: 2px;
border: 1px solid #8f9192;
border-left: 0;
border-right: 0;
z-index: 5;
}
&:hover{
&::after{
border-color:#3b5485;
}
}
}
}
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment