From 41ba930473135793616fbb9916cc8352127a2f63 Mon Sep 17 00:00:00 2001 From: xue jiahao Date: Thu, 6 Feb 2025 21:50:55 +0800 Subject: [PATCH] Fix code format --- .../basic/conditions/TableConditionValue.vue | 97 +++++++++---------- .../my-kintone-plugin/src/js/conditions.ts | 15 ++- .../my-kintone-plugin/src/js/helper.ts | 22 ++--- .../src/types/my-kintone.d.ts | 2 +- vue-project/my-kintone-plugin/vite.config.ts | 6 +- 5 files changed, 70 insertions(+), 72 deletions(-) diff --git a/vue-project/my-kintone-plugin/src/components/basic/conditions/TableConditionValue.vue b/vue-project/my-kintone-plugin/src/components/basic/conditions/TableConditionValue.vue index 5cec981..16c43f2 100644 --- a/vue-project/my-kintone-plugin/src/components/basic/conditions/TableConditionValue.vue +++ b/vue-project/my-kintone-plugin/src/components/basic/conditions/TableConditionValue.vue @@ -27,29 +27,29 @@ :disabled="selectedAppData.loading == undefined ? false : selectedAppData.loading" /> + /> - diff --git a/vue-project/my-kintone-plugin/src/js/conditions.ts b/vue-project/my-kintone-plugin/src/js/conditions.ts index b418ca6..1307428 100644 --- a/vue-project/my-kintone-plugin/src/js/conditions.ts +++ b/vue-project/my-kintone-plugin/src/js/conditions.ts @@ -30,8 +30,8 @@ export const conditionList: ConditionItem[] = [ { value: '>', label: '> (より後)', type: (field) => dateTimeComponent[field.type] || 'input' }, { value: 'like', label: '次のキーワードを含む', type: 'input' }, { value: 'not like', label: '次のキーワードを含まない', type: 'input' }, - { value: 'in', label: '次のいずれかを含む', type: (field)=>MultiChoiceComponent[field.type] || 'input' }, - { value: 'not in', label: '次のいずれも含まない', type: (field)=>MultiChoiceComponent[field.type] || 'input' }, + { value: 'in', label: '次のいずれかを含む', type: (field) => MultiChoiceComponent[field.type] || 'input' }, + { value: 'not in', label: '次のいずれも含まない', type: (field) => MultiChoiceComponent[field.type] || 'input' }, ]; // search from conditionList @@ -95,8 +95,8 @@ const component = { time: 'kuc-time', date: 'date', datetime: 'datetime', - multiChoice:'kuc-multichoice', - multiInput :"multi-input" + multiChoice: 'kuc-multichoice', + multiInput: 'multi-input', }; export const isDateTimeType = (field: OneOf) => { @@ -111,16 +111,15 @@ const dateTimeComponent: Partial> = { UPDATED_TIME: 'datetime', }; -const MultiChoiceComponent:Partial> = { +const MultiChoiceComponent: Partial> = { CHECK_BOX: 'multiChoice', DROP_DOWN: 'multiChoice', RADIO_BUTTON: 'multiChoice', MULTI_SELECT: 'multiChoice', - SINGLE_LINE_TEXT : 'multiInput', - LINK : 'multiInput' + SINGLE_LINE_TEXT: 'multiInput', + LINK: 'multiInput', }; - export type ComponentType = keyof typeof component; export const getComponent = (value: ConditionValue, fieldObj: OneOf) => { if (!value || !fieldObj) return; diff --git a/vue-project/my-kintone-plugin/src/js/helper.ts b/vue-project/my-kintone-plugin/src/js/helper.ts index 656f6a5..c65fb78 100644 --- a/vue-project/my-kintone-plugin/src/js/helper.ts +++ b/vue-project/my-kintone-plugin/src/js/helper.ts @@ -181,31 +181,31 @@ export function getFieldObj(fieldCode: string, { fields }: FieldsInfo, subTableC return meta[fieldCode]; } -export function getMeta(fields: Properties, subTableCode?: string ,withNoSubTableField = true) { +export function getMeta(fields: Properties, subTableCode?: string, withNoSubTableField = true) { if (!fields || !subTableCode) { return fields; } let meta = fields; const table = meta[subTableCode]; if (isType.SUBTABLE(table)) { - const subFields = table.fields; ; - Object.values(subFields).forEach(field=>{ + const subFields = table.fields; + Object.values(subFields).forEach((field) => { if (typeof field === 'object' && field !== null) { - (field as Record).subField = true; + (field as Record).subField = true; } }); - if(withNoSubTableField){ - meta={ ...fields, ...subFields }; - }else{ - meta=subFields; + if (withNoSubTableField) { + meta = { ...fields, ...subFields }; + } else { + meta = subFields; } } return meta; } -export const isStringArray=(value:any)=>{ - if(Array.isArray(value) && value.every(x=>typeof x ==='string')){ +export const isStringArray = (value: any) => { + if (Array.isArray(value) && value.every((x) => typeof x === 'string')) { return true; } return false; -} \ No newline at end of file +}; diff --git a/vue-project/my-kintone-plugin/src/types/my-kintone.d.ts b/vue-project/my-kintone-plugin/src/types/my-kintone.d.ts index 5522815..688b52e 100644 --- a/vue-project/my-kintone-plugin/src/types/my-kintone.d.ts +++ b/vue-project/my-kintone-plugin/src/types/my-kintone.d.ts @@ -10,5 +10,5 @@ export type LinkProtocolType = 'WEB' | 'CALL' | 'MAIL'; export type SelectType = | KintoneFormFieldProperty.CheckBox | KintoneFormFieldProperty.RadioButton - | KintoneFormFieldProperty.DropDown + | KintoneFormFieldProperty.Dropdown | KintoneFormFieldProperty.MultiSelect; diff --git a/vue-project/my-kintone-plugin/vite.config.ts b/vue-project/my-kintone-plugin/vite.config.ts index 3ef5a2d..86a9543 100644 --- a/vue-project/my-kintone-plugin/vite.config.ts +++ b/vue-project/my-kintone-plugin/vite.config.ts @@ -26,8 +26,8 @@ function replaceKucTagsPlugin() { const keyPascal = key.split('-') .map(word => word.charAt(0).toUpperCase() + word.slice(1)) .join(''); - if(key==='multi-choice'){ - key='multichoice'; + if (key === 'multi-choice') { + key = 'multichoice'; } importScript += `import * as Kuc${keyPascal} from "kintone-ui-component/lib/${key}";` }); @@ -83,6 +83,6 @@ export default defineConfig({ assetFileNames: 'src/[ext]/[name].[ext]', }, }, - sourcemap: false, + sourcemap: 'inline', } })