Sfoglia il codice sorgente

feat: content protection

add wanning component <warning @retry="xx" />
Casper Dai 3 anni fa
parent
commit
22ff05e329
54 ha cambiato i file con 276 aggiunte e 253 eliminazioni
  1. 7 7
      src/api/external.js
  2. 0 30
      src/api/publish.js
  3. 8 8
      src/components/CTable/index.vue
  4. 3 13
      src/components/DeviceTree/index.vue
  5. 1 1
      src/components/EventTargetChoose/index.vue
  6. 1 1
      src/components/Schedule/components/ProgramChoose.vue
  7. 3 13
      src/components/Schedule/components/ScheduleWrapper.vue
  8. 3 18
      src/components/StatusWrapper/index.vue
  9. 24 0
      src/components/Warning/index.vue
  10. 2 2
      src/constant.js
  11. 2 0
      src/main.js
  12. 9 2
      src/router/index.js
  13. 2 2
      src/utils/event.js
  14. 1 1
      src/views/basic/logger/index.vue
  15. 25 29
      src/views/basic/media/index.vue
  16. 3 13
      src/views/basic/profile/index.vue
  17. 2 2
      src/views/basic/upgrade/deploy/index.vue
  18. 1 1
      src/views/basic/upgrade/index.vue
  19. 1 1
      src/views/bigscreen/ast/Designer.vue
  20. 1 1
      src/views/bigscreen/designer/index.vue
  21. 3 13
      src/views/device/back/index.vue
  22. 1 1
      src/views/device/category/index.vue
  23. 1 1
      src/views/device/detail/components/DeviceAlarm.vue
  24. 12 0
      src/views/device/detail/components/DeviceInfo.vue
  25. 1 1
      src/views/device/detail/components/DeviceRuntime/Download.vue
  26. 1 1
      src/views/device/detail/components/DeviceRuntime/DownloadProgress.vue
  27. 1 1
      src/views/device/detail/components/DeviceRuntime/Running.vue
  28. 0 0
      src/views/device/detail/components/DeviceRuntime/ScreenShot.vue
  29. 0 0
      src/views/device/detail/components/DeviceRuntime/index.vue
  30. 2 2
      src/views/device/detail/components/DeviceSensor/Sensor.vue
  31. 0 0
      src/views/device/detail/components/DeviceSensor/index.vue
  32. 83 0
      src/views/device/detail/components/external/ContentProtection.vue
  33. 1 1
      src/views/device/detail/components/external/ReceivingCard/ReceivingCardInfo.vue
  34. 2 2
      src/views/device/detail/components/external/ReceivingCard/ReceivingCardInfoEdit.vue
  35. 3 3
      src/views/device/detail/components/external/ReceivingCard/ReceivingCardTopology.vue
  36. 7 17
      src/views/device/detail/components/external/ReceivingCard/index.vue
  37. 28 26
      src/views/device/detail/index.vue
  38. 3 3
      src/views/device/group/index.vue
  39. 1 1
      src/views/device/index.vue
  40. 1 1
      src/views/device/product/index.vue
  41. 4 14
      src/views/device/remote/index.vue
  42. 1 1
      src/views/external/transmitter/index.vue
  43. 0 0
      src/views/platform/debug/debug.js
  44. 0 0
      src/views/platform/debug/index.vue
  45. 1 1
      src/views/review/components/ReviewAsset.vue
  46. 1 1
      src/views/review/components/ReviewProgram.vue
  47. 1 1
      src/views/review/components/ReviewProgramRecur.vue
  48. 1 1
      src/views/review/components/ReviewPublish.vue
  49. 1 1
      src/views/review/components/ReviewSchedule.vue
  50. 1 1
      src/views/schedule/deploy/complex.vue
  51. 1 1
      src/views/schedule/deploy/index.vue
  52. 1 1
      src/views/schedule/history/index.vue
  53. 1 1
      src/views/schedule/index.vue
  54. 12 10
      src/views/schedule/timeline/index.vue

+ 7 - 7
src/api/external.js

@@ -73,18 +73,18 @@ export function deleteSendCard ({ id, name }) {
   }, name)
 }
 
