Переглянути джерело

完善功能按钮操作响应

liuwei 4 роки тому
батько
коміт
9778323577
2 змінених файлів з 102 додано та 71 видалено
  1. 58 51
      .idea/workspace.xml
  2. 44 20
      src/renderer/components/Admin.vue

+ 58 - 51
.idea/workspace.xml

@@ -2,7 +2,6 @@
 <project version="4">
   <component name="ChangeListManager">
     <list default="true" id="690c02a3-0e7d-4c4a-8f0c-a44c44c3a162" name="Default Changelist" comment="">
-      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/src/renderer/components/Admin.vue" beforeDir="false" afterPath="$PROJECT_DIR$/src/renderer/components/Admin.vue" afterDir="false" />
     </list>
     <ignored path="$PROJECT_DIR$/dist/" />
@@ -16,16 +15,15 @@
     <option name="LAST_RESOLUTION" value="IGNORE" />
   </component>
   <component name="FileEditorManager">
-    <splitter split-orientation="horizontal" split-proportion="0.8161408">
+    <splitter split-orientation="horizontal" split-proportion="0.7591019">
       <split-first>
         <leaf>
           <file pinned="false" current-in-tab="true">
             <entry file="file://$PROJECT_DIR$/src/renderer/components/Admin.vue">
               <provider selected="true" editor-type-id="text-editor">
-                <state relative-caret-position="545">
-                  <caret line="413" lean-forward="true" selection-start-line="413" selection-end-line="413" />
+                <state relative-caret-position="398">
+                  <caret line="249" column="203" selection-start-line="249" selection-start-column="203" selection-end-line="249" selection-end-column="203" />
                   <folding>
-                    <element signature="n#template#0;n#!!top" />
                     <element signature="n#div#0;n#template#0;n#!!top" />
                     <element signature="n#div#0;n#div#0;n#template#0;n#!!top" />
                     <element signature="n#div#0;n#div#0;n#div#0;n#template#0;n#!!top" />
@@ -40,24 +38,23 @@
                     <element signature="n#div#2;n#div#0;n#div#0;n#template#0;n#!!top" />
                     <element signature="n#div#0;n#div#2;n#div#0;n#div#0;n#template#0;n#!!top" />
                     <element signature="n#div#0;n#div#0;n#div#2;n#div#0;n#div#0;n#template#0;n#!!top" />
-                    <element signature="e#7165#7817#0" />
+                    <element signature="e#7163#7815#0" />
+                    <element signature="e#7868#7908#0" expanded="true" />
                     <element signature="e#8496#8529#0" />
                     <element signature="e#8546#9490#0" />
-                    <element signature="e#8567#9480#0" />
-                    <element signature="e#9510#11888#0" />
-                    <element signature="e#9927#9948#0" />
+                    <element signature="e#8565#9350#0" />
                     <element signature="e#11538#11580#0" />
                     <element signature="e#11983#12253#0" />
                     <element signature="e#12308#12370#0" />
                     <element signature="e#12562#13045#0" />
                     <element signature="e#12610#12803#0" />
                     <element signature="e#12809#13000#0" />
-                    <element signature="e#12555#13046#0" />
-                    <element signature="e#13180#13374#0" />
-                    <element signature="e#13405#13699#0" />
-                    <element signature="e#12683#12955#0" />
-                    <element signature="e#12766#12846#0" />
-                    <element signature="e#12852#12933#0" />
+                    <element signature="e#12954#14154#0" />
+                    <element signature="e#12999#13193#0" />
+                    <element signature="e#13224#13518#0" />
+                    <element signature="e#13790#14062#0" />
+                    <element signature="e#13873#13953#0" />
+                    <element signature="e#13959#14040#0" />
                     <element signature="e#13755#14478#0" />
                     <element signature="e#13802#13996#0" />
                     <element signature="e#14002#14294#0" />
