diff --git a/vue-project/my-kintone-plugin/src/components/Config.vue b/vue-project/my-kintone-plugin/src/components/Config.vue index c68e512..d3cbd62 100644 --- a/vue-project/my-kintone-plugin/src/components/Config.vue +++ b/vue-project/my-kintone-plugin/src/components/Config.vue @@ -88,6 +88,7 @@ function save() { const convertJoinTables = JSON.parse(JSON.stringify(data.joinTables)) as JoinTable[]; convertJoinTables.forEach((item) => { const meta = getMeta(item.meta as Properties, item.table, true); + if (!meta) return; // Process onConditions item.onConditions.forEach((condition) => { diff --git a/vue-project/my-kintone-plugin/src/components/basic/conditions/TableConditionValueDateTime.vue b/vue-project/my-kintone-plugin/src/components/basic/conditions/TableConditionValueDateTime.vue index 2f3bc4e..e7dd993 100644 --- a/vue-project/my-kintone-plugin/src/components/basic/conditions/TableConditionValueDateTime.vue +++ b/vue-project/my-kintone-plugin/src/components/basic/conditions/TableConditionValueDateTime.vue @@ -104,11 +104,13 @@ const monthClassName = computed(() => { return ''; }); const shortConditionClass = computed(() => { - return funcValue.value !== dateFuncMap[''].value && - funcValue.value !== dateFuncMap['FROM_TODAY'].value && - funcValue.value !== dateFuncMap['NOW'].value - ? 'short datetime-condition-combobox' - : 'datetime-condition-combobox'; + const className = 'datetime-condition-combobox'; + if (isInput()) { return className } + if (isFromToday() || funcValue.value === dateFuncMap['NOW'].value) { + return className + ' mid'; + } else { + return className + ' short'; + } }); const regex = /^(?\w+)\((?.*)\)$/; @@ -138,9 +140,9 @@ watch( inputValue.value = ''; selectValue.value = value || DEFAULT_WEEK_MONTH; } else if (isFromToday() && !(before && isFromToday(before))) { - // only called when load page + // only called when first open page const split = value.split(', '); - inputValue.value = split[0].replace('-', ''); + inputValue.value = split[0] === '0' ? '' : split[0].replace('-', ''); selectValue.value = split[1] || fromOptions[0].value; additionSelectValue.value = split[0] ? (split[0].startsWith('-') ? '-' : '+') : '+'; } @@ -203,17 +205,11 @@ function buildFromTodayResult({ if (value?.match(/^-?[0-9]+$/)) { fromTodayError.value = ''; let res = value; - if (value && value !== '0') { - if (addition === '-') { - if (!value.startsWith('-')) { - res = '-' + res; - } else { - res = res.replace('-', ''); - } - } else if (addition === '+') { - if (value.startsWith('-')) { - res = res.replace('-', ''); - } + if (value && value !== '0' && addition === '-') { + if (value.startsWith('-')) { + res = res.replace('-', ''); + } else { + res = '-' + res; } } return funcValue.value.replace('%s', select).replace('%d', res); @@ -234,6 +230,8 @@ function buildResult({ func = funcValue.value, value }: Param) { if (isWeek(func) || isMonth(func)) { val = value || selectValue.value; val = val === DEFAULT_WEEK_MONTH ? '' : val; + } else if (isFromToday(func)) { + return func.replace('%d', val || '0').replace('%s', val || 'DAYS'); } return func.replace('%s', val || ''); } diff --git a/vue-project/my-kintone-plugin/src/css/config.css b/vue-project/my-kintone-plugin/src/css/config.css index 26562ef..f5e86f0 100644 --- a/vue-project/my-kintone-plugin/src/css/config.css +++ b/vue-project/my-kintone-plugin/src/css/config.css @@ -82,16 +82,22 @@ --kuc-combobox-toggle-width: max(16vw, 200px); } +.plugin-kuc-table .kuc-text-input { + --kuc-text-input-width: max(15vw, 200px); + --kuc-dropdown-toggle-width: max(15vw, 200px); + --kuc-combobox-toggle-width: max(15vw, 200px); +} + @media screen and (max-width: 1820px) { - .kuc-text-input { - --kuc-text-input-width: max(14vw, 200px); - --kuc-dropdown-toggle-width: max(14vw, 200px); - --kuc-combobox-toggle-width: max(14vw, 200px); + .plugin-kuc-table .kuc-text-input { + --kuc-text-input-width: max(13vw, 200px); + --kuc-dropdown-toggle-width: max(13vw, 200px); + --kuc-combobox-toggle-width: max(13vw, 200px); } } -@media screen and (max-width: 1740px) { - .kuc-text-input { +@media screen and (max-width: 1710px) { + .plugin-kuc-table .kuc-text-input { --kuc-text-input-width: max(12vw, 200px); --kuc-dropdown-toggle-width: max(12vw, 200px); --kuc-combobox-toggle-width: max(12vw, 200px); @@ -156,6 +162,9 @@ .datetime-condition-combobox { --kuc-combobox-toggle-width: 130px; } +.datetime-condition-combobox.mid { + --kuc-combobox-toggle-width: 112px; +} .datetime-condition-combobox.short { --kuc-combobox-toggle-width: 92px; } @@ -187,12 +196,12 @@ --kuc-combobox-toggle-width: 86px; } .from-today-input { - --kuc-text-input-width: 80px; - --kuc-combobox-toggle-width: 80px; + --kuc-text-input-width: 75px; + --kuc-combobox-toggle-width: 75px; } .from-today-input.input { - --kuc-text-input-width: 60px; - --kuc-combobox-toggle-width: 60px; + --kuc-text-input-width: 50px; + --kuc-combobox-toggle-width: 50px; } /* .from-today-input error */