* Code for add menuTree to langItem
This commit is contained in:
@@ -241,6 +241,8 @@ $config->dev->postParams['testcase']['create']['expect'] = 'string';
|
||||
$config->dev->postParams['testcase']['create']['mailto'] = 'string';
|
||||
$config->dev->postParams['testcase']['create']['keywords'] = 'string';
|
||||
|
||||
$config->dev->arrTypesWithMenu = array('second', 'third', 'feature');
|
||||
|
||||
$config->disableFeature = array();
|
||||
if(!helper::hasFeature('waterfall')) $config->disableFeature = array('design', 'stage', 'programplan', 'weekly', 'researchplan', 'researchreport', 'gapanalysis');
|
||||
|
||||
|
||||
@@ -1,9 +1,18 @@
|
||||
.flex {display: flex;}
|
||||
.flex-1 {flex: 1;}
|
||||
.align-center {align-items: center;}
|
||||
.justify-center {justify-content: center;}
|
||||
.h-32 {height: 32px;}
|
||||
.py-6 {padding: 6px 0;}
|
||||
.my-12 {margin: 12px 0;}
|
||||
.ml-20 {margin-left: 20px;}
|
||||
.title {font-size: 13px; color: #313C52; font-weight: 700; height: 40px; text-align: center;}
|
||||
.gap-15 {gap: 15px;}
|
||||
|
||||
/* menu-tree */
|
||||
.menu-tree {flex: 0 0 200px; background: #fff; padding: 10px 10px;}
|
||||
.menu-tree > .tree {padding-top: 20px;}
|
||||
.menu-tree li {padding: 5px 25px;}
|
||||
|
||||
/* side-left */
|
||||
.main-content > .side-left {flex: 0 0 160px; margin-left: 64px;}
|
||||
|
||||
@@ -14,6 +14,8 @@ $(function()
|
||||
handleClickItem($(this).attr('labelid'));
|
||||
});
|
||||
|
||||
initMenu();
|
||||
|
||||
function addActive(id)
|
||||
{
|
||||
$('[labelid=' + id + ']').addClass('text-primary');
|
||||
@@ -39,4 +41,61 @@ $(function()
|
||||
addActive(clickId);
|
||||
};
|
||||
}
|
||||
|
||||
function initMenu()
|
||||
{
|
||||
if (arrTypesWithMenu.includes(type))
|
||||
{
|
||||
var myTreeData = [{
|
||||
title: '水果',
|
||||
children: [
|
||||
{title: '橘子'},
|
||||
{title: '瓜'}
|
||||
]
|
||||
}, {
|
||||
title: '坚果',
|
||||
children: [
|
||||
{title: '向日葵'},
|
||||
{title: '瓜子'}
|
||||
]
|
||||
}, {
|
||||
title: '蔬菜'
|
||||
}];
|
||||
$('#menuTree').tree(
|
||||
{
|
||||
data: myTreeData
|
||||
});
|
||||
}
|
||||
$('#searchInputTree').on('input', function()
|
||||
{
|
||||
var val = $(this).val();
|
||||
if (!val)
|
||||
{
|
||||
var updateData = JSON.parse(JSON.stringify(myTreeData));
|
||||
}
|
||||
else
|
||||
{
|
||||
var updateData = [];
|
||||
for (var i = 0; i < myTreeData.length; i++)
|
||||
{
|
||||
var item = {};
|
||||
$.extend(true, item, myTreeData[i])
|
||||
if (item.children)
|
||||
{
|
||||
var children = [];
|
||||
for (var j = 0; j < item.children.length; j++)
|
||||
{
|
||||
if (item.children[j].title.includes(val))
|
||||
{
|
||||
children.push(item.children[j]);
|
||||
}
|
||||
}
|
||||
item.children = children;
|
||||
}
|
||||
updateData.push(item);
|
||||
}
|
||||
}
|
||||
$('#menuTree').data('zui.tree').reload(updateData);
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php js::set('type', $type); ?>
|
||||
<?php js::set('arrTypesWithMenu', $config->dev->arrTypesWithMenu); ?>
|
||||
<?php include 'header.html.php';?>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
<div class="btn-toolBar pull-left">
|
||||
@@ -20,37 +22,48 @@
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
</div>
|
||||
<form class='main-form form-ajax' method='post'>
|
||||
<div id='mainContent' class='main-content flex'>
|
||||
<div class="side-left">
|
||||
<div class="title">默认值</div>
|
||||
<div class="label-list">
|
||||
<?php foreach($originalLangs as $langKey => $originalLang):?>
|
||||
<div labelId="<?php echo "{$moduleName}_{$langKey}"?>" class="input-label h-32 my-12"><?php echo $originalLang?></div>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
<div class="flex gap-15">
|
||||
<?php if(in_array($type, $config->dev->arrTypesWithMenu , false)):?>
|
||||
<div class="menu-tree">
|
||||
<div class="input-control search-box has-icon-left has-icon-right search-example">
|
||||
<input id="searchInputTree" type="search" class="form-control search-input empty">
|
||||
<label class="input-control-icon-left search-icon flex align-center justify-center"><i class="icon icon-search"></i></label>
|
||||
</div>
|
||||
<div class="side-right">
|
||||
<div class="title">修改值</div>
|
||||
<div class="input-list">
|
||||
<?php foreach($originalLangs as $langKey => $originalLang):?>
|
||||
<div class="input-control h-32 my-12">
|
||||
<?php
|
||||
$disabled = '';
|
||||
if($type == 'common' and ($langKey == 'URCommon' or $langKey == 'SRCommon')) $disabled = 'disabled';
|
||||
?>
|
||||
<?php echo html::input("{$moduleName}_{$langKey}", zget($customedLangs, $langKey, ''), "class='form-control shadow-primary-hover {$disabled}' {$disabled} placeholder='{$originalLang}'");?>
|
||||
<i iconId="<?php echo "{$moduleName}_{$langKey}"?>" class="icon icon-angle-right text-primary hidden"></i>
|
||||
<div id="menuTree" ></div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<form class='main-form form-ajax flex-1' method='post'>
|
||||
<div id='mainContent' class='main-content flex'>
|
||||
<div class="side-left">
|
||||
<div class="title">默认值</div>
|
||||
<div class="label-list">
|
||||
<?php foreach($originalLangs as $langKey => $originalLang):?>
|
||||
<div labelId="<?php echo "{$moduleName}_{$langKey}"?>" class="input-label h-32 my-12"><?php echo $originalLang?></div>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="side-main"></div>
|
||||
<div class="side-right">
|
||||
<div class="title">修改值</div>
|
||||
<div class="input-list">
|
||||
<?php foreach($originalLangs as $langKey => $originalLang):?>
|
||||
<div class="input-control h-32 my-12">
|
||||
<?php
|
||||
$disabled = '';
|
||||
if($type == 'common' and ($langKey == 'URCommon' or $langKey == 'SRCommon')) $disabled = 'disabled';
|
||||
?>
|
||||
<?php echo html::input("{$moduleName}_{$langKey}", zget($customedLangs, $langKey, ''), "class='form-control shadow-primary-hover {$disabled}' {$disabled} placeholder='{$originalLang}'");?>
|
||||
<i iconId="<?php echo "{$moduleName}_{$langKey}"?>" class="icon icon-angle-right text-primary hidden"></i>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="side-main"></div>
|
||||
</div>
|
||||
<div class="bottom-btn">
|
||||
<?php echo html::submitButton(); ?>
|
||||
<button id="reset" class="btn btn-wide ml-20"><?php echo $lang->restore?> </button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</form>
|
||||
<div class="bottom-btn">
|
||||
<?php echo html::submitButton(); ?>
|
||||
<button id="reset" class="btn btn-wide ml-20"><?php echo $lang->restore?> </button>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
Reference in New Issue
Block a user