@@ -65,9 +62,9 @@
                     <element signature="e#15601#15795#0" />
                     <element signature="e#15801#16095#0" />
                     <element signature="e#16016#16026#0" />
-                    <element signature="e#16322#16594#0" />
-                    <element signature="e#16405#16485#0" />
-                    <element signature="e#16491#16572#0" />
+                    <element signature="e#16086#16358#0" />
+                    <element signature="e#16169#16249#0" />
+                    <element signature="e#16255#16336#0" />
                     <element signature="e#16512#16784#0" />
                     <element signature="e#16595#16675#0" />
                     <element signature="e#16681#16762#0" />
@@ -80,11 +77,17 @@
                     <element signature="e#18140#18254#0" />
                     <element signature="e#18735#18850#0" />
                     <element signature="e#19763#20480#0" />
-                    <element signature="e#19808#20002#0" />
-                    <element signature="e#19212#19506#0" />
-                    <element signature="e#20577#21706#0" />
+                    <element signature="e#19530#20716#0" />
                     <element signature="e#21770#22056#0" />
+                    <element signature="e#19997#20155#0" />
+                    <element signature="e#20218#20376#0" />
+                    <element signature="e#20439#20597#0" />
+                    <element signature="e#20611#20651#0" />
                     <element signature="e#22104#22388#0" />
+                    <element signature="e#20730#20886#0" />
+                    <element signature="e#20949#21105#0" />
+                    <element signature="e#21168#21324#0" />
+                    <element signature="e#21604#21765#0" />
                     <element signature="e#22419#22967#0" />
                     <element signature="e#22489#22793#0" />
                     <element signature="e#22514#22779#0" />
@@ -114,8 +117,8 @@
           <file pinned="false" current-in-tab="true">
             <entry file="file://$PROJECT_DIR$/static/EnityButton.json">
               <provider selected="true" editor-type-id="text-editor">
-                <state>
-                  <caret column="1" lean-forward="true" selection-start-column="1" selection-end-column="1" />
+                <state relative-caret-position="703">
+                  <caret line="4910" column="1" lean-forward="true" selection-start-line="4910" selection-start-column="1" selection-end-line="4910" selection-end-column="1" />
                   <folding>
                     <element signature="e#4#1307#0" />
                     <element signature="e#55#520#0" />
@@ -506,8 +509,8 @@
       <find>9a0dff23-8633-4e7f-89bf-cc4f68ec</find>
       <find>9a0dff23-8633-4e7f-89bf-cc4f68ec88e1</find>
       <find>cb2687fd-931a-4b38-a76d-9c3ea171b8d8</find>
-      <find>d9868551-b579-4258-9bc7-7c1f733773f5</find>
       <find>black</find>
+      <find>d9868551-b579-4258-9bc7-7c1f733773f5</find>
     </findStrings>
     <replaceStrings>
       <replace>class</replace>
@@ -571,10 +574,10 @@
         <option value="$PROJECT_DIR$/src/renderer/assets/less/splitscreen.less" />
         <option value="$PROJECT_DIR$/static/EnityBigScreen.json" />
         <option value="$PROJECT_DIR$/static/EnityButton.json" />
-        <option value="$PROJECT_DIR$/static/EnityWindow.json" />
         <option value="$PROJECT_DIR$/src/utils/tools.js" />
         <option value="$PROJECT_DIR$/src/renderer/components/Login.vue" />
         <option value="$PROJECT_DIR$/../../新建文件夹/slideDemo.html" />
+        <option value="$PROJECT_DIR$/static/EnityWindow.json" />
         <option value="$PROJECT_DIR$/src/renderer/components/Admin.vue" />
       </list>
     </option>
@@ -689,12 +692,12 @@
       <workItem from="1587177725929" duration="22477000" />
       <workItem from="1587262250088" duration="21728000" />
       <workItem from="1587389723532" duration="10000" />
-      <workItem from="1587433244420" duration="7393000" />
+      <workItem from="1587433244420" duration="17599000" />
     </task>
     <servers />
   </component>
   <component name="TimeTrackingManager">
