1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-06-05 21:59:22 +02:00

feat(Firebird SQL): manual commit mode

This commit is contained in:
2022-11-10 15:52:31 +01:00
parent 03777a2ea3
commit 27566c1dfa
9 changed files with 97 additions and 75 deletions

View File

@ -81,7 +81,6 @@
:fields="fieldsObj"
:key-usage="keyUsage"
:element-type="elementType"
:blob-as-text="blobAsText"
:class="{'selected': selectedRows.includes(row._antares_id)}"
:selected="selectedRows.includes(row._antares_id)"
:selected-cell="selectedRows.length === 1 && selectedRows.includes(row._antares_id) ? selectedField : null"
@ -183,7 +182,6 @@ const isEditingRow = ref(false);
const workspaceSchema = computed(() => getWorkspace(props.connUid).breadcrumbs.schema);
const workspaceClient = computed(() => getWorkspace(props.connUid).client);
const blobAsText = computed(() => getWorkspace(props.connUid).customizations.blobAsText);
const primaryField = computed(() => {
const primaryFields = fields.value.filter(field => field.key === 'pri');

View File

@ -243,8 +243,7 @@ const props = defineProps({
itemHeight: Number,
elementType: { type: String, default: 'table' },
selected: { type: Boolean, default: false },
selectedCell: { type: String, default: null },
blobAsText: { type: Boolean, default: false }
selectedCell: { type: String, default: null }
});
const emit = defineEmits(['update-field', 'select-row', 'contextmenu', 'start-editing', 'stop-editing']);
@ -319,7 +318,7 @@ const inputProps = computed(() => {
return { type: 'text', mask: datetimeMask };
}
if (BLOB.includes(editingType.value) && !props.blobAsText)
if (BLOB.includes(editingType.value))
return { type: 'file', mask: false };
if (BOOLEAN.includes(editingType.value))
@ -399,7 +398,7 @@ const editON = async (field: string) => {
editingField.value = field;
editingLength.value = props.fields[field].length;
if ([...LONG_TEXT, ...ARRAY, ...TEXT_SEARCH].includes(type) || (BLOB.includes(type) && props.blobAsText)) {
if ([...LONG_TEXT, ...ARRAY, ...TEXT_SEARCH].includes(type)) {
isTextareaEditor.value = true;
editingContent.value = typeFormat(content, type);
emit('start-editing', field);
@ -416,7 +415,7 @@ const editON = async (field: string) => {
return;
}
if (BLOB.includes(type) && !props.blobAsText) {
if (BLOB.includes(type)) {
isBlobEditor.value = true;
editingContent.value = content || '';
fileToUpload.value = null;
@ -455,7 +454,7 @@ const editOFF = () => {
isInlineEditor.value[editingField.value] = false;
let content;
if (!BLOB.includes(editingType.value) || (BLOB.includes(editingType.value) && props.blobAsText)) {
if (!BLOB.includes(editingType.value)) {
if ([...DATETIME, ...TIME].includes(editingType.value)) {
if (editingContent.value !== null && editingContent.value.substring(editingContent.value.length - 1) === '.')
editingContent.value = editingContent.value.slice(0, -1);
@ -589,7 +588,7 @@ const typeFormat = (val: string | number | Date | number[], type: string, precis
return moment(val).isValid() ? moment(val).format(`YYYY-MM-DD HH:mm:ss${datePrecision}`) : val;
}
if (BLOB.includes(type) && !props.blobAsText) {
if (BLOB.includes(type)) {
const buff = Buffer.from(val as string);
if (!buff.length) return '';