|
@@ -5,14 +5,14 @@
|
|
|
area-style="control"
|
|
|
circle-style="green"
|
|
|
content-style="44"
|
|
|
+ @contextmenu="contextmenu"
|
|
|
>
|
|
|
- <ControlMatrixCard title="待启动" :datas="ls.start"></ControlMatrixCard>
|
|
|
- <ControlMatrixCard title="待停机" :datas="ls.stop"></ControlMatrixCard>
|
|
|
- <ControlMatrixCard title="待维护" :datas="ls.maintain"></ControlMatrixCard>
|
|
|
- <ControlMatrixCard title="待取消维护" :datas="ls.unmaintain"></ControlMatrixCard>
|
|
|
- <ControlMatrixCard title="待复位" :datas="ls.reset"></ControlMatrixCard>
|
|
|
- <el-button style="z-index:2;position:absolute;bottom:10px;right:10px;background: #292929;font-size:15px;width:90px;border:none;color:rgb(220,220,220);" size="small">发送</el-button>
|
|
|
-
|
|
|
+ <ControlMatrixCard title="待启动" :datas="ls.start" ref="start"></ControlMatrixCard>
|
|
|
+ <ControlMatrixCard title="待停机" :datas="ls.stop" ref="stop"></ControlMatrixCard>
|
|
|
+ <ControlMatrixCard title="待维护" :datas="ls.maintain" ref="maintain"></ControlMatrixCard>
|
|
|
+ <ControlMatrixCard title="待取消维护" :datas="ls.unmaintain" ref="unmaintain"></ControlMatrixCard>
|
|
|
+ <ControlMatrixCard title="待复位" :datas="ls.reset" ref="reset"></ControlMatrixCard>
|
|
|
+ <el-button style="z-index:2;position:absolute;bottom:10px;right:10px;background: #292929;font-size:15px;width:90px;border:none;color:rgb(220,220,220);" size="small" @click="menuClicked({type:'marking'})">发送</el-button>
|
|
|
</gy-card>
|
|
|
<el-button-group style="z-index:3;position:absolute;top:16px;left:120px;">
|
|
|
<el-button style="background: black;font-size:14px;width:80px;border:none;color:rgb(220,220,220);" size="mini" round>自动</el-button>
|
|
@@ -23,6 +23,7 @@
|
|
|
<script>
|
|
|
import ControlMatrixCard from "./windturbine/control/ControlMatrixCard.vue";
|
|
|
import MessageBridge from "../../assets/script/MessageBridge";
|
|
|
+import BackgroundData from "../../assets/script/BackgroundData";
|
|
|
|
|
|
export default {
|
|
|
name: "ControlArea",
|
|
@@ -83,6 +84,108 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ /* 右键菜单 */
|
|
|
+ contextmenu() {
|
|
|
+ const { remote } = require("electron");
|
|
|
+ var that = this;
|
|
|
+ const menuTemplate = [
|
|
|
+ {
|
|
|
+ label: "发送",
|
|
|
+ click() {
|
|
|
+ that.menuClicked({ type: "send" });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "挂牌",
|
|
|
+ submenu: [
|
|
|
+ {
|
|
|
+ label: "检修",
|
|
|
+ click() {
|
|
|
+ that.menuClicked({ type: "lock", value: 8 });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "故障维修",
|
|
|
+ click() {
|
|
|
+ that.menuClicked({ type: "lock", value: 7 });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "场内受累检修",
|
|
|
+ click() {
|
|
|
+ that.menuClicked({ type: "lock", value: 2 });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "场内受累故障",
|
|
|
+ click() {
|
|
|
+ that.menuClicked({ type: "lock", value: 3 });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "场外受累电网",
|
|
|
+ click() {
|
|
|
+ that.menuClicked({ type: "lock", value: 4 });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "场外受累天气",
|
|
|
+ click() {
|
|
|
+ that.menuClicked({ type: "lock", value: 5 });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "标注",
|
|
|
+ click() {
|
|
|
+ that.menuClicked({ type: "marking" });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ const menu = remote.Menu.buildFromTemplate(menuTemplate);
|
|
|
+
|
|
|
+ menu.popup(remote.getCurrentWindow());
|
|
|
+ },
|
|
|
+
|
|
|
+ menuClicked(msg) {
|
|
|
+ var bd = BackgroundData.getInstance();
|
|
|
+ if (!bd.LoginUser) {
|
|
|
+ bd.showdialog("提示", "控制出现错误:", "未登录");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (msg.type == "lock") {
|
|
|
+ // 挂牌
|
|
|
+ } else if (msg.type == "send") {
|
|
|
+ // 发送
|
|
|
+ } else if (msg.type == "marking") {
|
|
|
+ // 标注
|
|
|
+ var vs = this.getSelectedItems();
|
|
|
+ bd.marking(vs);
|
|
|
+ }
|
|
|
+ this.clearSelected();
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 获取选中的项目,isControl:是否是控制 */
|
|
|
+ getSelectedItems(isControl){
|
|
|
+ var ls = new Array();
|
|
|
+ this.$refs.start.outputSelectedItems(ls);
|
|
|
+ this.$refs.stop.outputSelectedItems(ls);
|
|
|
+ if(isControl) return ls;
|
|
|
+ this.$refs.maintain.outputSelectedItems(ls);
|
|
|
+ this.$refs.unmaintain.outputSelectedItems(ls);
|
|
|
+ this.$refs.reset.outputSelectedItems(ls);
|
|
|
+ return ls;
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 清除所有选择 */
|
|
|
+ clearSelected(){
|
|
|
+ this.$refs.start.clearSelected();
|
|
|
+ this.$refs.stop.clearSelected();
|
|
|
+ this.$refs.maintain.clearSelected();
|
|
|
+ this.$refs.unmaintain.clearSelected();
|
|
|
+ this.$refs.reset.clearSelected();
|
|
|
+ }
|
|
|
},
|
|
|
};
|
|
|
</script>
|