-    <option name="totallyTimeSpent" value="290856000" />
+    <option name="totallyTimeSpent" value="301062000" />
   </component>
   <component name="TodoView">
     <todo-panel id="selected-file">
@@ -709,7 +712,7 @@
     <frame x="-8" y="-8" width="1936" height="1056" extended-state="6" />
     <editor active="true" />
     <layout>
-      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.13171759" />
+      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.13171759" />
       <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
       <window_info id="npm" order="2" side_tool="true" />
       <window_info id="Favorites" order="3" side_tool="true" />
@@ -3636,8 +3639,8 @@
     </entry>
     <entry file="file://$PROJECT_DIR$/static/EnityWindow.json">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="294">
-          <caret line="252" column="17" lean-forward="true" selection-start-line="252" selection-start-column="17" selection-end-line="252" selection-end-column="17" />
+        <state relative-caret-position="210">
+          <caret line="241" column="25" lean-forward="true" selection-start-line="241" selection-start-column="25" selection-end-line="241" selection-end-column="25" />
           <folding>
             <element signature="e#4#669#0" />
             <element signature="e#157#165#0" />
@@ -3677,8 +3680,8 @@
     </entry>
     <entry file="file://$PROJECT_DIR$/static/EnityButton.json">
       <provider selected="true" editor-type-id="text-editor">
-        <state>
-          <caret column="1" lean-forward="true" selection-start-column="1" selection-end-column="1" />
+        <state relative-caret-position="703">
+          <caret line="4910" column="1" lean-forward="true" selection-start-line="4910" selection-start-column="1" selection-end-line="4910" selection-end-column="1" />
           <folding>
             <element signature="e#4#1307#0" />
             <element signature="e#55#520#0" />
@@ -4029,10 +4032,9 @@
     </entry>
     <entry file="file://$PROJECT_DIR$/src/renderer/components/Admin.vue">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="545">
-          <caret line="413" lean-forward="true" selection-start-line="413" selection-end-line="413" />
+        <state relative-caret-position="398">
+          <caret line="249" column="203" selection-start-line="249" selection-start-column="203" selection-end-line="249" selection-end-column="203" />
           <folding>
-            <element signature="n#template#0;n#!!top" />
             <element signature="n#div#0;n#template#0;n#!!top" />
             <element signature="n#div#0;n#div#0;n#template#0;n#!!top" />
             <element signature="n#div#0;n#div#0;n#div#0;n#template#0;n#!!top" />
@@ -4047,24 +4049,23 @@
             <element signature="n#div#2;n#div#0;n#div#0;n#template#0;n#!!top" />
             <element signature="n#div#0;n#div#2;n#div#0;n#div#0;n#template#0;n#!!top" />
             <element signature="n#div#0;n#div#0;n#div#2;n#div#0;n#div#0;n#template#0;n#!!top" />
-            <element signature="e#7165#7817#0" />
+            <element signature="e#7163#7815#0" />
+            <element signature="e#7868#7908#0" expanded="true" />
             <element signature="e#8496#8529#0" />
             <element signature="e#8546#9490#0" />
-            <element signature="e#8567#9480#0" />
-            <element signature="e#9510#11888#0" />
-            <element signature="e#9927#9948#0" />
+            <element signature="e#8565#9350#0" />
             <element signature="e#11538#11580#0" />
             <element signature="e#11983#12253#0" />
             <element signature="e#12308#12370#0" />
             <element signature="e#12562#13045#0" />
             <element signature="e#12610#12803#0" />
             <element signature="e#12809#13000#0" />
