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 { @@ -498,6 +498,24 @@ export default {
498 return localStorage.getItem('lgn') == 'admin'; 498 return localStorage.getItem('lgn') == 'admin';
499 } 499 }
500 500
  501 + /**
  502 + * TODO
  503 + * @param item
  504 + * @param index
  505 + */
  506 + let clickTopNav = (item,index) =>{
  507 + let arr = historyNode.value;
  508 + // // 删除当前节点后面的路径
  509 + // arr.filter(function (v,i) {
  510 + // if(i > index){
  511 + // arr.splice(i,1);
  512 + // }
  513 + // })
  514 +
  515 + addHistoryNode(item);
  516 + getPage(item.id);
  517 + }
  518 +
501 519
502 /** 520 /**
503 * 挂载完 521 * 挂载完
@@ -560,6 +578,7 @@ export default { @@ -560,6 +578,7 @@ export default {
560 578
561 showUploadDialogVisible, 579 showUploadDialogVisible,
562 historyNode, 580 historyNode,
  581 + clickTopNav,
563 582
564 tagHandleClose, 583 tagHandleClose,
565 isAdmin 584 isAdmin
1 <div style="padding-top: 20px;"> 1 <div style="padding-top: 20px;">
  2 + <el-divider content-position="left">个人信息</el-divider>
2 <el-form :model="ruleForm" label-width="120px" :size="$global.elementSize"> 3 <el-form :model="ruleForm" label-width="120px" :size="$global.elementSize">
3 <el-row> 4 <el-row>
4 <el-col :span="8"> 5 <el-col :span="8">
@@ -69,23 +69,21 @@ export default { @@ -69,23 +69,21 @@ export default {
69 69
70 70
71 let getFile = (param) =>{ 71 let getFile = (param) =>{
72 -  
73 let fileObj = param.file 72 let fileObj = param.file
74 73
75 - getBase64(fileObj).then(res => { 74 + proxy.$global.getBase64(fileObj).then(res => {
76 console.log(res) 75 console.log(res)
77 }); 76 });
78 77
79 imageUrl.value = URL.createObjectURL(fileObj) 78 imageUrl.value = URL.createObjectURL(fileObj)
80 79
81 } 80 }
  81 +
82 let beforeAvatarUpload = (file) =>{ 82 let beforeAvatarUpload = (file) =>{
83 const isJPG = file.type.indexOf('image/') != -1 83 const isJPG = file.type.indexOf('image/') != -1
84 -  
85 if (!isJPG) { 84 if (!isJPG) {
86 proxy.$global.showMsg('您上传的不是图片文件,请选择图片!','error'); 85 proxy.$global.showMsg('您上传的不是图片文件,请选择图片!','error');
87 } 86 }
88 -  
89 return isJPG 87 return isJPG
90 } 88 }
91 89
@@ -21,9 +21,12 @@ @@ -21,9 +21,12 @@
21 </el-form-item> 21 </el-form-item>
22 </el-form> 22 </el-form>
23 </div> 23 </div>
  24 + <div style="padding: 3px 6px;text-align: right">
  25 + <el-button type="primary" @click="showConfigDialog(true)">配置</el-button>
  26 + </div>
24 <cm-table-page :columns="obj.columns" :dataList="obj.maps" @loaddata="getPage" :showIndex="true" 27 <cm-table-page :columns="obj.columns" :dataList="obj.maps" @loaddata="getPage" :showIndex="true"
25 :showBorder="true" :currentPage="currentPage" :total="total" :loading="false" 28 :showBorder="true" :currentPage="currentPage" :total="total" :loading="false"
26 - :showPage="true" :height="(height - 80)"> 29 + :showPage="true" :height="(height - 130)">
27 <template #default="{row,prop,column}"> 30 <template #default="{row,prop,column}">
28 <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> 31 <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>
29 <el-link v-else :underline="false" @click="item.click(scope.row)">{{row[prop]}}</el-link> 32 <el-link v-else :underline="false" @click="item.click(scope.row)">{{row[prop]}}</el-link>
@@ -52,4 +55,10 @@ @@ -52,4 +55,10 @@
52 55
53 </template> 56 </template>
54 </cm-dialog> 57 </cm-dialog>
  58 +
  59 + <cm-dialog :title="dialogDetail.title" width="80%" :showDialogVisible="showConfig" :showFooter="false" @hidedialog="showConfigDialog" :showOkBtn="false" cancelText="关闭">
  60 + <template v-slot>
  61 +
  62 + </template>
  63 + </cm-dialog>
55 </div> 64 </div>
  1 +// 获取状态
  2 +const configPage = () => {
  3 + // 展示配置弹框
  4 + let dialogFlg = Vue.ref(false);
  5 + let dialogDetail = Vue.ref({
  6 + title: '资源属性配置',
  7 + });
  8 +
  9 + let showConfigDialog = (flg) => {
  10 + dialogFlg.value = flg;
  11 + }
  12 +
  13 + return {
  14 + showConfig: dialogFlg,
  15 + showConfigDialog,
  16 + dialogDetail
  17 +
  18 + }
  19 +}
1 export default { 20 export default {
2 name: 'resIndex', 21 name: 'resIndex',
3 template: '', 22 template: '',
@@ -8,15 +27,15 @@ export default { @@ -8,15 +27,15 @@ export default {
8 }, 27 },
9 data() { 28 data() {
10 return { 29 return {
11 - props : {  
12 - label:'label',  
13 - children:'children' 30 + props: {
  31 + label: 'label',
  32 + children: 'children'
14 } 33 }
15 } 34 }
16 }, 35 },
17 setup() { 36 setup() {
18 const {proxy} = Vue.getCurrentInstance(); 37 const {proxy} = Vue.getCurrentInstance();
19 - let height = Vue.ref(window.innerHeight -10); 38 + let height = Vue.ref(window.innerHeight - 10);
20 // 树数据 39 // 树数据
21 const treeData = Vue.ref([]); 40 const treeData = Vue.ref([]);
22 // 表格数据对象 41 // 表格数据对象
@@ -25,7 +44,7 @@ export default { @@ -25,7 +44,7 @@ export default {
25 const currentNode = Vue.ref({}); 44 const currentNode = Vue.ref({});
26 // 搜索框内容 45 // 搜索框内容
27 const searchForm = Vue.ref({ 46 const searchForm = Vue.ref({
28 - resName:'' 47 + resName: ''
29 }); 48 });
30 49
31 // 单元格点及保存的数据 50 // 单元格点及保存的数据
@@ -34,16 +53,7 @@ export default { @@ -34,16 +53,7 @@ export default {
34 // 展示U位弹框 53 // 展示U位弹框
35 let dialogFlg = Vue.ref(false); 54 let dialogFlg = Vue.ref(false);
36 55
37 - // const dialog = Vue.ref({  
38 - // title: '资源类型配置',  
39 - // activeName: ''  
40 - // });  
41 - // const dialogVisible = Vue.ref(false);  
42 - //  
43 - // // 弹框  
44 - // let showDialog = () => {  
45 - // dialogVisible.value = true;  
46 - // } 56 + let total = Vue.ref(0);
47 57
48 // 获取左侧树结构 58 // 获取左侧树结构
49 let loadTree = () => { 59 let loadTree = () => {
@@ -57,17 +67,25 @@ export default { @@ -57,17 +67,25 @@ export default {
57 }); 67 });
58 } 68 }
59 69
60 - let loadResList = () =>{  
61 - if(currentNode.value){  
62 - proxy.$http.get(`/api-web/v32/res/list/list/${currentNode.value.id}`, {}, function (res) { 70 + let loadResList = () => {
  71 + if (currentNode.value) {
  72 + // 查询参数
  73 + let params = {
  74 + page: 1,
  75 + limit: 10,
  76 + treeNodId: currentNode.value.id,
  77 + query: {}
  78 + }
  79 + proxy.$http.get(`/api-web/v32/res/list`, params, function (res) {
63 if (res && res.object) { 80 if (res && res.object) {
64 obj.value = res.object 81 obj.value = res.object
  82 + total.value = res.count;
65 } 83 }
66 }); 84 });
67 } 85 }
68 } 86 }
69 87
70 - let handleNodeClick =(data) =>{ 88 + let handleNodeClick = (data) => {
71 console.log(data) 89 console.log(data)
72 currentNode.value = data; 90 currentNode.value = data;
73 loadResList(); 91 loadResList();
@@ -75,11 +93,11 @@ export default { @@ -75,11 +93,11 @@ export default {
75 93
76 94
77 // 展示机房或者机柜信息 95 // 展示机房或者机柜信息
78 - let showDialog = (flg) =>{ 96 + let showDialog = (flg) => {
79 dialogFlg.value = flg; 97 dialogFlg.value = flg;
80 } 98 }
81 99
82 - let cellClick = (row,prop,column) =>{ 100 + let cellClick = (row, prop, column) => {
83 openCabinet(true); 101 openCabinet(true);
84 showDialog(true); 102 showDialog(true);
85 cellDetail.value['prop'] = prop; 103 cellDetail.value['prop'] = prop;
@@ -87,8 +105,8 @@ export default { @@ -87,8 +105,8 @@ export default {
87 cellDetail.value['title'] = column.label + '详情'; 105 cellDetail.value['title'] = column.label + '详情';
88 } 106 }
89 let cabinetNoSrc = Vue.ref(''); 107 let cabinetNoSrc = Vue.ref('');
90 - let openCabinet = (isInit) =>{  
91 - if(isInit){ 108 + let openCabinet = (isInit) => {
  109 + if (isInit) {
92 cabinetNoSrc.value = "/vue3/src/assets/images/res/img01.jpg" 110 cabinetNoSrc.value = "/vue3/src/assets/images/res/img01.jpg"
93 } else { 111 } else {
94 cabinetNoSrc.value = "/vue3/src/assets/images/res/img03.jpg" 112 cabinetNoSrc.value = "/vue3/src/assets/images/res/img03.jpg"
@@ -104,10 +122,9 @@ export default { @@ -104,10 +122,9 @@ export default {
104 }) 122 })
105 123
106 124
  125 + // 配置页面
  126 + const {showConfig, showConfigDialog, dialogDetail} = configPage()
107 return { 127 return {
108 - /*showDialog,  
109 - dialogVisible,  
110 - dialog*/  
111 128
112 currentNode, 129 currentNode,
113 treeData, 130 treeData,
@@ -122,7 +139,11 @@ export default { @@ -122,7 +139,11 @@ export default {
122 cellClick, 139 cellClick,
123 140
124 openCabinet, 141 openCabinet,
125 - cabinetNoSrc 142 + cabinetNoSrc,
  143 + total,
  144 +
  145 + // 配置页面
  146 + showConfig, showConfigDialog, dialogDetail,
126 } 147 }
127 } 148 }
128 } 149 }