fix load saved data

This commit is contained in:
2025-01-23 13:58:16 +08:00
parent e022cb5d89
commit a8754d7925
5 changed files with 69 additions and 30 deletions

View File

@@ -4,7 +4,7 @@
<script setup lang="ts">
import type { CachedData, CachedSelectedAppData, SavedData, WhereCondition } from '@/types/model';
import { defineProps, defineEmits, inject, computed, ref, reactive, render, h, watch, onMounted } from 'vue';
import { defineProps, inject, computed, render, h } from 'vue';
import TableCombobox from './TableCombobox.vue';
import { getFieldsDropdownItems } from '@/js/helper';
import type { ConditionValue } from '@/js/conditions';
@@ -27,11 +27,11 @@ const columns = [
render: (cellData: string, rowData: any, rowIndex: number) => {
const container = document.createElement('div');
const vnode = h(TableCombobox, {
items: getFieldsDropdownItems(selectedAppData.appFields, {
items: computed(() => getFieldsDropdownItems(selectedAppData.appFields, {
subTableCode: table.value,
defaultLabel: 'すべてのレコード',
}),
modelValue: '',
})),
modelValue: props.modelValue[rowIndex].field,
selectedAppData,
'onUpdate:modelValue': (newValue: string) => {
props.modelValue[rowIndex].field = newValue;
@@ -49,7 +49,7 @@ const columns = [
render: (cellData: string, rowData: any, rowIndex: number) => {
const container = document.createElement('div');
const vnode = h(TableCondition, {
modelValue: '',
modelValue: props.modelValue[rowIndex].condition,
index: rowIndex,
selectedAppData,
whereConditions: props.modelValue,
@@ -68,7 +68,7 @@ const columns = [
render: (cellData: string, rowData: any, rowIndex: number) => {
const container = document.createElement('div');
const vnode = h(TableConditionValue, {
modelValue: '',
modelValue: props.modelValue[rowIndex].data,
index: rowIndex,
selectedAppData,
whereConditions: props.modelValue,