From 61a88398a74bc33ae242af75bfe716912f0d3b2d Mon Sep 17 00:00:00 2001 From: weipengfei <2187978347@qq.com> Date: Thu, 4 Jan 2024 13:53:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/project/taskAdd.vue | 1390 ++++++++++++++++++++++++++ src/mixins/common.js | 1 + src/router/home.js | 7 + src/views/index.vue | 1 + src/views/project/space/task.vue | 152 +-- src/views/project/space/taskadd.vue | 74 ++ src/views/project/template/index.vue | 4 +- vue.config.js | 2 +- 8 files changed, 1565 insertions(+), 66 deletions(-) create mode 100644 src/components/project/taskAdd.vue create mode 100644 src/views/project/space/taskadd.vue diff --git a/src/components/project/taskAdd.vue b/src/components/project/taskAdd.vue new file mode 100644 index 0000000..6d06635 --- /dev/null +++ b/src/components/project/taskAdd.vue @@ -0,0 +1,1390 @@ + + + + + + diff --git a/src/mixins/common.js b/src/mixins/common.js index eb22778..0f2d9d5 100644 --- a/src/mixins/common.js +++ b/src/mixins/common.js @@ -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; } diff --git a/src/router/home.js b/src/router/home.js index 655a481..b65e0b1 100644 --- a/src/router/home.js +++ b/src/router/home.js @@ -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}}, + }, ] }, { diff --git a/src/views/index.vue b/src/views/index.vue index 71159d9..7d97050 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -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 = '/'; diff --git a/src/views/project/space/task.vue b/src/views/project/space/task.vue index 821d797..27649c1 100644 --- a/src/views/project/space/task.vue +++ b/src/views/project/space/task.vue @@ -27,6 +27,7 @@
  • 文件 +
  • 概览 @@ -78,6 +79,13 @@ · {{ stage.tasks.length }} + +
    + + + 添加任务 + +
    @@ -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); diff --git a/src/views/project/space/taskadd.vue b/src/views/project/space/taskadd.vue new file mode 100644 index 0000000..ad040cd --- /dev/null +++ b/src/views/project/space/taskadd.vue @@ -0,0 +1,74 @@ + + + + + + diff --git a/src/views/project/template/index.vue b/src/views/project/template/index.vue index fb05b72..f0b3fe6 100644 --- a/src/views/project/template/index.vue +++ b/src/views/project/template/index.vue @@ -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, }, diff --git a/vue.config.js b/vue.config.js index 9263c28..c997efa 100644 --- a/vue.config.js +++ b/vue.config.js @@ -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,