|
|
@ -1,8 +1,10 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<v-combobox |
|
|
|
<v-select |
|
|
|
v-model="localState" |
|
|
|
v-model="localState" |
|
|
|
:items="setValues" |
|
|
|
:items="setValues" |
|
|
|
|
|
|
|
:menu-props="{ bottom: true, offsetY: true }" |
|
|
|
|
|
|
|
item-value="title" |
|
|
|
multiple |
|
|
|
multiple |
|
|
|
chips |
|
|
|
chips |
|
|
|
flat |
|
|
|
flat |
|
|
@ -14,34 +16,32 @@ |
|
|
|
> |
|
|
|
> |
|
|
|
<template #selection="data"> |
|
|
|
<template #selection="data"> |
|
|
|
<v-chip |
|
|
|
<v-chip |
|
|
|
:key="data.item" |
|
|
|
:color="data.item.color" |
|
|
|
small |
|
|
|
small |
|
|
|
class="ma-1" |
|
|
|
class="ma-1" |
|
|
|
:color="colors[setValues.indexOf(data.item) % colors.length]" |
|
|
|
|
|
|
|
@click:close="data.parent.selectItem(data.item)" |
|
|
|
@click:close="data.parent.selectItem(data.item)" |
|
|
|
> |
|
|
|
> |
|
|
|
{{ data.item }} |
|
|
|
{{ data.item.title }} |
|
|
|
</v-chip> |
|
|
|
</v-chip> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<template #item="{ item }"> |
|
|
|
<template #item="{item}"> |
|
|
|
<v-chip small :color="colors[setValues.indexOf(item) % colors.length]"> |
|
|
|
<v-chip small :color="item.color"> |
|
|
|
{{ item }} |
|
|
|
{{ item.title }} |
|
|
|
</v-chip> |
|
|
|
</v-chip> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<template #append> |
|
|
|
<template #append> |
|
|
|
<v-icon small class="mt-2"> mdi-menu-down </v-icon> |
|
|
|
<v-icon small class="mt-1"> |
|
|
|
|
|
|
|
mdi-menu-down |
|
|
|
|
|
|
|
</v-icon> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</v-combobox> |
|
|
|
</v-select> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import colors from '@/mixins/colors'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
export default { |
|
|
|
name: 'SetListEditableCell', |
|
|
|
name: 'SetListEditableCell', |
|
|
|
mixins: [colors], |
|
|
|
|
|
|
|
props: { |
|
|
|
props: { |
|
|
|
value: String, |
|
|
|
value: String, |
|
|
|
column: Object, |
|
|
|
column: Object, |
|
|
@ -49,19 +49,18 @@ export default { |
|
|
|
computed: { |
|
|
|
computed: { |
|
|
|
localState: { |
|
|
|
localState: { |
|
|
|
get() { |
|
|
|
get() { |
|
|
|
return this.value && this.value.match(/(?:[^',]|\\')+(?='?(?:,|$))/g).map(v => v.replace(/\\'/g, "'")); |
|
|
|
return typeof this.value === 'string' ? this.value.split(',') : []; |
|
|
|
}, |
|
|
|
}, |
|
|
|
set(val) { |
|
|
|
set(val) { |
|
|
|
this.$emit('input', val.filter(v => this.setValues.includes(v)).join(',')); |
|
|
|
this.$emit('input', val.filter(v => this.setValues.find(el => el.title === v)).join(',')); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
setValues() { |
|
|
|
setValues() { |
|
|
|
if (this.column && this.column.dtxp) { |
|
|
|
const opts = this.column.colOptions.options || []; |
|
|
|
return this.column.dtxp |
|
|
|
for (const op of opts.filter(el => el.order === null)) { |
|
|
|
.match(/(?:[^']|\\')+(?='?(?:,|$))/g) |
|
|
|
op.title = op.title.replace(/^'/, '').replace(/'$/, ''); |
|
|
|
.map(v => v.replace(/\\'/g, "'").replace(/^'|'$/g, '')); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return []; |
|
|
|
return opts; |
|
|
|
}, |
|
|
|
}, |
|
|
|
parentListeners() { |
|
|
|
parentListeners() { |
|
|
|
const $listeners = {}; |
|
|
|
const $listeners = {}; |
|
|
@ -86,17 +85,26 @@ export default { |
|
|
|
}; |
|
|
|
}; |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<style scoped> |
|
|
|
<style scoped lang="scss"> |
|
|
|
select { |
|
|
|
|
|
|
|
width: 100%; |
|
|
|
::v-deep { |
|
|
|
height: 100%; |
|
|
|
.v-select { |
|
|
|
color: var(--v-textColor-base); |
|
|
|
min-width: 150px; |
|
|
|
-webkit-appearance: menulist; |
|
|
|
.v-select__selections { |
|
|
|
/*webkit browsers */ |
|
|
|
min-height: 38px !important; |
|
|
|
-moz-appearance: menulist; |
|
|
|
} |
|
|
|
/*Firefox */ |
|
|
|
} |
|
|
|
appearance: menulist; |
|
|
|
.v-input__slot{ |
|
|
|
|
|
|
|
padding-right: 0 !important; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.v-input__icon.v-input__icon--clear { |
|
|
|
|
|
|
|
width: 15px !important; |
|
|
|
|
|
|
|
.v-icon { |
|
|
|
|
|
|
|
font-size: 13px !important; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
</style> |
|
|
|
</style> |
|
|
|
<!-- |
|
|
|
<!-- |
|
|
|
/** |
|
|
|
/** |
|
|
|