Authored by 赵鹏军

Merge remote-tracking branch 'origin/master'

Showing 25 changed files with 303 additions and 158 deletions
... ... @@ -2546,17 +2546,17 @@ layui.define(['soulTable', 'commonDetail', 'common', 'laytpl', 'view', 'admin',
},
{field: 'health', title: '健康状态', minWidth: x_110, align: 'center', sort: true, templet: '#healthTpl'},
// {field: 'diskSize', title: '磁盘总大小', minWidth: 120, align: 'center'},
{field: 'fileSysUseRate', title: '文件系统使用率(最大)', align: 'center', minWidth: x_185, templet: '#fileUseRateTpl', sort: true},
{field: 'diskBusyRate', title: '磁盘繁忙率(最大)', minWidth: x_160, align: 'center', sort: true, templet: '<div>{{d.diskBusyRate}}%</div>'},
{field: 'cpuCores', title: '单个CPU核数', align: 'center', minWidth: x_140, sort: true, templet: '#cpuCoresTpl'},
{field: 'cpuNum', title: '主机CPU总核数', align: 'center', minWidth: x_150, sort: true, templet: '#cpuNumTpl'},
{field: 'cpuRate', title: 'CPU使用率', align: 'center', minWidth: x_120, templet: '#cpuRateTpl', sort: true},
// {field: 'fileSysUseRate', title: '文件系统使用率(最大)', align: 'center', minWidth: x_185, templet: '#fileUseRateTpl', sort: true},
// {field: 'diskBusyRate', title: '磁盘繁忙率(最大)', minWidth: x_160, align: 'center', sort: true, templet: '<div>{{d.diskBusyRate}}%</div>'},
// {field: 'cpuCores', title: '单个CPU核数', align: 'center', minWidth: x_140, sort: true, templet: '#cpuCoresTpl'},
// {field: 'cpuNum', title: '主机CPU总核数', align: 'center', minWidth: x_150, sort: true, templet: '#cpuNumTpl'},
// {field: 'cpuRate', title: 'CPU使用率', align: 'center', minWidth: x_120, templet: '#cpuRateTpl', sort: true},
{field: 'memorySize', title: '内存大小', align: 'center', minWidth: x_110, sort: true, templet: '<div>{{d.memorySize}} GB</div>'},
{field: 'cacheUsed', title: '缓存总大小', align: 'center', minWidth: x_120, sort: true, templet: '<div>{{d.cacheUsed}} GB</div>'},
{field: 'memoryRate', title: '内存使用率', align: 'center', minWidth: x_120, templet: '#memoryRateTpl', sort: true},
{field: 'vmmemoryUseRate', title: '虚拟内存使用率', align: 'center', minWidth: x_165, templet: '#vmmemoryRateTpl', sort: true},
{field: 'maxNetCardUpRate', title: '上行速率', align: 'center', minWidth: x_110, sort: true, templet: '<div>{{d.maxNetCardUpRate}} kb/s</div>'},
{field: 'maxNetCardDownRate', title: '下行速率', align: 'center', minWidth: x_110, sort: true, templet: '<div>{{d.maxNetCardDownRate}} kb/s</div>'},
// {field: 'cacheUsed', title: '缓存总大小', align: 'center', minWidth: x_120, sort: true, templet: '<div>{{d.cacheUsed}} GB</div>'},
// {field: 'memoryRate', title: '内存使用率', align: 'center', minWidth: x_120, templet: '#memoryRateTpl', sort: true},
// {field: 'vmmemoryUseRate', title: '虚拟内存使用率', align: 'center', minWidth: x_165, templet: '#vmmemoryRateTpl', sort: true},
// {field: 'maxNetCardUpRate', title: '上行速率', align: 'center', minWidth: x_110, sort: true, templet: '<div>{{d.maxNetCardUpRate}} kb/s</div>'},
// {field: 'maxNetCardDownRate', title: '下行速率', align: 'center', minWidth: x_110, sort: true, templet: '<div>{{d.maxNetCardDownRate}} kb/s</div>'},
{field: 'lastColTime', title: '最近采集时间', minWidth: x_160, align: 'center', sort: true},
{field: 'linkState', title: '连接状态', align: 'center', minWidth: x_110, templet: '#linkStateTpl', sort: true},
{field: 'adminName', title: '负责人', minWidth: x_120, align: 'center', sort: true},
... ... @@ -2572,17 +2572,17 @@ layui.define(['soulTable', 'commonDetail', 'common', 'laytpl', 'view', 'admin',
},
{field: 'health', title: '健康状态', minWidth: x_110, align: 'center', sort: true, templet: '#healthTpl'},
// {field: 'diskSize', title: '磁盘总大小', minWidth: 120, align: 'center'},
{field: 'fileSysUseRate', title: '文件系统使用率(最大)', align: 'center', minWidth: x_185, templet: '#fileUseRateTpl', sort: true},
{field: 'diskBusyRate', title: '磁盘繁忙率(最大)', minWidth: x_160, align: 'center', sort: true, templet: '<div>{{d.diskBusyRate}}%</div>'},
{field: 'cpuCores', title: '单个CPU核数', align: 'center', minWidth: x_140, sort: true, templet: '#cpuCoresTpl'},
{field: 'cpuNum', title: '主机CPU总核数', align: 'center', minWidth: x_150, sort: true, templet: '#cpuNumTpl'},
{field: 'cpuRate', title: 'CPU使用率', align: 'center', minWidth: x_120, templet: '#cpuRateTpl', sort: true},
// {field: 'fileSysUseRate', title: '文件系统使用率(最大)', align: 'center', minWidth: x_185, templet: '#fileUseRateTpl', sort: true},
// {field: 'diskBusyRate', title: '磁盘繁忙率(最大)', minWidth: x_160, align: 'center', sort: true, templet: '<div>{{d.diskBusyRate}}%</div>'},
// {field: 'cpuCores', title: '单个CPU核数', align: 'center', minWidth: x_140, sort: true, templet: '#cpuCoresTpl'},
// {field: 'cpuNum', title: '主机CPU总核数', align: 'center', minWidth: x_150, sort: true, templet: '#cpuNumTpl'},
// {field: 'cpuRate', title: 'CPU使用率', align: 'center', minWidth: x_120, templet: '#cpuRateTpl', sort: true},
{field: 'memorySize', title: '内存大小', align: 'center', minWidth: x_110, sort: true, templet: '<div>{{d.memorySize}} GB</div>'},
{field: 'cacheUsed', title: '缓存总大小', align: 'center', minWidth: x_120, sort: true, templet: '<div>{{d.cacheUsed}} GB</div>'},
{field: 'memoryRate', title: '内存使用率', align: 'center', minWidth: x_120, templet: '#memoryRateTpl', sort: true},
{field: 'vmmemoryUseRate', title: '虚拟内存使用率', align: 'center', minWidth: x_165, templet: '#vmmemoryRateTpl', sort: true},
{field: 'maxNetCardUpRate', title: '上行速率', align: 'center', minWidth: x_110, sort: true, templet: '<div>{{d.maxNetCardUpRate}} kb/s</div>'},
{field: 'maxNetCardDownRate', title: '下行速率', align: 'center', minWidth: x_110, sort: true, templet: '<div>{{d.maxNetCardDownRate}} kb/s</div>'},
// {field: 'cacheUsed', title: '缓存总大小', align: 'center', minWidth: x_120, sort: true, templet: '<div>{{d.cacheUsed}} GB</div>'},
// {field: 'memoryRate', title: '内存使用率', align: 'center', minWidth: x_120, templet: '#memoryRateTpl', sort: true},
// {field: 'vmmemoryUseRate', title: '虚拟内存使用率', align: 'center', minWidth: x_165, templet: '#vmmemoryRateTpl', sort: true},
// {field: 'maxNetCardUpRate', title: '上行速率', align: 'center', minWidth: x_110, sort: true, templet: '<div>{{d.maxNetCardUpRate}} kb/s</div>'},
// {field: 'maxNetCardDownRate', title: '下行速率', align: 'center', minWidth: x_110, sort: true, templet: '<div>{{d.maxNetCardDownRate}} kb/s</div>'},
{field: 'lastColTime', title: '最近采集时间', minWidth: x_160, align: 'center', sort: true},
{field: 'linkState', title: '连接状态', align: 'center', minWidth: x_110, templet: '#linkStateTpl', sort: true},
{field: 'adminName', title: '负责人', minWidth: x_120, align: 'center', sort: true},
... ...
... ... @@ -853,16 +853,25 @@ layui.define(['table', 'form', 'admin', 'layer', 'upload', 'common', 'sessions',
},
yes: function (index, layero) {
var password = $('#userReSetPwd').val();
var flag = false;
//验证密码等级是否满足
var flag = new RegExp(pattern).test(password);
if (!flag){
$('.deptTips').html(patternTips.replace('密码格式为:',''));
return;
}
if (checkHas(passwords,password)){
$('.deptTips').html('不能使用最近5次密码');
return;
if (pattern != ''){
flag = new RegExp(pattern).test(password);
if (!flag){
$('.deptTips').html(patternTips.replace('密码格式为:',''));
return;
}
}else{
if (password.trim().length <4 || password.trim().length >20){
$('.deptTips').html('密码必须为4-20位!');
return;
}
}
//管理员重置密码,不用做最近5次验证
// if (checkHas(passwords,password)){
// $('.deptTips').html('不能使用最近5次密码');
// return;
// }
resetPwd(id,password);
}
});
... ...
... ... @@ -73,16 +73,22 @@
form.verify((function(pattern, patternTips,last5His) {
return {
pass: function (value) {
if (value === ''){
if (value.trim() === ''){
return '必填项不能位空';
}
if (value === $('#oldPassword').val()){
if (value.trim() === $('#oldPassword').val()){
return '新密码不能与旧密码一致';
}
if(pattern && !new RegExp(pattern).test(value)){
if(pattern && !new RegExp(pattern).test(value.trim())){
return patternTips;
}
if (!pattern || pattern == undefined){
if (value.trim().length <4 || value.trim().length >20){
return '新密码必须4-20位!';
}
}
//临时增加用户组写死密码 joke add 20210508
if (last5His && last5His.length > 0 && checkHas(last5His,value)){
return '不能使用最近5次密码';
... ... @@ -186,7 +192,7 @@
var last5His = passwords;
verifyForm(pattern, patternTips,last5His);
} else {
layer.msg('没有获取去密码级别,将不做密码级别验证!', {icon: 0});
console.log('没有获取去密码级别,将不做密码级别验证!');
verifyForm(undefined, undefined,passwords);
}
}
... ...
... ... @@ -324,6 +324,10 @@ export default {
}, 1000)
if(!isAllSelect){
proxy.selectText='全选'
isAllSelect=true;
}
}
... ... @@ -334,11 +338,11 @@ export default {
*/
let deleteDocument = (id, type) => {
let url = `/inspection-report/file/change`;
let url = `/inspection-report/file/change?status=0`;
let msg = "您确认将该文件放入回收站?";
if (props.isRecycle) {
msg = "您确认永久删除该文件?";
url = `/inspection-report/file/delete`;
url = `/inspection-report/file/delete?status=1`;
}
let info = [];
... ... @@ -412,7 +416,7 @@ export default {
proxy.$global.confirm("是否还原选择的文件?", function () {
proxy.$http.post(`/inspection-report/file/restore`, info, function (res) {
proxy.$http.post(`/inspection-report/file/restore?status=1`, info, function (res) {
if (res && res.code == 0) {
proxy.$global.showMsg('还原成功!');
if (props.isRecycle) {
... ... @@ -622,6 +626,7 @@ export default {
* 文件下载
*/
let downloadFile = () => {
let status = props.isRecycle?1:0;
let arr = getCheckedFile();
let info = [];
... ... @@ -638,7 +643,7 @@ export default {
fileName:fileNameData
}
proxy.$http.downloadFile('/inspection-report/file/download', params);
proxy.$http.downloadFile('/inspection-report/file/download?status=' + status, params);
}
/**
... ...
... ... @@ -64,9 +64,9 @@ export default {
'.jpeg',
'.jpg',
'.json',
'.mp2',
'.mp3',
'.mp4',
// '.mp2',
// '.mp3',
// '.mp4',
'.mpeg',
'.mpg',
'.mpp',
... ...
... ... @@ -201,29 +201,38 @@ global.openCmdbAssets = (resTypeId, resId, proxy) => {
});
}
global.openDetail = (resId, resType, title) => {
// let url = `/#/res/resDetail/view/resId=${resId}`;
let url = window.top.location.href.split('/#')[0] + `/#/res/resDetail/view/resId=${resId}`;
if(resType){
url += '/resType=' + resType
}
if(title){
url += '/title=' + title
}
let lyaui = window.parent.layui;
global.openDetail = (resId, resType, proxy) => {
let lyaui = global.layui;
debugger
let editFlag = false;
let provider = '';
let name= 'test';
let name= '';
let ip = '';
let resTypeName = '';
let adminName = '';
let manageIp = '';
let collProtocol = '';
lyaui.commonCols.detailPage(resId, resType,editFlag,provider,name,ip,resTypeName,adminName,manageIp,collProtocol);
// 获取资源详情
proxy.$http.get(`/api-web/v32/res/detail/${resId}`, {}, function (res) {
if (res && res.map) {
let data = res.map;
provider = data.provider;
ip = data.ip;
resTypeName = data.resTypeName;
adminName = data.adminName;
manageIp = data.manageIp;
collProtocol = data.collProtocol;
name = data.resName;
lyaui.commonCols.detailPage(resId, resType,editFlag,provider,name,ip,resTypeName,adminName,manageIp,collProtocol);
}
});
}
... ...
<el-link type="info" :underline="false" @click="openCmdbAssets"> {{textString}}</el-link>
... ...
export default {
name: 'assetsComponents',
template: '',
components: {},
props: {
// 资源名称
textString: {
type: String,
default: 0
},
// 展示文字 收藏、拓扑、资产 'start,topo,assets'
start: {
type: Boolean,
default: true
},
topo: {
type: Boolean,
default: true
},
assets: {
type: Boolean,
default: true
},
resId: {
type: String,
default: ''
},
resTypeId: {
type: String,
default: ''
},
resType: {
type: String,
default: ''
},
optionData: {
type: Array,
default: []
}
},
data() {
return {}
},
setup(props, {attrs, slots, emit}) {
const {proxy} = Vue.getCurrentInstance();
let openCmdbAssets = () => {
if (props.resId == '') {
proxy.$global.showMsg("资源编号不存在,请确认!","warning")
return;
}
if (props.resTypeId == '') {
proxy.$global.showMsg("资源类型不存在,请确认!","warning")
return;
}
proxy.$global.openCmdbAssets(props.resTypeId, props.resId, proxy);
}
return {
openCmdbAssets
}
}
}
... ...
... ... @@ -5,8 +5,8 @@
:stroke-width="20"
:percentage="textValue"
:status="status">
<span>{{textValue == '' ? ' ' : textValue }} %</span>
<span>{{textValue == '' ? ' ' : textValue + '%' }}</span>
</el-progress>
</div>
<div style="width: 50px">{{textString == '' ? ' - ' : textString }} </div>
<div style="width: 50px">{{textString == '' ? '' : textString }} </div>
</div>
... ...
<div>
<el-dropdown>
<span class="el-dropdown-link" @click="openDetail" >
<span class="el-dropdown-link" @click="openDetail" style="cursor:pointer">
{{textString}}
<i class="el-icon-arrow-down" style="color: blue;font-weight: bold;" />
</span>
... ...
... ... @@ -75,7 +75,7 @@ export default {
favData.value = arr;
dialogFlg.value = flg;
} else {
proxy.$global.showMsg("没有查询到收藏夹,请先添加!","warning")
proxy.$global.showMsg("没有查询到收藏夹,请先添加!", "warning")
}
});
} else {
... ... @@ -91,7 +91,7 @@ export default {
*/
let saveStart = () => {
if (props.resId == '') {
proxy.$global.showMsg("资源编号不存在,请确认!","warning")
proxy.$global.showMsg("资源编号不存在,请确认!", "warning")
return;
}
... ... @@ -99,18 +99,18 @@ export default {
favIds: favIds.value.join(','),
resId: props.resId
}
proxy.$http.post(`/api-web/favorites/save/fav`, params, function (res) {
proxy.$http.post(`/api-web/favorites/save/fav?favIds=${params.favIds}&resId=${params.resId}`, {}, function (res) {
if (res && res.success) {
proxy.$global.showMsg("收藏成功!")
proxy.$global.showMsg("收藏成功!");
showDialog(false);
}
});
}
let openTopoPage = () => {
if (props.resId == '') {
proxy.$global.showMsg("资源编号不存在,请确认!","warning")
proxy.$global.showMsg("资源编号不存在,请确认!", "warning")
return;
}
... ... @@ -119,21 +119,21 @@ export default {
let openDetail = () => {
if (props.resId == '') {
proxy.$global.showMsg("资源编号不存在,请确认!","warning")
proxy.$global.showMsg("资源编号不存在,请确认!", "warning")
return;
}
proxy.$global.openDetail(props.resId,props.resType,props.title);
proxy.$global.openDetail(props.resId, props.resType, proxy);
}
let openCmdbAssets = () => {
if (props.resId == '') {
proxy.$global.showMsg("资源编号不存在,请确认!","warning")
proxy.$global.showMsg("资源编号不存在,请确认!", "warning")
return;
}
if (props.resTypeId == '') {
proxy.$global.showMsg("资源类型不存在,请确认!","warning")
proxy.$global.showMsg("资源类型不存在,请确认!", "warning")
return;
}
... ...
... ... @@ -79,6 +79,7 @@
<el-option label="使用率组件" :value="'rateComponents'"></el-option>
<el-option label="机房组件" :value="'machineRoomComponents'"></el-option>
<el-option label="机柜组件" :value="'machineRoomDetailComponents'"></el-option>
<el-option label="资产信息" :value="'assetsComponents'"></el-option>
</el-select>
</div>
... ...
... ... @@ -209,6 +209,10 @@ export default {
'machineRoomDetailComponents': Vue.defineAsyncComponent(
() => myImport('components/page/res/machineRoomDetailComponents/index')
),
'assetsComponents': Vue.defineAsyncComponent(
() => myImport('components/page/res/assetsComponents/index')
),
},
data() {
return {
... ...
... ... @@ -59,7 +59,7 @@
<cm-biz-type-tree-input multiple clearable collapseTags @callback="getBizType"/>
</el-dropdown>-->
<el-select v-model="busTypeArr" multiple filterable clearable collapse-tags placeholder="请选择指标" style="margin-top: 10px">
<el-select v-model="busTypeArr" multiple filterable clearable collapse-tags placeholder="请选择业务" style="margin-top: 10px">
<el-option
v-for="item in busTypeList"
:label="item.busTypeName" :value="item.busId"></el-option>
... ...
... ... @@ -125,6 +125,7 @@ export default {
var id = proxy.$global.getQueryVariable('configId') ;
let isSign = Vue.ref(id);//是否编辑 true为编辑,false为新增
let resTypeArr = Vue.ref([]);
let kpiTypeArr = Vue.ref([]);
let busTypeArr = Vue.ref([]);
... ... @@ -166,7 +167,6 @@ export default {
let getResType = (arr) => {
console.log(arr);
var types = arr.map(function (v) {
return v.id;
});
... ... @@ -174,7 +174,6 @@ export default {
loeadTable();
}
let getKpiType = (arr) => {
console.log(arr);
var types = arr.map(function (v) {
e
return v.kpiId;
... ... @@ -183,7 +182,6 @@ export default {
loeadTable();
}
let getBizType = (arr) => {
console.log(arr);
var types = arr.map(function (v) {
return v.busId;
});
... ... @@ -199,8 +197,8 @@ export default {
kpiId: kpiTypeArr.value.join(','),
busId: busTypeArr.value.join(','),
configId: config.value,
page:2,
limit:10
page: 1,
limit: 50
}
}
... ... @@ -208,13 +206,14 @@ export default {
// if (!reload && tabFirstList.value.length > 0) {
// return false;
// }
proxy.$http.get(`/api-web/ContrastAnalysis/added`, getParams(), function (res) {
if (res && res.data) {
proxy.countFirst=res.count;
tabFirstList.value = res.data;
}
});
if(isSign.value){//true为编辑,false为新增
proxy.$http.get(`/api-web/ContrastAnalysis/added`, getParams(), function (res) {
if (res && res.success) {
proxy.countFirst = res.count;
tabFirstList.value = res.data;
}
});
}
}
let loadSecondList = (reload) => {
... ... @@ -222,8 +221,8 @@ export default {
// return false;
// }
proxy.$http.get(`/api-web/ContrastAnalysis/notAdded`, getParams(), function (res) {
if (res && res.data) {
proxy.count=res.count;
if (res && res.success) {
proxy.count = res.count;
tabSecondList.value = res.data;
}
});
... ... @@ -268,8 +267,7 @@ export default {
let addRes = (row, index) => {
tabFirstList.value.push(row);
activeName.value = 'first'
//proxy.$global.showMsg("添加成功!");
proxy.$global.showMsg("添加成功!");
// 加载折线图
getChartData();
... ...
... ... @@ -1494,13 +1494,13 @@ export default {
Vue.onMounted(() => {
})
const goDetail=(item)=>{
proxy.allowClickData.map((itemName,index)=>{
if(item.name==itemName){
// proxy.allowClickData.map((itemName,index)=>{
// if(item.name==itemName){
proxy.isDetailShow=true;
console.log("detail",item)
proxy.detailData=item;
}
})
// }
// })
}
... ...
... ... @@ -263,12 +263,12 @@ export default {
})
const goDetail=(item)=>{
proxy.allowClickData.map((itemName,index)=>{
if(item.name==itemName){
// proxy.allowClickData.map((itemName,index)=>{
// if(item.name==itemName){
proxy.isDetailShow=true;
proxy.detailData=item;
}
})
// }
// })
}
return{
... ...
... ... @@ -313,12 +313,12 @@ export default {
})
const goDetail=(item)=>{
proxy.allowClickData.map((itemName,index)=>{
if(item.name==itemName){
// proxy.allowClickData.map((itemName,index)=>{
// if(item.name==itemName){
proxy.isDetailShow=true;
proxy.detailData=item;
}
})
// }
// })
}
return{
... ...
... ... @@ -12,7 +12,7 @@
<div class='img-serve' >
<img src="/vue3/src/assets/images/machineRoom/icon-state.png" alt="" class='state'>
<div class='img-serve-text'>{{item.name}}</div>
<div class='img-serve-text'>{{item.provider}}</div>
<div class='lamp'>
<img src="/vue3/src/assets/images/machineRoom/icon-weblogical.png" alt="" class='img-weblog'>
<div class='img-lamp'>
... ... @@ -54,7 +54,7 @@
<p>品 牌:{{deviceDataInfo.brandName}}</p>
<p>型 号:{{deviceDataInfo.model}}</p>
<p>序 列 号:{{deviceDataInfo.serialNumber}}</p>
<p>业 务 IP:{{deviceDataInfo.ServiceIP}}</p>
<p>业 务 IP:{{deviceDataInfo.ip}}</p>
<p>用 途:{{deviceDataInfo.purpose}}</p>
</div>
</div>
... ...
... ... @@ -16,23 +16,23 @@ export default {
deviceDataInfo:'',//设备详细信息
deviceDatas: [
{
name:'E12',
name:'E12',//机柜名称
cabinetCapacity :'42U',
deviceData:[
cabinetCapacity :'42U',//机柜总U位数-目前都是42U
deviceData:[//机柜所有的服务器
{
name:'物理服务器',
resName:'管理决策二包(数据集市39)',
brandName:'浪潮',
model:'TS860',
serialNumber:'216365930',
ServiceIP:'80.12.73.39',
purpose:'管理决策二包使用',
uPosition:'1-8U',
name:'物理服务器',//服务器名称
resName:'管理决策二包(数据集市39)',//服务器资源名称
brandName:'浪潮',//品牌
model:'TS860',//型号
serialNumber:'216365930',//序列号
ServiceIP:'80.12.73.39',//业务ip
purpose:'管理决策二包使用',//用途
uPosition:'1-8U',//U位
}
],
deviceNum:'1',
alarmNum:'0'
deviceNum:'1',//设备数量
alarmNum:'0'//警告量
},
{
name:'E13',
... ... @@ -168,37 +168,67 @@ export default {
setup(props, {attrs, slots, emit}) {
const {proxy} = Vue.getCurrentInstance();
const isShowDevice=Vue.ref(false);
const theirRoom=Vue.ref('');//机房名称
const CabinetNum=props.detailData.name;//机柜编号
// 挂载完
Vue.onMounted(() => {
if(props.machineData.name.indexOf('huzhou')!=-1){
proxy.isCenter=true;
proxy.theirRoom='湖州灾备';
}else{
proxy.isCenter=false;
proxy.theirRoom='兴议机房';
}
proxy.getDeviceInfo();
proxy.getData();
// proxy.getDeviceInfo();
})
const getData=()=>{
let parmas={
theirRoom:proxy.theirRoom,
theirCabinet:CabinetNum
}
$.get(proxy.domainName+'/api-web/v32/res/cabinet?access_token='+proxy.accessToken,parmas,function (res){
console.log("res1",res)
if(res){
let resData=res.data;
let deviceDatas=[];
deviceDatas.push({
name:CabinetNum,//机柜名称
cabinetCapacity :'42U',//机柜总U位数-目前都是42U
deviceNum:resData.length,//设备数量
alarmNum:'0',//警告量
deviceData:resData
})
proxy.deviceDatas=deviceDatas;
console.log("devdats",proxy.deviceDatas)
proxy.getDeviceInfo()
}
})
}
const getDeviceInfo=()=>{
proxy.deviceDatas.map((item,index)=>{
if(CabinetNum==item.name){
proxy.infoData=item;
proxy.serviceData=item.deviceData
item.deviceData.map((itemD,indexD)=>{
let strArr=itemD.uPosition.split("U");//[0]1-4 [1]U
let leftStrArr=strArr[0].split('-');//[0]1 [1]4
let leftStr=leftStrArr[0];
let rightStr=leftStrArr[1];
// let strArr=itemD.uPosition.split("U");//[0]1-4 [1]U
// let leftStrArr=strArr[0].split('-');//[0]1 [1]4
let leftStr=itemD.startU;//leftStrArr[0];
let rightStr=itemD.endU;//leftStrArr[1];
itemD.serviceHeight=rightStr;//nU的设备
let serveNum=1;
if(leftStr==1){
serveNum=rightStr
}else{
serveNum=rightStr-leftStr;
// if(leftStr==1){
// serveNum=rightStr
// }else{
serveNum=rightStr-leftStr+1;
}
// }
itemD.serviceClass='img-serve-'+serveNum;//设备的css的class
itemD.uClass='';
if(leftStr>1){
... ... @@ -219,7 +249,9 @@ export default {
return{
showDevice,
isShowDevice,
getDeviceInfo
getDeviceInfo,
getData,
theirRoom
}
}
}
\ No newline at end of file
... ...
... ... @@ -26,7 +26,7 @@ export default {
detailData:'',//详情数据
htmlName:'xiaoshansecond',
machineData:this.src,
allowClickData:['E12','E13'],//允许进入详情的机柜
allowClickData:['E12','E13','F14'],//允许进入详情的机柜
tableData:[
[
... ... @@ -477,12 +477,12 @@ export default {
})
const goDetail=(item)=>{
proxy.allowClickData.map((itemName,index)=>{
if(item.name==itemName){
// proxy.allowClickData.map((itemName,index)=>{
// if(item.name==itemName){
proxy.isDetailShow=true;
proxy.detailData=item;
}
})
// }
// })
}
return{
... ...
... ... @@ -1082,12 +1082,12 @@ export default {
})
const goDetail=(item)=>{
proxy.allowClickData.map((itemName,index)=>{
if(item.name==itemName){
// proxy.allowClickData.map((itemName,index)=>{
// if(item.name==itemName){
proxy.isDetailShow=true;
proxy.detailData=item;
}
})
// }
// })
}
return{
... ...
... ... @@ -621,12 +621,12 @@ export default {
})
const goDetail=(item)=>{
proxy.allowClickData.map((itemName,index)=>{
if(item.name==itemName){
// proxy.allowClickData.map((itemName,index)=>{
// if(item.name==itemName){
proxy.isDetailShow=true;
proxy.detailData=item;
}
})
// }
// })
}
return{
... ...
... ... @@ -13,13 +13,12 @@
<div style="height: 50px;text-align: left;margin-left: 10px;margin-top: 10px;display: flex">
<div style="width: calc(100% - 100px)">
<el-form :inline="true" :model="searchForm" class="demo-form-inline">
<el-form-item label="资源名称">
<el-input v-model="searchForm.resName" placeholder="请输入资源名称"></el-input>
<el-form-item v-for="searchInfo in obj.searchList" :label="searchInfo.name">
<el-input v-model="searchForm[searchInfo.key]" placeholder="请输入资源名称"></el-input>
</el-form-item>
<el-form-item>
<el-button @click="onSubmit">查询</el-button>
<el-button @click="loadResList">查询</el-button>
</el-form-item>
</el-form>
</div>
... ... @@ -30,34 +29,21 @@
<cm-table-page :columns="obj.columns" :dataList="obj.maps" @loaddata="getPage" :showIndex="true"
:showBorder="true" :currentPage="currentPage" :total="total" :loading="false"
:showPage="true" :height="(height - 95)" :maxWidth="max">
:showPage="true" :height="(height - 95)"
:maxWidth="max">
<template #default="{row,prop,column}">
<component v-if="row[prop] && row[prop].props && row[prop].props.colComponents != null && row[prop].props.colComponents != ''" v-bind:is="row[prop].props.colComponents"
:resId="row.resId"
:resTypeId="currentNode.id"
:textString="row[prop] == undefined ? '' : row[prop].value"
:optionData="row"></component>
<el-link v-else :underline="false" @click="item.click(scope.row)">{{row[prop] == undefined ? '' : row[prop].value }}</el-link>
<el-link v-else :underline="false" @click="item.click(scope.row)">{{row[prop].value == undefined ? '' : row[prop].value }}</el-link>
</template>
</cm-table-page>
</div>
</el-col>
</el-row>
<cm-dialog :title="cellDetail.prop == 'cabinetNo' ? '机柜详情' : cellDetail.title" width="80%" :showDialogVisible="dialogFlg" :showFooter="false" @hidedialog="showDialog" :showOkBtn="false" cancelText="关闭">
<template v-slot>
<div v-if="cellDetail.prop == 'cabinetNo'" @click="openCabinet(false)" :style="{'background-image': 'url(' + cabinetNoSrc + ')'}" style=";height: 600px;background-repeat: no-repeat;background-position: center;background-size: 93% 100%;">
<!--<div style="font-weight: bold;font-size: 20px;">
{{cellDetail.row[cellDetail.prop]}}
</div>-->
</div>
<div v-if="cellDetail.prop == 'resPositon'" @click="openCabinet(false)" style="background-image: url('/vue3/src/assets/images/res/img02.jpg');height: 600px;background-repeat: no-repeat;background-position: center;background-size: 80%;">
<div style="font-weight: bold;font-size: 20px;">
<!--{{cellDetail.row[cellDetail.prop]}}布局图-->
</div>
</div>
</template>
</cm-dialog>
<cm-dialog :title="configObj.title" width="80%" :showDialogVisible="showConfig" :showFooter="false" @hidedialog="showConfigDialog" :showOkBtn="false" cancelText="关闭">
<template v-slot>
... ...
... ... @@ -34,6 +34,15 @@ export default {
'statusComponents': Vue.defineAsyncComponent(
() => myImport('components/page/res/statusComponents/index')
),
'machineRoomComponents': Vue.defineAsyncComponent(
() => myImport('components/page/res/machineRoomComponents/index')
),
'machineRoomDetailComponents': Vue.defineAsyncComponent(
() => myImport('components/page/res/machineRoomDetailComponents/index')
),
'assetsComponents': Vue.defineAsyncComponent(
() => myImport('components/page/res/assetsComponents/index')
),
},
data() {
return {
... ... @@ -54,7 +63,7 @@ export default {
const currentNode = Vue.ref({});
// 搜索框内容
const searchForm = Vue.ref({
resName: ''
});
// 单元格点及保存的数据
... ... @@ -89,12 +98,17 @@ export default {
});
}
let page = Vue.ref(1);
let limit = Vue.ref(10);
let loadResList = () => {
if (currentNode.value) {
let fv = searchForm.value;
// 查询参数
let params = {
page: 1,
limit: 10,
page: page.value,
limit: limit.value,
treeNodeId: currentNode.value.id,
query: {}
}
... ... @@ -135,6 +149,16 @@ export default {
}
}
let getPage = (pageInfo) =>{
console.log(pageInfo);
debugger;
page.value = pageInfo.page;
limit.value = pageInfo.limit;
loadResList()
}
// 配置页面
const {showConfig, configObj, showConfigDialog} = configPage()
... ... @@ -164,6 +188,7 @@ export default {
cabinetNoSrc,
total,
max,
getPage,
// 配置页面
showConfig, configObj, showConfigDialog
... ...