瀏覽代碼

feat(upgrade): deploy supports filtering by device name and automatic refresh

daigang 2 年之前
父節點
當前提交
70be5a412d

+ 4 - 0
src/components/table/mixins/table.js

@@ -12,6 +12,9 @@ const ButtonConfig = {
 
 // {
 //   keepalive?: false,
+//   autoRefreshEachPage?: false,
+//   autoRefresh?: false, // 仅首页
+//   refreshInterval?: 5000,
 //   nonPagination?: false,
 //   singlePage?: false,
 //   pagination?: Object,
@@ -27,6 +30,7 @@ const ButtonConfig = {
 //     { key: String, type: 'select', placeholder: String, ...SelectSchema },
 //     { key: String, type: 'search', placeholder: String }
 //   ],
+//   // 仅针对列表
 //   cols: [
 //     { prop: String, label: String, render?: Function | Array }
 //   ]

+ 3 - 1
src/views/platform/upgrade/deploy/index.vue

@@ -117,6 +117,7 @@ export default {
       apk: '',
       devices: '',
       schema: {
+        autoRefreshEachPage: true,
         props: {
           size: 'small'
         },
@@ -134,6 +135,7 @@ export default {
             ]
           },
           { key: 'name', type: 'search', placeholder: '升级名称' },
+          { key: 'deviceName', type: 'search', placeholder: '设备名称' },
           { type: 'refresh' }
         ],
         cols: [
@@ -157,7 +159,7 @@ export default {
             }
           }), width: 120, align: 'center' },
           { type: 'invoke', render: [
-            { label: '删除', on: this.onDel }
+            { label: '删除', allow: ({ status }) => status !== 2, on: this.onDel }
           ] }
         ]
       },

+ 6 - 1
src/views/realm/settings/index.vue

@@ -8,6 +8,7 @@
     <span class="c-sibling-item--v u-font-size--sm u-bold">策略配置</span>
     <div class="c-sibling-item--v l-grid--info mini">
       <button
+        v-if="supportAlarm"
         class="o-button"
         @click="onAlarmStratConfig"
       >
@@ -97,6 +98,7 @@
 
 <script>
 import { mapGetters } from 'vuex'
+import { SupportedAlarmStrategies } from '@/constant'
 import AlarmStratConfigDialog from './components/AlarmStratConfigDialog.vue'
 import AutoRestartConfigDialog from './components/AutoRestartConfigDialog.vue'
 import OnlineRefreshConfigDialog from './components/OnlineRefreshConfigDialog.vue'
@@ -119,7 +121,10 @@ export default {
     ErrorOfflineAlarmConfigDialog
   },
   computed: {
-    ...mapGetters(['tenant'])
+    ...mapGetters(['tenant']),
+    supportAlarm () {
+      return SupportedAlarmStrategies.length > 0
+    }
   },
   methods: {
     onAlarmStratConfig () {

+ 6 - 3
src/views/realm/user/Account.vue

@@ -88,7 +88,10 @@
 
 <script>
 import { mapGetters } from 'vuex'
-import { AlarmLevelInfo } from '@/constant'
+import {
+  AlarmLevelInfo,
+  SupportedAlarmStrategies
+} from '@/constant'
 import {
   getUsersByDepartment,
   addUser,
@@ -164,7 +167,7 @@ export default {
             },
             on: { edit: val => this.onEditName(data, val) }
           }), 'class-name': 'c-edit-column' },
-          { label: '消息推送', render: (data, h) => h('el-select', {
+          SupportedAlarmStrategies.length && { label: '消息推送', render: (data, h) => h('el-select', {
             staticClass: 'u-width',
             props: {
               value: data.informLevel
@@ -219,7 +222,7 @@ export default {
                 label: AlarmLevelInfo[9999]
               }
             })
-          ]) },
+          ]), width: 220 },
           { type: 'tag', render: ({ userId, enabled }) => userId === this.userId
             ? null
             : {