fix ts
This commit is contained in:
@@ -19,7 +19,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { createEmptyJoinTable, loadApps, loadAppFieldsAndLayout, EMPTY_OPTION, getEmptyOnCondition } from '@/js/helper';
|
import { createEmptyJoinTable, loadApps, loadAppFieldsAndLayout, EMPTY_OPTION, getEmptyOnCondition } from '@/js/helper';
|
||||||
import type { CachedData, FieldsInfo, JoinTable, SavedData } from '@/types/model';
|
import type { CachedData, FieldsInfo, SavedData } from '@/types/model';
|
||||||
import type { Spinner } from 'kintone-ui-component';
|
import type { Spinner } from 'kintone-ui-component';
|
||||||
|
|
||||||
import { onMounted, watch, provide, reactive, ref, shallowRef, nextTick } from 'vue';
|
import { onMounted, watch, provide, reactive, ref, shallowRef, nextTick } from 'vue';
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { KucEvent } from '@/types/my-kintone';
|
import type { KucEvent } from '@/types/my-kintone';
|
||||||
import type { DropdownItem } from 'kintone-ui-component';
|
import type { ComboboxChangeEventDetail, DropdownItem } from 'kintone-ui-component';
|
||||||
import { defineProps, defineEmits } from 'vue';
|
import { defineProps, defineEmits } from 'vue';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
@@ -21,7 +21,7 @@ const emit = defineEmits<{
|
|||||||
(e: 'update:modelValue', value: string): void;
|
(e: 'update:modelValue', value: string): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const updateValue = (event: KucEvent) => {
|
const updateValue = ({ detail }: KucEvent<ComboboxChangeEventDetail>) => {
|
||||||
emit('update:modelValue', event.detail.value);
|
emit('update:modelValue', detail.value || '');
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { KucEvent } from '@/types/my-kintone';
|
import type { KucEvent } from '@/types/my-kintone';
|
||||||
|
import type { TextInputEventDetail } from 'kintone-ui-component';
|
||||||
import { defineProps, defineEmits } from 'vue';
|
import { defineProps, defineEmits } from 'vue';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
@@ -19,7 +20,7 @@ const emit = defineEmits<{
|
|||||||
(e: 'update:modelValue', value: string): void;
|
(e: 'update:modelValue', value: string): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const updateValue = (event: KucEvent) => {
|
const updateValue = ({ detail }: KucEvent<TextInputEventDetail>) => {
|
||||||
emit('update:modelValue', event.detail.value);
|
emit('update:modelValue', detail.value || '');
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ import {
|
|||||||
} from '@/js/helper';
|
} from '@/js/helper';
|
||||||
import { types } from '@/js/kintone-rest-api-client';
|
import { types } from '@/js/kintone-rest-api-client';
|
||||||
import type { CachedData, CachedSelectedAppData, FieldsInfo, JoinTable, SavedData } from '@/types/model';
|
import type { CachedData, CachedSelectedAppData, FieldsInfo, JoinTable, SavedData } from '@/types/model';
|
||||||
import type { KucEvent } from '@/types/my-kintone';
|
|
||||||
import { computed, inject, provide, reactive, ref, watch } from 'vue';
|
import { computed, inject, provide, reactive, ref, watch } from 'vue';
|
||||||
|
|
||||||
const savedData = inject<SavedData>('savedData') as SavedData;
|
const savedData = inject<SavedData>('savedData') as SavedData;
|
||||||
@@ -92,7 +91,7 @@ watch(
|
|||||||
{ immediate: true },
|
{ immediate: true },
|
||||||
);
|
);
|
||||||
|
|
||||||
const selectTable = (e: KucEvent) => {
|
const selectTable = () => {
|
||||||
resetConditions(props.table);
|
resetConditions(props.table);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -7,10 +7,8 @@ import type { CachedData, CachedSelectedAppData, SavedData, WhereCondition } fro
|
|||||||
import { defineProps, inject, computed, render, h, reactive } from 'vue';
|
import { defineProps, inject, computed, render, h, reactive } from 'vue';
|
||||||
import TableCombobox from './TableCombobox.vue';
|
import TableCombobox from './TableCombobox.vue';
|
||||||
import { generateId, getFieldsDropdownItems, search } from '@/js/helper';
|
import { generateId, getFieldsDropdownItems, search } from '@/js/helper';
|
||||||
import type { ConditionValue } from '@/js/conditions';
|
|
||||||
import TableCondition from './conditions/TableCondition.vue';
|
import TableCondition from './conditions/TableCondition.vue';
|
||||||
import TableConditionValue from './conditions/TableConditionValue.vue';
|
import TableConditionValue from './conditions/TableConditionValue.vue';
|
||||||
import type { KucTableEvent } from '@/types/my-kintone';
|
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
modelValue: WhereCondition[];
|
modelValue: WhereCondition[];
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
import { search } from '@/js/helper';
|
import { search } from '@/js/helper';
|
||||||
import type { CachedSelectedAppData } from '@/types/model';
|
import type { CachedSelectedAppData } from '@/types/model';
|
||||||
import type { KucEvent } from '@/types/my-kintone';
|
import type { KucEvent } from '@/types/my-kintone';
|
||||||
import type { DropdownItem } from 'kintone-ui-component';
|
import type { ComboboxChangeEventDetail, DropdownItem } from 'kintone-ui-component';
|
||||||
import { defineProps, defineEmits, type Ref, watch, ref } from 'vue';
|
import { defineProps, defineEmits, type Ref, watch, ref } from 'vue';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
@@ -45,7 +45,7 @@ const emit = defineEmits<{
|
|||||||
(e: 'update:modelValue', data: EmitData): void;
|
(e: 'update:modelValue', data: EmitData): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const updateValue = (event: KucEvent) => {
|
const updateValue = ({ detail }: KucEvent<ComboboxChangeEventDetail>) => {
|
||||||
emit('update:modelValue', { obj: search(props.dataList, props.id), value: event.detail.value });
|
emit('update:modelValue', { obj: search(props.dataList, props.id), value: detail.value || '' });
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import { getAvailableCondition, type ConditionValue } from '@/js/conditions';
|
|||||||
import { search } from '@/js/helper';
|
import { search } from '@/js/helper';
|
||||||
import type { CachedSelectedAppData, WhereCondition } from '@/types/model';
|
import type { CachedSelectedAppData, WhereCondition } from '@/types/model';
|
||||||
import type { KucEvent } from '@/types/my-kintone';
|
import type { KucEvent } from '@/types/my-kintone';
|
||||||
|
import type { ComboboxChangeEventDetail } from 'kintone-ui-component';
|
||||||
import { defineProps, defineEmits, computed } from 'vue';
|
import { defineProps, defineEmits, computed } from 'vue';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
@@ -35,7 +36,7 @@ const emit = defineEmits<{
|
|||||||
(e: 'update:modelValue', data: EmitData): void;
|
(e: 'update:modelValue', data: EmitData): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const updateValue = (event: KucEvent) => {
|
const updateValue = ({ detail }: KucEvent<ComboboxChangeEventDetail>) => {
|
||||||
emit('update:modelValue', { obj: whereCondition.value, value: event.detail.value as ConditionValue });
|
emit('update:modelValue', { obj: whereCondition.value, value: detail.value as ConditionValue });
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import { getComponent } from '@/js/conditions';
|
|||||||
import { search } from '@/js/helper';
|
import { search } from '@/js/helper';
|
||||||
import type { CachedSelectedAppData, WhereCondition } from '@/types/model';
|
import type { CachedSelectedAppData, WhereCondition } from '@/types/model';
|
||||||
import type { KucEvent } from '@/types/my-kintone';
|
import type { KucEvent } from '@/types/my-kintone';
|
||||||
|
import type { ComboboxChangeEventDetail, TextInputEventDetail } from 'kintone-ui-component';
|
||||||
import { defineProps, defineEmits, computed } from 'vue';
|
import { defineProps, defineEmits, computed } from 'vue';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
@@ -40,7 +41,7 @@ const emit = defineEmits<{
|
|||||||
(e: 'update:modelValue', data: EmitData): void;
|
(e: 'update:modelValue', data: EmitData): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const updateValue = (event: KucEvent) => {
|
const updateValue = (event: KucEvent<ComboboxChangeEventDetail | TextInputEventDetail>) => {
|
||||||
emit('update:modelValue', { obj: whereCondition.value, value: event.detail.value });
|
emit('update:modelValue', { obj: whereCondition.value, value: event.detail.value || '' });
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export type App = {
|
|||||||
export type Properties = Awaited<ReturnType<typeof client.app.getFormFields>>['properties'];
|
export type Properties = Awaited<ReturnType<typeof client.app.getFormFields>>['properties'];
|
||||||
export type Layout = Awaited<ReturnType<typeof client.app.getFormLayout>>['layout'];
|
export type Layout = Awaited<ReturnType<typeof client.app.getFormLayout>>['layout'];
|
||||||
|
|
||||||
type OneOf = Properties[string];
|
export type OneOf = Properties[string];
|
||||||
export type FieldType = OneOf['type'];
|
export type FieldType = OneOf['type'];
|
||||||
|
|
||||||
const typeNames = [
|
const typeNames = [
|
||||||
|
|||||||
@@ -1,9 +1,3 @@
|
|||||||
import type { TableChangeEventDetail } from 'kintone-ui-component';
|
export interface KucEvent<T> {
|
||||||
export interface KucEvent {
|
detail: T;
|
||||||
detail: {
|
|
||||||
value: string;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
export interface KucTableEvent {
|
|
||||||
detail: TableChangeEventDetail;
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user