This commit is contained in:
weipengfei 2024-01-04 13:53:27 +08:00
parent 7ab1dc4677
commit 61a88398a7
8 changed files with 1565 additions and 66 deletions

File diff suppressed because it is too large Load Diff

View File

@ -17,6 +17,7 @@ export default {
toHome() {
const currentOrganization = getStore('currentOrganization', true);
let home = config.HOME_PAGE;
console.log(config.HOME_PAGE);
if (currentOrganization) {
home = home + '/' + currentOrganization.code;
}

View File

@ -16,6 +16,13 @@ export default [
component: resolve => require(['@/views/project/space/taskdetail'], resolve),
meta: {model: 'Project', info: {show_slider: false}},
},
{
//任务添加
name: 'taskadd',
path: 'add/:taskCode',
component: resolve => require(['@/views/project/space/taskadd'], resolve),
meta: {model: 'Project', info: {show_slider: false}},
},
]
},
{

View File

@ -328,6 +328,7 @@
//
let that = this;
that.menu.forEach(function (v, k) {
console.log(v);
if (v.id == event.key) {
that.menus = v.children;
let turnPath = '/';

View File

@ -27,6 +27,7 @@
<li class=""><a class="app" data-app="works"
@click="$router.push('/project/space/files/' + code)">
文件</a>
</li>
<li class=""><a class="app" data-app="build"
@click="$router.push('/project/space/overview/' + code)">
概览</a>
@ -78,6 +79,13 @@
<span class="task-count"
v-if="stage.tasks.length > 0"> · {{ stage.tasks.length }}</span>
</div>
<!--添加任务按钮-->
<div @click.stop="addTask(stage.code,index)">
<a class="task-creator-handler link-add-handler">
<a-icon type="plus-circle" style="padding-left: 10px;padding-right: 5px;"></a-icon>
<span style="font-size: 0.8rem;">添加任务</span>
</a>
</div>
<div class="stage-menu-toggler popover">
<a-dropdown :trigger="['click']" placement="bottomCenter">
<a-tooltip placement="top">
@ -811,71 +819,72 @@
},
directives: {
dragscroll2: function (el) {
// el.oncontextmenu = function (ev) {
el.onmousedown = function (ev) {
console.log(ev.target.classList);
const exclude = [
"task-content",
"task-content-set",
"task-content",
"stage-name",
"scrum-stage-header",
"task-creator-handler",
"ant-btn",
"ant-input",
];
const isExclude = exclude.some((item) =>
ev.target.classList.contains(item)
);
if (isExclude) {
// document.onmousemove = null;
// document.onmouseup = null;
// el.style["scroll-behavior"] = originalScrollBehavior;
// el.style["pointer-events"] = originalPointerEvents;
return;
}
el.oncontextmenu = function (ev) {
el.onmousedown = function (ev) {
console.log(ev.target.classList);
const exclude = [
"task-content",
"task-content-set",
"task-content",
"stage-name",
"scrum-stage-header",
"task-creator-handler",
"ant-btn",
"ant-input",
];
const isExclude = exclude.some((item) =>
ev.target.classList.contains(item)
);
if (isExclude) {
// document.onmousemove = null;
// document.onmouseup = null;
// el.style["scroll-behavior"] = originalScrollBehavior;
// el.style["pointer-events"] = originalPointerEvents;
return;
}
ev.stopPropagation();
ev.preventDefault();
document.body.style.cursor = "move";
const disX = ev.clientX;
const disY = ev.clientY;
const originalScrollLeft = el.scrollLeft;
const originalScrollTop = el.scrollTop;
const originalScrollBehavior = el.style["scroll-behavior"];
const originalPointerEvents = el.style["pointer-events"];
el.style["scroll-behavior"] = "auto";
let elEvent = ev;
// document使
document.onmousemove = function (ev) {
ev.stopPropagation();
ev.preventDefault();
// elEvent.target.style.cursor = "move";
// ev.target.style.cursor = "move";
document.body.style.cursor = "move";
ev.stopPropagation();
ev.preventDefault();
document.body.style.cursor = "move";
const disX = ev.clientX;
const disY = ev.clientY;
const originalScrollLeft = el.scrollLeft;
const originalScrollTop = el.scrollTop;
const originalScrollBehavior = el.style["scroll-behavior"];
const originalPointerEvents = el.style["pointer-events"];
el.style["scroll-behavior"] = "auto";
let elEvent = ev;
// document使
document.onmousemove = function (ev) {
ev.stopPropagation();
ev.preventDefault();
// elEvent.target.style.cursor = "move";
// ev.target.style.cursor = "move";
document.body.style.cursor = "move";
const distanceX = ev.clientX - disX;
const distanceY = ev.clientY - disY;
el.scrollTo(
originalScrollLeft - distanceX,
originalScrollTop - distanceY
);
//
el.style["pointer-events"] = "none";
const distanceX = ev.clientX - disX;
const distanceY = ev.clientY - disY;
el.scrollTo(
originalScrollLeft - distanceX,
originalScrollTop - distanceY
);
//
el.style["pointer-events"] = "none";
};
document.onmouseup = function (ev) {
ev.stopPropagation();
// elEvent.target.style.cursor = "auto";
// ev.target.style.cursor = "auto";
document.body.style.cursor = "auto";
document.onmousemove = null;
document.onmouseup = null;
el.style["scroll-behavior"] = originalScrollBehavior;
el.style["pointer-events"] = originalPointerEvents;
};
};
document.onmouseup = function (ev) {
ev.stopPropagation();
// elEvent.target.style.cursor = "auto";
// ev.target.style.cursor = "auto";
document.body.style.cursor = "auto";
document.onmousemove = null;
document.onmouseup = null;
el.style["scroll-behavior"] = originalScrollBehavior;
el.style["pointer-events"] = originalPointerEvents;
};
};
},
}
}
},
methods: {
init() {
@ -991,6 +1000,14 @@
selectExecutor({key}) {
this.defaultExecutor = this.projectMembers[key];
},
//
addTask(stageCode, stageIndex){
console.log('-----',stageCode);
this.task.stage_code = stageCode;
this.task.project_code = this.code;
this.task.assign_to = this.defaultExecutor.code;
this.$router.push(`${this.$route.path}/add/${this.code}?from=${stageIndex}`);
},
//
createTask(stageCode, stageIndex) {
if (!this.task.name) {
@ -1053,7 +1070,11 @@
// title: '',
// msg: ''
// }, 'notice', 'success', 5);
}
//
this.taskDetail(res.data.code, stageIndex);
console.log({...res.data});
};
}).catch(() => {
app.createTaskLoading = false;
});
@ -1270,6 +1291,11 @@
},
taskDetail(code, stageIndex) {
this.$router.push(`${this.$route.path}/detail/${code}?from=${stageIndex}`);
this.$nextTick(()=>{
setTimeout(()=>{
this.showTaskCard(stageIndex,false);
}, 700)
})
},
stageSort(event) {
const list = this.getPreAndNextCode(event);

View File

@ -0,0 +1,74 @@
<template>
<a-modal
class="task-add-modal"
width="min-content"
:closable="false"
visible
title=""
:footer="null"
@cancel="addClose"
>
<task-add :taskCode="code" @close="addClose"></task-add>
</a-modal>
</template>
<script>
import taskAdd from '../../../components/project/taskAdd'
export default {
name: "task-add-modal",
components: {
taskAdd
},
data() {
return {
loading: false,
code: this.$route.params.taskCode,
projectCode: this.$route.params.code,
}
},
created() {
this.init();
},
methods: {
init() {
this.loading = true;
},
addClose() {
const stageIndex = this.$route.query.from;
let url = '';
if (stageIndex) {
url = `?from=${stageIndex}`;
}
this.$router.push(`/project/space/task/${this.projectCode}${url}`);
},
}
}
</script>
<style lang="less">
.task-add-modal {
/*display: flex;*/
/*justify-content: center;*/
/*flex: 1;*/
/*min-height: 1px;*/
/*min-width: 1px;*/
width: 1200px;
&.ant-modal {
padding-bottom: 0;
}
.ant-modal-content {
/*width: 1200px;*/
/*overflow: hidden;*/
.ant-modal-body {
padding: 0;
}
}
}
</style>

View File

@ -130,8 +130,8 @@
showLoadingMore: false,
loadingMore: false,
currentTemplate: {},
cover:'https://beta.vilson.xyz/static/image/default/project-cover.png',
// cover: config.PROD_URL + '/static/image/default/cover.png',
// cover:'https://beta.vilson.xyz/static/image/default/project-cover.png',
cover: config.PROD_URL + '/static/image/default/cover.png',
newData: {
id: 0,
},

View File

@ -19,7 +19,7 @@ module.exports = {
}
},
devServer: {
host: process.env.VUE_APP_DEV_HOST || '127.0.0.1',
// host: process.env.VUE_APP_DEV_HOST || '127.0.0.1',
port: process.env.VUE_APP_DEV_PORT || '8045',
https: false,
hotOnly: false,