From 3c4128944a4bf4c3cf6a186ac2c3bc04df6681a6 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 14 Nov 2023 16:03:20 +0800 Subject: [PATCH] * Adjust taskkanban. --- lib/zin/wg/formpanel/js/v1.js | 13 ++++++++++--- module/execution/js/taskkanban.ui.js | 24 ++++++------------------ module/task/ui/create.html.php | 7 +++---- 3 files changed, 19 insertions(+), 25 deletions(-) diff --git a/lib/zin/wg/formpanel/js/v1.js b/lib/zin/wg/formpanel/js/v1.js index 9f254e76dd..2f505f4607 100644 --- a/lib/zin/wg/formpanel/js/v1.js +++ b/lib/zin/wg/formpanel/js/v1.js @@ -4,11 +4,12 @@ function hideSingleField(hiddenFields) hiddenFields.forEach(function(field) { - var $this = $('form [name^="' + field + '"]'); + let $this = $('form [name^="' + field + '"]'); if($this.length == 0) return; - $inputGroup = $this.closest('.input-group'); - $formGroup = $this.closest('.form-group'); + let $formGroup = $this.closest('.form-group'); + let $inputGroup = $this.closest('.input-group'); + let $inputControl = $this.closest('.input-control'); if($inputGroup.length == 1) { $prev = $this.prev(); @@ -23,6 +24,12 @@ function hideSingleField(hiddenFields) $prev = $pickBox.prev(); if($prev.hasClass('input-group-addon')) $prev.addClass('hidden'); } + + if($inputControl.length == 1) + { + if($inputControl.prev().hasClass('input-group-addon')) $inputControl.prev().addClass('hidden'); + if($inputControl.hasClass('has-suffix')) $inputControl.addClass('hidden'); + } } else { diff --git a/module/execution/js/taskkanban.ui.js b/module/execution/js/taskkanban.ui.js index d88f9b6424..e3fd46b65d 100644 --- a/module/execution/js/taskkanban.ui.js +++ b/module/execution/js/taskkanban.ui.js @@ -120,23 +120,11 @@ window.getColActions = function(col) /* 父列不需要创建卡片相关的操作按钮。 */ if(col.parent != '-1' && (col.type == 'backlog' || col.type == 'unconfirmed' || col.type == 'wait')) { - actionList.push( - { - type: 'dropdown', - icon: 'expand-alt text-primary', - caret: false, - items: buildColCardActions(col), - }); + let cardActions = buildColCardActions(col); + if(cardActions.length > 0) actionList.push({type:'dropdown', icon:'expand-alt text-primary', caret:false, items:cardActions}); } - actionList.push( - { - type: 'dropdown', - icon: 'ellipsis-v', - caret: false, - items: buildColActions(col), - }); - + actionList.push({type:'dropdown', icon:'ellipsis-v', caret:false, items:buildColActions(col)}); return actionList; } @@ -159,13 +147,13 @@ window.buildColCardActions = function(col) if(priv.canCreateBug) actions.push({text: bugLang.create, url: $.createLink('bug', 'create', 'productID=0&moduleID=0&extra=executionID=' + executionID), 'data-toggle': 'modal'}); if(priv.canBatchCreateBug) { - if(productNum > 1) actions.push({text: bugLang.batchCreate, url: '#batchCreateBug', 'data-toggle': 'modal'}); + if(productNum > 1) actions.push({text: bugLang.batchCreate, url: '#batchCreateBug', 'data-toggle': 'modal', 'data-size': 'lg'}); else actions.push({text: bugLang.batchCreate, url: $.createLink('bug', 'batchcreate', 'productID=' + productID + '&moduleID=0&executionID=' + executionID), 'data-toggle': 'modal', 'data-size': 'lg'}); } } else if(col.type == 'wait') { - if(priv.canCreateTask) actions.push({text: taskLang.create, url: $.createLink('task', 'create', 'executionID=' + executionID), 'data-toggle': 'modal'}); + if(priv.canCreateTask) actions.push({text: taskLang.create, url: $.createLink('task', 'create', 'executionID=' + executionID), 'data-toggle': 'modal', 'data-size': 'lg'}); if(priv.canBatchCreateTask) actions.push({text: taskLang.batchCreate, url: $.createLink('task', 'batchcreate', 'executionID=' + executionID), 'data-toggle': 'modal', 'data-size': 'lg'}); if(priv.canImportBug && canImportBug) actions.push({text: executionLang.importBug, url: $.createLink('execution', 'importBug', 'executionID=' + executionID), 'data-toggle': 'modal', 'data-size': 'lg'}); } @@ -213,7 +201,7 @@ window.getItem = function(info) beginAndEnd = formatDate(begin) + ' ~ ' + formatDate(end); } - if(info.item.assignedTo) + if(info.item.assignedTo && typeof userList[info.item.assignedTo] != 'undefined') { user = userList[info.item.assignedTo]; assignedTo = user.realname; diff --git a/module/task/ui/create.html.php b/module/task/ui/create.html.php index 2a02b55cfe..53f0e0094a 100644 --- a/module/task/ui/create.html.php +++ b/module/task/ui/create.html.php @@ -237,11 +237,10 @@ formPanel ), span ( - set('class', 'input-group-addon'), - a + set('class', 'input-group-btn'), + btn ( - set('id', 'showAllModuleButton'), - set('href', 'javascript:;'), + setID('showAllModuleButton'), $lang->task->allModule, on::click('showAllModule') ),