Fix Multitool Option
This commit is contained in:
@@ -146,6 +146,18 @@
|
||||
text-align: left;
|
||||
width: calc(~'100% - 159px');
|
||||
margin-top: 11px;
|
||||
ul{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
li{
|
||||
display: inline;
|
||||
margin-right: 5px;
|
||||
padding-right: 5px;
|
||||
}
|
||||
li:not(:last-child) {
|
||||
border-right: 1px solid #4b4b4b;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
.text-right{
|
||||
|
||||
@@ -6952,6 +6952,18 @@ footer .container button.big:before {
|
||||
width: calc(100% - 159px);
|
||||
margin-top: 11px;
|
||||
}
|
||||
.tool .text-body ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.tool .text-body ul li {
|
||||
display: inline;
|
||||
margin-right: 5px;
|
||||
padding-right: 5px;
|
||||
}
|
||||
.tool .text-body ul li:not(:last-child) {
|
||||
border-right: 1px solid #4b4b4b;
|
||||
}
|
||||
.tool .text-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@@ -123,6 +123,7 @@ export default class Production extends Vue {
|
||||
}
|
||||
getHeadstoolName(id) {
|
||||
var r = this.getHeadsProperty(id);
|
||||
console.log(r);
|
||||
if(r.toolData)
|
||||
return r.toolData.toolName
|
||||
}
|
||||
|
||||
@@ -34,23 +34,24 @@ export default class depot extends Vue {
|
||||
|
||||
|
||||
public calcItemName(shank): any {
|
||||
console.log("shank",shank);
|
||||
if (!shank.childsTools)
|
||||
return this.$options.filters.localize("tooling_tool_abbreviation", 'T%d', shank.shankId);
|
||||
|
||||
if (shank.childsTools.length > 1)
|
||||
if (shank.childsTools.length > 1 || this.multitoolOptionActive)
|
||||
return this.$options.filters.localize("tooling_shank_abbreviation", 'S%d', shank.id);
|
||||
else
|
||||
return this.$options.filters.localize("tooling_tool_abbreviation", 'T%d', shank.childsTools[0].id);
|
||||
}
|
||||
|
||||
public calcItemTitle(shank): any {
|
||||
if (shank.childsTools && shank.childsTools.length > 1) {
|
||||
if ((shank.childsTools && shank.childsTools.length > 1) || this.multitoolOptionActive) {
|
||||
let str = "<ul>"
|
||||
shank.childsTools.forEach(element => {
|
||||
if (!this.familyOptionActive)
|
||||
str += "<li>" + this.$options.filters.localize("tooling_tool_abbreviation", 'T%d', element.id) + " - " + this.familyNameFromId(element.familyId) + "</li>";
|
||||
str += "<li>" + this.$options.filters.localize("tooling_tool_abbreviation", 'T%d', element.id) + "</li>";
|
||||
else
|
||||
str += "<li>" + this.$options.filters.localize("tooling_tool_abbreviation", 'T%d', element.id) + " - " + this.$options.filters.localize("tooling_family_abbreviation", 'F%d', element.familyId) + " - " + this.familyNameFromId(element.familyId) + "</li>";
|
||||
str += "<li>" + this.$options.filters.localize("tooling_tool_abbreviation", 'T%d', element.id) + " " + this.$options.filters.localize("tooling_family_abbreviation", 'F%d', element.familyId) + "</li>";
|
||||
});
|
||||
str += "</ul>"
|
||||
return str;
|
||||
@@ -74,7 +75,11 @@ export default class depot extends Vue {
|
||||
public get familyOptionActive(): boolean {
|
||||
return (this.$store.state as AppModel).tooling.familyOptionActive;
|
||||
}
|
||||
|
||||
|
||||
public get multitoolOptionActive(): boolean {
|
||||
return (this.$store.state as AppModel).tooling.multitoolOptionActive;
|
||||
}
|
||||
|
||||
public familyNameFromId(id): any {
|
||||
var found = (this.$store.state as AppModel).tooling.ncFamilies.find(k => k.id == id);
|
||||
if (found)
|
||||
@@ -255,15 +260,18 @@ export default class depot extends Vue {
|
||||
}
|
||||
|
||||
// Controllo se l'utensile è un utensile montato nel mandrino
|
||||
public checkIfToolIsMountedInSpindle(toolId) {
|
||||
|
||||
public checkIfToolIsMountedInSpindle(tool) {
|
||||
const heads = this.$store.state.machineInfo.heads
|
||||
|
||||
for (let i = 0; i < heads.length; i++) {
|
||||
const head = this.$store.getters.getHeadsProperty(heads[i].id)
|
||||
if(head)
|
||||
if(!head.fixedHead && toolId === head.mountedTool){
|
||||
return head.id
|
||||
if(!head.fixedHead){
|
||||
for (let j = 0; j < tool.childsTools.length; j++) {
|
||||
if(tool.childsTools[j].id === head.mountedTool){
|
||||
return head.id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@
|
||||
:title="calcItemTitle(ncToolAtPosition(pos.positionId))"
|
||||
:imgSource="getInfoNcShankIcon(ncToolAtPosition(pos.positionId))"
|
||||
:editable="editable"
|
||||
:headId="checkIfToolIsMountedInSpindle(ncToolAtPosition(pos.positionId).id)"
|
||||
:headId="checkIfToolIsMountedInSpindle(ncToolAtPosition(pos.positionId))"
|
||||
@click="removeToolsToDepot(pos.positionId, ncToolAtPosition(pos.positionId))"
|
||||
@clickinfo="openInfoShank(ncToolAtPosition(pos.positionId).id)">
|
||||
</card-tool-depot>
|
||||
|
||||
Reference in New Issue
Block a user