-export function getContentProtection (deviceId) {
+export function getContentProtection (deviceId, options) {
   return request({
     url: `/device/contentProtect/${deviceId}`,
-    method: 'GET'
+    method: 'GET',
+    ...options
   })
 }
 
 const contentProtectConfig = {
-  x: 0,
-  y: 0,
-  inputCard: [
-    { cardId: '01', srcId: '00' }
+  x: 1, y: 1,
+  inputCards: [
+    { cardId: 1, srcId: 0 }
   ],
   colors: [
     { order: 0, r: 0, g: 0, b: 0 },
@@ -98,7 +98,7 @@ const contentProtectConfig = {
 
 export function updateContentProtection (deviceId, protect) {
   return messageSend({
-    url: `/device/contentProtect/${deviceId}`,
+    url: '/device/contentProtect',
     method: 'POST',
     data: {
       deviceId, protect,

+ 0 - 30
src/api/publish.js

@@ -93,34 +93,4 @@ export function getTimeline (deviceId, options) {
     }
     return events
   })
-  // return Promise.resolve({
-  //   data: {
-  //     eventDetail: JSON.stringify([
-  //       {
-  //         priority: 1,
-  //         freq: 'WEEKLY',
-  //         start: '2022-04-20 00:00:00',
-  //         until: '2022-05-22 00:00:00',
-  //         byDay: '0,4,6',
-  //         startTime: '00:00:00',
-  //         endTime: '00:00:00',
-  //         target: { name: 't1' }
-  //       },
-  //       {
-  //         priority: 1,
-  //         freq: 'ONCE',
-  //         start: '2022-04-22 10:00:00',
-  //         until: '2022-04-22 20:00:00',
-  //         target: { name: 't2' }
-  //       },
-  //       {
-  //         priority: 2,
-  //         freq: 'ONCE',
-  //         start: '2022-04-21 22:00:00',
-  //         until: '2022-04-21 23:00:00',
-  //         target: { name: 't2' }
-  //       }
-  //     ])
-  //   }
-  // })
 }

+ 8 - 8
src/components/CTable/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div
-    v-loading="curr.loading"
+    v-loading="options.loading"
     class="l-flex__auto l-flex--col"
   >
     <div class="l-flex__none l-flex--row c-table__header">
@@ -10,7 +10,7 @@
       ref="table"
       class="l-flex--col c-table"
       :class="{ 'prevent-copy': preventCopy }"
-      :data="curr.list"
+      :data="options.list"
       v-bind="$attrs"
       @row-click="onClick"
       @row-dblclick="onRowClick"
@@ -19,16 +19,16 @@
       <slot />
       <status-wrapper
         slot="empty"
-        :error="curr.error"
+        :error="options.error"
         @retry="onPagination"
       />
     </el-table>
     <pagination
-      v-if="curr.params"
-      :total="curr.totalCount"
+      v-if="options.params"
+      :total="options.totalCount"
       :page-sizes="pageSizes"
-      :page.sync="curr.params.pageNum"
-      :limit.sync="curr.params.pageSize"
+      :page.sync="options.params.pageNum"
+      :limit.sync="options.params.pageSize"
       @pagination="onPagination"
     />
   </div>
@@ -43,7 +43,7 @@ export default {
     Pagination
   },
   props: {
-    curr: {
+    options: {
       type: Object,
       default () {
         return {}

+ 3 - 13
src/components/DeviceTree/index.vue

@@ -3,20 +3,10 @@
     v-loading="loading"
     class="l-flex--col c-tree"
   >
-    <el-result
+    <warning
       v-if="error"
-      icon="warning"
-    >
-      <template #extra>
-        <el-link
-          class="u-pointer"
-          type="warning"
-          @click="getDevices"
-        >
-          出错了,点击重试
-        </el-link>
-      </template>
-    </el-result>
+      @retry="getDevices"
+    />
     <template v-else>
       <div class="l-flex__none l-flex--row">
         <div class="l-flex__auto" />

+ 1 - 1
src/components/EventTargetChoose/index.vue

@@ -4,7 +4,7 @@
     class="l-flex__auto l-flex--col"
   >
     <c-table
-      :curr="options"
+      :options="options"
       @pagination="getList"
       @row-dblclick="choose"
     >

+ 1 - 1
src/components/Schedule/components/ProgramChoose.vue

@@ -4,7 +4,7 @@
     class="l-flex__auto l-flex--col"
   >
     <c-table
-      :curr="options"
+      :options="options"
       @pagination="getList"
       @row-dblclick="choose"
     >

+ 3 - 13
src/components/Schedule/components/ScheduleWrapper.vue

@@ -4,20 +4,10 @@
     class="l-flex--col c-schedule-wrapper"
     @click.stop
   >
-    <el-result
+    <warning
       v-if="error"
-      icon="warning"
-    >
-      <template #extra>
-        <el-link
-          class="u-pointer"
-          type="warning"
-          @click="retry"
-        >
-          出错了,点击重试
-        </el-link>
-      </template>
-    </el-result>
+      @retry="retry"
+    />
     <template v-if="!error && !loading">
       <div
         v-if="!hideHeader"

+ 3 - 18
src/components/StatusWrapper/index.vue

@@ -1,19 +1,9 @@
 <template>
   <div class="c-status-wrapper">
-    <el-result
+    <warning
       v-if="error"
-      icon="warning"
-    >
-      <template #extra>
-        <el-link
-          class="u-pointer"
-          type="warning"
-          @click="retry"
-        >
-          出错了,点击重试
-        </el-link>
-      </template>
-    </el-result>
+      v-on="$listeners"
+    />
     <el-empty
       v-else
       description="暂无数据"
@@ -30,11 +20,6 @@ export default {
       type: [Boolean, String],
       default: false
     }
-  },
-  methods: {
-    retry () {
-      this.$emit('retry')
-    }
   }
 }
 </script>

+ 24 - 0
src/components/Warning/index.vue

@@ -0,0 +1,24 @@
+<template>
+  <el-result icon="warning">
+    <template #extra>
+      <el-link
+        type="warning"
+        @click="retry"
+      >
+        获取失败,点击重试
+      </el-link>
+    </template>
+  </el-result>
+</template>
+
+<script>
+
+export default {
+  name: 'Warning',
+  methods: {
+    retry () {
+      this.$emit('retry')
+    }
+  }
+}
+</script>

+ 2 - 2
src/constant.js

@@ -46,7 +46,7 @@ export const EventTarget = {
 }
 
 export const Access = {
-  DEBUG: 'frontend:debug',
+  SUPER_ADMIN: 'frontend:admin',
 
   VIEW_SENSORS: 'view-sensors',
   VIEW_CAMERAS: 'view-cameras',
@@ -70,7 +70,7 @@ export const Access = {
 
 export const RoleAccess = {
   [Role.ADMIN]: [
-    Access.DEBUG,
+    Access.SUPER_ADMIN,
     Access.VIEW_LOGS,
     Access.MANAGE_PROFILE,
     Access.MANAGE_PRODUCTS,

+ 2 - 0
src/main.js

@@ -25,6 +25,7 @@ import EditInput from './components/EditInput'
 import SearchInput from './components/SearchInput'
 import Schedule from './components/Schedule'
 import ConfirmDialog from './components/ConfirmDialog'
+import Warning from './components/Warning'
 
 import {
   showLoading,
@@ -46,6 +47,7 @@ function startApp () {
   Vue.component('SearchInput', SearchInput)
   Vue.component('Schedule', Schedule)
   Vue.component('ConfirmDialog', ConfirmDialog)
+  Vue.component('Warning', Warning)
 
   Vue.prototype.$keycloak = keycloak
   Vue.prototype.$showLoading = showLoading

+ 9 - 2
src/router/index.js

@@ -254,6 +254,13 @@ export const asyncRoutes = [
         component: () => import('@/views/device/product/index'),
         access: Access.MANAGE_PRODUCTS,
         meta: { title: '产品管理' }
+      },
+      {
+        name: 'transfer',
+        path: 'transfer',
+        component: () => import('@/views/platform/transfer/index'),
+        access: Access.SUPER_ADMIN,
+        meta: { title: '数据迁移' }
       }
     ]
   },
@@ -274,13 +281,13 @@ export const asyncRoutes = [
   {
     path: '/d',
     component: Layout,
-    access: Access.DEBUG,
+    access: Access.SUPER_ADMIN,
     meta: { icon: 'bug' },
     children: [
       {
         path: '',
         name: 'debug',
-        component: () => import('@/views/basic/debug/index'),
+        component: () => import('@/views/platform/debug/index'),
         meta: { title: '调试' }
       }
     ]

+ 2 - 2
src/utils/event.js

@@ -292,10 +292,10 @@ function transformDeviceProgramToEvent ({ type, programCalendarId, startTimestam
       name: '未知'
     },
     invoke () {
-      EventCache.getName(this.target.type, this.target.id).then(name => {
+      delete this.invoke
+      return EventCache.getName(this.target.type, this.target.id).then(name => {
         this.target.name = name
       })
-      this.invoke = null
     }
   }
   return event

+ 1 - 1
src/views/basic/logger/index.vue

@@ -6,7 +6,7 @@
     background
   >
     <c-table
-      :curr="options"
+      :options="options"
       @row-click="onClick"
       @pagination="getList"
     >

+ 25 - 29
src/views/basic/media/index.vue

@@ -65,7 +65,7 @@
       </el-tabs>
       <c-table
         class="has-padding"
-        :curr="currObj"
+        :options="currOptions"
         @pagination="getList"
       >
         <el-table-column
@@ -128,7 +128,7 @@
             <div
               v-if="canSubmit"
               class="c-table__btn u-pointer"
-              @click="toSubmit(scope.row)"
+              @click="onSubmit(scope.row)"
             >
               提交
             </div>
@@ -205,7 +205,7 @@ export default {
     }
   },
   computed: {
-    currObj () {
+    currOptions () {
       return this[this.type][this.active]
     },
     isImage () {
@@ -240,22 +240,22 @@ export default {
         this.search()
       }
     },
-    onTabClick (active) {
+    onTabClick () {
       this.getList()
     },
     to (type) {
       if (this.type !== AssetType[type]) {
         this.type = AssetType[type]
-        if (this.currObj.totalCount === 0 || this.currObj.error) {
+        if (this.currOptions.totalCount === 0 || this.currOptions.error) {
           this.getList()
         }
       }
     },
     search () {
-      const currObj = this.currObj
-      currObj.list = []
-      currObj.totalCount = 0
-      currObj.params.pageNum = 1
+      const options = this.currOptions
+      options.list = []
+      options.totalCount = 0
+      options.params.pageNum = 1
       this.getList()
     },
     transform (asset) {
@@ -269,29 +269,29 @@ export default {
       return asset
     },
     getList () {
-      const currObj = this.currObj
-      if (!currObj.loading) {
-        currObj.error = false
-        currObj.loading = true
+      const options = this.currOptions
+      if (!options.loading) {
+        options.error = false
+        options.loading = true
         getAssets({
           type: this.type,
           status: this.status,
-          ...currObj.params
+          ...options.params
         }).then(({ data, totalCount }) => {
-          currObj.list = data.map(this.transform)
-          currObj.totalCount = totalCount
+          options.list = data.map(this.transform)
+          options.totalCount = totalCount
         }, () => {
-          currObj.error = true
-          currObj.list = []
+          options.error = true
+          options.list = []
         }).finally(() => {
-          currObj.loading = false
+          options.loading = false
         })
       }
     },
     reloadList () {
-      const currObj = this.currObj
-      if (currObj.list.length === 1 && currObj.params.pageNum > 1) {
-        currObj.params.pageNum -= 1
+      const options = this.currOptions
+      if (options.list.length === 1 && options.params.pageNum > 1) {
+        options.params.pageNum -= 1
       }
       this.getList()
     },
@@ -320,15 +320,11 @@ export default {
         keyName: asset.keyName
       })
     },
-    toSubmit (asset) {
-      submitAsset(asset).then(() => {
-        this.reloadList()
-      })
+    onSubmit (asset) {
+      submitAsset(asset).then(this.reloadList())
     },
     onDel (asset) {
-      deleteAsset(asset).then(() => {
-        this.reloadList()
-      })
+      deleteAsset(asset).then(this.reloadList())
     }
   }
 }

+ 3 - 13
src/views/basic/profile/index.vue

@@ -26,20 +26,10 @@
       <div class="u-bold">{{ name }}</div>
     </div>
     <div class="l-flex__fill u-overflow-y--auto">
-      <el-result
+      <warning
         v-if="error"
-        icon="warning"
-      >
-        <template #extra>
-          <el-link
-            class="u-pointer"
-            type="warning"
-            @click="getUserInfo"
-          >
-            出错了,点击重试
-          </el-link>
-        </template>
-      </el-result>
+        @retry="getUserInfo"
+      />
       <div
         v-else
         class="c-form"

+ 2 - 2
src/views/basic/upgrade/deploy/index.vue

@@ -6,7 +6,7 @@
     background
   >
     <c-table
-      :curr="options"
+      :options="options"
       @pagination="getList"
     >
       <template #header>
@@ -197,7 +197,7 @@
     >
       <c-table
         v-if="choosingApk"
-        :curr="apkOptions"
+        :options="apkOptions"
         @pagination="getApks"
         @row-dblclick="chosenApk"
       >

+ 1 - 1
src/views/basic/upgrade/index.vue

@@ -6,7 +6,7 @@
     background
   >
     <c-table
-      :curr="options"
+      :options="options"
       @pagination="getList"
     >
       <template #header>

+ 1 - 1
src/views/bigscreen/ast/Designer.vue

@@ -355,7 +355,7 @@
       </template>
       <c-table
         v-else
-        :curr="assetOptions"
+        :options="assetOptions"
         @pagination="getAssets"
         @row-dblclick="chooseAsset"
       >

+ 1 - 1
src/views/bigscreen/designer/index.vue

@@ -355,7 +355,7 @@
       </template>
       <c-table
         v-else
-        :curr="assetOptions"
+        :options="assetOptions"
         @pagination="getAssets"
         @row-dblclick="chooseAsset"
       >

+ 3 - 13
src/views/device/back/index.vue

@@ -58,20 +58,10 @@
           @pagination="getDevices"
         />
       </div>
-      <el-result
+      <warning
         v-if="returnList.error"
-        icon="warning"
-      >
-        <template #extra>
-          <el-link
-            class="u-pointer"
-            type="warning"
-            @click="getDevices"
-          >
-            出错了,点击重试
-          </el-link>
-        </template>
-      </el-result>
+        @retry="getDevices"
+      />
     </div>
   </wrapper>
 </template>

+ 1 - 1
src/views/device/category/index.vue

@@ -6,7 +6,7 @@
     background
   >
     <c-table
-      :curr="options"
+      :options="options"
       @pagination="getList"
     >
       <template #header>

+ 1 - 1
src/views/device/detail/components/DeviceAlarm.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <c-table
-      :curr="options"
+      :options="options"
       @pagination="getList"
     >
       <el-table-column

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

@@ -48,6 +48,14 @@
         <div class="l-flex__fill c-info__value primary">{{ device.remark }}</div>
       </div>
     </div>
+    <div class="l-flex--row c-info__block">
+      <div class="l-flex--row l-flex__fill c-info__item">
+        <div class="l-flex__none c-info__title">内容保护</div>
+        <div class="l-flex__fill c-info__value primary">
+          <content-protection :device="device" />
+        </div>
+      </div>
+    </div>
     <confirm-dialog
       ref="editDialog"
       title="编辑"
@@ -81,9 +89,13 @@
 
 <script>
 import { updateDevice } from '@/api/device'
+import ContentProtection from './external/ContentProtection'
 
 export default {
   name: 'DeviceInfo',
+  components: {
+    ContentProtection
+  },
   props: {
     device: {
       type: Object,

+ 1 - 1
src/views/device/detail/components/Download.vue → src/views/device/detail/components/DeviceRuntime/Download.vue

@@ -36,7 +36,7 @@
 import {
   addListener,
   removeListener
-} from '../monitor'
+} from '../../monitor'
 import DownloadProgress from './DownloadProgress'
 
 export default {

+ 1 - 1
src/views/device/detail/components/DownloadProgress.vue → src/views/device/detail/components/DeviceRuntime/DownloadProgress.vue

@@ -38,7 +38,7 @@
 import {
   addListener,
   removeListener
-} from '../monitor'
+} from '../../monitor'
 
 export default {
   name: 'DownloadProgress',

+ 1 - 1
src/views/device/detail/components/Running.vue → src/views/device/detail/components/DeviceRuntime/Running.vue

@@ -29,7 +29,7 @@ import {
   addListener,
   removeListener,
   send
-} from '../monitor'
+} from '../../monitor'
 
 export default {
   name: 'DeviceRunning',

+ 0 - 0
src/views/device/detail/components/ScreenShot.vue → src/views/device/detail/components/DeviceRuntime/ScreenShot.vue


+ 0 - 0
src/views/device/detail/components/DeviceRuntime.vue → src/views/device/detail/components/DeviceRuntime/index.vue


+ 2 - 2
src/views/device/detail/components/Sensor.vue → src/views/device/detail/components/DeviceSensor/Sensor.vue

@@ -41,7 +41,7 @@
       custom-class="c-dialog"
     >
       <c-table
-        :curr="options"
+        :options="options"
         @pagination="getSensors"
       >
         <el-table-column
@@ -70,7 +70,7 @@ import {
   Type,
   addListener,
   removeListener
-} from '../monitor'
+} from '../../monitor'
 
 export default {
   name: 'DeviceSensor',

+ 0 - 0
src/views/device/detail/components/DeviceSensor.vue → src/views/device/detail/components/DeviceSensor/index.vue


+ 83 - 0
src/views/device/detail/components/external/ContentProtection.vue

@@ -0,0 +1,83 @@
+<script>
+import {
+  getContentProtection,
+  updateContentProtection
+} from '@/api/external'
+
+export default {
+  name: 'ContentProtection',
+  props: {
+    device: {
+      type: Object,
+      default: null
+    }
+  },
+  data () {
+    return {
+      loading: true,
+      error: false,
+      open: false
+    }
+  },
+  computed: {
+    canEdit () {
+      return this.accessSet.has(this.Access.MANAGE_DEVICES) || this.accessSet.has(this.Access.MANAGE_DEVICE)
+    }
+  },
+  created () {
+    this.getContentProtection()
+  },
+  methods: {
+    getContentProtection () {
+      this.loading = true
+      this.error = false
+      getContentProtection(this.device.id, { custom: true }).then(
+        ({ data }) => {
+          this.open = data ? data.protect : false
+        },
+        () => {
+          this.error = true
+        }
+      ).finally(() => {
+        this.loading = false
+      })
+    },
+    toggle () {
+      const open = !this.open
+      updateContentProtection(this.device.id, open).then(() => {
+        this.open = open
+      })
+    }
+  },
+  render (h) {
+    if (this.loading) {
+      return h('i', {
+        class: 'el-icon-loading'
+      })
+    }
+    if (this.error) {
+      return h('el-link', {
+        props: {
+          type: 'warning'
+        },
+        on: {
+          click: this.getContentProtection
+        }
+      }, ['获取失败,点击重试'])
+    }
+    if (this.canEdit) {
+      return h('el-switch', {
+        props: {
+          value: this.open,
+          'active-color': '#13ce66',
+          'inactive-color': '#ff4949'
+        },
+        on: {
+          change: this.toggle
+        }
+      })
+    }
+    return h('div', null, this.open ? '已启用' : '未启用')
+  }
+}
+</script>

+ 1 - 1
src/views/device/detail/components/ReceivingCardInfo.vue → src/views/device/detail/components/external/ReceivingCard/ReceivingCardInfo.vue

@@ -38,7 +38,7 @@
 
 <script>
 export default {
-  name: 'DeviceReceivingCardInfo',
+  name: 'ReceivingCardInfo',
   props: {
     info: {
       type: Object,

+ 2 - 2
src/views/device/detail/components/ReceivingCardInfoEdit.vue → src/views/device/detail/components/external/ReceivingCard/ReceivingCardInfoEdit.vue

@@ -212,10 +212,10 @@ import {
   getReceivingCardManufacturers,
   addReceivingCard,
   updateReceivingCard
-} from '@/api/device'
+} from '@/api/external'
 
 export default {
-  name: 'DeviceReceivingCardInfoEdit',
+  name: 'ReceivingCardInfoEdit',
   props: {
     info: {
       type: Object,

+ 3 - 3
src/views/device/detail/components/ReceivingCardTopology.vue → src/views/device/detail/components/external/ReceivingCard/ReceivingCardTopology.vue

@@ -26,14 +26,14 @@
 </template>
 
 <script>
-import { getReceivingCardTopology } from '@/api/device'
+import { getReceivingCardTopology } from '@/api/external'
 import {
   addListener,
   removeListener
-} from '../monitor'
+} from '@/views/device/detail/monitor'
 
 export default {
-  name: 'DeviceReceivingCardTopology',
+  name: 'ReceivingCardTopology',
   props: {
     info: {
       type: Object,

+ 7 - 17
src/views/device/detail/components/DeviceScreen.vue → src/views/device/detail/components/external/ReceivingCard/index.vue

@@ -4,20 +4,10 @@
     class="l-flex--col"
   >
     <template v-if="!loading">
-      <el-result
+      <warning
         v-if="error"
-        icon="warning"
-      >
-        <template #extra>
-          <el-link
-            class="u-pointer"
-            type="warning"
-            @click="getDefaults"
-          >
-            出错了,点击重试
-          </el-link>
-        </template>
-      </el-result>
+        @retry="getDefaults"
+      />
       <template v-else>
         <tabs
           :items="tabs"
@@ -37,18 +27,18 @@
 </template>
 
 <script>
-import { getReceivingCard } from '@/api/device'
+import { getReceivingCard } from '@/api/external'
 import {
   send,
   reset
-} from '../monitor'
-import Tabs from './Tabs'
+} from '@/views/device/detail/monitor'
+import Tabs from '@/views/device/detail/components/Tabs'
 import ReceivingCardTopology from './ReceivingCardTopology'
 import ReceivingCardInfo from './ReceivingCardInfo'
 import ReceivingCardInfoEdit from './ReceivingCardInfoEdit'
 
 export default {
-  name: 'DeviceCard',
+  name: 'ReceivingCard',
   components: {
     Tabs,
     ReceivingCardTopology,

+ 28 - 26
src/views/device/detail/index.vue

@@ -30,20 +30,10 @@
           />
         </el-tabs>
       </template>
-      <el-result
+      <warning
         v-if="!loading && !device"
-        icon="warning"
-      >
-        <template #extra>
-          <el-link
-            class="u-pointer"
-            type="warning"
-            @click="getDevice"
-          >
-            出错了,点击重试
-          </el-link>
-        </template>
-      </el-result>
+        @retry="getDevice"
+      />
     </div>
     <div
       v-if="device"
@@ -73,7 +63,7 @@ import DeviceInfo from './components/DeviceInfo'
 import DeviceStatus from './components/DeviceStatus'
 import DeviceAlarm from './components/DeviceAlarm'
 import DeviceInvoke from './components/DeviceInvoke'
-import DeviceScreen from './components/DeviceScreen'
+// import ReceivingCard from './components/external/ReceivingCard'
 
 export default {
   name: 'DeviceDetail',
@@ -81,10 +71,11 @@ export default {
     DeviceInfo,
     DeviceStatus,
     DeviceAlarm,
-    DeviceInvoke,
-    DeviceScreen
+    DeviceInvoke/* ,
+    ReceivingCard */
   },
   data () {
+    const canEdit = this.accessSet.has(this.Access.MANAGE_DEVICES) || this.accessSet.has(this.Access.MANAGE_DEVICE)
     return {
       loading: true,
       device: null,
@@ -95,8 +86,8 @@ export default {
         { key: 'info', label: '设备信息' },
         { key: 'status', label: '运行状态' },
         { key: 'alarm', label: '设备告警' },
-        this.accessSet.has(this.Access.MANAGE_DEVICES) || this.accessSet.has(this.Access.MANAGE_DEVICE) ? { key: 'invoke', label: '设备操控' } : null,
-        { key: 'screen', label: '屏体状态监测' }
+        canEdit ? { key: 'invoke', label: '设备操控' } : null/* ,
+        { key: 'screen', label: '屏体状态监测' } */
       ].filter(val => val)
     }
   },
@@ -136,7 +127,7 @@ export default {
         case 'invoke':
           return 'DeviceInvoke'
         case 'screen':
-          return 'DeviceScreen'
+          return 'ReceivingCard'
         default:
           return ''
       }
@@ -162,14 +153,25 @@ export default {
       const id = this.deviceId
       getDevice(id).then(({ data }) => {
         if (this.deviceId === id) {
-          this.device = data
-          this.isActivated = data.activate === 2
-          this.isOnline = this.isActivated && data.onlineStatus === 1
-          if (!this.isOnline) {
-            ScreenshotCache.remove(id)
+          if (data) {
+            this.device = data
+            this.isActivated = data.activate === 2
+            this.isOnline = this.isActivated && data.onlineStatus === 1
+            if (!this.isOnline) {
+              ScreenshotCache.remove(id)
+            }
+            start(this.device)
+            addListener('online', this.onUpdate)
+          } else {
+            // this.error = false
+            this.$message({
+              type: 'warning',
+              message: '设备不存在'
+            })
+            this.$router.replace({
+              name: 'device-list'
+            })
           }
-          start(this.device)
-          addListener('online', this.onUpdate)
         }
       }).finally(() => {
         if (this.deviceId === id) {

+ 3 - 3
src/views/device/group/index.vue

@@ -6,7 +6,7 @@
     background
   >
     <c-table
-      :curr="options"
+      :options="options"
       @pagination="getList"
     >
       <template #header>
@@ -101,7 +101,7 @@
       custom-class="c-dialog large"
     >
       <c-table
-        :curr="groupOptions"
+        :options="groupOptions"
         @pagination="getDevicesByGroup"
       >
         <template #header>
@@ -166,7 +166,7 @@
       append-to-body
     >
       <c-table
-        :curr="deviceOptions"
+        :options="deviceOptions"
         @pagination="getDevices"
         @row-dblclick="chooseDevice"
       >

+ 1 - 1
src/views/device/index.vue

@@ -7,7 +7,7 @@
   >
     <c-table
       ref="table"
-      :curr="currOptions"
+      :options="currOptions"
       row-key="id"
       @pagination="getList"
       @row-click="onRowClick"

+ 1 - 1
src/views/device/product/index.vue

@@ -6,7 +6,7 @@
     background
   >
     <c-table
-      :curr="options"
+      :options="options"
       @pagination="getList"
     >
       <template #header>

+ 4 - 14
src/views/device/remote/index.vue

@@ -9,20 +9,10 @@
       v-loading="loading"
       class="l-flex__none l-flex--col c-sidebar has-padding"
     >
-      <el-result
+      <warning
         v-if="error"
-        icon="warning"
-      >
-        <template #extra>
-          <el-link
-            class="u-pointer"
-            type="warning"
-            @click="getGroups"
-          >
-            出错了,点击重试
-          </el-link>
-        </template>
-      </el-result>
+        @retry="getGroups"
+      />
       <template v-else>
         <div class="l-flex__none o-title">全部分组</div>
         <div class="l-flex__auto c-tree">
@@ -41,7 +31,7 @@
     <div class="l-flex__auto l-flex--col has-padding">
       <c-table
         ref="multipleTable"
-        :curr="options"
+        :options="options"
         row-key="id"
         @pagination="getList"
         @row-click="onRowClick"

+ 1 - 1
src/views/external/transmitter/index.vue

@@ -6,7 +6,7 @@
     background
   >
     <c-table
-      :curr="options"
+      :options="options"
       @pagination="getList"
     >
       <template #header>

+ 0 - 0
src/views/basic/debug/debug.js → src/views/platform/debug/debug.js


+ 0 - 0
src/views/basic/debug/index.vue → src/views/platform/debug/index.vue


+ 1 - 1
src/views/review/components/ReviewAsset.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="l-flex__auto l-flex--col has-padding">
     <c-table
-      :curr="options"
+      :options="options"
       @pagination="getList"
     >
       <el-table-column

+ 1 - 1
src/views/review/components/ReviewProgram.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="l-flex__auto l-flex--col has-padding">
     <c-table
-      :curr="options"
+      :options="options"
       @pagination="getList"
     >
       <el-table-column

+ 1 - 1
src/views/review/components/ReviewProgramRecur.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="l-flex__auto l-flex--col has-padding">
     <c-table
-      :curr="options"
+      :options="options"
       @pagination="getList"
     >
       <el-table-column

+ 1 - 1
src/views/review/components/ReviewPublish.vue

@@ -2,7 +2,7 @@
   <div class="l-flex__auto l-flex--col has-padding">
     <c-table
       ref="table"
-      :curr="options"
+      :options="options"
       @pagination="getList"
       @row-click="toggle"
     >

+ 1 - 1
src/views/review/components/ReviewSchedule.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="l-flex__auto l-flex--col has-padding">
     <c-table
-      :curr="options"
+      :options="options"
       @pagination="getList"
     >
       <el-table-column

+ 1 - 1
src/views/schedule/deploy/complex.vue

@@ -121,7 +121,7 @@
     >
       <c-table
         v-if="choosingSchedule"
-        :curr="scheduleOptions"
+        :options="scheduleOptions"
         @pagination="getSchedules"
         @row-dblclick="onChooseSchedule"
       >

+ 1 - 1
src/views/schedule/deploy/index.vue

@@ -68,7 +68,7 @@
     >
       <c-table
         v-if="choosing"
-        :curr="scheduleOptions"
+        :options="scheduleOptions"
         :row-class-name="getRowClassName"
         @pagination="getSchedules"
         @row-dblclick="choose"

+ 1 - 1
src/views/schedule/history/index.vue

@@ -7,7 +7,7 @@
   >
     <c-table
       ref="table"
-      :curr="options"
+      :options="options"
       @pagination="getList"
       @row-click="toggle"
     >

+ 1 - 1
src/views/schedule/index.vue

@@ -6,7 +6,7 @@
     background
   >
     <c-table
-      :curr="options"
+      :options="options"
       @pagination="getList"
     >
       <template #header>

+ 12 - 10
src/views/schedule/timeline/index.vue

@@ -120,11 +120,10 @@
                 class="l-flex--row c-timeline__programs has-padding--h"
               >
                 <el-link
-                  class="u-pointer"
                   type="warning"
                   @click.stop="getTimeline(item)"
                 >
-                  出错了,点击重试
+                  获取失败,点击重试
                 </el-link>
               </div>
               <template v-else-if="item.options.list.length">
@@ -359,15 +358,18 @@ export default {
       const options = device.options
       options.error = false
       options.loading = true
-      getTimeline(device.id).finally(() => {
+      getTimeline(device.id, { custom: true }).then(
+        events => {
+          const now = Date.now()
+          options.events = this.transformEvents(events.map(this.transformEvent).filter(({ until }) => !until || now < new Date(until)))
+          this.calcEvents(options)
+        },
+        () => {
+          options.error = true
+          options.list = []
+        }
+      ).finally(() => {
         options.loading = false
-      }).then(events => {
-        const now = Date.now()
-        options.events = this.transformEvents(events.map(this.transformEvent).filter(({ until }) => !until || now < new Date(until)))
-        this.calcEvents(options)
-      }, () => {
-        options.error = true
-        options.list = []
       })
     },
     transformEvent (event) {