소스 검색

refactor: adjust status sequence

Casper Dai 3 년 전
부모
커밋
755c71c96d
4개의 변경된 파일40개의 추가작업 그리고 132개의 파일을 삭제
  1. 14 14
      src/views/bigscreen/index.vue
  2. 16 108
      src/views/external/camera/index.vue
  3. 7 7
      src/views/platform/media/index.vue
  4. 3 3
      src/views/schedule/index.vue

+ 14 - 14
src/views/bigscreen/index.vue

@@ -137,8 +137,8 @@ export default {
         filters: [
           { key: 'status', type: 'select', options: [
             { value: State.READY, label: '待提交' },
-            { value: State.SUBMITTED, label: '未审核' },
-            { value: State.RESOLVED, label: '已审核' }
+            { value: State.RESOLVED, label: '已审核' },
+            { value: State.SUBMITTED, label: '未审核' }
           ] },
           { key: 'resolutionRatio', type: 'select', placeholder: '全部分辨率', simple: true, remote: getRatios },
           { key: 'name', type: 'search', placeholder: '节目名称' }
@@ -154,17 +154,6 @@ export default {
     window.removeEventListener('message', this.onMessage)
   },
   methods: {
-    onMessage (event) {
-      if (!this.loading) {
-        const id = event.data?.id
-        if (id) {
-          const program = this.$refs.table.getData().find(program => program.id === id)
-          if (program) {
-            program.style = this.getStyle(event.data.base64, true)
-          }
-        }
-      }
-    },
     getRatios (params) {
       return getRatios(params).then(({ data }) => {
         return {
@@ -177,6 +166,17 @@ export default {
         }
       })
     },
+    onMessage (event) {
+      if (!this.loading) {
+        const id = event.data?.id
+        if (id) {
+          const program = this.$refs.table.getData().find(program => program.id === id)
+          if (program) {
+            program.style = this.getStyle(event.data.base64, true)
+          }
+        }
+      }
+    },
     transform ({ id, name, status, resolutionRatio, createTime, img }) {
       return {
         id, name, status, resolutionRatio,
@@ -288,7 +288,7 @@ export default {
           return
         }
         submitProgram(item).then(() => {
-          this.$refs.table.resetCondition({ status: State.SUBMITTED })
+          this.$refs.table.decrease(1)
         })
       }).finally(() => {
         this.$closeLoading(loading)

+ 16 - 108
src/views/external/camera/index.vue

@@ -18,9 +18,9 @@
           <div class="l-flex--row c-table__header">
             <div class="l-flex__auto c-sibling-item">
               <button
-                v-if="canEdit"
+                v-if="isSuperAdmin"
                 class="o-button"
-                @click="addbtn"
+                @click="onAdd"
               >
                 <i class="o-button__icon el-icon-circle-plus-outline" />新增
               </button>
@@ -71,16 +71,16 @@
                 </div>
                 <div class="o-video_buttom l-flex--row">
                   <div class="l-flex__auto">{{ video.name }}</div>
-                  <template v-if="canEdit">
+                  <template v-if="isSuperAdmin">
                     <img
                       class="o-video_edit"
                       :src="imgUrl.edit"
-                      @click.stop="editbtn(video)"
+                      @click.stop="onEdit(video)"
                     >
                     <img
                       class="o-video_delete"
                       :src="imgUrl.delete"
-                      @click.stop="deletebtn(video)"
+                      @click.stop="onDel(video)"
                     >
                   </template>
                 </div>
@@ -99,66 +99,6 @@
           />
         </div>
       </el-tab-pane>
-      <!-- <el-tab-pane label="视频回传" name="second">
-        <div class="has-padding">
-          <div class="l-flex--row c-table__header">
-            <div class="l-flex__auto c-sibling-item">
-              <el-checkbox-group v-model="checkList" @change="chechChange">
-                <el-checkbox label="视频回采"></el-checkbox>
-                <el-checkbox label="模拟终端"></el-checkbox>
-              </el-checkbox-group>
-            </div>
-            <div class="l-flex__none c-sibling-item">
-              <img
-                class="c-sibling-item"
-                @click="rowChange(24)"
-                :src="require('@/assets/icon_one_normal.png')"
-                alt=""
-              />
-              <img
-                class="c-sibling-item"
-                @click="rowChange(12)"
-                :src="require('@/assets/icon_four_normal.png')"
-                alt=""
-              />
-              <img
-                class="c-sibling-item"
-                @click="rowChange(8)"
-                :src="require('@/assets/icon_nine_focus.png')"
-                alt=""
-              />
-            </div>
-            <button
-              class="l-flex__none c-sibling-item o-button"
-              @click="search"
-            >
-              <i class="o-button__icon el-icon-full-screen" />
-              全屏
-            </button>
-          </div>
-          <el-row :gutter="16" class="rowheight">
-            <el-col
-              :span="rowNum"
-              v-for="(item, index) in returnList.list"
-              :key="index"
-              class="cameraRow"
-            >
-              <div class="return_item bg-purple"
-                ref="returnB"
-                :style="{ height: returnheight }">
-                <div class="o-video_buttom l-flex--row">
-                  <div class="l-flex__auto">{{ item.name }}</div>
-                  <img
-                    :src="require('@/assets/icon_address.png')"
-                    class="o-video_edit"
-                  />
-                  <div class="return_local">{{ item.name }}</div>
-                </div>
-              </div>
-            </el-col>
-          </el-row>
-        </div>
-      </el-tab-pane> -->
     </el-tabs>
     <!-- 新增和编辑 -->
     <el-dialog
@@ -265,6 +205,7 @@
 </template>
 
 <script>
+import { mapGetters } from 'vuex'
 import flvjs from 'flv.js'
 import {
   getCamera,
@@ -290,9 +231,7 @@ export default {
         edit: require('@/assets/icon_edit.png'),
         delete: require('@/assets/icon_delete.png')
       },
-      videoOption: createListOptions({
-        pageSize: 6
-      }),
+      videoOption: createListOptions({ pageSize: 6 }),
       dialogTitle: '新增',
       adding: false,
       camera: {
@@ -314,20 +253,11 @@ export default {
       editOption: {},
       detailing: false,
       videoheight: '',
-      playerList: {},
-
-      checkList: [],
-      returnList: createListOptions({
-        pageSize: 9
-      }),
-      returnheight: 0,
-      rowNum: 8
+      playerList: {}
     }
   },
   computed: {
-    canEdit () {
-      return this.accessSet.has(this.Access.MANAGE_DEVICES)
-    }
+    ...mapGetters(['isSuperAdmin'])
   },
   created () {
     this.getCamera()
@@ -336,19 +266,9 @@ export default {
     this.destroyPlayer()
   },
   methods: {
-    rowChange (num) {
-      this.rowNum = num
-      this.$nextTick(() => {
-        this.returnheight = (this.$refs.returnB[0].clientWidth * 9) / 16 + 'px'
-      })
-    },
-    chechChange (val) {
-      console.log(val)
-    },
     destroyPlayer () {
       for (const key in this.playerList) {
         if (Object.hasOwnProperty.call(this.playerList, key)) {
-          // const element = object[key];
           if (this.playerList[key]) {
             this.playerList[key].pause()
             this.playerList[key].unload()
@@ -373,25 +293,13 @@ export default {
           ({ data, totalCount }) => {
             options.totalCount = totalCount
             options.list = data
-            // for (let i = 0; i < 34; i++) {
-            //   data.push({
-            //     deviceId: Math.random(),
-            //   })
-            // }
-            this.$nextTick(() => {
-              this.videoheight =
-                (this.$refs.videoB[0].clientWidth * 9) / 16 + 'px'
+            options.totalCount && this.$nextTick(() => {
+              this.videoheight = (this.$refs.videoB[0].clientWidth * 9) / 16 + 'px'
               this.destroyPlayer()
               for (let i = 0; i < data.length; i++) {
                 if (options.list[i].online) {
                   this.getflv(options.list[i].deviceId)
                 }
-                // getOnline(options.list[i].deviceId).then(({ data }) => {
-                //   options.list[i].online = data
-                //   if (data) {
-                //     this.getflv(options.list[i].deviceId)
-                //   }
-                // })
               }
             })
           },
@@ -416,7 +324,7 @@ export default {
         this.getCamera()
       })
     },
-    addbtn () {
+    onAdd () {
       this.camera = {
         name: '',
         deviceId: '',
@@ -446,7 +354,7 @@ export default {
       this.adding = false
       this.$refs[formName].resetFields()
     },
-    editbtn (item) {
+    onEdit (item) {
       this.adding = true
       this.isEdit = true
       this.dialogTitle = '编辑'
@@ -472,7 +380,7 @@ export default {
         this.getCamera()
       })
     },
-    deletebtn (item) {
+    onDel (item) {
       const videoOption = this.videoOption
       deleteCamera({ id: item.id, name: item.name }).then(() => {
         if (videoOption.list.length === 1 && videoOption.params.pageNum > 1) {
@@ -603,8 +511,8 @@ video::-webkit-media-controls-enclosure {
     height: 100%;
   }
 }
-.c-form__item_padding{
-  .el-input__inner{
+.c-form__item_padding {
+  .el-input__inner {
     padding-right: 50px;
   }
 }

+ 7 - 7
src/views/platform/media/index.vue

@@ -45,14 +45,14 @@
         v-model="active"
         class="c-tabs"
       >
-        <el-tab-pane
-          label="已审核"
-          name="2"
-        />
         <el-tab-pane
           label="待提交"
           name="0"
         />
+        <el-tab-pane
+          label="已审核"
+          name="2"
+        />
         <el-tab-pane
           label="待审核"
           name="1"
@@ -102,21 +102,21 @@ export default {
       active: `${State.RESOLVED}`,
       type: AssetType.IMAGE,
       [AssetType.IMAGE]: {
-        [State.RESOLVED]: createListOptions({ type: AssetType.IMAGE, status: State.RESOLVED }),
         [State.READY]: createListOptions({ type: AssetType.IMAGE, status: State.READY }),
         [State.SUBMITTED]: createListOptions({ type: AssetType.IMAGE, status: State.SUBMITTED }),
+        [State.RESOLVED]: createListOptions({ type: AssetType.IMAGE, status: State.RESOLVED }),
         [State.REJECTED]: createListOptions({ type: AssetType.IMAGE, status: State.REJECTED })
       },
       [AssetType.VIDEO]: {
-        [State.RESOLVED]: createListOptions({ type: AssetType.VIDEO, status: State.RESOLVED }),
         [State.READY]: createListOptions({ type: AssetType.VIDEO, status: State.READY }),
         [State.SUBMITTED]: createListOptions({ type: AssetType.VIDEO, status: State.SUBMITTED }),
+        [State.RESOLVED]: createListOptions({ type: AssetType.VIDEO, status: State.RESOLVED }),
         [State.REJECTED]: createListOptions({ type: AssetType.VIDEO, status: State.REJECTED })
       },
       [AssetType.AUDIO]: {
-        [State.RESOLVED]: createListOptions({ type: AssetType.AUDIO, status: State.RESOLVED }),
         [State.READY]: createListOptions({ type: AssetType.AUDIO, status: State.READY }),
         [State.SUBMITTED]: createListOptions({ type: AssetType.AUDIO, status: State.SUBMITTED }),
+        [State.RESOLVED]: createListOptions({ type: AssetType.AUDIO, status: State.RESOLVED }),
         [State.REJECTED]: createListOptions({ type: AssetType.AUDIO, status: State.REJECTED })
       },
       mediaAsset: null

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

@@ -94,8 +94,8 @@ export default {
         filters: [
           { key: 'status', type: 'select', options: [
             { value: State.READY, label: '待提交' },
-            { value: State.SUBMITTED, label: '未审核' },
-            { value: State.RESOLVED, label: '已审核' }
+            { value: State.RESOLVED, label: '已审核' },
+            { value: State.SUBMITTED, label: '未审核' }
           ] },
           { key: 'resolutionRatio', type: 'select', placeholder: '全部分辨率', simple: true, remote: getRatios },
           { key: 'name', type: 'search', placeholder: '名称' }
@@ -190,7 +190,7 @@ export default {
     },
     onSubmit (item) {
       submitSchedule(item).then(() => {
-        this.$refs.table.resetCondition({ status: State.SUBMITTED })
+        this.$refs.table.decrease(1)
       })
     },
     onDel (item) {