-            <element signature="e#12555#13046#0" />
-            <element signature="e#13180#13374#0" />
-            <element signature="e#13405#13699#0" />
-            <element signature="e#12683#12955#0" />
-            <element signature="e#12766#12846#0" />
-            <element signature="e#12852#12933#0" />
+            <element signature="e#12954#14154#0" />
+            <element signature="e#12999#13193#0" />
+            <element signature="e#13224#13518#0" />
+            <element signature="e#13790#14062#0" />
+            <element signature="e#13873#13953#0" />
+            <element signature="e#13959#14040#0" />
             <element signature="e#13755#14478#0" />
             <element signature="e#13802#13996#0" />
             <element signature="e#14002#14294#0" />
@@ -4072,9 +4073,9 @@
             <element signature="e#15601#15795#0" />
             <element signature="e#15801#16095#0" />
             <element signature="e#16016#16026#0" />
-            <element signature="e#16322#16594#0" />
-            <element signature="e#16405#16485#0" />
-            <element signature="e#16491#16572#0" />
+            <element signature="e#16086#16358#0" />
+            <element signature="e#16169#16249#0" />
+            <element signature="e#16255#16336#0" />
             <element signature="e#16512#16784#0" />
             <element signature="e#16595#16675#0" />
             <element signature="e#16681#16762#0" />
@@ -4087,11 +4088,17 @@
             <element signature="e#18140#18254#0" />
             <element signature="e#18735#18850#0" />
             <element signature="e#19763#20480#0" />
-            <element signature="e#19808#20002#0" />
-            <element signature="e#19212#19506#0" />
-            <element signature="e#20577#21706#0" />
+            <element signature="e#19530#20716#0" />
             <element signature="e#21770#22056#0" />
+            <element signature="e#19997#20155#0" />
+            <element signature="e#20218#20376#0" />
+            <element signature="e#20439#20597#0" />
+            <element signature="e#20611#20651#0" />
             <element signature="e#22104#22388#0" />
+            <element signature="e#20730#20886#0" />
+            <element signature="e#20949#21105#0" />
+            <element signature="e#21168#21324#0" />
+            <element signature="e#21604#21765#0" />
             <element signature="e#22419#22967#0" />
             <element signature="e#22489#22793#0" />
             <element signature="e#22514#22779#0" />

+ 44 - 20
src/renderer/components/Admin.vue

@@ -61,7 +61,7 @@
                     width:item.Width + 'px',
                     height:item.Height + 'px',
                     zIndex:item.ZIndex,
-                    display:item.IsVisibility ? 'block' : 'none',
+                    display:item.IsVisibility ? 'black' : 'none',
                 }"
             >
                 <div v-for="(item,key) in signalPreList" :key="key" class="item">
@@ -194,6 +194,7 @@
 </template>
 
 <script>
+    import '../assets/less/splitscreen.less'
     import {mapState} from 'vuex'
     import draggable from 'vuedraggable'
     import labelJson from '../../../static/EnityLable'
@@ -204,7 +205,6 @@
     import imageJson from '../../../static/EnityImage'
     import windowJson from '../../../static/EnityWindow'
     import storageUtils from "../../utils/storageUtils"
