2021-09-16 21:08:02 +02:00
|
|
|
<template>
|
|
|
|
|
<div class="text-center">
|
2022-01-20 00:38:49 +01:00
|
|
|
<div v-if="multiselect_by_server">
|
|
|
|
|
<q-select
|
2025-04-04 18:15:14 +02:00
|
|
|
ref="selectMultiServer"
|
2022-01-20 00:38:49 +01:00
|
|
|
:model-value="myarrvalue"
|
2022-02-14 11:30:53 +01:00
|
|
|
@update:model-value="changeval"
|
|
|
|
|
v-bind="$attrs"
|
2022-01-20 00:38:49 +01:00
|
|
|
label-color="primary"
|
2025-02-03 17:18:33 +01:00
|
|
|
:label="addstrrequired + label"
|
2022-01-20 00:38:49 +01:00
|
|
|
@filter="filterFn"
|
|
|
|
|
@filter-abort="abortFilterFn"
|
2022-01-23 23:25:19 +01:00
|
|
|
input-debounce="600"
|
2022-01-20 00:38:49 +01:00
|
|
|
rounded
|
|
|
|
|
outlined
|
|
|
|
|
multiple
|
2022-12-02 10:55:04 +01:00
|
|
|
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
|
2022-01-20 00:38:49 +01:00
|
|
|
options-dense
|
|
|
|
|
map-options
|
2022-12-01 21:44:33 +01:00
|
|
|
:stack-label="label ? true : false"
|
2022-01-20 00:38:49 +01:00
|
|
|
emit-value
|
2022-01-20 02:26:48 +01:00
|
|
|
:readonly="sola_lettura"
|
|
|
|
|
:use-input="useinput"
|
2022-01-20 00:38:49 +01:00
|
|
|
:dense="dense"
|
|
|
|
|
:input-class="myclass"
|
|
|
|
|
:options="valori"
|
|
|
|
|
:option-value="optval"
|
2023-03-04 10:20:49 +01:00
|
|
|
:class="myclass ? myclass : 'combowidth'"
|
|
|
|
|
style="min-width: 250px !important"
|
2022-01-20 00:38:49 +01:00
|
|
|
>
|
2025-04-04 18:15:14 +02:00
|
|
|
<template
|
|
|
|
|
v-if="getIcon() && !sola_lettura"
|
|
|
|
|
v-slot:prepend
|
|
|
|
|
>
|
2022-01-28 18:15:46 +01:00
|
|
|
<q-icon :name="getIcon()" />
|
|
|
|
|
</template>
|
2022-01-20 00:38:49 +01:00
|
|
|
|
|
|
|
|
<template v-slot:no-option>
|
2025-04-22 18:30:42 +02:00
|
|
|
<q-item v-if="mystr">
|
|
|
|
|
<q-item-section class="text-grey">
|
|
|
|
|
<span
|
2025-11-26 18:32:05 +01:00
|
|
|
v-if="Number.isInteger(parseInt(mystr)) && tools.isGruppoMacro()"
|
2025-04-22 18:30:42 +02:00
|
|
|
@click="searchOnGM(mystr)"
|
|
|
|
|
class="clickable-text"
|
|
|
|
|
>
|
|
|
|
|
Clicca qui per cercarlo su GM
|
|
|
|
|
</span>
|
|
|
|
|
<span v-else>
|
|
|
|
|
Testo non trovato: '{{ mystr }}'
|
|
|
|
|
</span>
|
|
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
<q-item v-else>
|
2025-04-04 18:15:14 +02:00
|
|
|
<q-item-section class="text-grey"> Digita il testo da cercare </q-item-section>
|
2022-01-20 00:38:49 +01:00
|
|
|
</q-item>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template v-slot:selected-item="scope">
|
|
|
|
|
<div v-if="scope.opt[fieldsTable.getLabelByTable(tablesel)]">
|
|
|
|
|
<q-chip
|
2022-01-20 02:26:48 +01:00
|
|
|
:removable="!sola_lettura"
|
2022-01-20 00:38:49 +01:00
|
|
|
dense
|
|
|
|
|
@remove="scope.removeAtIndex(scope.index)"
|
|
|
|
|
v-if="checkIfShowRec(scope.opt)"
|
2022-12-14 13:13:28 +01:00
|
|
|
:color="$q.dark.isActive ? `black` : `white`"
|
2022-12-14 22:07:23 +01:00
|
|
|
:text-color="$q.dark.isActive ? `white` : `black`"
|
2022-01-20 00:38:49 +01:00
|
|
|
class="q-my-none q-ml-xs q-mr-none"
|
|
|
|
|
>
|
2024-05-09 23:36:58 +02:00
|
|
|
<q-avatar
|
|
|
|
|
color="primary"
|
|
|
|
|
text-color="white"
|
|
|
|
|
icon=""
|
|
|
|
|
size="12px"
|
|
|
|
|
/>
|
2022-01-20 00:38:49 +01:00
|
|
|
{{ scope.opt[fieldsTable.getLabelByTable(tablesel)] }}
|
|
|
|
|
</q-chip>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
2022-01-20 01:17:21 +01:00
|
|
|
<template v-slot:option="{ itemProps, opt, selected, toggleOption }">
|
|
|
|
|
<q-item v-bind="itemProps">
|
|
|
|
|
<q-item-section>
|
2025-04-04 18:15:14 +02:00
|
|
|
<q-item-label>{{ opt[fieldsTable.getLabelByTable(tablesel)] }}</q-item-label>
|
2022-01-20 01:17:21 +01:00
|
|
|
</q-item-section>
|
|
|
|
|
<q-item-section side>
|
2024-05-09 23:36:58 +02:00
|
|
|
<q-toggle
|
|
|
|
|
:model-value="selected"
|
|
|
|
|
@update:model-value="toggleOption(opt)"
|
|
|
|
|
/>
|
2022-01-20 01:17:21 +01:00
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
</template>
|
2022-01-20 00:38:49 +01:00
|
|
|
</q-select>
|
|
|
|
|
</div>
|
2022-01-23 23:25:19 +01:00
|
|
|
<div v-else-if="pickup">
|
2021-09-16 21:08:02 +02:00
|
|
|
<q-select
|
2025-04-04 18:15:14 +02:00
|
|
|
ref="selectPickup"
|
2021-12-21 01:26:29 +01:00
|
|
|
v-if="pickup"
|
|
|
|
|
:model-value="myvalue"
|
2022-02-14 11:30:53 +01:00
|
|
|
@update:model-value="changeval"
|
|
|
|
|
rounded
|
|
|
|
|
outlined
|
2022-12-02 10:44:57 +01:00
|
|
|
:dense="dense"
|
2022-02-14 11:30:53 +01:00
|
|
|
options-dense
|
2021-12-21 01:26:29 +01:00
|
|
|
use-input
|
2025-02-03 17:18:33 +01:00
|
|
|
:label="addstrrequired + label"
|
2021-12-21 01:26:29 +01:00
|
|
|
input-debounce="300"
|
|
|
|
|
:input-class="myclass"
|
|
|
|
|
:options="valori"
|
|
|
|
|
:option-value="optval"
|
2025-11-26 18:32:05 +01:00
|
|
|
:option-label="(opt) => getOptionLabel(opt)"
|
2025-04-04 18:15:14 +02:00
|
|
|
:use-chips="tools.isValueNotEmpty(myvalue)"
|
2024-06-20 17:22:46 +02:00
|
|
|
stack-label
|
2025-04-04 18:15:14 +02:00
|
|
|
clearable
|
2022-12-02 10:55:04 +01:00
|
|
|
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
|
2021-12-21 01:26:29 +01:00
|
|
|
@filter="filterFn"
|
2025-04-04 18:15:14 +02:00
|
|
|
@clear="clear"
|
2021-12-21 01:26:29 +01:00
|
|
|
v-bind="$attrs"
|
|
|
|
|
>
|
2025-04-04 18:15:14 +02:00
|
|
|
<template
|
|
|
|
|
v-if="getIcon()"
|
|
|
|
|
v-slot:prepend
|
|
|
|
|
>
|
2024-05-09 23:36:58 +02:00
|
|
|
<q-icon
|
2025-04-04 18:15:14 +02:00
|
|
|
size="xs"
|
|
|
|
|
:name="getIcon()"
|
2024-05-09 23:36:58 +02:00
|
|
|
/>
|
|
|
|
|
</template>
|
2021-12-21 01:26:29 +01:00
|
|
|
<template v-slot:no-option>
|
2025-04-22 18:30:42 +02:00
|
|
|
<q-item v-if="mystr">
|
|
|
|
|
<q-item-section class="text-grey">
|
|
|
|
|
<span
|
2025-11-26 18:32:05 +01:00
|
|
|
v-if="Number.isInteger(parseInt(mystr)) && tools.isGruppoMacro()"
|
2025-04-22 18:30:42 +02:00
|
|
|
@click="searchOnGM(mystr)"
|
|
|
|
|
class="clickable-text text-blue"
|
|
|
|
|
>
|
|
|
|
|
Clicca qui per cercarlo su GM
|
|
|
|
|
</span>
|
|
|
|
|
<span v-else>
|
|
|
|
|
Testo non trovato: '{{ mystr }}'
|
|
|
|
|
</span>
|
|
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
<q-item v-else>
|
2025-04-04 18:15:14 +02:00
|
|
|
<q-item-section class="text-grey"> Digita il testo da cercare </q-item-section>
|
2021-12-21 01:26:29 +01:00
|
|
|
</q-item>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:option="scope">
|
|
|
|
|
<q-item v-bind="scope.itemProps">
|
2025-04-24 01:03:20 +02:00
|
|
|
<q-item-section :class="applyLabelColorBasedOnProductStatus(scope.opt)">
|
|
|
|
|
<q-item-label >
|
|
|
|
|
|
2025-03-31 23:55:53 +02:00
|
|
|
{{ tools.getValueByFunzOrVal(scope.opt, optlab) }}
|
2025-04-04 18:15:14 +02:00
|
|
|
</q-item-label>
|
2021-12-21 01:26:29 +01:00
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
</template>
|
|
|
|
|
</q-select>
|
2022-01-23 23:25:19 +01:00
|
|
|
</div>
|
|
|
|
|
<div v-else-if="multiple">
|
|
|
|
|
<q-select
|
2025-04-04 18:15:14 +02:00
|
|
|
ref="selectMultiple"
|
2022-01-23 23:25:19 +01:00
|
|
|
:multiple="true"
|
|
|
|
|
:model-value="myarrvalue"
|
|
|
|
|
label-color="primary"
|
2025-02-03 17:18:33 +01:00
|
|
|
:label="addstrrequired + label"
|
2022-01-23 23:25:19 +01:00
|
|
|
@update:model-value="changeval"
|
|
|
|
|
rounded
|
2022-12-02 10:55:04 +01:00
|
|
|
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
|
2022-01-23 23:25:19 +01:00
|
|
|
outlined
|
2022-01-26 01:31:07 +01:00
|
|
|
@filter="filterFn"
|
2022-01-23 23:25:19 +01:00
|
|
|
v-bind="$attrs"
|
|
|
|
|
:input-class="myclass"
|
|
|
|
|
:use-input="useinput"
|
|
|
|
|
input-debounce="0"
|
2022-01-28 00:57:28 +01:00
|
|
|
@new-value="newvaluefuncfirst"
|
2022-01-23 23:25:19 +01:00
|
|
|
map-options
|
|
|
|
|
emit-value
|
|
|
|
|
stack-label
|
|
|
|
|
:options="valori"
|
|
|
|
|
:option-value="optval"
|
|
|
|
|
:option-label="optlab"
|
2024-05-09 23:36:58 +02:00
|
|
|
:dense="dense"
|
|
|
|
|
>
|
2023-03-05 22:04:28 +01:00
|
|
|
<!--options-selected-class="text-deep-blue"-->
|
|
|
|
|
|
2025-04-04 18:15:14 +02:00
|
|
|
<template
|
|
|
|
|
v-if="getIcon()"
|
|
|
|
|
v-slot:prepend
|
|
|
|
|
>
|
2022-01-28 18:15:46 +01:00
|
|
|
<q-icon :name="getIcon()" />
|
|
|
|
|
</template>
|
2024-05-09 23:36:58 +02:00
|
|
|
<template v-slot:selected-item="scope">
|
|
|
|
|
<div v-if="tools.getValueByFunzOrVal(scope.opt, optlab)">
|
2022-01-23 23:25:19 +01:00
|
|
|
<q-chip
|
|
|
|
|
removable
|
|
|
|
|
dense
|
|
|
|
|
@remove="scope.removeAtIndex(scope.index)"
|
|
|
|
|
v-if="checkIfShowRec(scope.opt)"
|
2022-12-14 13:13:28 +01:00
|
|
|
:color="$q.dark.isActive ? `black` : `white`"
|
2022-01-23 23:25:19 +01:00
|
|
|
class="q-my-none q-ml-xs q-mr-none"
|
|
|
|
|
>
|
2024-05-09 23:36:58 +02:00
|
|
|
<q-avatar
|
|
|
|
|
color="primary"
|
|
|
|
|
text-color="white"
|
|
|
|
|
:icon="scope.opt.icon ? scope.opt.icon : ''"
|
|
|
|
|
size="12px"
|
|
|
|
|
/>
|
2022-02-08 23:06:22 +01:00
|
|
|
{{ tools.getValueByFunzOrVal(scope.opt, optlab) }}
|
2022-01-23 23:25:19 +01:00
|
|
|
</q-chip>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template
|
|
|
|
|
v-if="withToggle"
|
2024-05-09 23:36:58 +02:00
|
|
|
v-slot:option="{ itemProps, opt, selected, toggleOption }"
|
|
|
|
|
>
|
2022-01-23 23:25:19 +01:00
|
|
|
<q-item v-bind="itemProps">
|
|
|
|
|
<q-item-section>
|
2025-04-04 18:15:14 +02:00
|
|
|
<q-item-label>{{ tools.getValueByFunzOrVal(opt, optlab) }}</q-item-label>
|
|
|
|
|
<q-item-label
|
|
|
|
|
v-if="'hint' in opt"
|
|
|
|
|
class="hint"
|
|
|
|
|
>{{ opt['hint'] }}</q-item-label
|
|
|
|
|
>
|
2022-01-23 23:25:19 +01:00
|
|
|
</q-item-section>
|
|
|
|
|
<q-item-section side>
|
2024-05-09 23:36:58 +02:00
|
|
|
<q-toggle
|
|
|
|
|
:model-value="selected"
|
|
|
|
|
@update:model-value="toggleOption(opt)"
|
|
|
|
|
/>
|
2022-01-23 23:25:19 +01:00
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
</template>
|
|
|
|
|
</q-select>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else>
|
2021-12-21 01:26:29 +01:00
|
|
|
<q-select
|
2025-04-04 18:15:14 +02:00
|
|
|
ref="selectGeneric"
|
2022-01-23 23:25:19 +01:00
|
|
|
:multiple="false"
|
2021-09-16 21:08:02 +02:00
|
|
|
rounded
|
|
|
|
|
outlined
|
|
|
|
|
:dense="dense"
|
|
|
|
|
:input-class="myclass"
|
2021-10-04 01:29:15 +02:00
|
|
|
:model-value="myvalue"
|
2021-12-11 00:25:35 +01:00
|
|
|
:options="valori"
|
2021-09-16 21:08:02 +02:00
|
|
|
:option-value="optval"
|
|
|
|
|
:option-label="optlab"
|
2021-10-04 01:29:15 +02:00
|
|
|
@update:model-value="changeval"
|
2022-01-26 01:31:07 +01:00
|
|
|
@filter="filterFn"
|
2022-12-02 10:55:04 +01:00
|
|
|
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
|
2025-05-06 18:19:03 +02:00
|
|
|
:label="label ? addstrrequired + label : undefined"
|
2022-01-28 00:57:28 +01:00
|
|
|
:use-input="useinput"
|
|
|
|
|
@new-value="newvaluefuncfirst"
|
2021-09-16 21:08:02 +02:00
|
|
|
emit-value
|
2022-02-14 11:30:53 +01:00
|
|
|
input-debounce="0"
|
2021-09-16 21:08:02 +02:00
|
|
|
map-options
|
2021-12-17 18:30:18 +01:00
|
|
|
v-bind="$attrs"
|
2024-05-09 23:36:58 +02:00
|
|
|
:class="myclass ? myclass : 'combowidth'"
|
|
|
|
|
>
|
2025-04-04 18:15:14 +02:00
|
|
|
<template
|
|
|
|
|
v-if="getIcon()"
|
|
|
|
|
v-slot:prepend
|
|
|
|
|
>
|
2022-01-28 18:15:46 +01:00
|
|
|
<q-icon :name="getIcon()" />
|
|
|
|
|
</template>
|
2021-12-17 18:30:18 +01:00
|
|
|
<template v-slot:option="scope">
|
|
|
|
|
<q-item v-bind="scope.itemProps">
|
|
|
|
|
<q-item-section avatar>
|
2024-05-09 23:36:58 +02:00
|
|
|
<q-icon :name="scope.opt.icon ? scope.opt.icon : ''" />
|
2021-12-17 18:30:18 +01:00
|
|
|
</q-item-section>
|
|
|
|
|
<q-item-section>
|
2025-04-04 18:15:14 +02:00
|
|
|
<q-item-label>{{ tools.getValueByFunzOrVal(scope.opt, optlab) }}</q-item-label>
|
|
|
|
|
<q-item-label
|
|
|
|
|
v-if="'hint' in scope.opt"
|
|
|
|
|
class="hint"
|
|
|
|
|
>{{ scope.opt['hint'] }}</q-item-label
|
|
|
|
|
>
|
2021-12-17 18:30:18 +01:00
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
</template>
|
2021-09-16 21:08:02 +02:00
|
|
|
</q-select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
2025-04-04 18:15:14 +02:00
|
|
|
<script lang="ts" src="./CMySelect.ts"></script>
|
2021-09-16 21:08:02 +02:00
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
@import './CMySelect.scss';
|
|
|
|
|
</style>
|