瀏覽代碼

字典表返回值修改,字典查询页面统一修改

mork 2 周之前
父節點
當前提交
0db63689e2

+ 5 - 1
src/main.js

@@ -25,7 +25,11 @@ initApp.config.globalProperties.$moment = moment;
 
 // 添加自定义方法,传入DMS字典名称,返回对应字典数据
 initApp.config.globalProperties.$getDmsTypes = (cName, index) => {
-    return store.state.DmsTypesMap[cName] ? store.state.DmsTypesMap[cName][index + ''] : cName + "_" + index;
+    if(index){// 有索引时,返回对应字典值
+        return store.state.DmsTypesMap[cName] ? store.state.DmsTypesMap[cName][index + ''] : cName + "_" + index;
+    }else{// 无索引时,返回所有字典值
+        return store.state.DmsTypesMap[cName];
+    }
 };
 // 添加自定义方法,得到用户类型【1:游客;2:普通用户;3:管理员】
 const getUserType = () => {

+ 1 - 1
src/store/index.js

@@ -8,7 +8,7 @@ export default createStore({
     userState: false,
     userInfo: null,
     // DMS字典,系统app.vue初始化一次之后,后续直接全局$getDmsTypes可调用,传入字典cName和index,返回对应字典数据
-    DMSTypes: ["appstatus"],
+    DMSTypes: ["appstatus","applevel"],
     // appstatus: 应用状态
     DmsTypesMap: localStorage.getItem("DmsTypesMap") ? JSON.parse(localStorage.getItem("DmsTypesMap")) : {},
     menuList: [

+ 3 - 3
src/views/rwgl/Index.vue

@@ -316,7 +316,7 @@ export default {
 }
 </script>
 
-<style>
+<style lang="less" scoped>
 * {
     --el-table-bg-color: #eeeeee0b;
     /* 表格背景 */
@@ -428,10 +428,10 @@ body {
             #337aac 100%);
     font-size: 20px;
 
-    .third-title {
+     .third-title {
         font-size: 28px;
         padding: 0;
-    }
+    } 
 }
 
 .middle-container {

+ 2 - 3
src/views/skmh/index.vue

@@ -131,9 +131,8 @@
       <div class="chart-card full-width">
         <div class="chart-title">用户分布</div>
         <!-- <div ref="comparisonChart" class="chart-container"></div> -->
-        <el-table :data="tableData" style="width: 100%"
-          height="calc(100% - 40px);
-          background-color: rgba(255, 255, 255, 0.1);"
+        <el-table :data="tableData" style="width: 100%;"
+          height="530"
           :header-cell-style="headerCellStyle"
           :row-style="rowStyle"
           :cell-style="cellStyle"

+ 2 - 1
src/views/yxgl/StatisticalAnalysis.vue

@@ -398,7 +398,7 @@ export default {
       // 应用状态分布,cloumnId:1659
       appCenter
         .getDmsDataList({
-          columnId: 1659,
+          columnId: systemConfig.columnIds[1],
           pageSize: 1000,
           page: 0,
         })
@@ -417,6 +417,7 @@ export default {
             });
             // 转换为数组
             for (let key in statusMap) {
+              console.log(key, statusMap[key]);
               if (statusMap[key] && key) {
                 tableDatas.push({
                   name: this.$getDmsTypes("appstatus", key),

+ 50 - 23
src/views/yygl/manage/index.vue

@@ -317,30 +317,57 @@ export default {
       })
     },
     getDmsCNameAType(param) {
-      let requestParams = {
-        cName: param,
-        type: 0
-      };
-      
-      appCenter.getDmsCNameAType(requestParams).then(res => {
-        if (res.code === 200) {
-            let option = res.content.map(item => ({
-              label: item.index,
-              value: item.name
-            }));
-            let allOption = {
-              label: 'all',
-              value: '全部'
-            }
-            if(param === 'applevel'){
-              this.buffOptions = option;
-              this.buffOptions.unshift(allOption);
-            }else{
-              this.statusOptions = option;
-              this.statusOptions.unshift(allOption);
-            }
+      let allOption = {
+        label: 'all',
+        value: '全部'
+      }
+      if (param === "applevel") {
+          this.buffOptions = [];
+          this.buffOptions.push(allOption);
+          let obj = this.$getDmsTypes("applevel");
+          for(let key in obj){
+            this.buffOptions.push({
+              label:  key,
+              value: obj[key]
+            })
+          }
+        } else if (param === "appstatus") {
+          this.statusOptions = [];
+          this.statusOptions.push(allOption);
+          let obj = this.$getDmsTypes("appstatus");
+          for(let key in obj){
+            this.statusOptions.push({
+              label:  key,
+              value: obj[key]
+            })
+          }
         }
-      })
+
+
+      // let requestParams = {
+      //   cName: param,
+      //   type: 0
+      // };
+      
+      // appCenter.getDmsCNameAType(requestParams).then(res => {
+      //   if (res.code === 200) {
+      //       let option = res.content.map(item => ({
+      //         label: item.index,
+      //         value: item.name
+      //       }));
+      //       let allOption = {
+      //         label: 'all',
+      //         value: '全部'
+      //       }
+      //       if(param === 'applevel'){
+      //         this.buffOptions = option;
+      //         this.buffOptions.unshift(allOption);
+      //       }else{
+      //         this.statusOptions = option;
+      //         this.statusOptions.unshift(allOption);
+      //       }
+      //   }
+      // })
     },
     getDmsDataList() {
       let requestParams = {

+ 34 - 25
src/views/yygl/monitor/index.vue

@@ -165,7 +165,6 @@ export default {
       newApplications: [],
       statusOptions: [],
       buffOptions: [],
-      tagOptions: [],
       typeArrs: [],
       selectAapplications: [],
       selectedAppRange: '',
@@ -243,7 +242,6 @@ export default {
     initData() {
       this.getDmsCNameAType("applevel");
       this.getDmsCNameAType("appstatus");
-      this.getDmsCNameAType("tag");
       this.getDmsDataList();
       let param = {
         num: 6,
@@ -384,25 +382,42 @@ export default {
       return this.typeArrs.slice(0, 4); // 获取前四个元素
     },
     getDmsCNameAType(param) {
-      let requestParams = {
-        cName: param,
-        type: 0,
-      };
-      appCenter.getDmsCNameAType(requestParams).then((res) => {
-        if (res.code === 200 && res.content) {
-          let option = res.content.map((item) => ({
-            label: item.index,
-            value: item.name,
-          }));
-          if (param === "applevel") {
-            this.buffOptions = option;
-          } else if (param === "appstatus") {
-            this.statusOptions = option;
-          } else if (param === "tag") {
-            this.tagOptions = option;
+      if (param === "applevel") {
+          this.buffOptions = [];
+          let obj = this.$getDmsTypes("applevel");
+          for(let key in obj){
+            this.buffOptions.push({
+              label:  key,
+              value: obj[key]
+            })
+          }
+        } else if (param === "appstatus") {
+          this.statusOptions = [];
+          let obj = this.$getDmsTypes("appstatus");
+          for(let key in obj){
+            this.statusOptions.push({
+              label:  key,
+              value: obj[key]
+            })
           }
         }
-      });
+      // let requestParams = {
+      //   cName: param,
+      //   type: 0,
+      // };
+      // appCenter.getDmsCNameAType(requestParams).then((res) => {
+      //   if (res.code === 200 && res.content) {
+      //     let option = res.content.map((item) => ({
+      //       label: item.index,
+      //       value: item.name,
+      //     }));
+      //     if (param === "applevel") {
+      //       this.buffOptions = option;
+      //     } else if (param === "appstatus") {
+      //       this.statusOptions = option;
+      //     }
+      //   }
+      // });
     },
     getDmsDataList() {
       let requestParams = {
@@ -430,12 +445,6 @@ export default {
             appstautName:
               this.statusOptions.find((info) => info.label == item.appstauts.trim())
                 ?.value || "",
-            tags: item.apptags
-              .split(",")
-              .map(
-                (tag) =>
-                  this.tagOptions.find((info) => info.label == tag.trim())?.value || ""
-              ),
             createTime: moment(item.create_time).format("YYYY-MM-DD HH:mm:ss"),
           }));
           this.applications = this.itemApplications;

+ 29 - 18
src/views/yygl/overview/index.vue

@@ -132,25 +132,36 @@ export default {
       });
     },
     getDmsCNameAType() {
-      let requestParams = {
-        cName: "applevel",
-        type: 0,
-      };
-
-      appCenter.getDmsCNameAType(requestParams).then((res) => {
-        if (res.code === 200) {
-            this.buffOptions = res.content.map(item => ({
-              label: item.index,
-              value: item.name
-            }));
-            let allOption = {
-              label: 'all',
-              value: '全部'
-            }
-            this.buffOptions.unshift(allOption);
-            
+      let allOption = {
+          label: 'all',
+          value: '全部'
         }
-      });
+      this.buffOptions.unshift(allOption);
+      let obj = this.$getDmsTypes("applevel");
+      for(let key in obj){
+        this.buffOptions.push({
+          label:  key,
+          value: obj[key]
+        })
+      }
+      // let requestParams = {
+      //   cName: "applevel",
+      //   type: 0,
+      // };
+      // appCenter.getDmsCNameAType(requestParams).then((res) => {
+      //   if (res.code === 200) {
+      //       this.buffOptions = res.content.map(item => ({
+      //         label: item.index,
+      //         value: item.name
+      //       }));
+      //       let allOption = {
+      //         label: 'all',
+      //         value: '全部'
+      //       }
+      //       this.buffOptions.unshift(allOption);
+            
+      //   }
+      // });
     },
     getDmsDataList() {
        let requestParams = {