Authored by 鲁尚清

缓存数据功能页面,故障诊断基础环境全部添加后刷新

  1 +<title>缓存数据</title>
  2 +<iframe src="/vue3/index.html#/cache" class="layadmin-iframe" style="height: 99.5%!important;"/>
@@ -53,3 +53,5 @@ @@ -53,3 +53,5 @@
53 53
54 /*对比分析*/ 54 /*对比分析*/
55 @import "../css/analysis.css"; 55 @import "../css/analysis.css";
  56 +/*缓存数据*/
  57 +@import "../css/cacheData.css";
  1 +.cache-container{
  2 + height:100%;
  3 + background: #FFFFFF;
  4 + padding:20px;
  5 +}
  6 +.tag-item{
  7 + margin-right: 10px;
  8 +}
  9 +.view-container{
  10 + min-height: 600px;
  11 + padding:0 10px 10px;
  12 + display: flex;
  13 + flex-flow: column;
  14 + align-items: flex-start;
  15 +}
  16 +.view-title{
  17 + padding-bottom: 10px;
  18 +}
  19 +.view-detail{
  20 + flex: 1;
  21 + width: 100%;
  22 + text-align: left;
  23 + border:1px solid #ccc;
  24 + max-height: 600px;
  25 + overflow-y: auto;
  26 +}
  27 +.detail-data{
  28 + padding:10px;
  29 +}
@@ -144,7 +144,12 @@ const routes = [{ @@ -144,7 +144,12 @@ const routes = [{
144 path: '/vue3/portSense', 144 path: '/vue3/portSense',
145 name: 'portSense', 145 name: 'portSense',
146 component: () => myImport('views/portSense/index') 146 component: () => myImport('views/portSense/index')
147 - } 147 + },
  148 + {
  149 + path: '/cache',
  150 + name: 'cacheData',
  151 + component: () => myImport('views/cacheData/index')
  152 + },
148 ]; 153 ];
149 154
150 // hash模式: createWebHashHistory 155 // hash模式: createWebHashHistory
  1 +<div class="cache-container">
  2 + <el-row>
  3 + <el-col :span="24">
  4 + <div class="flex-div-start margin-top-bottom-10">
  5 + <el-input class="margin-right-10" v-model="keyWords" placeholder="输入关键字" />
  6 +
  7 + <div class="flex-div-start">
  8 +
  9 + <el-button type="primary" @click="onBtnSearch()" style="margin-left: 10px">搜索</el-button>
  10 +
  11 + </div>
  12 + </div>
  13 +
  14 +
  15 + </el-col>
  16 +
  17 + </el-row>
  18 + <el-row class="margin-top-bottom-10">
  19 + <el-col :span="24" class="flex-div-start margin-bottom-10">
  20 +
  21 + <el-check-tag class="tag-item" v-for="(item,index) in tagData" :checked="checkedId==item.id" @click="changeTag(item.id)">{{item.name}}</el-check-tag>
  22 +
  23 + </el-col>
  24 + </el-row>
  25 + <el-row class="margin-top-bottom-10">
  26 + <el-col :span="24" class="flex-div-start margin-bottom-10">
  27 +
  28 +<!-- <span>匹配项:{{num}}个</span>-->
  29 + <span>[筛选:{{num}}个]</span>
  30 +
  31 + </el-col>
  32 + </el-row>
  33 + <el-row class="margin-bottom-50">
  34 + <el-col :span="24" class="table-height">
  35 + <cm-table-page v-show="tableDataList" :columns="columns" :dataList="tableDataList" @loaddata="loadTableDataList"
  36 + :showIndex="true" :total="count" :showSelection="false"
  37 + :showBorder="true" :loading="false" :pageSize="pageSize"
  38 + :showPage="true" :showTools="true" :height="(height - 500)">
  39 + <template #tools="{scope}">
  40 + <el-button type="text" size="small" @click.prevent="handleView(scope.row,scope.$index)">
  41 + 查看
  42 + </el-button>
  43 + </template>
  44 + </cm-table-page>
  45 + </el-col>
  46 +
  47 + </el-row>
  48 +</div>
  49 +<cm-dialog :title="titleName" width="90%" :showDialogVisible="cacheVisible" @hidedialog="closeDialog" :showCancelBtn="true" :showFooter="false">
  50 + <template v-slot>
  51 + <div class="view-container">
  52 + <div class="view-title">Value:</div>
  53 + <div class="view-detail">
  54 + <div class="detail-data">
  55 + {{viewData}}
  56 +
  57 + </div>
  58 + </div>
  59 +
  60 + </div>
  61 + <div class="margin-top flex-center ">
  62 + <el-button @click="cancelBtn">取消</el-button>
  63 + </div>
  64 + </template>
  65 +</cm-dialog>
  1 +export default {
  2 + name: 'cacheData',
  3 + template: '',
  4 + components: {},
  5 + props:[],
  6 + data () {
  7 + return {
  8 +
  9 + }
  10 + },
  11 + setup(){
  12 + const {proxy} = Vue.getCurrentInstance();
  13 + // Start LSQ 2022/1/5
  14 + let height = Vue.ref(window.innerHeight - 10);
  15 + // 挂载完
  16 + Vue.onMounted(() => {
  17 +
  18 + })
  19 + //配置项标签数据
  20 + let tagData=Vue.ref([{
  21 + name:'配置1',
  22 + id:'001'
  23 + },{
  24 + name:'配置2',
  25 + id:'002'
  26 + },{
  27 + name:'配置3',
  28 + id:'003'
  29 + }])
  30 + //表格字段
  31 + let columns=Vue.ref([
  32 + {
  33 + prop: 'busTypeName',
  34 + label: '业务系统',
  35 + sortable: true,
  36 + align: 'center',
  37 + },
  38 + {
  39 + prop: 'resName',
  40 + label: '资源名称',
  41 + sortable: true,
  42 + align: 'center',
  43 + },
  44 + ])
  45 + let page=Vue.ref(1);
  46 + let pageSize=Vue.ref(10);
  47 + let keyWords=Vue.ref();
  48 + let count=Vue.ref(0);
  49 + let tableDataList=Vue.ref([{
  50 + busTypeName:'电子税务局',
  51 + id:'111',
  52 + resName:'缓存',
  53 + val:'25698458'
  54 + }]);
  55 + let checkedId = Vue.ref(0);
  56 + let titleName=Vue.ref('查看数据')
  57 + let cacheVisible=Vue.ref(false);
  58 + let viewData=Vue.ref();
  59 + //匹配项数
  60 + let num=Vue.ref(0);
  61 +
  62 + //点击标签进行搜索
  63 + const changeTag = (status) => {
  64 + console.log("aa",status)
  65 + checkedId.value = status;
  66 + getDataList();
  67 + }
  68 + //操作按钮 查看
  69 + const handleView=(row,index)=>{
  70 + viewData.value=row.val;
  71 + cacheVisible.value=true;
  72 +
  73 + }
  74 + //重新加载表格数据
  75 + let loadTableDataList = ({page, limit}) => {
  76 + page.value=page;
  77 + pageSize.value=limit;
  78 + getDataList()
  79 + }
  80 + // 点击按钮搜索
  81 + let onBtnSearch = () => {
  82 + getDataList();
  83 + }
  84 + //获取缓存数据
  85 + let getDataList=()=>{
  86 + let params={
  87 + page:page.value,
  88 + pageSize:pageSize.value,
  89 + keyWord:keyWords.value,
  90 + id:checkedId.value
  91 + }
  92 + /*proxy.$http.get(`/api-web/`, params, function (res) {
  93 + if (res && res.success) {
  94 + count.value = res.count;
  95 + tableDataList.value = res.data;
  96 + }
  97 + });*/
  98 +
  99 + }
  100 + //关闭弹框回调函数
  101 + let closeDialog=()=>{
  102 +
  103 + }
  104 + //关闭弹框
  105 + let cancelBtn=()=>{
  106 + cacheVisible.value=false;
  107 + }
  108 + return {
  109 + num,
  110 + height,
  111 + columns,
  112 + tagData,
  113 + page,
  114 + count,
  115 + pageSize,
  116 + keyWords,
  117 + tableDataList,
  118 + checkedId,
  119 + changeTag,
  120 + handleView,
  121 + loadTableDataList,
  122 + onBtnSearch,
  123 + getDataList,
  124 + cacheVisible,
  125 + titleName,
  126 + viewData,
  127 + closeDialog,
  128 + cancelBtn
  129 +
  130 + }
  131 + //End LSQ 2022/1/5
  132 +
  133 + }
  134 +
  135 +}
