mirror of
https://github.com/nocodb/nocodb.git
synced 2026-05-02 12:47:16 +00:00
@@ -64,7 +64,9 @@
|
||||
<date-time-picker-cell v-else-if="isDateTime" v-model="localState" ignore-focus v-on="parentListeners" />
|
||||
|
||||
<enum-cell
|
||||
v-else-if="isEnum && ((!isForm && !active) || isLocked || (isPublic && !isForm) || !_isUIAllowed('tableRowUpdate'))"
|
||||
v-else-if="
|
||||
isEnum && ((!isForm && !active) || isLocked || (isPublic && !isForm) || !_isUIAllowed('tableRowUpdate'))
|
||||
"
|
||||
v-model="localState"
|
||||
:column="column"
|
||||
v-on="parentListeners"
|
||||
|
||||
@@ -17,14 +17,12 @@ export default {
|
||||
props: ['value', 'column'],
|
||||
computed: {
|
||||
enumValues() {
|
||||
const opts = (this.column.colOptions)
|
||||
? this.column.colOptions.options.filter(el => el.title !== '') || []
|
||||
: [];
|
||||
const opts = this.column.colOptions ? this.column.colOptions.options.filter(el => el.title !== '') || [] : [];
|
||||
for (const op of opts.filter(el => el.order === null)) {
|
||||
op.title = op.title.replace(/^'/, '').replace(/'$/, '');
|
||||
}
|
||||
return opts;
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -19,9 +19,7 @@ export default {
|
||||
props: ['value', 'column'],
|
||||
computed: {
|
||||
setValues() {
|
||||
const opts = (this.column.colOptions)
|
||||
? this.column.colOptions.options.filter(el => el.title !== '') || []
|
||||
: [];
|
||||
const opts = this.column.colOptions ? this.column.colOptions.options.filter(el => el.title !== '') || [] : [];
|
||||
for (const op of opts.filter(el => el.order === null)) {
|
||||
op.title = op.title.replace(/^'/, '').replace(/'$/, '');
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ export default {
|
||||
this.options = this.copyOptions(this.column.colOptions?.options) || [];
|
||||
// Support for older options
|
||||
for (const op of this.options.filter(el => el.order === null)) {
|
||||
op.title = op.title.replace(/^'/, '').replace(/'$/, '')
|
||||
op.title = op.title.replace(/^'/, '').replace(/'$/, '');
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -88,9 +88,7 @@ export default {
|
||||
};
|
||||
await this.$api.dbTableColumn.create(this.meta.id, selectCol);
|
||||
if (this.column.colOptions) {
|
||||
this.$store
|
||||
.dispatch('meta/ActLoadMeta', { force: true, id: this.column.fk_model_id })
|
||||
.then(() => {});
|
||||
this.$store.dispatch('meta/ActLoadMeta', { force: true, id: this.column.fk_model_id }).then(() => {});
|
||||
}
|
||||
this.$toast.success('Select column saved successfully').goAway(3000);
|
||||
return true;
|
||||
@@ -113,9 +111,7 @@ export default {
|
||||
};
|
||||
await this.$api.dbTableColumn.update(this.column.id, selectCol);
|
||||
if (this.column.colOptions) {
|
||||
this.$store
|
||||
.dispatch('meta/ActLoadMeta', { force: true, id: this.column.fk_model_id })
|
||||
.then(() => {});
|
||||
this.$store.dispatch('meta/ActLoadMeta', { force: true, id: this.column.fk_model_id }).then(() => {});
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
dense
|
||||
flat
|
||||
hide-details
|
||||
:class="`mt-0 ${isForm ? 'form-select': ''}`"
|
||||
:class="`mt-0 ${isForm ? 'form-select' : ''}`"
|
||||
:clearable="!column.rqd"
|
||||
v-on="parentListeners"
|
||||
>
|
||||
@@ -55,9 +55,7 @@ export default {
|
||||
},
|
||||
},
|
||||
enumValues() {
|
||||
const opts = (this.column.colOptions)
|
||||
? this.column.colOptions.options.filter(el => el.title !== '') || []
|
||||
: [];
|
||||
const opts = this.column.colOptions ? this.column.colOptions.options.filter(el => el.title !== '') || [] : [];
|
||||
for (const op of opts.filter(el => el.order === null)) {
|
||||
op.title = op.title.replace(/^'/, '').replace(/'$/, '');
|
||||
}
|
||||
@@ -105,7 +103,7 @@ export default {
|
||||
}
|
||||
.form-select {
|
||||
.v-select__selections {
|
||||
border: 1px solid rgba(127,130,139,0.2);
|
||||
border: 1px solid rgba(127, 130, 139, 0.2);
|
||||
}
|
||||
input {
|
||||
z-index: -1;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
solo
|
||||
hide-details
|
||||
deletable-chips
|
||||
:class="`text-center mt-0 ${isForm ? 'form-select': ''}`"
|
||||
:class="`text-center mt-0 ${isForm ? 'form-select' : ''}`"
|
||||
>
|
||||
<template #selection="data">
|
||||
<v-chip
|
||||
@@ -27,15 +27,13 @@
|
||||
</v-chip>
|
||||
</template>
|
||||
|
||||
<template #item="{item}">
|
||||
<template #item="{ item }">
|
||||
<v-chip small :color="item.color">
|
||||
{{ item.title }}
|
||||
</v-chip>
|
||||
</template>
|
||||
<template #append>
|
||||
<v-icon small class="mt-1">
|
||||
mdi-menu-down
|
||||
</v-icon>
|
||||
<v-icon small class="mt-1"> mdi-menu-down </v-icon>
|
||||
</template>
|
||||
</v-select>
|
||||
</div>
|
||||
@@ -59,9 +57,7 @@ export default {
|
||||
},
|
||||
},
|
||||
setValues() {
|
||||
const opts = (this.column.colOptions)
|
||||
? this.column.colOptions.options.filter(el => el.title !== '') || []
|
||||
: [];
|
||||
const opts = this.column.colOptions ? this.column.colOptions.options.filter(el => el.title !== '') || [] : [];
|
||||
for (const op of opts.filter(el => el.order === null)) {
|
||||
op.title = op.title.replace(/^'/, '').replace(/'$/, '');
|
||||
}
|
||||
@@ -91,7 +87,6 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
::v-deep {
|
||||
.v-select {
|
||||
min-width: 150px;
|
||||
@@ -99,7 +94,7 @@ export default {
|
||||
min-height: 38px !important;
|
||||
}
|
||||
}
|
||||
.v-input__slot{
|
||||
.v-input__slot {
|
||||
padding-right: 0 !important;
|
||||
}
|
||||
.v-input__icon.v-input__icon--clear {
|
||||
@@ -114,14 +109,13 @@ export default {
|
||||
}
|
||||
.form-select {
|
||||
.v-select__selections {
|
||||
border: 1px solid rgba(127,130,139,0.2);
|
||||
border: 1px solid rgba(127, 130, 139, 0.2);
|
||||
}
|
||||
input {
|
||||
z-index: -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
<!--
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user