Pārlūkot izejas kodu

应用管理页面修改

mork 3 nedēļas atpakaļ
vecāks
revīzija
6cf3eaf94b

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

@@ -129,12 +129,12 @@
     <!-- 设备综合分析比较 -->
     <div class="comparison-section">
       <div class="chart-card full-width">
-        <div class="chart-title">各委办平台用户分布</div>
+        <div class="chart-title">用户分布</div>
         <!-- <div ref="comparisonChart" class="chart-container"></div> -->
         <el-table :data="tableData" style="width: 100%">
           <el-table-column prop="name" label="委办单位" />
-          <el-table-column prop="number" label="注册用户数" />
-          <el-table-column prop="activity" label="活跃" />
+          <el-table-column prop="number" label="用户名称" />
+          <el-table-column prop="activity" label="活跃天数" />
           <el-table-column prop="server" label="服务使用量" />
         </el-table>
       </div>

+ 1 - 1
src/views/yygl/appCenter.vue

@@ -32,7 +32,7 @@
 <script>
 import AppOverview from "@/views/yygl/overview/index.vue";
 import AppManagement from "@/views/yygl/manage/index.vue";
-import AppMonitoring from "@/views/yygl/monitor/index.vue";
+import AppMonitoring from "@/views/yygl/monitor/index3.vue";
 export default {
   name: "AppCenter",
   components: {

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

@@ -96,13 +96,25 @@
                 <span class="metric-value">{{ app.buffName }}</span>
               </div>
               <div class="metric-item">
-                <span class="metric-label">状态</span>
+                <span class="metric-label">应用状态</span>
                 <span class="metric-value" :class="`status-${app.appstauts}`">{{ app.appstautName }}</span>
               </div>
               <div class="metric-item">
                 <span class="metric-label">使用单位</span>
                 <span class="metric-value">{{ app.sydw }}</span>
               </div>
+              <div class="metric-item">
+                <span class="metric-label">所属部门</span>
+                <span class="metric-value">{{ app.ssbm }}</span>
+              </div>
+              <div class="metric-item">
+                <span class="metric-label">负责人</span>
+                <span class="metric-value">{{ app.ywfzr }}</span>
+              </div>
+              <div class="metric-item">
+                <span class="metric-label">联系方式</span>
+                <span class="metric-value">{{ app.phone }}</span>
+              </div>
               <div class="metric-item">
                 <span class="metric-label">创建时间</span>
                 <span class="metric-value">{{ app.createTime }}</span>
@@ -249,6 +261,7 @@ export default {
       appCenter.getContentById(requestParams).then((data) => {
           if (data.code === 200) {
             that.contentItem = data.content;
+            that.contentItem.phone = this.formatPhoneNumber(that.contentItem.phone);
             that.isContentShow = true;
             that.isContentView = false;
           }
@@ -385,7 +398,7 @@ export default {
             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'),
             frameTime: moment(item.frame_time).format('YYYY-MM-DD HH:mm:ss'),
-
+            phone: this.formatPhoneNumber(item.phone),
           }))
           this.applications = this.itemApplications;
         }else{
@@ -393,6 +406,10 @@ export default {
           this.applications = [];
         }
       })
+    },
+     formatPhoneNumber(phone) {
+      if (!phone) return '';
+        return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
     }
   }
 }
