perf: 优化任务窗口

This commit is contained in:
kuaifan 2022-04-20 16:12:19 +08:00
parent 4c595affa5
commit 0ad32ff63d
5 changed files with 25 additions and 16 deletions

View File

@ -305,8 +305,8 @@
:mask-closable="false" :mask-closable="false"
:footer-hide="true" :footer-hide="true"
@on-visible-change="taskVisibleChange"> @on-visible-change="taskVisibleChange">
<div class="page-manage-task-modal" :style="taskStyle"> <div class="page-manage-task-modal">
<TaskDetail ref="taskDetail" :task-id="taskId" :open-task="taskData"/> <TaskDetail ref="taskDetail" :task-id="taskId" :open-task="taskData" modalMode/>
</div> </div>
</Modal> </Modal>

View File

@ -70,7 +70,8 @@
<!--主任务--> <!--主任务-->
<div <div
v-else-if="ready" v-else-if="ready"
:class="{'task-detail':true, 'open-dialog': hasOpenDialog, 'completed': taskDetail.complete_at}"> :class="{'task-detail':true, 'open-dialog': hasOpenDialog, 'completed': taskDetail.complete_at}"
:style="taskDetailStyle">
<div v-show="taskDetail.id > 0" class="task-info"> <div v-show="taskDetail.id > 0" class="task-info">
<div class="head"> <div class="head">
<TaskMenu <TaskMenu
@ -454,6 +455,11 @@ export default {
type: Boolean, type: Boolean,
default: true default: true
}, },
// Modal
modalMode: {
type: Boolean,
default: false
},
}, },
data() { data() {
return { return {
@ -625,6 +631,16 @@ export default {
} }
}, },
taskDetailStyle() {
const {modalMode, innerHeight, hasOpenDialog} = this;
if (modalMode && hasOpenDialog) {
return {
maxHeight: (innerHeight - (innerHeight > 900 ? 200 : 70) - 30) + 'px'
}
}
return {}
},
cutTime() { cutTime() {
const {taskDetail} = this; const {taskDetail} = this;
let start_at = $A.Date(taskDetail.start_at, true); let start_at = $A.Date(taskDetail.start_at, true);

View File

@ -11,12 +11,12 @@
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow: auto;
.task-detail { .task-detail {
flex: 1; flex: 1;
margin: 0; margin: 0;
padding: 18px 22px; padding: 18px 22px;
border-radius: 0; border-radius: 0;
overflow: auto;
} }
} }
</style> </style>

View File

@ -504,6 +504,7 @@
.percent { .percent {
display: none; display: none;
margin-left: 4px; margin-left: 4px;
align-items: center;
cursor: pointer; cursor: pointer;
} }
} }
@ -628,7 +629,7 @@
} }
.percent { .percent {
display: inline-block; display: flex;
} }
} }
} }

View File

@ -4,7 +4,6 @@
margin: 0 -32px 12px -10px; margin: 0 -32px 12px -10px;
padding: 0 22px 12px 0; padding: 0 22px 12px 0;
min-height: 120px; min-height: 120px;
overflow: auto;
.task-info { .task-info {
flex: 3; flex: 3;
display: flex; display: flex;
@ -492,6 +491,7 @@
flex-shrink: 0; flex-shrink: 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: flex-end;
margin-top: 22px; margin-top: 22px;
position: relative; position: relative;
.head { .head {
@ -671,16 +671,8 @@
margin: 0 0 0 18px; margin: 0 0 0 18px;
min-width: 320px; min-width: 320px;
max-width: 450px; max-width: 450px;
&:before { border-left: 1px solid #f4f5f5;
content: "";
position: absolute;
top: 0;
left: 0;
bottom: 0;
z-index: 1;
width: 1px;
background-color: #f4f5f5;
}
.head { .head {
&:before { &:before {
left: 18px; left: 18px;