@@ -48,6 +48,7 @@ export default { @@ -48,6 +48,7 @@ export default {
48 computed: {}, 48 computed: {},
49 setup(props){ 49 setup(props){
50 const {proxy} = Vue.getCurrentInstance(); 50 const {proxy} = Vue.getCurrentInstance();
  51 + let height = Vue.ref(window.innerHeight - 10);
51 let id = proxy.$global.getQueryVariable('configId') ; 52 let id = proxy.$global.getQueryVariable('configId') ;
52 let config = Vue.ref(id == false ? null : id); 53 let config = Vue.ref(id == false ? null : id);
53 let count=Vue.ref(0); 54 let count=Vue.ref(0);
@@ -148,6 +149,7 @@ export default { @@ -148,6 +149,7 @@ export default {
148 } 149 }
149 150
150 return { 151 return {
  152 + height,
151 getEnvironmentData, 153 getEnvironmentData,
152 loadTableDataList, 154 loadTableDataList,
153 page, 155 page,
@@ -323,7 +323,10 @@ export default { @@ -323,7 +323,10 @@ export default {
323 this.type='base'; 323 this.type='base';
324 this.state=this.faultEnvironmentRadio; 324 this.state=this.faultEnvironmentRadio;
325 this.setDetailConfig(this.type) 325 this.setDetailConfig(this.type)
326 - this.getBaseList(); 326 + if(this.faultEnvironmentRadio==1){
  327 + this.getBaseList();
  328 +
  329 + }
327 330
328 }, 331 },
329 //APM 332 //APM
@@ -644,13 +647,17 @@ export default { @@ -644,13 +647,17 @@ export default {
644 this.baseVisible=false; 647 this.baseVisible=false;
645 if(itemData.faultConfId){ 648 if(itemData.faultConfId){
646 this.faultConfId=itemData.faultConfId; 649 this.faultConfId=itemData.faultConfId;
  650 + this.propsData.faultConfId=this.faultConfId;
  651 +
647 } 652 }
648 this.setTargetId(itemData.targetId); 653 this.setTargetId(itemData.targetId);
649 // this.targetId=itemData; 654 // this.targetId=itemData;
  655 + this.propsData.targetId=itemData.targetId;
650 //获取已添加的环境基础列表 656 //获取已添加的环境基础列表
651 this.getBaseList(); 657 this.getBaseList();
652 }, 658 },
653 getBaseList(){ 659 getBaseList(){
  660 + this.$refs.basic.setBizId();
654 this.$refs.basic.getEnvironmentData(); 661 this.$refs.basic.getEnvironmentData();
655 662
656 }, 663 },