add:首页功能开发

This commit is contained in:
test 2021-12-28 15:38:40 +08:00
commit ffc2c7dea3
66 changed files with 509 additions and 189 deletions

View File

@ -114,7 +114,7 @@ class SystemController extends AbstractController
return Base::retError('参数错误'); return Base::retError('参数错误');
} }
foreach ($list AS $item) { foreach ($list AS $item) {
if (empty($item['name']) || empty($item['color']) || empty($item['days']) || empty($item['priority'])) { if (empty($item['name']) || empty($item['color']) || empty($item['priority'])) {
continue; continue;
} }
$array[] = [ $array[] = [
@ -231,7 +231,7 @@ class SystemController extends AbstractController
} }
/** /**
* @api {post} api/system/imgupload 11. 上传图片 * @api {post} api/system/imgupload 09. 上传图片
* *
* @apiDescription 需要token身份 * @apiDescription 需要token身份
* @apiVersion 1.0.0 * @apiVersion 1.0.0
@ -281,7 +281,7 @@ class SystemController extends AbstractController
} }
/** /**
* @api {get} api/system/get/imgview 12. 浏览图片空间 * @api {get} api/system/get/imgview 10. 浏览图片空间
* *
* @apiDescription 需要token身份 * @apiDescription 需要token身份
* @apiVersion 1.0.0 * @apiVersion 1.0.0
@ -377,7 +377,7 @@ class SystemController extends AbstractController
} }
/** /**
* @api {post} api/system/fileupload 13. 上传文件 * @api {post} api/system/fileupload 11. 上传文件
* *
* @apiDescription 需要token身份 * @apiDescription 需要token身份
* @apiVersion 1.0.0 * @apiVersion 1.0.0

View File

@ -153,7 +153,7 @@ class UsersController extends AbstractController
} }
/** /**
* @api {get} api/users/reg/needinvite 04. 是否需要邀请码 * @api {get} api/users/reg/needinvite 05. 是否需要邀请码
* *
* @apiDescription 用于判断注册是否需要邀请码 * @apiDescription 用于判断注册是否需要邀请码
* @apiVersion 1.0.0 * @apiVersion 1.0.0
@ -172,7 +172,7 @@ class UsersController extends AbstractController
} }
/** /**
* @api {get} api/users/info 05. 获取我的信息 * @api {get} api/users/info 06. 获取我的信息
* *
* @apiDescription 需要token身份 * @apiDescription 需要token身份
* @apiVersion 1.0.0 * @apiVersion 1.0.0
@ -208,7 +208,7 @@ class UsersController extends AbstractController
} }
/** /**
* @api {get} api/users/editdata 06. 修改自己的资料 * @api {get} api/users/editdata 07. 修改自己的资料
* *
* @apiDescription 需要token身份 * @apiDescription 需要token身份
* @apiVersion 1.0.0 * @apiVersion 1.0.0
@ -268,7 +268,7 @@ class UsersController extends AbstractController
} }
/** /**
* @api {get} api/users/editpass 07. 修改自己的密码 * @api {get} api/users/editpass 08. 修改自己的密码
* *
* @apiDescription 需要token身份 * @apiDescription 需要token身份
* @apiVersion 1.0.0 * @apiVersion 1.0.0
@ -308,7 +308,7 @@ class UsersController extends AbstractController
} }
/** /**
* @api {get} api/users/search 08. 搜索会员列表 * @api {get} api/users/search 09. 搜索会员列表
* *
* @apiDescription 搜索会员列表 * @apiDescription 搜索会员列表
* @apiVersion 1.0.0 * @apiVersion 1.0.0
@ -369,7 +369,7 @@ class UsersController extends AbstractController
} }
/** /**
* @api {get} api/users/basic 09. 获取指定会员基础信息 * @api {get} api/users/basic 10. 获取指定会员基础信息
* *
* @apiDescription 需要token身份 * @apiDescription 需要token身份
* @apiVersion 1.0.0 * @apiVersion 1.0.0

View File

@ -335,7 +335,7 @@ class ProjectTask extends AbstractModel
'p_color' => $p_color, 'p_color' => $p_color,
]); ]);
if ($content) { if ($content) {
$task->desc = Base::getHtml($content); $task->desc = Base::getHtml($content, 100);
} }
// 标题 // 标题
if (empty($name)) { if (empty($name)) {
@ -531,7 +531,7 @@ class ProjectTask extends AbstractModel
], [ ], [
'content' => $data['content'], 'content' => $data['content'],
]); ]);
$this->desc = Base::getHtml($data['content']); $this->desc = Base::getHtml($data['content'], 100);
$this->addLog("修改{任务}详细描述"); $this->addLog("修改{任务}详细描述");
$updateContent = true; $updateContent = true;
} }

View File

@ -35,7 +35,7 @@ class SettingsTableSeeder extends Seeder
'id' => 2, 'id' => 2,
'name' => 'priority', 'name' => 'priority',
'desc' => '', 'desc' => '',
'setting' => '[{"name":"\\u91cd\\u8981\\u4e14\\u7d27\\u6025","color":"#ED4014","days":1,"priority":1},{"name":"\\u91cd\\u8981\\u4e0d\\u7d27\\u6025","color":"#F16B62","days":3,"priority":2},{"name":"\\u7d27\\u6025\\u4e0d\\u91cd\\u8981","color":"#19C919","days":5,"priority":3},{"name":"\\u4e0d\\u91cd\\u8981\\u4e0d\\u7d27\\u6025","color":"#2D8CF0","days":7,"priority":4}]', 'setting' => '[{"name":"\\u91cd\\u8981\\u4e14\\u7d27\\u6025","color":"#ED4014","days":1,"priority":1},{"name":"\\u91cd\\u8981\\u4e0d\\u7d27\\u6025","color":"#F16B62","days":3,"priority":2},{"name":"\\u7d27\\u6025\\u4e0d\\u91cd\\u8981","color":"#19C919","days":5,"priority":3},{"name":"\\u4e0d\\u91cd\\u8981\\u4e0d\\u7d27\\u6025","color":"#2D8CF0","days":0,"priority":4}]',
'created_at' => seeders_at('2021-07-01 08:04:30'), 'created_at' => seeders_at('2021-07-01 08:04:30'),
'updated_at' => seeders_at('2021-07-01 09:20:26'), 'updated_at' => seeders_at('2021-07-01 09:20:26'),
), ),

142
electron/main.js vendored
View File

@ -1,7 +1,7 @@
const fs = require('fs') const fs = require('fs')
const path = require('path') const path = require('path')
const XLSX = require('xlsx'); const XLSX = require('xlsx');
const {app, BrowserWindow, ipcMain, dialog} = require('electron') const {app, BrowserWindow, ipcMain, dialog, screen} = require('electron')
let mainWindow = null, let mainWindow = null,
subWindow = [], subWindow = [],
@ -42,7 +42,7 @@ function randomString(len) {
return pwd; return pwd;
} }
function createWindow() { function createMainWindow() {
mainWindow = new BrowserWindow({ mainWindow = new BrowserWindow({
width: 1280, width: 1280,
height: 800, height: 800,
@ -53,6 +53,7 @@ function createWindow() {
contextIsolation: false contextIsolation: false
} }
}) })
mainWindow.webContents.setUserAgent(mainWindow.webContents.getUserAgent() + " MainTaksWindow/1.0");
if (devloadUrl) { if (devloadUrl) {
mainWindow.loadURL(devloadUrl).then(r => { mainWindow.loadURL(devloadUrl).then(r => {
@ -76,24 +77,24 @@ function createWindow() {
}) })
} }
function createRouter(arg) { function createSubWindow(args) {
if (!arg) { if (!args) {
return; return;
} }
if (typeof arg !== "object") { if (typeof args !== "object") {
arg = { args = {
path: arg, path: args,
config: {}, config: {},
} }
} }
let name = arg.name || "auto_" + randomString(6); let name = args.name || "auto_" + randomString(6);
let item = subWindow.find(item => item.name == name); let item = subWindow.find(item => item.name == name);
let browser = item ? item.browser : null; let browser = item ? item.browser : null;
if (browser) { if (browser) {
browser.focus(); browser.focus();
if (arg.force === false) { if (args.force === false) {
return; return;
} }
} else { } else {
@ -104,10 +105,11 @@ function createRouter(arg) {
parent: mainWindow, parent: mainWindow,
webPreferences: { webPreferences: {
preload: path.join(__dirname, 'preload.js'), preload: path.join(__dirname, 'preload.js'),
devTools: args.devTools !== false,
nodeIntegration: true, nodeIntegration: true,
contextIsolation: false contextIsolation: false
} }
}, arg.config || {})) }, args.config || {}))
browser.on('close', function () { browser.on('close', function () {
let index = subWindow.findIndex(item => item.name == name); let index = subWindow.findIndex(item => item.name == name);
if (index > -1) { if (index > -1) {
@ -116,14 +118,15 @@ function createRouter(arg) {
}) })
subWindow.push({ name, browser }) subWindow.push({ name, browser })
} }
browser.webContents.setUserAgent(browser.webContents.getUserAgent() + " SubTaskWindow/1.0" + (args.userAgent ? (" " + args.userAgent) : ""));
if (devloadUrl) { if (devloadUrl) {
browser.loadURL(devloadUrl + '#' + (arg.hash || arg.path)).then(r => { browser.loadURL(devloadUrl + '#' + (args.hash || args.path)).then(r => {
}) })
} else { } else {
browser.loadFile('./public/index.html', { browser.loadFile('./public/index.html', {
hash: arg.hash || arg.path hash: args.hash || args.path
}).then(r => { }).then(r => {
}) })
@ -131,55 +134,131 @@ function createRouter(arg) {
} }
app.whenReady().then(() => { app.whenReady().then(() => {
createWindow() createMainWindow()
app.on('activate', function () { app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) createWindow() if (BrowserWindow.getAllWindows().length === 0) createMainWindow()
}) })
}) })
app.on('window-all-closed', function () { app.on('window-all-closed', () => {
if (process.platform !== 'darwin') app.quit() if (process.platform !== 'darwin') {
app.quit()
}
}) })
app.on('before-quit', () => { app.on('before-quit', () => {
willQuitApp = true willQuitApp = true
}) })
ipcMain.on('inheritClose', () => { ipcMain.on('inheritClose', (event) => {
inheritClose = true inheritClose = true
event.returnValue = "ok"
}) })
ipcMain.on('windowRouter', (event, arg) => { ipcMain.on('windowRouter', (event, args) => {
createRouter(arg) createSubWindow(args)
event.returnValue = "ok"
}) })
ipcMain.on('windowHidden', () => { ipcMain.on('windowHidden', (event) => {
app.hide(); app.hide();
event.returnValue = "ok"
}) })
ipcMain.on('windowClose', () => { ipcMain.on('windowClose', (event) => {
mainWindow.close() const win = BrowserWindow.fromWebContents(event.sender);
win.close()
event.returnValue = "ok"
}) })
ipcMain.on('windowMax', function () { ipcMain.on('windowSize', (event, args) => {
if (mainWindow.isMaximized()) { const win = BrowserWindow.fromWebContents(event.sender);
mainWindow.restore(); if (win) {
} else { if (args.width || args.height) {
mainWindow.maximize(); let [w, h] = win.getSize()
const width = args.width || w
const height = args.height || h
win.setSize(width, height, args.animate === true)
//
if (args.autoZoom === true) {
let move = false
let [x, y] = win.getPosition()
if (Math.abs(width - w) > 10) {
move = true
x -= (width - w) / 2
}
if (Math.abs(height - h) > 10) {
move = true
y -= (height - h) / 2
}
if (move) {
win.setPosition(Math.max(0, Math.floor(x)), Math.max(0, Math.floor(y)))
}
}
}
if (args.minWidth || args.minHeight) {
win.setMinimumSize(args.minWidth || win.getMinimumSize()[0], args.minHeight || win.getMinimumSize()[1])
}
if (args.maxWidth || args.maxHeight) {
win.setMaximumSize(args.maxWidth || win.getMaximumSize()[0], args.maxHeight || win.getMaximumSize()[1])
}
} }
event.returnValue = "ok"
}) })
ipcMain.on('setDockBadge', (event, arg) => { ipcMain.on('windowMinSize', (event, args) => {
const win = BrowserWindow.fromWebContents(event.sender);
if (win) {
win.setMinimumSize(args.width || win.getMinimumSize()[0], args.height || win.getMinimumSize()[1])
}
event.returnValue = "ok"
})
ipcMain.on('windowMaxSize', (event, args) => {
const win = BrowserWindow.fromWebContents(event.sender);
if (win) {
win.setMaximumSize(args.width || win.getMaximumSize()[0], args.height || win.getMaximumSize()[1])
}
event.returnValue = "ok"
})
ipcMain.on('windowCenter', (event, args) => {
const win = BrowserWindow.fromWebContents(event.sender);
if (win) {
win.center();
}
event.returnValue = "ok"
})
ipcMain.on('windowMax', (event) => {
const win = BrowserWindow.fromWebContents(event.sender);
if (win.isMaximized()) {
win.restore();
} else {
win.maximize();
}
event.returnValue = "ok"
})
ipcMain.on('sendForwardMain', (event, args) => {
if (mainWindow) {
mainWindow.webContents.send(args.channel, args.data)
}
event.returnValue = "ok"
})
ipcMain.on('setDockBadge', (event, args) => {
if(process.platform !== 'darwin'){ if(process.platform !== 'darwin'){
// Mac only // Mac only
return; return;
} }
if (runNum(arg) > 0) { if (runNum(args) > 0) {
app.dock.setBadge(String(arg)) app.dock.setBadge(String(args))
} else { } else {
app.dock.setBadge("") app.dock.setBadge("")
} }
event.returnValue = "ok"
}) })
ipcMain.on('saveSheet', (event, data, filename, opts) => { ipcMain.on('saveSheet', (event, data, filename, opts) => {
@ -194,4 +273,5 @@ ipcMain.on('saveSheet', (event, data, filename, opts) => {
}).then(o => { }).then(o => {
XLSX.writeFile(data, o.filePath, opts); XLSX.writeFile(data, o.filePath, opts);
}); });
event.returnValue = "ok"
}) })

View File

@ -1,6 +1,6 @@
{ {
"name": "DooTask", "name": "DooTask",
"version": "0.4.78", "version": "0.4.86",
"description": "DooTask is task management system.", "description": "DooTask is task management system.",
"main": "main.js", "main": "main.js",
"license": "MIT", "license": "MIT",
@ -35,8 +35,9 @@
"@electron-forge/maker-zip": "^6.0.0-beta.61", "@electron-forge/maker-zip": "^6.0.0-beta.61",
"dmg-license": "^1.0.10", "dmg-license": "^1.0.10",
"dotenv": "^10.0.0", "dotenv": "^10.0.0",
"electron": "^16.0.4", "electron": "^16.0.5",
"electron-builder": "^22.14.5" "electron-builder": "^22.14.5",
"electron-log": "^4.4.3"
}, },
"dependencies": { "dependencies": {
"electron-squirrel-startup": "^1.0.0", "electron-squirrel-startup": "^1.0.0",

View File

@ -1,6 +1,6 @@
{ {
"name": "DooTask", "name": "DooTask",
"version": "0.4.78", "version": "0.4.86",
"description": "DooTask is task management system.", "description": "DooTask is task management system.",
"scripts": { "scripts": {
"start": "./cmd dev", "start": "./cmd dev",
@ -36,6 +36,7 @@
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"css-loader": "^6.5.1", "css-loader": "^6.5.1",
"echarts": "^5.2.2", "echarts": "^5.2.2",
"electron": "^16.0.5",
"element-ui": "^2.15.6", "element-ui": "^2.15.6",
"file-loader": "^6.2.0", "file-loader": "^6.2.0",
"inquirer": "^8.2.0", "inquirer": "^8.2.0",

2
public/css/app.css vendored

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

2
public/js/app.js vendored

File diff suppressed because one or more lines are too long

View File

@ -52,7 +52,7 @@
/**! /**!
* @fileOverview Kickass library to create and place poppers near their reference elements. * @fileOverview Kickass library to create and place poppers near their reference elements.
* @version 1.15.0 * @version 1.16.1
* @license * @license
* Copyright (c) 2016 Federico Zivolo and contributors * Copyright (c) 2016 Federico Zivolo and contributors
* *

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
public/js/build/205.js vendored Normal file
View File

@ -0,0 +1 @@
"use strict";(self.webpackChunkDooTask=self.webpackChunkDooTask||[]).push([[205],{4058:(e,t,i)=>{i.d(t,{Z:()=>r});var n=i(1519),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,".component-only-office[data-v-cd66b0a0]{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0}.component-only-office .placeholder[data-v-cd66b0a0]{flex:1;height:100%;width:100%}.component-only-office .office-loading[data-v-cd66b0a0]{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0;z-index:2}",""]);const r=o},74205:(e,t,i)=>{i.r(t),i.d(t,{default:()=>f});var n=i(20629);function o(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function r(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}const l={name:"OnlyOffice",props:{id:{type:String,default:function(){return"office_"+Math.round(1e4*Math.random())}},value:{type:[Object,Array],default:function(){return{}}}},data:function(){return{loadIng:0,fileName:null,fileType:null,fileUrl:null,docEditor:null}},mounted:function(){},beforeDestroy:function(){null!==this.docEditor&&(this.docEditor.destroyEditor(),this.docEditor=null)},computed:function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?o(Object(i),!0).forEach((function(t){r(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):o(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({},(0,n.rn)(["userToken","userInfo"])),watch:{value:{handler:function(e){this.fileUrl="http://nginx/api/file/content/?id="+e.id+"&token="+this.userToken,this.fileType=this.getType(e.type),this.fileName=e.name},immediate:!0,deep:!0},fileUrl:{handler:function(e){var t=this;e&&(this.loadIng++,$A.loadScript(this.$store.state.method.apiUrl("../office/web-apps/apps/api/documents/api.js"),(function(e){t.loadIng--,null===e?t.loadFile():$A.modalAlert("组件加载失败!")})))},immediate:!0}},methods:{getType:function(e){switch(e){case"word":return"docx";case"excel":return"xlsx";case"ppt":return"pptx"}return""},loadFile:function(){var e=this;if(this.fileUrl){null!==this.docEditor&&(this.docEditor.destroyEditor(),this.docEditor=null);var t="zh";switch(this.getLanguage()){case"CN":case"TC":t="zh";break;default:t="en"}var i={document:{fileType:this.fileType,key:this.fileType+"-"+this.value.id,title:this.fileName+"."+this.fileType,url:this.fileUrl},editorConfig:{mode:"edit",lang:t,user:{id:this.userInfo.userid,name:this.userInfo.nickname},customization:{uiTheme:"theme-classic-light"},callbackUrl:"http://nginx/api/file/content/office?id="+this.value.id+"&token="+this.userToken}};this.$nextTick((function(){e.docEditor=new DocsAPI.DocEditor(e.id,i)}))}}}};var a=i(93379),c=i.n(a),s=i(4058),d={insert:"head",singleton:!1};c()(s.Z,d);s.Z.locals;const f=(0,i(51900).Z)(l,(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"component-only-office"},[i("div",{staticClass:"placeholder",attrs:{id:this.id}}),e._v(" "),e.loadIng>0?i("div",{staticClass:"office-loading"},[i("Loading")],1):e._e()])}),[],!1,null,"cd66b0a0",null).exports}}]);

2
public/js/build/210.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -257,7 +257,7 @@
/** @license /** @license
* *
* jsPDF - PDF Document creation from JavaScript * jsPDF - PDF Document creation from JavaScript
* Version 2.4.0 Built on 2021-09-14T10:30:30.230Z * Version 2.5.0 Built on 2021-12-21T09:44:51.866Z
* CommitID 00000000 * CommitID 00000000
* *
* Copyright (c) 2010-2021 James Hall <james@parall.ax>, https://github.com/MrRio/jsPDF * Copyright (c) 2010-2021 James Hall <james@parall.ax>, https://github.com/MrRio/jsPDF

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
public/js/build/320.js vendored Normal file

File diff suppressed because one or more lines are too long

2
public/js/build/340.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
/*! /*!
* TOAST UI Calendar * TOAST UI Calendar
* @version 1.13.0-1 | Wed Jun 16 2021 * @version 1.15.1 | Wed Dec 22 2021
* @author NHN FE Development Lab <dl_javascript@nhn.com> * @author NHN FE Development Lab <dl_javascript@nhn.com>
* @license MIT * @license MIT
*/ */
@ -84,6 +84,8 @@
/*! ../common/reqAnimFrame */ /*! ../common/reqAnimFrame */
/*! ../common/sanitizer */
/*! ../common/timezone */ /*! ../common/timezone */
/*! ../common/vlayout */ /*! ../common/vlayout */
@ -302,6 +304,10 @@
/*! ./weekdayInMonth */ /*! ./weekdayInMonth */
/*! @license DOMPurify 2.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.1/LICENSE */
/*! dompurify */
/*! handlebars-template-loader/runtime */ /*! handlebars-template-loader/runtime */
/*! handlebars/runtime */ /*! handlebars/runtime */
@ -424,6 +430,10 @@
!*** ./src/js/view/month/more.js ***! !*** ./src/js/view/month/more.js ***!
\***********************************/ \***********************************/
/*!************************************!*\
!*** ./src/js/common/sanitizer.js ***!
\************************************/
/*!************************************!*\ /*!************************************!*\
!*** ./src/js/factory/calendar.js ***! !*** ./src/js/factory/calendar.js ***!
\************************************/ \************************************/
@ -616,6 +626,10 @@
!*** ./src/js/view/template/month/month.hbs ***! !*** ./src/js/view/template/month/month.hbs ***!
\**********************************************/ \**********************************************/
/*!***********************************************!*\
!*** ./node_modules/dompurify/dist/purify.js ***!
\***********************************************/
/*!***********************************************!*\ /*!***********************************************!*\
!*** ./src/js/handler/daygrid/resizeGuide.js ***! !*** ./src/js/handler/daygrid/resizeGuide.js ***!
\***********************************************/ \***********************************************/

File diff suppressed because one or more lines are too long

2
public/js/build/357.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -257,7 +257,7 @@
/** @license /** @license
* *
* jsPDF - PDF Document creation from JavaScript * jsPDF - PDF Document creation from JavaScript
* Version 2.4.0 Built on 2021-09-14T10:30:30.230Z * Version 2.5.0 Built on 2021-12-21T09:44:51.866Z
* CommitID 00000000 * CommitID 00000000
* *
* Copyright (c) 2010-2021 James Hall <james@parall.ax>, https://github.com/MrRio/jsPDF * Copyright (c) 2010-2021 James Hall <james@parall.ax>, https://github.com/MrRio/jsPDF

1
public/js/build/371.js vendored Normal file

File diff suppressed because one or more lines are too long

2
public/js/build/388.js vendored Normal file

File diff suppressed because one or more lines are too long

1
public/js/build/418.js vendored Normal file
View File

@ -0,0 +1 @@
"use strict";(self.webpackChunkDooTask=self.webpackChunkDooTask||[]).push([[418],{35270:(e,t,a)=>{a.d(t,{Z:()=>i});var n=a(1519),s=a.n(n)()((function(e){return e[1]}));s.push([e.id,".page-404[data-v-1f590918]{background-color:#fff;color:#636b6f;font-weight:400;margin:0}.page-404[data-v-1f590918],.page-404 .full-height[data-v-1f590918]{height:100vh}.page-404 .flex-center[data-v-1f590918]{align-items:center;display:flex;justify-content:center}.page-404 .position-ref[data-v-1f590918]{position:relative}.page-404 .code[data-v-1f590918]{border-right:2px solid;font-size:26px;padding:0 15px;text-align:center}.page-404 .message[data-v-1f590918]{font-size:18px;padding:10px;text-align:center}",""]);const i=s},54418:(e,t,a)=>{a.r(t),a.d(t,{default:()=>o});var n=a(93379),s=a.n(n),i=a(35270),l={insert:"head",singleton:!1};s()(i.Z,l);i.Z.locals;const o=(0,a(51900).Z)({},(function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)}),[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"page-404"},[a("div",{staticClass:"flex-center position-ref full-height"},[a("div",{staticClass:"code"},[e._v("404")]),e._v(" "),a("div",{staticClass:"message"},[e._v("Not Found")])])])}],!1,null,"1f590918",null).exports}}]);

1
public/js/build/461.js vendored Normal file

File diff suppressed because one or more lines are too long

1
public/js/build/481.js vendored Normal file
View File

@ -0,0 +1 @@
"use strict";(self.webpackChunkDooTask=self.webpackChunkDooTask||[]).push([[481],{41339:(t,e,i)=>{i.d(e,{Z:()=>n});var a=i(1519),o=i.n(a)()((function(t){return t[1]}));o.push([t.id,".page-invite[data-v-10872f44]{align-items:center;display:flex;justify-content:center}.page-invite .invite-warp .invite-desc[data-v-10872f44]{max-height:300px;max-width:460px;overflow:auto}.page-invite .invite-warp .invite-footer[data-v-10872f44]{align-items:center;display:flex;justify-content:center;margin-top:24px}.page-invite .invite-warp .invite-footer>button[data-v-10872f44]{height:36px;min-width:120px}",""]);const n=o},49481:(t,e,i)=>{i.r(e),i.d(e,{default:()=>s});const a={data:function(){return{loadIng:0,joinLoad:0,already:!1,project:{}}},watch:{$route:{handler:function(t){this.code=t.query?t.query.code:"",this.getData()},immediate:!0}},methods:{getData:function(){var t=this;this.loadIng++,this.$store.dispatch("call",{url:"project/invite/info",data:{code:this.code}}).then((function(e){var i=e.data;t.loadIng--,t.already=i.already,t.project=i.project})).catch((function(){t.loadIng--,t.project={}}))},joinProject:function(){var t=this;this.joinLoad++,this.$store.dispatch("call",{url:"project/invite/join",data:{code:this.code}}).then((function(e){var i=e.data;t.joinLoad--,t.already=i.already,t.project=i.project,t.goProject()})).catch((function(e){var i=e.msg;t.joinLoad--,$A.modalError(i)}))},goProject:function(){var t=this;this.$nextTick((function(){t.goForward({path:"/manage/project/"+t.project.id})}))}}};var o=i(93379),n=i.n(o),c=i(41339),r={insert:"head",singleton:!1};n()(c.Z,r);c.Z.locals;const s=(0,i(51900).Z)(a,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"page-invite"},[i("PageTitle",{attrs:{title:t.$L("加入项目")}}),t._v(" "),t.loadIng>0?i("div",{staticClass:"invite-load"},[i("Loading")],1):i("div",{staticClass:"invite-warp"},[t.project.id>0?i("Card",[i("p",{attrs:{slot:"title"},slot:"title"},[t._v(t._s(t.project.name))]),t._v(" "),t.project.desc?i("div",{staticClass:"invite-desc"},[t._v(t._s(t.project.desc))]):i("div",[t._v(t._s(t.$L("暂无介绍")))]),t._v(" "),i("div",{staticClass:"invite-footer"},[t.already?i("Button",{attrs:{type:"success",icon:"ios-checkmark-circle-outline"},on:{click:t.goProject}},[t._v(t._s(t.$L("已加入")))]):i("Button",{attrs:{type:"primary",loading:t.joinLoad>0},on:{click:t.joinProject}},[t._v(t._s(t.$L("加入项目")))])],1)]):i("Card",[i("p",[t._v(t._s(t.$L("邀请地址不存在或已被删除!")))])])],1)],1)}),[],!1,null,"10872f44",null).exports}}]);

1
public/js/build/545.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
"use strict";(self.webpackChunkDooTask=self.webpackChunkDooTask||[]).push([[694],{31185:(e,t,i)=>{i.d(t,{Z:()=>r});var n=i(23645),o=i.n(n)()((function(e){return e[1]}));o.push([e.id,".component-only-office[data-v-cd66b0a0]{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0}.component-only-office .placeholder[data-v-cd66b0a0]{flex:1;height:100%;width:100%}.component-only-office .office-loading[data-v-cd66b0a0]{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0;z-index:2}",""]);const r=o},32694:(e,t,i)=>{i.r(t),i.d(t,{default:()=>f});var n=i(20629);function o(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function r(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}const l={name:"OnlyOffice",props:{id:{type:String,default:function(){return"office_"+Math.round(1e4*Math.random())}},value:{type:[Object,Array],default:function(){return{}}}},data:function(){return{loadIng:0,fileName:null,fileType:null,fileUrl:null,docEditor:null}},mounted:function(){},beforeDestroy:function(){null!==this.docEditor&&(this.docEditor.destroyEditor(),this.docEditor=null)},computed:function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?o(Object(i),!0).forEach((function(t){r(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):o(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({},(0,n.rn)(["userToken","userInfo"])),watch:{value:{handler:function(e){this.fileUrl="http://nginx/api/file/content/?id="+e.id+"&token="+this.userToken,this.fileType=this.getType(e.type),this.fileName=e.name},immediate:!0,deep:!0},fileUrl:{handler:function(e){var t=this;e&&(this.loadIng++,$A.loadScript(this.$store.state.method.apiUrl("../office/web-apps/apps/api/documents/api.js"),(function(e){t.loadIng--,null===e?t.loadFile():$A.modalAlert("组件加载失败!")})))},immediate:!0}},methods:{getType:function(e){switch(e){case"word":return"docx";case"excel":return"xlsx";case"ppt":return"pptx"}return""},loadFile:function(){var e=this;if(this.fileUrl){null!==this.docEditor&&(this.docEditor.destroyEditor(),this.docEditor=null);var t="zh";switch(this.getLanguage()){case"CN":case"TC":t="zh";break;default:t="en"}var i={document:{fileType:this.fileType,key:this.fileType+"-"+this.value.id,title:this.fileName+"."+this.fileType,url:this.fileUrl},editorConfig:{mode:"edit",lang:t,user:{id:this.userInfo.userid,name:this.userInfo.nickname},customization:{uiTheme:"theme-classic-light"},callbackUrl:"http://nginx/api/file/content/office?id="+this.value.id+"&token="+this.userToken}};this.$nextTick((function(){e.docEditor=new DocsAPI.DocEditor(e.id,i)}))}}}};var a=i(93379),c=i.n(a),s=i(31185),d={insert:"head",singleton:!1};c()(s.Z,d);s.Z.locals;const f=(0,i(51900).Z)(l,(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"component-only-office"},[i("div",{staticClass:"placeholder",attrs:{id:this.id}}),e._v(" "),e.loadIng>0?i("div",{staticClass:"office-loading"},[i("Loading")],1):e._e()])}),[],!1,null,"cd66b0a0",null).exports}}]);

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
"use strict";(self.webpackChunkDooTask=self.webpackChunkDooTask||[]).push([[774],{78932:(t,e,i)=>{i.d(e,{Z:()=>n});var a=i(23645),o=i.n(a)()((function(t){return t[1]}));o.push([t.id,".page-invite[data-v-10872f44]{align-items:center;display:flex;justify-content:center}.page-invite .invite-warp .invite-desc[data-v-10872f44]{max-height:300px;max-width:460px;overflow:auto}.page-invite .invite-warp .invite-footer[data-v-10872f44]{align-items:center;display:flex;justify-content:center;margin-top:24px}.page-invite .invite-warp .invite-footer>button[data-v-10872f44]{height:36px;min-width:120px}",""]);const n=o},25774:(t,e,i)=>{i.r(e),i.d(e,{default:()=>s});const a={data:function(){return{loadIng:0,joinLoad:0,already:!1,project:{}}},watch:{$route:{handler:function(t){this.code=t.query?t.query.code:"",this.getData()},immediate:!0}},methods:{getData:function(){var t=this;this.loadIng++,this.$store.dispatch("call",{url:"project/invite/info",data:{code:this.code}}).then((function(e){var i=e.data;t.loadIng--,t.already=i.already,t.project=i.project})).catch((function(){t.loadIng--,t.project={}}))},joinProject:function(){var t=this;this.joinLoad++,this.$store.dispatch("call",{url:"project/invite/join",data:{code:this.code}}).then((function(e){var i=e.data;t.joinLoad--,t.already=i.already,t.project=i.project,t.goProject()})).catch((function(e){var i=e.msg;t.joinLoad--,$A.modalError(i)}))},goProject:function(){var t=this;this.$nextTick((function(){t.goForward({path:"/manage/project/"+t.project.id})}))}}};var o=i(93379),n=i.n(o),c=i(78932),r={insert:"head",singleton:!1};n()(c.Z,r);c.Z.locals;const s=(0,i(51900).Z)(a,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"page-invite"},[i("PageTitle",{attrs:{title:t.$L("加入项目")}}),t._v(" "),t.loadIng>0?i("div",{staticClass:"invite-load"},[i("Loading")],1):i("div",{staticClass:"invite-warp"},[t.project.id>0?i("Card",[i("p",{attrs:{slot:"title"},slot:"title"},[t._v(t._s(t.project.name))]),t._v(" "),t.project.desc?i("div",{staticClass:"invite-desc"},[t._v(t._s(t.project.desc))]):i("div",[t._v(t._s(t.$L("暂无介绍")))]),t._v(" "),i("div",{staticClass:"invite-footer"},[t.already?i("Button",{attrs:{type:"success",icon:"ios-checkmark-circle-outline"},on:{click:t.goProject}},[t._v(t._s(t.$L("已加入")))]):i("Button",{attrs:{type:"primary",loading:t.joinLoad>0},on:{click:t.joinProject}},[t._v(t._s(t.$L("加入项目")))])],1)]):i("Card",[i("p",[t._v(t._s(t.$L("邀请地址不存在或已被删除!")))])])],1)],1)}),[],!1,null,"10872f44",null).exports}}]);

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
"use strict";(self.webpackChunkDooTask=self.webpackChunkDooTask||[]).push([[844],{88064:(e,t,a)=>{a.d(t,{Z:()=>i});var n=a(23645),s=a.n(n)()((function(e){return e[1]}));s.push([e.id,".page-404[data-v-1f590918]{background-color:#fff;color:#636b6f;font-weight:400;margin:0}.page-404[data-v-1f590918],.page-404 .full-height[data-v-1f590918]{height:100vh}.page-404 .flex-center[data-v-1f590918]{align-items:center;display:flex;justify-content:center}.page-404 .position-ref[data-v-1f590918]{position:relative}.page-404 .code[data-v-1f590918]{border-right:2px solid;font-size:26px;padding:0 15px;text-align:center}.page-404 .message[data-v-1f590918]{font-size:18px;padding:10px;text-align:center}",""]);const i=s},53844:(e,t,a)=>{a.r(t),a.d(t,{default:()=>o});var n=a(93379),s=a.n(n),i=a(88064),l={insert:"head",singleton:!1};s()(i.Z,l);i.Z.locals;const o=(0,a(51900).Z)({},(function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)}),[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"page-404"},[a("div",{staticClass:"flex-center position-ref full-height"},[a("div",{staticClass:"code"},[e._v("404")]),e._v(" "),a("div",{staticClass:"message"},[e._v("Not Found")])])])}],!1,null,"1f590918",null).exports}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -173,10 +173,10 @@ export default {
}, },
electronEvents() { electronEvents() {
if (!this.isElectron) { if (!this.$Electron) {
return; return;
} }
const {ipcRenderer} = this.$electron; const {ipcRenderer} = this.$Electron;
ipcRenderer.send('inheritClose'); ipcRenderer.send('inheritClose');
ipcRenderer.on('windowClose', () => { ipcRenderer.on('windowClose', () => {
if (this.$Modal.removeLast()) { if (this.$Modal.removeLast()) {
@ -188,6 +188,13 @@ export default {
} }
ipcRenderer.send('windowHidden'); ipcRenderer.send('windowHidden');
}) })
ipcRenderer.on('dispatch', (event, args) => {
if (!this.$store.state.method.isJson(args)) {
return;
}
let {action, data} = args;
this.$store.dispatch(action, data);
})
} }
} }
} }

View File

@ -46,12 +46,6 @@ Vue.component('EDropdown', Dropdown);
Vue.component('EDropdownMenu', DropdownMenu); Vue.component('EDropdownMenu', DropdownMenu);
Vue.component('EDropdownItem', DropdownItem); Vue.component('EDropdownItem', DropdownItem);
Vue.prototype.isElectron = false;
if (!!__IS_ELECTRON) {
Vue.prototype.isElectron = true;
Vue.prototype.$electron = require('electron')
}
const originalPush = VueRouter.prototype.push const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) { VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err) return originalPush.call(this, location).catch(err => err)
@ -96,6 +90,10 @@ Vue.prototype.goBack = function (number) {
}; };
Vue.prototype.$A = $A; 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; Vue.config.productionTip = false;
const app = new Vue({ const app = new Vue({
@ -115,3 +113,15 @@ $A.Notice = app.$Notice;
$A.Modal = app.$Modal; $A.Modal = app.$Modal;
$A.store = app.$store; $A.store = app.$store;
$A.L = app.$L; $A.L = app.$L;
$A.Electron = app.$Electron;
$A.isMainElectron = app.$isMainElectron;
$A.isSubElectron = app.$isSubElectron;
$A.execMainDispatch = (action, data) => {
if ($A.isSubElectron) {
$A.Electron.ipcRenderer.send('sendForwardMain', {
channel: 'dispatch',
data: {action, data},
});
}
};

View File

@ -1,6 +1,6 @@
<template> <template>
<div v-if="repoStatus && !$store.state.windowMax768" class="common-app-down"> <div v-if="repoStatus && !$store.state.windowMax768" class="common-app-down">
<div v-if="isElectron" class="common-app-down-link" @click="openExternal(repoData.html_url)"> <div v-if="$Electron" class="common-app-down-link" @click="openExternal(repoData.html_url)">
<Icon type="md-download"/> {{$L(repoTitle)}} <Icon type="md-download"/> {{$L(repoTitle)}}
</div> </div>
<a v-else class="common-app-down-link" :href="repoData.html_url" target="_blank"> <a v-else class="common-app-down-link" :href="repoData.html_url" target="_blank">
@ -41,7 +41,7 @@ export default {
this.repoStatus = 0; this.repoStatus = 0;
return; return;
} }
if (!this.isElectron) { if (!this.$Electron) {
// //
this.repoStatus = 1; this.repoStatus = 1;
return; return;
@ -183,7 +183,7 @@ export default {
openExternal(url) { openExternal(url) {
try { try {
this.$electron.shell.openExternal(url); this.$Electron.shell.openExternal(url);
} catch (e) { } catch (e) {
window.location.href = url; window.location.href = url;
} }

View File

@ -272,8 +272,8 @@ export default {
bookType: bookType || "xlsx" bookType: bookType || "xlsx"
} }
const filename = bookName + "." + (bookType == 'xlml' ? 'xls' : bookType); const filename = bookName + "." + (bookType == 'xlml' ? 'xls' : bookType);
if (this.isElectron) { if (this.$Electron) {
this.$electron.ipcRenderer.send('saveSheet', data, filename, opts); this.$Electron.ipcRenderer.send('saveSheet', data, filename, opts);
} else { } else {
XLSX.writeFile(data, filename, opts); XLSX.writeFile(data, filename, opts);
} }

View File

@ -178,14 +178,12 @@ export default {
mounted() { mounted() {
this.getDemoAccount(); this.getDemoAccount();
// //
console.log(this.$route);
if (!this.isElectron && this.cacheServerUrl) { if (!this.isElectron && this.cacheServerUrl) {
this.onServerUrlClear(); this.onServerUrlClear();
} }
this.$route.query.type == "reg" this.$route.query.type == "reg"
? (this.loginType = "reg") ? (this.loginType = "reg")
: (this.loginType = "login"); : (this.loginType = "login");
console.log(this.$route);
}, },
deactivated() { deactivated() {
this.loginJump = false; this.loginJump = false;

View File

@ -145,7 +145,9 @@
}" }"
@on-visible-change="taskVisibleChange" @on-visible-change="taskVisibleChange"
footer-hide> footer-hide>
<TaskDetail :open-task="taskData"/> <div class="page-manage-task-modal" :style="taskStyle">
<TaskDetail :task-id="taskId" :open-task="taskData"/>
</div>
</Modal> </Modal>
<!--查看所有团队--> <!--查看所有团队-->
@ -225,6 +227,7 @@ export default {
openMenu: {}, openMenu: {},
visibleMenu: false, visibleMenu: false,
show768Menu: false, show768Menu: false,
innerHeight: window.innerHeight,
allUserShow: false, allUserShow: false,
allProjectShow: false, allProjectShow: false,
@ -258,9 +261,10 @@ export default {
}); });
// //
document.addEventListener('keydown', this.shortcutEvent); document.addEventListener('keydown', this.shortcutEvent);
window.addEventListener('resize', this.innerHeightListener);
// //
if (this.isElectron) { if (this.$Electron) {
this.$electron.ipcRenderer.send('setDockBadge', 0); this.$Electron.ipcRenderer.send('setDockBadge', 0);
} }
}, },
@ -271,6 +275,7 @@ export default {
} }
// //
document.removeEventListener('keydown', this.shortcutEvent); document.removeEventListener('keydown', this.shortcutEvent);
window.removeEventListener('resize', this.innerHeightListener);
}, },
deactivated() { deactivated() {
@ -341,6 +346,13 @@ export default {
return data.filter(({name}) => name.toLowerCase().indexOf(projectKeyValue.toLowerCase()) > -1); return data.filter(({name}) => name.toLowerCase().indexOf(projectKeyValue.toLowerCase()) > -1);
} }
return data; return data;
},
taskStyle() {
const {innerHeight} = this;
return {
maxHeight: (innerHeight - (innerHeight > 900 ? 200 : 70) - 20) + 'px'
}
} }
}, },
@ -361,14 +373,14 @@ export default {
}, },
msgAllUnread() { msgAllUnread() {
if (this.isElectron) { if (this.$Electron) {
this.$electron.ipcRenderer.send('setDockBadge', this.msgAllUnread + this.dashboardTotal); this.$Electron.ipcRenderer.send('setDockBadge', this.msgAllUnread + this.dashboardTotal);
} }
}, },
dashboardTotal() { dashboardTotal() {
if (this.isElectron) { if (this.$Electron) {
this.$electron.ipcRenderer.send('setDockBadge', this.msgAllUnread + this.dashboardTotal); this.$Electron.ipcRenderer.send('setDockBadge', this.msgAllUnread + this.dashboardTotal);
} }
}, },
@ -450,6 +462,10 @@ export default {
}; };
}, },
innerHeightListener() {
this.innerHeight = window.innerHeight;
},
chackPass() { chackPass() {
if (this.userInfo.changepass === 1) { if (this.userInfo.changepass === 1) {
this.goForward({path: '/manage/setting/password'}); this.goForward({path: '/manage/setting/password'});

View File

@ -24,7 +24,7 @@
<ScrollerY <ScrollerY
ref="scroller" ref="scroller"
class="dialog-scroller overlay-y" class="dialog-scroller overlay-y"
:auto-bottom="autoBottom && !inputFocus" :auto-bottom="autoBottom"
@on-scroll="chatScroll" @on-scroll="chatScroll"
static> static>
<div ref="manageList" class="dialog-list"> <div ref="manageList" class="dialog-list">
@ -347,12 +347,10 @@ export default {
}, },
onEventFocus(e) { onEventFocus(e) {
this.inputFocus = true;
this.$emit("on-focus", e) this.$emit("on-focus", e)
}, },
onEventblur(e) { onEventblur(e) {
this.inputFocus = false;
this.$emit("on-blur", e) this.$emit("on-blur", e)
}, },

View File

@ -867,16 +867,10 @@ export default {
} }
this.$set(this.columnLoad, column.id, true); this.$set(this.columnLoad, column.id, true);
// //
this.$store.dispatch("call", { this.$store.dispatch("removeColumn", column.id).then(({data, msg}) => {
url: 'project/column/remove',
data: {
column_id: column.id,
},
}).then(({data, msg}) => {
$A.messageSuccess(msg); $A.messageSuccess(msg);
this.$set(this.columnLoad, column.id, false); this.$set(this.columnLoad, column.id, false);
this.$Modal.remove(); this.$Modal.remove();
this.$store.dispatch("forgetColumn", data.id);
}).catch(({msg}) => { }).catch(({msg}) => {
$A.modalError(msg, 301); $A.modalError(msg, 301);
this.$set(this.columnLoad, column.id, false); this.$set(this.columnLoad, column.id, false);

View File

@ -37,7 +37,7 @@
<Button :class="{advanced: advanced}" @click="advanced=!advanced">{{$L('高级选项')}}</Button> <Button :class="{advanced: advanced}" @click="advanced=!advanced">{{$L('高级选项')}}</Button>
<ul class="advanced-priority"> <ul class="advanced-priority">
<li v-for="(item, key) in taskPriority" :key="key"> <li v-for="(item, key) in taskPriority" :key="key">
<ETooltip :content="item.name + ' (' + item.days + $L('天') + ')'"> <ETooltip :content="taskPriorityContent(item)">
<i <i
class="taskfont" class="taskfont"
:style="{color:item.color}" :style="{color:item.color}"
@ -369,10 +369,23 @@ export default {
} }
}, },
taskPriorityContent(item) {
let days = $A.runNum(item.days);
if (days <= 0) {
return item.name + ' (' + this.$L('无时间限制') + ')';
}
return item.name + ' (' + days + this.$L('天') + ')';
},
choosePriority(item) { choosePriority(item) {
let start = new Date(); let start = new Date();
let end = new Date(new Date().setDate(start.getDate() + $A.runNum(item.days))); let days = $A.runNum(item.days);
this.$set(this.addData, 'times', $A.date2string([start, end])) if (days > 0) {
let end = new Date(new Date().setDate(start.getDate() + days));
this.$set(this.addData, 'times', $A.date2string([start, end]))
} else {
this.$set(this.addData, 'times', [])
}
this.$set(this.addData, 'p_level', item.priority) this.$set(this.addData, 'p_level', item.priority)
this.$set(this.addData, 'p_name', item.name) this.$set(this.addData, 'p_name', item.name)
this.$set(this.addData, 'p_color', item.color) this.$set(this.addData, 'p_color', item.color)

View File

@ -100,47 +100,52 @@
<p v-if="columnName"><span>{{columnName}}</span></p> <p v-if="columnName"><span>{{columnName}}</span></p>
<p v-if="taskDetail.id"><span>{{taskDetail.id}}</span></p> <p v-if="taskDetail.id"><span>{{taskDetail.id}}</span></p>
</div> </div>
<Poptip <div class="function">
v-if="getOwner.length === 0" <Poptip
confirm v-if="getOwner.length === 0"
ref="receive" confirm
class="pick" ref="receive"
:title="$L('你确认领取任务吗?')" class="pick"
placement="bottom" :title="$L('你确认领取任务吗?')"
@on-ok="onOwner(true)" placement="bottom"
transfer> @on-ok="onOwner(true)"
<Button type="primary">{{$L('我要领取任务')}}</Button> transfer>
</Poptip> <Button type="primary">{{$L('我要领取任务')}}</Button>
<EDropdown </Poptip>
trigger="click" <ETooltip v-if="$Electron" :content="$L('新窗口打开')">
placement="bottom" <i class="taskfont open" @click="openNewWin">&#xe776;</i>
@command="dropTask"> </ETooltip>
<Icon class="menu" type="ios-more"/> <EDropdown
<EDropdownMenu slot="dropdown"> trigger="click"
<EDropdownItem v-if="taskDetail.complete_at" command="uncomplete"> placement="bottom"
<div class="item red"> @command="dropTask">
<Icon type="md-checkmark-circle-outline" />{{$L('标记未完成')}} <Icon class="menu" type="ios-more"/>
</div> <EDropdownMenu slot="dropdown">
</EDropdownItem> <EDropdownItem v-if="taskDetail.complete_at" command="uncomplete">
<EDropdownItem v-else command="complete"> <div class="item red">
<div class="item"> <Icon type="md-checkmark-circle-outline" />{{$L('标记未完成')}}
<Icon type="md-radio-button-off" />{{$L('完成')}} </div>
</div> </EDropdownItem>
</EDropdownItem> <EDropdownItem v-else command="complete">
<EDropdownItem command="archived"> <div class="item">
<div class="item"> <Icon type="md-radio-button-off" />{{$L('完成')}}
<Icon type="ios-filing" />{{$L('归档')}} </div>
</div> </EDropdownItem>
</EDropdownItem> <EDropdownItem command="archived">
<EDropdownItem command="remove"> <div class="item">
<div class="item"> <Icon type="ios-filing" />{{$L('归档')}}
<Icon type="md-trash" />{{$L('删除')}} </div>
</div> </EDropdownItem>
</EDropdownItem> <EDropdownItem command="remove">
</EDropdownMenu> <div class="item">
</EDropdown> <Icon type="md-trash" />{{$L('删除')}}
</div>
</EDropdownItem>
</EDropdownMenu>
</EDropdown>
</div>
</div> </div>
<div class="scroller overlay-y" :style="scrollerStyle"> <div class="scroller overlay-y">
<div class="title"> <div class="title">
<Input <Input
v-model="taskDetail.name" v-model="taskDetail.name"
@ -310,7 +315,7 @@
<i class="taskfont">&#xe6f0;</i>{{$L('子任务')}} <i class="taskfont">&#xe6f0;</i>{{$L('子任务')}}
</div> </div>
<ul class="item-content subtask"> <ul class="item-content subtask">
<TaskDetail v-for="(task, key) in subList" :key="key" :open-task="task"/> <TaskDetail v-for="(task, key) in subList" :key="key" :task-id="task.id" :open-task="task"/>
</ul> </ul>
<ul :class="['item-content', subList.length === 0 ? 'nosub' : '']"> <ul :class="['item-content', subList.length === 0 ? 'nosub' : '']">
<li> <li>
@ -412,6 +417,10 @@ export default {
name: "TaskDetail", name: "TaskDetail",
components: {ProjectLog, DialogWrapper, TaskUpload, UserInput, TaskPriority, TEditor}, components: {ProjectLog, DialogWrapper, TaskUpload, UserInput, TaskPriority, TEditor},
props: { props: {
taskId: {
type: Number,
default: 0
},
openTask: { openTask: {
type: Object, type: Object,
default: () => { default: () => {
@ -509,7 +518,6 @@ export default {
'userId', 'userId',
'projects', 'projects',
'columns', 'columns',
'taskId',
'taskSubs', 'taskSubs',
'taskContents', 'taskContents',
'taskFiles', 'taskFiles',
@ -572,19 +580,6 @@ export default {
return this.taskDetail.dialog_id > 0 && !this.$store.state.windowMax768; 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() { dialogStyle() {
const {innerHeight, hasOpenDialog} = this; const {innerHeight, hasOpenDialog} = this;
if (!innerHeight) { if (!innerHeight) {
@ -1114,6 +1109,10 @@ export default {
}).then(({data}) => { }).then(({data}) => {
this.$store.dispatch("saveTask", data); this.$store.dispatch("saveTask", data);
this.$store.dispatch("getDialogOne", data.dialog_id); this.$store.dispatch("getDialogOne", data.dialog_id);
if ($A.isSubElectron) {
this.resizeDialog();
return;
}
this.$nextTick(() => { this.$nextTick(() => {
if (this.$store.state.windowMax768) { if (this.$store.state.windowMax768) {
this.goForward({path: '/manage/messenger', query: {sendmsg: this.msgText}}); this.goForward({path: '/manage/messenger', query: {sendmsg: this.msgText}});
@ -1144,6 +1143,10 @@ export default {
this.sendLoad = false; this.sendLoad = false;
this.$store.dispatch("saveTask", data); this.$store.dispatch("saveTask", data);
this.$store.dispatch("getDialogOne", data.dialog_id); this.$store.dispatch("getDialogOne", data.dialog_id);
if ($A.isSubElectron) {
this.resizeDialog();
return;
}
this.$nextTick(() => { this.$nextTick(() => {
this.goForward({path: '/manage/messenger', query: {sendmsg: this.msgText}}); this.goForward({path: '/manage/messenger', query: {sendmsg: this.msgText}});
this.$store.state.method.setStorage("messenger::dialogId", data.dialog_id) this.$store.state.method.setStorage("messenger::dialogId", data.dialog_id)
@ -1169,6 +1172,50 @@ export default {
$A.modalError(msg); $A.modalError(msg);
this.$store.dispatch("getTaskFiles", this.taskDetail.id) this.$store.dispatch("getTaskFiles", this.taskDetail.id)
}); });
},
openNewWin() {
let config = {
parent: null,
width: Math.min(window.screen.availWidth, this.$el.clientWidth + 72),
height: Math.min(window.screen.availHeight, this.$el.clientHeight + 72),
minWidth: 600,
minHeight: 450,
};
if (this.hasOpenDialog) {
config.minWidth = 800;
config.minHeight = 600;
}
this.$Electron.ipcRenderer.send('windowRouter', {
name: 'task-' + this.taskDetail.id,
path: "/single/task/" + this.taskDetail.id,
force: false,
config
});
this.$store.dispatch('openTask', 0);
},
resizeDialog() {
this.$Electron.ipcRenderer.sendSync('windowSize', {
width: Math.max(1100, window.innerWidth),
height: Math.max(720, window.innerHeight),
minWidth: 800,
minHeight: 600,
autoZoom: true,
});
if (this.msgText) {
let num = 0;
let interval = setInterval(() => {
num++;
if (this.$refs.dialog || num > 20) {
clearInterval(interval);
if (this.$refs.dialog) {
this.$refs.dialog.sendMsg(this.msgText);
this.msgText = "";
}
}
}, 100);
}
} }
} }
} }

View File

@ -666,7 +666,7 @@ export default {
this.searchKey = ''; this.searchKey = '';
this.pid = item.id; this.pid = item.id;
} else { } else {
if (this.isElectron) { if (this.$Electron) {
this.openSingle(item); this.openSingle(item);
} else { } else {
this.editInfo = item; this.editInfo = item;
@ -676,7 +676,7 @@ export default {
}, },
openSingle(item) { openSingle(item) {
this.$electron.ipcRenderer.send('windowRouter', { this.$Electron.ipcRenderer.send('windowRouter', {
name: 'file-' + item.id, name: 'file-' + item.id,
path: "/single/file/" + item.id, path: "/single/file/" + item.id,
force: false, // force: false, //

View File

@ -59,7 +59,7 @@ export default {
$A.modalError({ $A.modalError({
content: msg, content: msg,
onOk: () => { onOk: () => {
if (this.isElectron) { if (this.$Electron) {
window.close(); window.close();
} }
} }

View File

@ -0,0 +1,88 @@
<template>
<div class="electron-task">
<PageTitle :title="taskInfo.name"/>
<Loading v-if="loadIng > 0"/>
<TaskDetail v-else :task-id="taskInfo.id" :open-task="taskInfo"/>
</div>
</template>
<style lang="scss" scoped>
.electron-task {
height: 100%;
display: flex;
flex-direction: column;
overflow: auto;
.task-detail {
flex: 1;
margin: 0;
padding: 18px 22px;
border-radius: 0;
}
}
</style>
<style lang="scss">
.electron-task {
.task-detail {
.task-info {
.head {
.function {
margin-right: 0;
.open {
display: none;
}
}
}
}
}
}
</style>
<script>
import TaskDetail from "../manage/components/TaskDetail";
export default {
components: {TaskDetail},
data() {
return {
loadIng: 0,
taskInfo: {},
}
},
mounted() {
//
},
watch: {
'$route': {
handler() {
this.getInfo();
},
immediate: true
},
},
methods: {
getInfo() {
let task_id = $A.runNum(this.$route.params.id);
if (task_id <= 0) {
return;
}
this.loadIng++;
this.$store.dispatch("getTaskOne", task_id).then(({data}) => {
this.loadIng--;
this.taskInfo = data;
this.$store.dispatch("getTaskContent", task_id);
this.$store.dispatch("getTaskFiles", task_id);
this.$store.dispatch("getTasks", {parent_id: task_id});
}).catch(({msg}) => {
this.loadIng--;
$A.modalError({
content: msg,
onOk: () => {
if (this.$Electron) {
window.close();
}
}
});
});
}
}
}
</script>

View File

@ -80,6 +80,11 @@ export default [
path: '/single/file/:id', path: '/single/file/:id',
component: () => import('./pages/single/file.vue'), component: () => import('./pages/single/file.vue'),
}, },
{
name: 'single-task',
path: '/single/task/:id',
component: () => import('./pages/single/task.vue'),
},
{ {
name: 'login', name: 'login',
path: '/login', path: '/login',

View File

@ -139,6 +139,8 @@ export default {
* @param data|{key, project_id} * @param data|{key, project_id}
*/ */
toggleTablePanel({state}, data) { toggleTablePanel({state}, data) {
$A.execMainDispatch("toggleTablePanel", data)
//
let key = data; let key = data;
let project_id = state.projectId; let project_id = state.projectId;
if (state.method.isJson(data)) { if (state.method.isJson(data)) {
@ -295,6 +297,8 @@ export default {
* @param data * @param data
*/ */
saveUserBasic({state}, data) { saveUserBasic({state}, data) {
$A.execMainDispatch("saveUserBasic", data)
//
let index = state.cacheUserBasic.findIndex(({userid}) => userid == data.userid); let index = state.cacheUserBasic.findIndex(({userid}) => userid == data.userid);
if (index > -1) { if (index > -1) {
data = Object.assign(state.cacheUserBasic[index], data) data = Object.assign(state.cacheUserBasic[index], data)
@ -414,6 +418,8 @@ export default {
* @param data * @param data
*/ */
saveFile({state, dispatch}, data) { saveFile({state, dispatch}, data) {
$A.execMainDispatch("saveFile", data)
//
if (state.method.isArray(data)) { if (state.method.isArray(data)) {
data.forEach((file) => { data.forEach((file) => {
dispatch("saveFile", file); dispatch("saveFile", file);
@ -435,6 +441,8 @@ export default {
* @param file_id * @param file_id
*/ */
forgetFile({state, dispatch}, file_id) { forgetFile({state, dispatch}, file_id) {
$A.execMainDispatch("forgetFile", file_id)
//
state.files = state.files.filter((file) => file.id != file_id); state.files = state.files.filter((file) => file.id != file_id);
state.files.forEach((file) => { state.files.forEach((file) => {
if (file.pid == file_id) { if (file.pid == file_id) {
@ -504,6 +512,8 @@ export default {
* @param data * @param data
*/ */
saveProject({state, dispatch}, data) { saveProject({state, dispatch}, data) {
$A.execMainDispatch("saveProject", data)
//
if (state.method.isArray(data)) { if (state.method.isArray(data)) {
data.forEach((project) => { data.forEach((project) => {
dispatch("saveProject", project) dispatch("saveProject", project)
@ -531,6 +541,8 @@ export default {
* @param project_id * @param project_id
*/ */
forgetProject({state}, project_id) { forgetProject({state}, project_id) {
$A.execMainDispatch("forgetProject", project_id)
//
let index = state.projects.findIndex(({id}) => id == project_id); let index = state.projects.findIndex(({id}) => id == project_id);
if (index > -1) { if (index > -1) {
state.projects.splice(index, 1); state.projects.splice(index, 1);
@ -562,7 +574,7 @@ export default {
reject({msg: 'Parameter error'}); reject({msg: 'Parameter error'});
return; return;
} }
if (state.cacheProjects.length > 0) { if (state.projects.length === 0 && state.cacheProjects.length > 0) {
state.projects = state.cacheProjects; state.projects = state.cacheProjects;
} }
dispatch("call", { dispatch("call", {
@ -705,6 +717,8 @@ export default {
* @param data * @param data
*/ */
saveColumn({state, dispatch}, data) { saveColumn({state, dispatch}, data) {
$A.execMainDispatch("saveColumn", data)
//
if (state.method.isArray(data)) { if (state.method.isArray(data)) {
data.forEach((column) => { data.forEach((column) => {
dispatch("saveColumn", column) dispatch("saveColumn", column)
@ -729,6 +743,8 @@ export default {
* @param column_id * @param column_id
*/ */
forgetColumn({state, dispatch}, column_id) { forgetColumn({state, dispatch}, column_id) {
$A.execMainDispatch("forgetColumn", column_id)
//
let index = state.columns.findIndex(({id}) => id == column_id); let index = state.columns.findIndex(({id}) => id == column_id);
if (index > -1) { if (index > -1) {
dispatch('getProjectOne', state.columns[index].project_id) dispatch('getProjectOne', state.columns[index].project_id)
@ -753,7 +769,7 @@ export default {
reject({msg: 'Parameter error'}) reject({msg: 'Parameter error'})
return; return;
} }
if (state.cacheColumns.length > 0) { if (state.columns.length === 0 && state.cacheColumns.length > 0) {
state.columns = state.cacheColumns; state.columns = state.cacheColumns;
} }
state.projectLoad++; state.projectLoad++;
@ -829,6 +845,8 @@ export default {
* @param data * @param data
*/ */
saveTask({state, dispatch}, data) { saveTask({state, dispatch}, data) {
$A.execMainDispatch("saveTask", data)
//
if (state.method.isArray(data)) { if (state.method.isArray(data)) {
data.forEach((task) => { data.forEach((task) => {
dispatch("saveTask", task) dispatch("saveTask", task)
@ -867,6 +885,8 @@ export default {
* @param task_id * @param task_id
*/ */
forgetTask({state, dispatch}, task_id) { forgetTask({state, dispatch}, task_id) {
$A.execMainDispatch("forgetTask", task_id)
//
let index = state.tasks.findIndex(({id}) => id == task_id); let index = state.tasks.findIndex(({id}) => id == task_id);
let key = 'tasks'; let key = 'tasks';
if (index === -1) { if (index === -1) {
@ -898,6 +918,8 @@ export default {
* @param dialog_id * @param dialog_id
*/ */
increaseTaskMsgNum({state}, dialog_id) { increaseTaskMsgNum({state}, dialog_id) {
$A.execMainDispatch("increaseTaskMsgNum", dialog_id)
//
const task = state.tasks.find((task) => task.dialog_id === dialog_id); const task = state.tasks.find((task) => task.dialog_id === dialog_id);
if (task) task.msg_num++; if (task) task.msg_num++;
}, },
@ -913,7 +935,7 @@ export default {
state.tasks = []; state.tasks = [];
return; return;
} }
if (state.cacheTasks.length > 0) { if (state.tasks.length == 0 && state.cacheTasks.length > 0) {
state.tasks = state.cacheTasks; state.tasks = state.cacheTasks;
} }
if (data.project_id) { if (data.project_id) {
@ -1324,6 +1346,8 @@ export default {
* @param data * @param data
*/ */
saveDialog({state, dispatch}, data) { saveDialog({state, dispatch}, data) {
$A.execMainDispatch("saveDialog", data)
//
if (state.method.isArray(data)) { if (state.method.isArray(data)) {
data.forEach((dialog) => { data.forEach((dialog) => {
dispatch("saveDialog", dialog) dispatch("saveDialog", dialog)
@ -1348,6 +1372,8 @@ export default {
* @param data * @param data
*/ */
updateDialogLastMsg({state, dispatch}, data) { updateDialogLastMsg({state, dispatch}, data) {
$A.execMainDispatch("updateDialogLastMsg", data)
//
let dialog = state.dialogs.find(({id}) => id == data.dialog_id); let dialog = state.dialogs.find(({id}) => id == data.dialog_id);
if (dialog) { if (dialog) {
dispatch("saveDialog", { dispatch("saveDialog", {
@ -1442,6 +1468,8 @@ export default {
* @param dialog_id * @param dialog_id
*/ */
moveDialogTop({state}, dialog_id) { moveDialogTop({state}, dialog_id) {
$A.execMainDispatch("moveDialogTop", dialog_id)
//
const index = state.dialogs.findIndex(({id}) => id == dialog_id); const index = state.dialogs.findIndex(({id}) => id == dialog_id);
if (index > -1) { if (index > -1) {
const tmp = state.method.cloneJSON(state.dialogs[index]); const tmp = state.method.cloneJSON(state.dialogs[index]);
@ -1456,6 +1484,8 @@ export default {
* @param dialog_id * @param dialog_id
*/ */
forgetDialog({state}, dialog_id) { forgetDialog({state}, dialog_id) {
$A.execMainDispatch("forgetDialog", dialog_id)
//
let index = state.dialogs.findIndex(({id}) => id == dialog_id); let index = state.dialogs.findIndex(({id}) => id == dialog_id);
if (index > -1) { if (index > -1) {
state.dialogs.splice(index, 1); state.dialogs.splice(index, 1);
@ -1479,6 +1509,8 @@ export default {
* @param data * @param data
*/ */
saveDialogMsg({state, dispatch}, data) { saveDialogMsg({state, dispatch}, data) {
$A.execMainDispatch("saveDialogMsg", data)
//
if (state.method.isArray(data)) { if (state.method.isArray(data)) {
data.forEach((msg) => { data.forEach((msg) => {
dispatch("saveDialogMsg", msg) dispatch("saveDialogMsg", msg)

View File

@ -1,7 +1,9 @@
.task-detail { .task-detail {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin: 0 -10px 30px; margin: 0 -32px 12px -10px;
padding: 0 22px 12px 0;
overflow: auto;
.task-info { .task-info {
flex: 1; flex: 1;
display: flex; display: flex;
@ -10,7 +12,7 @@
.head { .head {
display: flex; display: flex;
align-items: center; align-items: center;
height: 40px; height: 42px;
padding-bottom: 10px; padding-bottom: 10px;
color: #888888; color: #888888;
position: relative; position: relative;
@ -60,14 +62,25 @@
} }
} }
} }
.pick { .function {
margin-left: 16px; display: flex;
margin-right: -16px; align-items: center;
}
.menu {
font-size: 22px;
margin: 0 32px; margin: 0 32px;
cursor: pointer; .pick {
margin-left: 12px;
margin-right: 10px;
}
.open {
margin-top: -2px;
margin-left: 12px;
font-size: 22px;
cursor: pointer;
}
.menu {
margin-left: 12px;
font-size: 22px;
cursor: pointer;
}
} }
} }
.scroller { .scroller {
@ -365,7 +378,7 @@
} }
} }
.task-dialog { .task-dialog {
flex: 1; flex-shrink: 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-top: 22px; margin-top: 22px;
@ -424,7 +437,7 @@
.no-input { .no-input {
display: flex; display: flex;
align-items: center; align-items: center;
margin: 32px 0 0 36px; margin: 22px 0 0 36px;
background-color: #F4F5F7; background-color: #F4F5F7;
padding: 10px 12px; padding: 10px 12px;
border-radius: 10px; border-radius: 10px;
@ -481,11 +494,8 @@
.task-info { .task-info {
overflow: auto; overflow: auto;
.head { .head {
.menu { .function {
margin: 0 2px; margin-right: 2px;
}
.pick {
margin-right: 12px;
} }
} }
} }

View File

@ -271,6 +271,11 @@
} }
} }
.page-manage-task-modal {
display: flex;
flex-direction: column;
}
.page-manage-add-task-button-group { .page-manage-add-task-button-group {
margin-left: 8px !important; margin-left: 8px !important;
.ivu-dropdown { .ivu-dropdown {