@@ -461,7 +478,7 @@ export default {
   display: flex;
   justify-content: space-between;
   align-items: center;
-  margin-bottom: 5px;
+  margin: 0px 10px 5px 10px;
 }
 
 .total-count {
@@ -483,6 +500,7 @@ export default {
   margin-bottom: 20px;
   height: 500px;
   overflow: auto;
+  padding: 0px 10px 0px 10px;
 }
 
 .application-item {
@@ -561,6 +579,7 @@ export default {
   gap: 40px;
   flex: 1;
   justify-content: space-around;
+  padding-right: 20px;
 }
 
 .metric-item {
@@ -619,6 +638,7 @@ export default {
   display: flex;
   justify-content: space-between;
   align-items: center;
+  margin: 0px 15px 0px 10px;
   // padding-top: 15px;
   // border-top: 1px solid rgba(255, 255, 255, 0.1);
 }

+ 104 - 23
src/views/yygl/monitor/index.vue

@@ -4,7 +4,18 @@
     <div class="main-content">
       <!-- 应用统计卡片 -->
       <div class="stats-cards">
-        <div class="stat-card">
+        <div class="stat-card" v-for="(item) in getLimitedList()" :key="item.name" >
+          <div class="stat-icon approved">
+            <el-icon><CircleCheckFilled /></el-icon>
+          </div>
+          <div class="stat-content">
+            <div class="stat-label">{{ item.name }}</div>
+            <div class="stat-number">
+              {{ item.value }} 个
+            </div>
+          </div>
+        </div>
+        <!-- <div class="stat-card">
           <div class="stat-icon approved">
             <el-icon><CircleCheckFilled /></el-icon>
           </div>
@@ -39,7 +50,7 @@
             <div class="stat-label">已下架应用</div>
             <div class="stat-number">20个</div>
           </div>
-        </div>
+        </div> -->
       </div>
 
       <!-- 内容模块 -->
@@ -74,13 +85,13 @@
         <div class="module">
           <div class="module-header">
             <h3 class="module-title">应用上新</h3>
-            <a href="#" class="module-more">更多</a>
+            <!-- <a href="#" class="module-more">更多</a> -->
           </div>
           <div class="module-content">
-            <div class="new-app" v-for="(app, index) in newApps" :key="index">
+            <div class="new-app" v-for="(app, index) in applications" :key="index">
               <div class="app-info">
-                <span class="app-name">{{ app.name }}</span>
-                <span class="app-date">{{ app.date }}</span>
+                <span class="app-name">{{ app.title }}</span>
+                <span class="app-date">{{ app.createTime }}</span>
               </div>
             </div>
           </div>
@@ -114,12 +125,26 @@
 </template>
 
 <script>
+
 import * as echarts from 'echarts'
+import appCenter from "@/api/appCenter";
+import moment from 'moment';
+import CountUp from 'vue-countup-v3'
 export default {
   name: "ApplicationMonitor",
+  components: {
+    CountUp
+  },
   data() {
     return {
       statusChart: null,
+      itemApplications: [],
+      applications: [],
+      statusOptions: [],
+      buffOptions: [],
+      tagOptions: [],
+      typeArrs: [],
+
       // 快捷应用数据
       quickApps: [
         { name: '农产品安全管控示范应用场', type: 'green' },
@@ -127,15 +152,6 @@ export default {
         { name: '数字孪生黄浦', type: 'blue' }
       ],
       
-      // 应用上新数据
-      newApps: [
-        { name: '水系综合管理系统', date: '2023-10-29' },
-        { name: '虹口历史文脉管理系统开发', date: '2023-09-15' },
-        { name: '虹口智慧环卫监管平台', date: '2023-09-15' },
-        { name: '上海虹口区一网统管平台', date: '2023-09-15' },
-        { name: '上海公共交通服务保障', date: '2023-09-15' }
-      ],
-      
       // 应用热度排行数据
       hotApps: [
         { name: '崇明区乡村振兴一张图', count: 128, percentage: 100 },
@@ -147,7 +163,7 @@ export default {
     }
   },
    mounted() {
-    this.initCharts()
+    this.initData()
     window.addEventListener('resize', this.handleResize)
   },
   beforeUnmount() {
@@ -155,8 +171,11 @@ export default {
     this.destroyCharts()
   },
   methods: {
-    initCharts() {
-      this.initStatusChart()
+    initData() {
+      this.getDmsCNameAType('applevel');
+      this.getDmsCNameAType('appstatus');
+      this.getDmsCNameAType('tag');
+      this.getDmsDataList()
     },
     handleResize() {
       if (this.statusChart) this.statusChart.resize()
@@ -167,7 +186,71 @@ export default {
         this.statusChart = null
       }
     },
+    getLimitedList() {
+      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;
+            }
+        }
+      })
+    },
+    getDmsDataList() {
+      let requestParams = {
+        columnId: 1659,
+        states: 0,
+        orderBy: JSON.stringify([{"field":"create_time","orderByType":2}]),
+        pageSize: 9999,
+        page: 0
+      };
+      appCenter.getDmsDataList(requestParams).then(res => {
+        if (res.code === 200) {
+          this.itemApplications = res.content.data.map(item => ({
+            ...item,
+            status: item.status === 0 ? '待审核' : item.status === 1 ? '待发布' : item.status === 2 ? '未完成' : '已完成',
+            buffName: this.buffOptions.find(info => info.label == item.appbuff.trim())?.value || '',
+            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;
+          this.getTypeArrs();
+        }else{
+          this.applications = [];
+        }
+      })
+    },
+    getTypeArrs() {
+      let that = this;
+      that.statusOptions.forEach(item => {
+          let arr = this.applications.filter(info => info.appstauts == item.label);
+          let name = item.value,length = arr.length;
+          let str = {name: name,value: length};
+          that.typeArrs.push(str);
+      })
+      this.initStatusChart()
+    },
     initStatusChart() {
+      let colors = ['#52C41A','#FAAD14','#F5222D','#1E90FF'];
+      let seriesData = this.typeArrs.map((item,index) => ({
+        // value: item.value, name: item.name, itemStyle: { color: colors[index] }  //自定义颜色
+        value: item.value, name: item.name // 随机颜色
+      }))
       this.statusChart = echarts.init(this.$refs.statusChart)
       const option = {
         tooltip: {
@@ -211,11 +294,7 @@ export default {
             labelLine: {
               show: false
             },
-            data: [
-              { value: 400, name: '在维', itemStyle: { color: '#52C41A' } },
-              { value: 300, name: '在筹', itemStyle: { color: '#FAAD14' } },
-              { value: 200, name: '停用', itemStyle: { color: '#F5222D' } }
-            ]
+            data: seriesData
           }
         ]
       }
@@ -362,6 +441,8 @@ export default {
 
 .module-content {
   padding: 20px;
+  height: 320px;
+  overflow: auto;
 }
 
 /* 应用状态分布图 */

+ 32 - 13
src/views/yygl/overview/index.vue

@@ -2,7 +2,7 @@
   <div class="application-overview">
     <!-- 右侧主内容区 -->
     <div class="main-content">
-        <div style="display: flex;justify-content: space-between;">
+        <div style="display: flex;justify-content: space-between;padding-right: 30px;">
             <!-- 搜索栏 -->
             <div class="search-bar">
                 <el-input
@@ -21,7 +21,7 @@
 
             <!-- 应用范围过滤 -->
             <div class="filter-tabs">
-                <el-radio-group v-model="activeTab" size="medium" @change="handleTabChange" v-for="item in levelOptions" :key="item.value">
+                <el-radio-group v-model="activeTab" size="medium" @change="handleTabChange" v-for="item in buffOptions" :key="item.value">
                     <el-radio-button :label="item.label">{{ item.value }}</el-radio-button>
                     <!-- <el-radio-button label="1">区级</el-radio-button>
                     <el-radio-button label="2">街镇</el-radio-button> -->
@@ -38,10 +38,11 @@
             <div class="card-content">
               <div class="app-header">
                 <h3 class="app-name">{{ app.title }}</h3>
-                <span class="app-level">{{ app.levelName }}</span>
+                <!-- <span class="app-level">{{ app.buffName }}</span> -->
                 <span class="app-version">{{ app.version }}</span>
               </div>
               <div class="app-tags">
+                <el-tag size="small" type="success">{{ app.buffName }}</el-tag>
                 <!-- <el-tag size="small" type="success">{{ app.status }}</el-tag> -->
                 <el-tag size="small" v-for="tag in app.tags" :key="tag">{{ tag }}</el-tag>
               </div>
@@ -72,7 +73,7 @@ export default {
       searchKeyword: '',
       activeTab: 'all',
       curUrl:systemConfig.dmsDataProxy,
-      levelOptions: [],
+      buffOptions: [],
       tagOptions: [],
       applications: [],
       itemApplications: []
@@ -83,10 +84,11 @@ export default {
   },
   methods: {
     handleTabChange() {
+      console.log(this.activeTab);
       if (this.activeTab == 'all') {
         this.applications = this.itemApplications;
       } else {
-        this.applications = this.itemApplications.filter(item => item.level == this.activeTab);
+        this.applications = this.itemApplications.filter(item => item.appbuff == this.activeTab);
       }
     },
     initData() {
@@ -126,7 +128,7 @@ export default {
       
       appCenter.getDmsCNameAType(requestParams).then(res => {
         if (res.code === 200) {
-            this.levelOptions = res.content.map(item => ({
+            this.buffOptions = res.content.map(item => ({
               label: item.index,
               value: item.name
             }));
@@ -134,16 +136,33 @@ export default {
               label: 'all',
               value: '全部'
             }
-            this.levelOptions.unshift(allOption);
+            this.buffOptions.unshift(allOption);
             
         }
       })
     },
     getDmsDataList() {
-      let requestParams = {
-        columnId: 1658,
+      // let requestParams = {
+      //   columnId: 1658,
+      //   states: 0,
+      //   pageSize: 999,
+      //   page: 0
+      // };
+      // if (this.searchKeyword) {
+      //   requestParams.search = JSON.stringify([
+      //     {
+      //       field: "title",
+      //       searchType: 2,
+      //       content: { value: "%" + this.searchKeyword + "%" },
+      //     },
+      //   ]);
+      // }
+
+       let requestParams = {
+        columnId: 1659,
         states: 0,
-        pageSize: 999,
+        orderBy: JSON.stringify([{"field":"frame_time","orderByType":2}]),
+        pageSize: 9999,
         page: 0
       };
       if (this.searchKeyword) {
@@ -160,9 +179,8 @@ export default {
           this.itemApplications = res.content.data.map(item => ({
             ...item,
             status: item.status === 0 ? '待审核' : item.status === 1 ? '待发布' : item.status === 2 ? '未完成' : '已完成',
-            // levelName: item.level == 0 ? '区级' : item.level == 1 ? '街镇' : item.level == 2 ? '社区' : '',
-            levelName: this.levelOptions.find(info => info.label == item.level.trim())?.value || '',
-            tags: item.tag.split(',').map(tag => this.tagOptions.find(info => info.label == tag.trim())?.value || ''),
+            buffName: this.buffOptions.find(info => info.label == item.appbuff.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;
@@ -255,6 +273,7 @@ export default {
     // height: 640px;
     height: calc(100vh - 266px);
     overflow: auto;
+    padding-right: 20px;
 }
 
 /* 应用卡片网格样式 */