ソースを参照

开发小组件统计功能

vothin 2 年 前
コミット
6c7f6f3a50
3 ファイル変更35 行追加28 行削除
  1. 3 3
      public/domain.js
  2. 4 4
      src/utils/domain.js
  3. 28 21
      src/views/nfc-interaction/nfcInteraction.vue

+ 3 - 3
public/domain.js

@@ -1,7 +1,7 @@
 const domain = {
-  serverUrl: 'http://192.168.1.57:8005',
-  DeviceUrl: 'http://192.168.1.57:8006',
-  mediaUrl: 'http://192.168.1.57:8004',
+  serverUrl: 'http://8.129.220.143:8005',
+  DeviceUrl: 'http://8.129.220.143:8006',
+  mediaUrl: 'http://8.129.220.143:8004',
   OnlineSystemUrl: 'http://api.base.wdklian.com',
   apiMode: 'dev',
   uiVersion: 1 // 1 医院版,2 月子中心版,3养老院版

+ 4 - 4
src/utils/domain.js

@@ -48,8 +48,8 @@ module.exports = {
 // docker run -idt -p 8007:80 -e uiVersion=2 --name ncs-ui-yz --log-opt max-size=500m --log-opt max-file=1  -v /etc/localtime:/etc/localtime --restart always  registry.cn-shenzhen.aliyuncs.com/wdkl/hp_ui:bdhp1.77
 //
 // 网盘医院版
-// docker build -t   registry.cn-shenzhen.aliyuncs.com/wdkl/hp_ui:bdhp1.124 .
-// docker push registry.cn-shenzhen.aliyuncs.com/wdkl/hp_ui:bdhp1.124
+// docker build -t   registry.cn-shenzhen.aliyuncs.com/wdkl/hp_ui:bdhp1.125 .
+// docker push registry.cn-shenzhen.aliyuncs.com/wdkl/hp_ui:bdhp1.125
 // docker pull registry.cn-shenzhen.aliyuncs.com/wdkl/hp_ui:bdhp1.47
 // 删除ui
 // docker run -idt -p 80:80 --name ncs-ui --log-opt max-size=500m --log-opt max-file=1  -v /etc/localtime:/etc/localtime --restart always  registry.cn-shenzhen.aliyuncs.com/wdkl/hp_ui:bdhp1.119
@@ -58,8 +58,8 @@ module.exports = {
 // docker push registry.cn-shenzhen.aliyuncs.com/wdkl/hp_ui:en1.83
 // docker run -idt -p 8008:80 --name ncs-ui --log-opt max-size=500m --log-opt max-file=1  -v /etc/localtime:/etc/localtime --restart always  registry.cn-shenzhen.aliyuncs.com/wdkl/hp_ui:en1.83
 // 西班牙语板
-// docker build -t   registry.cn-shenzhen.aliyuncs.com/wdkl/hp_ui:es1.92 .
-// docker push registry.cn-shenzhen.aliyuncs.com/wdkl/hp_ui:es1.92
+// docker build -t   registry.cn-shenzhen.aliyuncs.com/wdkl/hp_ui:es1.93 .
+// docker push registry.cn-shenzhen.aliyuncs.com/wdkl/hp_ui:es1.93
 // docker run -idt -p 80:80 --name ncs-ui --log-opt max-size=500m --log-opt max-file=1  -v /etc/localtime:/etc/localtime --restart always  registry.cn-shenzhen.aliyuncs.com/wdkl/hp_ui:es1.92
 // 俄语板
 // docker build -t   registry.cn-shenzhen.aliyuncs.com/wdkl/hp_ui:ru1.92 .

+ 28 - 21
src/views/nfc-interaction/nfcInteraction.vue

@@ -50,7 +50,14 @@
         </el-row>
 
         <el-row style="margin: 20px 20px 0 20px" :gutter="30">
-          <el-col :span="8">
+          <el-col :span="12">
+            <el-table :data="functionTable" border stripe style="width: 100%">
+              <el-table-column prop="item" label="小组件"/>
+              <el-table-column prop="value" label="统计次数"/>
+            </el-table>
+          </el-col>
+
+          <el-col :span="12">
             <el-scrollbar wrap-class="scrollbar-wrapper" :style="{height: (asideHeight)+'px'}" >
               <div style="padding: 10px">
                 <el-timeline v-if="this.nfcInteractionList.length > 0" style="margin: 10px">
@@ -76,21 +83,6 @@
               </div>
             </el-scrollbar>
           </el-col>
-
-          <el-col :span="16">
-            <el-collapse v-model="activeName" style="margin: 10px">
-              <el-collapse-item v-for="(item, index) in functions" :index="index+''" :key="index" :title="titleStr(item)" :name="item.function_code">
-                <span style="margin: 10px"> {{ nfcInteractionList.length }} </span>
-              </el-collapse-item>
-            </el-collapse>
-          </el-col>
-<!--          <div class="table-wrapper" style="margin: 15px">-->
-<!--            <el-table :data="tableData" :default-sort = "{prop: 'count', order: 'descending'}" stripe border style="width: 100%">-->
-<!--              <el-table-column type="index" width="100" :label="this.$t('action.index')" align="center" />-->
-<!--              <el-table-column prop="name" :label="this.$t('interaction.actionType')" min-width="130" align="center" />-->
-<!--              <el-table-column prop="count" :label="this.$t('interaction.actionTime')" min-width="130" align="center" sortable />-->
-<!--            </el-table>-->
-<!--          </div>-->
         </el-row>
       </el-col>
     </el-row>
@@ -156,7 +148,8 @@ export default {
       clerkList: [],
       currentClerk: {},
       functions: [],
-      activeName: ''
+      activeName: '',
+      functionTable: []
     }
   },
   mounted() {
@@ -190,6 +183,7 @@ export default {
         this.clerkList = {...res}
         this.currentClerk = {...this.clerkList[Object.keys(this.clerkList)[0]][0]}
         this.param.clerk_id = this.currentClerk.clerk_id
+        this.getNfcInteraction()
         // this.calendarOnClick(this.value)
       })
     },
@@ -200,12 +194,10 @@ export default {
     // 获取选择月的nfc数据
     getNfcInteraction() {
       this.loading = true
-      console.log(this.param.clerk_id)
-      console.log(this.param)
       API_nfcInteraction.get_list_by_clerk_id(this.param).then(r => {
         this.nfcInteractionList = r.filter(i => i.components_type !== FUNCTION_TYPE.MANAGE_BED);
-        console.log(this.nfcInteractionList)
         this.loading = false;
+        this.getFunctionTable();
       })
     },
     /** 年月份发生变化 */
@@ -224,7 +216,7 @@ export default {
       else if (date.type === 'DATE') {
         this.value = date.date_val
 
-        this.param.type = 'MONTH'
+        this.param.type = 'DATE'
         this.param.year = this.value.getFullYear()
         this.param.month = this.checkTime(this.value.getMonth() + 1)
         this.param.day = this.checkTime(this.value.getDate())
@@ -273,6 +265,21 @@ export default {
     getFunctionString(param) {
       return FUNCTION_TYPE.getDescFromValue(param)
     },
+    getLengthByFunction(functionType) {
+      return this.nfcInteractionList.filter(p =>
+          p.components_type === functionType
+      ).length
+    },
+    // 组建一个表格数据
+    getFunctionTable(){
+      this.functionTable = []
+      for (let i = 0; i < this.functions.length; i++) {
+        this.functionTable.push({
+          "item" : FUNCTION_TYPE.getDescFromValue(this.functions[i].function_code),
+          "value" : this.getLengthByFunction(this.functions[i].function_code)
+        })
+      }
+    }
   }
 }
 </script>