mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-15 05:12:49 +00:00
perf: 任务详情支持调整聊天区域尺寸
This commit is contained in:
parent
36cdf87bfe
commit
23d0f50a3d
13
resources/assets/js/functions/common.js
vendored
13
resources/assets/js/functions/common.js
vendored
@ -1426,16 +1426,23 @@ const timezone = require("dayjs/plugin/timezone");
|
|||||||
return this.isJson(value) ? value : def;
|
return this.isJson(value) ? value : def;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
existsStorage(key) {
|
||||||
|
return this.__operationStorage(key) !== null;
|
||||||
|
},
|
||||||
|
|
||||||
__operationStorage(key, value) {
|
__operationStorage(key, value) {
|
||||||
if (!key) {
|
if (!key) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let keyName = '__state__';
|
let keyName = '__state__';
|
||||||
if (key.substring(0, 5) === 'cache') {
|
const keyArr = key.split(".");
|
||||||
keyName = '__state:' + key + '__';
|
if (keyArr.length > 1) {
|
||||||
|
const stateName = keyArr.shift();
|
||||||
|
keyName = '__state:' + stateName + '__';
|
||||||
|
key = keyArr.join(".");
|
||||||
}
|
}
|
||||||
if (typeof value === 'undefined') {
|
if (typeof value === 'undefined') {
|
||||||
return this.__loadFromlLocal(key, '', keyName);
|
return this.__loadFromlLocal(key, null, keyName);
|
||||||
} else {
|
} else {
|
||||||
this.__savaToLocal(key, value, keyName);
|
this.__savaToLocal(key, value, keyName);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -431,6 +431,13 @@
|
|||||||
<TaskUpload ref="upload" class="upload" @on-select-file="onSelectFile"/>
|
<TaskUpload ref="upload" class="upload" @on-select-file="onSelectFile"/>
|
||||||
</div>
|
</div>
|
||||||
<div v-show="taskDetail.id > 0" class="task-dialog" :style="dialogStyle">
|
<div v-show="taskDetail.id > 0" class="task-dialog" :style="dialogStyle">
|
||||||
|
<ResizeLine
|
||||||
|
class="task-resize"
|
||||||
|
placement="right"
|
||||||
|
v-model="taskDialogWidth"
|
||||||
|
:min="220"
|
||||||
|
:max="900"
|
||||||
|
:reverse="true"/>
|
||||||
<template v-if="hasOpenDialog">
|
<template v-if="hasOpenDialog">
|
||||||
<DialogWrapper v-if="taskId > 0" ref="dialog" :dialog-id="taskDetail.dialog_id">
|
<DialogWrapper v-if="taskId > 0" ref="dialog" :dialog-id="taskDetail.dialog_id">
|
||||||
<div slot="head" class="head">
|
<div slot="head" class="head">
|
||||||
@ -566,6 +573,7 @@ import TaskTag from "./ProjectTaskTag/tags.vue";
|
|||||||
import TaskTagSelect from "./ProjectTaskTag/select.vue";
|
import TaskTagSelect from "./ProjectTaskTag/select.vue";
|
||||||
import TaskExistTips from "./TaskExistTips.vue";
|
import TaskExistTips from "./TaskExistTips.vue";
|
||||||
import TEditorTask from "../../../components/TEditorTask.vue";
|
import TEditorTask from "../../../components/TEditorTask.vue";
|
||||||
|
import ResizeLine from "../../../components/ResizeLine.vue";
|
||||||
import TaskContentHistory from "./TaskContentHistory.vue";
|
import TaskContentHistory from "./TaskContentHistory.vue";
|
||||||
import TaskTagAdd from "./ProjectTaskTag/add.vue";
|
import TaskTagAdd from "./ProjectTaskTag/add.vue";
|
||||||
import emitter from "../../../store/events";
|
import emitter from "../../../store/events";
|
||||||
@ -573,6 +581,7 @@ import emitter from "../../../store/events";
|
|||||||
export default {
|
export default {
|
||||||
name: "TaskDetail",
|
name: "TaskDetail",
|
||||||
components: {
|
components: {
|
||||||
|
ResizeLine,
|
||||||
TaskTagAdd,
|
TaskTagAdd,
|
||||||
TaskContentHistory,
|
TaskContentHistory,
|
||||||
TEditorTask,
|
TEditorTask,
|
||||||
@ -617,6 +626,7 @@ export default {
|
|||||||
ready: false,
|
ready: false,
|
||||||
|
|
||||||
taskDetail: {},
|
taskDetail: {},
|
||||||
|
taskDialogWidth: $A.getStorageInt('task.dialogWidth', -1),
|
||||||
|
|
||||||
ownerData: {},
|
ownerData: {},
|
||||||
ownerLoad: 0,
|
ownerLoad: 0,
|
||||||
@ -705,6 +715,9 @@ export default {
|
|||||||
data.time && this.$set(this.delayTaskForm, 'time', Math.round(data.time * 100) / 100);
|
data.time && this.$set(this.delayTaskForm, 'time', Math.round(data.time * 100) / 100);
|
||||||
data.type && this.$set(this.delayTaskForm, 'type', data.type);
|
data.type && this.$set(this.delayTaskForm, 'type', data.type);
|
||||||
});
|
});
|
||||||
|
if (this.taskDialogWidth === -1) {
|
||||||
|
this.taskDialogWidth = Math.min(450, Math.min(1200, this.windowWidth * 0.9) * 0.4)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
@ -795,7 +808,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
dialogStyle() {
|
dialogStyle() {
|
||||||
const {windowHeight, hasOpenDialog} = this;
|
const {windowHeight, taskDialogWidth, hasOpenDialog} = this;
|
||||||
const height = Math.min(1100, windowHeight)
|
const height = Math.min(1100, windowHeight)
|
||||||
if (!height) {
|
if (!height) {
|
||||||
return {};
|
return {};
|
||||||
@ -805,7 +818,8 @@ export default {
|
|||||||
}
|
}
|
||||||
const factor = height > 900 ? 200 : 70;
|
const factor = height > 900 ? 200 : 70;
|
||||||
return {
|
return {
|
||||||
minHeight: (height - factor - 48) + 'px'
|
minHeight: (height - factor - 48) + 'px',
|
||||||
|
width: taskDialogWidth + 'px',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -1049,7 +1063,10 @@ export default {
|
|||||||
this.updateData('tag', this.tagValue);
|
this.updateData('tag', this.tagValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
taskDialogWidth(w) {
|
||||||
|
$A.setStorage('task.dialogWidth', w);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
padding: 0 22px 10px 0;
|
padding: 0 22px 10px 0;
|
||||||
min-height: 120px;
|
min-height: 120px;
|
||||||
.task-info {
|
.task-info {
|
||||||
flex: 3;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
position: relative;
|
position: relative;
|
||||||
@ -575,7 +575,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.task-dialog {
|
.task-dialog {
|
||||||
flex: 2;
|
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@ -583,6 +582,14 @@
|
|||||||
margin-top: 22px;
|
margin-top: 22px;
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
|
.task-resize {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
width: 2px;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
.head {
|
.head {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -794,7 +801,7 @@
|
|||||||
.task-dialog {
|
.task-dialog {
|
||||||
margin: 0 0 0 18px;
|
margin: 0 0 0 18px;
|
||||||
min-width: 220px;
|
min-width: 220px;
|
||||||
max-width: 450px;
|
max-width: 900px;
|
||||||
border-left: 1px solid #f4f5f5;
|
border-left: 1px solid #f4f5f5;
|
||||||
|
|
||||||
.head {
|
.head {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user