fix ui for custom fields with very long text

This commit is contained in:
wh1te909 2021-05-04 06:47:53 +00:00
parent 707b4c46d9
commit ca735bc14a
5 changed files with 14 additions and 5 deletions

View File

@ -1,5 +1,6 @@
<template>
<q-input
:class="longTextClass(field)"
v-if="field.type === 'text' || field.type === 'number'"
ref="input"
outlined
@ -88,6 +89,11 @@ export default {
return field.default_value_bool ? `Default value: ${field.default_value_bool}` : "";
else return field.default_value_string ? `Default value: ${field.default_value_string}` : "";
},
longTextClass(field) {
return field.hasOwnProperty("default_value_string") && field.default_value_string.length >= 130
? "q-mb-xl q-mt-xl"
: "";
},
},
computed: {
validationRules() {

View File

@ -465,9 +465,6 @@ export default {
})
.catch(e => {});
},
truncateText(txt) {
return txt.length >= 60 ? txt.substring(0, 60) + "..." : txt;
},
isBuiltInScript(pk) {
try {
return this.scripts.find(i => i.id === pk).script_type === "builtin" ? true : false;

View File

@ -57,7 +57,10 @@
<span v-if="props.row.default_values_multiple.length > 0">{{ props.row.default_values_multiple }}</span>
</q-td>
<q-td v-else>
{{ props.row.default_value_string }}
{{ truncateText(props.row.default_value_string) }}
<q-tooltip v-if="props.row.default_value_string.length >= 60" content-style="font-size: 12px">{{
props.row.default_value_string
}}</q-tooltip>
</q-td>
<!-- required -->
<q-td>

View File

@ -1,5 +1,5 @@
<template>
<q-card style="min-width: 85vh">
<q-card style="min-width: 60vw">
<q-splitter v-model="splitterModel">
<template v-slot:before>
<q-tabs dense v-model="tab" vertical class="text-primary">

View File

@ -209,5 +209,8 @@ export default {
const b = date.formatDate(ret, "h:mm A");
return `${a} at ${b}`;
},
truncateText(txt) {
return txt.length >= 60 ? txt.substring(0, 60) + "..." : txt;
},
}
}