소스 검색

fix: some bugs

Casper Dai 1 년 전
부모
커밋
9093db476c

+ 4 - 4
.env.development

@@ -12,8 +12,8 @@ VUE_APP_OFFLINE_MAP_GATEWAY = '127.0.0.1'
 VUE_APP_OFFLINE_MAP_PROXY = '/tiles'
 
 # 84服务器 10.180.88.84:8093
-VUE_APP_GATEWAY = 'isoc.artaplay.com:8443'
-VUE_APP_KEYCLOAK_OPTIONS_URL = 'https://isoc.artaplay.com:8443/auth'
+# VUE_APP_GATEWAY = 'isoc.artaplay.com:8443'
+# VUE_APP_KEYCLOAK_OPTIONS_URL = 'https://isoc.artaplay.com:8443/auth'
 # 71服务器 10.180.88.71:6443
 # VUE_APP_GATEWAY = 'isoc.artaplay.com:7443'
 # VUE_APP_KEYCLOAK_OPTIONS_URL = 'https://isoc.artaplay.com:8443/auth'
@@ -24,5 +24,5 @@ VUE_APP_KEYCLOAK_OPTIONS_URL = 'https://isoc.artaplay.com:8443/auth'
 # VUE_APP_GATEWAY = 'msr.inspur.com:8084'
 # VUE_APP_KEYCLOAK_OPTIONS_URL = 'https://msr.inspur.com:8084/auth'
 # 屏管家
-# VUE_APP_GATEWAY = '172.31.4.238'
-# VUE_APP_KEYCLOAK_OPTIONS_URL = 'http://172.31.4.238/auth'
+VUE_APP_GATEWAY = '172.31.4.238'
+VUE_APP_KEYCLOAK_OPTIONS_URL = 'http://172.31.4.238/auth'

+ 2 - 2
feature.js

@@ -29,8 +29,8 @@ module.exports = {
     ...createFeature('__TAKEOVER__'),
     ...createFeature('__ALARM_SMS__'),
     ...createFeature('__ALARM_EMAIL__'),
-    ...createFeature('__WECHAT_OFFICIAL__'),
-    ...createFeature('__WECHAT_APPLAT__'),
+    ...createFeature('__ALARM_WECHAT_OFFICIAL__'),
+    ...createFeature('__ALARM_WECHAT_APPLAT__'),
     ...createFeature('__JUMP_REVIEW__')
   }
 }

+ 22 - 2
src/constant.js

