perf: 任务窗口
This commit is contained in:
parent
9bfa680fa4
commit
320dd49a87
@ -335,7 +335,7 @@ class ProjectTask extends AbstractModel
|
||||
'p_color' => $p_color,
|
||||
]);
|
||||
if ($content) {
|
||||
$task->desc = Base::getHtml($content);
|
||||
$task->desc = Base::getHtml($content, 100);
|
||||
}
|
||||
// 标题
|
||||
if (empty($name)) {
|
||||
@ -531,7 +531,7 @@ class ProjectTask extends AbstractModel
|
||||
], [
|
||||
'content' => $data['content'],
|
||||
]);
|
||||
$this->desc = Base::getHtml($data['content']);
|
||||
$this->desc = Base::getHtml($data['content'], 100);
|
||||
$this->addLog("修改{任务}详细描述");
|
||||
$updateContent = true;
|
||||
}
|
||||
|
7
resources/assets/js/app.js
vendored
7
resources/assets/js/app.js
vendored
@ -91,6 +91,8 @@ Vue.prototype.goBack = function (number) {
|
||||
|
||||
Vue.prototype.$A = $A;
|
||||
Vue.prototype.$Electron = !!__IS_ELECTRON ? require('electron') : null;
|
||||
Vue.prototype.$isMainElectron = !!__IS_ELECTRON && window.navigator && window.navigator.userAgent && /\s+MainTaskWindow\//.test(window.navigator.userAgent);
|
||||
Vue.prototype.$isSubElectron = !!__IS_ELECTRON && window.navigator && window.navigator.userAgent && /\s+SubTaskWindow\//.test(window.navigator.userAgent);
|
||||
|
||||
Vue.config.productionTip = false;
|
||||
|
||||
@ -113,9 +115,10 @@ $A.store = app.$store;
|
||||
$A.L = app.$L;
|
||||
|
||||
$A.Electron = app.$Electron;
|
||||
$A.isMainElectron = app.$isMainElectron;
|
||||
$A.isSubElectron = app.$isSubElectron;
|
||||
$A.execMainDispatch = (action, data) => {
|
||||
const navigator = window.navigator && window.navigator.userAgent
|
||||
if ($A.Electron && navigator && /\s+SubTaskWindow\//.test(navigator)) {
|
||||
if ($A.isSubElectron) {
|
||||
$A.Electron.ipcRenderer.send('sendForwardMain', {
|
||||
channel: 'dispatch',
|
||||
data: {action, data},
|
||||
|
@ -145,7 +145,9 @@
|
||||
}"
|
||||
@on-visible-change="taskVisibleChange"
|
||||
footer-hide>
|
||||
<TaskDetail :task-id="taskId" :open-task="taskData"/>
|
||||
<div class="page-manage-task-modal" :style="taskStyle">
|
||||
<TaskDetail :task-id="taskId" :open-task="taskData"/>
|
||||
</div>
|
||||
</Modal>
|
||||
|
||||
<!--查看所有团队-->
|
||||
@ -225,6 +227,7 @@ export default {
|
||||
openMenu: {},
|
||||
visibleMenu: false,
|
||||
show768Menu: false,
|
||||
innerHeight: window.innerHeight,
|
||||
|
||||
allUserShow: false,
|
||||
allProjectShow: false,
|
||||
@ -258,6 +261,7 @@ export default {
|
||||
});
|
||||
//
|
||||
document.addEventListener('keydown', this.shortcutEvent);
|
||||
window.addEventListener('resize', this.innerHeightListener);
|
||||
//
|
||||
if (this.$Electron) {
|
||||
this.$Electron.ipcRenderer.send('setDockBadge', 0);
|
||||
@ -271,6 +275,7 @@ export default {
|
||||
}
|
||||
//
|
||||
document.removeEventListener('keydown', this.shortcutEvent);
|
||||
window.removeEventListener('resize', this.innerHeightListener);
|
||||
},
|
||||
|
||||
deactivated() {
|
||||
@ -341,6 +346,13 @@ export default {
|
||||
return data.filter(({name}) => name.toLowerCase().indexOf(projectKeyValue.toLowerCase()) > -1);
|
||||
}
|
||||
return data;
|
||||
},
|
||||
|
||||
taskStyle() {
|
||||
const {innerHeight} = this;
|
||||
return {
|
||||
maxHeight: (innerHeight - (innerHeight > 900 ? 200 : 70) - 20) + 'px'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@ -450,6 +462,10 @@ export default {
|
||||
};
|
||||
},
|
||||
|
||||
innerHeightListener() {
|
||||
this.innerHeight = window.innerHeight;
|
||||
},
|
||||
|
||||
chackPass() {
|
||||
if (this.userInfo.changepass === 1) {
|
||||
this.goForward({path: '/manage/setting/password'});
|
||||
|
@ -145,7 +145,7 @@
|
||||
</EDropdown>
|
||||
</div>
|
||||
</div>
|
||||
<div class="scroller overlay-y" :style="scrollerStyle">
|
||||
<div class="scroller overlay-y">
|
||||
<div class="title">
|
||||
<Input
|
||||
v-model="taskDetail.name"
|
||||
@ -580,19 +580,6 @@ export default {
|
||||
return this.taskDetail.dialog_id > 0 && !this.$store.state.windowMax768;
|
||||
},
|
||||
|
||||
scrollerStyle() {
|
||||
const {innerHeight, hasOpenDialog} = this;
|
||||
if (!innerHeight) {
|
||||
return {};
|
||||
}
|
||||
if (!hasOpenDialog) {
|
||||
return {};
|
||||
}
|
||||
return {
|
||||
maxHeight: (innerHeight - (innerHeight > 900 ? 200 : 70) - 66 - 30) + 'px'
|
||||
}
|
||||
},
|
||||
|
||||
dialogStyle() {
|
||||
const {innerHeight, hasOpenDialog} = this;
|
||||
if (!innerHeight) {
|
||||
@ -1122,7 +1109,7 @@ export default {
|
||||
}).then(({data}) => {
|
||||
this.$store.dispatch("saveTask", data);
|
||||
this.$store.dispatch("getDialogOne", data.dialog_id);
|
||||
if (this.$Electron) {
|
||||
if ($A.isSubElectron) {
|
||||
this.resizeDialog();
|
||||
return;
|
||||
}
|
||||
@ -1156,7 +1143,7 @@ export default {
|
||||
this.sendLoad = false;
|
||||
this.$store.dispatch("saveTask", data);
|
||||
this.$store.dispatch("getDialogOne", data.dialog_id);
|
||||
if (this.$Electron) {
|
||||
if ($A.isSubElectron) {
|
||||
this.resizeDialog();
|
||||
return;
|
||||
}
|
||||
@ -1188,9 +1175,6 @@ export default {
|
||||
},
|
||||
|
||||
openNewWin() {
|
||||
if (!this.$Electron) {
|
||||
return;
|
||||
}
|
||||
let config = {
|
||||
parent: null,
|
||||
width: Math.min(window.screen.availWidth, this.$el.clientWidth + 72),
|
||||
@ -1206,17 +1190,12 @@ export default {
|
||||
name: 'task-' + this.taskDetail.id,
|
||||
path: "/single/task/" + this.taskDetail.id,
|
||||
force: false,
|
||||
devTools: false,
|
||||
userAgent: "ElectronSubwindow",
|
||||
config
|
||||
});
|
||||
this.$store.dispatch('openTask', 0);
|
||||
},
|
||||
|
||||
resizeDialog() {
|
||||
if (!this.$Electron) {
|
||||
return;
|
||||
}
|
||||
this.$Electron.ipcRenderer.sendSync('windowSize', {
|
||||
width: Math.max(1100, window.innerWidth),
|
||||
height: Math.max(720, window.innerHeight),
|
||||
|
@ -1,7 +1,9 @@
|
||||
.task-detail {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin: 0 -10px 30px;
|
||||
margin: 0 -32px 12px -10px;
|
||||
padding: 0 22px 12px 0;
|
||||
overflow: auto;
|
||||
.task-info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
@ -435,7 +437,7 @@
|
||||
.no-input {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 32px 0 0 36px;
|
||||
margin: 22px 0 0 36px;
|
||||
background-color: #F4F5F7;
|
||||
padding: 10px 12px;
|
||||
border-radius: 10px;
|
||||
|
5
resources/assets/sass/pages/page-manage.scss
vendored
5
resources/assets/sass/pages/page-manage.scss
vendored
@ -271,6 +271,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
.page-manage-task-modal {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.page-manage-add-task-button-group {
|
||||
margin-left: 8px !important;
|
||||
.ivu-dropdown {
|
||||
|
Loading…
x
Reference in New Issue
Block a user