diff --git a/app/Http/Controllers/Api/FileController.php b/app/Http/Controllers/Api/FileController.php index 8fb628def..166731f23 100755 --- a/app/Http/Controllers/Api/FileController.php +++ b/app/Http/Controllers/Api/FileController.php @@ -623,6 +623,8 @@ public function content__upload() 'asp', 'properties', 'gitignore', 'log', 'bas', 'prg', 'python', 'ftl', 'aspx' => "code", 'mp3', 'wav', 'mp4', 'flv', 'avi', 'mov', 'wmv', 'mkv', '3gp', 'rm' => "media", + 'xmind' => "xmind", + 'rp' => "axure", default => "", }; $file = File::createInstance([ diff --git a/app/Http/Controllers/Api/ProjectController.php b/app/Http/Controllers/Api/ProjectController.php index ef50befa1..8070c53e3 100755 --- a/app/Http/Controllers/Api/ProjectController.php +++ b/app/Http/Controllers/Api/ProjectController.php @@ -1328,72 +1328,6 @@ public function task__update() return Base::retSuccess('修改成功', $data); } - /** - * @api {post} api/project/task/upload 27. 上传文件 - * - * @apiDescription 需要token身份(限:项目、任务负责人) - * @apiVersion 1.0.0 - * @apiGroup project - * @apiName task__upload - * - * @apiParam {Number} task_id 任务ID - * @apiParam {String} [filename] post-文件名称 - * @apiParam {String} [image64] post-base64图片(二选一) - * @apiParam {File} [files] post-文件对象(二选一) - * - * @apiSuccess {Number} ret 返回状态码(1正确、0错误) - * @apiSuccess {String} msg 返回信息(错误描述) - * @apiSuccess {Object} data 返回数据 - */ - public function task__upload() - { - $user = User::auth(); - // - $task_id = Base::getPostInt('task_id'); - // - $task = ProjectTask::userTask($task_id, true, true); - // - $path = "uploads/task/" . $task->id . "/"; - $image64 = Base::getPostValue('image64'); - $fileName = Base::getPostValue('filename'); - if ($image64) { - $data = Base::image64save([ - "image64" => $image64, - "path" => $path, - "fileName" => $fileName, - ]); - } else { - $data = Base::upload([ - "file" => Request::file('files'), - "type" => 'file', - "path" => $path, - "fileName" => $fileName, - ]); - } - // - if (Base::isError($data)) { - return Base::retError($data['msg']); - } else { - $fileData = $data['data']; - $file = ProjectTaskFile::createInstance([ - 'project_id' => $task->project_id, - 'task_id' => $task->id, - 'name' => $fileData['name'], - 'size' => $fileData['size'] * 1024, - 'ext' => $fileData['ext'], - 'path' => $fileData['path'], - 'thumb' => Base::unFillUrl($fileData['thumb']), - 'userid' => $user->userid, - ]); - $file->save(); - // - $file = ProjectTaskFile::find($file->id); - $task->addLog("上传文件:" . $file->name); - $task->pushMsg('upload', $file); - return Base::retSuccess("上传成功", $file); - } - } - /** * @api {get} api/project/task/dialog 28. 创建/获取聊天室 * @@ -1653,7 +1587,7 @@ public function task__flow() /** * @api {get} api/project/flow/list 33. 工作流列表 * - * @apiDescription 需要token身份(限:项目负责人) + * @apiDescription 需要token身份 * @apiVersion 1.0.0 * @apiGroup project * @apiName flow__list @@ -1669,9 +1603,8 @@ public function flow__list() User::auth(); // $project_id = intval(Request::input('project_id')); - $is_filter = intval(Request::input('is_filter',0)); // - $project = Project::userProject($project_id, true, true, $is_filter); + $project = Project::userProject($project_id, true); // $list = ProjectFlow::with(['ProjectFlowItem'])->whereProjectId($project->id)->get(); return Base::retSuccess('success', $list); diff --git a/app/Models/Project.php b/app/Models/Project.php index 0b1bab82a..76e452a30 100644 --- a/app/Models/Project.php +++ b/app/Models/Project.php @@ -354,11 +354,10 @@ public function pushMsg($action, $data = null, $userid = null) * 获取项目信息(用于判断会员是否存在项目内) * @param int $project_id * @param null|bool $archived true:仅限未归档, false:仅限已归档, null:不限制 - * @param null $mustOwner true:仅限项目负责人, false:仅限非项目负责人, null:不限制 - * @param int $is_filter 是否是用筛选列表 + * @param null|bool $mustOwner true:仅限项目负责人, false:仅限非项目负责人, null:不限制 * @return self */ - public static function userProject($project_id, $archived = true, $mustOwner = null, $is_filter = 0) + public static function userProject($project_id, $archived = true, $mustOwner = null) { $project = self::authData()->where('projects.id', intval($project_id))->first(); if (empty($project)) { @@ -370,10 +369,10 @@ public static function userProject($project_id, $archived = true, $mustOwner = n if ($archived === false && $project->archived_at == null) { throw new ApiException('项目未归档', [ 'project_id' => $project_id ]); } - if ($mustOwner === true && !$project->owner && $is_filter === 0) { + if ($mustOwner === true && !$project->owner) { throw new ApiException('仅限项目负责人操作', [ 'project_id' => $project_id ]); } - if ($mustOwner === false && $project->owner && $is_filter === 0) { + if ($mustOwner === false && $project->owner) { throw new ApiException('禁止项目负责人操作', [ 'project_id' => $project_id ]); } return $project; diff --git a/app/Models/WebSocketDialogMsg.php b/app/Models/WebSocketDialogMsg.php index 23b6b6335..46d7d1b3a 100644 --- a/app/Models/WebSocketDialogMsg.php +++ b/app/Models/WebSocketDialogMsg.php @@ -46,9 +46,6 @@ class WebSocketDialogMsg extends AbstractModel 'updated_at', ]; - const MSG_TYPE_TEXT = "text"; - const MSG_TYPE_FILE = "file"; - /** * 阅读占比 * @return int|mixed diff --git a/app/Module/Base.php b/app/Module/Base.php index 6a8c3049c..55e02e6da 100755 --- a/app/Module/Base.php +++ b/app/Module/Base.php @@ -2263,7 +2263,8 @@ public static function upload($param) 'asp', 'properties', 'gitignore', 'log', 'bas', 'prg', 'python', 'ftl', 'aspx', 'mp3', 'wav', 'mp4', 'flv', 'avi', 'mov', 'wmv', 'mkv', '3gp', 'rm', - 'xmind', 'rp', + 'xmind', + 'rp', ]; break; default: diff --git a/resources/assets/js/pages/login.vue b/resources/assets/js/pages/login.vue index 1ab24536e..b1193fc37 100644 --- a/resources/assets/js/pages/login.vue +++ b/resources/assets/js/pages/login.vue @@ -13,15 +13,8 @@ - - - - + +  {{$L('邀请码')}}  @@ -252,7 +245,7 @@ export default { } if (this.loginType == 'reg') { if (this.password != this.password2) { - $A.noticeError("确认密码输入不一致"); + $A.messageWarning("确认密码输入不一致"); return; } } @@ -276,10 +269,7 @@ export default { }); }).catch(({data, msg}) => { this.loadIng--; - $A.noticeError({ - desc: msg, - duration: 10 - }); + $A.modalError(msg); if (data.code === 'need') { this.reCode(); this.codeNeed = true; diff --git a/resources/assets/js/pages/manage.vue b/resources/assets/js/pages/manage.vue index c3efc265f..56e953ad9 100644 --- a/resources/assets/js/pages/manage.vue +++ b/resources/assets/js/pages/manage.vue @@ -451,6 +451,12 @@ export default { }, 5000) }, + workReportShow(show) { + if (show) { + this.getReportUnread(0); + } + }, + unreadTotal: { handler(num) { if (this.$Electron) { @@ -550,7 +556,6 @@ export default { if (this.reportUnreadNumber > 0) { this.reportTabs = "receive"; } - this.getReportUnread(0); this.workReportShow = true; return; case 'clearCache': diff --git a/resources/assets/js/pages/manage/components/DialogWrapper.vue b/resources/assets/js/pages/manage/components/DialogWrapper.vue index 90ff89f66..0991c733d 100644 --- a/resources/assets/js/pages/manage/components/DialogWrapper.vue +++ b/resources/assets/js/pages/manage/components/DialogWrapper.vue @@ -35,13 +35,17 @@
  • {{$L('加载历史消息')}}
  • {{$L('暂无消息')}}
  • - + :class="{self:item.userid == userId, 'history-tip': topId == item.id}"> + {{$L('历史消息')}} +
    + +
    + +
  • {{projectData.desc}}
    +
    + {{$L('显示已完成')}} +
    -
    {{$L('进度')}}
    -
    -
    - {{$L('显示已完成')}} -
    @@ -507,8 +502,9 @@ export default { archivedTaskShow: false, projectDialogSubscribe: null, + + flowId: 0, flowList: [], - flowId: 0 } }, @@ -572,23 +568,21 @@ export default { }, panelTask() { - const {searchText,flowId} = this; + const {searchText, flowId} = this; return function (list) { if (!this.projectParameter('completedTask')) { list = list.filter(({complete_at}) => { return !complete_at; }); } + if (flowId > 0) { + list = list.filter(({flow_item_id}) => flow_item_id === flowId); + } if (searchText) { list = list.filter(({name, desc}) => { return $A.strExists(name, searchText) || $A.strExists(desc, searchText); }); } - if(flowId > 0){ - list = list.filter(({flow_item_id}) => { - return flow_item_id === flowId; - }); - } return list; } }, @@ -624,7 +618,7 @@ export default { })).sort((a, b) => { let at1 = $A.Date(a.complete_at), at2 = $A.Date(b.complete_at); - if(at1 || at2){ + if (at1 || at2) { return at1 - at2; } if (a.sort != b.sort) { @@ -691,14 +685,14 @@ export default { if (task.project_id != projectId || task.parent_id > 0) { return false; } + if (flowId > 0 && task.flow_item_id !== flowId) { + return false; + } if (searchText) { if (!$A.strExists(task.name, searchText) && !$A.strExists(task.desc, searchText)) { return false; } } - if(task.flow_item_id !== flowId && flowId > 0){ - return false; - } return !task.complete_at; }); return array.sort((a, b) => { @@ -725,14 +719,14 @@ export default { if (task.project_id != projectId || task.parent_id > 0) { return false; } + if (flowId > 0 && task.flow_item_id !== flowId) { + return false; + } if (searchText) { if (!$A.strExists(task.name, searchText) && !$A.strExists(task.desc, searchText)) { return false; } } - if(task.flow_item_id !== flowId && flowId > 0){ - return false; - } return task.complete_at; }); return array.sort((a, b) => { @@ -762,10 +756,11 @@ export default { }, projectId: { handler(val) { - if (val) { + if (val > 0) { this.getFlowData(); } }, + immediate: true, }, }, @@ -1158,21 +1153,20 @@ export default { taskIsHidden(task) { const {name, desc, complete_at} = task; - const {searchText,flowId} = this; + const {searchText, flowId} = this; if (!this.projectParameter('completedTask')) { if (complete_at) { return true; } } + if (flowId > 0 && task.flow_item_id !== flowId) { + return false; + } if (searchText) { if (!($A.strExists(name, searchText) || $A.strExists(desc, searchText))) { return true; } } - - if(task.flow_item_id !== flowId && flowId > 0){ - return true; - } return false; }, @@ -1200,6 +1194,22 @@ export default { }); }, + getFlowData() { + this.$store.dispatch("call", { + url: 'project/flow/list', + data: { + project_id: this.projectId, + }, + }).then(({data}) => { + let flowList = data.map(({project_flow_item}) => project_flow_item); + if (flowList) { + this.flowList = flowList[0]; + } + }).catch(() => { + this.flowList = []; + }); + }, + inviteCopy() { if (!this.inviteData.url) { return; @@ -1253,14 +1263,14 @@ export default { return false; } } + if (this.flowId > 0 && task.flow_item_id !== this.flowId) { + return false; + } if (this.searchText) { if (!$A.strExists(task.name, this.searchText) && !$A.strExists(task.desc, this.searchText)) { return false; } } - if(task.flow_item_id !== this.flowId && this.flowId > 0){ - return false; - } return task.owner; }, @@ -1276,37 +1286,20 @@ export default { return false; } } + if (this.flowId > 0 && task.flow_item_id !== this.flowId) { + return false; + } if (this.searchText) { if (!$A.strExists(task.name, this.searchText) && !$A.strExists(task.desc, this.searchText)) { return false; } } - if(task.flow_item_id !== this.flowId && this.flowId > 0){ - return false; - } return task.task_user && task.task_user.find(({userid, owner}) => userid == this.userId && owner == 0); }, expiresFormat(date) { return $A.countDownFormat(date, this.nowTime) }, - getFlowData() { - this.$store.dispatch("call", { - url: 'project/flow/list', - data: { - project_id: this.projectId, - is_filter: 1 - }, - }).then(({data}) => { - let flowList = data.map(item => { - return item.project_flow_item; - }); - this.flowList = flowList[0]; - }).catch(({msg}) => { - this.flowList = []; - return false; - }); - }, } } diff --git a/resources/assets/js/pages/manage/components/ReportEdit.vue b/resources/assets/js/pages/manage/components/ReportEdit.vue index 2ff83645f..24025746b 100644 --- a/resources/assets/js/pages/manage/components/ReportEdit.vue +++ b/resources/assets/js/pages/manage/components/ReportEdit.vue @@ -103,16 +103,10 @@ export default { if (this.id > 0) { this.getDetail(val); }else{ - this.userInputShow = false; this.reportData.offset = 0; this.reportData.type = "weekly"; this.reportData.receive = []; this.getTemplate(); - setTimeout(() => { - // 如果不做异步,直接重新赋值的话会导致组件无法重新加载 - // 组件不销毁重新渲染,会导致UserInput组件无法重新拉取所有人的列表 - this.userInputShow = true; - }, 50) } }, }, diff --git a/resources/assets/js/pages/manage/components/TaskAdd.vue b/resources/assets/js/pages/manage/components/TaskAdd.vue index c20df9e85..905b9baae 100644 --- a/resources/assets/js/pages/manage/components/TaskAdd.vue +++ b/resources/assets/js/pages/manage/components/TaskAdd.vue @@ -473,10 +473,6 @@ export default { return; } this.loadIng++; - // 处理栏目变更 - if ( this.addData.cascader.length > 0 ) { - this.addData.column_id = this.addData.cascader[1]; - } this.$store.dispatch("taskAdd", this.addData).then(({msg}) => { this.loadIng--; $A.messageSuccess(msg); diff --git a/resources/assets/js/pages/manage/file.vue b/resources/assets/js/pages/manage/file.vue index f33addc3f..db7dcc8a6 100644 --- a/resources/assets/js/pages/manage/file.vue +++ b/resources/assets/js/pages/manage/file.vue @@ -417,7 +417,8 @@ export default { 'asp', 'properties', 'gitignore', 'log', 'bas', 'prg', 'python', 'ftl', 'aspx', 'mp3', 'wav', 'mp4', 'flv', 'avi', 'mov', 'wmv', 'mkv', '3gp', 'rm', - 'xmind', 'rp', + 'xmind', + 'rp', ], uploadAccept: '', maxSize: 204800, diff --git a/resources/assets/sass/pages/components/project-list.scss b/resources/assets/sass/pages/components/project-list.scss index 843b7df38..332af5c52 100644 --- a/resources/assets/sass/pages/components/project-list.scss +++ b/resources/assets/sass/pages/components/project-list.scss @@ -136,14 +136,18 @@ box-shadow: none; } } - .project-select{ + .project-select { display: flex; align-items: center; margin-right: 14px; - opacity: 0.9; - z-index: 1000; - .title{ - width:50px; + .ivu-select-single { + .ivu-select-selection { + height: 30px; + .ivu-select-selected-value { + height: 28px; + line-height: 28px; + } + } } } .project-switch-button { @@ -957,16 +961,6 @@ .project-switch { margin-left: 0; justify-content: flex-end; - .project-select{ - display: flex; - align-items: center; - margin-right: 14px; - opacity: 0.9; - z-index: 1000; - .title{ - width:50px; - } - } } } }