@@ -373,8 +373,8 @@ export const AlarmLevelInfo = {
 export const AlarmStrategies = [
   { key: 'note', label: '短信', support: __ALARM_SMS__ },
   { key: 'email', label: '邮件', support: __ALARM_EMAIL__ },
-  { key: 'wechat', label: '公众号', support: __WECHAT_OFFICIAL__ },
-  { key: 'wechatApplet', label: '小程序', support: __WECHAT_APPLAT__ }
+  { key: 'wechat', label: '公众号', support: __ALARM_WECHAT_OFFICIAL__ },
+  { key: 'wechatApplet', label: '小程序', support: __ALARM_WECHAT_APPLAT__ }
 ]
 
 export const SupportedAlarmStrategies = AlarmStrategies.filter(({ support }) => support)
@@ -503,3 +503,23 @@ export const TaskOperateType = {
   STATUS: 3,
   ADD: 4
 }
+
+export const AsyncTaskStatus = {
+  PROCESSING: 0,
+  SUCCESS: 1,
+  FAILURE: 2
+}
+
+export const AsyncTaskType = {
+  SCREEN_BROADCAST: 1,
+  SCREEN_ONLINE: 2,
+  PEOPLE_COUNTING: 3,
+  ONLINE_DURATION: 4
+}
+
+export const AsyncTaskTypeInfo = {
+  [AsyncTaskType.SCREEN_BROADCAST]: '大屏播出单',
+  [AsyncTaskType.SCREEN_ONLINE]: '大屏上下线记录',
+  [AsyncTaskType.PEOPLE_COUNTING]: '人流量统计',
+  [AsyncTaskType.ONLINE_DURATION]: '在线时长'
+}

+ 1 - 0
src/views/device/detail/components/DeviceInfo/components/Power.vue

@@ -132,6 +132,7 @@ export default {
   },
   methods: {
     getCachePowers () {
+      clearInterval(this.$cacheTimer)
       if (this.$tableData[GET_POWER_STATUS]) {
         return Promise.resolve({
           data: this.$tableData[GET_POWER_STATUS] || []

+ 2 - 5
src/views/realm/report/components/PeopleCountingDialog.vue

@@ -49,13 +49,10 @@ export default {
       this.$refs.dialog.show()
     },
     onConfirm (done) {
-      const time = this.dateRange[0] === this.dateRange[1] ? this.dateRange[0] : `${this.dateRange[0]}~${this.dateRange[1]}`
-      const endDate = new Date(this.dateRange[1].replace(/-/g, '/'))
-      endDate.setDate(endDate.getDate())
       getPeopleCoutingExcel({
         startDate: this.dateRange[0],
-        endDate: parseTime(endDate, '{y}-{m}-{d}')
-      }, time).then(({ data: { type } }) => {
+        endDate: this.dateRange[1]
+      }).then(({ data: { type } }) => {
         this.$emit('added', type)
         done()
       })

+ 15 - 20
src/views/realm/report/components/ServerAsyncTaskDialog.vue

@@ -9,17 +9,12 @@
 
 <script>
 import {
-  TaskStatus, TaskOperateType
+  AsyncTaskStatus,
+  AsyncTaskType,
+  AsyncTaskTypeInfo
 } from '@/constant.js'
 import { getServerAsyncTasks } from '../api.js'
 
-const TypeInfo = {
-  [TaskOperateType.DEPRECATED_STATUS]: '大屏播出单',
-  [TaskOperateType.DEPRECATED_ADD]: '大屏上下线记录',
-  [TaskOperateType.STATUS]: '人流量统计',
-  [TaskOperateType.ADD]: '在线时长'
-}
-
 export default {
   name: 'ServerAsyncTaskDialog',
   data () {
@@ -35,20 +30,20 @@ export default {
         refreshInterval: 5000,
         condition: { type: this.type },
         filters: [
-          { key: 'type', type: 'select', options: [
-            { value: TaskOperateType.DEPRECATED_STATUS, label: '大屏播出单' },
-            { value: TaskOperateType.DEPRECATED_ADD, label: '大屏上下线记录' },
-            { value: TaskOperateType.STATUS, label: '人流量统计' },
-            { value: TaskOperateType.ADD, label: '在线时长' }
-          ], placeholder: '任务类型' },
+          { key: 'type', type: 'select', options: Object.keys(AsyncTaskType).map(key => {
+            return {
+              value: AsyncTaskType[key],
+              label: AsyncTaskTypeInfo[AsyncTaskType[key]]
+            }
+          }), placeholder: '任务类型' },
           { key: 'status', type: 'select', options: [
-            { value: TaskStatus.CANCELLED, label: '待完成' },
-            { value: TaskStatus.DISABLE, label: '已完成' },
-            { value: TaskStatus.ENABLE, label: '下载失败' }
-          ], placeholder: '状态' }
+            { value: AsyncTaskStatus.PROCESSING, label: '进行中' },
+            { value: AsyncTaskStatus.SUCCESS, label: '已完成' },
+            { value: AsyncTaskStatus.FAILURE, label: '下载失败' }
+          ], placeholder: '任务状态' }
         ],
         cols: [
-          { label: '任务类型', render: ({ type }) => TypeInfo[type] },
+          { label: '任务类型', render: ({ type }) => AsyncTaskTypeInfo[type] },
           { prop: 'createTime', label: '创建时间' },
           { type: 'tag', render: ({ status }) => {
             return {
@@ -57,7 +52,7 @@ export default {
             }
           } },
           { type: 'invoke', render: [
-            { label: '下载报表', allow: ({ status }) => status !== 0 && status !== 2, on: this.onDownload }
+            { label: '下载报表', allow: ({ status }) => status === AsyncTaskStatus.SUCCESS, on: this.onDownload }
           ], width: 160 }
         ]
       }

+ 0 - 5
src/views/realm/report/index.vue

@@ -183,11 +183,6 @@ export default {
   computed: {
     ...mapGetters(['isGroupAdmin', 'isTopGroup'])
   },
-  watch: {
-    deviceId () {
-      this.$refs.table?.pageTo(1)
-    }
-  },
   methods: {
     getDeviceExcel () {
       getDeviceExcel()