fix bug for +/-
This commit is contained in:
11
vue-project/my-kintone-plugin/src/js/fields.ts
Normal file
11
vue-project/my-kintone-plugin/src/js/fields.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import type { FieldType } from "./kintone-rest-api-client";
|
||||
|
||||
const availableJoinType: FieldType[] = [
|
||||
'SINGLE_LINE_TEXT',
|
||||
'NUMBER',
|
||||
'CALC',
|
||||
'DATE',
|
||||
'TIME',
|
||||
'DATETIME',
|
||||
'LINK'
|
||||
] as const
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { FieldsInfo, JoinTable, WhereCondition } from '@/types/model';
|
||||
import type { FieldsInfo, FieldsJoinMapping, JoinTable, WhereCondition } from '@/types/model';
|
||||
import { client, isType, type FieldType, type App, type Layout } from './kintone-rest-api-client';
|
||||
import type { DropdownItem } from 'kintone-ui-component';
|
||||
|
||||
@@ -7,11 +7,21 @@ export const EMPTY_OPTION = {
|
||||
label: '--------',
|
||||
} as DropdownItem;
|
||||
|
||||
export const getEmptyWhereCondition = () => ({ field: '', condition: '', data: '' }) as WhereCondition;
|
||||
export const getEmptyOnCondition = () => ({ leftField: '', rightField: '' });
|
||||
export const getEmptyFieldsMapping = () => ({ leftField: '', rightField: '' });
|
||||
export function generateId(): string {
|
||||
const timestamp = new Date().getTime().toString(36);
|
||||
const randomNum = Math.random().toString(36).substring(2, 11);
|
||||
return `${timestamp}-${randomNum}`;
|
||||
}
|
||||
|
||||
export function createEmptyJoinTable(id = Number(new Date())) {
|
||||
export function search(list: Array<WhereCondition|FieldsJoinMapping>, id: string) {
|
||||
return list.find(item => item.id === id);
|
||||
}
|
||||
|
||||
export const getEmptyWhereCondition = () => ({ field: '', condition: '', data: '', id: generateId()} as WhereCondition);
|
||||
export const getEmptyOnCondition = () => ({ leftField: '', rightField: '', id: generateId() } as FieldsJoinMapping);
|
||||
export const getEmptyFieldsMapping = () => ({ leftField: '', rightField: '', id: generateId() } as FieldsJoinMapping);
|
||||
|
||||
export function createEmptyJoinTable(id = generateId()) {
|
||||
return resetTable({ id, app: '' } as JoinTable);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user