refactor: 根据最新的lgbSelect重构Dicts Menus页面

This commit is contained in:
Argo Zhang 2019-07-26 13:18:36 +08:00
parent 0a943114eb
commit 21c8080a1f
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
3 changed files with 54 additions and 103 deletions

View File

@ -29,17 +29,12 @@
</div>
<div class="form-group col-sm-6 col-md-auto">
<label class="control-label" for="txt_dict_define">字典类别</label>
<div class="form-select" data-toggle="lgbSelect">
<input type="hidden" data-toggle="lgbSelect" id="txt_dict_define" />
<input type="text" readonly="readonly" class="form-control form-select-input" placeholder="请选择 ...">
<span class="form-select-append"><i class="fa fa-angle-up"></i></span>
<div class="dropdown-menu-arrow"></div>
<div class="dropdown-menu">
<a class="dropdown-item" href="#" data-val="">全部</a>
<a class="dropdown-item" href="#" data-val="0">系统使用</a>
<a class="dropdown-item" href="#" data-val="1">自定义</a>
</div>
</div>
<input class="form-control" data-toggle="lgbSelect" />
<select data-toggle="lgbSelect" class="d-none" id="txt_dict_define">
<option value="">全部</option>
<option value="0">系统使用</option>
<option value="1">自定义</option>
</select>
</div>
<div class="form-group col-sm-6 col-md-auto flex-sm-fill justify-content-sm-end align-self-sm-end">
<button type="button" id="btn_query" class="btn btn-primary btn-fill"><i class="fa fa-search" aria-hidden="true"></i><span>查询</span></button>
@ -67,16 +62,11 @@
</div>
<div class="form-group col-sm-6">
<label class="control-label" for="dictDefine">字典类型</label>
<div class="form-select" data-toggle="lgbSelect">
<input type="hidden" data-toggle="lgbSelect" id="dictDefine" data-default-val="1" />
<input type="text" readonly="readonly" class="form-control form-select-input" placeholder="请选择 ...">
<span class="form-select-append"><i class="fa fa-angle-up"></i></span>
<div class="dropdown-menu-arrow"></div>
<div class="dropdown-menu">
<a class="dropdown-item" href="#" data-val="0">系统使用</a>
<a class="dropdown-item" href="#" data-val="1">自定义</a>
</div>
</div>
<input class="form-control" data-toggle="lgbSelect" />
<select data-toggle="lgbSelect" class="d-none" data-default-val="1" id="dictDefine">
<option value="0">系统使用</option>
<option value="1">自定义</option>
</select>
</div>
<div class="form-group col-sm-6">
<label class="control-label" for="dictName">字典名称</label>

View File