-    import '../assets/less/splitscreen.less'
 
     export default {
         components: {
@@ -214,7 +214,7 @@
             return {
                 user: storageUtils.getUser(), // 本地存储的用户
                 signalPreList: [],  // 被拖到大屏中的信号源列表
-                isDragging: false,
+                isDragging: false, // 是否可拖动标志
                 splitScreenStatus: 0,// 分屏状态(默认0: 自由屏,1: 4分屏  2:9分屏  3: 16分屏)
                 labelJson, // label标签配置
                 bigScreenJson,// 大屏显示配置
@@ -223,35 +223,32 @@
                 sliderJson, // 滑块配置
                 imageJson, // 图片配置
                 windowJson, // 主要页面配置
-                count: 0,// 音量计数器
+                count: 0,   // 音量计数器
                 count2: 0, // 预案管理模块计数器
                 count3: 0, // 管理控制按钮计数器
                 count4: 0, // 3个视频按钮计数器
                 count5: 0, // 安卓分布式按钮
+                count6: 0, // 其他按钮
             }
         },
         mounted() {
             // 获取分屏按钮数组(将分屏按钮和其他按钮区分开)
             const arr = this.buttonJson.filter(item => (item.WindowID === '9a0dff23-8633-4e7f-89bf-cc4f68ec88e1' || item.WindowID === '08208721-41cc-4f1e-937b-3a1627389049' || item.WindowID === 'ab842585-0c91-4e65-bfed-a219bcaaeb43'))
-            const arr2 = this.buttonJson.filter(item => !(item.WindowID === '9a0dff23-8633-4e7f-89bf-cc4f68ec88e1' || item.WindowID === '08208721-41cc-4f1e-937b-3a1627389049' || item.WindowID === 'ab842585-0c91-4e65-bfed-a219bcaaeb43'))
             this.arr = arr
-            this.arr2 = arr2
 
             // 获取功能按钮涉及到的按钮和label
-            // 1.电源管理   2.音频管理  3.视频管理  4.环境控制  5.电脑控制
+            // 1.电源管理  2.音频管理  3.视频管理  4.环境控制  5.电脑控制
             const funcBtnArr = this.buttonJson.filter(item => (item.WindowID === 'd80a8b6e-9f88-41ff-b3a7-1ff8d6ee37a5' || item.WindowID === 'cb2687fd-931a-4b38-a76d-9c3ea171b8d8' || item.WindowID === '027ab76d-6b9c-46ac-abe6-75b8059f786b' || item.WindowID === 'a12b287f-f68c-4efa-b652-d6e5b0a09d0d' || item.WindowID === 'd9868551-b579-4258-9bc7-7c1f733773f5'))
-            const noFuncBtnArr = this.buttonJson.filter(item => !(item.WindowID === 'd80a8b6e-9f88-41ff-b3a7-1ff8d6ee37a5' || item.WindowID === 'cb2687fd-931a-4b38-a76d-9c3ea171b8d8' || item.WindowID === '027ab76d-6b9c-46ac-abe6-75b8059f786b' || item.WindowID === 'a12b287f-f68c-4efa-b652-d6e5b0a09d0d' || item.WindowID === 'd9868551-b579-4258-9bc7-7c1f733773f5'))
             const funcLabArr = this.labelJson.filter(item => (item.WindowID === 'd80a8b6e-9f88-41ff-b3a7-1ff8d6ee37a5' || item.WindowID === 'cb2687fd-931a-4b38-a76d-9c3ea171b8d8' || item.WindowID === '027ab76d-6b9c-46ac-abe6-75b8059f786b' || item.WindowID === 'a12b287f-f68c-4efa-b652-d6e5b0a09d0d' || item.WindowID === 'd9868551-b579-4258-9bc7-7c1f733773f5'))
-            const noFuncLabArr = this.labelJson.filter(item => !(item.WindowID === 'd80a8b6e-9f88-41ff-b3a7-1ff8d6ee37a5' || item.WindowID === 'cb2687fd-931a-4b38-a76d-9c3ea171b8d8' || item.WindowID === '027ab76d-6b9c-46ac-abe6-75b8059f786b' || item.WindowID === 'a12b287f-f68c-4efa-b652-d6e5b0a09d0d' || item.WindowID === 'd9868551-b579-4258-9bc7-7c1f733773f5'))
-            const funSliderArr = [...this.sliderJson]
-            const funcObj = {
+            this.funcObj = {
                 funcBtnArr,
-                noFuncBtnArr,
                 funcLabArr,
-                noFuncLabArr,
-                funSliderArr,
+                funSliderArr:this.sliderJson
             }
-            this.funcObj = funcObj
+
+            // 获取电源管理和电脑控制按钮
+            const powerAndCompBtns = this.buttonJson.filter(item => (item.WindowID === 'd80a8b6e-9f88-41ff-b3a7-1ff8d6ee37a5' || item.WindowID === 'd9868551-b579-4258-9bc7-7c1f733773f5') && item.ID !== '19554440-98bc-4644-83a0-d9cefd69153e')
+            this.powerAndCompBtns = powerAndCompBtns
         },
         methods: {
             // 移动信号源
@@ -306,7 +303,6 @@
                             item.IsVisibility = false
                         }
                     })
