Authored by XuHaoJie

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

... ... @@ -498,6 +498,24 @@ export default {
return localStorage.getItem('lgn') == 'admin';
}
/**
* TODO
* @param item
* @param index
*/
let clickTopNav = (item,index) =>{
let arr = historyNode.value;
// // 删除当前节点后面的路径
// arr.filter(function (v,i) {
// if(i > index){
// arr.splice(i,1);
// }
// })
addHistoryNode(item);
getPage(item.id);
}
/**
* 挂载完
... ... @@ -560,6 +578,7 @@ export default {
showUploadDialogVisible,
historyNode,
clickTopNav,
tagHandleClose,
isAdmin
... ...
<div style="padding-top: 20px;">
<el-divider content-position="left">个人信息</el-divider>
<el-form :model="ruleForm" label-width="120px" :size="$global.elementSize">
<el-row>
<el-col :span="8">
... ...
... ... @@ -69,23 +69,21 @@ export default {
let getFile = (param) =>{
let fileObj = param.file
getBase64(fileObj).then(res => {
proxy.$global.getBase64(fileObj).then(res => {
console.log(res)
});
imageUrl.value = URL.createObjectURL(fileObj)
}
let beforeAvatarUpload = (file) =>{
const isJPG = file.type.indexOf('image/') != -1
if (!isJPG) {
proxy.$global.showMsg('您上传的不是图片文件,请选择图片!','error');
}
return isJPG
}
... ...
... ... @@ -21,9 +21,12 @@
</el-form-item>
</el-form>
</div>
<div style="padding: 3px 6px;text-align: right">
<el-button type="primary" @click="showConfigDialog(true)">配置</el-button>
</div>
<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 - 80)">
:showPage="true" :height="(height - 130)">
<template #default="{row,prop,column}">
<a href="javascript:void(0)" v-if="prop == 'resPositon' || prop == 'cabinetNo'" style="border-bottom: solid 1px blue;margin-bottom: 3px;height: 30px;font-size: 15px;" @click="cellClick(row,prop,column)">{{row[prop]}}</a>
<el-link v-else :underline="false" @click="item.click(scope.row)">{{row[prop]}}</el-link>
... ... @@ -52,4 +55,10 @@
</template>
</cm-dialog>
<cm-dialog :title="dialogDetail.title" width="80%" :showDialogVisible="showConfig" :showFooter="false" @hidedialog="showConfigDialog" :showOkBtn="false" cancelText="关闭">
<template v-slot>
</template>
</cm-dialog>
</div>
... ...
// 获取状态
const configPage = () => {
// 展示配置弹框
let dialogFlg = Vue.ref(false);
let dialogDetail = Vue.ref({
title: '资源属性配置',
});
let showConfigDialog = (flg) => {
dialogFlg.value = flg;
}
return {
showConfig: dialogFlg,
showConfigDialog,
dialogDetail
}
}
export default {
name: 'resIndex',
template: '',
... ... @@ -8,15 +27,15 @@ export default {
},
data() {
return {
props : {
label:'label',
children:'children'
props: {
label: 'label',
children: 'children'
}
}
},
setup() {
const {proxy} = Vue.getCurrentInstance();
let height = Vue.ref(window.innerHeight -10);
let height = Vue.ref(window.innerHeight - 10);
// 树数据
const treeData = Vue.ref([]);
// 表格数据对象
... ... @@ -25,7 +44,7 @@ export default {
const currentNode = Vue.ref({});
// 搜索框内容
const searchForm = Vue.ref({
resName:''
resName: ''
});
// 单元格点及保存的数据
... ... @@ -34,16 +53,7 @@ export default {
// 展示U位弹框
let dialogFlg = Vue.ref(false);
// const dialog = Vue.ref({
// title: '资源类型配置',
// activeName: ''
// });
// const dialogVisible = Vue.ref(false);
//
// // 弹框
// let showDialog = () => {
// dialogVisible.value = true;
// }
let total = Vue.ref(0);
// 获取左侧树结构
let loadTree = () => {
... ... @@ -57,17 +67,25 @@ export default {
});
}
let loadResList = () =>{
if(currentNode.value){
proxy.$http.get(`/api-web/v32/res/list/list/${currentNode.value.id}`, {}, function (res) {
let loadResList = () => {
if (currentNode.value) {
// 查询参数
let params = {
page: 1,
limit: 10,
treeNodId: currentNode.value.id,
query: {}
}
proxy.$http.get(`/api-web/v32/res/list`, params, function (res) {
if (res && res.object) {
obj.value = res.object
total.value = res.count;
}
});
}
}
let handleNodeClick =(data) =>{
let handleNodeClick = (data) => {
console.log(data)
currentNode.value = data;
loadResList();
... ... @@ -75,11 +93,11 @@ export default {
// 展示机房或者机柜信息
let showDialog = (flg) =>{
let showDialog = (flg) => {
dialogFlg.value = flg;
}
let cellClick = (row,prop,column) =>{
let cellClick = (row, prop, column) => {
openCabinet(true);
showDialog(true);
cellDetail.value['prop'] = prop;
... ... @@ -87,8 +105,8 @@ export default {
cellDetail.value['title'] = column.label + '详情';
}
let cabinetNoSrc = Vue.ref('');
let openCabinet = (isInit) =>{
if(isInit){
let openCabinet = (isInit) => {
if (isInit) {
cabinetNoSrc.value = "/vue3/src/assets/images/res/img01.jpg"
} else {
cabinetNoSrc.value = "/vue3/src/assets/images/res/img03.jpg"
... ... @@ -104,10 +122,9 @@ export default {
})
// 配置页面
const {showConfig, showConfigDialog, dialogDetail} = configPage()
return {
/*showDialog,
dialogVisible,
dialog*/
currentNode,
treeData,
... ... @@ -122,7 +139,11 @@ export default {
cellClick,
openCabinet,
cabinetNoSrc
cabinetNoSrc,
total,
// 配置页面
showConfig, showConfigDialog, dialogDetail,
}
}
}
... ...