@ -43,47 +43,33 @@
</div>
<div class="form-group col-sm-6 col-lg-auto">
<label class="control-label" for="sel_menus_category">菜单类别</label>
<div class="form-select" data-toggle="lgbSelect">
<input type="hidden" data-toggle="lgbSelect" id="sel_menus_category" />
<input type="text" readonly="readonly" class="form-control form-select-input" placeholder="请选择 ...">
<span class="form-select-append"><i class="fa fa-angle-up"></i></span>
<div class="dropdown-menu-arrow"></div>
<div class="dropdown-menu">
<a class="dropdown-item" href="#" data-val="">全部</a>
<a class="dropdown-item" href="#" data-val="0">系统菜单</a>
<a class="dropdown-item" href="#" data-val="1">外部菜单</a>
</div>
</div>
<input class="form-control" data-toggle="lgbSelect" />
<select data-toggle="lgbSelect" class="d-none" id="sel_menus_category">
<option value="">全部</option>
<option value="0">系统菜单</option>
<option value="1">外部菜单</option>
</select>
</div>
<div class="form-group col-sm-6 col-lg-auto">
<label class="control-label" for="sel_menus_res">菜单类型</label>
<div class="form-select" data-toggle="lgbSelect">
<input type="hidden" data-toggle="lgbSelect" id="sel_menus_res" />
<input type="text" readonly="readonly" class="form-control form-select-input" placeholder="请选择 ...">
<span class="form-select-append"><i class="fa fa-angle-up"></i></span>
<div class="dropdown-menu-arrow"></div>
<div class="dropdown-menu">
<a class="dropdown-item" href="#" data-val="">全部</a>
<a class="dropdown-item" href="#" data-val="0">菜单</a>
<a class="dropdown-item" href="#" data-val="1">资源</a>
<a class="dropdown-item" href="#" data-val="2">按钮</a>
</div>
</div>
<input class="form-control" data-toggle="lgbSelect" />
<select data-toggle="lgbSelect" class="d-none" id="sel_menus_res">
<option value="">全部</option>
<option value="0">菜单</option>
<option value="1">资源</option>
<option value="2">按钮</option>
</select>
</div>
<div class="form-group col-sm-6 col-lg-auto">
<label class="control-label" for="sel_app">所属应用</label>
<div class="form-select" data-toggle="lgbSelect">
<input type="hidden" data-toggle="lgbSelect" id="sel_app" data-default-val="0" />
<input type="text" readonly="readonly" class="form-control form-select-input" placeholder="请选择 ...">
<span class="form-select-append"><i class="fa fa-angle-up"></i></span>
<div class="dropdown-menu-arrow"></div>
<div class="dropdown-menu">
<input class="form-control" data-toggle="lgbSelect" />
<select data-toggle="lgbSelect" class="d-none" id="sel_app">
<option value="">全部</option>
@foreach (var kv in Model.Applications)
{
<a class="dropdown-item" href="#" data-val="@kv.Key">@kv.Value</a>
<option value="@kv.Key">@kv.Value</option>
}
</div>
</div>
</select>
</div>
<div class="form-group col-sm-6 col-lg-auto flex-sm-fill justify-content-sm-end align-self-sm-end">
<button type="button" id="btn_query" class="btn btn-primary btn-fill"><i class="fa fa-search" aria-hidden="true"></i><span>查询</span></button>
@ -162,61 +148,36 @@
</div>
<div class="form-group col-sm-6">
<label class="control-label" for="category">菜单类别</label>
<div class="form-select" data-toggle="lgbSelect">
<input type="hidden" data-toggle="lgbSelect" id="category" data-default-val="1" />
<input type="text" readonly="readonly" class="form-control form-select-input" placeholder="请选择 ...">
<span class="form-select-append"><i class="fa fa-angle-up"></i></span>
<div class="dropdown-menu-arrow"></div>
<div class="dropdown-menu">
<a class="dropdown-item" href="#" data-val="">全部</a>
<a class="dropdown-item" href="#" data-val="0">系统菜单</a>
<a class="dropdown-item" href="#" data-val="1">外部菜单</a>
</div>
</div>
<select data-toggle="lgbSelect" class="d-none" data-default-val="1" id="category">
<option value="0">系统菜单</option>
<option value="1">外部菜单</option>
</select>
</div>
<div class="form-group col-sm-6">
<label class="control-label" for="target">目标</label>
<div class="form-select" data-toggle="lgbSelect">
<input type="hidden" data-toggle="lgbSelect" id="target" data-default-val="_self" />
<input type="text" readonly="readonly" class="form-control form-select-input" placeholder="请选择 ...">
<span class="form-select-append"><i class="fa fa-angle-up"></i></span>
<div class="dropdown-menu-arrow"></div>
<div class="dropdown-menu">
<a class="dropdown-item" href="#" data-val="_self">本窗口</a>
<a class="dropdown-item" href="#" data-val="_blank">新窗口</a>
<a class="dropdown-item" href="#" data-val="_parent">父级窗口</a>
<a class="dropdown-item" href="#" data-val="_top">顶级窗口</a>
</div>
</div>
<select data-toggle="lgbSelect" class="d-none" data-default-val="_self" id="target">
<option value="_self">本窗口</option>
<option value="_blank">新窗口</option>
<option value="_parent">父级窗口</option>
<option value="_top">顶级窗口</option>
</select>
</div>
<div class="form-group col-sm-6">
<label class="control-label" for="isRes">菜单类型</label>
<div class="form-select" data-toggle="lgbSelect">
<input type="hidden" data-toggle="lgbSelect" id="isRes" data-default-val="0" />
<input type="text" readonly="readonly" class="form-control form-select-input" placeholder="请选择 ...">
<span class="form-select-append"><i class="fa fa-angle-up"></i></span>
<div class="dropdown-menu-arrow"></div>
<div class="dropdown-menu">
<a class="dropdown-item" href="#" data-val="0">菜单</a>
<a class="dropdown-item" href="#" data-val="1">资源</a>
<a class="dropdown-item" href="#" data-val="2">按钮</a>
</div>
</div>
<select data-toggle="lgbSelect" class="d-none" data-default-val="0" id="isRes">
<option value="0">菜单</option>
<option value="1">资源</option>
<option value="2">按钮</option>
</select>
</div>
<div class="form-group col-sm-6">
<label class="control-label" for="app">所属应用</label>
<div class="form-select" data-toggle="lgbSelect">
<input type="hidden" data-toggle="lgbSelect" id="app" data-default-val="0" />
<input type="text" readonly="readonly" class="form-control form-select-input" placeholder="请选择 ...">
<span class="form-select-append"><i class="fa fa-angle-up"></i></span>
<div class="dropdown-menu-arrow"></div>
<div class="dropdown-menu">
<select data-toggle="lgbSelect" class="d-none" data-default-val="0" id="app">
@foreach (var kv in Model.Applications)
{
<a class="dropdown-item" href="#" data-val="@kv.Key">@kv.Value</a>
<option value="@kv.Key">@kv.Value</option>
}
</div>
</div>
</select>
</div>
</div>
</form>

View File

@ -420,7 +420,7 @@
else {
var data = [];
this.lgbSelect('get', function (source) { data = source; });
var find = data.filter(function () { return this.value === value; });
var find = data.filter(function (item, index) { return item.value === value; });
if (find.length === 1) text = find[0].text;
}
}