fix D&D layout
This commit is contained in:
@@ -0,0 +1,181 @@
|
||||
import Vue from "vue";
|
||||
import softkeysPrefered from "../modules/base-components/cards/softkeys-prefered.vue"
|
||||
import headProduction from "../modules/heads/head-production.vue"
|
||||
import cardAxesProduction from "../modules/base-components/cards/card-axes-production.vue"
|
||||
import processSelectionMaintenance from "../modules/base-components/cards/process-selection-maintenance.vue";
|
||||
import cardProductionCms from "../modules/base-components/cards/card-production-cms.vue";
|
||||
import { Hub } from "src/services/hub";
|
||||
import { Factory, MessageService, awaiter } from "src/_base";
|
||||
import { appModelActions, alarmsModelActions, store } from "src/store";
|
||||
import { ModalHelper } from "src/modules/base-components";
|
||||
import { DataService } from '../services/dataService';
|
||||
import Component from "vue-class-component";
|
||||
import { Watch } from "vue-property-decorator";
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
softkeysPrefered, headProduction, cardAxesProduction, processSelectionMaintenance, cardProductionCms
|
||||
}
|
||||
})
|
||||
export default class Production extends Vue {
|
||||
|
||||
isCnReady: Function;
|
||||
|
||||
activeCms = true;
|
||||
activeCnc = false;
|
||||
headsR = [];
|
||||
selectedHead = null;
|
||||
selectedPositionTop = 0;
|
||||
userSubkeysMenuOpened = false;
|
||||
waitingForSftkConfirm = false;
|
||||
confirmationDelegate = null;
|
||||
|
||||
async created() {
|
||||
await awaiter(new DataService().GetUserSoftkeyFavorite());
|
||||
}
|
||||
async mounted() {
|
||||
this.confirmationDelegate = null;
|
||||
ModalHelper.HideModal("modal2");
|
||||
}
|
||||
|
||||
get machineInfo() {
|
||||
return this.$store.state.machineInfo;
|
||||
}
|
||||
get heads() {
|
||||
return this.$store.state.machineInfo.heads;
|
||||
}
|
||||
softkeyFavorite() {
|
||||
function compare(a, b) {
|
||||
if (a.id < b.id) {
|
||||
return -1;
|
||||
}
|
||||
if (a.id > b.id) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
var array = this.$store.state.machineInfo.softkeysFavorites;
|
||||
return array.sort(compare);
|
||||
}
|
||||
|
||||
@Watch("activeCnc")
|
||||
activeCncChanged() {
|
||||
if (this.activeCnc) {
|
||||
Factory.Get(MessageService).publishToChannel("HMI-production-show");
|
||||
Factory.Get(MessageService).publishToChannel("HMI-production-show-state");
|
||||
}
|
||||
else {
|
||||
Factory.Get(MessageService).publishToChannel("HMI-production-hide");
|
||||
Factory.Get(MessageService).publishToChannel("HMI-production-hide-state");
|
||||
}
|
||||
}
|
||||
|
||||
beforeDestroy() {
|
||||
Factory.Get(MessageService).publishToChannel("HMI-production-hide");
|
||||
Factory.Get(MessageService).publishToChannel("HMI-production-hide-state");
|
||||
}
|
||||
|
||||
closeAlarmsRibbon() {
|
||||
alarmsModelActions.toggleOpened(this.$store, false);
|
||||
alarmsModelActions.toggleServiceOpened(this.$store, false);
|
||||
}
|
||||
selectHead(h) {
|
||||
this.selectedHead = h;
|
||||
}
|
||||
getHeadsProperty(id) {
|
||||
var r = this.$store.getters.getHeadsProperty(id);
|
||||
return r || {};
|
||||
}
|
||||
clickCms() {
|
||||
this.activeCms = true;
|
||||
this.activeCnc = false;
|
||||
}
|
||||
clickCnc() {
|
||||
this.activeCnc = true;
|
||||
this.activeCms = false;
|
||||
}
|
||||
ncClick(id) {
|
||||
Hub.Current.ncSoftKeyClick(id);
|
||||
}
|
||||
isReadOnly(id) {
|
||||
let r = this.$store.getters.getNcSoftKeyInfo(id);
|
||||
if (r) return r.isReadOnly;
|
||||
return false;
|
||||
}
|
||||
isKeyActive(id) {
|
||||
let r = this.$store.getters.getNcSoftKeyStatus(id);
|
||||
if (r) return r.active;
|
||||
return false;
|
||||
}
|
||||
name(id) {
|
||||
let r = this.$store.getters.getNcSoftKeyInfo(id);
|
||||
if (r) return r.visualizedName;
|
||||
return null;
|
||||
}
|
||||
isKeySelected(id) {
|
||||
let r = this.$store.getters.getNcSoftKeyStatus(id);
|
||||
if (r) return r.value;
|
||||
return false;
|
||||
}
|
||||
overrideMinus(id) {
|
||||
Hub.Current.headOverrideMinus(id);
|
||||
}
|
||||
overridePlus(id) {
|
||||
Hub.Current.headOverridePlus(id);
|
||||
}
|
||||
positionBox(arg1, arg2) {
|
||||
this.selectedPositionTop = (arg1.offsetTop - (this.$refs.scrollable as any).scrollTop - (this.$refs.scrollable as any).offsetHeight + 155);
|
||||
this.userSubkeysMenuOpened = arg2;
|
||||
}
|
||||
toggleMainView() {
|
||||
Factory.Get(MessageService).publishToChannel("enable-selected-softkeys-prefered", true);
|
||||
appModelActions.MainViewToggle(this.$store);
|
||||
}
|
||||
getSubKeysActive(keys) {
|
||||
let result = {};
|
||||
for (const key in keys) {
|
||||
result[key] = this.getSoftKeyActive(key);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
getSoftKeyActive(id) {
|
||||
if (!this.isCnReady()) return false;
|
||||
var sk = this.$store.getters.getSoftKeyStatus(id);
|
||||
if (sk)
|
||||
return sk.active;
|
||||
return false;
|
||||
}
|
||||
softKeyChanged(id, confirm) {
|
||||
if (!confirm)
|
||||
Hub.Current.sendUserSoftKey(id);
|
||||
else {
|
||||
this.confirmationDelegate = () => {
|
||||
Hub.Current.sendUserSoftKey(id);
|
||||
};
|
||||
this.waitingForSftkConfirm = true;
|
||||
}
|
||||
}
|
||||
sendKeyCancel() {
|
||||
this.confirmationDelegate = null;
|
||||
}
|
||||
sendKeyConfirm() {
|
||||
if (this.confirmationDelegate)
|
||||
this.confirmationDelegate();
|
||||
this.confirmationDelegate = null;
|
||||
}
|
||||
getSubKeysStatus(keys) {
|
||||
let result = {};
|
||||
for (const key in keys) {
|
||||
result[key] = this.getSoftKeyStatus(key);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
getSoftKeyStatus(id) {
|
||||
if (!this.isCnReady()) return false;
|
||||
var sk = this.$store.getters.getSoftKeyStatus(id);
|
||||
if (sk)
|
||||
return sk.value;
|
||||
return false;
|
||||
}
|
||||
};
|
||||
@@ -11,7 +11,7 @@
|
||||
<button class="btn" :class="{'pressed': activeCms}" @click="clickCms()">{{'production_box_video_button_cms' | localize("CMS")}}</button>
|
||||
<button class="btn" :class="{'pressed': activeCnc}" @click="clickCnc()">{{'production_box_video_button_cnc' | localize("CNC")}}</button>
|
||||
</div>
|
||||
<div class="cnc" v-if="activeCnc">
|
||||
<div class="cnc" v-if="activeCnc">
|
||||
<img id="cnc-img" src="assets/images/Siemens_Placeholder.jpg" @click="closeAlarmsRibbon()" v-if="isSiemens()">
|
||||
<img id="cnc-img-fanuc" src="assets/images/Fanuc_Placeholder.jpg" @click="closeAlarmsRibbon()" v-if="isFanuc()">
|
||||
<img id="cnc-img" src="assets/images/Osai_Placeholder.jpg" @click="closeAlarmsRibbon()" v-if="isOsai()">
|
||||
@@ -32,7 +32,7 @@
|
||||
<button @click="ncClick(17)" :disabled="!isKeyActive(17)" :class="{active:isKeySelected(17) , inverted:isReadOnly(17)}" class="soft "><img src="../../assets/icons/under-hood-png/dry-run-active.png" />{{name(17)}}</button>
|
||||
<button v-if="machineInfo.isFanuc" @click="ncClick(18)" :disabled="!isKeyActive(18)" :class="{active:isKeySelected(18) , inverted:isReadOnly(18)}" class="soft ">{{name(18)}}</button>
|
||||
<button v-if="machineInfo.isFanuc" @click="ncClick(19)" :disabled="!isKeyActive(19)" :class="{active:isKeySelected(19) , inverted:isReadOnly(19)}" class="soft ">{{name(19)}}</button>
|
||||
|
||||
|
||||
<button v-if="machineInfo.isSiemens" @click="ncClick(18)" :disabled="!isKeyActive(18)" :class="{active:isKeySelected(18) , inverted:isReadOnly(18)}" class="soft ">{{name(18)}}</button>
|
||||
<button v-if="machineInfo.isSiemens" @click="ncClick(19)" :disabled="!isKeyActive(19)" :class="{active:isKeySelected(19) , inverted:isReadOnly(19)}" class="soft ">{{name(19)}}</button>
|
||||
<button v-if="machineInfo.isSiemens || isDemo()" @click="ncClick(20)" :disabled="!isKeyActive(20)" :class="{active:isKeySelected(20) , inverted:isReadOnly(20)}" class="soft "><img class="teach" src="../../assets/icons/under-hood-png/teach.png" />{{name(20)}}</button>
|
||||
@@ -99,185 +99,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import softkeysPrefered from "../modules/base-components/cards/softkeys-prefered.vue"
|
||||
import headProduction from "../modules/heads/head-production.vue"
|
||||
import cardAxesProduction from "../modules/base-components/cards/card-axes-production.vue"
|
||||
import processSelectionMaintenance from "../modules/base-components/cards/process-selection-maintenance.vue";
|
||||
import cardProductionCms from "../modules/base-components/cards/card-production-cms.vue";
|
||||
import { Hub } from "src/services/hub";
|
||||
import { Factory, MessageService,awaiter } from "src/_base";
|
||||
import { appModelActions, alarmsModelActions,store } from "src/store";
|
||||
import { ModalHelper } from "src/modules/base-components";
|
||||
import { DataService } from '../services/dataService';
|
||||
export default {
|
||||
components:{
|
||||
softkeysPrefered, headProduction, cardAxesProduction, processSelectionMaintenance, cardProductionCms
|
||||
},
|
||||
props:["sk"],
|
||||
data: function(){
|
||||
return {
|
||||
activeCms: true,
|
||||
activeCnc: false,
|
||||
headsR: [],
|
||||
selectedHead: null,
|
||||
selectedPositionTop: 0,
|
||||
userSubkeysMenuOpened:false,
|
||||
waitingForSftkConfirm:false,
|
||||
confirmationDelegate:null
|
||||
}
|
||||
},
|
||||
async created(){
|
||||
await awaiter(new DataService().GetUserSoftkeyFavorite());
|
||||
},
|
||||
async mounted() {
|
||||
this.confirmationDelegate= null;
|
||||
ModalHelper.HideModal("modal2");
|
||||
},
|
||||
computed:{
|
||||
machineInfo: function() {
|
||||
return this.$store.state.machineInfo;
|
||||
},
|
||||
heads: function(){
|
||||
return this.$store.state.machineInfo.heads;
|
||||
},
|
||||
softkeyFavorite: function(){
|
||||
<script src="./production.ts" lang="ts">
|
||||
|
||||
function compare(a,b){
|
||||
if(a.id < b.id){
|
||||
return -1;
|
||||
}
|
||||
if(a.id > b.id){
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
var array = this.$store.state.machineInfo.softkeysFavorites;
|
||||
|
||||
return array.sort(compare);
|
||||
}
|
||||
},
|
||||
watch:
|
||||
{
|
||||
activeCnc: function() {
|
||||
if(this.activeCnc){
|
||||
Factory.Get(MessageService).publishToChannel("HMI-production-show");
|
||||
Factory.Get(MessageService).publishToChannel("HMI-production-show-state");
|
||||
}
|
||||
else{
|
||||
Factory.Get(MessageService).publishToChannel("HMI-production-hide");
|
||||
Factory.Get(MessageService).publishToChannel("HMI-production-hide-state");
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeDestroy: function () {
|
||||
Factory.Get(MessageService).publishToChannel("HMI-production-hide");
|
||||
Factory.Get(MessageService).publishToChannel("HMI-production-hide-state");
|
||||
},
|
||||
methods:{
|
||||
closeAlarmsRibbon(){
|
||||
alarmsModelActions.toggleOpened(this.$store, false);
|
||||
alarmsModelActions.toggleServiceOpened(this.$store, false);
|
||||
},
|
||||
selectHead(h){
|
||||
this.selectedHead = h;
|
||||
},
|
||||
getHeadsProperty: function(id) {
|
||||
var r = this.$store.getters.getHeadsProperty(id);
|
||||
return r || {};
|
||||
},
|
||||
clickCms(){
|
||||
this.activeCms = true;
|
||||
this.activeCnc = false;
|
||||
},
|
||||
clickCnc(){
|
||||
this.activeCnc = true;
|
||||
this.activeCms = false;
|
||||
},
|
||||
ncClick(id) {
|
||||
Hub.Current.ncSoftKeyClick(id);
|
||||
},
|
||||
isReadOnly(id) {
|
||||
let r = this.$store.getters.getNcSoftKeyInfo(id);
|
||||
if (r) return r.isReadOnly;
|
||||
return false;
|
||||
},
|
||||
isKeyActive(id) {
|
||||
let r = this.$store.getters.getNcSoftKeyStatus(id);
|
||||
if (r) return r.active;
|
||||
return false;
|
||||
},
|
||||
name(id){
|
||||
let r = this.$store.getters.getNcSoftKeyInfo(id);
|
||||
if(r) return r.visualizedName;
|
||||
return null;
|
||||
},
|
||||
isKeySelected(id) {
|
||||
let r = this.$store.getters.getNcSoftKeyStatus(id);
|
||||
if (r) return r.value;
|
||||
return false;
|
||||
},
|
||||
overrideMinus: function(id) {
|
||||
Hub.Current.headOverrideMinus(id);
|
||||
},
|
||||
overridePlus: function(id) {
|
||||
Hub.Current.headOverridePlus(id);
|
||||
},
|
||||
positionBox(arg1,arg2){
|
||||
this.selectedPositionTop = (arg1.offsetTop - (this.$refs.scrollable).scrollTop - (this.$refs.scrollable).offsetHeight + 155);
|
||||
this.userSubkeysMenuOpened = arg2;
|
||||
},
|
||||
toggleMainView() {
|
||||
Factory.Get(MessageService).publishToChannel("enable-selected-softkeys-prefered", true);
|
||||
appModelActions.MainViewToggle(this.$store);
|
||||
},
|
||||
getSubKeysActive(keys){
|
||||
let result = {};
|
||||
for (const key in keys) {
|
||||
result[key] = this.getSoftKeyActive(key);
|
||||
}
|
||||
return result;
|
||||
},
|
||||
getSoftKeyActive(id){
|
||||
if(!this.isCnReady()) return false;
|
||||
var sk = this.$store.getters.getSoftKeyStatus(id);
|
||||
if (sk)
|
||||
return sk.active;
|
||||
return false;
|
||||
},
|
||||
softKeyChanged(id, confirm) {
|
||||
if (!confirm)
|
||||
Hub.Current.sendUserSoftKey(id);
|
||||
else {
|
||||
this.confirmationDelegate = () => {
|
||||
Hub.Current.sendUserSoftKey(id);
|
||||
};
|
||||
this.waitingForSftkConfirm= true;
|
||||
}
|
||||
},
|
||||
sendKeyCancel() {
|
||||
this.confirmationDelegate = null;
|
||||
},
|
||||
sendKeyConfirm() {
|
||||
if (this.confirmationDelegate)
|
||||
this.confirmationDelegate();
|
||||
this.confirmationDelegate = null;
|
||||
},
|
||||
getSubKeysStatus(keys){
|
||||
let result = {};
|
||||
for (const key in keys) {
|
||||
result[key] = this.getSoftKeyStatus(key);
|
||||
}
|
||||
return result;
|
||||
},
|
||||
getSoftKeyStatus(id){
|
||||
if(!this.isCnReady()) return false;
|
||||
var sk = this.$store.getters.getSoftKeyStatus(id);
|
||||
if (sk)
|
||||
return sk.value;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@@ -120,7 +120,7 @@ export default {
|
||||
this.draggingIn = false;
|
||||
this.draggingItem = null;
|
||||
var itemsPositions = {objectId: event.payload.id, newPosition: event.addedIndex, oldPosition: event.removedIndex};
|
||||
await new FileService().moveItemsQueue(this.selectedProcess,itemsPositions,this.partPrograms);
|
||||
await new FileService().moveItemsQueue(this.selectedProcess,itemsPositions,event.payload);
|
||||
|
||||
}
|
||||
else{
|
||||
|
||||
@@ -12,7 +12,7 @@ export class FileService extends baseRestService {
|
||||
}
|
||||
|
||||
async getFileInfo(path: string) {
|
||||
var result = await this.Get<any>(this.BASE_URL + "file/info", true, {
|
||||
var result = await this.Get<any>(this.BASE_URL + "file/info", true, {
|
||||
filePath: path
|
||||
});
|
||||
|
||||
@@ -29,37 +29,37 @@ export class FileService extends baseRestService {
|
||||
return await this.Put<any>(this.BASE_URL + "file/deactivate", null);
|
||||
}
|
||||
|
||||
async deleteQueue(processId){
|
||||
async deleteQueue(processId) {
|
||||
var result = await this.Delete<any>(this.BASE_URL + "queue/" + processId + "/empty", true);
|
||||
productionActions.deletePartPrograms(store);
|
||||
return result;
|
||||
}
|
||||
|
||||
async deleteItemQueue(processId, model){
|
||||
async deleteItemQueue(processId, model) {
|
||||
var result = await this.Delete<any>(this.BASE_URL + "queue/" + processId + "/remove/" + model.id, true);
|
||||
productionActions.deletePartProgram(store,model);
|
||||
productionActions.deletePartProgram(store, model);
|
||||
return result;
|
||||
}
|
||||
|
||||
async moveItemsQueue(processId, position, model){
|
||||
async moveItemsQueue(processId, position, model) {
|
||||
productionActions.movePartProgram(store, { model, position });
|
||||
var result = await this.Put<any>(this.BASE_URL + "queue/" + processId + "/move", position, true);
|
||||
model = result;
|
||||
productionActions.movePartProgram(store,{model,position});
|
||||
// productionActions.movePartProgram(store, { model: result, position });
|
||||
return result;
|
||||
}
|
||||
|
||||
async startQueue(processId){
|
||||
async startQueue(processId) {
|
||||
var result = await this.Post<any>(this.BASE_URL + "queue/start?processId=" + processId, null);
|
||||
return result;
|
||||
}
|
||||
|
||||
async stopQueue(processId){
|
||||
async stopQueue(processId) {
|
||||
var result = await this.Post<any>(this.BASE_URL + "queue/stop?processId=" + processId, null);
|
||||
return result;
|
||||
}
|
||||
|
||||
async changeReps(processId,model){
|
||||
var result = await this.Put<any>(this.BASE_URL + "queue/" + processId + "/edit/" + model.id, {reps: model.reps});
|
||||
async changeReps(processId, model) {
|
||||
var result = await this.Put<any>(this.BASE_URL + "queue/" + processId + "/edit/" + model.id, { reps: model.reps });
|
||||
productionActions.updatePartProgram(store, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user