Authored by XuHaoJie

Merge branch 'master' of http://113.200.75.45:82/monitor_v3/hg-monitor-web into master-V32-XuHaoJie

... ... @@ -41,7 +41,10 @@ layui.define(['table', 'admin', 'form', 'common', 'sessions', 'reslist', 'common
loadFavoriteList("0");
//解决点击面包屑,favorites_parentId没有赋值问题 joke add 20200518 开始
$("#favorites_parentId").val('0');
//解决点击面包屑,favorites_parentId没有赋值问题 joke add 20200518 开始
//解决点击面包屑,favorites_parentId没有赋值问题 joke add 20200518 结束
//清空面包屑其他按钮选中状态
$(".layui-breadcrumb .breadcrumb_a").removeClass("active");
$("#tofavorite_home").addClass("active");
});
//创建收藏夹
$("#create_favorite").on("click",function () {
... ... @@ -57,7 +60,7 @@ layui.define(['table', 'admin', 'form', 'common', 'sessions', 'reslist', 'common
yes:function (index,layero) {
var favoritesName = $(layero).find('input[name=favoritesName]').val();
// Start xwx 2021/11/1 新建文件夹名称不能为空
if (favoritesName!=''){
if (favoritesName.trim()!=''){
saveFavorite(null,favoritesName,parentId);
$("e.empty").hide();
//刷新列表
... ... @@ -175,10 +178,16 @@ layui.define(['table', 'admin', 'form', 'common', 'sessions', 'reslist', 'common
$(".empty").show();
loadFavoriteList(id);
}
//反射面包屑选中,先清空所有选中状态 joke add 20211203
$(".layui-breadcrumb .breadcrumb_a").removeClass("active");
$("#tofavorite_home").removeClass("active");
//反射面包屑选中 joke add 20211203
$('#'+id).addClass("active");
//面包屑点击事件
$(".layui-breadcrumb a.breadcrumb_a").unbind('click').on("click",function () {
$(".layui-breadcrumb .breadcrumb_a").removeClass("active");
//点击面包屑时,去除我的收藏夹选中状态 joke add 20211203
$("#tofavorite_home").removeClass("active");
$(this).addClass("active");
var id = $(this).attr("id");
var flag = $(this).data("flag");
... ... @@ -213,6 +222,10 @@ layui.define(['table', 'admin', 'form', 'common', 'sessions', 'reslist', 'common
$(".layui-icon-ok").on("click",function (e) {
e.stopPropagation();
var name = $("#name_"+id).val();
if (name.trim() == ''){
layer.msg('收藏夹名称不能为空', {icon: 0, time: 3000});
return;
}
saveFavorite(id,name,parentId,"title_"+id);
});
//编辑收藏夹下取消按钮点击事件 joke add 20200515
... ... @@ -224,7 +237,8 @@ layui.define(['table', 'admin', 'form', 'common', 'sessions', 'reslist', 'common
//删除收藏夹
$(".favorite-icon-del").on("click",function () {
var id = $(this).data("id");
deleteFavorite(id);
var pid = $(this).data("pid");
deleteFavorite(id,pid);
});
}
//判断字符串是否再集合中
... ... @@ -252,7 +266,7 @@ layui.define(['table', 'admin', 'form', 'common', 'sessions', 'reslist', 'common
});
}
//删除收藏夹
function deleteFavorite(id) {
function deleteFavorite(id,pid) {
//确认提示框
layer.confirm('即将删除收藏夹及所有子收藏夹,删除后将无法恢复,您确定要删除吗?', {
btn: ['确定', '取消'] //按钮
... ... @@ -266,6 +280,8 @@ layui.define(['table', 'admin', 'form', 'common', 'sessions', 'reslist', 'common
offset: '15px'
, icon: 1
, time: 1000
},function () {
// loadFavoriteList(pid);
});
}).error(function (error) {
console.log(error);
... ...
... ... @@ -315,7 +315,12 @@ layui.define(['common', 'swiper', 'admin','commonDetail','mxClient','sessions','
layer.msg('暂无告警', {icon: 0});
return false;
}
//不以资源类型不包括父节点的资源类型 包括阿里云、华为云
if("ALI_CLOUD_PLAT"== _resType || "HUAWEI_CLOUD_PLAT" == _resType){
_resType =_resType.substring(0,_resType.lastIndexOf("_"));
}
$(this).attr("lay-href", "/alarm/activewarning/restype=" + _resType + "/level=" + level);
// $(this).trigger();
});
// 点击资源数量
... ...
... ... @@ -1246,7 +1246,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
}
form.render('select');
form.render();
//清空查询条件 joke add 20200409 开始
//清空查询条件 joke add 20200409 结束
var targetId = '';
var searchType = "";
... ... @@ -1376,7 +1376,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
$("#res_minicomputer").parent().parent().removeClass("hide");
var minicomputerStr = '';
minicomputerStr = '<option value="">=小型机服务器=</option>';
let url = `${common.domainName}/api-web/home/res-list/HOST_MINICOMPUTER?access_token=${accessToken}&page=1&limit=30&resCategory=resources`
let url = `${common.domainName}/api-web/home/res-list/hostMinicomputerPartitionParents?access_token=${accessToken}`
$.ajax({
url: url,
method: 'get',
... ... @@ -1399,7 +1399,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
if (targetId && searchType) {
var url = "/api-web/home/res-list/" + searchType + "?page=1&limit=50";
if(searchType == 'MIDDLEWARE_WEBLOGIC'){
url += '&parentId=null'
url += '&parentId=null&parentType=parent'
}
admin.req({
url: common.domainName + url
... ... @@ -1609,7 +1609,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
id: 'layer-select-favorites',
content: '<div class="div-select-favorites"><div id="slt-favorites-tree"></div></div>',
offset: '150px',
area: ['20%', '15%'],
area: ['20%', '25%'],
btn: ['选择', '取消'],
resize: false,
success: function () {
... ... @@ -1622,7 +1622,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
clickClose: true,
autoRow: true,
filterable: true,
height: 'auto',
height: '200px',
toolbar: {
show: true,
},
... ... @@ -1636,7 +1636,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
showFolderIcon: true,
showLine: true,
indent: 20,
expandedKeys: [-3],
expandedKeys: true,
strict: false
},
data: data
... ...
... ... @@ -79,7 +79,7 @@
<div class="card-main">
<div class="layui-btn-group favorites-btngroup" style="z-index: 99">
<i class="layui-icon favorite-icon-edit" title="编辑" data-id="{{item.favId}}" data-pid="{{item.parentId}}">&#xe642;</i>
<i class="layui-icon favorite-icon-del" title="删除" data-id="{{item.favId}}">&#xe640;</i>
<i class="layui-icon favorite-icon-del" title="删除" data-id="{{item.favId}}" data-pid="{{item.parentId}}">&#xe640;</i>
</div>
<div class="favorite-icon" data-id="{{item.favId}}" data-pid="{{item.parentId}}" data-child="{{item.childNum}}"
data-name="{{item.favName}}" data-res="{{item.resNum}}">
... ...
... ... @@ -159,13 +159,13 @@
</div>
</div>
</div>
<div class="layui-inline hide" >
<div class="layui-input-inline">
<select name="label" id="res_sub_restype" lay-filter="sub_restype">
<option value="">=资源类型=</option>
</select>
</div>
</div>
<!-- <div class="layui-inline hide" >-->
<!-- <div class="layui-input-inline">-->
<!-- <select name="label" id="res_sub_restype" lay-filter="sub_restype">-->
<!-- <option value="">=资源类型=</option>-->
<!-- </select>-->
<!-- </div>-->
<!-- </div>-->
<div class="layui-inline hide">
<div class="layui-input-inline">
<select name="label" id="res_vendor" lay-filter="res_vendor">
... ...
... ... @@ -58,4 +58,11 @@ custom-class="config-dialog"
}
.button-more{
position: absolute;right: 0;top: 33px;z-index: 1;background: #f5f7fa;width: 80px; padding: 10px;
}
.breadcrumb .el-breadcrumb{
background: #ffffff;
padding: 20px 5px 0;
}
.breadcrumb .el-breadcrumb .el-breadcrumb__item{
cursor: pointer;
}
\ No newline at end of file
... ...
... ... @@ -91,6 +91,17 @@
</div>
<!--列表-->
<div v-if="activeBtn == 'list'">
<el-row>
<el-col :span="24" class="breadcrumb">
<el-breadcrumb :separator-icon="ArrowRight">
<template v-for="(item,index) in breadcrumbList">
<el-breadcrumb-item :key="index" v-if="item.data.name" @click="nodeClick(item, item.data)">{{item.data.name}}</el-breadcrumb-item>
</template>
</el-breadcrumb>
</el-col>
</el-row>
<cm-table-page :columns="columns" :dataList="dataList" @loaddata="getPage" :showIndex="true"
:showBorder="false" :showSelection="false" :showTools="isEditName"
:showPage="false" :height="height - 54">
... ...
... ... @@ -132,6 +132,11 @@ export default {
let historyNode = Vue.ref([]);
let isUserFolder = Vue.ref(false);
/*面包屑路径数据
* lu
*/
let breadcrumbList=Vue.ref([]);
let addHistoryNode = (item) => {
if (item.name == undefined && item.fileName) {
... ... @@ -148,6 +153,8 @@ export default {
arr.push(item);
historyNode.value = arr;
}
breadcrumbList.value.push({data:item});
console.log("breadcrumbList",breadcrumbList.value)
currentNodeData.value = item;
}
... ... @@ -307,8 +314,14 @@ export default {
let arr = [];
arr.push(id);
defaultExpandedKeys.value = arr;
let indexSlice='';
let arrList= breadcrumbList.value;
arrList.map((item,index)=>{
if(id == item.data.id){
indexSlice=index
}
})
breadcrumbList.value=arrList.slice(0,indexSlice)
addHistoryNode(data);
getPage(id);
... ... @@ -866,6 +879,7 @@ export default {
return {
/* viewEdit,*/
breadcrumbList,
editFileName,
isInput,
iconclass,
... ...
... ... @@ -43,9 +43,15 @@
<i class="layui-icon layui-icon-shrink-right" id="LAY_app_flexible"></i>
</a>
</li>
<li class="layui-nav-item" lay-tips="大屏">
<a href="javascript:;" layadmin-event="toBigScreen" ><img src="/src/style/img/icon-daping.png" style="width: 16px;height: 16px"></a>
</li>
<!--判定是否有daping角色,如果有则显示该菜单 joke add 20211203-->
<script type="text/html" template lay-url="{{sessionStorage.getItem('domainName')}}/api-user/users/checkHasRole?roleCode=daping">
{{# if(d.count > 0){ }}
<li class="layui-nav-item" lay-tips="大屏">
<a href="javascript:;" layadmin-event="toBigScreen" ><img src="/src/style/img/icon-daping.png" style="width: 16px;height: 16px"></a>
</li>
{{# } }}
</script>
<script type="text/html" template lay-url="{{sessionStorage.getItem('domainName')}}/api-web/sxview/getbizListByUser?access_token={{localStorage.getItem('access_token')}}">
{{# if(d.data.length>0){ }}
... ...
... ... @@ -18,7 +18,7 @@ export default {
return {
timer:null,
domainName:sessionStorage.getItem('domainName'),
apiUrl:'/api-web/sxview/getbizListByUser?access_token=',
apiUrl:'/api-web/sxview/getBizListForHzDp?access_token=',
checkId:0,//当前选中的tabs
listItem:1,//轮播数-总页数
pageSize:5,//每页显示5条数据
... ...