- Profile

- Bot Telegram
- fixed Chip multiselect
This commit is contained in:
Paolo Arena
2020-01-03 01:53:19 +01:00
parent 4a20dca54a
commit 7b64358016
18 changed files with 206 additions and 84 deletions

View File

@@ -1,5 +1,6 @@
.clchip{
display: flex;
justify-content: center;
//flex: 1;
//flex-direction: column;
}

View File

@@ -35,52 +35,84 @@ export default class CMyChipList extends Vue {
this.myarrvalues = []
// console.table(this.options)
this.options.forEach((rec, index) => {
if (this.type === tools.FieldType.multiselect) {
if (this.value.includes(rec[this.optval])) {
const mydata = {
label: null,
value: rec[this.optval],
// myris = mylist.filter((myrec) => arrval.includes(myrec[key]))
valbool: true,
icon: '',
color: tools.getColorByIndexBest(index)
if (this.options) {
this.options.forEach((rec, index) => {
if (this.type === tools.FieldType.multiselect) {
if (!!this.value) {
if (this.value.includes(rec[this.optval])) {
const mydata = {
label: null,
value: rec[this.optval],
// myris = mylist.filter((myrec) => arrval.includes(myrec[key]))
valbool: true,
icon: '',
color: tools.getColorByIndexBest(index)
}
if (tools.isObject(this.optlab)) {
mydata.label = this.options.filter((myrec) => myrec[this.optval] === mydata.value).map(this.optlab)
if (mydata.label)
mydata.label = mydata.label[0]
} else {
mydata.label = rec[this.optlab]
}
if (this.opticon)
mydata.icon = rec[this.opticon]
if (this.optcolor)
mydata.color = rec[this.optcolor]
this.myarrvalues.push(mydata)
}
}
} else if (this.type === tools.FieldType.select) {
if (this.value === rec[this.optval]) {
const mydata = {
label: null,
value: this.value,
valbool: true,
icon: '',
color: tools.getColorByIndexBest(index)
}
// console.log('mydata', mydata, 'optlab', this.optlab, 'value', this.value)
if (tools.isObject(this.optlab)) {
mydata.label = this.options.filter((myrec) => myrec[this.optval] === mydata.value).map(this.optlab)
if (mydata.label)
mydata.label = mydata.label[0]
} else {
mydata.label = rec[this.optlab]
}
if (this.opticon)
mydata.icon = rec[this.opticon]
if (this.optcolor)
mydata.color = rec[this.optcolor]
this.myarrvalues.push(mydata)
}
if (tools.isObject(this.optlab)) {
mydata.label = this.options.filter((myrec) => myrec[this.optval] === mydata.value).map(this.optlab)
if (mydata.label)
mydata.label = mydata.label[0]
} else {
mydata.label = rec[this.optlab]
} else {
if (tools.isBitActive(this.value, rec[this.optval])) {
const mydata = {
label: this.$t(rec[this.optlab]),
value: rec[this.optval],
valbool: tools.isBitActive(this.value, rec[this.optval]),
icon: '',
color: tools.getColorByIndexBest(index)
}
if (this.opticon)
mydata.icon = rec[this.opticon]
if (this.optcolor)
mydata.color = rec[this.optcolor]
this.myarrvalues.push(mydata)
}
if (this.opticon)
mydata.icon = rec[this.opticon]
if (this.optcolor)
mydata.color = rec[this.optcolor]
this.myarrvalues.push(mydata)
}
} else {
if (tools.isBitActive(this.value, rec[this.optval])) {
const mydata = {
label: this.$t(rec[this.optlab]),
value: rec[this.optval],
valbool: tools.isBitActive(this.value, rec[this.optval]),
icon: '',
color: tools.getColorByIndexBest(index)
}
if (this.opticon)
mydata.icon = rec[this.opticon]
if (this.optcolor)
mydata.color = rec[this.optcolor]
this.myarrvalues.push(mydata)
}
}
})
})
}
if (this.myarrvalues.length === 0)
this.myarrvalues.push({ label: this.$t('otherpages.manage.nessuno'), color: 'gray' })