refactor: refs #8647 solved inject warning
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
a4e4c882ee
commit
be3c48b9f1
|
@ -71,7 +71,7 @@ const $props = defineProps({
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
include: {
|
include: {
|
||||||
type: [Object, Array],
|
type: [Object, Array, String],
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
where: {
|
where: {
|
||||||
|
|
|
@ -146,14 +146,22 @@ const addFilter = async (filter, params) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
async function fetch(params) {
|
async function fetch(params) {
|
||||||
useArrayData(props.dataKey, params);
|
if (params) {
|
||||||
|
for (let param in params) {
|
||||||
|
if (params[param]) arrayData.store[param] = params[param];
|
||||||
|
}
|
||||||
|
}
|
||||||
arrayData.resetPagination();
|
arrayData.resetPagination();
|
||||||
await arrayData.fetch({ append: false });
|
await arrayData.fetch({ append: false });
|
||||||
return emitStoreData();
|
return emitStoreData();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function update(params) {
|
async function update(params) {
|
||||||
useArrayData(props.dataKey, params);
|
if (params) {
|
||||||
|
for (let param in params) {
|
||||||
|
if (params[param]) arrayData.store[param] = params[param];
|
||||||
|
}
|
||||||
|
}
|
||||||
const { limit, skip } = store;
|
const { limit, skip } = store;
|
||||||
store.limit = limit + skip;
|
store.limit = limit + skip;
|
||||||
store.skip = 0;
|
store.skip = 0;
|
||||||
|
|
|
@ -93,6 +93,7 @@ const columns = computed(() => [
|
||||||
optionLabel: 'name',
|
optionLabel: 'name',
|
||||||
optionValue: 'id',
|
optionValue: 'id',
|
||||||
},
|
},
|
||||||
|
columnClass: 'expand',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
@ -247,74 +248,70 @@ const closeEventForm = () => {
|
||||||
</QBtnGroup>
|
</QBtnGroup>
|
||||||
</template>
|
</template>
|
||||||
</VnSubToolbar>
|
</VnSubToolbar>
|
||||||
<div class="table-container">
|
<VnTable
|
||||||
<div class="column items-center">
|
ref="tableRef"
|
||||||
<VnTable
|
:data-key="dataKey"
|
||||||
ref="tableRef"
|
:columns="columns"
|
||||||
:data-key="dataKey"
|
redirect="Zone"
|
||||||
:columns="columns"
|
:create="{
|
||||||
redirect="Zone"
|
urlCreate: 'Zones',
|
||||||
:create="{
|
title: t('list.createZone'),
|
||||||
urlCreate: 'Zones',
|
onDataSaved: ({ id }) => tableRef.redirect(`${id}/location`),
|
||||||
title: t('list.createZone'),
|
formInitialData: {},
|
||||||
onDataSaved: ({ id }) => tableRef.redirect(`${id}/location`),
|
}"
|
||||||
formInitialData: {},
|
table-height="85vh"
|
||||||
}"
|
v-model:selected="selectedRows"
|
||||||
table-height="85vh"
|
:table="{
|
||||||
v-model:selected="selectedRows"
|
'row-key': 'id',
|
||||||
:table="{
|
selection: 'multiple',
|
||||||
'row-key': 'id',
|
}"
|
||||||
selection: 'multiple',
|
>
|
||||||
}"
|
<template #column-addressFk="{ row }">
|
||||||
>
|
{{ dashIfEmpty(formatRow(row)) }}
|
||||||
<template #column-addressFk="{ row }">
|
</template>
|
||||||
{{ dashIfEmpty(formatRow(row)) }}
|
<template #more-create-dialog="{ data }">
|
||||||
</template>
|
<VnSelect
|
||||||
<template #more-create-dialog="{ data }">
|
url="AgencyModes"
|
||||||
<VnSelect
|
v-model="data.agencyModeFk"
|
||||||
url="AgencyModes"
|
option-value="id"
|
||||||
v-model="data.agencyModeFk"
|
option-label="name"
|
||||||
option-value="id"
|
:label="t('list.agency')"
|
||||||
option-label="name"
|
/>
|
||||||
:label="t('list.agency')"
|
<VnInput
|
||||||
/>
|
v-model="data.price"
|
||||||
<VnInput
|
:label="t('list.price')"
|
||||||
v-model="data.price"
|
min="0"
|
||||||
:label="t('list.price')"
|
type="number"
|
||||||
min="0"
|
required="true"
|
||||||
type="number"
|
/>
|
||||||
required="true"
|
<VnInput
|
||||||
/>
|
v-model="data.bonus"
|
||||||
<VnInput
|
:label="t('zone.bonus')"
|
||||||
v-model="data.bonus"
|
min="0"
|
||||||
:label="t('zone.bonus')"
|
type="number"
|
||||||
min="0"
|
/>
|
||||||
type="number"
|
<VnInput
|
||||||
/>
|
v-model="data.travelingDays"
|
||||||
<VnInput
|
:label="t('zone.travelingDays')"
|
||||||
v-model="data.travelingDays"
|
type="number"
|
||||||
:label="t('zone.travelingDays')"
|
min="0"
|
||||||
type="number"
|
/>
|
||||||
min="0"
|
<VnInputTime v-model="data.hour" :label="t('list.close')" />
|
||||||
/>
|
<VnSelect
|
||||||
<VnInputTime v-model="data.hour" :label="t('list.close')" />
|
url="Warehouses"
|
||||||
<VnSelect
|
v-model="data.warehouseFK"
|
||||||
url="Warehouses"
|
option-value="id"
|
||||||
v-model="data.warehouseFK"
|
option-label="name"
|
||||||
option-value="id"
|
:label="t('list.warehouse')"
|
||||||
option-label="name"
|
:options="warehouseOptions"
|
||||||
:label="t('list.warehouse')"
|
/>
|
||||||
:options="warehouseOptions"
|
<QCheckbox
|
||||||
/>
|
v-model="data.isVolumetric"
|
||||||
<QCheckbox
|
:label="t('list.isVolumetric')"
|
||||||
v-model="data.isVolumetric"
|
:toggle-indeterminate="false"
|
||||||
:label="t('list.isVolumetric')"
|
/>
|
||||||
:toggle-indeterminate="false"
|
</template>
|
||||||
/>
|
</VnTable>
|
||||||
</template>
|
|
||||||
</VnTable>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
</VnSection>
|
</VnSection>
|
||||||
<QDialog v-model="showZoneEventForm" @hide="closeEventForm()">
|
<QDialog v-model="showZoneEventForm" @hide="closeEventForm()">
|
||||||
|
@ -333,24 +330,6 @@ const closeEventForm = () => {
|
||||||
/>
|
/>
|
||||||
</QDialog>
|
</QDialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.table-container {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
.column {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
min-width: 70%;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.shrink-column) {
|
|
||||||
width: 8%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
es:
|
es:
|
||||||
Search zone: Buscar zona
|
Search zone: Buscar zona
|
||||||
|
|
Loading…
Reference in New Issue