-                    this.buttonJson = [ ...this.arr,...this.arr2]
                     return
                 }
 
@@ -366,10 +362,6 @@
                             item.IsVisibility = false
                         }
                     })
-
-                    this.buttonJson = [...this.funcObj.noFuncBtnArr, ...this.funcObj.funcBtnArr]
-                    this.labelJson = [...this.funcObj.noFuncLabArr, ...this.funcObj.funcLabArr]
-                    this.sliderJson = [...this.funcObj.funSliderArr]
                     return
                 }
 
@@ -411,6 +403,17 @@
                     return
                 }
 
+                // 电源管理和电脑管理
+                if(this.powerAndCompBtns.some(item => item.ID === e.ID)){
+                    if(e.ActionType === 2){
+                        this.$refs[e.ID][0].style.backgroundImage = 'url(' + require(`../../../static/images/${e.ActionIcon}`) + ')'
+                        e.ActionType = -2
+                    }else {
+                        this.$refs[e.ID][0].style.backgroundImage = 'url(' + require(`../../../static/images/${e.BackIcon}`) + ')'
+                        e.ActionType = 2
+                    }
+                }
+
                 // 系统开关按钮
                 /*if (e.ID === 'aea34c76-4216-469b-9610-9889a2d42d06') {
                     this.systemStatus = !this.systemStatus
@@ -425,6 +428,8 @@
                     }
                     return false
                 }*/
+
+                return
             },
 
             // 鼠标按下事件
@@ -433,6 +438,10 @@
                     this.$refs[e.ID][0].style.backgroundImage = 'url(' + require(`../../../static/images/${e.ActionIcon}`) + ')'
                 }else if(e.WindowID === '027ab76d-6b9c-46ac-abe6-75b8059f786b') { // 视频控制按钮
                     this.$refs[e.ID][0].style.backgroundImage = 'url(' + require(`../../../static/images/${e.ActionIcon}`) + ')'
+                }else if(e.WindowID === 'a12b287f-f68c-4efa-b652-d6e5b0a09d0d') { // 环境控制按钮
+                    this.$refs[e.ID][0].style.backgroundImage = 'url(' + require(`../../../static/images/${e.ActionIcon}`) + ')'
+                }else if(e.ID === '19554440-98bc-4644-83a0-d9cefd69153e'){ // 电脑控制All按钮
+                    this.$refs[e.ID][0].style.backgroundImage = 'url(' + require(`../../../static/images/${e.ActionIcon}`) + ')'
                 }
                 return
             },
@@ -443,6 +452,10 @@
                     this.$refs[e.ID][0].style.backgroundImage = 'url(' + require(`../../../static/images/${e.BackIcon}`) + ')'
                 }else if(e.WindowID === '027ab76d-6b9c-46ac-abe6-75b8059f786b') { // 视频控制按钮
                     this.$refs[e.ID][0].style.backgroundImage = 'url(' + require(`../../../static/images/${e.BackIcon}`) + ')'
+                }else if(e.WindowID === 'a12b287f-f68c-4efa-b652-d6e5b0a09d0d') { // 环境控制按钮
+                    this.$refs[e.ID][0].style.backgroundImage = 'url(' + require(`../../../static/images/${e.BackIcon}`) + ')'
+                }if(e.ID === '19554440-98bc-4644-83a0-d9cefd69153e'){ // 电脑控制All按钮
+                    this.$refs[e.ID][0].style.backgroundImage = 'url(' + require(`../../../static/images/${e.BackIcon}`) + ')'
                 }
                 return
             },
@@ -555,3 +568,14 @@
         }
     }
 </style>
+
+
+
+
+
+
+
+
+
+
+